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!
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!
Your code doesn’t make sense, you’re just making a variable equal to itself =). And where did you put it anyway?
pom
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!
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:
Ok but its not being dragged! Rather controlled by arrow keys! =)
You control it as you wish. Your question was about displaying the coordinates, no? :tie:
:: Copyright KIRUPA 2024 //--