Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
* Adobe Edge Animate Composition Actions
* Edit this file with caution, being careful to preserve
* function signatures and comments starting with 'Edge' to maintain the
* ability to interact with these actions from within Adobe Edge Animate
(function($, Edge, compId){
var Composition = Edge.Composition, Symbol = Edge.Symbol; // aliases for commonly used Edge classes
//Edge symbol: 'stage'
(function(symbolName) {
Symbol.bindSymbolAction(compId, symbolName, "creationComplete", function(sym, e) {
// insert code to be run when the symbol is created here
var thisScrollHandler = function(e) {
if(isScrolledIntoView(sym.element)) {
console.log('Start me up');;
$(window).off("scroll", thisScrollHandler);
function isScrolledIntoView(elem)
var docViewTop = $(window).scrollTop();
var docViewBottom = docViewTop + $(window).height();
var elemTop = $(elem).offset().top;
var elemBottom = elemTop + $(elem).height();
return ((elemBottom >= docViewTop) && (elemTop <= docViewBottom)
&& (elemBottom <= docViewBottom) && (elemTop >= docViewTop) );
if(isScrolledIntoView(sym.element)) {
} else {
$(window).on("scroll", thisScrollHandler);
//Edge binding end
Symbol.bindElementAction(compId, symbolName, "${_play}", "click", function(sym, e) {;
//Edge binding end
//Edge symbol end:'stage'
})(jQuery, AdobeEdge, "EDGE-4894298");

This comment has been minimized.

Copy link

@pojitonov pojitonov commented Jun 12, 2013

Could you explain how to setup this script in Edge Animate, I put it at stage on CreationComplete Action and it is doesn't work for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment