Thanks for the comment.
Just to be clear, The TweenMax works if it sits outside of the function and the video works as well. (The video code is Sizmek code)
So this works.
this.c4.addEventListener("click", playvideo);
TweenMax.to(this.c10, 1, {alpha:1, ease: Power2.easeOut}, "+=0") ;
function playvideo () {
//attach video element to body
var bodyElement = document.body;
bodyElement.insertBefore(videlem, bodyElement.childNodes[0]);
videlem.play();
}
---------------
This plays the video but not the TweenMax animation. (when the TweenMax is after the video code)
this.c4.addEventListener("click", playvideo);
function playvideo () {
//attach video element to body
var bodyElement = document.body;
bodyElement.insertBefore(videlem, bodyElement.childNodes[0]);
videlem.play();
TweenMax.to(this.c10, 1, {alpha:1, ease: Power2.easeOut}, "+=0") ;
}
---------------
This does not play the video so it appears that the TweenMax is throwing an error but why?
this.c4.addEventListener("click", playvideo);
function playvideo () {
TweenMax.to(this.c10, 1, {alpha:1, ease: Power2.easeOut}, "+=0") ;
//attach video element to body
var bodyElement = document.body;
bodyElement.insertBefore(videlem, bodyElement.childNodes[0]);
videlem.play();
}