Reputation: 63
I have a MovieClip called Tile, which has its own class. I have the below code in a for loop, which creates a grid.
var tile:MovieClip = new Tile();
tile.gotoAndStop(Floor1[i][u]+1);
tile.x = ((u-i)*tileh)+365;
tile.y = ((u+i)*tileh/2)+70;
addChild(tile);
tile.addEventListener(MouseEvent.ROLL_OVER, mouseover);
Now, there's another moveiclip in Tile called Outline. It is not a class. What I want to do is to have the Outline movieclip go to a frame when I roll over the tile variable with my mouse.
Below is the function for the mouse event. I have tried event.currentTarget.Outline.gotoAndStop(3) but it doesn't seem to work. I get a reference error #1069: Property Outline not found on Tile and there is no default value.
function mouseover(event:MouseEvent)
{
event.currentTarget.Outline.gotoAndStop(3);
}
Upvotes: 0
Views: 70
Reputation: 8159
Is Outline
(all variables should be lower case, camel case by the way. Capital implies it is a class name) a public variable? You should declare Outline in global scope as follows:
package com.blah.blah
{
public class Tile extends DisplayObjectContainer {
public var outline:DisplayObject;
public function Tile() {
// instantiate outline here
}
}
}
Basic explanation of access modifiers:
Upvotes: 1