PDA

View Full Version : Color change for emptyMovieClip



mariam
October 3rd, 2003, 09:06 PM
I'm loading external .swfs into an EmptyMovieClip. but i want to change the background color dynamically for some of the swfs but not all.
that is, sometimes the background color is white sometimes black. how do i do this?

maria

kode
October 3rd, 2003, 09:58 PM
You can't. :-\

You could work around this by drawing a fake background (a rectangle of the size of your movie), convert it into a movie clip and use the Color object to change its color. :)

http://www.macromedia.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary142.html

Or you could use the Drawing API, which would be something along these lines...

var bgcolor = 0x000000;
var bounds = this.getBounds();
this.beginFill(bgcolor, 100);
this.moveTo(bounds.xmin, bounds.ymin);
this.lineTo(bounds.xmax, bounds.ymin);
this.lineTo(bounds.xmax, bounds.ymax);
this.lineTo(bounds.xmin, bounds.ymax);
this.lineTo(bounds.xmin, bounds.ymin);
this.endFill();

mariam
October 4th, 2003, 08:57 PM
thanks for your reply kode. now i know that it can't be done i'm just going to draaw a black background when necessaary.
m

kode
October 5th, 2003, 12:00 AM
You're welcome. ;)