In this article using Flash Actionscript 3, we will demonstrate a very easy way to load a sprite with a bitmap.
It will show you how you can simply add an image to your flash library, programatically create a sprite, attach the image to that sprite and display it on the screen. This will be done programatically instead of using the timeline.
Once you are able to understand how this is done, you can then take the sprite and manipulate it in your flash application. It is very useful to do things through actionscript vs. the timeline at times because it keeps your project cleaner and easier to manage especially if you have many, many images that you want to manipulate. Several properties of sprites include X and Y coordinates, fading in and out, rotating and resizing. Flash has very intuitive ways of allowing you to do this.
But first, lets start with an example on how to create a sprite:
|
|