Hi Rogers:

Thanks for the quick reply.  How should I alter the code below to make that work?  Also, how do I apply a Sclae-9 to the bitmap.  I’m relatively new to Flex.

Cheers,

Dave

 


From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Roger Gonzalez
Sent: Monday, February 13, 2006 12:16 PM
To: [email protected]
Subject: RE: [flexcoders] Using Embed not working in Beta (worked in Alpha)

 

Embedding bitmaps doesn't usually produce a Sprite, it usually produces
a SkinBitmap, which extends BitmapData.  So, you can't do that coersion.

(The "usually" qualification is because if you apply Scale-9 to your
bitmap, you do get a Sprite-derived subclass.)

-rg

> -----Original Message-----
> From: [email protected]
> [mailto:[EMAIL PROTECTED] On Behalf Of quasimotoca
> Sent: Friday, February 10, 2006 8:22 PM
> To: [email protected]
> Subject: [flexcoders] Using Embed not working in Beta (worked
> in Alpha)
>
> Hi:
> I used to do this in Flex alpha:
>
>             [Embed(source="images/mypicture.png")]
>                 private var MyPicture:Class;
>                 .....
>             public function MySprite()
>             {
>                     var c:UIComponent
>                   var s:Sprite
>                        
>                   MyButton = new UIComponent()
>                   MyButton.visible = false
>                   s = Sprite(new MyPicture())
>                   MyButton.addChild(s)
>                 .....
>                 }
>
> In the beta I get the following error:
>
> TypeError: Error #1034: Type Coercion failed: cannot convert
> [EMAIL PROTECTED] to flash.display.Sprite
>       at ..... [lots of stuff]
>
> Anyone else having similar trouble?  Any solutions greatly welcome!
> Cheers,
> Dave
>
>
>
>
>
>
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Search Archives:
> http://www.mail-archive.com/flexcoders%40yahoogroups.com
> Yahoo! Groups Links
>
>
>

>
>
>



--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




Reply via email to