0% found this document useful (0 votes)
27 views2 pages

Zoom in & Zoom Out

The document provides steps to create a zoom tool in Flash using ActionScript code. It describes importing images and buttons, then attaching code to the buttons to zoom in, zoom out, and reset the image on click. The zoom in/out code changes the image's scale, while reset sets the image size and position.

Uploaded by

SAT1243
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views2 pages

Zoom in & Zoom Out

The document provides steps to create a zoom tool in Flash using ActionScript code. It describes importing images and buttons, then attaching code to the buttons to zoom in, zoom out, and reset the image on click. The zoom in/out code changes the image's scale, while reset sets the image size and position.

Uploaded by

SAT1243
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

Zoom In & Zoom Out Step 1: Import image to stage and give the instance name as controlme.

Step 2: Import 3 new buttons for zoom-in, Zoom-out, and reset and convert them into buttons. Step 3: Select zoom-in button press f9 and it opens the actionscript window. Step 4: Copy the following code there.
on (press) { _root.controlme._xscale = _root.controlme._xscale + 4; _root.controlme._yscale = _root.controlme._yscale + 4; } on (release, releaseOutside) { _root.StoredActions.gotoAndStop(1); }

Step 5: Select Zoom-out button and open action script window. Copy the code there.
on (press) { //_root.StoredActions.gotoAndPlay("decrease"); _root.controlme._xscale = _root.controlme._xscale - 5; _root.controlme._yscale = _root.controlme._yscale - 5; } on (release, releaseOutside) { _root.StoredActions.gotoAndStop(1); }

Step 6: Select reset button and copy the code there.


on (press) { controlme._width = 100; controlme._height = 100; controlme._x = 10; controlme._y = 10; }

Now run the application it works.

Hope this will be helpful to many of us. Good luck, For more details click http://www.sumudra.com zoom tool: http://www.sumudra.com/tutorials/drag/zoom.rar

You might also like