Advanced Search

Results 1 to 3 of 3

Thread: Flash + MySql

  1. #1
    Join Date
    Oct 2009
    Location
    Seattle, WA
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Flash + MySql

    So I am attempting to set up a form in flash that communicates with a database. I followed the instructions on a tutorial (http://www.developphp.com/Flash_tuto...ial.php?tid=39), and got the sample to communicate with our database. That shows me that my php script is working correctly, but when I copy the sample into my flash file, the flash no longer talks with the database.

    I copied the form fields into a new layer, and copied the action script exactly. Here is the action script:

    // Btn listener
    submit_btn.addEventListener(MouseEvent.CLICK, btnDown);
    // Btn Down function
    function btnDown(event:MouseEvent):void {


    // Assign a variable name for our URLVariables object
    var variables:URLVariables = new URLVariables();
    // Build the varSend variable
    // Be sure you place the proper location reference to your PHP config file here
    var varSend:URLRequest = new URLRequest("http://www.auraseattle.com/config_flash2.php");
    varSend.method = URLRequestMethod.POST;
    varSend.data = variables;
    // Build the varLoader variable
    var varLoader:URLLoader = new URLLoader;
    varLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
    varLoader.addEventListener(Event.COMPLETE, completeHandler);

    variables.first_name = uname_txt.text;
    variables.last_name = uname2_txt.text;
    variables.email = uname3_txt.text;
    variables.phone_number = uname4_txt.text;
    variables.birthday = uname5_txt.text;
    variables.sendRequest = "parse";
    // Send the data to the php file
    varLoader.load(varSend);

    // When the data comes back from PHP we display it here
    function completeHandler(event:Event):void{

    var phpVar1 = event.target.data.var1;
    var phpVar2 = event.target.data.var2;

    result1_txt.text = phpVar1;
    result2_txt.text = phpVar2;

    }


    }

    I am trying to figure out what might be the difference between the two flash files? The sample only has one frame, while mine has multiple frames and actions. Do I need to do something else to make the button work when clicked? I haven't set any on (release) { code yet.

    Let me know what other information I should provide. Thanks in advance!

  2. #2
    Join Date
    Oct 2009
    Location
    Seattle, WA
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default more info

    I'm thinking the problem might be that the working sample flash file has one frame, while the problematic file I am attempting to place the form in has a whole movie?

  3. #3
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Quote Originally Posted by johnse4 View Post
    I'm thinking the problem might be that the working sample flash file has one frame, while the problematic file I am attempting to place the form in has a whole movie?
    It might well be. Does the layer on which you have placed the code extend the length of the entire movie? If you have keyframes anywhere in there, the actions will stop at that frame.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •