Why I can't push the images loaded into a table?

I'm just trying to load images in a small xml list and put them in a table, but I get a message like this:
TypeError: Error #1009: cannot access a property or method of a null object reference.
to thumbHolder / placePics)

It really tells me nothing! What I am doing wrong?

the code is here. I put a comment where is the problem (I left out the imports & stuff):

public class thumbHolder extends MovieClip {}
var xmlRequest:URLRequest;
var xmlLoader:URLLoader;
var imgData:XML;
var numberOfChildren:Number;
var currentImgNum:Number;
var imgLoader:Loader;
var imgContainer:Array;

public void thumbHolder() {}
xmlRequest = new URLRequest ("images.xml");
xmlLoader = new URLLoader (xmlRequest);
currentImgNum = 1;
xmlLoader.addEventListener (Event.COMPLETE, spreadPics);
}

public void spreadPics(e:Event):void {}
imgData = new XML (e.target.data);
numberOfChildren = imgData.*.length ();
for (var i: int = 0; i < numberOfChildren; i ++) {}
currentImg = imgData.image [i] .imgURL;
imgLoader = new loader;
imgLoader.load (new URLRequest (currentImg));
imgLoader.contentLoaderInfo.addEventListener (Event.COMPLETE, placePics);
}
}

function placePics(e:Event):void {}
var oldH:Number = imgLoader.height;
var oldW:Number = imgLoader.width;
imgLoader.height = 100;
var now: Number = (imgLoader.height / oldH) * 100;
imgLoader.width = (present * oldW) / 100;

-It's the line of code that accompanies the error! ----
imgContainer.push (imgLoader);
}

}

Sorry the underscore. For some reason I didn't right to the remove-_ -.

create you this table:

var imgContainer:Array;

should be

var imgContainer:Array = [];  new Array();

my previous message corrected a more serious problem that you will encounter if you do not use this code, too.

Tags: Adobe Animate

