# Quesion about the background colour

**URL:** <https://forum.kirupa.com/t/quesion-about-the-background-colour/13659>\
**Category:** flash\
**Created:** [February 16, 2003, 2:18pm UTC](https://forum.kirupa.com/t/quesion-about-the-background-colour/13659 "2003-02-16T14:18:11Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sraet](https://avatars.discourse-cdn.com/v4/letter/s/aeb1de/32.png) [@Sraet](https://forum.kirupa.com/u/Sraet)\
**Post date:** [February 16, 2003, 2:18pm UTC](https://forum.kirupa.com/t/quesion-about-the-background-colour/13659/1 "2003-02-16T14:18:11Z")

</div>

Is it possible to change, while running, the background colour of a flash file or is making a borderless rectangle the entire size of the flash scene the easiest way to manipulate the background colour?

---

<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 16, 2003, 2:32pm UTC](https://forum.kirupa.com/t/quesion-about-the-background-colour/13659/2 "2003-02-16T14:32:01Z")

</div>

you can’t change the background on the fly

i’d use the rectangle 🙂

---

<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 16, 2003, 2:32pm UTC](https://forum.kirupa.com/t/quesion-about-the-background-colour/13659/3 "2003-02-16T14:32:45Z")

</div>

Do not suppose you could share a small snippet with the line that sets the colour of the rectangle to something 🙂

---

<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 16, 2003, 2:38pm UTC](https://forum.kirupa.com/t/quesion-about-the-background-colour/13659/4 "2003-02-16T14:38:03Z")

</div>

Come on Kax, wakie wakie, I wanna know! hehe. Ive tried searching the Flash MX help files but I can not seem to find a list of \_properties to give a go with the rectangle.

---

<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 16, 2003, 2:40pm UTC](https://forum.kirupa.com/t/quesion-about-the-background-colour/13659/5 "2003-02-16T14:40:14Z")

</div>

i posted something in the as section 🙂

```auto
newColor = new Color (instance)
colorTrans = colorVars = newColor.getTransform()

this.onEnterFrame = function () {
	for (k in colorVars) {
		colorVars[k] += (colorTrans[k] - colorVars[k]) * .1
	}
	newColor.setTransform(colorVars)
}

```

to change the color use the variable **colorTrans**

```auto
colorTrans = { ra:0, rb:0, ga:0, gb:0, ba:0, bb:0, aa:0, ab:0 }

```

ra is the percentage for the red component (-100 to 100)  
rb is the offset for the red component (-255 to 255)  
ga is the percentage for the green component (-100 to 100)  
gb is the offset for the green component (-255 to 255)  
ba is the percentage for the blue component (-100 to 100)  
bb is the offset for the blue component (-255 to 255)  
aa is the percentage for alpha (-100 to 100)  
ab is the offset for alpha (-255 to 255)

---

<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 16, 2003, 2:41pm UTC](https://forum.kirupa.com/t/quesion-about-the-background-colour/13659/6 "2003-02-16T14:41:21Z")

</div>

Well thank ya muchly for the post… Deicded just to make a white square and alter the \_root.moveClipInstanceName.\_alpha value to get it to fade out of view (the desired end result)

Thanks for the help! 🙂

---

<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 16, 2003, 2:43pm UTC](https://forum.kirupa.com/t/quesion-about-the-background-colour/13659/7 "2003-02-16T14:43:46Z")

</div>

well … if you just want to change between 2 colors i guess it would be easier that way 😏

---

<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 16, 2003, 2:46pm UTC](https://forum.kirupa.com/t/quesion-about-the-background-colour/13659/8 "2003-02-16T14:46:29Z")

</div>

Suppose I should have been a bit more specific…

What I am doing is making a very short and sweet Preloader that doesnt really look like one… The % loaded of the movie will be the inverse alpha value of rectangle… So this will let the movie fade in before starting… Believe it or not its only 100x50 and the framerate can not keep up with loading the frames on a 56k modem, figured I didnt want a lil box with Loading written in it for the 5 seconds it takes to load and the fade in would look neat _shrug_

---

<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 16, 2003, 2:55pm UTC](https://forum.kirupa.com/t/quesion-about-the-background-colour/13659/9 "2003-02-16T14:55:31Z")

</div>

hmm … i see  
and you don’t know how to do that ??

first frame:

place your rectangle and this actions in the timeline

```auto
this.onEnterFrame = function () {
	bloaded = this.getBytesLoaded()
	btotal = this.getBytesTotal()
	percent = Math.round ((bloaded / btotal) * 100)
	rectangleInstance._alpha = 100 - percent
	if (bloaded == btotal) {
		this.play()
	}
}
this.stop()

```

i didn’t test it but it should work =)

---

<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 16, 2003, 3:06pm UTC](https://forum.kirupa.com/t/quesion-about-the-background-colour/13659/10 "2003-02-16T15:06:04Z")

</div>

I know how to do it 🙂 Thanks tho… The reason I didn’t say what exactually I wanted to do was cause I like trying to figure things out… But well… I looked through the help files for quite some time seeing how to change the background colour… I m ean it is a param you can set in HTML so there has to be a way to change it I would think… some how.

Thanks again tho!

---

<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 16, 2003, 3:14pm UTC](https://forum.kirupa.com/t/quesion-about-the-background-colour/13659/11 "2003-02-16T15:14:38Z")

</div>

ok then … good luck

and i should go back to work :sure:

---

<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 16, 2003, 3:42pm UTC](https://forum.kirupa.com/t/quesion-about-the-background-colour/13659/12 "2003-02-16T15:42:29Z")

</div>

All done, for what its worth 🙂

Varriation sorta on my signature (since it didnt resize well :))

[http://tears.ws/](http://tears.ws/) The top left corner will fade into black then run the animation.

[EDIT:PS]No laughing at my webbie, yes its emtpy, yes I just emptied it a few hours ago, yes I am attempting to make a new webbie![/EDIT:PS]

---

<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 16, 2003, 3:48pm UTC](https://forum.kirupa.com/t/quesion-about-the-background-colour/13659/13 "2003-02-16T15:48:21Z")

</div>

lol 😛

open the page the square is like 80% alpha  
.01 seconds later there’s no square 🙂

---

<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 16, 2003, 6:16pm UTC](https://forum.kirupa.com/t/quesion-about-the-background-colour/13659/14 "2003-02-16T18:16:31Z")

</div>

Hehe, Those of us with fast connections will notice either a one or none step fade 🙂 Honestly it only takes about 3 seconds to download it all on a 56k modem (according to the MX debugging interface)
