Hi and thank for your answer. Yes, I'm sorry, Globals was misspelled but it's not the cause of my issue. my_gs is used by the other developers. Their code, which is executed before mine, is the following:
var oldgs = window.GreenSockGlobals;
var oldgs_queue = window._gsQueue;
var my_gs = window.GreenSockGlobals = {};
// your library here..
try{
// They misspelled Globals!!!!!!!!!!!!
// But I don't think that this is the cause
window.GreenSockGobals = null;
window._gsQueue = null;
delete(window.GreenSockGlobals);
delete(window._gsQueue);
} catch(e) {}
try{
window.GreenSockGlobals = oldgs;
window._gsQueue = oldgs_queue;
} catch(e) {}
Then I tried to use your code. This is included after the above one. Here is my code
var oldgs = window.GreenSockGlobals;
var oldgs_queue = window._gsQueue;
var wpppgs = window.GreenSockGlobals = {};
// your library here..
try{
window.GreenSockGlobals = null;
window._gsQueue = null;
delete(window.GreenSockGlobals);
delete(window._gsQueue);
} catch(e) {}
try{
window.GreenSockGlobals = oldgs;
window._gsQueue = oldgs_queue;
} catch(e) {}
What happens here is that when this code is executed I get the following error:
Uncaught TypeError: Cannot read property 'greensock' of undefined
and if I try to call TweenMax in this way
plugin.timeline = new wpppgs.TimelineMax(tlObj);
// or also plugin.timeline = new TimelineMax(tlObj);
it returns
Uncaught ReferenceError: TimelineMax is not defined
If I force the other plugin to be executed after mine, the two works correctly. But, of course, I can have control over it and there could be other plugins producing the same issue. So I would need to find a way that allow my plugin to work together with any other using TweenMax, whether it's fired before mine or not.
Thanks!
Thomas