1
votes

I have many single frame movieclips on stage.

some of them are drawn using vector shapes in flash.

some of them are bitmaps loaded from an external .png file. note that in this case the display objects are of type shape, not of type bitmap.

enter image description here

I would like to export the movieclips containing vector shapes to svg documents. and the movieclips with bitmaps to bitmapData.

the problem is I am unable to differentiate between the 2 in actionscript.

I have only had success when converting the shape into Bitmap type with AS Linkage. however, this is not ideal as we would have to inspect all movieclips manually. Is there a way to differentiate between a shape that is vector and a shape that is bitmap?

1
I dont think you can do it via ActionScript API - if that is what you are asking. Instead if you can create JSFL that will do the "manual task" you've mentioned.Lukasz 'Severiaan' Grela
could you give some pointers to which API I should be looking at? thankstzl
just search for JSFL fl.getDocumentDOM().library - if you want to enumerate items in library panel or fl.getDocumentDOM().getTimeline() to access items from the timeline. Unfortunately I dont have any snippets. In the JSFL you can check if the item is a shape or bitmap.Lukasz 'Severiaan' Grela

1 Answers

0
votes

I found a solution. ensuring that there is not GraphicsBitmapFill in it was enough for my use case

for(var i :int = 0; i < target.numChildren; i++) {
    var s:Shape = target.getChildAt(i) as Shape;
    if (s) {
        var g:Vector.<IGraphicsData> = s.graphics.readGraphicsData();
        for(var j:int = 0; j < g.length;j++)    {
        var bitmap:GraphicsBitmapFill = g[i] as GraphicsBitmapFill;
            if (bitmap) {
                hasBitMapChildren = true
            }
        }
    }
}