[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
70
S
19
G
139
Posts: 3,318
Reputation: 82,218

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
99
S
22
G
192
Posts: 4,176
Reputation: 111,215

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
70
S
19
G
139
Posts: 3,318
Reputation: 82,218


Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 0 guests