PDA

View Full Version : JSFL APIs to move elements in the stage?


manis
11-23-2006, 12:32 PM
Hi All,

I tried to set the top/left (move the elements to new position) of all the elements present in stage of FLA first parsing all the elements in different layers/frames and then setting Matrix.tx and Matrix.ty properties of the element. It seems working fine in Flash8 but the size of the elements getting bigger in Flash MX 2004. Why does it look so in MX 2004?
(please note that element.top and element.left are cannot be set)

Again one query..

I tried then using fl.getDocumentDOM().moveSelectionBy() method. But after fl.getDocumentDOM().selectAll() only selects those elements which are visible. So, most of the other elements in different frame/layer got unselected and hence not been moved.


Please suggest me with some ideas to move all the elements (in diff layers/frames) of the stage to new position using JSFL APIs.

Thanks in advance!

jjbilly
11-27-2006, 12:57 PM
You can run through the layers and temporarily make them all visible; if you store the original visibility in an array, you can then restore that state once you have done your moving.

I often use this for dealing with different types of element (I mean types defined by me, rather than jsfl types) - by keeping them on different layers, I can lock all layers except the one I'm interested in working on at a given time, then use selectAll there.