Hello all,
I am using the below AS to remake a menu button 6 times, which works fine and does it at a delayed interval, but I can not seem to effect each button, I thought this line below gave them intance names of menubtn0 thru menbtn6, but it isnt…
var menubtn = menubtn.duplicateMovieClip ("menubtn"+i, i);
Here is all the code, and I also attached the fla, any help would be greatly apprciated.
Thanks!
ActionScript Code:
[FONT=Courier New][LEFT]obj = [COLOR=#000000]**new**[/COLOR] [COLOR=#0000ff]Object[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR];
i=[COLOR=#000080]0[/COLOR];
obj.[COLOR=#000080]interval[/COLOR] = [COLOR=#000000]function[/COLOR]COLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR]
[COLOR=#808080]//trace(“interval function called”);[/COLOR]
[COLOR=#0000ff]if[/COLOR]COLOR=#000000[/COLOR][COLOR=#000000]{[/COLOR]
[COLOR=#000000]var[/COLOR] menubtn = menubtn.[COLOR=#0000ff]duplicateMovieClip[/COLOR] [COLOR=#000000]([/COLOR][COLOR=#ff0000]“menubtn”[/COLOR]+i, i[COLOR=#000000])[/COLOR];
[COLOR=#0000ff]_root[/COLOR][COLOR=#000000][[/COLOR][COLOR=#ff0000]“menubtn”[/COLOR]+i[COLOR=#000000]][/COLOR].[COLOR=#0000ff]_y[/COLOR] = i*[COLOR=#000080]17[/COLOR];
[COLOR=#0000ff]_root[/COLOR][COLOR=#000000][[/COLOR][COLOR=#ff0000]“menubtn”[/COLOR]+i[COLOR=#000000]][/COLOR].[COLOR=#0000ff]_x[/COLOR] = [COLOR=#000080]30[/COLOR];
[COLOR=#000000]}[/COLOR]
i++;
[COLOR=#000000]}[/COLOR]
[COLOR=#0000ff]setInterval[/COLOR][COLOR=#000000]([/COLOR] obj, [COLOR=#ff0000]“interval”[/COLOR], [COLOR=#000080]500[/COLOR] [COLOR=#000000])[/COLOR];
menubtn0.[COLOR=#0000ff]onRelease[/COLOR] = [COLOR=#000000]function[/COLOR]COLOR=#000000[/COLOR][COLOR=#000000]{[/COLOR]
pages.[COLOR=#0000ff]gotoAndStop[/COLOR]COLOR=#000000[/COLOR];
[COLOR=#000000]}[/COLOR]
menubtn1.[COLOR=#0000ff]onRelease[/COLOR] = [COLOR=#000000]function[/COLOR]COLOR=#000000[/COLOR][COLOR=#000000]{[/COLOR]
pages.[COLOR=#0000ff]gotoAndStop[/COLOR]COLOR=#000000[/COLOR];
[COLOR=#000000]}[/COLOR]
menubtn2.[COLOR=#0000ff]onRelease[/COLOR] = [COLOR=#000000]function[/COLOR]COLOR=#000000[/COLOR][COLOR=#000000]{[/COLOR]
pages.[COLOR=#0000ff]gotoAndStop[/COLOR]COLOR=#000000[/COLOR];
[COLOR=#000000]}[/COLOR]
menubtn3.[COLOR=#0000ff]onRelease[/COLOR] = [COLOR=#000000]function[/COLOR]COLOR=#000000[/COLOR][COLOR=#000000]{[/COLOR]
pages.[COLOR=#0000ff]gotoAndStop[/COLOR]COLOR=#000000[/COLOR];
[COLOR=#000000]}[/COLOR]
menubtn4.[COLOR=#0000ff]onRelease[/COLOR] = [COLOR=#000000]function[/COLOR]COLOR=#000000[/COLOR][COLOR=#000000]{[/COLOR]
pages.[COLOR=#0000ff]gotoAndStop[/COLOR]COLOR=#000000[/COLOR];
[COLOR=#000000]}[/COLOR]
menubtn5.[COLOR=#0000ff]onRelease[/COLOR] = [COLOR=#000000]function[/COLOR]COLOR=#000000[/COLOR][COLOR=#000000]{[/COLOR]
pages.[COLOR=#0000ff]gotoAndStop[/COLOR]COLOR=#000000[/COLOR];
[COLOR=#000000]}[/COLOR]
menubtn6.[COLOR=#0000ff]onRelease[/COLOR] = [COLOR=#000000]function[/COLOR]COLOR=#000000[/COLOR][COLOR=#000000]{[/COLOR]
pages.[COLOR=#0000ff]gotoAndStop[/COLOR]COLOR=#000000[/COLOR];
[COLOR=#000000]}[/COLOR]
[/LEFT]
[/FONT]
Thanks!
Dale