# TypeError: Error #1006: value is not a function

**URL:** https://forum.kirupa.com/t/typeerror-error-1006-value-is-not-a-function/326135
**Category:** Uncategorized
**Created:** [November 24, 2011, 3:35pm UTC](https://forum.kirupa.com/t/typeerror-error-1006-value-is-not-a-function/326135 "2011-11-24T15:35:43Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![bunsak](https://avatars.discourse-cdn.com/v4/letter/b/58956e/32.png) [@bunsak](https://forum.kirupa.com/u/bunsak)
#### Post date: [November 24, 2011, 3:35pm UTC](https://forum.kirupa.com/t/typeerror-error-1006-value-is-not-a-function/326135/1 "2011-11-24T15:35:43Z")

</div>

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](http://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
