Jump to content
Search Community

TypeError when loading GSAP in Flash HTMLLoader

dcak test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts



I have a GSAP animation that runs fine in all browsers (FF, IE, Chrome, Safari on Windows & Mac), but when I try to load the HTML page containing the animation from within Flash (using the HTMLLoader), TweenMax.js throws the following error:


TypeError: Result of expression 'rect.style' [null] is not an object.
 at app:/lipide/gsap/src/uncompressed/TweenMax.js : 3408
 at app:/lipide/gsap/src/uncompressed/TweenMax.js : 3414
 at app:/lipide/gsap/src/uncompressed/TweenMax.js : 5414
 at app:/lipide/gsap/src/uncompressed/TweenMax.js : 5430
 at app:/lipide/gsap/src/uncompressed/TweenMax.js : 5435
 at app:/lipide/gsap/src/uncompressed/TweenMax.js : 4754
 at app:/lipide/gsap/src/uncompressed/TweenMax.js : 7091


and, of course, the animation doesn't run (in fact the whole JS engine is stopped)


any ideas welcome...

Link to comment
Share on other sites

hmm, rect.style is related to how our CSSPlugin handles SVG elements.


A quick google search shows that the Air Webkit browser does not support SVG



Not sure when that was dated. 


Apparrently AIR 16 not so good? http://stackoverflow.com/questions/28022649/svg-support-in-adobe-air-16-0


To be frank, the Air Webkit browser is not high on our list of supported browsers (this is the first time anyone has mentioned it).


It would be great if you could narrow down where the problem might be. We really can't start building an Air app hoping to stumble into it. 


Are you animating SVGs? If so, if you remove that animation or the SVG elements does it work?


Another test, load an html page that only includes the TweenMax file 


<script src="/gsap/TweenMax.js"></script> 


But do not include any calls to TweenMax or any tween code.

none of this: TweenMax.to(element, 1, {x:200});


Still get the error?


If not start adding tweens until the error occurs.


Just curious to know if you can narrow down where the problem occurs. 


Also, please try the same animation with jQuery or css animation.

  • Like 2
Link to comment
Share on other sites

I think I figured it out.


The underlying reason for the error seemed to be line 3390 of TweenMax.js:


_createSVG = function(type, container, attributes) {
    var element = _doc.createElementNS("http://www.w3.org/2000/svg",type),

This apparently was interpreted as cross-site scripting and therefore prohibited by the Flash HTMLLoader.


When changed to


     var element = _doc.createElement(type),


the error disappeared, and everything worked fine - TweenMax.js loading, animations running...

...apparently without side-effects (did not explicitly try any SVG though).

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...