Solved

Realtime update of coordinates while moving an object

Posted on 2008-10-19
6
313 Views
Last Modified: 2013-11-11
Im experiencing a problem with Flash, which im trying to learn still on very basic level...  Now to the question I have done a simple ball object and a simple dynamic textfield called coordholder.

What i've been trying to do is to constantly when the object is moving showing the coordinates of the ball in the coordholder as text,

Ive been trying a lot of stuff but I guess it's possible to use some kind of trigger that uses a timer and while the timer is on the coords should be updated and on drop stop it.  

Do you guys have any idea of how this could be done?
0
Comment
Question by:clooak
  • 3
  • 2
6 Comments
 
LVL 39

Expert Comment

by:blue-genie
ID: 22756194
firstly, AS2 or AS3.
secondly. how are you doing the moving of the ball - or are you wanting to know how to do that.
then you're right about the timer you'll just get the coordinates of the object and display it in the textfield.

0
 

Author Comment

by:clooak
ID: 22756820
well i've a onpress and on release event which triggers the ball to move, If i would implement it, then it will just get the coordinates when i drop and release or something. What i want is that it should as long as the object is moving(ball) then update the coordinates in the dynamic field
0
 
LVL 39

Expert Comment

by:blue-genie
ID: 22757400
triggers the ball to move - is this a frame tween, a normal script tween?
when i drop or release or something - you need to be more specific. i.e. is the ball a drag and drop and when you release it you want the coordinates?
or is the ball going from left to right and at some point in time (when would be nice) - you want to show the coordinates.

the reason i'm asking these questions is to determine which solution to suggest to you.
for example how to determine if the ball is moving etc.

0
 

Author Comment

by:clooak
ID: 22757520
Well i forgot to mention it's a drag and drop event and as long as the ball is dragged I want it to determine it's actual coordinates of the object and set it in the textbox as text.

No motion tween or anything just a drag and drop event

Tell me if there is anything else that which is unclear
0
 
LVL 39

Accepted Solution

by:
blue-genie earned 100 total points
ID: 22757778
ok i'm assuming youre using AS2 since you're refering to onRElease events.
ok however you're doing your drag and drop you should be able to use setInterval to call a function every however many milliseconds you want to get the x and y of the object. you'll do this where you have the startDrag

just make sure when you have your onrelease which stops the dragging that you clear the interval.
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Error 2032 in all the browser 6 2,837
Online Course Not Responding 3 94
how can flash builder 4.X version make use of java 8 5 309
Animating text  - electrons orbit around letter M 12 79
I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
Here are some practices and techniques that can be adopted into your Flash/Flex application development process. Note: Not all "performance tips" provide an immediately-recognizable benefit.   This article does not include timing validation data,…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question