Page 1 of 1

Script Delat

Posted: Sat Jun 01, 2013 6:36 pm
by chelling
The repeat loop is this card script is causing a 4 to 5 second delay in the script of
"button2", which is just a go to card script. I have spent several hours and can't get it to
work better. Does anyone have any recommendations?

local tSoundFile, tSoundDonePlaying

on openCard
put "" into tSoundDonePlaying
if the environment is "mobile" then playAnime
end openCard

on playAnime
put specialFolderPath("engine") & "/audio/musicFile2.mp3" into tSoundFile
mobilePlaySoundOnChannel tSoundFile, "tSndChannel", now
repeat until soundFinishedOnChannel tSndChannel, tSoundFile
move image "myImage1" to the points of graphic "Polygon"
if tSoundDonePlaying = "yes" then exit repeat
end repeat
iphoneClearTouches
end playAnime

on soundFinishedOnChannel tSndChannel, tSoundFile
put "yes" into tSoundDonePlaying
stop moving image "myImage1"
move image "myImage1" to the location of grc "Oval"
set the visible of card btn "button1" to true
set the visible of card btn "button2" to true
end soundFinishedOnChannel