gotoAndPlay(...) Action
Posted on March 17th, 2010 by smith
If I got 2 tags, for this sample, they'll be "_over" and "_out" which are used for a button that has a motion of color tint.
Now, lets say I start with gotoAndPlay("_over"), then the button turns from one color to another, then I trigger the gotoAndPlay("_out") and the button changes back to it's original color.
My problem is when I trigger the gotoAndPlay("_out") while gotoAndPlay("_over") was playing, so I was wondering if you can somehow get the frame being played by the "_over" tagged frame and relate it to the gotoAndPlay(...) function.
btn1.onRollOver = function() {
gotoAndPlay("_over");
}
btn1.onRollOut = function() {
gotoAndPlay("_out");
}
ActionScript Code:
btn1.onRollOver = function() {
gotoAndPlay("_over");
}
btn1.onRollOut = function() {
gotoAndPlay("_out");
}
I indeed do that, but then, when I enter the _out instance while im in the _over instance, the animation bugs.
Rough Example:
btn1.onRollOver = function() {
if(btn2._currentframe>=20)
//perform these actions
}
else{
//perform these actions)
}
If you use movieclips as opposed to buttons - you can be specific about where in the timeline of each or anything the playhead is and then allow something to happen based on that information.
Look up `If statements' and `_currentframe' anyway to get familiar and use movie clips instead of buttons.
I'm crappy at AS so the two things above are easy to learn.
Thanks, all I needed is the _currentframe thingy ;) I'm pretty strong in scripting, with any language, so that won't be a problem :)
Rough Example:
btn1.onRollOver = function() {
if(btn2._currentframe>=20)
//perform these actions
}
else{
//perform these actions)
}
If you use movieclips as opposed to buttons - you can be specific about where in the timeline of each or anything the playhead is and then allow something to happen based on that information.
Look up `If statements' and `_currentframe' anyway to get familiar and use movie clips instead of buttons.
I'm crappy at AS so the two things above are easy to learn.
#If you have any other info about this subject , Please add it free.# |