PDA

View Full Version : as3 guidance


cooperslee
09-30-2008, 04:00 PM
I would love to get some help with an actionscript 3 file.

I have a file from flashden and I'm trying to learn by example. It's a menu that's working great, but I can't figure out how to attach movie clips to the items.

Any help would be so much appreciated!


var _menuItemsAndContent:Array = new Array({name:"Home", mc:new MovieClip}, //name and mc, leave mc empty if you don't use it
:confused:{name:"Who am I", mc:null},
{name:"Curriculum Vitae", mc:null},
{name:"Contact me", mc:null},
{name:"Projects",mc:null});


function onSubMouseClick(event:MouseEvent):void {
//here are the the 3 methods that can be used to change the content

//returns item id/it's position in the _subBtnsAndPos array
trace("id " + event.currentTarget.name);
//returns the items name
trace("name " + _subBtnsAndPos[event.currentTarget.name].name);
//return the MovieClip that has been accosiated with the item or null
//if you haven't use that feature
trace("MC " + _subBtnsAndPos[event.currentTarget.name].mc);
}