0
votes

I want to create a login database in Flash via MySQL PHP route. I copied a large portion of the code from some tutorials. My login basically contains users entering their email address picking a password and I have a basic Combobox.

When I run the code I receive this error...

ReferenceError: Error #1069: Property data not found       fl.controls.Button and there is no default value.
    at phpRegister_fla::MainTimeline/btnHandler()

I have debugged Flash but I don't get any additional information.

After searching online I still don't understand what is causing the error.

I hope my code will help you pinpoint where I am going wrong. Apologies its kind of long. Any help much appreciated.

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);
}
2
I'm guessing there's no 'data' found on event.target. - user1888370

2 Answers

0
votes

There probably isn't anything wrong with the code. It is rather that you are using a component that doesn't exist in the "standard flash library" namely fl.controls.button. In order for you to be able to use that you need to add a linkage to that component.

Since you didn't mention how you compile your code it is kinda hard to tell you what to do. However, you probably don't need the fl-button but could do with a "SimpleButton" or "Movieclip" or something else instead.

If Flash: http://forums.adobe.com/message/4260710?tstart=0

Similar issue: AS3 Error: '1172: Definition fl.controls:Button could not be found.'

More info: http://www.actionscript-flash-guru.com/blog/14-flcontrols-not-found-how-do-i-import-the-fl-package

0
votes

In your btnHandler function you have :

... event.target.data.systemResult ...

Where event.target seem to be an fl.control.Button object. Those objects have no "data" property. i don't know what you are looking for in event.target.data.systemResult ?