Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Accordion Menu Need Some Help



hello everyone . i have to make a accordion menu for a client and i have never used the accordion component. is that the best way to go about it or is there another way that is easier and nicer looking? thankskool



KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 03-01-2007, 04:16 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Accordion Menu Pro V1
help!!! need example code to load external swf 's using just purchashed accordion menu pro v1. Also how to make menu with 5 title bars with 5 sub menus under each one. Each sub menu button selects and loads a differant external swf or jpg. I want the menus to unfold the way they do at the jumpeye website here http://store.jumpeye.com/accmenu/index.html. Need specifics on how to do it ?

Accordion Menu Pro V1
help!!! need example code to load external swf 's using just purchashed accordion menu pro v1. Also how to make menu with 5 title bars with 5 sub menus under each one. Each sub menu button selects and loads a differant external swf or jpg. I want the menus to unfold the way they do at the jumpeye website here http://store.jumpeye.com/accmenu/index.html. Need specifics on how to do it ?

[F8] Accordion Menu Help
Hi everyone please look at the following file to help me fix this horizontal accordion menu:
accordion_test.fla

When you first play the movie without rolling the mouse over any of the squares the starting position of all three squares is good. But when you start rolling the mouse over not everything is perfect.

I need help perfecting this please.

If you place the mouse to the right edge of the purple square before touching the blue square it actually opens up the blue square.. I think this is because of the invisible button that is on the blue square over lapping the purple. The same thing happens for the green square when putting the cursor close to the left edge inside the green it triggers the blue to open.

If you roll over and out just on the blue square several times it changes to two different positions. I just want the squares to go back to starting position when rolled out..

I hope this makes sense!

Please can someone advise me on how to get this working?!

Accordion Menu Help
Hi friends
I was looking for a accordion menu
http://www.flashden.net/item/dynamic...dion-menu/1359

Any idea or tutorials how to make this xml based cool menu??

Xml Accordion Menu Help
I am using this accordion menu where i am unable to link the root level link.

Flash
Frame 1 :

PHP Code:



//Load XML Data
function loadXML(loaded) {
    if (loaded) {
        xmlNode = this.firstChild;
        categoryName = [];
        subNum = [];
        total = xmlNode.childNodes.length;
        for (i=0; i<total; i++) {
            categoryName[i] = xmlNode.childNodes[i].attributes.Name;
            subNum[i] = xmlNode.childNodes[i].childNodes.length;
        }
        gotoAndStop(2);
    } else {
        trace("Error loading XML");
    }
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("menu.xml");
stop(); 




Frame 2:

PHP Code:



//Get button height
bttnHeight = this.lev1_mc.lev1_bttn._height
//Build first level buttons
for (i=0; i<total+1; ++i) {
    this.lev1_mc.lev1_bttn.duplicateMovieClip("lev1_bttn"+i, i);
    this.lev1_mc["lev1_bttn"+i]._y = bttnHeight*i;
    this.lev1_mc["lev1_bttn"+i].originY = this.lev1_mc["lev1_bttn"+i]._y;
    this.lev1_mc["lev1_bttn"+i].destY = this.lev1_mc["lev1_bttn"+i]._y;
    this.lev1_mc["lev1_bttn"+i].ID = i;
    this.lev1_mc["lev1_bttn"+i].bttnName = categoryName[i];
    this.lev1_mc["lev1_bttn"+i].subNum = subNum[i];
    if (i == total) {
        this.lev1_mc["lev1_bttn"+i]._visible = false;
    }
    //Apply Accordion Script to each button
    this.lev1_mc["lev1_bttn"+i].onEnterFrame = function() {
        menuScript(this);
    };
    //Build second level buttons
    for (j=0; j<subNum[i]; ++j) {
        this.lev1_mc["lev1_bttn"+i].lev2_mc.lev2_bttn.duplicateMovieClip("lev2_bttn"+j, j);
        this.lev1_mc["lev1_bttn"+i].lev2_mc["lev2_bttn"+j]._y = bttnHeight+bttnHeight*j;
        this.lev1_mc["lev1_bttn"+i].lev2_mc["lev2_bttn"+j].bttnName = xmlNode.childNodes[i].childNodes[j].attributes.Name;
        this.lev1_mc["lev1_bttn"+i].lev2_mc["lev2_bttn"+j].link = xmlNode.childNodes[i].childNodes[j].attributes.Link
    }
}

//Set tween amount here
tween = 3
//Accordion Script function
function menuScript(object) {
    object._y += (object.destY-object._y)/tween
    if (selectedID>=object.ID) {
        object.lev2_mc._visible = true;
        object.mask_mc._height = this.lev1_mc["lev1_bttn"+(object.ID+1)]._y-object.originY+2;
    } else {
        object.lev2_mc._visible = false;
    }
    if (clicked == object._name) {
        object.lev2_mc._visible = true;
        object.icon_mc.gotoAndStop(2);
        object.destY = object.originY;
    } else {
        object.icon_mc.gotoAndStop(1);
        if (this.lev1_mc[clicked]._y<object._y) {
            object.destY = object.originY+moveTo-bttnHeight-1;
        } else {
            object.destY = object.originY;
        }
    }
}
// Function for linking (target URL or movieclip frame label)
_global.linkAction = function(object) {
    //Target a URL on press
    getURL(object.link, "_blank")
    //Target frame labels within a movieclip on press
    //_root.content_mc.gotoAndStop(object.link)
}
// Function for button selection
function clickAction(object) {
    selectedID = object.ID;
    moveTo = object._height;
    if (clicked == object._name) {
        clicked = "";
    } else {
        clicked = object._name;
    }
}
stop(); 




XML:


PHP Code:



<?xml version="1.0" encoding="iso-8859-1"?>
<Menu>
    <Flash Name="Flash">
        <Item Name="Animations" Link="#"/>
        <Item Name="Menus and Buttons" Link="#"/>
        <Item Name="Preloaders" Link="#"/>
        <Item Name="Site Templates" Link="#"/>
        <Item Name="Applications and Utilities" Link="#"/>
    </Flash>
    <Audio Name="Audio">
        <Item Name="Music" Link="#"/>
        <Item Name="Sound" Link="#"/>
    </Audio>
    <Video Name="Video">
        <Item Name="Video Loops" Link="#"/>
        <Item Name="Video Effects" Link="#"/>
    </Video>
    <Fonts Name="Fonts">
        <Item Name="Sans-Serif" Link="#"/>
        <Item Name="Serif" Link="#"/>
        <Item Name="Display Fonts" Link="#"/>
    </Fonts>
</Menu>



The sub level links works fine.
But I want to link the root level xml, example :
<Flash Name="Flash"> «---- How can i link to an URL??
if i put this <Flash Name="Flash" Link="#" /> it doesn't work

can some one help me??

Menu Accordion Help
Hey, Im switching over to AS3 and I have this project XML list. Flash loads the xml nodes into flash and into 2 alternating color backgrounds. Actually that is of no relevance. But what I'm stuck with is this..

The list is loading great, and on MOUSE_OVER I have another movieclip being added to the stage off to the side. A few things on the project parameters got changed around and now I must make this mouse over movieclip appear on click, inside the xml menu directly below the item that was clicked. So I was thinking "accordion" but to do this, I must move the objects below the current item down, to make room for this 2nd level information inside the list. I am drawing a blank on how to do this.

I welcome any suggestions, and thanks in advance.

Accordion Menu
How do I create an accordion menu? I have been trying with the component that comes with Flash CS3 but haven´t been able to customize it the way I want.

Any advice?

Help On Accordion XML Menu
Hi everybody, I'm desperately trying to emulate the accordion-to-text menu as seen on www.posttool.com.

1) I've tried to have my accordion opening dynamically upon text file lenght but I didn't.

