[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
67
S
19
G
122
Posts: 3,207
Reputation: 73,401

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
97
S
22
G
178
Posts: 4,118
Reputation: 104,043

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
67
S
19
G
122
Posts: 3,207
Reputation: 73,401


Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 3 guests