| Home | Tutorials | Forums | Articles | Blogs | Movies | Library | Employment | Press | Buy templates |
|
|
#1 |
|
Registered User
Join Date: Nov 2004
Posts: 1
|
Here's a weird thing that's annoying the [insert profanity here] out of me.
Code:
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;
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! |
|
|
|
|
|
#2 |
|
lala
Join Date: Feb 2002
Location: on the road
Posts: 2,859
|
i tried ur script and encountered no error, with it working as expected.
|
|
|
|
|
|
|
|
|
#3 |
|
Tyler Wright
Join Date: Jun 2005
Posts: 5
|
I'm having troubles with the DOM.selection array working properly as well. I tried too. I selected a couple of shapes and a movieclip (unnamed) and ran the script. tracing out mySelection array returned
[object Shape],[object Shape],[object SymbolInstance] but only the SymbolInstance was selected. Once I figure it out I'll let you know |
|
|
|
|
|
#4 |
|
Tyler Wright
Join Date: Jun 2005
Posts: 5
|
So here are the tricks.
1st don't try and select both shapes and symbols, doesn't always work as expected. I 'grouped' the shapes in order to select them along with symbols (grouping shapes makes them behave as a symbol more or less). 2nd always make sure that whatever you're targeting for selection is in the currently selected frame. To set the frame selection use ActionScript Code:
good luck with all your jsfl projects, there are far too few of them. I just finished a pair of commands that together allow you to slice up a movieclip and its children shapes/symbols into 9 segments for resizing. It will save quite a bit of time for skinning componants and is well worth the time I invested to build it. |
|
|
|
|
|
#5 | |
|
Registered User
Join Date: Feb 2006
Posts: 12
|
Quote:
Would be nice for the skinning jobs I have to do here. ![]() |
|
|
|
|
|
|
#6 |
|
Tyler Wright
Join Date: Jun 2005
Posts: 5
|
Sorry, it's been a while since I've been back to this list. Yes I'd love to share my jsfl scripts. I only hope they're not too confusing. I've written a few instructions to help.
Code:XT will have the instructions and download |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|