2) Also I can't make the script load the xml text content (with html tags) from another xml file.
I want menu.xml to give my buttons a NAME and a CONTENT picked up from another xml.










Attach Code

<?xml version="1.0"?>
<MENU>
<MENU NAME="Services">
<MENU CONTENT="text/services.xml" />
</FOLDER>
</MENU>

























Edited: 08/31/2007 at 02:11:48 AM by Daniele Saguto

Help On XML Accordion Menu
Hi everybody, I'm desperately trying to emulate the accordion-to-text menu as seen on www.posttool.com.

1) I've tried to have my accordion opening dynamically upon text file lenght but I didn't.

2) Also I can't make the script load the xml text content (with html tags) from another xml file.
I want menu.xml to give my buttons a NAME and a CONTENT picked up from another xml.









Attach Code

<?xml version="1.0"?>
<MENU>
<MENU NAME="Services">
<MENU CONTENT="text/services.xml" />
</FOLDER>
</MENU>

Accordion Menu
i know that there are many of these threads around, and i have read most of them but none really explain anything properly.

i would like to know how to build an accordion menu, but with out the use of the component in Flash Pro 2004.

If any one would care to post a step by step (im a n00b ) guide on how to make a horizontal accordion, i would really apprecitate it. Or if you could link me to one.


Thanks.

Any One Have A Tut On Accordion Menu's?
Hello everyone im looking for a tutorial on how to create an accordion menu with out using the accordion component. If anyone knows of a good one please pass it along

thanks,
kool

Accordion Menu
Hello,

I was wondering if someone could help me out with creating a accordion menu. I need one that goes horizontal, on the image u see an example of what Im trying to reach.

Does anyone know a good tut or has a fla file?


Thx,

Accordion Menu Help
Hi friends
I was looking for a accordion menu
http://www.flashden.net/item/dynamic...dion-menu/1359

Any idea or tutorials how to make this xml based cool menu??

Xml Accordion Menu Help
I am using this accordion menu where i am unable to link the root level link.

Flash
Frame 1 :

PHP Code:



//Load XML Datafunction loadXML(loaded) {    if (loaded) {        xmlNode = this.firstChild;        categoryName = [];        subNum = [];        total = xmlNode.childNodes.length;        for (i=0; i<total; i++) {            categoryName[i] = xmlNode.childNodes[i].attributes.Name;            subNum[i] = xmlNode.childNodes[i].childNodes.length;        }        gotoAndStop(2);    } else {        trace("Error loading XML");    }}xmlData = new XML();xmlData.ignoreWhite = true;xmlData.onLoad = loadXML;xmlData.load("menu.xml");stop(); 




Frame 2:

PHP Code:



