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 6551887
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:23:35+00:00 2026-05-25T12:23:35+00:00

I am really pulling my hair out with this one. Flash game, container swf

  • 0

I am really pulling my hair out with this one.
Flash game, container swf loads a img using the loader class.

The image is the map which will be used on the levels.

The problem im having is that I originaly had each level load the map image, convert to a bitmap, and us it to create x and y’s for colision detection.

the problem was that the game was loading and sometimes the map image hadent loaded.
It also ment that each level was loading the same image and if the above happened on the 3rd, 4th level it was very annoying.

So I need a way to load the image in the parent, but have it available to the child, however it must be available as at bitmap to work.

Here is the code I have

PARENT SWF:

(This code is in the constructor)

var mImageLoader = new Loader();
var anImageURLRequest:URLRequest = new URLRequest('http://example.com/Level-map.png');
mImageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete);
mImageLoader.load(anImageURLRequest);

The child SWF is then loaded outside of the constructor

CHILD SWF:

map1 = Bitmap(mImageLoader.content);
        bmd1 = map1.bitmapData;

        addChild(map1);

Obviusly the above doesnt work, but is ideally how I need it to work
Anyone got any Ideas?

Really need to access the loader object after its loaded the image frmo the child swf

Thanks

Andrew

  • 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-25T12:23:36+00:00Added an answer on May 25, 2026 at 12:23 pm

    If parent SWF has a reference to the loaded child SWF, you can just set a property of the child or call a child’s method to pass the bitmap. Here’s what I’m talking about:

    // Child.as
    public function setBitmap(value:Bitmap):void
    {
        addChild(value);
    }
    
    // Parent.as
    public function Parent()
    {
        // load child
        var loader:Loader = new Loader();
        loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadedChild);
        loader.load('Child.swf');
    }
    
    private function loadedChild(event:Event):void
    {
        var loaderInfo:LoaderInfo = event.currentTarget as LoaderInfo;
        loaderInfo.removeEventListener(Event.COMPLETE, loadedChild);
    
        // 'bitmap' contains the reference to your Bitmap
        var child:Child = loaderInfo.content as Child;
        child.setBitmap(bitmap);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm really pulling my hair out on this one, it seems that I'm having
Really ripping my hair out on this one. I have a JAAS Authentication Provider
This one has had me pulling out my hair. I've been trying to deserialize
I'm pulling my hair out over this one. I have an app that when
I'm pulling my hair out over this MSBuild issue. We're using TeamCity to build
I have been literally pulling my hair out with this one and its beginning
I've really been pulling me hair out on this for a while and would
I'm really pulling my hair out, this must be a simple problem, but I
I have really been confused by this one. After pulling from a repo, I
This problem of mine has me pulling my hair out. It's related to the

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.