This is just off the top of my head, but try using SWFLoader.
On Thu, Oct 30, 2008 at 1:49 PM, Jayson <[EMAIL PROTECTED]> wrote:
>
> I am using BitmapAssets to add to a sprite which is printed using
> PrintJob.
>
> [Embed(source="images/logo.png")]
> [Bindable]
> public var logo:Class;
> ...
> var bitmapImg:BitmapAsset = new logo() as BitmapAsset;
> bitmapImg.smoothing = true;
> bitmapImg.setActualSize(500, 42);
> sheet.addChild(bitmapImg);
>
>
> This works fine when the image to be added is embedded. Some images I
> need to add dynamically. How would I do this?
>
> I've tried using a Loader and doing something like this:
>
> var imgLdr:Loader = new Loader(imgURLReq);
> imgLdr.contentLoaderInfo.addEventListener(Event.COMPLETE, imgLoaded);
>
> function imgLoaded(e:Event):void{
> var eventImg:BitmapAsset = new BitmapAsset;
> eventImg.bitmapData = imgLdr.content as BitmapData
> eventImg.smoothing = true;
> eventImg.setActualSize(300, 200);
> sheet.addChild(eventImg);
> }
>
>
> I think I need to do something similar to the static method by loading
> the image with a Loader and casting it as a Class, but this is not
> working out for me.
>
> Any ideas?
>
>
> Thanks!
>
> Jayson
>
>
> ------------------------------------
>
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Alternative FAQ location:
> https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847
> Search Archives:
> http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups
> Links
>
>
>
>
--
"Therefore, send not to know For whom the bell tolls. It tolls for thee."
Like the cut of my jib? Check out my Flex blog!
:: Josh 'G-Funk' McDonald
:: 0437 221 380 :: [EMAIL PROTECTED]
:: http://flex.joshmcdonald.info/