flex-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Harui <aha...@adobe.com>
Subject Re: Loading svg image at runtime
Date Fri, 29 Apr 2016 20:49:15 GMT
Did you end up embedding the SVG file?  If so, I believe it gets
transcoded into a Sprite.  There are various ways to take a bitmap
snapshot of a Sprite, but also keep in mind that if you were using the
image array to cache bitmaps being loaded, now that they are embedded, you
no longer need that cache.

-Alex

On 4/29/16, 11:19 AM, "mark goldin" <markzolotoy@gmail.com> wrote:

>How can I store a content of an svg image in an array?
>
>With png images I am doing something like this:
>
>Loader.contentLoaderInfo.addEventListener(Event.COMPLETE,
>CompleteHandler);
>private function CompleteHandler(event:Event):void
>{
>    imageArray.addItem(event.currentTarget.content.bitmapData);
>}
>
>Thanks
>
>On Fri, Apr 29, 2016 at 12:23 PM mark goldin <markzolotoy@gmail.com>
>wrote:
>
>> I see, thanks.
>>
>> On Fri, Apr 29, 2016 at 12:15 PM Alex Harui <aharui@adobe.com> wrote:
>>
>>> IIRC, SVG is only supported when embedded.
>>>
>>> In FlexJS, we might have an SVG loader some day.
>>>
>>> -Alex
>>>
>>> On 4/29/16, 9:34 AM, "mark goldin" <markzolotoy@gmail.com> wrote:
>>>
>>> >I am trying to load an svg image.
>>> >var request:URLRequest = new URLRequest('image.svg');
>>> >var imageLoader:Loader = new Loader();
>>> >var loaderContext:LoaderContext = new LoaderContext();
>>> >loaderContext.checkPolicyFile = true;
>>> >imageLoader.load(request,loaderContext);
>>> >
>>> >in the Console I see this:
>>> >[SWF] /assets/casemanagement/closed.svg - 0 bytes after decompression
>>> >
>>> >and it's just keep popping up.
>>> >
>>> >Can we load svg images into Flex application?
>>> >
>>> >Thanks
>>>
>>>

Mime
View raw message