First time here? First time here? Newsletter Signup Newsletter
Search tutorials
Author: ben david bennett | Website: http://www.synaptology.com

2. The following script was added to Frame 1 of the Frame Actions box of the main time line.

//### 1. Variables###
var stageWidth = 200;
var stageHeight = 145;
var halfStageHeight =stageHeight/2;

var speed = 0;
var scale = 1;

var maxScaleFactor = 4;
var minScaleFactor = 0.5;

var clipWidthNow = 1303.0
var actualClipWidth = 1303.0;

var left2Right = false;
var right2Left = false;

var bigger = false;
var smaller = false; 

Here we declare a series of variables. The stage width and height are manually declared as there is no explicit method to retrieve these values. The speed and scale variables are initialized to 0 and 1, respectively so that the movie is initially stationary and not being scaled. The max and minScaleFactor set how large and small, respectively the menu can be scaled relative to the original dimensions of the menu movie. The variable clipWidthNow is used to track the current size of the menu, whereas actualClipWidth is the width of the menu movie symbol in pixels. This can be retrieved programmatically but I found that there was a slight discrepancy (0.95 pixels) between the actual value and the programmatically retrieved value. Although the difference is not large it is enough to mess up the alignment of the menu movie clips. The next 4 variables, left2Right, right2Left, bigger and smaller are Boolean values which indicate the direction of movement of the menu movie clip and the scaling and are all initialized to false.

» Level Intermediate

Added: 2001-07-23
Rating: 7 Votes: 52
(10 being the highest)
» Author
No details available.
» Download
Download the files used in this tutorial.
» Forums
More help? Search our boards for quick answers!


  • There are no comments yet. Be the first to comment!

  • You must have javascript enabled in order to post comments.

Leave a Comment
  • Your email address will not be published. All fields are required.
Featured Flash FLA
» Author: Inocreato
» Title: RaiseTheBlocks
» Description: Raise all the blocks to win the game
Featured Sound Loops
Image for equalize

Audio Player

» Author: TomCat Carty
» Title: The Wood
» Description: Just a little game ending or it can maybe be looped. Recorders with music box and percussion to give the feel of well, I don't know, the woods? Free to use, just credit me. thank you
Latest Font
» Author: Fábio FAFERS
» Description: I created this font for free use. Everyone can apply it in personal or business texts. Its free, but I want to be communicated in case of business use. Donations are accepted to keep the project of free fonts alive! Thank you all
Featured Sound Fx
Image for equalize

Audio Player

» Author: Davisigner
» Description: Hmm... what to say about this one? It's reminiscent of the closing notes of the opening music from the Three Stooges done in a church organ style with a closing cymbal crash. I'll give this one away gratis, but feel free to check out my free loops and potential upcoming license-mandated ones over in the respective part of Flashkit.