This content has been marked as final. Show 4 replies
I'm just coming to this myself. AS3 wouldn't be very useful if something like this couldn't be done. If you check the help files (which have really gone down hill!) you will notice that the MovieClip class has almost no methods or properties anymore, so I don't think you will be able to to much with a MovieClip instance anyways. For manipulating visual objects with AS3, I think you need to look at the DisplayObject class. So something along the lines of:
I have place at design time an imported PNG on the stage and made it into a symbol. I gave that symbol an instance name of myPic.
Exactly what I was looking for. Thanks.
Okay, remember the part where I said I'm just coming to the myself? Well this also works:
I really don't understand the difference between Sprite and DisplayObject yet so I'm a bit confused. At first I thought that it would make a difference if myPic was just a static movieclip vs having a timeline. But even when I added a timeline motion tween to myPic both codes seemed to work.
It might be because by placing the clip on the stage at authortime it has already been added to a DisplayObject at publish time (just one I didn't explicitly create).
But then it gets even stranger, because if you check the Sprite class it doesn't have the alpha property, but I guess it inherits from DisplayObject (several steps above) so that is where it comes from.
So can anybody else shed any light on when to use Sprite and when to use DisplayObject?
MovieClip inheritance is
MovieClip -> Sprite -> DisplayObjectContainer -> InteractiveObject ->
DisplayObject -> EventDispatcher -> Object
The alpha property is defined in the DisplayObject class, so both MovieClip
and Sprite inherit the property.