PDA

View Full Version : Coloring problem


fubar_bg
04-03-2006, 07:55 AM
Hi all,


i have the following problem:
- in a movie, i attach "n" movies from a custom movie class.
- in every attached movie, onrollover i attach on it another movie class (popup), that shows information. So all the "n" movies have different colors (red, green, blue - depending of values in %s). But, when i color them, the attached to them movie changes its color too. Here is an example:

this is the class i invoke "n" times and create "n" movies from it (its just a square, and i call it like this:

clip_7[0] = attachMovie("expMap", "clip_7"+0, 8000+0,{_x:wid+0.5, _y:hei+0.5, _width:(lice2/movie_h)-0.5, _height:(lice3/mas_7_wid)-0.5});

and the class:

dynamic class expMap extends MovieClip
{
var bgcolor:Number = 0;
var dpth:Number = 0;

function onEnterFrame()
{
if (this.variation > 0)
bgcolor = 0x00CC00;
else if (this.variation < 0)
bgcolor = 0xFF0000;
else
bgcolor = 0x0000FF;

myColor = new Color(this);
myColor.setRGB(bgcolor);
}


function onRollOver()
{
//this.dpth = this.getDepths();
this.swapDepths(1000000000);

mov = attachMovie("infobox", "mov", 50001);
//mov.swapDepths(1000000001);

mov._height = (70 / this._height)*mov._height;
mov._width = (200 / this._width)*mov._width;
mov._alpha = 50;


mov.startDrag(true);

mov.infobox_text = this.msg ;
}


function onRollOut()
{
mov._visible = false;
this.swapDepths(this.dpth);
}

function onPress()
{
//.....................
}
}


Any help will be appriciated.
10x in advance!

fubar.

Xeef
04-03-2006, 02:14 PM
hi and welcome to As.Org

that's how they bahave
if you change the color of a clip ALL it's children get this color



fubar ;)

pixelwit
04-03-2006, 10:13 PM
Turn the graphic (you say it's a square) inside your expMap clip into a MovieClip then use the colorObject on that child clip rather than the whole expMap clip.

-PiXELWiT
http://www.pixelwit.com