Flash AS2 Tutorial – Loading External SWF files

Posted: July 15, 2010 in Adobe Flash, Design, Internet, Tutorial
Tags: , , ,

Loading external pages into MovieClip symbols

also

Loading external SWF’s into blankMC’s from a navigation/menu SWF

  1. Let’s start this one by opening the Top SWF created in the last tutorial.
  2. As you will remember I made three buttons whose _visible property was switched on and off according to what was rolled over. I am going to use those same three buttons in this tutorial. They were called:

HistCurrent_btn     for current history

HistOld_btn         for old history

HistROld_btn          for really old history

  1. So that you have something to load that resembles the buttons purpose I have used the ‘Save As’ option on my ‘Body’ default page and saved three other pages as ‘BodyCurrent.fla’, ‘BodyOld.fla’ and ‘BodyReallyOld.fla’.

  1. Now, you need to go back to the Top.fla file and get ready to make the buttons work for you.

    Start with the button for Current history. First click on the Actions Layer and open the actions property panel. Now enter this code:

  1. So that you can understand what this code means think of it as the following,

    For the button called ‘HistCurrent_btn’ wait for things to happen. When the mouse button is released on the button (onRelease), go and perform an operation (function) of what it told inside of the curly swirly brackets. (loadMovie(“BodyCurrent.swf”,_root.bodyBlank_mc);).

  2. The next two buttons are a repeat of the same instructions. If you do the same correctly your code should look like:

  1. Now it time to test if what you have done works. Start by making sure you have made the SWF for each of the files you want to load. If in doubt open each one and press “CTRL+ENTER”.
  2. Now go to the Container file and open it. Use it to test the other files. The reason for this is that it is the file that contains the Blank Movie Clips that are needed for the code you just wrote to work.

Problem Solving Tips: – if it doesn’t work

  • Check that code for all of the buttons has the names of the files typed EXACTLY as they are saved.
  • Check that the files are in the same folder
  • Check that you have made the SWF files for each of the FLA files you have created
  • Check that the name of the buttons is the same as what you have specified in the Actions panel.
  • Check that all the code is ONLY in the ACTIONS LAYER.
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s