Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > Extensions and Plugins > JSFL - Extending Flash

Reply
 
Thread Tools Rate Thread Display Modes
Old 11-24-2004, 04:56 PM   #1
jasonM
Registered User
 
Join Date: Nov 2004
Posts: 1
Default JSFL documentDOM().selection

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;
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!
jasonM is offline   Reply With Quote
Old 11-25-2004, 02:22 PM   #2
hangalot
lala
 
hangalot's Avatar
 
Join Date: Feb 2002
Location: on the road
Posts: 2,859
Default

i tried ur script and encountered no error, with it working as expected.
__________________
oi poloi
http://www.memorphic.com/news/
hangalot is offline   Reply With Quote
Old 06-24-2005, 04:00 PM   #3
xtyler
Tyler Wright
 
Join Date: Jun 2005
Posts: 5
Default

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
xtyler is offline   Reply With Quote
Old 07-17-2005, 08:26 PM   #4
xtyler
Tyler Wright
 
Join Date: Jun 2005
Posts: 5
Default

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:
var timeline = fl.getDocumentDOM().getTimeline(); timeline.currentFrame = frameNumber;    // where frameNumber is a Number //              -- or --              // timeline.layers[l].locked = false;    // 'l' is the layer number, starting at 0 being the top timeline.setSelectedLayers(l); timeline.setSelectedFrames(f, f);    // 'f' is the frame number, start & end

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.
xtyler is offline   Reply With Quote
Old 02-24-2006, 02:49 PM   #5
Boersnoes
Registered User
 
Join Date: Feb 2006
Posts: 12
Default

Quote:
Originally Posted by xtyler
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.
Care to share those scripts?
Would be nice for the skinning jobs I have to do here.
Boersnoes is offline   Reply With Quote
Old 05-18-2006, 06:09 PM   #6
xtyler
Tyler Wright
 
Join Date: Jun 2005
Posts: 5
Default JSFL scripts available

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
xtyler is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:06 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2009 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.