Hello :)

A gif asset is not a Shape class but a Bitmap ?

try the flash.utils.describeType method to see the real inherited class :

trace( describeType( newImage ) ) ;

If you write "as Shape" the new filter object is null ... use other display
class (Bitmap) to cast your variable.

EKA+ :)



2009/5/13 ACE Flash <[email protected]>

> hi there, I'd like to use pure  actionscript 3 to embed my assets in flash.
> and use addChild() to add them on the stage.
>
> The code seem doesn't work for me, any suggestions?
>
> thanks
>
>
>        [Embed(source="/assets/img1.gif" , mimeType="image/gif")]
>        public var newImage:Class;
>
>        [Embed(source="/assets/img2.gif" , mimeType="image/gif")]
>        public var oldImage:Class;
>
>
>            var img1:Shape= new newImage() as Shape;;
>            addChild( img1 );
> _______________________________________________
> Flashcoders mailing list
> [email protected]
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to