//Get button heightbttnHeight = this.lev1_mc.lev1_bttn._height//Build first level buttonsfor (i=0; i<total+1; ++i) {    this.lev1_mc.lev1_bttn.duplicateMovieClip("lev1_bttn"+i, i);    this.lev1_mc["lev1_bttn"+i]._y = bttnHeight*i;    this.lev1_mc["lev1_bttn"+i].originY = this.lev1_mc["lev1_bttn"+i]._y;    this.lev1_mc["lev1_bttn"+i].destY = this.lev1_mc["lev1_bttn"+i]._y;    this.lev1_mc["lev1_bttn"+i].ID = i;    this.lev1_mc["lev1_bttn"+i].bttnName = categoryName[i];    this.lev1_mc["lev1_bttn"+i].subNum = subNum[i];    if (i == total) {        this.lev1_mc["lev1_bttn"+i]._visible = false;    }    //Apply Accordion Script to each button    this.lev1_mc["lev1_bttn"+i].onEnterFrame = function() {        menuScript(this);    };    //Build second level buttons    for (j=0; j<subNum[i]; ++j) {        this.lev1_mc["lev1_bttn"+i].lev2_mc.lev2_bttn.duplicateMovieClip("lev2_bttn"+j, j);        this.lev1_mc["lev1_bttn"+i].lev2_mc["lev2_bttn"+j]._y = bttnHeight+bttnHeight*j;        this.lev1_mc["lev1_bttn"+i].lev2_mc["lev2_bttn"+j].bttnName = xmlNode.childNodes[i].childNodes[j].attributes.Name;        this.lev1_mc["lev1_bttn"+i].lev2_mc["lev2_bttn"+j].link = xmlNode.childNodes[i].childNodes[j].attributes.Link    }}//Set tween amount heretween = 3//Accordion Script functionfunction menuScript(object) {    object._y += (object.destY-object._y)/tween    if (selectedID>=object.ID) {        object.lev2_mc._visible = true;        object.mask_mc._height = this.lev1_mc["lev1_bttn"+(object.ID+1)]._y-object.originY+2;    } else {        object.lev2_mc._visible = false;    }    if (clicked == object._name) {        object.lev2_mc._visible = true;        object.icon_mc.gotoAndStop(2);        object.destY = object.originY;    } else {        object.icon_mc.gotoAndStop(1);        if (this.lev1_mc[clicked]._y<object._y) {            object.destY = object.originY+moveTo-bttnHeight-1;        } else {            object.destY = object.originY;        }    }}// Function for linking (target URL or movieclip frame label)_global.linkAction = function(object) {    //Target a URL on press    getURL(object.link, "_blank")    //Target frame labels within a movieclip on press    //_root.content_mc.gotoAndStop(object.link)}// Function for button selectionfunction clickAction(object) {    selectedID = object.ID;    moveTo = object._height;    if (clicked == object._name) {        clicked = "";    } else {        clicked = object._name;    }}stop(); 




XML:


PHP Code:



<?xml version="1.0" encoding="iso-8859-1"?><Menu>    <Flash Name="Flash">        <Item Name="Animations" Link="#"/>        <Item Name="Menus and Buttons" Link="#"/>        <Item Name="Preloaders" Link="#"/>        <Item Name="Site Templates" Link="#"/>        <Item Name="Applications and Utilities" Link="#"/>    </Flash>    <Audio Name="Audio">        <Item Name="Music" Link="#"/>        <Item Name="Sound" Link="#"/>    </Audio>    <Video Name="Video">        <Item Name="Video Loops" Link="#"/>        <Item Name="Video Effects" Link="#"/>    </Video>    <Fonts Name="Fonts">        <Item Name="Sans-Serif" Link="#"/>        <Item Name="Serif" Link="#"/>        <Item Name="Display Fonts" Link="#"/>    </Fonts></Menu>



The sub level links works fine.
But I want to link the root level xml, example :
<Flash Name="Flash"> «---- How can i link to an URL??
if i put this <Flash Name="Flash" Link="#" /> it doesn't work

can some one help me??

Accordion Menu
i know that there are many of these threads around, and i have read most of them but none really explain anything properly.

i would like to know how to build an accordion menu, but with out the use of the component in Flash Pro 2004.

If any one would care to post a step by step (im a n00b ) guide on how to make a horizontal accordion, i would really apprecitate it. Or if you could link me to one.


Thanks.

Help, Someone, Anyone Accordion Menu.
Hi,

Well here goes, i'm having a real problem trying to create an 'accordion' like menu in flash 8, I recently bout the 'Accordion menu pro' from jumpeye, after spending hours and hours trying to create my own i thought this would be it.

But here's where the problem is, they use simple images for the mouse over etc instances of the mouse, however i have movie clips that have buttons in them that tell the individual movie clip to do its stuff (on mouse over etc play frame 8 which animates the movie.) A couple of friends have looked at this and say I can't use movie clips with this accordion menu.

Ok, so I have 5 menu items, and each one has 4 eub sections that move down when it's section is clicked, but i'm having serious difficulty with the buttons recognising when the one below it is closed and telling it to move up, i end up with it moving it up but opening the sub sections that belong to it instead of it staying closed and moving it up, alot like fantasy interactive's navigation but each rollover etc is an animation rather that just still frames, does anyone know what i should be doin, is it listeners / behaviours or clip instances or actionscript, anybody that can help me do this, if so needed will be payed, i desperately need this done a.s.a.p, so basically in a nutshell, i want a navigation very similar to fantasy interactives but has movie clip subsections instead of simple buttons.

Thanks for any reply's to this post.

Regards,

Duncan.

Accordion Menu
I'm trying to do an accordion menu in flash, just 2 levels (top and subsections)

It really doesn't have any blocks/squares, it's only the text with roll-over and in-section color change but the functionality is pretty much the same (I will need to make invisible squares as a hit area).

I've been looking lots of threads and in Google but I find little or not help. I don't know where to start. I found that some components can do the jobs but they're expensive therefore I want to do it myself. I couldn't find any tutorial either and I have no idea where to start on my own. I made dropdown menus by myself before, but having the other buttons moved and subsections appear / disappear is getting me nuts.

Anyone know about a good tutorial? Any hint where I could start to code it myself from scratch?

Thanks a lot

Xml Menu With Accordion
Hi all

I'm almost there... the menu is almost working, but there is still some bugs. I would also like to put some tweening without breaking everything.

Anyway, if you would like to take a look a the zip and tell me how I could fix it, let me know

http://www.netdezinz.com/flash/menu_acc.zip 8k

thanks for your time !

Mike

Accordion Menu Help
<---- noob here. I'm really hoping someone can point me in the right direction or if you want to do it for me I'll gladly pay you via paypal. What I'm trying to do is use this Flash Accordion menu as the website itself and have movieclips play inside the colored areas after the animation takes place. I'd need to have clickable content inside and I've read this might be a problem using this technique.

I honestly have no idea where to start...if I try to use a "goto and play frame 2" then the animation doesn't work and it just skips to the content on the 2nd frame. So then I tried using a load movie...both internally and externally but I just can't seem to get it work. Any advice to lead me on my way would be very appreciated!!! That or I'll pay someone to help poor lil meh!!!

