Hi,
as far as I know, there is no clean solution to this problem.
However, if you feel hackish, this /could/ work:
var w = myClip._width;
var h = myClip._height;
var clip = myClip.createEmptyMovieClip( "foobar",
myClip.getNextHighestDepth() );
with( clip ) {
beginFill( 0x00ff00, 100 ) {
lineTo( w, 0 );
lineTo( w, h );
endFill();
}
var x = myClip._width - w;
var y = myClip._height - h;
clip.removeMovieClip();
Now, (x, y) should be the coordinates of your origin (i.e., top left
is at (-x, -y)).
Maybe. I haven't tested it.
Good luck...
Mark
On 4/24/06, Meinte van't Kruis <[EMAIL PROTECTED]> wrote:
> Hi folks,
>
> I have a problem correctly figuring out the actual x value of the top-left
> corner of a movieclip when scaling it.
> To demonstrate to this:
>
> put movieclip t on stage(a black box). Edit it, so that it's left top corner
> isn't on the movieclip centerpoint.
>
> this code on stage:
>
> onEnterFrame=function(){
> t._xscale++;
> trace(t._x);
> trace(t.getBounds().xMin);
> trace(t.getRect().xMin);
> }
>
> if you execute it, you can clearly see the top-left corner is in fact
> moving, due to the scaling.
> But the values never change. So my question is:
>
> how do I know the coordinates of the topleft corner of an (off-centered)
> movieclip, or
> the coordinates of the topright corner of a centered movieclip while scaling
> it?
>
> I'm really stuck on this, help would be very much appreciated.
>
> greetings,
> Meinte
> _______________________________________________
> [email protected]
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
> Brought to you by Fig Leaf Software
> Premier Authorized Adobe Consulting and Training
> http://www.figleaf.com
> http://training.figleaf.com
>
--
http://snafoo.org/
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com