PDA

View Full Version : Possible bug with isGroup property


nitinmukesh123
04-20-2007, 06:30 AM
Hi All,

Just a brief overview of what i am trying to achieve.

I frequently face problem of corrupted fonts in Flash files because some smart graphic people rather then selecting the font from the list of fonts type in the box which makes it corrupt.

To solve this problem I have started creating a JSFL which will find all textfields on Stage and in library and correct the font. It works fine except in the case where the textfield is inside a group means it is grouped. This issue is solved by ungrouping an element but creates further problem with shapes :(

Suppose there is a shape on stage and is grouped and i execute the jsfl it successfully ungroup the shape but in case the shape is ungrouped and i execute the JSFL it throws an error

The function unGroup() is currently unavailable

I tried to put the condition to avoid the issues

if ((elms[i].elementType == "shape") && elms[i].isGroup){
fSelectElement(elms[i])
currentDoc.unGroup();
}

but isGroup property returns true for both grouped shape and ungrouped shape. Thats why the error and i am unable to solve the problem :(

Hope somebody can help with this..


Here is the complete JSFL

http://www.2xupload.de/file/dfd82bb334a36f2fba4934d95e48db57/JSFL.txt.html

Path to be copied
C:\Documents and Settings\<user name>\Local Settings\Application Data\Macromedia\Flash 8\en\Configuration\Commands




Steps to replicate this problem:

1. Create a shape on stage. Select the shape and group it (CTRL + G).

Run the jsfl work fine ungroups the shape.


2. Create a shape on stage.

Running the jsfl throws the error.

nitinmukesh123
04-26-2007, 10:56 AM
Got the solution

http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=15&catid=194&threadid=1261315&enterthread=y

rost
08-09-2007, 06:59 PM
The surprising thing is that not only shapes have the "isGroup" property.

For example, create TextField and group it; then create MovieClip and group it: you'll find that it is possible to detect the isGroup property correctly for both of the objects!

But JSAPI documentation doesn't say it, it only describes the isGroup property for shapes, not for any other type of stage element.