Ask a Question related to Macromedia Flash, Design and Development.
-
ThaNigga #1
root position of nested clip
Hi, i've got a clip nested like the following:
_root.clip1.clip2.clip3.clip4.clip5.clip6.clip7
Every clip can be rotated or moved randomly. How could i know the position
and rotation of clip7 in the root? I've tried with localToGlobal, but i
can't understand how it works. Thanks.
ThaNigga Guest
-
help with movie clip position
I have am having trouble adjusting the position of a movie clip, I don't know if my code is bad, or if it just isn't possible to do in the way that... -
Clip position relative to _root
Hi all I have a clip buried deep within other clips, and I want to find its _x and _y position relative to the _root clip. Is this possible ... -
passing a movie clip variable to root
Hello all I have multiple duplicate movie clips that declare/void variables, but i cant get those variables brought to _roo For instance... -
button nested in movie clip which uses onClipEven
I am loading an external SWF movie into a blank movie clip The SWF movie has a button with an onRollOver action It's parent, the blank movie clip,... -
Finding the x position of a dragged movie clip
I'm building a draggable time line that needs to be able to capture the x position of the movie clip being dragged. While it is being dragged it will... -
Jeckyl #2
Re: root position of nested clip
you're on the right track ... localToGlobal is the way to go
--
All the best,
Jeckyl
Jeckyl Guest
-
ThaNigga #3
Re: root position of nested clip
Thanks, i'm colser to the solution... :)
ThaNigga Guest
-
ThaNigga #4
Re: root position of nested clip
"ThaNigga" <thanigga@hotmail.com> escribió en el mensaje
news:36t4msF5690htU1@individual.net...Finally I found the solution, and I post it, if anyone is interested:> Hi, i've got a clip nested like the following:
> _root.clip1.clip2.clip3.clip4.clip5.clip6.clip7
> Every clip can be rotated or moved randomly. How could i know the position
> and rotation of clip7 in the root? I've tried with localToGlobal, but i
> can't understand how it works. Thanks.
>
>
I was trying to do that:
_root.clip1.clip2.clip3.clip4.clip5.clip6.clip7poi nt=new Object();
_root.clip1.clip2.clip3.clip4.clip5.clip6.clip7.po int.x=_root.clip1.clip2.cl
ip3.clip4.clip5.clip6.clip7._x;
_root.clip1.clip2.clip3.clip4.clip5.clip6.clip7.po int.y=_root.clip1.clip2.cl
ip3.clip4.clip5.clip6.clip7._y;
localToGlobal(_root.clip1.clip2.clip3.clip4.clip5. clip6.clip7.point);
But it didn't work. I tried this too:
_root.clip1.clip2.clip3.clip4.clip5.clip6.clip7.lo calToGlobal(_root.clip1.cl
ip2.clip3.clip4.clip5.clip6.clip7.point);
But still nothing. Finally the right way seems to be this:
with _root.clip1.clip2.clip3.clip4.clip5.clip6.clip7) {
this.point = new Object();
this.point.x = this._x;
this.point.y = this._y;
localToGlobal(this.point);
}
This works perfectly. The rotation is easy to know:
_root.clip1.clip2.clip3.clip4.clip5.clip6.clip7._r otation +
_root.clip1.clip2.clip3.clip4.clip5.clip6._rotatio n +
_root.clip1.clip2.clip3.clip4.clip5._rotation +
_root.clip1.clip2.clip3.clip4._rotation + _root.clip1.clip2.clip3._rotation
+ _root.clip1.clip2._rotation + _root.clip1._rotation;
I hope this will help someone.
ThaNigga Guest
-
Jeckyl #5
Re: root position of nested clip
Reason your first ones failed is your stuffed it up with dots where they
shouldn't be etc .. you can do it simply like this.
var myclip = _root.clip1.clip2.clip3.clip4.clip5.clip6.clip7;
var point = new Object();
point.x = myclip._x;
point.y = myclip._y;
myclip.localToGlobal(point);
or maybe just
var myclip = _root.clip1.clip2.clip3.clip4.clip5.clip6.clip7;
var point = { x : myclip._x, y : myclip._y };
myclip.localToGlobal(point);
--
All the best,
Jeckyl
Jeckyl Guest
-
ThaNigga #6
Re: root position of nested clip
Thanks! This will help me in the future.
ThaNigga Guest



Reply With Quote

