Explore the community Forums Lectora Lectora Questions & Answers Making Object Blink in Lectora v11

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #306919 Score: 0
    Profile photo of Jill Searcy
    Jill Searcy
    Member
    beginner
    intermediate
    friend finder
    contributor
    1 pt
    @jsearcy

    Hello everyone!

    I am looking for a quick and easy way to make an object blink in Lectora. Any ideas?

    #306929 Score: 2
    Profile photo of clammers
    clammers
    Member
    beginner
    intermediate
    contributor
    curious george
    wise owl
    picture perfect
    friend finder
    advanced
    entry
    entry
    9 pts
    @clammers

    What do you mean by blink? A quick an easy solution would be to put a timed action on the page. On: Timed Interval, Action: Toggle Show/Hide, Target: (Object). The action will repeatedly fire, showing and hiding the object, giving the illusion of blinking or flashing.

    This post has received 2 votes up.
    #306930 Score: 0
    Profile photo of Darrel Somoza
    Darrel Somoza
    Member
    contributor
    friend finder
    beginner
    intermediate
    junior moderator
    advanced
    wise owl
    curious george
    120 pts
    @Klaatu

    The easiest way I can think of that also gives you complete control over the blinking effect is by using Greensock GSAP.

    Once you add the HTML extension it’s two simple lines of code:

    var star = document.getElementById(“shape47”);
    TweenMax.to(star, .25, {opacity:0, repeat:-1, yoyo:true});

    You an add this as a page show action.

    The first line grabs the HTML element and assigns it a name. You would need to swap the HTML name (“shape47” in this case) of the object in your project that you want to blink.

    The second line takes the object (I named it ‘star’) and animates its opacity to zero over the span of a quarter of a second (.25). The repeat -1 and yoyo:true make it repeat indefinitely.

    You can experiment by changing the .25 to get the blink however you like. Also, if you add  , repeatDelay:0.25 (don’t forget the comma) So now the second line looks like this:

    TweenMax.to(star, .25, {opacity:0, repeat:-1, yoyo:true, repeatDelay:0.25});

    You can add a delay between the animation of the opacity. This will give you further control over the blink effect.

    Note that if you copy and paste from the above that you should delete and re-add the quotes because for some reason they do not copy and paste correctly and the code will not work.

    the .ini and .awt for is included in the attached zip. Try it, it’s fun and works great. Hope this helps.

    Darrel

    Attachments:
    1. Blink.zip
    #306933 Score: 0
    Profile photo of Darrel Somoza
    Darrel Somoza
    Member
    contributor
    friend finder
    beginner
    intermediate
    junior moderator
    advanced
    wise owl
    curious george
    120 pts
    @Klaatu

    Clammers solution is simple and effective.

    #306934 Score: 0
    Profile photo of Jill Searcy
    Jill Searcy
    Member
    beginner
    intermediate
    friend finder
    contributor
    1 pt
    @jsearcy

    Thanks for the quick responses. However, this is for a customer who has no programming skills so adding extensions is not an option. (I apologize for not mentioning this in the initial post.) I thought I could do it using a timer but once I added it, I got stumped. Could you be a bit more specific on exactly where I should add the action? I rarely ever use timers with Lectora so I am pretty rusty.

    Thanks again for the responses.

     

     

    #306944 Score: 1
    Profile photo of Darrel Somoza
    Darrel Somoza
    Member
    contributor
    friend finder
    beginner
    intermediate
    junior moderator
    advanced
    wise owl
    curious george
    120 pts
    @Klaatu

    Hi Jill. As Clammers suggests you place the object on the page and then insert an action on the page itself. The trigger will be Timed Interval. In the Action and Target section select the action Toggle Show/Hide. The target you select in the drop down will be the object you want to blink or flash. You then adjust the Interval and Delay in the Trigger Section to your liking.

    This post has received 1 vote up.
    #306947 Score: 0
    Profile photo of Jill Searcy
    Jill Searcy
    Member
    beginner
    intermediate
    friend finder
    contributor
    1 pt
    @jsearcy

    Duh… I was thinking about it very differently. Thank you! I believe that will work.

    #306956 Score: 1
    Profile photo of Sergey Snegirev
    Sergey Snegirev
    Member
    contributor
    intermediate
    advanced
    friend finder
    lab member
    junior moderator
    advocate
    LUC16
    LUC16 Attendee
    wise owl
    336 pts
    @ssneg

    You can see the complete setup in the screenshot below.

    This post has received 1 vote up.
    Attachments:
    #306958 Score: 0
    Profile photo of Jill Searcy
    Jill Searcy
    Member
    beginner
    intermediate
    friend finder
    contributor
    1 pt
    @jsearcy

    As always,  you are a great help! Thanks Sergey!

    #307035 Score: 0
    Profile photo of Jill Searcy
    Jill Searcy
    Member
    beginner
    intermediate
    friend finder
    contributor
    1 pt
    @jsearcy

    Ok – My animation is working perfectly but I need to allow the user to reset it so they can watch it from the beginning. The stop action on the timer stops the clock ticking (so to speak) but the animations based on the time intervals continues no matter what I do. Any ideas?

    #307038 Score: 0
    Profile photo of Jill Searcy
    Jill Searcy
    Member
    beginner
    intermediate
    friend finder
    contributor
    1 pt
    @jsearcy

    Never mind folks  – I determined that the timer was irrelevant. I added the timed interval action for each object with a coordinating variable (for a one or zero typical on off switch) and it works. Thanks to everyone who helped!

    #307046 Score: 0
    Profile photo of Sergey Snegirev
    Sergey Snegirev
    Member
    contributor
    intermediate
    advanced
    friend finder
    lab member
    junior moderator
    advocate
    LUC16
    LUC16 Attendee
    wise owl
    336 pts
    @ssneg

    I was just going to suggest using a variable. Be careful though as the toggle animation can stop at the VISIBLE or HIDDEN position with a 50%/50% chance. So you might want to add another action that definitely hides (or shows, depending on what you want to achieve) the object after the blinking has been stopped by the variable.

    #307050 Score: 0
    Profile photo of Jill Searcy
    Jill Searcy
    Member
    beginner
    intermediate
    friend finder
    contributor
    1 pt
    @jsearcy

    I noticed that in my testing but it won’t matter in this instance because I have to hide the object to reset the animations on the page so learners can watch them more than once if they need to. (It’s a step by step animation of a software tutorial.)

Viewing 13 posts - 1 through 13 (of 13 total)

You must be logged in to reply to this topic.