First time here? First time here? Newsletter Signup Newsletter
Search tutorials
Author: ben david bennett | Website: http://www.synaptology.com
//### 2. Initialize movie###
attachMovie("holderMovie", "holderMovie", 0);
_root.holderMovie._y = halfStageHeight;
_root.holderMovie._x = stageWidth/2;

for (var i=0; i<%lt%> 2; i++) {
    _root.holderMovie.attachMovie("menuMovie", "menuMovie" + i, i);
    _root.holderMovie["menuMovie"+i]._x -= i*actualClipWidth;

The Initialize movie section provides the inital set-up for the movie clips. First the empty clip, "holderMovie" is placed on the stage using the attachMovie() method. This method takes 3 arguments, attachMovie(identifier, newName, depth), which indicate the identifier given to the movie when we linked the symbol (see above), the new name for the movie clip instance and the depth of the clip in the programmatically generated clip stack. The clip is then centered on the stage by setting the _x and _y values of the clip according to the midpoints of the stage dimensions. A for() loop is then used to generate 2 instances of the menu movie symbol (again using the attachMovie() method). Because the attachMovie() method is used within another movie clip (holderMovie) the first instance (menuMovie0) is aligned to the registration point of the holderMovie clip instance. The second instance (menuMovie1) is aligned to the left of the first instance to provide a seamless pair of clips.

» 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.