Brian Coughter
asked on
Jump to scene based on button click
I have a button that I set a variable on:
onClipEvent (mouseDown) {
var buttonHit:String = "AboutUs";
}
Upon clicking this button (which is a Movie Clip), I am taken to a transitional scene. At the end of that scene an action is supposed to pick up that variable that was set on the button click and take me to the next scene based on the evaluation of that variable. However, it's not working. Is this the best way to go about this?
gotoAndPlay("eval(buttonHi t)",1);
onClipEvent (mouseDown) {
var buttonHit:String = "AboutUs";
}
Upon clicking this button (which is a Movie Clip), I am taken to a transitional scene. At the end of that scene an action is supposed to pick up that variable that was set on the button click and take me to the next scene based on the evaluation of that variable. However, it's not working. Is this the best way to go about this?
gotoAndPlay("eval(buttonHi
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
aboutUs_mc.onRelease=funct ion(){
_global.buttonHit = "AboutUs";
}
_global.buttonHit = "AboutUs";
}
In other words, you want to assign the action to the object in question, not to the type of object (clip).
It's the equivalent of saying "if basketball player gets goal, do this", instead of saying.. if "Tim Duncan gets goal, do this".
It's the equivalent of saying "if basketball player gets goal, do this", instead of saying.. if "Tim Duncan gets goal, do this".
ASKER
So _mc is an ActionScript suffix used to point to a specific movie clip?
ASKER
Never mind, I'm retarded. I got it now...
AboutUs.AboutUs_Button.onR elease = function(){
_global.buttonHit = "AboutUs";
gotoAndPlay("GPE", 1);
}
Thanks for all the wizardry!
AboutUs.AboutUs_Button.onR
_global.buttonHit = "AboutUs";
gotoAndPlay("GPE", 1);
}
Thanks for all the wizardry!
my pleasure.. btw, _mc is something you add to the end of your move clip instances if you want actionscript to give you some context sensitive help in the editor. Try it. Just go to the AS panel and type.. me_mc. once you type the dot, voila!
:)
:)
ASKER
onClipEvent (mouseDown) {
_global.buttonHit = "AboutUs";
}
Here's my issue now:
the buttonHit var gets assigned no matter where I click. How to I assign that var only when I click the AboutUs movie clip?