Instantiate a BitmapData class from loaded child swf?

  • DartHead
  • Beginner
  • Beginner
  • User avatar
  • Posts: 56
  • Loc: NYC

Post 3+ Months Ago

I have a swf called "index.swf" that contains a bitmap in its library. This bitmap has a linkage identifier of "bg" and a class name of "BG".

I'd like to load "index.swf" into a MC I've called "container_mc" and set the background of the root SWF to the bitmap "bg" in "index.swf" using BitmapData.loadBitmap("bg"). How do I reference the "bg" bitmap in the child swf on the root timeline? Is this possible? Can someone give me some guidance?
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13502
  • Loc: Florida

Post 3+ Months Ago

http://www.kirupa.com/developer/flash8/ ... ibrary.htm
  • DartHead
  • Beginner
  • Beginner
  • User avatar
  • Posts: 56
  • Loc: NYC

Post 3+ Months Ago

That doesn't seem to work for bitmaps.

I set the linkage of the bitmap in library.fla to Export for runtime sharing, Export in first frame, and URL to "library.swf", and gave it an identifier of "image". I exported library.swf and saved and closed the library.fla.

Next in index.fla I imported library.fla as a library. I dragged the bitmap from library.fla into index.fla. From there the linkage was set to Import for runtime sharing with the URL and identifier the same.

Then I attempted to call bg:BitmapData = BitmapData.loadBitmap("image");

When I trace bg, it is undefined.

Am I missing something?
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13502
  • Loc: Florida

Post 3+ Months Ago

I don't know, never used that method, but Kirupa's generally a good source of info & that seemed like it would do the trick. :scratchhead:
  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

don't know why you try to set the background using: BitmapData = BitmapData.loadBitmap("image");
Isn't it more simple to create a movie clip, place it on the stage, name it's instance to bgMC, send it to back so it will act like a background and then use: bgMC.loadMovie("myBg.swf") or bgMC.loadMovie("myBg.jpg").
Maybe i think too simple ... don't know.
@joebert ... hmmm, when i first looked at your avatar, i read Ice instead of Joe.
Nice anyway :D

Post Information

  • Total Posts in this topic: 5 posts
  • Users browsing this forum: No registered users and 11 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.