gree / lwf

LWF - Lightweight SWF
http://gree.github.com/lwf/
zlib License
627 stars 167 forks source link

About using telltarget, fscommand in Unity #91

Closed ghost closed 10 years ago

ghost commented 10 years ago

Could you give me example about using telltarget, fscommand from flash in Unity?

splhack commented 10 years ago

tellTarget is the same as Flash 3's

// this.foo.stop();
tellTarget("foo"){
    stop();
}

// this._parent.stop();
tellTarget("../"){
    stop();
}

// _root.stop();
tellTarget("/"){
    stop();
}

fscommand is for LWF event system. In Flash action panel,

fscommand("event", "done");

In C#, you can handle the event as the following.

lwfObject.AddEventHandler("done", (movie, button) => {
    // movie and button are where this event was invoked from
});
ghost commented 10 years ago

Thanks you very much!