Import an image to the flash project library.
This is easily done by selecting "File"
-> "Import to Library"
Once it is imported, you can see the image in your library by selecting "Window" -> "Library" from the main menu.
From there, you would want to "Right Click"
the image and select "Linkage"
Once the linkage window appears as shown below, you will need to give the image a "Class"
In this case we named it "atkbr_jpg"
. Keep in mind that we are not using any spaces and no periods.
If we want a placeholder for clarity, we use an underscore (_).
We also check the box that says "Export for Actionscript"
and "Export in First Frame"
Click the mouse on the first frame in the timeline and press F9
This will bring up the actionscript window. Proceed to enter the actionscript as shown. In this example we first create an empty sprite.
we then create a bitmap_data and assign it the same name as the image class name with dimensions. In this example, the image size is 168 x 152.
We create a new bitmap and assign it the bitmap data and then we attach the bitmap to the sprite and the sprite to the stage.
Once it is on the stage, it will be visible when you run it.
And there you have it, a simple example on how to create a sprite.
You can download the flash file by clicking here!