I have a symbol originally created at [-100,-100] coordinate (left top corner). Now I put an instance of this symbol on a stage at [0,0] stage coordinates (by dragging it with a mouse in IDE). Having this instance can I still determine original [-100,-100] position from actionscript somehow? (myInstance.x
returns stage coordinate).
What I do:
- create a new symbol in a library located at -100,-100 coordinates during its creation
- put an instance of this symbol on the stage at some different coordinates
- in actionscript try to get original -100 value from instance object, like:
this.myInstance.x
(only this returns stage coordinates)
Why I am doing this:
I am trying to put this movieclip into a BitmapData:
var myClip:MovieClip = this.myInstance;
var bmp:BitmapData = new BitmapData(myClip.width, myClip.height);
bmp.draw(myClip);
The problem is BitmapData looks like taking only part of a clip that lies in positive coordinates. To overcome this I would need to provide transform matrix with corresponding offsets:
var m:Matrix = new Matrix();
m.tx = 100;
m.ty = 100;
bmp.draw(myClip, m);
I would be able to calculate this offset if I knew original symbol coordinates before it was dropped on a stage.
Hopefully this makes sense.