[flexcoders] Re: Embed an image
One way is to create a JSP page on your server that reads the database and streams the content to the servlet output. In Flex, you can then set the mx:Image tag's source property to the URL of the JSP page. HTH, Doug --- In flexcoders@yahoogroups.com, moni_singhal [EMAIL PROTECTED] wrote: Actually i want to retrieve an image in a Flex Component (Flex 1.5 Application) from a java file (in java file i am getting the image from the database ). As mx:Image tag only takes source as an attribute .How should i do this ? Thanks, Monika
[flexcoders] Re: Embed an image
You should just be able to send the content-type:image/jpg header in the response (from your servlet/bean) and load it from the url of the servlet. No? Also, if you have retreived the binary data and are looking to push that into the Image component (and this is very strange, and maybe someone can explain this) but you can also pass a class into the very same attribute and it will display the image. Here is a sample derived from the Image documentation where you embed an image during compile time and use that embedded data in place of the string. mx:Script ![CDATA[ [Bindable][Embed(source=theme/filetype/ico_wmrm.png)]public var wmrmICO:Class; ]] /mx:Script mx:Image source={wmrmICO}/ Hope this is helpful... Shanimal --- In flexcoders@yahoogroups.com, moni_singhal [EMAIL PROTECTED] wrote: Actually i want to retrieve an image in a Flex Component (Flex 1.5 Application) from a java file (in java file i am getting the image from the database ). As mx:Image tag only takes source as an attribute .How should i do this ? Thanks, Monika
[flexcoders] Re: Embed an image for a Sprite
Ok, I managed to figure out what the problem was from a previous post - one cannot add a sprite directly to a container, one has to first add it to a UIComponent type. Anyone with more info / experience with this? Cheers Tracy --- In flexcoders@yahoogroups.com, polestar11 [EMAIL PROTECTED] wrote: Hi there How does one attach an image to a sprite class? I have tried the following example, but nothing gets displayed on the screen: package { import flash.display.Bitmap; import flash.display.Sprite; public class MySprite extends Sprite{ [Embed(source='/assets/board.png')] public var MyPhoto:Class; function MySprite() { var pic:Bitmap = new MyPhoto(); this.addChild(pic); } } } Thanks Tracy -- 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 * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/