-
try using this in the main timeline.
Code:
myMC_mc.onEnterFrame = function() {
if (this._currentframe==this._totalframes) {
_root.gotoAndStop("finish");
}
}
myMC_mc is the name of the buton animation you want to track. It tests to see if it has reached the end of the animation then goes and stops at the frame called finished on the root timeline. You would replace taht with the frame label you want it to jump to.
-
Thanks VI Knight. It works perfectly. You are good!
-
-
Thank you for all the help.
In the code that was posted for me, rollover is structured for 6 buttons. How would I go about extending it to more buttons? I tried changing the "7" in "for(var i=1; i<7; i++) {".
But this didn't do any thing. any ideas?
The code is included below (same as above).
stop();
var my_array=new Array();
dtext.html = true;
var buttonText:LoadVars = new LoadVars();
buttonText.onLoad = function(success) {
if (!success) {
dtext.htmlText = "<b>FAILED TO LOAD</b>"
trace("failed to load");
} else {
for(var i=1; i<7; i++) {
trace(eval("this.button"+i));
mc=eval("this.button"+i);
my_array.push(mc);
_root["mcbutton"+i].onRollOver = function(){
this.gotoAndPlay(2);
assignText(this);
}
_root["mcbutton"+i].onRollOut = function(){
this.gotoAndPlay(21);
dtext.htmlText = ""; }
}
}
};
buttonText.load("buttonText.txt");
function assignText(who){
dtext.htmlText = my_array[who._name.substr(-1)-1];
}
-
did you change the text file to also include the changes to the buttons? Reember that the script is running off of the text file so if you are adding extra buttons you have to remember to add them also in the text file as well as changing the "7" in the for(var i=1; i<7; i++) to match the number of buttons +1
-
Yes I did this I have the range extending well beyond 100 in the text file
thanx