Solved

Realtime update of coordinates while moving an object

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

While working over numerous projects I often had the requirement for doing a screen capture in AS3.0. Unfortunately I found no "ready made" solutions in google search that suited my requirements. But I did come across some great resources which help…
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 set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.

920 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now