Page 1 of 1

First Click does Nothing

Posted: Sun Jan 17, 2016 4:36 pm
by A1Qicks
So, I've got a section off to the left of my card that I want to slide out in front. It should be hidden by default. This is what I have:

local showOnline

on OpenCard
set the right of group OnlineUsers to the left of this card
put false into showOnline
end OpenCard

on mouseUp
if showOnline is false then
move group OnlineUsers to 96, 332 in 80 milliseconds
put true into showOnline
else
move group OnlineUsers to -96, 332 in 80 milliseconds
put false into showOnline
end if
end mouseUp

This works absolutely fine, apart from the fact that after opening the card, the first click does nothing. After that, it works as it should. Why is this?

Re: First Click does Nothing

Posted: Sun Jan 17, 2016 6:46 pm
by hpsh
think you need to change local showOnline to Global showonline

also you need to include that in the button script

also:
--cardscript

Code: Select all

global showOnline

on OpenCard
set the right of group OnlineUsers to the left of this card
put false into showOnline
end OpenCard
--button script

Code: Select all

on mouseUp
global showonline
if showOnline is false then
move group OnlineUsers to 96, 332 in 80 milliseconds
put true into showOnline
else
move group OnlineUsers to -96, 332 in 80 milliseconds
put false into showOnline
end if
end mouseUp

Re: First Click does Nothing

Posted: Mon Jan 18, 2016 2:16 pm
by A1Qicks
Fixed it - thanks!