Flash Position
- Started
- Last post
- 13 Responses
- JamesEngage
Okay... I've got a movie clip inside another movie clip and i want to find out the position of the one inside the other on the stage, at the moment I can only get the position it is inside the other movie clips....
any ideas howe to refernce something to the stage in that way?
- REDWOOD0
the outer movieclip coordinate + the innermovieclip coordinate
- JamesEngage0
thats the problem you see... i will not know the position of the outer movieclip (sorry should have put that)
I could calcualte it using trig, but I'm getting far too many nightmarish equations and -ve and +ve 's so want to get flash to do the hard work for me!
- Epictive0
Can you just do something like this:
function insideMC(outerMC, innerMC) {
InsideX = this[outerMC]._x+this[outerMc][i...
InsideY = this[outerMC]._y+this[outerMc][i...
trace("The movieclip is located at x="+InsideX+" y="+InsideY);
}And call the function listing the two MC names:
insideMC("outs", "ins");
- Epictive0
If you want an .fla let me know, but what I wrote above should work if I understood you.
- JamesEngage0
The outside one is at a random angle also
- Epictive0
Just keep adding more factors don't you James. So spell it out: There is a MC inside a MC. The outer MC is going to be at a random angle. If you are only trying to get X and Y the above function will work because the ref points stay the same, but I am guessing you now want the X,Y, and angle of the inner MC? What are you trying to do?
Sorry if I am being slow, I am still in bed.
- JamesEngage0
its the factors making it difficult isn't it!
yep thats right... basically the outer one could be at any angle and any x and any y...
makes it difficult doesn't it...
- Epictive0
Can I ask why/What your trying to do?
- JamesEngage0
Can I mail you... it's a bit secret?
- Epictive0
I like secrets. Mail away.
- JamesEngage0
cheers... sent it to info@ ... where is your floaty man you used to have at your site?
- j_red0
dood is this a localToGlobal issue?
You can get the inner mc's position relative to the root timeline with this.
- unfittoprint0
?____________________
function tracePos(targetObj){
pos= targetObj._x + targetObj._parent._x;
trace(pos);
}ie:
tracePos(myClip.innerClip);