Monday 15 February 2010

How to load an image from flash library? -


I am developing an advertisement that includes the zooming effect on mouse hover. Currently it is loading an external image that is placed in the same folder.

What do I want to do: I have to load the image from my flash library. Can anyone help me out quickly in this?

In the Action Script, the Loader class is a display object, so that you can do the following:

  var imageLoader: loader = new loader (); Var Image: URLRequest = New URLRequest ("path / to / image.format"); ImageLoader.load (image); AddChild (imageLoader); ImageLoader.x = 200; ImageLoader.y = 300;   

Note that you will need to import your appropriate classes (see AS3 Docs and view the above mentioned sections and use the relevant import statement) and that the URLRequest manufacturers exported them. The SSFF is relative to the file and is not in your source folder.

Good luck!

No comments:

Post a Comment