PDA

View Full Version : get location of an instance


Boersnoes
05-05-2006, 02:12 PM
Today I ran into a rather stupid "feature" of jsfl.
Apparently instances have a .left and a .top property, but no x or y property. This way I can get the position relative to the instance's registration point and stage origin, but not the position of the instance itself.
Practicly I need to know if an instance is located at 0,0.
But although I have put it at 0,0 in the editor, i get 0,-2 from the folowing code:
alert(fl.getDocumentDOM().timelines[timeline].layers[layer].frames[frame].elements[element].top);
alert(fl.getDocumentDOM().timelines[timeline].layers[layer].frames[frame].elements[element].left);

Any ideas how to solve this?

aravinth_vt
05-22-2006, 09:13 AM
Hi,

I think it's due to the line thickness problem. convert all the lines inside the clip to hairline and run the script. it will show "0,0". to check it for (0,0) have an approximation value like + or - 10.

In case i am not answering to the exact problem, please brief me in a different way!