Animation with Icons and next card
Posted: Tue Nov 15, 2011 4:31 pm
Hi there,
I am trying to animate a button like a person blinking.
I have 2 images and from the script of animating enemy space ship, I was able to make mine work.
Problem: When I go to next/previous card ( 2, 3, etc), it shows error because the runAnim cannot find the button or image to replace (they are in card 1).
Can it be fixed, or a code to stop the runAnim3 running or a better way.
NOTE: Every card will have up to 4 of this individual animations.
Thanks
Mission007
Here is the script:
-----------------------
on preOpenStack
set icon of button ID 1175 to ID of img ID 1177
end preOpenStack
Local blinkAnim
on openCard
if blinkAnim = "" then runAnim3
end openCard
on runAnim3
if blinkAnim = 11 or blinkAnim >11 then put 1 into blinkAnim
if blinkAnim < 10 then
set icon of button ID 1175 to ID of img ID 1177
add 1 to blinkAnim
send "runAnim3" to me in random(10)*100 millisecs
else
set icon of button ID 1175 to ID of img ID 1178
add 1 to blinkAnim
send "runAnim3" to me in 250 millisecs
end if
end runAnim3
-------------------------
I am trying to animate a button like a person blinking.
I have 2 images and from the script of animating enemy space ship, I was able to make mine work.
Problem: When I go to next/previous card ( 2, 3, etc), it shows error because the runAnim cannot find the button or image to replace (they are in card 1).
Can it be fixed, or a code to stop the runAnim3 running or a better way.
NOTE: Every card will have up to 4 of this individual animations.
Thanks
Mission007
Here is the script:
-----------------------
on preOpenStack
set icon of button ID 1175 to ID of img ID 1177
end preOpenStack
Local blinkAnim
on openCard
if blinkAnim = "" then runAnim3
end openCard
on runAnim3
if blinkAnim = 11 or blinkAnim >11 then put 1 into blinkAnim
if blinkAnim < 10 then
set icon of button ID 1175 to ID of img ID 1177
add 1 to blinkAnim
send "runAnim3" to me in random(10)*100 millisecs
else
set icon of button ID 1175 to ID of img ID 1178
add 1 to blinkAnim
send "runAnim3" to me in 250 millisecs
end if
end runAnim3
-------------------------