Reputation: 21
Can someone pls help me on this. I had accident recently and forgot all of this. Now i want to work again on it...So..Thing is. I want some text field with submit button. When i input in text field certain number and clcik submit, then it takes me to corresponded frame when all the data regarding that number in input box will be. For example, i need to put number 100, and i dedicated frame 100 to that input, so user clcik submit and takes him to frame 100. Thank you very much I did find something like this
import flash.events.MouseEvent;
submitbtn.addEventListener(MouseEvent.CLICK, testPassword);
function testPassword(e:MouseEvent):void {
if (numbertext.text == "903") {
gotoAndPlay(903);
} else {
gotoAndPlay(200);
}
}
Something like that
Upvotes: 0
Views: 181
Reputation: 734
Pass number, not string to Number DataType.
import flash.events.MouseEvent;
import flash.display.MovieClip
var numbertext:Number = 0;
var MyClip:MovieClip = new MovieClip();
submitbtn.addEventListener(MouseEvent.CLICK, testPassword);
function testPassword(e:MouseEvent):void {
if (numbertext == 903) {
MyClip.gotoAndPlay(903);
}
else {
MyClip.gotoAndPlay(200);
}
}
Note if you add it to the frame use this.gotoAnPlay(number)
To learn more about gotoAndPlay()
visit ActionScript gotoAndPlay
Upvotes: 1