Flash tutorials
Home 3D (2) Actionscripting (66) Animation (108) Audio (4) Drawing (7) Full flash sites (4) Getting Started (15) Navigation (25) Special Effects (61) Text Effects (38)

Picture displaying from the library on the stage by action script

6.3.2008, 12:26    Total views: 30448

See this tutorial and learn how to load and display a picture from the Library on stage using the action script code and some special flash tricks.

Step 1

First of all, find any picture which you like to use for this tutorial.



Step 2


Go back on flash. Choose File > Import > Import to Library and import any picture into a flash library.



Step 3

Choose now right click on the picture in the Flash Library and select Linkage. See the picture below.



After that, in the windows that is just appear,choose the following options like it is shown on the picture below.



Step 4

It's time for action script code. Select the first frame and open the Actio Script Panel (F9). After that, enter the following action script code inside the actions panel:

import flash.display.BitmapData;
var fill:BitmapData = BitmapData.loadBitmap("picture");
this.beginBitmapFill(fill);
this.lineTo(Stage.width, 0);
this.lineTo(Stage.width, Stage.height);
this.lineTo(0, Stage.height);
this.lineTo(0, 0);
this.endFill(20);

Test your Movie (Ctrl+Enter)

We're done!

Download source file (.fla)

Have questions about this tutorial?
Visit our friendly Community Forums!
Digg it! Add this tutorial to del.icio.us! Furl it! Add this tutorial to reddit! Spurl it! Add this tutorial to technorati!

Top tutorials

1. Advanced full flash site - Part 1
Total views: 294945

2. High-tech city animation
Total views: 244815

3. Water effect
Total views: 226080

4. Photo slide show
Total views: 208597

5. Special Picture Effect
Total views: 184175



Related links