Stack fade-In
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Stack fade-In
I want to have a stack fade into view. I remember seeing or having a clip of code that used BlendLevel to fade the Stack into view smoothly. Can't seem to find now though.
I've experimented with a repeat down to 0, but my results haven't worked proper, or looked choppy.
I've experimented with a repeat down to 0, but my results haven't worked proper, or looked choppy.
Hi keyless, the bit of code I was shown uses a repeat but there isn't any choppiness, and also its a fade out, so I guess fade in should be okay with the first line reversed. Plus you'll have to set your stack as transparent first, of course:
Hope that does the job for you (but if that's the code you had anyway, I expect there must be something else needed for a fade in...)

Code: Select all
on preOpenCard
Set the blendLevel of stack "Registration" to 100
end preOpenCard
on openCard
repeat with BlendOut = 100 to 0 step 2
set the blendlevel of stack "Registration" to BlendOut
wait 10 milliseconds
end repeat
end openCard

First, Thanks for the script, it is similar to what I was trying, but more refined. The one I think I had before had some calculation for the wait, but I suspect this will be fine if I can get it to work.
everything about that script looks right, but when I put it in a stack, no fade in, I just see the card flash quick but nothings comes up. Blendlevel appears to stay at 100.
everything about that script looks right, but when I put it in a stack, no fade in, I just see the card flash quick but nothings comes up. Blendlevel appears to stay at 100.
That's mighty odd, I can't get a fade in to work either, even from a button press (and with a correction):
Something missing here, I suppose but unfortunately I don't know what...
Code: Select all
repeat with BlendOut = 100 down to 0 step 2
If it's an effect for a standalone, then this might work in the main stack script:
If you want to open a substack or another card, then you can "go invisible" card or stack and in the preOpenCard/preOpenStack handler kick off the blend level and invisibility before starting the blendIn handler. Doing it that way, even with the lock screen and setting of invisibility I can't avoid getting a quick flicker of the stack being displayed and then made invisible.
Code: Select all
on startup
set the visible of this stack to false
lock screen
set the blendLevel of this stack to 100
set the visible of this stack to true
unlock screen
send "blendIn 98" to this stack
end startup
on blendIn pBlendLevel
set the blendLevel of this stack to pBlendLevel
subtract 2 from pBlendLevel
if pBlendLevel >= 0 then
send "blendIn" && pBlendLevel to this stack in 15 milliseconds
end if
end blendIn
I found a way to make the preOpenStack method work without the flicker. (Doing it all in the preOpenStack makes it go a bit lala.) This works nicely here:
Code: Select all
on preOpenStack
set the visible of this stack to false
end preOpenStack
on openStack
set the blendLevel of this stack to 100
set the visible of this stack to true
send "blendIn 99" to this stack
end openStack
on blendIn pBlendLevel
set the blendLevel of this stack to pBlendLevel
subtract 1 from pBlendLevel
if pBlendLevel >= 0 then
send "blendIn" && pBlendLevel to this stack in 15 milliseconds
end if
end blendIn