Macromedia Flash - Zoom in / Zoom out with the button

This exercise will show you how to create a zoomed in and out Movie Clip using the buttons and Action Script in flash 8.

This exercise will show you how to create a zoomed in and out Movie Clip using the buttons and Action Script in flash 8.

Step 1

Create a new flash file, select the Line Tool (N) and draw 'star' as shown below.

Picture 1 of Macromedia Flash - Zoom in / Zoom out with the button

Step 2

Press Ctrl + A and then F8 key on the keyboard to convert 'star' into Movie Clip.

Picture 2 of Macromedia Flash - Zoom in / Zoom out with the button

Step 3

When the new Movie Clip ('star') is still selected, open the Properties Panel (Ctrl + F3) and enter 'star'.

Picture 3 of Macromedia Flash - Zoom in / Zoom out with the button

Step 4

Click Window > Components to open the Components Panel.

Step 5

Then from Components Panel select Button and use the drag-and-drop operation to do the following

Picture 4 of Macromedia Flash - Zoom in / Zoom out with the button

Step 6

When your button is still selected, from the Properties Panel , enter ButtonDecrease

Step 7

Select the button and press Ctrl + D on the keyboard to duplicate the object.

Step 8

On the newly duplicated Button object, change the name to ButtonIncrease.

Step 9

Add a new layer with the name Action.

Picture 5 of Macromedia Flash - Zoom in / Zoom out with the button

Step 10

Click on the first frame of the layer Action, open the Action Script Panel (F9) and enter the following script:

ButtonIncrease.onRelease = function (): Void {
with (star) {
_xscale + = 7;
_yscale + = 7;
}
};

ButtonDecrease.onRelease = function (): Void {
with (star) {
_xscale - = 7;
_yscale - = 7;
}
};

Press Ctrl + Enter to preview the product and download the complete file here if you don't have time to practice.

Update 25 May 2019
Category

System

Mac OS X

Hardware

Game

Tech info

Technology

Science

Life

Application

Electric

Program

Mobile