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 6214307
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T06:51:12+00:00 2026-05-24T06:51:12+00:00

I am new to action script 3.0. Help me to understand how can I

  • 0

I am new to action script 3.0. Help me to understand how can I load data with URLLoader.

So, I have an aplication like:

var PATH:String = "http://www.somesite.com/myFirstPage.php?a=10&b=20";


var urlRequest:URLRequest = new URLRequest(PATH);
var urlLoader:URLLoader = new URLLoader();
urlLoader.dataFormat = URLLoaderDataFormat.TEXT;
urlLoader.addEventListener(Event.COMPLETE, urlLoader_complete);
urlLoader.load(urlRequest);

function urlLoader_complete(evt:Event):void {
    some_result = urlLoader.data;
}

php script looks like:

<?php
//retrieve GET params

int c = a + b; //a and b come from GET request

return "{{"result_equal":"20"}}"; //result in JSON

?>

I don’t really understand how JSON result from .php page gets in my URLLoader object. Help me by simple example, please. Thanx!

  • 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-24T06:51:13+00:00Added an answer on May 24, 2026 at 6:51 am

    You need a few things here. First off, you’ll need a JSON library, because somehow it isn’t built into Flash, even with their modified E4X core:

    https://github.com/mikechambers/as3corelib

    This should give you the following bits of code:

    import com.adobe.serialization.json.JSON;
    
    function urlLoader_complete(e:Event):void 
    {
       var loader:URLLoader = URLLoader(e.target);
       var some_result:Object = JSON.decode(loader.data);
    }
    

    Now… your PHP code is a mess. The best way to create JSON is to just use the json_encode function:

    $retVal = array('result_equal'=>20);
    echo json_encode($retVal);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code in action script 3: async.addResponder(new Responder(result, defaultFaultHandler)); result is
I have a php/action.php. That script creats a file in the folder ../data/myfile.kml. After
I am a new to Action Script, so I am not sure if my
I am new to action script. I am trying to write a mouse out
I am very new to Action Script. I am using Flash Professional CS5 with
I'm new to the whole Action Script / Flash world...but trying to teach myself
I am new to flash and just learned some action Script 3 with some
I have this action script code that is working perfectly but i am try
Need your help, trying to change this script: https://github.com/MrHus/jquery-monthly-ical To load external JSON data
Is there an easy way to have a rails action load up an external

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.