Adobe LCCS:如何等待两个共享属性同步?

发布于 2024-12-01 15:28:43 字数 278 浏览 1 评论 0原文

我的应用程序中有两个 sharedProperties,一个其中另外还有一个指挥棒属性。如果我只想同步其中一个,这很容易,我只需向同步事件添加一个事件监听器即可。如果我有两个,我仍然可以将事件侦听器附加到两者以检查每个同步的时间,但是我将如何等待它们同步?

非常感谢我可以测试的任何代码示例。

I have two sharedProperties in an app, one of them is in addition a batonProperty. It is easy if I only want one of them to be synched, I just add an eventlistener to the sync event. If I have two though, I can still attach event listeners to both to check when each syncs, but how would I wait for both of them to be synched?

Any code samples I can test are much appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

感情洁癖 2024-12-08 15:28:43

我没有使用过sharedProperties,但是对于任何需要等待多个事件的情况,您不知道它们会以什么顺序发生,您可以使用这个非常基本的设置中的某些内容:

var event1occurred:Boolean;
var event2occurred:Boolean;

function onEvent1(e:Event):void {
    event1occurred = true;
    checkIfAllEventsOccurred();
}

function onEvent2(e:Event):void {
    event2occurred = true;
    checkIfAllEventsOccurred();
}

function checkIfAllEventsOccurred():void {
    if(event1occurred && event2occurred) {
        // Do stuff here
    }
}

I haven't worked with sharedProperties, but for any situation where you need to wait for more than one event, where you don't know in what order they will occur, you can use something in the lines of this pretty basic setup:

var event1occurred:Boolean;
var event2occurred:Boolean;

function onEvent1(e:Event):void {
    event1occurred = true;
    checkIfAllEventsOccurred();
}

function onEvent2(e:Event):void {
    event2occurred = true;
    checkIfAllEventsOccurred();
}

function checkIfAllEventsOccurred():void {
    if(event1occurred && event2occurred) {
        // Do stuff here
    }
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文