title: AdobeFlashCS6 Actionscript3 JSON: Exported SWF and HTML banner don't show JSON information
body: <p>I have a <em>.swf</em> banner that in adobe FlashCS6 plays fine,  but when I export it ( <em>.swf</em> and <em>.html</em>) the banner looses JSON information taken from online JSON file.</p>
  
  <p>What am I doing wrong?</p>
  
  <p>ActionScript Code:</p>
  
  <pre><code>play();
  import flash.display.Sprite;
  import flash.events.Event;
  import flash.net.URLLoader;
  import flash.net.URLRequest;
  
  var _jsonPath:String = yourURL;
  function init(e:Event = null):void 
  {
      removeEventListener(Event.ADDED_TO_STAGE, init);
  
      var loader:URLLoader = new URLLoader();
      var request:URLRequest = new URLRequest();
      request.url = _jsonPath;
      loader.addEventListener(Event.COMPLETE, onLoaderComplete);
      loader.load(request);
  }    
  init();  
  function onLoaderComplete(e:Event):void 
  {
      var loader:URLLoader = URLLoader(e.target);
      var jsonObject:Object = JSON.parse(loader.data);
      //JsonMan.decode(s:String):Object
      trace("loader.data: " + loader.data);
      trace(jsonObject[3].object.bets[0].title);
      if(i&lt;10){
          country1.text = String(jsonObject[i].object.bets[0].title).toUpperCase();
          country2.text = String(jsonObject[i].object.bets[2].title).toUpperCase();
          country1_odds.htmlText = String("&lt;b&gt;"+ jsonObject[i].object.bets[0].odds + "&lt;/b&gt;");
          country2_odds.htmlText = String("&lt;b&gt;"+jsonObject[i].object.bets[2].odds + "&lt;/b&gt;");
          x_odds.htmlText = String("&lt;b&gt;"+jsonObject[i].object.bets[1].odds + "&lt;/b&gt;");
          var today = new Date();
          var dd = today.getDate();
          var mm = today.getMonth()+1; //January is 0!
          var yyyy = today.getFullYear();
  
          if(dd&lt;10) {
              dd='0'+dd
          } 
          if(mm&lt;10) {
              mm='0'+mm
          } 
  
          today = mm+'-'+dd+'-'+yyyy;
          trace(today);
  
          obj_date.htmlText = String("&lt;b&gt;" + jsonObject[i].object.date + "&lt;/b&gt;");
          i++;
          if(i==9){
              i=0;
          }
      }
  }
  </code></pre>
  
  <p>Edit:</p>
  
  <p>In Chrome console it says: </p>
  
  <blockquote>
    <p>Failed to load resource: net::ERR_NAME_NOT_RESOLVED cloudssl.my.phpcloud.com/super/contentScript.js 2. 
    Failed to load resource: the server responded with a status of 404 (Not Found) api.topsport.lt/crossdomain.xml. 
    GET api.topsport.lt/crossdomain.xml 404 (Not Found) crossdomain.xml:1</p>
  </blockquote>
  
  <p>In output I receive this text:</p>
  
  <pre><code>    `TypeError: Error #1010: A term is undefined and has no properties.`
  `at TOPSPORT2_fla::MainTimeline/onLoaderComplete()`
  `at flash.events::EventDispatcher/dispatchEventFunction()`
  `at flash.events::EventDispatcher/dispatchEvent()`
  `at flash.net::URLLoader/onComplete()`
      `TypeError: Error #1010: A term is undefined and has no properties.`
  `at TOPSPORT2_fla::MainTimeline/onLoaderComplete()`
  `at flash.events::EventDispatcher/dispatchEventFunction()`
  `at flash.events::EventDispatcher/dispatchEvent()`
  `at flash.net::URLLoader/onComplete()`
  </code></pre>