Question

I am making a program in which I need to download dynamically generated JSON string and then decode and use it in Flash. When I play swf file, everything goes right, but when I publish it and try to play flash application in .html file it seems like I don't receive any data from server...

var urlString:String = "http://test.hfbiz.cz/utils/parc_coord?param=";
var wholeUrlString:String = urlString + wholeString;

// for example: http://test.hfbiz.cz/utils/parc_coord?param=2:764442_2_709_20


var myRequest:URLRequest = new URLRequest(wholeUrlString);
var myLoader = new URLLoader();
myLoader.addEventListener(Event.COMPLETE, onload);
myLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityError);
myLoader.addEventListener(IOErrorEvent.IO_ERROR, IOError);
myLoader.load(myRequest);
...

function onload(evt:Event):void
    {   
        vystup_txt.text = "Data Loaded ";

        var kompletParcelyPole:Array = [];
        var JSONdata:Object = JSON.parse(myLoader.data);
    }

Unfortunately I don't even get my tracing note "Data Loaded" when running in browser... Any ideas what can be done badly?

Was it helpful?

Solution

OTHER TIPS

First of all, get a FlashFirebug for tracing and other debugging you need in browsers.

As for data not being received, I think you're loading data from another domain and you're getting a security error. Try tracing out everything and look at the traces in FlashFirebug.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top