WEB Any Flash ActionScript 3.0 guru's in here?

Discussion in 'OT Technology' started by MikeTheVike1, Jan 8, 2008.

  1. MikeTheVike1

    MikeTheVike1 OT Supporter

    Aug 29, 2002
    Likes Received:
    I'm teaching myself as I go, currently I'm working with very basic XML files and loading them into flash.

    Basically what I want to do is read all the images in the XML file, and put them into an array that I can access to perform tweens and stuff on them. I have the XML file loaded into flash, but I'm having problems with loading it into an Array, and then accessing them. if anyone wants to take a look at my code so far, that would be awesome...

    I'm getting this error right after the trace("good to go") command using my current code....

    TypeError: Error #1006: value is not a function.
    at portfolio_test_03_fla::MainTimeline/loadIMG()
    at portfolio_test_03_fla::MainTimeline/imgLoaded()

    //Declare variables
    var imgArray:Array = new Array();
    var imageLoader:Loader; 
    var xml:XML;
    var xmlList:XMLList; 
    var xmlLoader:URLLoader = new URLLoader(); 
    xmlLoader.load(new URLRequest("xmldata/images.xml")); 
    var xmlLength:int = 0;  
    xmlLoader.addEventListener(Event.COMPLETE, xmlLoaded); 
    function xmlLoaded(event:Event) :void {     
         xml = XML(event.target.data);
         xmlList = xml.children();     
         xmlLength = xmlList.length();     
         for (var i:int = 0; i<xmlLength; i++) {
              imageLoader = new Loader();
              imageLoader.load(new URLRequest(xmlList[i].attribute("href")));
              imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, imgLoaded);
    function imgLoaded(event:Event) :void {
         trace("xmlLength" + " " + xmlLength);        
         if (imgArray.length == xmlLength) {            
    function loadIMG() {     
         trace("good to go");     
         for (var j:int = 0; j<imgArray.length(); j++) {         

    And if anyone is messing with AS3 and wants my code for a simple image viewer that slides pictures in with "next" and "previous" buttons, I'll post it.

Share This Page