Accordion Menu SelectedChild
Hi,

So I'm having a problem with the Accordion component in MX '04. I want different things to happen when the user clicks on different menu items in the accordion. That requires getting the accordion's selectedChild property, so I know what they've clicked on. However, the accordion's selectedItem is not
defined when I trace it from within the event handler. The event handler
is invoked anytime the myAccordion.change event is broadcast. My hunch is that when I click the accordion, the "selectedItem" property is set undefined until the animation finishes, at which time the new childLabel of the accordion is put into selectedItem. Basically, my theory is that I'm tracing selectedItem in that fraction of a second when it is
undefined.

Fortunately, it looks like Macromedia added accordion event object
properties for this purpose. They say they added "newValue" and
"prevValue", which (it appears) would get around this problem. The only
thing is, I don't know how to reference them! My code looks like this:

myAccordionListener = new Object();
myAccordionListener.change = function(){
trace("Changed to "+this.myAccordionListener.newValue); //this target is what I can't seem to get.
}
this._parent.myAccordion.addEventListener("change" ,
myAccordionListener);


Does this make sense? Also, to experiment, I tried using the on(change)
handler in the actions of the accordion itself, to try to accomplish the
same thing. But when I trace the newValue property, it's always
undefined.

Any ideas?

A 4 Level Accordion Menu?
I am trying to use the ui components accordion menu but I need to have 4 levels rather than 2 for player 6.

Anyone got any ideas or seen any out there, dont mind buying it

Accordion Style Menu
can someone recommend a good accordion style menu. i can't seem to find any non xml based ones that look good. thanks!

Accordion Menu For Actionscript 3.0
Can anyone point me to a tutorial on how to create an Accordion Menu with easing in ActionScript 3.0? Or, does anyone have a .fla I can examine? I have some for ActionScript 2.0, but I need one for 3.0...

thanks for any type of response.

Horizontal Accordion Menu Help
I’m trying to figure out how to design a menu similar to the following example in portfolio section with arrays in actionscript and am a little lost. Has anyone seen any examples similar to this that they could point me in the direction of? I just want the values to have a constant x position but slide in and out on the y.

http://www.goodbysilverstein.com/main_site/main.html

Any help or suggestions would be greatly appreciated.

-C

Flash Accordion Menu
Hi everyone. I’m new to this so bear with me. I’m hoping someone can help me out here with a flash accordion menu on my site.

http://www.themilitary.co.uk

switch site to Army of Me and you’ll find it on the left. The fla file can be downloaded at:

http://www.themilitary.co.uk/aom/images/aom_nav0.fla

Ok heres the problem – probably familiar to anyone whose dealt with these things before and you can spot it immediately when you use the menu: I need a way to keep the section open on the menu when you click on a subnav option. I have little understanding of actionscript and it took me a while just to get the menu to work and look the way it does (i didnt build it from scratch obviously). But i did build the entire site so i have some knowledge of html. I am guessing i need to pass a variable from each html page to direct the movie to ‘stay open’ at certain points. What this code might look like and where it would go is beyond me at the minute. If someone would be kind enough to download the fla file and give me an idea of what code needs to go in each page i’d be very grateful.

Thanks in advance – Antony

Accordion Component For Menu AS3
What happened to the Accordion component that was in AS2? I've been searching for an accordion menu script or component that is compatible in AS3. Does anyone know of one? I'm not looking for one of the 'menu builders' -- I want to be able to edit the code.

ACCORDION MENU ACTIONSCRIPT 3.0
Can anyone point me to a tutorial on how to create an Accordion Menu with easing in ActionScript 3.0? Or, does anyone have a .fla I can examine? I have some for ActionScript 2.0, but I need one for 3.0...

thanks for any type of response.

Accordion Menu In Flash Mx
Is there a possibility to create something like the accordion component in flash 6 ?
I've looked through the forums here, and the search results goes always to 2004 ...
Anyone knows how to create this effect ?
I need Mx because the data is to be loaded from XML .. that is easier without a component i guess..

Accordion Menu / XML Tutorial
Hello,

I´m in really need of a tutorial or working sample of a Accordion menu using XML, like the one´s from : http://store.jumpeye.com/accmenu/help.html

Can anyone poit me out a tutorial with something like that?

Thanks.

Accordion Sliding Menu
Hi
I've build a very simple horizontal accordion-like sliding Menu.
It works except for the rollout after the release, then it slides back instead of staying in position.
The problem is that I need a slide back after the rollover on the rollout.
But I dont after the release.
In the end it should look like >>this<<.


PHP Code:



function movItem(clip, speed, x) { clip.onEnterFrame = function() {  var a = Math.abs(x-clip._x);  clip._x += (Math.round(x-clip._x))/speed;  if (a<=1) {   clip._x = x;   delete clip.onEnterFrame;  } };}for (var i = 1; i<6; i++) { this["mc"+i].ID = i; this["mc"+i].onRollOver = function() {  if (this.ID == 1) {   movItem(mc1, 5, 30);   movItem(mc2, 5, 60);   movItem(mc3, 5, 90);  }  if (this.ID == 2) {   movItem(mc2, 5, 60);   movItem(mc3, 5, 90);  }  if (this.ID == 3) {   movItem(mc3, 5, 90);  } }; this["mc"+i].onRollOut = function() {  if (this.ID == 1) {   movItem(mc1, 5, 0);   movItem(mc2, 5, 30);   movItem(mc3, 5, 60);  }  if (this.ID == 2) {   movItem(mc2, 5, 30);   movItem(mc3, 5, 60);  }  if (this.ID == 3) {   movItem(mc3, 5, 60);  } }; this["mc"+i].onRelease = function() {  if (this.ID == 1) {   movItem(mc1, 5, 220);   movItem(mc2, 5, 250);   movItem(mc3, 5, 280);  }  if (this.ID == 2) {   movItem(mc2, 5, 250);   movItem(mc3, 5, 280);  }  if (this.ID == 3) {   movItem(mc3, 5, 280);  } };} 




