SitePoint Sponsor

User Tag List

Results 1 to 7 of 7

Threaded View

  1. #1
    SitePoint Member
    Join Date
    Nov 2012
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Flash CS6 via php

    Hello Everybody,
    I am attempting to create a Flash login via the mysql database. I have created a database in mysql and I have edited two files fla in flash and a php file using notepad text editor. I want to send my URLVariables to the php script to check the variables stored in the mysql database. Problem is i am getting no information back.

    This is my fla code below: Can you please check my code for any mistakes. I copied this majority of the code from a tutorial. I am wondering if my connection url parameter to the php connection file is correct?

    Code:
    import flash.net.URLRequest;
    import flash.net.URLVariables;
    import flash.net.URLLoader;
    import fl.controls.Button;
    import fl.controls.TextInput;
    import flash.text.TextFormat;
    import flash.events.Event;
    
    //Requesting the php
    var phpFileRequest:URLRequest = new URLRequest(".flashexample/");
    
    phpFileRequest.method = URLRequestMethod.POST;
    
    //Assing the variable names
    //Build the variable
    var phpVars:URLVariables = new URLVariables();
    
    //Building the loader
    var phpLoader:URLLoader = new URLLoader();
    phpLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
    
    //Variables ready for sending
    phpVars.email = email.text;
    phpVars.password = password.text;
    
    
    phpLoader.load(phpFileRequest);
    
    phpLoader.addEventListener(Event.COMPLETE, showResult);
    
    function showResult (event:Event):void {
    
    statusTxt.text = "" + event.target.data.systemResult;
    trace(event.target.data.systemResult);
    
    }
    
    var mybutton:Button = new Button();
    mybutton.toggle = true;
    mybutton.x = 125;
    mybutton.y = 110;
    mybutton.width = 21;
    mybutton.height = 11;
    mybutton.label = "Send";
    mybutton.buttonMode = true;
    addChild(mybutton);
    
    var tf:TextFormat = new TextFormat();
    tf.font = "Arial";
    tf.size = 16;
    tf.color = 0x000000;
    
    
    var ti:TextInput = new TextInput();
    ti.x = 93.35;
    ti.y = 73.35;
    ti.width = 172.00;
    ti.height = 22.00;
    ti.editable = true;
    ti.enabled = true;
    ti.setStyle("textFormat", tf);
    addChild(ti);
    
    var tp:TextInput = new TextInput();
    tp.x = 95.35;
    tp.y = 121.90;
    tp.width = 172.00;
    tp.height = 22.00;
    tp.displayAsPassword = true;
    tp.editable = true;
    tp.enabled = true;
    tp.setStyle("textFormat", tf);
    addChild(tp);
    Last edited by Force Flow; Mar 4, 2013 at 10:54. Reason: added code tags


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
  •