I have a flash file with a MC "wmc" which contains the following script to randomize labels on load as well as for next and prev buttons to function. I used the prev/next btn scipt in a previous file but for some reason the buttons are no longer functioning in this one. I must be missing something elementary! I would greatly appreciate any help any of you could offer. The actual file is available via the following link (see the "workmc" MovieClip in layer "wimages"): http://senduit.com/3aa253
Thank you VERy much, in advance. (I'll have to put this forum on the payroll soon)Code:import flash.display.FrameLabel; function goRandNext(event:MouseEvent = null):void { var labels:Array=currentLabels; for (var i:uint = 0; i < labels.length; i++) { var label:FrameLabel=labels[i]; trace("frame " + label.frame + ": " + label.name); } var num:uint=Math.ceil(Math.random()*labels.length-1); label=labels[num]; trace(num +" -- "+"frame " + label.frame + ": " + label.name); gotoAndPlay(label.frame); } addEventListener(MouseEvent.MOUSE_UP,goRandNext); goRandNext(); r_btn.addEventListener(MouseEvent.CLICK, nextSection); l_btn.addEventListener(MouseEvent.CLICK, prevSection); function nextSection(event:MouseEvent):void { var thisLabel:String = currentLabel; var thisLabelNum:String = thisLabel.replace("sc", ""); var curNumber:Number = Number(thisLabelNum); if (curNumber < 5) { var nextNum:Number = curNumber + 1; gotoAndStop("sc" + nextNum); } } function prevSection(event:MouseEvent):void { var thisLabel:String = currentLabel; var thisLabelNum:String = thisLabel.replace("sc", ""); var curNumber:Number = Number(thisLabelNum); var prevNum:Number = curNumber - 1; gotoAndStop("sc" + prevNum); }![]()




Reply With Quote
