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

  • SEARCH
  • Home
  • 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 8410201
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T00:06:57+00:00 2026-06-10T00:06:57+00:00

I have a function in my AS3 that frequently calls a PHP file. It

  • 0

I have a function in my AS3 that frequently calls a PHP file. It fails and throws the error I used in the title. I always get this error message. But when I run it in a browser it works fine. I don’t know what seems to be the problem.This is my code:

    $function checkComplete(evt:MouseEvent):void {

    // Create A new URLVariables instance to store the variable
    var myVariables:URLVariables = new URLVariables();

    // Create a variable (e.g. username) to send
    myVariables.username = candidate_txt.text;

// Create a new URLRequest instance sending data to "ascom01.php"
var myRequest:URLRequest = new URLRequest("apm01.php");

// Send data using the POST method
myRequest.method = URLRequestMethod.POST;

// The data property of the request is set to the
// URLVariables instance (myVariables) to send to the PHP file.
// Note: myVariables stored the variable (e.g. candidate)
myRequest.data = myVariables;

// Create a new instance of the URLLoader class to work with.
// URLLoader.load( ) method should be used when we need the 
// sent variables returned back to Flash ActionScript.
var myLoader:URLLoader = new URLLoader;

//specify dataFormat property of the URLLoader to be "VARIABLES"
//This ensure that the variables loaded into Flash with the same variable names
myLoader.dataFormat = URLLoaderDataFormat.VARIABLES;

//Load the PHP file by using URLRequest
myLoader.load(myRequest);

//Listen when the loading of data COMPLETE
//Call the loadComplete function when the loading COMPLETE
myLoader.addEventListener(Event.COMPLETE, loadComplete);

}

// Hook up the button with the function checkComplete
enter_btn.addEventListener(MouseEvent.CLICK, checkComplete);

// This is the function that display the data returned back from PHP file
function loadComplete(evt:Event):void {

//Display the value with variable name "totalItem"
total_txt.text = evt.target.data.totalItem

//Get the value (string) with variable name "phpConfirm"
var myResult:String = evt.target.data.phpConfirm;

//Split the string into an Array
var myArray:Array = myResult.split("|");
//output_txt.text = "The number of items are: " + myArray.length;

var finalString = "";
var i:int;
for (i = 0; i < myArray.length; i++) {

finalString = finalString + myArray[i] + "<br>";
    }

    output_txt.htmlText = finalString;


    }`
  • 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-06-10T00:06:59+00:00Added an answer on June 10, 2026 at 12:06 am

    This exception arises because you have to deploy your php files into the php-server. Flash couldn’t run php code. You trying to launch it from disk C.

    So

    var myRequest:URLRequest = new URLRequest("apm01.php");
    

    should be something like

    var myRequest:URLRequest = new URLRequest("http://myhost:80/example/apm01.php");
    

    Other way, you could upload your flash file to the same folder on server, and launch it from there.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a function in my AS3 that frequently calls a PHP file. Most
I have an AS3 program that calls a function multiple times. The function must
I have an AS3 function that runs when a URLRequest fails. I need to
I have a function in my flash AS3 file. I'd like to pass a
I have a function defined in AS3 that's gonna be called from client side
I have an AS3 function that I need to end with calling another function.
I have an AS3 class with some getVideo function. I want to use this
I have function getCartItems in cart.js and I want to call that function in
I have function Start() that is fired on ready. When I click on .ExampleClick
I have a very simple AS3 app that draws few circles using drawing api

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.