[Solved]Calling an action from JavaScript

Post your completed addons to share with the community

Post » Fri Apr 05, 2013 4:30 am

How do I call an Action from either another action, or an external function?

Say I have Action:
Acts.prototype.PlayByName = function (folder, filename, looping, vol, tag)
{}

How do I call it from:
Acts.prototype.PlayByNameEx = function (folder, filename, looping, vol, tag)
{
}

or

function SomeFnc()
{
}

Thanks.blackhornet2013-04-05 16:48:17
ImageImageImage
B
71
S
19
G
167
Posts: 3,428
Reputation: 96,572

Post » Fri Apr 05, 2013 8:51 am

Reference
[code]cr.plugins_.Text.prototype.acts.SetText.apply(this.inst, [param]);[/code]

SetText is an action in Text plugin. Call this action with the Text object instance.
B
105
S
25
G
216
Posts: 4,295
Reputation: 123,644

Post » Fri Apr 05, 2013 4:47 pm

Thank you! I was able to optimize the self-call to:

pluginProto.acts.PlayByName.apply(this, []);
ImageImageImage
B
71
S
19
G
167
Posts: 3,428
Reputation: 96,572


Return to Completed Addons

Who is online

Users browsing this forum: LaurenceBedford and 2 guests