Adobe Edge: control a specific symbol from html page

落爺英雄遲暮 提交于 2019-12-04 20:35:28

Grabbing symbols when you're outside of the edge program require you to do a bit more than call "Symbol." So let me just walk you through how to grab your symbol:

1st - You have to get a reference to the specific composition. This will generally be the class on the #Stage element. If you don't give it a specific name in Edge Animate, the default name will be something weird like EDGE-1230930194.

var myAnim = AdobeEdge.getComposition("nameOfComposition");

2nd - You need to grab the specific symbol

var mySymbol = myAnim.getSymbols("nameOfSymbol")[0]; // Because it's in an array

And there ya have it! You got yourself the symbol. If you wanted to play it in reverse for example then you'd do this:

mySymbol.playReverse();

The more interesting things to do for finer manipulation involve grabbing the underlying element like so:

var mySymbolElem = mySymbol.getSymbolElement();

And then of course you can use any jQuery methods to mess around with it:

mySymbolElem.fadeOut(5000, function(){alert("alerts rox")});

Hope that helps!

After Edge render to html page, all symbol will be merge with a new id name are connected by an "_". For example if you want to change an image of a symbol named "thumb01":

$('#Stage_thumb01').css('background-image',  'url('thumb_img_02.jpg')');

"Stage" is a root default container of an Edge html

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!