How to Call frames in an external Flash movie

January 7, 2010

Actionscript 3.0 Tutorial

Calling frames in dynamic movie

Display frames of external swf file with gotoAndStop and gotoAndPlay commands

Minimum Flash Designer version 5.0.22.5.

Create main movie:

  1. Create a new document and set the size to 500 x 400 (“Frame” > “Frame Size”)
  2. Set “Frame 1″ to “Stop” (“Frame” > “Frame Delay” and check “Stop”, click OK)
  3. Draw a button and name it “Frame 1″ (double-click the button to rename it)
  4. Choose “Action” > “OnClick”, check “ActionScript” and type:submovie.gotoAndStop("Frame 1");
  5. Copy the button 2 times and rename the copies to “Frame 2″ and “Frame 3″
  6. Modify the actionscript for each button to submovie.gotoAndStop("Frame 2"); and submovie.gotoAndStop("Frame 3"); respectively
  7. Save the file for later as “mainmovie”

Now create the sub-movie:

  1. Create a new document and set the size to 400 x 250 (“Frame” > “Frame Size”)
  2. Set “Frame 1″ to “Stop” (“Frame” > “Frame Delay” and check “Stop”, click OK)
  3. Create text “Frame 1″ on Frame 1, copy the text to clipboard (“Edit” > “Copy”)
  4. Choose “Frame” > “New” twice to add Frame 2 and Frame 3
  5. Paste the text on Frame 2 and Frame 3 and modify it to “Frame 2″ and “Frame 3″ respectively.
  6. Save the file as “submovie” (“File” > “Save As”)
  7. Export the movie as submovie.swf and put it on your desktop (“File” > “Export Flash SWF File”)

Insert the submovie into mainmovie:

  1. Go back to main movie document window
  2. Choose “Insert” > “Flash”
  3. Type the file path “submovie.swf” (without quotes) and click OK
  4. Choose “Item” > “Placement Properties” and rename the item to “submovie” and check “ActionScript Target”, click OK
  5. Choose “Item” > “Resize” and resize the movie to 400 x 250 (uncheck “Keep proportions”)
  6. Export the main movie and put it on your desktop (“File” > “Export Flash SWF File”)
  7. Choose “File” > “Export Web Page”, the page should popup in a browser window
  8. Click “Frame” buttons to test the sub movie .

Note: the sub movie doesn’t work in preview mode, only in HTML page. The sub movie must be available at the same path as the main movie. You have to upload both swf file to your web site.

Download source code here

, , , , ,

3 Responses to “How to Call frames in an external Flash movie”

  1. forex robot Says:

    nice post. thanks.

Trackbacks/Pingbacks

  1. Remedies for External Hemorrhoids – Miracle Remedies for External Hemorrhoids - January 7, 2010

    [...] How to Call frames in an external Flash movie | Flash tutorial … [...]

  2. Tha Trackback » Blog Archive » How to Call frames in an external Flash movie | Flash tutorial … - January 9, 2010

    [...] Found this interesting post today, here is a quick excerpt of it: Tagged as: Calling frames, Calling frames in dynamic movie, dynamic movie, external Flash movie, Flash movie, How to Call frames Leave a comment. Comments (0) Trackbacks (1) ( subscribe to comments on this post ) … Read the rest of this great post Here [...]

Leave a Reply