TypeError: Error #1006: value is not a function

Dear All,

Please help!!!

I got this errors:


TypeError: Error #1006: value is not a function.
at My_Grid_gallery_fla::MainTimeline/processXML()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/onComplete()


When I try to run this code below (Could you all please help?):

import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.events.Event;
import flash.display.MovieClip;
import flash.media.Video;

[COLOR=#800000][/COLOR]
[COLOR=#800000]var columns:Number;[/COLOR]
[COLOR=#800000]var my_x:Number;[/COLOR]
[COLOR=#800000]var my_y:Number;[/COLOR]
[COLOR=#800000]var my_thumb_width:Number;[/COLOR]
[COLOR=#800000]var my_thumb_height:Number;[/COLOR]
[COLOR=#800000]var my_images:XMLList;[/COLOR]
[COLOR=#800000]var my_total:Number;[/COLOR]
[COLOR=#800000]
[/COLOR]

[COLOR=#800000]
[/COLOR]
[COLOR=#800000]var container_mc:MovieClip;[/COLOR]
[COLOR=#800000]
[/COLOR]

[COLOR=#800000][/COLOR]
[COLOR=#800000]var myXMLLoader:URLLoader = new URLLoader();[/COLOR]
[COLOR=#800000]myXMLLoader.load(new URLRequest(“gallery.xml”));[/COLOR]
[COLOR=#800000]
[/COLOR]

[COLOR=#800000]myXMLLoader.addEventListener(Event.COMPLETE, processXML);[/COLOR]
[COLOR=#800000]
[/COLOR]

[COLOR=#800000]function processXML(e:Event):void{[/COLOR]
[COLOR=#800000] [/COLOR]
[COLOR=#800000] [/COLOR]
[COLOR=#800000] [/COLOR]
[COLOR=#800000] var myXML:XML = new XML(e.target.data);[/COLOR]
[COLOR=#800000] [/COLOR]
[COLOR=#800000] [/COLOR]
[COLOR=#800000] columns = myXML.@COLUMNS;[/COLOR]
[COLOR=#800000] my_x = myXML.@XPOSITION;[/COLOR]
[COLOR=#800000] my_y = myXML.@YPOSITION;[/COLOR]
[COLOR=#800000] my_thumb_width = myXML.@WIDTH;[/COLOR]
[COLOR=#800000] my_thumb_height = myXML.@HEIGHT;[/COLOR]
[COLOR=#800000] my_images = myXML.IMAGE;[/COLOR]
[COLOR=#800000] my_total = myXML.lenght();[/COLOR]
[COLOR=#800000] [/COLOR]
[COLOR=#800000] createContainer();[/COLOR]
[COLOR=#800000] callThumbs();[/COLOR]
[COLOR=#800000] [/COLOR]
[COLOR=#800000]}[/COLOR]
[COLOR=#800000]
[/COLOR]

[COLOR=#800000]function createContainer():void{[/COLOR]
[COLOR=#800000] container_mc = new MovieClip();[/COLOR]
[COLOR=#800000] container_mc.x = my_x;[/COLOR]
[COLOR=#800000] container_mc.y = my_y[/COLOR]
[COLOR=#800000] addChild(container_mc);[/COLOR]
[COLOR=#800000]}[/COLOR]
[COLOR=#800000]
[/COLOR]

[COLOR=#800000]function callThumbs():void{[/COLOR]
[COLOR=#800000] for (var i:Number = 0; i < my_total; i++){[/COLOR]
[COLOR=#800000] var thumb_url = my_images.@THUMB;[/COLOR]

[COLOR=#800000] var thumb_loader = new Loader();[/COLOR]
[COLOR=#800000] thumb_loader.load(new URLRequest(thumb_url));[/COLOR]
[COLOR=#800000] [/COLOR]
[COLOR=#800000] thumb_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, thumbLoaded);[/COLOR]
[COLOR=#800000] }[/COLOR]
[COLOR=#800000]}[/COLOR]
[COLOR=#800000]
[/COLOR]

[COLOR=#800000]
*[/COLOR]
[COLOR=#800000]function thumbLoaded(e:Event):void{[/COLOR]
[COLOR=#800000]var my_thumb:Loader = Loader(e.target.loader);[/COLOR]
[COLOR=#800000]container_mc.addChild(my_thumb);[/COLOR]
[COLOR=#800000]}
[/COLOR]

Looking forward to hearing from you.

Best Regards,

Bunsak