Well, I am doing something like this ...
Here is some code, simplified:

My item renderer is based on HBox.

private var image:Bitmap = new Bitmap();
private function init():void
{
var uic:UIComponent = new UIComponent();
uic.addChild(image);
addChild(uic);
}

override public function set data(value:Object):void
{
     image = new Bitmap(FlexGlobals.topLevelApplication.Icons[0].Icon;
}
.....
private function PreloadImage_CompleteHandler(event:Event):void
{

FlexGlobals.topLevelApplication.Icons.addItem(event.currentTarget.content.bitmapData);
}


It works fine, but I also want to use my renderer with an image placed at a
design time and not added at the run time. Is it possible?

Thanks


On Wed, Mar 25, 2015 at 5:15 AM, Kessler CTR Mark J <
mark.kessler....@usmc.mil> wrote:

> Ahh, guess it's going to be just gathering a list of urls from a source
> (such as a server) and creating a class to pre-download using something
> like URLLoader .  Then when you reference them later they are already in
> the client cache.  You could also alternatively store the binary data an
> object as well.
>
> -Mark
>
> -----Original Message-----
> From: mark goldin [mailto:markzolo...@gmail.com]
> Sent: Monday, March 23, 2015 2:04 PM
> To: users
> Subject: Re: Combobox with icons
>
> My code is a bit simplified. bitmapData is a result of loading an image in
> advance.
>
> On Mon, Mar 23, 2015 at 1:00 PM, Kessler CTR Mark J <
> mark.kessler....@usmc.mil> wrote:
>
> > I do know a s:BitmapImage can load files on the fly with its source
> > property [1].  It supports "The name of a external image file" and " The
> > image location can be specified via a URL, URLRequest, or file
> reference".
> > It  is limited to PNG, GIF, or JPG.
> >
> >
> > [1]
> >
> http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/spark/primitives/BitmapImage.html#source
> >
> > -Mark
> >
>

Reply via email to