View Full Version : Simple show x, y
cookie
February 17th, 2003, 09:48 AM
I have an object that moves when the arrows are pressed but how do i display the coordinates of the object, x and y? I tried
this.x=this.x
this.y=this.y
and then two dynamic boxes called x and y but it doesn't work!
pom
February 17th, 2003, 12:05 PM
Your code doesn't make sense, you're just making a variable equal to itself =). And where did you put it anyway?
pom :)
cookie
February 17th, 2003, 12:08 PM
I got it from someone else on kirupa! Can you show me how to do it? I'll alter my request!
I would like to display the height of an object from the bottom of the stage, i.e. when object is at say y=100 (I have taken y=0 to be the bottom of the stage) I want to display that in a dynamic box!
pom
February 17th, 2003, 12:13 PM
OK:
clip with instance name myClip
textboxes with instance names box1 and box2
on the main timeline:
myClip.startDrag(true);
this.onEnterFrame=function(){
box1.text=myClip._x;
box2.text=myClip._y;
}pom :tie:
cookie
February 17th, 2003, 12:18 PM
Ok but its not being dragged! Rather controlled by arrow keys! =)
pom
February 17th, 2003, 12:50 PM
You control it as you wish. Your question was about displaying the coordinates, no? :tie:
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.