Solved

Realtime update of coordinates while moving an object

Posted on 2008-10-19
6
314 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
I have found that much of my time doing support ends up being a constant repetition of the same steps to different people.  Early on I stated using web pages with Frequently Asked Questions (FAQs) to alleviate most of the burden.  Sometimes this jus…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

860 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