View Full Version : Loading bitmaps (images), mcs from the library
Mythic Fr0st
May 18th, 2007, 02:04 AM
Anyone know how to load bitmaps/mc's from the library onto the stage in AS3?
devonair
May 18th, 2007, 03:05 AM
You have to give the library items class names (such as "BitmapClass" or "MovieClipClass") in the linkage properties box, then just say something like:
// bitmap example
var myBmpData:BitmapClass = new BitmapClass(0, 0);
var myBmp:Bitmap = new Bitmap(myBmpData);
addChild(myBmp);
// mc example
var myMovieClip:MovieClipClass = new MovieClipClass();
addChild(myMovieClip);
jgallen23
May 25th, 2007, 02:33 AM
do you have to do any checking to see if it has been loaded or does flash preload everything thats in the library before it starts?
You have to give the library items class names (such as "BitmapClass" or "MovieClipClass") in the linkage properties box, then just say something like:
ActionScript Code:
// bitmap example
var myBmpData:BitmapClass = new BitmapClass(0, 0);
var myBmp:Bitmap = new Bitmap(myBmpData);
addChild(myBmp);
// mc example
var myMovieClip:MovieClipClass = new MovieClipClass();
addChild(myMovieClip);
TheCanadian
May 25th, 2007, 03:27 AM
Everything that is used in the library is compiled with the SWF when you publish the movie.
jgallen23
May 25th, 2007, 10:55 AM
is there any reason that some images wouldn't show up the first time I view the flash in a browser and then when I hit refresh they show up?
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.