Does somebody have suggestions about make it work like the example in the link or a better starting point to reach what I'm after?

Accordion Menu Prob
Hi All,
I have created Accordion menu in flash 8. In Accordion change event I changed the image. I embed this swf into aspx page. That is worked well. After that I want to use this in Web Browser control in VB.Net
So I used WEB BROWSER control in VB.NET.The Prob is the Accordion menu is not worked in VB.NET WEB BROWSER .
How to Solve this prob? If U have any solution let me know.
Thanks in advance

Urgent Help On Accordion Menu
Can someone help on this accordion menu.
I have the menu almost working, but i would like to change one thing. I would like to force the yellow tab to be always open, when i load my menu, whithout the need of the rollOver. Like it is the yellow, in fact opens, but if i rollOut it close. I would like that ii stay´s opened, but if i rollOver the others tabs the yellow tab would have to close to, and when it return to the initial state the yellow tab must be opened again



I don´t now if a made my self understood

I have tried but i failed. Please If someone could help thank´s in advanced

[AS 2.0] A TRULY Flexible Accordion Menu
hey gang!

i've been looking for a decent accordion menu forever. a coded one, not that component crap that you can't customize worth a damn.

i couldn't find one that didn't make my head hurt or didn't require the menus, etc. to be created beforehand. so i finally knuckled down and made one. lazy me. and since i've seen a bunch of posts looking for them, i thought i'd put my efforts here for everyone to use and enjoy. nothing like bashing your head against a wall trying to do something simple.

