I’m working with this tutorial:
http://www.kirupa.com/developer/mx2004/button_effect.htm
Everything works fine however instead of having the button launch website in a new window, I want it to go the next frame of the movie, which happens to be frame 49. The animated rollover and rollouts work fine. The the “on release” command isn’t working.
Here’s my as:
//all this code is inside the complex button so you can stick as many as you want
//on the stage and all will work… they all will have this code in it…
stop(); // stop the movie clip from playing (stop button from growing, we want that when the mouse rolls over only
this.onEnterFrame = function(){
if(rewind == true){ //if rewind switch is set to true play backwards
prevFrame(); // play backwards
}
}
this.onRollOver = function(){
rewind = false; //set variable (or switch) that decides wether ot not to play backwards…
play(); // play this movie clip… (grow the button(tween));
}
this.onRollOut = function(){
rewind = true; //set or rewind switch to true so it will play backwards…
}
this.onRelease = function(){
getURL(“http://www.kirupa.com","_blank”);
}
[FONT=Courier New]
[/FONT]
I tried changing it to:
ActionScript Code:
[FONT=Courier New][LEFT][FONT=Verdana][COLOR=#000000]//all this code is inside the complex button so you can stick as many as you want [/COLOR][/FONT][/LEFT]
[FONT=Verdana][COLOR=#000000]
//on the stage and all will work… they all will have this code in it…
[/COLOR][/FONT]
[LEFT][FONT=Verdana][COLOR=#000000]stop(); // stop the movie clip from playing (stop button from growing, we want that when the mouse rolls over only[/COLOR][/FONT][/LEFT]
[FONT=Verdana][COLOR=#000000]
[LEFT]this.onEnterFrame = function(){
[LEFT]if(rewind == true){ //if rewind switch is set to true play backwards
prevFrame(); // play backwards
}
}[/LEFT]
[/LEFT]
[/COLOR][/FONT]
[LEFT][FONT=Verdana][COLOR=#000000]this.onRollOver = function(){[/COLOR][/FONT][/LEFT]
[FONT=Verdana][COLOR=#000000]
[LEFT]rewind = false; //set variable (or switch) that decides wether ot not to play backwards…
[LEFT]play(); // play this movie clip… (grow the button(tween));
}[/LEFT]
[/LEFT]
[/COLOR][/FONT]
[LEFT][FONT=Verdana][COLOR=#000000]this.onRollOut = function(){[/COLOR][/FONT][/LEFT]
[FONT=Verdana][COLOR=#000000]
[LEFT]rewind = true; //set or rewind switch to true so it will play backwards…
[LEFT]}[/LEFT]
[/LEFT]
[/COLOR][/FONT]
[LEFT][FONT=Verdana][COLOR=#000000]this.onRelease = function() {[/COLOR][/FONT][/LEFT]
[FONT=Verdana][COLOR=#000000]
[LEFT]gotoAndPlay(49);
[LEFT]}[/LEFT]
[/COLOR][/FONT]
[/FONT]
Is there an easy mod for this tutorial to make it do the behaviour I want?
[/LEFT]