Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8738503
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:44:37+00:00 2026-06-13T10:44:37+00:00

I am loading images for a game before the game begin. So the main

  • 0

I am loading images for a game before the game begin. So the main function sends links of images to an image loading object. This is what happen in my image loading object when I do image.load(link) in my main :

    public function charge(str:String, img_x:int, img_y:int, layer:Sprite):void
    {
        trace("load");
        urlRequest = new URLRequest(str);
        
        loaderArray[cptDemande] = new Loader();
        loaderArray[cptDemande].contentLoaderInfo.addEventListener(Event.COMPLETE, loading_done);
        loaderArray[cptDemande].load(urlRequest);
        
        posX[cptDemande] = img_x;
        posY[cptDemande] = img_y;
        
        layerArray[cptDemande] = layer;
        
        cptDemande++;           
    }

The parameters img_x:int, img_y:int and layer:Sprite are related to displaying the images afterward. I am using arrays to be able to add the images to the stage when the loading is all done.

The event listener fire this function :

    public function loading_done(evt:Event):void
    {
        cptLoaded++;
        evt.currentTarget.contentLoaderInfo.removeEventListener(Event.COMPLETE, loading_done);
        if((cptDemande == cptLoaded) && (isDone == true))
        {
            afficher();
        }
    }

what I want is to be able to target the good loader to remove the event listener. What I am currently using(evt.currentTarget) doesn’t work and generate an error code :

1069 Property data not found on flash.display.LoaderInfo and there is no default value

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T10:44:38+00:00Added an answer on June 13, 2026 at 10:44 am

    Tracing evt.currentTarget shows that currentTarget is the LoaderInfo property. Try updating your code as follows:

    public function loading_done(evt:Event):void
    {
        cptLoaded++;
    
        // Current target IS the contentLoaderInfo
        evt.currentTarget.removeEventListener(Event.COMPLETE, loading_done);
        //evt.currentTarget.contentLoaderInfo.removeEventListener(Event.COMPLETE, loading_done);
        if((cptDemande == cptLoaded) && (isDone == true))
        {
            afficher();
        }
    }
    

    Just a wee tip for you while I’m at it, you could make life a lot easier for yourself by storing all the properties of your images on an Object and then pushing these onto a single Array, rather than managing a separate Array for each property.

    Something like this:

        private var loadedImages:Array = new Array();       
    
        public function charge(str:String, img_x:int, img_y:int, layer:Sprite):void
        {   
            var urlRequest:URLRequest = new URLRequest(str);
    
            var loader:Loader = new Loader();
            loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loading_done);
            loader.load(urlRequest);
    
            var imageData:Object = { };
            imageData.loader = loader;
            imageData.posX = img_x;
            imageData.posY = img_y;
            imageData.layer = layer;
    
            // Now we have a single Array with a separate element for 
            // each image representing all its properties
            loadedImages.push(imageData);
    
            cptDemande++;           
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I read in a Game tutorial how to load images, and they did this:
Having some annoying issues with loading images into a BufferedImage (image in the example)
This code generates Low memory warning because background 5 thread is almostly loading images
I'm using Mika Tuupola's Lazy Load plugin http://www.appelsiini.net/projects/lazyload to delay loading images as you
I'm trying to get an image to load in a game that I am
I made this pacman game using an applet. When the applet finishes loading, it
During my game loop I am constantly loading images using BitmapFactory.decodeResource(getResources(), R.drawable.objectx); Most of
I'm working on a game, and I need to load multiple image files (png,
I am learning to create game in Java and requires loading several images in
Loading images into Flex (size < 100kb) causes IE7 memory increase by a megabyte

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.