the code is VERY flexible and quickly adaptable to XML implentation (which i'd actually originally did this for). and, best of all, everything is customizable. out the hoo-hoo. oh... and i commented the hell out of it for my staff, because it's often better to know WHY something works so you can learn from it and use the principles in your own stuff. there are a couple of finesse things with regard to the spacing that just need a tweak +- 1 pixel... but i thought i'd get this up before i move on to something else.

i'm working on making this into a class and when i do, i might throw it up if anyone is interested. and mad thanks to the 'lmc_tween.as' crew. i know Zigo is the new deal, but there's life in the old stuff yet!

WR!

Accordion Menu For Actionscript 3.0
Can anyone point me to a tutorial on how to create an Accordion Menu with easing in ActionScript 3.0? Or, does anyone have a .fla I can examine? I have some for ActionScript 2.0, but I need one for 3.0...

thanks for any type of response.

How To?... Custom Accordion Menu
Hi, I would like to create a similar style menu to one I found the other day. It's at http://73.ufc.com ...if you skip the intro video, the menu is in the bottom right of the website. It has the fighters facing each other and on scroll over they expand, hiding the other fighters.

I'm not a total noob when it comes to AS but I definitely need help. I would just like an outline of script that I could build upon that would function the same way as the one I found at the UFC site. I know Flash has the Accordion component but I'm hoping for something a bit more advanced than that. Even if you know of a tutorial that could help, I would appreciate it. Thanks.

Accordion Slide Menu
Hi,
I've been looking everywhere for a tutorial or fla on an "accordian" style animated menu.
I can't seem to find it anywhere.
Does anyone know where i can find a tutorial or does anyone have an fla so i can learn how it's done?

Thankyou people.

XML Driven Accordion Menu
I am using the accordion menu component but I do not understand how to make it use XML as it's list.

Rollover Accordion Menu
http://www.flashadvisor.com/movie/display/317.html

Can someone check out this guy?s .fla and tell me what he is doing. How is he coming up with those numbers or is they?re an easier way to make a custom accordion menu without using the standard accordion component

I am trying to make a menu like:
http://www.schweitzer.com/

Accordion Menu V1 Help Need Price Quote
newbie will pay a reasonable price to someone who can modify my recently purchashed accordion menu pro v1. All I need is it to work like the example they have on there website and to set it up to load external swf's and jpg's.
Send me a price quote.

[f8] Accordion Drop Down Menu Problems
hey there,
i have this code below in xml for a drop down menu with images...it all works fine and shows the swf files however the buttons within the swf files dont work...is there anyway i can sit flash movies within this accordion dropdown menu so that they work as normal...thanks alot

<?xml version="1.0" encoding="UTF-8"?>

<component name="Accordion Panel v3">

<data childStyle="style1">

<item title="Jumpeye" contentPath="images/test.swf"/>

<item title="Working" contentPath="images/test2.swf"/>

<item title="Drawing" contentPath="images/test3.swf"/>

<item title="On meeting" contentPath="images/img4.jpg"/>

<item title="Having fun" contentPath="images/img5.jpg"/>

</data>



</component>

Horizontal Accordion Menu With Images?
Hi all,

I am looking for some examples of horizontal accordion menu with images. I can't remember the websites anymore.
And where should I start? Any tutorials?

Flash Mx 2004 Accordion Menu
Hi All,

I found a great Flash 2004 Accordion Menu, it is easy to skin, and the transition is really smooth. One problem though I can't figure out how to make it Load external swf's it was designed for jumping to links withing the site.

If anyone wants to look at a copy, and explain to me how to modify it I would appreciate it.

Accordion Like Menu System... (howto?)
ok i found something i like to use but i just can figure out how this is done.. i found a bunsh of accordion like systems that look the same.. but can figure out how this works??

does any one have a tutorial or a site that give info on this???

http://www.bordesign.fr/

Open Certain Category - XML Menu Accordion
I not a developer, so I bought a menu, which I saw in flashden.

a menu xml accordion.
http://flashden.net/files/21673/index.html

My problem is the following, the menu opens all, I just would like to open certain category.

In that way:
in my URL I have a param &IDCategoria=2660&, I can take this param, but my whole menu opens, all categories, not just this particular category.

Can anyone help me?
AS.

Code:
stop();
// subitems
var xmlItems = xmlRoot.childNodes
// total subitems
var total = xmlItems.length
// todos items
var itemList = []
//----------------------------------------------
//catch the url param
import flash.external.*;
import QueryString.as;
var myPath:QueryString = new QueryString();
assignVariables();
//------------------------------------------------
function assignVariables() {
if (myPath.parameters.Y) {
idCategoria_txt.text = unescape("IDCategoria="+myPath.parameters.IDCategoria);

for (i=0; i<total; i++){
// Attaching menu
box.attachMovie("item", "item" + i, i)
itemList[i] = box["item"+i]
itemList[i].xmlRoot = xmlItems[i]
itemList[i].separation = separation
itemList[i].tabulation = tabulation
itemList[i].subItemAutoClose = subItemAutoClose
itemList[i].itemHeight = itemHeight
itemList[i].itemWidth = itemWidth
itemList[i].light = light
//itemList[i].buttonColor = buttonColor
//itemList[i].rollOverColor = rollOverColor
itemList[i].arrowColor = arrowColor
itemList[i].rollOverArrowColor = rollOverArrowColor
itemList[i].TextColor = TextColor
itemList[i].rollOverText = rollOverText
itemList[i].openEase = openEase
itemList[i].closeEase = closeEase
itemList[i].rollOutFade = rollOutFade
itemList[i].openAll = openAll
itemList[i].openID = openID
}

//botões menu
button.onRelease = function(){
if (link){
getURL(xmlRoot.attributes.url+"&Y="+myPath.parameters.Y, "_self")
}
}
button.onReleaseOutside = function(){
if (link){
getURL(xmlRoot.attributes.url+"&Y="+myPath.parameters.Y, "_self")
}
}
button.onRollOver=function(){
if (!openBox){
over = true
}
}
button.onRollOut=function(){
if (!openBox){
over = false
}
}

//cores
color.setRGB(buttonColor)
color = new Color (button.over)
color = new Color (Arrow.color)
color.setRGB(arrowColor)
color = new Color (Arrow.over)
color.setRGB(rollOverArrowColor)
// nome do item CAT
cat.text = xmlRoot.attributes.cat
id_txt.text = xmlRoot.attributes.id
levels_txt.text = xmlRoot.attributes.level
// máscara
box.setMask(mask)
// sem submenu
if (total<1){
link = true
Arrow._visible=false
}
if (!light){
button.light._visible=false
}
mask._height = 0
button._x = button._y = 0

mask.onEnterFrame=function(){
cursor._x=_xmouse
cursor._y=_ymouse
button._height = itemHeight
button._width = itemWidth
box._y = mask._y = button._height + separation
mask._width = button._width*tabulation/5

if (openBox || myPath.parameters.IDCategoria){
mask._height += (targetSize - mask._height)/openEase
Arrow._rotation += (-90 - Arrow._rotation)/openEase
box._x = mask._x += (tabulation - mask._x)/openEase
teste_txt.text = "Categoria aberta";
teste_txt.textColor = 0xFF0099;
}

else {
mask._height += (0 - mask._height)/closeEase
Arrow._rotation += (0 - Arrow._rotation)/closeEase
box._x = mask._x += (0 - mask._x)/closeEase
}
if (over){
cat.textColor = rollOverText
if (button.over._alpha<100){
button.over._alpha +=50
}
} else {
cat.textColor = TextColor
if (button.over._alpha>0){
button.over._alpha -= rollOutFade
}
}
Arrow.over._alpha = button.over._alpha
// menu
for (i=1; i<=total; i++){
// menu embaixo do outro

itemList[i]._y = itemList[i-1]._y + itemList[i-1].mask._height + itemList[i-1].button._height + separation
targetSize = itemList[i-1]._y + itemList[i-1].mask._height + itemList[i-1].button._height + separation
if (!openBox && !openAll){
itemList[i-1].openBox=false
itemList[i-1].over=false
}

// abrir todos
if (openAll && openBox){
itemList[i-1].openBox=true
itemList[i-1].over=false
if (!itemList[i-1].link){
itemList[i-1].over=true

}
}
}
}

onMouseDown = function (){
for (i=0; i<total; i++){
if (itemList[i].button.hitTest(cursor)){
showCurrent(itemList[i])
}
}
}
// botão clicado
showCurrent=function(current){
for (i=0; i<total; i++){
if (itemList[i]!=current){
if (subItemAutoClose){
itemList[i].openBox=false
}
if (total > 0){
itemList[i].over = false
}
} else {
// se tiver submenu
if (total>0){
if (itemList[i].openBox){
if (!openAll){
itemList[i].openBox=false
}
} else {

itemList[i].openBox=true
}
}
}
}
}
// fechando a função assignVariables if Y parameter exists
}
}
If somebody wanna help, I´ll send the .fla

Sorry about my english.

Accordion Menu Masking Problems
I'm trying to create an xml accordion menu that has main menus and a sub menus buttons (movieClips) revealed with a mask. Simple question, How do I stop the mask area which reveals the sub menus catching mouseEvents on the submenus?

The main menu button is a movieClip, it has the mask sprite attached to it as a property so it can scale dynamically to reveal the subMenus. They are set as children of the main menu button container.

In my code I've set mainMenu.mouseChildern = true. But when the mainMenu is clicked I change mouseEnabeled = false to help prevent the main menu receiving events. This helps on rollOver rollOut events, but when I click or mouseDown on the subMenu the mask catches the event also and activates the main menu again. I've tried the obvious mask.mouseEnabled = false; mask.mouseChildern = false; mask.hitArea = null; and even setting mask.alpha = 0 but this has no effect at all.

I don't understand why the mask has to extend the hitArea property of the mainMenu and why this can't be set to null. It also seems crazy that when mouseChildren = true the parent clip also has to receive notice of the event.

Any suggestons on how to sneak around the parent?

XML + Accordion Component To Create A Menu
I'm trying to figure out how to create an XML driven menu using the accordion component. I want the child names to come from the xml. Each child/segment of the accordion should contain an empty clip. The clip should be populated with buttons, however many are listed in the xml file, and the buttons should load a file (in this case a jpg) into a target movie clip.
I'm not sure I explained that well.

Picture an accordion component on the left side of your screen. Section one is IDENTITY, section two is RECRUITMENT, section three is ANNUAL REPORTS. Each section contains a movie clip. in the IDENTITY section the clip contains three buttons ID1 ID2 ID3. Clicking ID2 loads a jpg into a box on the right side of the screen. The only complicated part of this is that all the information , the labels, the number of segments, the number of buttons in each segment, the location and description of the jpgs, everything is contained in a single XML file so that someone else could come along, open the file, add a PROMOTION section, add five buttons to the section and put five jpgs in a folder and the application will reflect the change.

I've done the gotoAndLearn Accordion video player and XML tutorials

[F8] Flash Accordion Menu - Expertise Sought
Hi everyone. I’m new to this so bear with me. I’m hoping someone can help me out here with a flash accordion menu on my site.

http://www.themilitary.co.uk

switch site to Army of Me and you’ll find it on the left. The fla file can be downloaded at:

http://www.themilitary.co.uk/aom/images/aom_nav0.fla

Ok heres the problem – probably familiar to anyone whose dealt with these things before and you can spot it immediately when you use the menu: I need a way to keep the section open on the menu when you click on a subnav option. I have little understanding of actionscript and it took me a while just to get the menu to work and look the way it does (i didnt build it from scratch obviously). But i did build the entire site so i have some knowledge of html. I am guessing i need to pass a variable from each html page to direct the movie to ‘stay open’ at certain points. What this code might look like and where it would go is beyond me at the minute. If someone would be kind enough to download the fla file and give me an idea of what code needs to go in each page i’d be very grateful.

Thanks in advance – Antony

Recursively Access Xml Nodes - Accordion Menu
hi,

I'm very new to actionscript 3.

I'm trying to figure out how to use a recursive function to access an xml file which basically represents a hierarchical menu as follows:




<course><section><title>Introduction to Actionscript</title><section><title>Lesson 1: Variables</title><section><title>Topic 1: Data types</title></section></section>


</section>


</course>

.. basically I want this menu to adapt to different scenarios, so that there can be (theoretically) an unlimited number of sections nested within other sections. (i.e. menus with submenus with submenus....)

my 'pseudocode' goes something like this (I've tried it a few ways in AS3, but no luck)



Code:



parseStructure(node){for each(section in node){trace(title);if (section has sections){parseStructure(section);}}}
I came across a good AS2 tutorial on using a recursive function to access xml nodes by senocular here: http://www.kirupa.com/web/xml/exampl...4ASclasses.htm

..but I am having trouble applying the theory behind this to get it working in AS3.

Any help or advice appreciated!

Thanks!
Karen

XML Accordion Menu / Content - Question About Best Approach
Hi,

I've been messing around with this AS3 version of an AS2 menu I made. The AS2 menu uses AsBroadcaster to broadcast messages to each menu item, telling it to updates its position based off what ever item is active, and expanded. Changing this AS2 approach to use eventDispatcher etc in AS3 works fine. The AS3 version however, does not quite perform the same, tending to be "too reactive". The problem is that with a vertical accordion menu when you move the mouse downwards, the menu items move too quickly to trigger each menu items rollOver event, and this causes the menu to look a little erratic, with odd menu items expanding, when they should simply expand one after the other. To get around it, I've found I can either slow down the tween, or use a combination of a mouseMove event with a basic "active area if clause" to trigger a variable. This does work, but I'm puzzled as to why AS2 would not need this approach. I tend to think that AS3 is just that much better performing and so responds to the movements of the menu items that much quicker. Or, its a overall architecture problem, and the way I've set up this menu is flawed.

Have a look at the code and see what you think. Is the way I have done it, a good way to approach this kind of menu system? This is the first thing I tried to make in AS3, so I'm interested in seeing whats "correct".

Here are the source files in zip format. (Classes, XML, Images, CS3 Flash file). AS2 version included if you want to compare. (I've been meaning to put the AS2 version up in the source experiments).

AS3 version
AS2 version

Here is how it works - http://www.noponies.com/dev/accordion/ Theres no preloader yet, so give it a bit to load.

here is the class file for a menu item;

PHP Code:



package {
    import flash.display.*;
    import flash.display.Stage;
    import flash.events.*;
    import caurina.transitions.Tweener;//using Tweener to tween the y property
    import flash.text.*;

    public class menu_as extends Sprite {

        public var startY = int;
        public static  var SHUFFLEPOS:String = "shufflepos"; //set up for custom event dispatch
        public static  var RESETPOS:String = "resetpos"; //set up for custom event dispatch
        public var menuBar:Sprite;
        public var contentHolder:Sprite;
        public var menuTxt:TextField;
        public var menuFormat:TextFormat;
        public var barHeight:int;
        public var masker:Shape;
        //public var pictureValue:int = undefined;//used if you want to link menu to an array index etc
        public var activated:Boolean=false;//var to track if the menu is expanded.        
        // below vars passed in via arguments to constructor
        public var loadedContent;//content of loader - varies
        public var titleText:String;
        public var parentXMLs:XML;//temp var for passing each menu its xml node. not final!

        public function menu_as(loadedContent, titleText, parentXML) {
            parentXMLs = parentXML;
            //generic setup
            barHeight = 14;//height of menu bar
            buttonMode = true;
            useHandCursor = true;
            
            //add content
            contentHolder = new Sprite();
            contentHolder.y = -loadedContent.height;//set a negative height
            contentHolder.addChild(loadedContent);
            addChild(contentHolder);
            
            //mask
            masker = new Shape();
            masker.graphics.beginFill(0xFFFFFF);
            masker.graphics.drawRect(0, barHeight, loadedContent.width, loadedContent.height);
            masker.graphics.endFill();
            addChild(masker);
            loadedContent.mask = masker; //mask the loaded content
            
            //visible bar sprite
            menuBar = new Sprite();
            menuBar.graphics.beginFill(0x000000);
            menuBar.graphics.drawRect(0, 0, loadedContent.width, barHeight);//height, width of menu bar
            menuBar.graphics.endFill();
            addChild(menuBar); //add in the black menu bar

            //text field formatting
            menuFormat = new TextFormat();
            menuFormat.font = new standard07_65().fontName;//class name of font in parent library
            menuFormat.size = 8;
            menuFormat.color = 0xFFFFFF;
            
            //text field constructing
            menuTxt = new TextField();
            menuTxt.type = TextFieldType.DYNAMIC;
            menuTxt.autoSize = TextFieldAutoSize.LEFT;
            menuTxt.embedFonts = true;
            //menuTxt.antiAliasType = AntiAliasType.ADVANCED;
            //menuTxt.gridFitType = "pixel";
            //menuTxt.sharpness = 400;
            menuTxt.x = 8;
            menuTxt.y = 0;
            menuTxt.mouseEnabled = false;
            menuTxt.htmlText = titleText;
            menuTxt.setTextFormat(menuFormat);
            addChild(menuTxt);//add the menus title text

            //event listeners
            addEventListener(MouseEvent.ROLL_OUT, rollOutHandler); //use rollovers in order to treat each instance as a whole and so we only fire one event.
            addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler);//comment out this listener to make the menus stay open even if rolled out.
            addEventListener(MouseEvent.ROLL_OVER, mouseOverHandler);
            addEventListener(MouseEvent.CLICK, mouseClickHandler);
            addEventListener(Event.ADDED, addedHandler);//use stage as listener for custom events

        }
        
        //added to stage handler
        private function addedHandler(event:Event):void {
            stage.addEventListener(menu_as.SHUFFLEPOS, shuffleHandler);
            stage.addEventListener(menu_as.RESETPOS, resetHandler);
            startY = event.target.y; //find out our ypos
        }
        
        /*mouse move handler, used to trigger a variable that enables smoother dowards movement through the menus
        basically this creates a 'active zone', which triggers a switch inf the activated variable. If we are inside this zone, we keep it true. This
        helps with downwards mouse movement across the menus.*/
        private function mouseMoveHandler(event:MouseEvent):void {
            if (stage.mouseY<=this.y+2 || stage.mouseY>=this.y+(this.menuBar.height+this.masker.height)-2 || stage.mouseX<=this.x+20 || stage.mouseX>=this.x+this.width-20) {
            this.activated = false
            }
        }
        
        //rollout
        private function rollOutHandler(event:MouseEvent):void {
            if (!this.activated) {
                dispatchEvent(new Event(menu_as.RESETPOS,true));
                Tweener.addTween(this.contentHolder,{y:-contentHolder.height, time:1.5});
                this.activated = false;
            }
        }

        //rollover
        private function mouseOverHandler(event:MouseEvent):void {
            dispatchEvent(new Event(menu_as.RESETPOS,true));
            Tweener.addTween(this.contentHolder,{y:barHeight, time:1.5});
            dispatchEvent(new Event(menu_as.SHUFFLEPOS,true));
            this.activated = true;
        }
        
        //click
        private function mouseClickHandler(event:MouseEvent):void {
            trace("You clicked "+this.parentXMLs.about.text());//the about text for each element. Just a test.
            dispatchEvent(new Event(menu_as.RESETPOS,true));
            Tweener.addTween(this.contentHolder,{y:-this.contentHolder.height, time:1.5});
            this.activated = false
        }
        
        //reset position of clips listener handler
        private function resetHandler(event:Event):void {
            Tweener.addTween(this,{y:startY, time:1.5 });
        }
        
        //shuffle the clips positions, dependent on their x pos and y pos in relation to the currently active menu
        //using xpos gives us column support
        private function shuffleHandler(event:Event):void {
            if (this!==event.target) {
                //slide the bars back up
                Tweener.addTween(this.contentHolder,{y:-this.contentHolder.height, time:1.5});
            }
            if ((this.y>event.target.y) && (this.x == event.target.x)) {
                //slide the bars back up
                Tweener.addTween(this,{y:startY+event.target.contentHolder.height, time:1.5});
            }
        }

    }





And, how it is used in Flash;


PHP Code:



//load in xml via call to external xml parsing class
var menuXML:XML = new XML();
var myloadXml:loadXml = new loadXml("menu.xml", checkLoad);

//call back function for xml loading
function checkLoad(evt:Event):void {
    menuXML = XML(evt.target.data);
    loadThumbs();
}

//vars for setting up the loading of each thumbnail
var loader:Loader;
var p:int = 0;
var menuy:int = 0

function loadThumbs():void {
    loader = new Loader();
    loader.contentLoaderInfo.addEventListener(Event.INIT, initListener);
    loader.load(new URLRequest(String(menuXML.pic.image.text()[p])));

    function initListener(e:Event):void {
        //load the menu content - (loader content, title text, xml node data)
        var newMenu:menu_as = new menu_as(loader.content, menuXML.pic.names.text()[p], menuXML.pic[p]);
        //position the menus
        newMenu.y = menuy+=20 //keep in mind the height of the menu bar, which is 14, so we have a 6px space
        newMenu.x =100
        //newMenu.pictureValue = p
        addChild(newMenu)
        p++;
        if (p<menuXML.pic.length ()) {            
            loadThumbs();//create loop
        }
        if (p==menuXML.pic.length ()) {
            //do when done
        }
    }


Copyright © 2005-08 www.BigResource.com, All rights reserved