Script Delat

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
chelling
Posts: 100
Joined: Tue Mar 06, 2007 3:14 am

Script Delat

Post by chelling » Sat Jun 01, 2013 6:36 pm

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

Post Reply