Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

how to display xy coordintes of drag and drop movie

0 views
Skip to first unread message

Dr Vangeldor

unread,
Jul 12, 2008, 2:40:09 AM7/12/08
to
can someone tell me how to display the coordinates of the red cirle shown in
the drag and drop tutorial found here:
http://www.flashvalley.com/fv_tutorials/advanced_drag_and_drop_in_Flash/
I have done this tutorial just fine but dont know how to display its x and y
coordinatetes in a dynamic text box as i move the red circle around the screen.
thank you for any assistance you may give.
steve

kglad

unread,
Jul 12, 2008, 10:07:33 AM7/12/08
to
in your on(press) handler start a loop (onEnterFrame or setInterval) and
repeatedly assign your textfield's text property to be the red circles _x and
_y properties. in your on(release) handler terminate that loop.

Dr Vangeldor

unread,
Jul 12, 2008, 12:53:27 PM7/12/08
to
Hi kglad,
I dont suppose you could show me how to create the loop? My own research
seems to indicate the onEnterFrame method would be easiest.
I am just a beginner and even this is still beyond me.
thanks

kglad

unread,
Jul 12, 2008, 3:50:02 PM7/12/08
to
:

redCircle.onPress=function{
this.startDrag();
this.onEnterFrame=function(){
_root.yourTextField.text=this._x+", "+this._y; // create this textfield on
your main timeline
}
}
redCircle.onRelease=redCircle.onReleaseOutside=function(){
this.stopDrag();
delete this.onEnterFrame;
}

Dr Vangeldor

unread,
Jul 13, 2008, 2:52:13 PM7/13/08
to
Thank you for your help. Your solution is exactly what I needed.
:)
0 new messages