PDA

View Full Version : Dynamic change of Background-Color


beeblebrox
07-12-2004, 12:11 PM
G'day,
i've got a big problem, please help!
The Idea:
A interactive Color-Game.
by rolling over a movieclip you can change the background-color.
Some MCs add a bit of green, some others add red etc.

//Each Movieclip (a_mov, b_mov etc.) contains a Button with Drag-ability:

on (press) {
startDrag(this,true);
}
on(release) {
stopDrag();
}

// The Main-Script:

a_mov.onRollOver = function() {
trace("hello, onRollOver be traced!");
r=rr;
r=rr+15;
};

fl = new Color(flaeche);
strr = r.toString(16);
strg = g.toString(16);
strb = b.toString(16);
rgb = strr+strg+strb;
f1.setRGB(parseInt(rgb, 16));


1. Is there a chance to get it work?
2. No TRACE-Output while Rollover....why?

I just checked the colorfade-tutorial
(http://www.actionscript.org/tutorials/advanced/Color_fade/index.shtml)
but did not understand...does anybody?

cobo
07-12-2004, 01:00 PM
have you checked the pathing...?

where is your a_mov ?!?
will the function be called?

cobo

beeblebrox
07-12-2004, 02:12 PM
sorry but
what do you mean?
how do i check the pathing?

beeblebrox
07-12-2004, 02:46 PM
Okay...
targetpath said:
_level0.a_mov

now, what does that mean?
perhaps you could post a
tutorial-link?

cobo
07-12-2004, 03:21 PM
at first give it a try with a blank flash file...

create a rectangle an give it the instance name of a_mov...

copy and paste your code onto the _root timeline (thatīs the main timeline...)

a_mov.onRollOver = function() {
trace("hello, onRollOver be traced!");
r=rr;
r=rr+15;
}


in line five, thereīs no need for a semicolon... ;)

recreate one step after the other to find out where the problem is...

cobo

beeblebrox
07-12-2004, 04:24 PM
Hey! Thank you!

:o