Forum Discussion

NancyWoinoski's avatar
NancyWoinoski
Super Hero
12 years ago

How do I change state on button when lightbox viewed

Hi, I have a text object on my first screen that opens a lightbox when clicked. I have 3 states on the text (normal, hover and then a custom state called Done what is supposed to display a checkmark beside the text when triggered).

I don't want the Done state to change until the viewer has gone through all the content in the lightbox.

I created a true/false variable called introDone and set the initial value to False.

I added a trigger to the last layer in the lightbox slide to change the variable to true when the timeline starts.

I put another variable on the slide with the textbox to change the state of the textbox to Done when the timeline starts if introDone = true.

It is all very well and good except that it doesn't work - has anyone managed to get this to work? If so, can you share your solution.

15 Replies

  • SteveFlowers's avatar
    SteveFlowers
    Community Member

    The HTML5 bug is that when the lightbox closes, the play state of the layer isn't restored. It remains paused. Hoping to see more parity between Flash and HTML5.

  • Steve Flowers said:

    Gotcha. Yep, that's the same problem I solved at one time. I'll see if I can pull out the example I used. As I remember I did this using a couple of different mechanisms under different circumstances. The problem, as I remember, is that while the lightbox is up, nothing happens on the base slide. So any listeners aren't active. I believe the way I worked this was with a layer. 

    - Have your button pop up a layer when the timeline starts. The layer triggers the opening of the lightbox. 

    - The lightbox pauses progression of the layer so it won't execute the trigger at the end of the timeline

    - When the lightbox closes, the layer continues

    - Trigger at the end of the layer to switch your base layer state if a variable meets a certain condition

    The layer doesn't need to be very long. 1 second or so. 


    Thanks, Steve!  This just saved the day for me!

  • ZuzannaPopik's avatar
    ZuzannaPopik
    Community Member

    I know it is 5 years later, but here's my workaround.

    Each lightbox has a trigger to change a variable "Lightbox1Visited" to TRUE (from default FALSE). In my case the variable changes when the lightbox timeline starts, but this can be customized.

    Then on the base layer the button has a trigger
    -to change its state to DONE
    -when the mouse hovers over
    -a tansparent shape that covers all of the slide
    -on the condition that "Lightbox1Visited" is TRUE.

    This transparent shape might be a bit silly, but it works for me and maybe someone finds this helpful.