Lectora online GreenSock implementation

Hello,


I use Lectora online and try to get Greensock to work.


The way i use it:


Under the title i add a html extention.

object type: Meta tags

Custom html:


In a page i have a image (name: image64)

i added a html object to that page with the following:

Object type: Top of file scripting

custom html:


i cant get it to work. What am i doing wrong?

Discussion (6)

If you looked into your own published HTML file, you'd notice that Lectora treats the "top of file scripting" literally. It adds your script to the top of file before the opening HTML tag. So if you add JS this way, it a) invalidates HTML code and b) is executed before the GS script is even loaded. This why it doesn't work.


The top of file scripting - I guess - is reserved for PHP and other server-side stuff that you want to execute before your course page is rendered.


So if you want to do some JavaScripting, put all your code into the meta tags, like you did with GS library:

< script src=https://...cdn...greensockstuff />

< script src=my_own_functions.js />

Seems to me you are good until here:


<<< Object type: Top of file scripting >>>

<<< custom html: >>>


I add an Action, onShow "Run JavaScript" instead of your HTML Extension/Top of file script.

and your TweenMax statement is incorrect. The parameter is either autoAlpha or opacity.

@Paul Minni 61075 wrote:

The parameter is either autoAlpha or opacity.

Wrong. Proof: http://jsfiddle.net/99UXG/

@ssneg 61097 wrote:

Wrong. Proof: http://jsfiddle.net/99UXG/


Your example isn't working for me. No matter what value I enter for alpha the result is literally [object Object]. And it doesn't take two seconds to complete either.


But I did substitute "alpha" for "opacity" in some of my GSAP code and it did function the same, so I stand corrected.

Yep. GSAP guys try to keep the same syntax between the AS3 and JS libraries, so they allow using alpha in JS version although it looks and feels strange to any JS developer.

Wow, it's been a long time since I thought about AS3... I wasn't GSAP aware back in those days.

Discussions have been disabled for this post