Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Here i'm setting the buttons that move between frames.
- //When i add iTextBoxes.gotoAndStop(activeFrame); it errors.
- //I want the textbox movieclip frames to switch sync to the main frames.
- function controlNext(event:MouseEvent):void { //Go to next frame
- if (activeFrame <= numFrames) {
- iControler.iPlayPause.gotoAndStop(1);
- activeFrame ++;
- gotoAndStop(activeFrame);
- iTextBoxes.gotoAndStop(activeFrame);
- isPaused = false;
- playAll();
- }
- }
- function controlBack(event:MouseEvent):void { //Go to previous frame
- if (activeFrame >= 2) {
- iControler.iPlayPause.gotoAndStop(1);
- activeFrame --;
- gotoAndStop(activeFrame);
- iTextBoxes.gotoAndStop(activeFrame);
- isPaused = false;
- playAll();
- }
- }
- //This is the code i have on frame 1 of the iTextBoxes movieclip
- stop();
- var currentLetter:Number = 0;
- function setText(currentMessage:String, textBox:TextField):void {
- var writingInterval:Number = setInterval(autoWrite, 100);
- function autoWrite():void {
- if (currentLetter <= currentMessage.length) {
- textBox.text = currentMessage.substr(0, currentLetter) + "█";
- currentLetter ++;
- } else {
- clearInterval(writingInterval);
- gotoAndStop(nextFrame);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment