jasonM
11-24-2004, 03:56 PM
Here's a weird thing that's annoying the [insert profanity here] out of me.
dom = fl.getDocumentDOM();
mySelected = new Array();
for(m in dom.selection)
{
if((dom.selection[m]!="sortOn") && (dom.selection[m].name==""))
{
mySelected.push(dom.selection[m])
}
}
dom.selectNone()
dom.selection = mySelected;
The idea is to run through the selection and pick up the symbols which have no name ... (name == "")
A trace on the mySelected array confirms that the array is collecting the correct symbols from the selection, however I get an error "Argument 1 is invalid" when I try and add the mySelected array to the newly reset selection array...
I know the selection array is wierd (i.e. "push" is documented as not working with it etc...) and an assignment is supposed to add the assigned contents to the existing array instead of the usual replacement.
However, no matter what I've tried so far I can't modify the document selection (unless I use mouseClick or selectionRect methods)
Anyone had success in this area? If you have any experience with the selection array I'd be very glad to hear any other discoveries. It's such a powerful feature I just pray it's usable !somehow!
dom = fl.getDocumentDOM();
mySelected = new Array();
for(m in dom.selection)
{
if((dom.selection[m]!="sortOn") && (dom.selection[m].name==""))
{
mySelected.push(dom.selection[m])
}
}
dom.selectNone()
dom.selection = mySelected;
The idea is to run through the selection and pick up the symbols which have no name ... (name == "")
A trace on the mySelected array confirms that the array is collecting the correct symbols from the selection, however I get an error "Argument 1 is invalid" when I try and add the mySelected array to the newly reset selection array...
I know the selection array is wierd (i.e. "push" is documented as not working with it etc...) and an assignment is supposed to add the assigned contents to the existing array instead of the usual replacement.
However, no matter what I've tried so far I can't modify the document selection (unless I use mouseClick or selectionRect methods)
Anyone had success in this area? If you have any experience with the selection array I'd be very glad to hear any other discoveries. It's such a powerful feature I just pray it's usable !somehow!