0
해당 코드를 사용하고 싶습니다.AS3 다른 장면에서 내 텍스트 상자를 지정하는 방법
username.text = amazing_text.text;
로그인 화면 클래스에서이 코드를 작동 시키려면 일반적으로이 클래스는 내 체인저 암호 장면 amazing_text를 보지 못합니다. 나는이 메인 클래스를 작동 시키려고 노력하지만 커다란 문제를 야기한다. 다른 장면에서 "amazing_text"를 어떻게 지정할 수 있습니까?
package actions {
import flash.display.MovieClip;
import flash.events.*;
import flash.net.*;
import flash.text.*;
public class main extends MovieClip {
public function main():void {
submit_button.buttonMode = true;
submit_button.addEventListener(MouseEvent.MOUSE_DOWN, checkLogin);
username.text = "";
password.text = "";
}
public function gotoscenetwo():void
{
MovieClip(root).gotoAndStop(1,"welcome");
}
public function checkLogin (e:MouseEvent):void {
if (username.text == "" || password.text == "") {
if (username.text == "") {
username.text = "Enter your username";
}
if (password.text == "") {
password.text = "Enter your password";
}
} else {
processLogin();
}
}
public function processLogin():void {
var phpVars:URLVariables = new URLVariables();
var phpFileRequest:URLRequest = new URLRequest("php/controlpanel.php");
phpFileRequest.method = URLRequestMethod.POST;
phpFileRequest.data = phpVars;
var phpLoader:URLLoader = new URLLoader();
phpLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
phpLoader.addEventListener(Event.COMPLETE, showResult);
phpVars.systemCall = "checkLogin";
phpVars.username = username.text;
phpVars.password = password.text;
phpLoader.load(phpFileRequest);
}
public function showResult (event:Event):void {
result_text.autoSize = TextFieldAutoSize.RIGHT;
result_text.text = "" + event.target.data.systemResult;
if(result_text.text == "undefined")
{
gotoscenetwo();
username.text = amazing_text.text;
}
else{
stop();
}
}
}
사진이 없습니다. 내 명성이 낮습니다. 그러나 나는 설명 할 수있다.
이것은 내 웹 사이트 프로젝트입니다. 첫 번째 로그인 화면이 있습니다. 사용자 이름과 암호가 올바른 경우 프로그램이 sceen을 환영하고 그 사용자가 암호를 변경하거나 웹 사이트를 탐색 할 수 있습니다. 일부 variable
에서
이 EcemAyhanoğlu @ 또 다른 문제는, 당신이 이름을'amazing_text있는 텍스트 필드가없는 것을 의미한다 ' – Cherniv
아이튠즈가 다시 작동하지 않습니다. 클래스를 볼 수 없습니다. amazing_text.text –
아니요, 그렇습니다.하지만 메인 클래스 심볼 클래스가 없기 때문에 클래스가 내 텍스트를 볼 수 없습니다. –