title: AS3 JSON.decode throwing #1009 error
body: <p>I am using the as3corelib JSON library and decoding some JSON from a URLLoader request. However, I'm having issues with JSON.decode throwing an error:</p>
  
  <blockquote>
  <pre><code>TypeError: Error #1009: Cannot access a property or method of a null
  </code></pre>
    
    <p>object reference.  at
    com.adobe.serialization.json::JSONTokenizer/nextChar()
    at
    com.adobe.serialization.json::JSONTokenizer()
    at
    com.adobe.serialization.json::JSONDecoder()
    at
    com.adobe.serialization.json::JSON$/decode()
    at Main/drawMap()  at
    flash.events::EventDispatcher/dispatchEventFunction()
    at
    flash.events::EventDispatcher/dispatchEvent()
    at flash.net::URLLoader/onComplete()</p>
  </blockquote>
  
  <p>My code is as follows:</p>
  
  <pre><code> private function storeAssets(e:Event):void
   {
    // returned variables from PHP call
    var variables:URLVariables = new URLVariables(e.target.data);
    assets = JSON.decode(variables.assets);
   }
  </code></pre>
  
  <p>I have passed my JSON input into validators and it always returns as valid so I'm really scratching my head on this.</p>