O'Reilly logo

ActionScript Graphing Cookbook by Peter Backx, Dominic Gélineau

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Loading a file from the local hard drive

In the previous recipe, we've already seen one way of loading a file from the hard drive through relative URLs. There are a few shortcomings to that approach though, as follows:

  • If the Flash application is on a website, you cannot use the URLLoader class to load a file from the user's hard drive
  • Even if this was possible, we'd need to implement something so that the user can choose which file to load

In this recipe, we will demonstrate how to use a file dialog to let the user select which file to show.

Getting ready

Again, copy and paste the previous recipe's code into a new class called Recipe3. Rename the class name and the constructor and remove the three lines that create and start the URL loader. Leave ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required