3 Replies Latest reply on Sep 1, 2009 2:18 PM by babo_ya

    Embedded Image Class Instantiating Error

    archenil Level 1



      I have an embeded image class. When trying to create an instance of this Class object, a "Type Coercion failed" error came up.  I've included my code below. If someone would enlighten me on the right way to do that I would appreciate it.


                [Embed(source="assets/images/flagicon.png", mimeType="application/octet-stream")]
                private var flag:Class;


                var myByteArr:ByteArray = new flag();

                //Type Coercion failed: cannot convert 'flag' to flash.utils.ByteArray.