Similar Questions

  • I don't know why I can't download the image of my student during the proof of eligibility card?

    I am trying to download the image of my student card for proof that I'm amstudent, but when the presentation starts the image disappear. It is a jpeg image. How can we not

    How can I do?

    Please try using another web browser for you to bid.

    Moved to this discussion in the forum student and Teacher Edition Information.

  • erase the images loaded into the Gallery of xml to load another game

    I can't understand how to unload my already populated xml Gallery, before loading the new features:

    Here, the functions I want:

    //following 2 functions will be called by a button :
    
    
    // removes previously placed objects 
    function clearLoadedPictures():void {
      //
      
      //
    }
    
    // Load another ,xml to load new pictures set - ok : works fine
    function LoadNewPictures():void {
            //
            i_g = 0;
            //
               // xml data
                var xml_gallery:XML                = new XML();
                var xml_gallery_List:XMLList        = new XMLList;
                // XML data loader...
                var xmlUrlReq:URLRequest   = new URLRequest("xml/gallery2.xml");// gallery2.xml will replace gallery.xml already loaded
                var xml_gallery_UrlLoader:URLLoader = new URLLoader(xmlUrlReq);
                //
                xml_gallery_UrlLoader.addEventListener(Event.COMPLETE, xml_gallery_Complete);
                xml_gallery_UrlLoader.addEventListener(IOErrorEvent.IO_ERROR, xml_gallery_LoadFailed);
            
     }
    

    Here Gallery of xml code:

    var _mc:item;
    var total:int;
    var i_g:int;
    var id:int;
    //
    var btn_Gallery_Ready:Boolean;
    //
    
    var speedX:Number;
    var spaceR:Number;
    
    var img_gallery_Loader:Loader;
    //
    
    i_g = 0;
                //
               // xml data
                var xml_gallery:XML                = new XML();
                var xml_gallery_List:XMLList        = new XMLList;
                // XML data loader...
                var xmlUrlReq:URLRequest   = new URLRequest("xml/gallery.xml");
                var xml_gallery_UrlLoader:URLLoader = new URLLoader(xmlUrlReq);
                //
                xml_gallery_UrlLoader.addEventListener(Event.COMPLETE, xml_gallery_Complete);
                xml_gallery_UrlLoader.addEventListener(IOErrorEvent.IO_ERROR, xml_gallery_LoadFailed);
                //
                bottom24.gallery.content_mc.addEventListener(MouseEvent.ROLL_OVER, startScroll);
                bottom24.gallery.content_mc.addEventListener(MouseEvent.ROLL_OUT, stopScroll); //
    
    // xmlComplete function
            function xml_gallery_Complete(e:Event):void 
            {
                
            xml_gallery = XML(e.target.data); // 
                xml_gallery_List = xml_gallery.item;  // <item> in gallery.xml
                total = xml_gallery_List.length();
                spaceR = xml_gallery.attribute("space"); // specified in gallery.xml file as is : <gallery space="119" speed="0.2">
                speedX = xml_gallery.attribute("speed");
                //
                init_gallery();
    
            }//;
    
    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
            function xml_gallery_LoadFailed(e:IOErrorEvent):void {
                trace("Load Failed: " + e);
            }
    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
            function init_gallery()  // 
            {
                
                //bottom.gallery.content_mc.itemHolder_mc.
                
                _mc = new item(); //
                _mc.alpha = 0;
                //_mc.imgMask_mc.scaleY = 0;  // condition pour apparition des timbres ds la gallery - OLD
                _mc.imgMask_mc.alpha = 0; // condition pour apparition des timbres ds la gallery - NEW
                _mc.x = i_g * spaceR;
                
                _mc.btn.id = i_g; 
                _mc.btn.mouseChildren = false;
                 
                bottom24.gallery.content_mc.itemHolder_mc.addChild(_mc);
                //
                Tweener.addTween(_mc, {alpha:1, time:0.8, transition:"easeOutExpo"});
                //
    
                //
                _mc.online_mc.alpha = 0; //invisible sans roll over
    
                //
                
                if (xml_gallery_List[i_g].url != "")
                {
                    _mc.btn.buttonMode = true;
                    _mc.online_mc.visible = true;
                    //
                    btn_Gallery_Ready = true;
                    //
                }
                else 
                {
                    _mc.btn.buttonMode = false;
                    _mc.online_mc.visible = false;
                    //
                    btn_Gallery_Ready = false;
                    //
                }
                //
               
                //
                
                //
            var imgRequest:URLRequest = new URLRequest (xml_gallery_List[i_g].image); //
             img_gallery_Loader = new Loader(); // var imgLoader:Loader;
                img_gallery_Loader.load(imgRequest); //
                //
                img_gallery_Loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, imgLoading);
                img_gallery_Loader.contentLoaderInfo.addEventListener(Event.COMPLETE, img_gallery_Complete);
                //
                i_g++;
        
            }
    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
            function imgLoading(event:ProgressEvent):void // tiny preloader in bottom thumbs pics
            {
    
        _mc.preloader_mc.width = Math.round(img_gallery_Loader.contentLoaderInfo.bytesLoaded / img_gallery_Loader.contentLoaderInfo.bytesTotal * 100);
            }
    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    
            function img_gallery_Complete(event:Event):void
            {
                _mc.imgHolder_mc.addChild(img_gallery_Loader);
                
                Tweener.addTween(_mc.imgHolder_mc, {_saturation:0.9, time:0.6});// desaturate scrolling thumbs
                //_mc.imgHolder_mc.alpha = 0.5; // test
                
                // apparition des timbres ds la gallery, ici fade in : - NEW
                Tweener.addTween(_mc.imgMask_mc, {"alpha":1, delay:i_g / 20, time:0.4, transition:"easeOutExpo"});// test
                // apparition des timbres ds la gallery, ici image apparait de haut en bas : - OLD
                //Tweener.addTween(_mc.imgMask_mc, {"scaleY":1, delay:i_g / 10, time:1, transition:"easeOutExpo"});
                
                // la ligne de preloader qui diminue vers la gauche :
                Tweener.addTween(_mc.preloader_mc, {"scaleX":0, delay:0, time:1, transition:"easeOutExpo"});
                
                //
                _mc.btn.addEventListener(MouseEvent.ROLL_OVER, onMouseOver);
                _mc.btn.addEventListener(MouseEvent.ROLL_OUT, onMouseOut);
                _mc.btn.addEventListener(MouseEvent.CLICK, onMouseClick);
                //
                
                if (i_g < total)
                {
                    init_gallery();
                }
               //
            }
    


    Thank you

    If you try to remove all the children from bottom24.gallery.content_mc.itemHolder_mc, you can use:

    {while (bottom24. (Gallery.content_mc.itemHolder_mc.numChildren>0)}

    bottom24. Gallery.content_mc.itemHolder_mc.removeChildAt (0);

    }

  • I can't see the images received by using my Yahoo email in my MacBook Air, but I can see them in my iPhone 6, no idea why this is happening?

    I can't see the images received by using my Yahoo email in my MacBook Air, but I can see them in my iPhone 6, no idea why this is happening?

    Hello

    If you access your Yahoo mail via Mac Mail application, in the Mail menu bar, click Mail > Preferences , and then select the display tab to assure you that:

    Display remote messages HTML images is selected.

  • OOP, for the image loader

    Hi thanks for having a look at this post...

    I'd love to help getting started on OBJECT oriented programming.

    A charger base image, looks like this:

    var my_loader:Loader = new Loader();

    my_loader. Load (new URLRequest ("imagename.jpg"));

    movieclipinstancename.addChild (my_loader);

    All it does it is add an image to an empty movieclip.

    But when a lot of images must be loaded, I believe that OOP is the best way to do it - so you can do several Chargers?

    I am lost to know where to start to write the code for a generic charger, however.

    If anyone knows how to reach, and where I could learn, I'd appreciate it really.

    Thanks in advance!

    You can do almost anything with the classes.

    Here's a thread we had with a user about how to write classes. One of the aspects of this thread was the image loader:

    http://forums.Adobe.com/thread/607737?TSTART=0

  • why I can not get the same apps I have on my iPad?

    why I can not get the same apps I have on my iPad?

    Because they are different versions for different operating systems.

  • Can not see the images of the patent (i.e., D/359 691) on research of patent USPTO.gov, it tells me I need a plugin (7.7.1.0 Quicktime) that I've already updated.

    Can not see the images of the patent (that is, D/359 691) on USPTO.gov patent search, it tells me I need a plugin (Quicktime) that I've already updated.
    In the 'quick search' I give terms & it compiles a list. I have then cross to every doc and look to see the doc and associated drawings. I don't know what to say at this stage.

    Thank you.

    QuickTime cannot handle images in TIFF format.

    You can watch AlternaTIFF - http://www.alternatiff.com/

  • I can't open the images in Yahoo mail with 7 Firefox, but IE works.

    After several years of success with Yahoo mail and Firefox, I can longer open mail of Yahoo (jpg, bmp) images. I can open them in gmail with Firefox or IE. I can open them in Yahoo mail using IE. I am running Firefox 7.0.1 and I think, but am not sure, all my trouble started after the update to this version of Firefox.

    RESOLVED: Here is the solution to "I can't open the images in Yahoo mail with 7 Firefox, but IE works." Just before I log on my E-mail Yahoo site I turn on cookies, but I never enable third-party cookies. That has always worked very well until October 2011. Just after I installed the new Firefox 7 this problem started. Now I just found out that the problem is solved, if I enable cookies from third party. Users should not have to enable cookies from third party read the Yahoo mail via Firefox!

  • How/where can I find the image masters of my photos in the PHOTOS app?

    How/where can I find the image masters of my photos in the PHOTOS app?

    Pictures of launch and watch them. If you want to use the somewhere with other software, select them and export the original unmodified in a folder on the desktop and use there

    LN

  • How can I delete the images I posted in threads?

    I came here before and I've posted questions to people to help me. That being said, I sometimes had to post images to show the people what I was talking about. I find this kind of insecure, so I wanted to make sure I deleted all the images that I had posted before just for questions of security, so that no one else could see the photos I posted from my computer. Any suggestions on this subject, where I can find where to delete them?

    Yet once, not that we can see since the images have been emptied. Please let me know if there is anything else, my team and myself can help you. We're always here if you have questions and concerns in the future. Thank you!

  • How can you save the image to a google map that is contained in a Web site?

    How can you save the image to a google map that is contained in a Web site? I use a macbook at the beginning of 2011 pro and functional on OS X Yosemite 10.10.5. I would like to capture the image of the map and print it with a good quality.

    Take a screenshot and print that

    Google mapsHow to take a screenshot on your Mac - Apple Support

  • Why I can't open the attachment in Outlook express?

    Why I can't open the attachment in Outlook express?

    Try to save the first attachment, then try to open it.  See also www.oehelp.com/OETips.aspx#1

    Steve

  • need help, can not attach the image file to my yahoo mail.

    need help, trying to compose e-mail... can not attach the image file to my yahoo mail... using firefox. Vista starter edition

    using 3 G hsdpa usb modem, model huawei E156G

    download stats is 0.00 KB its not not download, http://img337.imageshack.us/img337/2547/3ginterface.jpg

    the strange thing is that if I only download small file/pic as 50 KB download data passes through, but as 1 MB image file or more it will not pass and remained at 0.00 kb

    I tried to run administrator (always on the standard user account)---> cmd---> ipconfig/flushdns, still the same problem.

    Hi korgmeister,

    1 when was the last time it was working fine?

    2. do you have security software installed on the computer?

    3. are you able to access all Web sites?

    First of all, I suggest that you try to download the file with Windows internet explore.

    If you are able to download using Windows internet explore, then there may be a problem with the Firefox browser.

    Uninstall and reinstall Firefox browser and check.

    If you are facing a similar issue when you use Internet explore, then it may be Internet problem try to download some other file or document check if it works.

    Also contact your internet service provider to check if the connection side there is fine.

    Go back with the results!

    I hope this helps!

    Halima S - Microsoft technical support.

    Visit ourMicrosoft answers feedback Forum and let us know what you think.

  • When I record video in portrait mode, it displays in the landscape. How can I activate the image?

    When I record video in portrait mode, it displays in the landscape. How can I activate the image?

    Go to [MENU]--> [reading]--> [rotation]. The image rotates when you press the Center button on the wheel.

    If my post answered your question, please mark it as "accept as a Solution.

  • Why I can still see the files deleted and renamed on a shared directory?

    Why I can still see the files deleted and renamed on a shared directory, but my co-workers can't see them? Is there a setting on my pc that I need to change?

    Hello
     
     
    Thanks for posting your question in the Microsoft Community.
     
     
    The question you posted would be better suited in the TechNet Forums.
     
    I would recommend posting your query in the link below.
     
     
    I hope that the information above helps you.

