# Changing the bg colour of a flash site with actionscript

**URL:** https://forum.kirupa.com/t/changing-the-bg-colour-of-a-flash-site-with-actionscript/102275
**Category:** Uncategorized
**Created:** [February 21, 2004, 5:26pm UTC](https://forum.kirupa.com/t/changing-the-bg-colour-of-a-flash-site-with-actionscript/102275 "2004-02-21T17:26:52Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![cartoonfox](https://avatars.discourse-cdn.com/v4/letter/c/bb73d2/32.png) [@cartoonfox](https://forum.kirupa.com/u/cartoonfox)
#### Post date: [February 21, 2004, 5:26pm UTC](https://forum.kirupa.com/t/changing-the-bg-colour-of-a-flash-site-with-actionscript/102275/1 "2004-02-21T17:26:52Z")

</div>

hi, is there anyway to change the background colour of a flash site with actionscript. like when you press a button?

so, in this case [http://www.cartoonfox.hostrocket.com/cartoonfox-v4.html](http://www.cartoonfox.hostrocket.com/cartoonfox-v4.html) when you press a button, the WHOLE of the red changes to what ever colour?

thanks.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 21, 2004, 5:32pm UTC](https://forum.kirupa.com/t/changing-the-bg-colour-of-a-flash-site-with-actionscript/102275/2 "2004-02-21T17:32:17Z")

</div>

You can change the colour of a movieclip by using the Color object.

```auto

yourColor = new Color(yourmc);
yourColor.setRGB(0x000000);
//where 000000 is your hex colour value
// you can also use setTransform for more control:
yourColor.setTransform({ra:100,ga:100,ba:100,aa:100})
// ra is the amount of red on a scale of 100, ba is the same for blue, ga the same for green and aa the same for alpha

```

More info: [http://www.macromedia.com/support/flash/action\_scripts/actionscript\_dictionary/actionscript\_dictionary142.html](http://www.macromedia.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary142.html)

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 21, 2004, 5:46pm UTC](https://forum.kirupa.com/t/changing-the-bg-colour-of-a-flash-site-with-actionscript/102275/3 "2004-02-21T17:46:05Z")

</div>

hmmm, is there no other way than to use a movieclip? other wise i’ll have to make the movieclip the perfect size to prevent scrolling, but different browsers have slightly different sizes (due to browser tool bars etc)

thanks 🙂

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 21, 2004, 5:46pm UTC](https://forum.kirupa.com/t/changing-the-bg-colour-of-a-flash-site-with-actionscript/102275/4 "2004-02-21T17:46:18Z")

</div>

And you can also change the background color of the HTML document through Java\*\*\*\*Script:

```auto
var hex = 0xFFFFFF;
getURL("java **** script:void(document.bgColor="+hex+")");

```

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 21, 2004, 6:07pm UTC](https://forum.kirupa.com/t/changing-the-bg-colour-of-a-flash-site-with-actionscript/102275/5 "2004-02-21T18:07:11Z")

</div>

hey cool, thanks 🙂

except it doesnt change the colour right 😕

i put FF33CC which is a pink, but it came out darkish green!!

thanks

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 21, 2004, 6:08pm UTC](https://forum.kirupa.com/t/changing-the-bg-colour-of-a-flash-site-with-actionscript/102275/6 "2004-02-21T18:08:59Z")

</div>

It’s working fine here … don’t forget to use 0xFF33CC as hex value.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 21, 2004, 6:17pm UTC](https://forum.kirupa.com/t/changing-the-bg-colour-of-a-flash-site-with-actionscript/102275/7 "2004-02-21T18:17:33Z")

</div>

yeah i had 0xFF33CC, and it comes up as a darkish green, strange 😕

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 21, 2004, 6:30pm UTC](https://forum.kirupa.com/t/changing-the-bg-colour-of-a-flash-site-with-actionscript/102275/8 "2004-02-21T18:30:21Z")

</div>

That’s weird - have you got it online somewhere so we can check it out ?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 21, 2004, 6:42pm UTC](https://forum.kirupa.com/t/changing-the-bg-colour-of-a-flash-site-with-actionscript/102275/9 "2004-02-21T18:42:55Z")

</div>

don’t forget, there are only 216 safe web colors.

all the others may not look the same on Windows as they do on other Operating Systems…

Rev ![](http://aulman.com/rev.gif)

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 21, 2004, 6:56pm UTC](https://forum.kirupa.com/t/changing-the-bg-colour-of-a-flash-site-with-actionscript/102275/10 "2004-02-21T18:56:29Z")

</div>

FF33CC is a web safe colour. and i’m using a mac, IE.

i’ll put it online and see what happens.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 21, 2004, 7:00pm UTC](https://forum.kirupa.com/t/changing-the-bg-colour-of-a-flash-site-with-actionscript/102275/11 "2004-02-21T19:00:24Z")

</div>

here we go. press the pink text button.  
[http://www.cartoonfox.hostrocket.com/cartoonfox-v4.html](http://www.cartoonfox.hostrocket.com/cartoonfox-v4.html)

now i need to figure out how to change the swf bg colour… and help?

thanks 🙂

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 21, 2004, 7:11pm UTC](https://forum.kirupa.com/t/changing-the-bg-colour-of-a-flash-site-with-actionscript/102275/12 "2004-02-21T19:11:17Z")

</div>

you’ll have to use a mc, then change that…

unless you want to use transparent bg in Flash via HTML… only works in Macs w/player 7 installed, Windows Netscape/Mozilla w/player 7, and of course, all windows IE since IE4…

Then the javaScript will change the bg for all, since the Flash bg is transparent…

just had this issue with a site, and the client is on Mac OS9 AOL…

Rev ![](http://aulman.com/rev.gif)

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 21, 2004, 7:20pm UTC](https://forum.kirupa.com/t/changing-the-bg-colour-of-a-flash-site-with-actionscript/102275/13 "2004-02-21T19:20:45Z")

</div>

hmmm, i have flash player 7, but i can only publish in 6. i tried changing the publish settings for html to transparent window, but nothing changed when i tested it.

maybe i should not bother.

thanks 🙂

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 21, 2004, 7:22pm UTC](https://forum.kirupa.com/t/changing-the-bg-colour-of-a-flash-site-with-actionscript/102275/14 "2004-02-21T19:22:15Z")

</div>

either use an HTML editor (dreamweaver, etc) or ask someone to write it for you…

I think the saturation #'s are pretty hi on the player 7…

Rev ![](http://aulman.com/rev.gif)
