Hi I am try to assign each menu btns to go to designated frames but it doesn't
work.
any idea would be greatly appreciated. thanks.
var menus = [aboutus, cd, awards, cl, news, contactus];
var frames = [2,3,4,5,11,12];
for(var j=0; j<menus.length; j++) {
menus[j].onRelease = function() {gotoAndStop(frames[j]);};
}
DMennenoh **AdobeCommunityExpert** - 17 Jul 2008 12:20 GMT
It doesn't work because of this:
gotoAndStop(frames[j]);};
frames[j] is not a local variable in the button clip. All buttons should go
to frame 12 the way you have it.
You can do like so to make a local var within each button:
var menus = [aboutus, cd, awards, cl, news, contactus];
var frames = [2, 3, 4, 5, 11, 12];
for(var j = 0; j < menus.length; j++) {
menus[j].myFrame = frames[j];
menus[j].onRelease = function() {gotoAndStop(this.myFrame);};
}

Signature
Dave -
www.offroadfire.com
Head Developer
http://www.blurredistinction.com
Adobe Community Expert
http://www.adobe.com/communities/experts/
ibrubru - 17 Jul 2008 15:31 GMT
Actually it didn't even go to frame 12 the way I had it
but I'm glad it's all working fine now.
thank you, Dave.
DMennenoh **AdobeCommunityExpert** - 17 Jul 2008 19:13 GMT
>>Actually it didn't even go to frame 12 the way I had it
Ah, right - because when the loop ends j is equal to the length of the menus
array - 6. So frames[6] would be undefined...

Signature
Dave -
www.offroadfire.com
Head Developer
http://www.blurredistinction.com
Adobe Community Expert
http://www.adobe.com/communities/experts/