Page 1 of 1

Tools : Freehand

Posted: Thu Nov 26, 2015 3:20 pm
by problème
Hello
I have a image "i" and a graphic curve "gc" do with the tool freehand.
I put in the script of image

Code: Select all

on mouseUp
   move image "i" to the points of graphic "gc" in 5 seconds
end mouseUp
It's work correctly, but when i put this code in a command in the card script, i don't see the image to move.

in the card script

Code: Select all

on preOpenCard
  moveOnGraphic
end preOpenCard

command moveOnGraphic
  move image "i" to the points of graphic "gc" in 5 seconds
  --send "moveOnGraphic" to me in 250 milliseconds 
end moveOnGraphic

Re: Tools : Freehand

Posted: Thu Nov 26, 2015 3:32 pm
by bn
Hi problème,

try on opencard

preOpencard is sent before the card is visible and available for doing things, the user should not see. Like rearranging objects etc.

openCard is sent when the card is visible. What you do now is visible to the user.

from the dictionary
Handle the preOpenCard message to update a card's appearance before the card appears on screen.

Comments:
The preOpenCard message is sent before the openCard message. Unlike openCard, preOpenCard handlers are executed before the card appears. Because of this, the preOpenCard handler is a good place to put code that adjusts the size, position, and appearance of objects; the changes are made before the card appears.
Kind regards
Bernd

Re: Tools : Freehand

Posted: Thu Nov 26, 2015 3:52 pm
by problème
I solved the problem i have add "without waiting" at the end

command ....
move image "i" to the points of graphic "gc" in 5 seconds "without waiting"
end ....

Re: Tools : Freehand

Posted: Thu Nov 26, 2015 4:00 pm
by bn
I just tried this in a new stack with your code in the card script
and on opencard

It works perfectly.

Maybe I don't understand the what and where of your setup.

Kind regards

Bernd

Re: Tools : Freehand

Posted: Thu Nov 26, 2015 4:09 pm
by problème
i have to add "without waiting" to make it work.
Thanks for the help