PaperKingdoms

July 17, 2007

Fade background color in new color : actionscript

Filed under: actionscript, code, design, flash, internet, open source, program, software, tutorial, web development — bardicknowledge @ 9:53 am

Have ya ever wanted to change your background color during runtime using actionscript instead of having a timeline event? Did you by any change want to have it fade from it’s current color to the new color with the click of a button?

Well, if so today’s your lucky day. For a site I’m working on I needed to make the buttons when clicks change the background color, so I set out to do it. The first and pretty much only problem I encountered was when you changed the background it would show the stage background and not the last color showed. So if I click red and then clicked orange I would want it to fade from red to orange. Well what I was getting was red, white, then fade to orange. But after about 15 minutes or so of playing I figured out a way around it.

So anyways, it works now and you can easily change the speed of fade by changing the alpha added to itself. Here’s the link. Hope it’s of some use to ya’s ^_^

Advertisements

1 Comment »

  1. How do you code the buttons? The as is put on the stage but what do you put on the buttons to change from one color to another?

    Thanks a bunch,

    Sam

    Comment by Samuel — January 22, 2009 @ 6:45 pm


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: