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

  • Home
  • SEARCH
  • 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 546591
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T10:52:59+00:00 2026-05-13T10:52:59+00:00

I have a weird issue. I can get Event.COMPLETE to fire when I set

  • 0

I have a weird issue. I can get Event.COMPLETE to fire when I set

image.source = byteArray;

BUT

When I manipulate the byteArray – convert it to Bitmap and use image.source or image.load to load it, the bitmap gets loaded properly into the Image component; BUT Event.COMPLETE never fires. What might be wrong here? I have added an event lister for complete too! My source is as follows:

                var bmp:Bitmap = scaleBitmapData(bitmapData,280,220);
                imgPreview.addEventListener(Event.COMPLETE,onPreviewImageCompleted); // never fires
                imgPreview.visible = false;
                imgPreview.load(bmp); // does not work with .source either; image is displayed but Event.Complete never fires!

Thanks
Subrat

  • 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-05-13T10:52:59+00:00Added an answer on May 13, 2026 at 10:52 am

    So the class in play here is SWFLoader (Image extends SWFLoader). If you passed in the ByteArray or a url than it adds the appropriate listener. What you’ve done is fed it a Bitmap, which is a display object. Here is the important code that is loading a Bitmap into an Image:

     else if (classOrString is DisplayObject)
     {
         contentHolder = child = DisplayObject(classOrString);
         addChild(child);
         contentLoaded();
     }
    

    ByteArray:

    else if (byteArray)
    {
        loader = new FlexLoader();
        contentHolder = child = loader;
        addChild(child);
    
        loader.contentLoaderInfo.addEventListener(
            Event.COMPLETE, contentLoaderInfo_completeEventHandler);
        loader.contentLoaderInfo.addEventListener(
            Event.INIT, contentLoaderInfo_initEventHandler);
        loader.contentLoaderInfo.addEventListener(
            IOErrorEvent.IO_ERROR, contentLoaderInfo_ioErrorEventHandler);
        loader.contentLoaderInfo.addEventListener(
            Event.UNLOAD, contentLoaderInfo_unloadEventHandler);
    
        // if loaderContext null, it will use default, which is AppDomain
        // of child of Loader's context
        loader.loadBytes(byteArray, loaderContext);
    }
    

    a url:

    else if (url)
    {
        // Create an instance of the Flash Player Loader class to do all the work
        loader = new FlexLoader();
        contentHolder = child = loader;
    
        // addChild needs to be called before load()
        addChild(loader);
    
        // Forward the events from the Flash Loader to anyone
        // who has registered as an event listener on this Loader.
        loader.contentLoaderInfo.addEventListener(
            Event.COMPLETE, contentLoaderInfo_completeEventHandler);
        loader.contentLoaderInfo.addEventListener(
            HTTPStatusEvent.HTTP_STATUS, contentLoaderInfo_httpStatusEventHandler);
        loader.contentLoaderInfo.addEventListener(
            Event.INIT, contentLoaderInfo_initEventHandler);
        loader.contentLoaderInfo.addEventListener(
            IOErrorEvent.IO_ERROR, contentLoaderInfo_ioErrorEventHandler);
        loader.contentLoaderInfo.addEventListener(
            Event.OPEN, contentLoaderInfo_openEventHandler);
        loader.contentLoaderInfo.addEventListener(
            ProgressEvent.PROGRESS, contentLoaderInfo_progressEventHandler);
        loader.contentLoaderInfo.addEventListener(
            SecurityErrorEvent.SECURITY_ERROR, contentLoaderInfo_securityErrorEventHandler);
        loader.contentLoaderInfo.addEventListener(
            Event.UNLOAD, contentLoaderInfo_unloadEventHandler); 
    ...[this goes on for awhile]
    

    So you get the gist here. Don’t convert it to a Bitmap and you’ll get your complete event. You could also add ADDED_TO_STAGE to your Bitmap.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 339k
  • Answers 339k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You can handle the CanExecuteChanged event of the command May 14, 2026 at 4:24 am
  • Editorial Team
    Editorial Team added an answer There are big differences between how many heap one can… May 14, 2026 at 4:24 am
  • Editorial Team
    Editorial Team added an answer using Django-cron is much easier and simple EDIT: Added a… May 14, 2026 at 4:24 am

Related Questions

I have a page with a dropdown. The onchange event calls a Javascript function
UPDATE As Mathias notes below, this exact problem has been reported and resolved here:
I have a weird situation where I open a form from my application, hide
I'm using linq to sql for MySql (using DbLinq) in an ASP.NET MVC website.
I have the following file: <html> <head> <title></title> <link rel=css type=text/css href=/empty.css title=css />

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.