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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T01:54:10+00:00 2026-05-18T01:54:10+00:00

I’m trying to pull data into flash using JSON but i keep getting this

  • 0

I’m trying to pull data into flash using JSON but i keep getting this error

JSONParseError: Unexpected < encountered
 at com.adobe.serialization.json::JSONTokenizer/parseError()
 at com.adobe.serialization.json::JSONTokenizer/getNextToken()
 at com.adobe.serialization.json::JSONDecoder/nextToken()
 at com.adobe.serialization.json::JSONDecoder()
 at com.adobe.serialization.json::JSON$/decode()
 at jsonairtest_fla::MainTimeline/decodeJSON()
 at flash.events::EventDispatcher/dispatchEventFunction()
 at flash.events::EventDispatcher/dispatchEvent()
 at flash.net::URLLoader/onComplete()

even though i can runt the pp file in the browser and the ouput looks fine to me, i even tried calling up a txt file and that worked but i don’t know what am i doing wrong here.

Here is AS3 code

 import com.adobe.serialization.json.JSON

    var loader:URLLoader = new URLLoader();
    var request:URLRequest = new URLRequest();


    request.url = "pull.php";
    loader.load(request);

    loader.addEventListener(Event.COMPLETE, decodeJSON);


    function decodeJSON(event:Event):void{
    var loader2:URLLoader = URLLoader(event.target);
    //trace(event.target.data);
    var People:Array = JSON.decode(loader2.data);

    trace(People[0].NETWORKNAME) ; 
    trace(People[1].NETWORKNAME) ; 

      }

PHP code:

 <?php

       $host="localhost";
       $user="";
       $password="";
       $database="db name";
       $tablename="table name";

       header('Content-type: application/json');

       if(!$connection = mysql_connect($host,$user,$password))
        {
            //if connection not eastablished then display message and die
            $message = mysql_error();
            //echo "$message<br>";
            die();
        }else
        // in case the connection is eastablished 
        $message = "Connection eastablished.....";
        //echo"$message<br>";
         mysql_select_db($database,$connection)
            or die("database not found");
         $query = mysql_query("SELECT NETWORKNAME from $tablename);
        $returnArray = array(); 
         while($row=mysql_fetch_assoc($query))
         array_push($returnArray, $row);

        mysql_close();
        echo json_encode($returnArray);

    ?>
  • 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-18T01:54:11+00:00Added an answer on May 18, 2026 at 1:54 am

    To convert the response into an array of undecoded JSON objects, try this:

    var jsonArray:Array = loader2.data.match(/\{.*?\}/gi);
    

    Then simply loop through calling JSON.decode on each member of the array. 🙂

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

Sidebar

Related Questions

No related questions found

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.