Maybe you are looking for

  • Cannot download pictures from a wireless OfficeJet Pro 8600 memory card more

    I can't figure out how to upload photos using the card slot.  I know that it doesn't like the previous (OfficeJet 7310 - Wired), but am unable to locate where the "drive" for the location. I tried to access the card reader by using the IP address, bu

  • Black screen problem and I have a real Windows XP Home Edition. Help, please!

    I have a genuine Windows XP Home Edition came with my Dell computer. After downloading the critical updates a few weeks ago, I now get the black screen and the message window saying that I may be victim of a counterfeit and that my system may be at r

  • How to send email with an attachment in Groovy?

    I have a user that is running remotely a groovy script to extract data from the Foglight Server.   When it executes this script, it has the ability to create a data file on the Foglight Server.  I would like to add a feature where this data file is s

  • Migration to 64-bit to 64-bit (Windows 7)

    I tried to migrate my settings of a machine of Windows 7 64 bit to another computer in Windows 7 64 bit using an easy transfer cable, but I received an error message that the migration from 64 to 64 - bit is not supported. Any suggestions?

  • Cisco Advanced Wireless LAN field specialist

    Hello.. I've passed the CCNA certification recently and wanted to get the specialist wireless but cannot find any info how to go to this topic - Cisco press didn't review guides for these apparently - or am I looking in the wrong places... Thanks in