Adobe Edge:从HTML页面控制特定符号 [英] Adobe Edge: control a specific symbol from html page

查看:171
本文介绍了Adobe Edge:从HTML页面控制特定符号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要从我的 HTML页面(index.html-而不是edgeActions.js页面)控制我的一个边缘符号

I need to control over one of my edge Symbols, from my HTML page (index.html - not the edgeActions.js page)

例如,我有一个图像符号:"sym1",我想将其从html主页中隐藏. 我试过了:

For example, I have an image Symbol: "sym1", and I want to hide it from the main html page. I tried:

sym.$("sym1").hide();

sym.$( "sym1" ).hide();

但这是行不通的.

那是我可以使其工作的唯一方法(仅在edgeActions页面中):

That's the only way I could make it work (In edgeActions page only):

  Symbol.bindElementAction(compId, symbolName, "document", "compositionReady", function(sym, e) {
         var ex1 = sym.$( "sym1" );         

         yepnope({
            both: [
                "libs/jquery-ui.min.js",
                "libs/jquery-ui.css",
            ],
            callback: function() {

         ( ex1 ).hide();
            }
         });

      });

我需要了解如何使用JQuery从html主页面控制符号.

I need to understand how can I control the symbol from the main html page with JQuery.

推荐答案

当您不在边缘程序中时,要抓取符号,您需要做的不仅仅是调用符号".因此,让我带领您逐步了解如何获取您的符号:

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-您必须获得对特定构成的引用.这通常是#Stage元素上的类.如果您没有在Edge Animate中给它指定特定的名称,则默认名称将像EDGE-1230930194这样奇怪.

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-您需要获取特定的符号

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();

然后,您当然可以使用任何jQuery方法来解决它:

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

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

希望有帮助!

这篇关于Adobe Edge:从HTML页面控制特定符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