[Xerte] RE: Call script function from HREF anchor?

Dave Burnett d_b_burnett at hotmail.com
Tue Dec 22 22:50:13 GMT 2009


OK, for the archives, I think I may have sussed it out.

In a text icon I have:
<a href="asfunction:_level0.engine.help_function,Click">Click</a>

help_function is the name of an isFunc script icon somewhere above the text icon that contains this:
eventObject.word = args[0];
rootIcon.broadcast('showDefinition');

Then I have an event response off an interaction set to icon: rootIcon and eventName: showDefinition

Below that in a script:
debug(eventObject.word);
 
So when you click on the word "Click", it triggers the function and passes the word "Click" as an argument.
The function sets "Click" as the word property of eventObject, then broadcasts the "showDefinition" event, which is picked up by the event response.

Probably just re-invented the wheel, and slightly out of round to boot.


From: d_b_burnett at hotmail.com
To: xerte at lists.nottingham.ac.uk
Subject: Call script function from HREF anchor?
Date: Tue, 22 Dec 2009 12:22:15 -0500








I can't seem to get the syntax for calling a named script icon function from an html link.

 		 	   		  
Hotmail: Trusted email with powerful SPAM protection. Sign up now. 		 	   		  
_________________________________________________________________
Your E-mail and More On-the-Go. Get Windows Live Hotmail Free.
http://clk.atdmt.com/GBL/go/171222985/direct/01/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.nottingham.ac.uk/pipermail/xerte/attachments/20091222/23f6f431/attachment.html


More information about the Xerte mailing list