Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5937279
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:31:01+00:00 2026-05-22T15:31:01+00:00

I want to integrate my flash file with php code. I got the below

  • 0

I want to integrate my flash file with php code. I got the below code from

http://www.kirupa.com/developer/actionscript/flashphpxml_integration2.htm

function lv(l, n, t, e, f) {
    if (l == undefined) {
        l = new LoadVars();
        l.onLoad = function () {
            var i;
            n.htmlText = "";
            if (t == undefined) {
                n.htmlText += "<b>" + this["title" + e] + "</b><br>";
            } else {
                for (i = 0; i < this.n; i++) {
                    n.htmlText += "<a href='" + this["link" + i] + "'>" + this["title" + i] + "</a><br>";
                }
            }
        };
    }
    l.load(f);
}
lv(sites_txt, "cycle", null, "sites.php");

I did all the steps given in that forum but while running that code i got error Like

1180: Call to a possibly undefined method LoadVars.

Warning: 1060: Migration issue: The method LoadVars is no longer supported.  For more information, see the URLVariables class, the URLRequest.urlVariables and URLRequest.postData properties, and the URLLoader.dataFormat property..

1136: Incorrect number of arguments.  Expected 5.

I am new to the flash scripting please guide me how to troublshooting these

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T15:31:02+00:00Added an answer on May 22, 2026 at 3:31 pm

    Your example code was in AS2, here’s how you send and receive data from and to PHP using AS3 using:

    1. URLRequest
    2. URLLoader
    3. URLVariables

    Here’s a quick class I have made for you:

    package
    {
        import flash.net.URLRequest;
        import flash.net.URLLoader;
        import flash.net.URLVariables;
        import flash.net.URLRequestMethod;
        import flash.events.Event;
    
        public class PHPData extends Object
        {
            /**
             * Sends data to a PHP script
             * @param script A URL to the PHP script
             */
            public function send(script:String, vars:URLVariables):void
            {
                var req:URLRequest = new URLRequest(script);
    
                req.data = vars;
                req.method = URLRequestMethod.POST;
    
                var loader:URLLoader = new URLLoader();
                loader.load(req);
    
                // listeners
                loader.addEventListener(Event.COMPLETE, _complete);
            }
    
            /**
             * Called when a response has been received from a PHP script
             * @param e Event.COMPLETE
             */
            private function _complete(e:Event):void
            {
                var vars:URLVariables = new URLVariables(e.target.data);
    
                var i:String;
                for(i in vars)
                {
                    trace(i + ": " + vars[i]);
                }
    
                e.target.removeEventListener(Event.COMPLETE, _complete);
            }
        }
    }
    

    With this, you can send data to a given PHP script in the format of URLVariables.

    URLVariables are easily prepared like so:

    var vars:URLVariables = new URLVariables();
    
    vars.myvar = "some value";
    vars.myothervar = 30;
    

    Here’s a quick example I have mocked up for you which sends a string to PHP, then PHP sends back the string hashed as MD5 and also has a timestamp attached as a secondary value.

    var php:PHPData = new PHPData();
    
    var vars:URLVariables = new URLVariables();
    vars.myvar = "marty";
    
    php.send("http://projectavian.com/md5.php", vars);
    

    Your output for this will be something similar to:

    response: bb3761a33402b4f82806178e79ec5261
    time: 1306133172
    

    Just alter the _complete method in the PHPData class to handle your response data as required 🙂


    I’ll throw this in because your question has the mysql tag..

    All you need to do is your standard INSERT and SELECT queries in the PHP script and encode your result into this format:

    var=1&other=2&more=three
    

    So you could have..

    <?php
        mysql_connect(/* ?? */);
        mysql_select_db(/* ?? */);
    
        // INSERT example
        $thing = mysql_real_escape_string($_POST["thing"]);
        mysql_query("INSERT INTO table VALUES('','$thing')");
    
        // SELECT for response
        $id = mysql_real_escape_string($_POST["uid"]);
        $query = mysql_query("SELECT * FROM table WHERE id='$uid' LIMIT 1");
    
        // send response
        $r = mysql_fetch_assoc($query);
        echo 'fname=' . $r["first_name"] . '&lname=' . $r["last_name"];
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using the SWFUpload from http://www.anedix.com/data/file/news/realname/swfupload-php-example-v1_4.zip and want to integrate this into my
I want to integrate some existing Perl code with ASP.NET. I see plenty examples
I have a flash control that I want to integrate with in SharePoint and
I want to integrate openid authentication into my php application. It must support authentication
While trying to integrate Yahoo Media Player into my own website, I want to
I want to loop over the contents of a text file and do a
Is there any way to integrate an flash mp3 player into a html site
i want to integrate my application with 3rd party application, my understanding is that
i want to integrate googles ads to my application. the one that you see
i want to integrate an affiliate script with a shopping cart, for that i

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.