Page 1 of 1

How to move a ball on the surface of a line?

Posted: Wed Apr 09, 2008 2:50 pm
by alex298
Hi,

I use the following syntax to move a ball (center of ball) along a line:

move graphic "ball" to the points of graphic "Line"

I have some questions:

1. I wish the ball to move on the surface of the line. How can I do that?

2. I layout another button and use stop moving graphic "ball" to stop the ball moving. However when I clicked the button to move the ball again, the ball is always starting from the beginning, not from the stopped position. How can I make the ball resume the journey from the stopped position?

Best regards

Posted: Wed Apr 09, 2008 3:38 pm
by Mark

Posted: Thu Apr 10, 2008 5:10 am
by alex298
Hi Mark,

Thanks for your kind assistance.

However I still cannot figure out how to resume the motion from the stopped location.

I have another question:

move graphic "ball" to the points of graphic "hexagon" in 15 seconds

I wish to trigger some actions when the ball move to the corners of the hexagon. For example, when the ball move to the first corner, stop, do something, then move again.... How can I do that?

Thanks and best regards

Posted: Thu Apr 10, 2008 8:45 am
by Mark
Hi Aex,

What is your current script, that makes the ball move?

Best,

Mark

Posted: Thu Apr 10, 2008 9:30 am
by alex298
Hi Mark,

Actually I am doing a simple stuff for kids.

Here's the details of my project:

1. The card has the following objects:
- graphic "ball"
- graphic "hexagon"
- button "Move"
- button "Stop"
- field "Turn"

2. Button "Move" Script:

on mouseUp
move graphic "ball" to the points of graphic "hexagon"
end mouseUp

3. Button "Stop" Script:

on mouseUp
stop moving graphic "ball"
end mouseUp

Here's what I wish to do:

1. The graphic "ball" will move along graphic "hexagon" when click on the Button "Move".

2. The graphic "ball" will stop when click on Button "Stop"

3. The graphic "ball" will continue the move from the stopped location when click on the Button "Move"

4. When the graphic "ball" move to a corner of the graphic "hexagon", it will stop for 2 seconds, and a message will appear in the text field "Turn".

Thanks and best regards

Alex