My account
Shopping cart
Knowledge base
Support


Adding Actions for the Drop Down Menu V3



1. Open your Macromedia Flash software and create a new file (File/New/Flash Document). Drag a drop down menu on the stage from the Component window (Ctrl+F7 or Command+F7 on Mac).

2. If you can’t find the drop down menu component, please see the How to install a MXP file tutorial. If you have trouble configuring your drop down menu please see the How to find Help for Jumpeye components.

3. Before you continue with this tutorial, please read the Create a Simple Drop Down menu tutorial.

4. You can use functions with Drop Down Menu Pro v3. First, let’s see how to use functions to jump to a specific frame. Create a new layer where you will place the movieclip and another one for your actions. This is how your timeline should look like :



5. Select the drop down menu layer, go to frame 30 on your timeline and press F5 to insert frames for your menu to stay on the stage ‘till frame 30. Do the same thing for the movie clip and actions layer.

6. Select frame 30 on the movie clip layer, add a key frame to it (F6) and draw or write something (on frame 30). I’ve wrote “this is frame 30” as you can see in the image below.

This is how your stage and timeline should look like:



7. Now let’s add some actions script to the actions layer. This is what I added on the first frame of the actions layer:

stop();
function jump(frm):Void {
     gotoAndStop(frm);
}


8. Edit your xml file (or the supplied xml) like this

<?xml version='1.0' encoding='UTF-8'?>
<component name='Drop Down Menu v3'>
     <data>
          <main>
               <item title="Home" >
                    <item title="Jump to frame 30" function="jump(30)" />
                    <item title="Subtitle 2" />
                    <item title="Subtitle 3" />
               </item>
      ………….      ………….      ………….      ………….      ………….      ………….
    ………….      ………….      ………….      ………….      ………….      ………….
          </main>
     </data>
</component>


As you can see, I’ve added the function’s name (which has to be declared inside the fla file) and a parameter. In our case the frame number
Item Title – the title that is displayed on the main title bars or child bars
function - the function name you want to call when the item is clicked. This function must be declared in your fla file
In order to see the entire list of parameters that can be used in the xml file, please see the xml help file.

9. After this, press Ctrl+Enter to test your movie and is what you should get:



Loading an external swf file into an empty movieclip using the Drop Down Menu v3


1. You have to complete the “Adding Actions for the Drop Down Menu” tutorial before.

2. Please create first a swf movie and place it in the same folder with the xml and the fla which contains the Drop Down Menu component. My swf file is called test.swf

3. Inside the fla file which contains the drop down menu, create a new blank symbol (Insert/New Symbol or Ctrl+F8 / Command+F8 for Mac). Choose a name for the symbol and click ok.

4. Drag an instance of the blank symbol on the stage and set its instance name to target_mc. This symbol will be the placeholder where the external movie clip will be loaded.



5. Declare a new function on the first frame of the actions layer like this (below the jump function you already have) :

function loadMov(mov):Void {
     target_mc.loadMovie(mov);
}


6. Edit the xml file with this new function like this :

<?xml version='1.0' encoding='UTF-8'?>
<component name='Drop Down Menu v3'>
     <data>
          <main>
               <item title="Home" >
                    <item title="Jump to frame 30" function="jump(30)" />
                    <item title="Load external swf" function="loadMov(test.swf)" />
                    <item title="Subtitle 3" />
               </item>
      ………….      ………….      ………….      ………….      ………….      ………….
          </main>
     </data>
</component>


7. Save the xml file, then return to Flash and test the movie. When you click Home/Load external swf your external movie clip should be loaded



Download the source files for this tutorial