-
hey. hey. a-hey-na-ney-na-hey
if currentframe is this, then do this
hey
i have a flash page basically with a menu, submenu, and content box.
when you click on links in the menu, sub links in the submenu show up according to what menu link you clicked. then when you click on links in the submenu, the corresponding page shows up in the content box.
also, when you click on a submenu link, the submenu mc goes to a frame that deactivates the link and puts a dot beside it to signify that that is the page you are currently on.
so, say i go from a NEWS menu link, click on the submenu CURRENT NEWS, then i click on BIO in the main menu link, the submenu changes to correspond to the menu's current link and the content box stays where it was because the only thing that controls it is the submenu links.
(i hope i'm making sense)
the issue is that if i click back to the NEWS menu link, the CURRENT NEWS link is active and the signifying dot is not there because it basically just resetting itself because i went away from the NEWS frame and came back to it.
I came up with some actionscript that i have no idea if it is correct, but the basics of it is that:
when you click a menu button, if the content box's current frame is X then, if the submenu is on that same X link, tell the submenu to go to that particular deactivated X link frame. otherwise, tell the submenu to go to the frame where the links are active.
Code:
on (release) {
if (_root.contentbox._currentframe="news1") {
_root.submenumc.submenu.gotoAndStop("news1");
} else {
_root.submenumc.submenu.gotoAndStop("news0");
}
}
if anyone can shed a bit of light on this coding issue that would be amazing.
if i did a good enough job explaining, when you understand, it is actually a simple concept, its just getting the actionscript correct.
i am using Flash CS3 and actionscript 2
thanks all
-
Flashmatics
for comparison use == not =
so in your example:
_root.contentbox._currentframe == "news1"
-
hey. hey. a-hey-na-ney-na-hey
that did help a bit, but the whole thing still didn't work. i changed the target from a frame label to just a frame number and it totally works now so thanks. but i really need it to point to a frame label because if anything changes on that timeline, i need it to be as painless as possible and don't want to have to go changing frame numbers in all these scripts. is there something i'm missing again?
thanks
-
Flashmatics
oops yeah currentframe only refers to the frame number, there is no label equivalent unfortunately
-
FK'n_dog
_currentframe only returns the number of the frame, not its label.
you could use a Boolean variable at frame label "news1" -
bNews1 = true;
and check for its value on the button action -
on (release) {
if (_root.contentbox.bNews1) {
_root.submenumc.submenu.gotoAndStop("news1");
} else {
_root.submenumc.submenu.gotoAndStop("news0");
}
}
set the value to false when you exit "news1"
-
hey. hey. a-hey-na-ney-na-hey
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|