Object Script Delay

HelpXplain is the exciting new animated infographics and screencast tool that integrates with Help+Manual.

Moderators: Alexander Halser, Tim Green

Post Reply
Terry McMorrow
Posts: 14
Joined: Tue Jul 23, 2019 2:22 am

Object Script Delay

Unread post by Terry McMorrow »

Trying to show a next page button when user clicks right answer, I want an audio to play and then the button to appear

Not sure how to start invisible and then show,
tried hiding object and then using this command to show
xplain.set("#shape",{x:-100,display: 'block' }, 5.0)
This does move the object (tested by not hiding first)

I tried having the object off screen and then move it on screen
xplain.set("#shape",{x:-100}, 5.0)

The problem with this approach is that it moves it on immediatly,
How can I get it to show after a certain delay? Or after the audio plays
User avatar
Tim Green
Site Admin
Posts: 23156
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Object Script Delay

Unread post by Tim Green »

Hi Terry,

Getting elements to display after a delay is one of the basic features of HelpXplain animations. To apply it, click on the element to select it, then in the Animations tab, select one of the show animations: Show, Fade In, Zoom In, or Move In. If you then look in the toolbar, you can select the delay before the animation starts, in addition to the duration of the animation and the pause after it finishes.

To further control this you could stop play at a certain point and attach a click action to a visible element to start play again. To do that, select the element, then select Execute a script in the Link & Interaction section on the right and use the xplain.play() command to restart the animation.
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
Terry McMorrow
Posts: 14
Joined: Tue Jul 23, 2019 2:22 am

Re: Object Script Delay

Unread post by Terry McMorrow »

Hi Tim

Thanks for getting back to me, Let me try explaining better

Here are steps to create issue

put 2 shapes on canvas, rename them to shape1 and shape2

For shape1 select Execute a script and put this script in
xplain.animateTo("#shape2", 5, {x:100, y:200}, 10)

When you preview slideshow and click shape1, shape2 does move but there is not a 10 second delay, it executes immediately.

Same issue (no delay) with
xplain.animateFromTo
xplain.set
User avatar
Tim Green
Site Admin
Posts: 23156
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Object Script Delay

Unread post by Tim Green »

Hi Terry,

Ah, now I see what you mean. I just tested this and you're right, the delay value is being ignore. I'm not quite sure what the issue is here. I'm checking with the developer and will get back to you when I have more information. :)
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
User avatar
Alexander Halser
EC-Software Support
Posts: 4098
Joined: Mon Jun 24, 2002 7:24 pm
Location: Salzburg, Austria
Contact:

Re: Object Script Delay

Unread post by Alexander Halser »

Hi Terry,

I apologize - there is no last parameter "delay" in this function, this is obviously a mistake in the online help.
However, you can specify a delay with the "delay" attribute:

xplain.animateTo("#shape2", 5, {x:100, y:200, delay:10})

HelpXplain licenses the javascript library TweenLite from GreenSock for animations. The function "xplain.animateTo()" is in fact directly wired to "TweenLite.to()" with all its functionality. Here is more documentation about this function:

https://greensock.com/docs/v2/TweenLite/static.to()

Please handle the function with care, in particular with delays. When animating objects according to a timeline (slide entry or exit), the HX script keeps the timeline in mind when performing other user interactions, such as a switch to the previous slide. Timeline-animated objects cancel their animations and get reset to original values so that the animation can begin again if the slide is viewed a second time. This animation handling is not in place for user-defined scripts. So when a user clicks on that object first (which doesn't do anything before the delay) and then switches to the next or previous slide, the animation will still execute and nothing will stop it. Keep that in mind when designing your Xplain.
Alexander Halser
Senior Software Architect, EC Software GmbH
Post Reply