$SCRIPT_START var canvas, stage, exportRoot, anim_container, dom_overlay_container, fnStartAnimation; var prevFrame = null, isPlaying = true; function initCanvas() { canvas = document.getElementById("$CANVAS_ID"); anim_container = document.getElementById("$ANIM_CONTAINER_ID"); dom_overlay_container = document.getElementById("dom_overlay_container"); $CREATE_LOADER $LOAD_MANIFEST $PRELOAD_ASSETS } $HANDLE_FILE_LOAD_START $HANDLE_FILE_LOAD_BODY $HANDLE_FILE_LOAD_END $HANDLE_COMPLETE_START //This function is always called, irrespective of the content. You can use the variable "stage" after it is created in token create_stage. $CREATE_STAGE //Registers the "tick" event listener. $START_ANIMATION //Code to support hidpi screens and responsive scaling. $RESP_HIDPI createjs.Ticker.addEventListener("tick", tick); createjs.Ticker.addEventListener("tick", stage); try{ var callOutside = window.parent.iFrameAnimationLoaded; } catch(e){} if (typeof callOutside !== "undefined") { callOutside(creativeName); } $HANDLE_COMPLETE_END $PLAYSOUND function tick(evt){ if(isPlaying){ if(exportRoot.currentFrame != prevFrame){ //console.log(exportRoot.currentFrame); prevFrame = exportRoot.currentFrame; try{ var callOutsideToTrackPosition = window.parent.moveSliderToCurrentFrame; } catch(e){} if (typeof callOutsideToTrackPosition !== "undefined") { callOutsideToTrackPosition(creativeName, exportRoot.currentFrame, exportRoot.totalFrames); } } } } $SCRIPT_END
$PRELOADER_DIV