Help with JSON Decode Please look

Hey Friends, I have some code that I got from a working example tutorial. I thought this would work but am getting some errors I’m not familiar with. If any script gurus could take a quick look I would very much appreciate it. I’m new to JSON and rusty with AS. Many thanks.

The errors are:

TypeError: Error #1034: Type Coercion failed: cannot convert Object@2cf94c71 to Array.
at testJson_fla::MainTimeline/decodeJSON()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/onComplete()

The code is:


//import Jason.as class
import com.adobe.serialization.json.JSON;

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

//reading data from txt file

//Json can be called from any file like .txt .php etc. i Used here .txt
request.url = “http://api.brightcove.com/services/library?command=find_video_by_id&video_id=742822863001&video_fields=name,length,shortDescription&token=Hq5dquUiLfWbyvqt-RCRt1TTbMgp4iTZRYXsfJxcwDo5aajWJTN7TQ…&jsoncallback=?”;
loader.load(request);

//On load i’m calling this event which call decoding json class file;
loader.addEventListener(Event.COMPLETE, decodeJSON);

//decoding funtion;

function decodeJSON(event:Event):void
{

var loader:URLLoader = URLLoader(event.target);
var MarqueeData:Array = JSON.decode(loader.data);

trace(MarqueeData[0].name);
trace(MarqueeData[0].length);
trace(MarqueeData[0].shortDescription);

marqData.text = MarqueeData[0].name + "> " + MarqueeData[0].number + ">> " + MarqueeData[0].shortDescription;

}