Quesion about the background colour

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?

you can’t change the background on the fly

i’d use the rectangle :slight_smile:

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

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.

i posted something in the as section :slight_smile:

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

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)

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! :slight_smile:

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

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

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

first frame:

place your rectangle and this actions in the timeline

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 =)

I know how to do it :slight_smile: 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!

ok then … good luck

and i should go back to work :sure:

All done, for what its worth :slight_smile:

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

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]

lol :stuck_out_tongue:

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

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