Events handlers in JavaScript


hi!

i'm evaluating director, using vbscriptxtra connect com objects director.

with xtra, can in lingo:
-- event handler class in 1 script
on new me
return me
end
on onerrorevent me, args
alert("onerrorevent fired")
end
on onresponseevent me,args
alert("onerrorevent fired")
end
-- end event handler class

-- caller class (in script)
on new me
me.objcomintegrator = xtra("vbscriptxtra").createobject("boinkintegrator.clsintegrator")
me.objcomintegrator.eventshandler = new(script("comeventhandler"))
end
-- end caller class

this works fine in application , can recive events com library.

i want translate javascript. here code:
-- event handler class

function comeventhandler()
{
this.onerrorevent = onerrorevent;
this.onresponseevent = onresponseevent;
}
function onerrorevent(args)
{
_player.alert("onerrorevent fired");
}
function onresponseevent (args)
{
_player.alert("onresponseevent fired");
}
-- end event handler class
-- caller class
function clscontroller()
{
this.objcomintegrator = xtra("vbscriptxtra").createobject("boinkintegrator.clsintegrator");
trace("creando el objeto clscontroller");
this.objcomintegrator.eventshandler = new comeventhandler();
}
-- end caller class

this not work , don't know why.

the xtra provider answer me this:
"in general, possible use js vbscriptxtra, limitations applied director itself. problem director not allow xtra handle js class object xtra level. events handling works parent script instances or sprite behaviours. should set like:
me.objcomintegrator.eventshandler = new(script("comeventhandler"))

when use:
this.objcomintegrator.eventshandler = new comeventhandler();"

it’s possible in lingo, in javascript

i'll thank

regards,

jorge dario arias
software engineering
boink system inc.
www.boink.com

well, don't use javascript version. it's flash users
try director.

">
> works fine in application , can recive events com
> library.
>
> want translate javascript. here code:
> -- event handler class
>
>
> not work , don't know why.
>
> xtra provider answer me this:
> "in general, possible use js vbscriptxtra,
> limitations
> applied director itself. problem director not
> allow
> xtra handle js class object xtra level. events
> handling
> works parent script instances or sprite behaviours. should
> set
> like:
> me.objcomintegrator.eventshandler = new(script("comeventhandler"))
>
> when use:
> this.objcomintegrator.eventshandler = new comeventhandler();"
>
> it?s possible in lingo, in javascript
>
> i'll thank
>
> regards,
>
> jorge dario arias
> software engineering
> boink system inc.
> www.boink.com
>
>




More discussions in Director Lingo


adobe

Comments

Popular posts from this blog

Connecting Raspberry Pi 2 to P10(1R)-V706 LED Dot Matrix - Raspberry Pi Forums

TypeError: <unknown> is not a numpy array - Raspberry Pi Forums

datso and removing imagetitle - Joomla! Forum - community, help and support