Your Ad Here

December 31, 2009

Loading External Image by Using Components in Flash

Name : Loading External Image by Components
Category : Advanced

Actionscript : 2.0

In Macromedia we can load external Images (like .jpg files) by using built in Components. We can also load it using Movie clip but here we will discuss about Loading it by Components only.

1- Open up Macromedia Flash and create a new file.

2- Open the Components window : Window> Components (shortcut: Ctrl+F7)

3- Expand the “User Interface” Menu by clicking on it.

4- Then locate the “Loader” component and Drag n Drop it on to the stage.













5- The Image file you are going to load in this movie should be placed in the same folder or Directory.


6- When you will select the Loader component on the stage you will see in the bottom of the screen the Properties Tab, beside that you will see Filters and Parameters Tab. Select the Parameters Tab.







7- Here you will see Three Properties:


      -autoLoad: To set that the Image should be automatically loaded or not

     -ContentPath: The path of the content you are going to load (if the content is in the same folder we will write the file name only)

    -scaleContent: To set that the Image loaded should be scaled to the width and height of the component or not


8- Set the “autoLoad” to “true” and “scaleContent” to “true”.


9- Write the name of the Image file in the “ContentPath”, like we are using “sample.jpg”.

10- All done, now test the movie clip by pressing Ctrl+Enter.

*Note: You can set the Properties from the Parameters Tab like if you don’t want to scale the Image, just set the “scaleContent” to “false”

No comments:

Post a Comment

Please use sensible language.....!