PDA

View Full Version : Empty Movie Clip Problem


nigeledge
03-24-2003, 06:42 PM
I'm trying to create a bunch of empty movie clips into a grid. Each clip is just a rectangle. I want to tie a mouseOver and mouseOut method to each clip to change the background color. Everything draws fine and the mouseover works... except that no matter which cell you mouseover, only the last cell actually updates or changes. Here's my code. Any suggestions?// initial positions
xPos = 15;
yPos = 80;

for(i = 0;i<20;i++)
{

// name of clip
gridClip = "grid" + i;

// create clip
_root.createEmptyMovieClip(gridClip,i+10);

// draw the rectangle
_root[gridClip].lineStyle(0,0xE6E6DC,100);
_root[gridClip].beginFill(0xEEEEEE,100);
_root[gridClip].moveTo(xPos,yPos);
_root[gridClip].lineTo(xPos+110,yPos);
_root[gridClip].lineTo(xPos+110,yPos+80);
_root[gridClip].lineTo(xPos,yPos+80);
_root[gridClip].lineTo(xPos,yPos);
_root[gridClip].endFill();

// mouseOver effect
_root[gridClip].onRollOver = function()
{
_root[gridClip]._alpha = 50;
}

// mouseOut Effect
_root[gridClip].onRollOut = function()
{
_root[gridClip]._alpha = 100;
}

// update position
xPos = xPos + 110;

}

tg
03-24-2003, 06:51 PM
change this part:

// mouseOver effect
_root[gridClip].onRollOver = function()
{
this._alpha = 50;
}

// mouseOut Effect
_root[gridClip].onRollOut = function()
{
this._alpha = 100;
}

nigeledge
03-24-2003, 06:57 PM
I should have known [slapping myself in the face].

Many thanks!