I have a custom class that extends MovieClip. The idea is that it allows for storing extra variables and information about the MovieClip.
public class MapObject extends MovieClip
{
private var cellX:int;
private var cellY:int;
public function MapObject()
{
}
}
I have several MovieClips (.swf files) that I load at runtime. The problem is, how can I make these MovieClip objects actually become MapObject objects?
I've tried :
var mapObject:MapObject = myMovieClip as MapObject;
but it gives null
PS. I know you can add variables dynamically to MovieClips, but I don't really want to do that.