Link to home
Start Free TrialLog in
Avatar of skibama1
skibama1

asked on

Dynamically change stage color

Is there a way to change the stage color on a button press?
Avatar of Billystyx
Billystyx

you can use this:
my_color = new Color(targetmc);
my_color.setRGB(0x993366);

to dynamically change the colour of a clip - but not directly to the stage colour - create a stage sized square mc, lay it underneath everything else and give it an instance name to reference as above.

billystyx
Avatar of skibama1

ASKER

That would work but is there not a way to change the stage color itself.
not really - an idea just popped into my head - dont know if it will work - you could try loading an swf with a different colour bg to the main underneath it (the _level0 clip is the one that holds the bg colour) that may be a way of doing it if you are trying just so you know you can.
O/w, go with the mc on stage

billystyx
ASKER CERTIFIED SOLUTION
Avatar of sam85281
sam85281

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
By the way, because bgcolor is set to blank you need to set an initial color with actionscript or it will default to your body bgcolor.

To do this, in frame one pu this action:

getURL("javascript:changeBG(#);"); // Once again that should be the number (0,1,2,etc) that mayches the color designated in the array.

Also note that to test this you need to run the html file that contains the movie.  Trying to run just the swf or using ctrl+enter will just open a blank window.

Because of this, I usually save that stuff for last in the project so it's not so annoying during the design process.

-Sam