Instantiate a BitmapData class from loaded child swf?

  • DartHead
  • Beginner
  • Beginner
  • User avatar
  • Joined: Feb 22, 2004
  • Posts: 56
  • Loc: NYC
  • Status: Offline

Post January 12th, 2007, 5:32 pm

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
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post January 12th, 2007, 5:32 pm

  • joebert
  • Sledgehammer
  • Genius
  • No Avatar
  • Joined: Feb 10, 2004
  • Posts: 13455
  • Loc: Florida
  • Status: Offline

Post January 13th, 2007, 12:10 am

http://www.kirupa.com/developer/flash8/ ... ibrary.htm
Strong with this one, the sudo is.
  • DartHead
  • Beginner
  • Beginner
  • User avatar
  • Joined: Feb 22, 2004
  • Posts: 56
  • Loc: NYC
  • Status: Offline

Post January 13th, 2007, 11:48 am

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
  • Sledgehammer
  • Genius
  • No Avatar
  • Joined: Feb 10, 2004
  • Posts: 13455
  • Loc: Florida
  • Status: Offline

Post January 13th, 2007, 12:42 pm

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:
Strong with this one, the sudo is.
  • IceCold
  • Guru
  • Guru
  • User avatar
  • Joined: Nov 05, 2004
  • Posts: 1254
  • Loc: Ro
  • Status: Offline

Post January 14th, 2007, 11:24 pm

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
“True mastery transcede any particular art. It stems from mastery of oneself - the ability, developed throgh self-discipline, to be calm, fully aware, and complety in tune with oneself and the surroundings. Then, and only then, can a person know himself. ”

Post Information

  • Total Posts in this topic: 5 posts
  • Users browsing this forum: No registered users and 52 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
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.