Example:
Hit mouse click over the example!
Step 1
First, save the image below!

Step 2
Create a new flash document. Press Ctrl+J key on the keyboard (Document Properties) and set the width of your document to 400 pixels and the height to 300 pixels. Select white as background color. Set your Flash movie's frame rate to 40 and click ok.

Step 3
Call the current layer image. Double-click on its default name (Layer 1) to change it. Press Enter once you have typed in the new name!
Step 4
Choose now File > Import > Import to stage (Ctrl+R) and import the image that you saved in step 1!
Step 5
While the image is still selected, press F8 key (Convert to Symbol) to convert it into a Movie Clip Symbol.

Step 6
Go now to the Flash Library (Ctrl+L), choose right click on image_mc and select Linkage.

Step 7
In the Linkage Properties window, select Export for ActionScript and for Class type CoolImage. See the picture below!

click now ok.
Don’t worry about the ActionScript Class Warning. Just click ok!
Step 8
Select now image on the stage and hit delete key on the keyboard to delete it!
Step 9
Select the first frame now and go to the Action Script Panel (F9). Then, enter this code inside the actions panel:
function Main() {
stage.addEventListener(MouseEvent.CLICK, AddImage);
}
Main();
function AddImage(e:MouseEvent):void {
var newImage:CoolImage = new CoolImage();
this.addChild(newImage);
Step 1
First, save the image below!

Step 2
Create a new flash document. Press Ctrl+J key on the keyboard (Document Properties) and set the width of your document to 400 pixels and the height to 300 pixels. Select white as background color. Set your Flash movie's frame rate to 40 and click ok.

Step 3
Call the current layer image. Double-click on its default name (Layer 1) to change it. Press Enter once you have typed in the new name!
Step 4
Choose now File > Import > Import to stage (Ctrl+R) and import the image that you saved in step 1!
Step 5
While the image is still selected, press F8 key (Convert to Symbol) to convert it into a Movie Clip Symbol.

Step 6
Go now to the Flash Library (Ctrl+L), choose right click on image_mc and select Linkage.

Step 7
In the Linkage Properties window, select Export for ActionScript and for Class type CoolImage. See the picture below!

click now ok.
Don’t worry about the ActionScript Class Warning. Just click ok!
Step 8
Select now image on the stage and hit delete key on the keyboard to delete it!
Step 9
Select the first frame now and go to the Action Script Panel (F9). Then, enter this code inside the actions panel:
function Main() {
stage.addEventListener(MouseEvent.CLICK, AddImage);
}
Main();
function AddImage(e:MouseEvent):void {
var newImage:CoolImage = new CoolImage();
this.addChild(newImage);
newImage.x = mouseX;
newImage.y = mouseY;
newImage.scaleX = 0;
newImage.scaleY = 0;
newImage.alpha = 0;
newImage.addEventListener(Event.ENTER_FRAME, ZoomImage);
}
function ZoomImage(e:Event):void {
var imageMC:MovieClip = MovieClip(e.target);
imageMC.scaleX += .05;
imageMC.scaleY += .05;
if (imageMC.scaleX < 4) {
imageMC.alpha += .05;
} else {
imageMC.alpha -= .05;
if (imageMC.alpha < .8) {
imageMC.removeEventListener(Event.ENTER_FRAME, ZoomImage);
}
}
}
We're done now!
Test your Movie and enjoy!
Download source file (.fla)
discuss this topic to forum
