Old 01-15-2009, 03:49 PM   #1 (permalink)
Junior Member
 
Join Date: Jan 2009
Posts: 2
Default Struggling with menu actions

Hi there,

Sorry for posting such a basic question but i am really struggling with the firing actions on an item. I have read the help files but i can't seem to follow them (really sorry! i am new to flash).

I am using the downloaded file (so i have not attempted to integrate it into another project) So say, for example, i want the Author Program item in the menu to go to frame 5.

Would the XML code look like this?
<item label="Make Money"/>
<subitem label="Author Program" frame="5"/>

I am having trouble figuring out what my action scripting should look like?

Would anyone be able to help?

Many thanks,
lolo
lolo1 is offline   Reply With Quote
Old 01-19-2009, 10:04 AM   #2 (permalink)
Junior Member
 
Join Date: Jan 2009
Posts: 2
Default please can anyone help?

Sorry, i am really struggling on this and i have an urgent deadline. Could anyone shed some light?
lolo1 is offline   Reply With Quote
Old 01-19-2009, 07:36 PM   #3 (permalink)
OYXLUSFlash.com Staff Member
 
Adrian's Avatar
 
Join Date: May 2008
Posts: 1,981
Send a message via Yahoo to Adrian Send a message via Skype™ to Adrian
Default

Code:
menu_mc.onItemClick= function(node:XMLNode, level:Number){ 
    your_movie_clip.gotoAndStop(Number(node.attributes.frame));
 }
This is the code you should use. Replace your_movie_clip with the instance name of the movie clip you want to play. For example you could replace it with _root to play the main time line. Make sure your menu instance name is menu_mc.

This will work when you press either a menu item or a subitem. If you want to restrict it only to subitems, use the following:
Code:
menu_mc.onItemClick= function(node:XMLNode, level:Number){ 
    if(level == 2)
           your_movie_clip.gotoAndStop(Number(node.attributes.frame));
 }

Last edited by Adrian; 01-19-2009 at 07:38 PM.
Adrian is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 01:32 AM.