Flash Help svp.
- Started
- Last post
- 9 Responses
- konception
I have a navigation bar in flash and for a certain link a sub menu folds out. If the user goes to another link this submenu folds back up.
Problem is.. if the back button is used, this submenu does not fold away as it should. Is there a javascript I can use that will tell the swf to play( ); when the back button is used on certain pages??
If this doesnt make sense I'll get the swf online for you.Thanks!!!
- konception0
btw, the swf is in it's own frame at the top, so it does not reload.
- konception0
anyone? anyone???
- cphunk0
Just an opinion, but rather than making them click for the submenu then click again, why not just make it a rollover or hitTest function. Best to keep a one click navigational system in my opinion.
Anyways, either way. A hitTest function will work. Make a clip in the background with its alpha set to 0.
then use this code on the main parent clip.
onClipEvent (load) {
function CheckMouseOver () {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
return (true);
} else {
return (false);
}
}
}onClipEvent (enterFrame) {
var MouseIsOver = CheckMouseOver();
if (!MouseIsOver) {
whatever.gotoAndStop(2);;
}
else if(MouseIsOver) {
whatever.gotoAndStop(1);;
}
}u can even call a movement function in place of whatever.gotoAndStop(2); etc. I just made it simple for you.
- konception0
the client wants an intermediary page describing the submenu options.. so the submenu has to come down.. and then it has to STAY while the use is navigating through that section of the site. She wants them always to be visible once they are called. (this is a 250 page site.. ugh.)
If the back button is used to return to a previous page outside of this section, the submenu should go away.. but how? This has nothing to do with rollovers.
cphunk, Thanks for the code... i copied it down for future use. :)
- autonoma0
These pages might be of interest to you:
http://www.flashmagazine.com/htm…
http://www.flashsupport.com/topi…However, as far as I know, the browser cannot communicate with the Flash file in this way unless that file is reloaded.
- dgtl_rchtct0
you figure it out?
- cphunk0
i really don't want to code this all out. so i'll just give the theory.
what you can do is make a javascript function on the html page that the dropdown will be present on.
the javascript function should be something (pseudocode) like - an onExit command. onExit set a variable to false.
Then in flash on your movie clip dropdown. use an onClipEvent(enterFrame) to test whether the javascript variable has changed. If it's changed. hide the dropdown. That should work.
- dgtl_rchtct0
what cphunk is probably referring to is setting up listeners in your flash document and creating a backButton object in your flash movie that checks (via listener) whether back button has been pressed.
you then write this object out in your html where you settings are for the flash file; ie: onMouseWheel="this.SetVariable...
i won't go into further detail but i believe you will find your answers in the links provided. if not i can post code.
- konception0
just getting caught up with my thread finally.
THANKS GUYS. :)
laura.