Code acting oddly

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
neomodus
Posts: 18
Joined: Fri Apr 13, 2012 10:27 pm

Code acting oddly

Post by neomodus » Tue Feb 10, 2015 9:22 pm

Hi
I have the following code on a button mouse up event

Global tWords
On mouseUp
set the visible of field "Dict" to true
put "Dictionary decompressing - please wait" into field "Dict"
put decompress(the cMaximumtext of this stack) into tWords
lock screen for visual effect
Go to card id 1005
unlock screen with visual effect push left
End mouseUp

What I want to do is display a wait message whilst the dictionary is being decompressed but on IOS the button just appears depressed and the message only appears after the dictionary has decompressed and then displays the next card.
Any advice please?
Thanks

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: Code acting oddly

Post by jmburnod » Wed Feb 11, 2015 1:56 pm

Hi neomobus,

You can maybe try to divide your script in several parts and you may use a "send in time" message
something like that

Code: Select all

Global tWords
On mouseUp
   set the visible of field "Dict" to true
   put "Dictionary decompressing - please wait" into field "Dict" 
   send "doDecompressMyText" to me in 300 milliseconds
   send "doGoCd" to me in 1300 milliseconds
End mouseUp

on doDecompressMyText
   put decompress(the cMaximumtext of this stack) into tWords
end doDecompressMyText

on doGoCd
   lock screen for visual effect
   Go to card id 1005
   unlock screen with visual effect push left
end doGoCd
Best regards
Jean-Marc
https://alternatic.ch

neomodus
Posts: 18
Joined: Fri Apr 13, 2012 10:27 pm

Re: Code acting oddly

Post by neomodus » Wed Feb 11, 2015 9:53 pm

Thanks Jean Marc
That code works fine.
Thanks

Post Reply