My account
Shopping cart
Knowledge base
Support


Adding Actions for the Accordion Tree Menu



1. Open your Adobe Flash CS3 software and create a new file (File/New/Flash Document). Drag an accordion tree menu on the stage from the Component window (Ctrl+F7 or Command+F7 on Mac).

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

3. Before you continue with this tutorial, please read the Create a simple Accordion Tree menu tutorial.

4. You can use functions with Accordion Tree 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 accordion tree 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){
     gotoAndStop(frm);
}


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

<?xml version='1.0' encoding='UTF-8'?>
<component name=Accordion Tree Menu v3'>
     <data>
          <main>
               <item title="Home" >
                    <item title="Subtitle 1" itemHeight="20" >
                         <item title="Subtitle 1" />
                         <item title="Jump to frame 30" function = "jump(30)" />
                         <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
item height – the height oh the item
In order to see the entire list of parameters that can be used in the xml file, please see the xml help page.

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 Accordion Tree Menu v3


1. You have to complete the “Adding Actions for the Accordion Tree 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 Accordion Tree Menu component. My swf file is called test.swf

3. Inside the fla file which contains the accordion tree 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 {
     var ldr:Loader = new Loader();
     var url:URLRequest = new URLRequest(mov);

     ldr.load(url);
     target_mc.addChild(ldr);
}


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

<?xml version='1.0' encoding='UTF-8'?>
<component name=Accordion Tree Menu v3'>
     <data>
          <main>
               <item title="Home" itemHeight="22">
    ………….      ………….      ………….      ………….      ………….
                    <item title="News" itemHeight="20">
                         <item title="Subtitle 1" />
                         <item title="Load external swf" function="loadMov(test.swf)" itemHeight="30"/>
                         <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/News/Load external swf your external movie clip should be loaded