我想通过 MySQL PHP 路由在 Flash 中创建一个登录数据库。我从一些教程中复制了大部分代码。我的登录基本上包含用户输入他们的电子邮件地址来选择密码,我有一个基本的组合框。
当我运行代码时,我收到此错误...
ReferenceError: Error #1069: Property data not found fl.controls.Button and there is no default value.
at phpRegister_fla::MainTimeline/btnHandler()
我已经调试了 Flash,但没有得到任何其他信息。
在网上搜索后,我仍然不明白是什么导致了错误。
我希望我的代码能帮助你查明我哪里出错了。道歉它有点长。非常感谢任何帮助。
import flash.net.URLVariables;
import flash.net.URLRequest;
import flash.net.URLLoader;
import flash.events.MouseEvent;
import flash.events.KeyboardEvent;
import flash.events.Event;
import flash.text.TextField;
import fl.data.DataProvider;
import fl.controls.Button;
btn_Submit.addEventListener(MouseEvent.CLICK, btnHandler);
//Validate form fields
function btnHandler(event:MouseEvent):void {
status_Txt.text = "" + event.target.data.systemResult;
trace(event.target.data.systemResult);
var phpVars:URLVariables = new URLVariables();
var phpFileRequest:URLRequest = new URLRequest("phpFile");
phpFileRequest.method = URLRequestMethod.POST;
phpFileRequest.data = phpVars;
phpVars.email = email.text;
phpVars.ps_wd = ps_wd.text;
var phpLoader:URLLoader = new URLLoader();
phpLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
}
textOneField.addEventListener(Event.CHANGE, changeHandler);
function changeHandler(event:Event):void {
trace("data entered");
}
textTwoField.addEventListener(Event.CHANGE, changeData);
function changeData(event:Event):void {
trace("data changed");
}
email.addEventListener(KeyboardEvent.KEY_UP, keyHandler);
ps_wd.addEventListener(KeyboardEvent.KEY_UP, keyEnter);
function keyHandler(event:KeyboardEvent):void {
if(event.keyCode == Keyboard.ENTER)
trace("keyboard was pressed");
}
function keyEnter(event:KeyboardEvent):void {
if (event.keyCode == Keyboard.ENTER)
trace("Enter button hit");
}
var persons:Array = new Array();
persons[0] = "Male";
persons[1] = "Female";
c_two.dataProvider = new DataProvider(persons);
c_two.addEventListener(Event.CHANGE, dataHandler);
function dataHandler(event:Event):void {
trace(event.target.value);
}