[Xerte-dev] Re: Event horizon

Julian Tenney Julian.Tenney at nottingham.ac.uk
Tue Jun 18 16:01:42 BST 2013


You can but in a general sense it gets very messy

From: xerte-dev-bounces at lists.nottingham.ac.uk [mailto:xerte-dev-bounces at lists.nottingham.ac.uk] On Behalf Of Smith, John
Sent: 18 June 2013 16:00
To: For Xerte technical developers
Subject: [Xerte-dev] Re: Event horizon

Can't you do

oldRollOver = myObject.onRollOver;
myObject.onRollOver = function(){
    //do stuff
    oldRollOver();
}

Just a guess though I have no idea!!

Regards,

John Smith
Learning Technologist
School of Health & Life Sciences
Glasgow Caledonian University

From: xerte-dev-bounces at lists.nottingham.ac.uk<mailto:xerte-dev-bounces at lists.nottingham.ac.uk> [mailto:xerte-dev-bounces at lists.nottingham.ac.uk] On Behalf Of Julian Tenney
Sent: Tuesday, June 18, 2013 3:57 PM
To: For Xerte technical developers
Subject: [Xerte-dev] Re: Event horizon

It';s one of the limitations in AS2 that events can only have one listener:

myObject.onRollOver = function(){
  //do stuff
}

You cannot add further listeners to the onRollOver event. So if you later assign myObject.onRollOver = anotherFunction() you over write the orginal one yes.

rootIcon.onKeyPress is an attempt to work around that because it can persist and you can use flags etc to work out what to do. The actual events are onKeyDown and onKeyUp which you can listen for on individual icons, rather than rootIcon.

Either way around, without addEventListener which came later, it's limited.

From: xerte-dev-bounces at lists.nottingham.ac.uk<mailto:xerte-dev-bounces at lists.nottingham.ac.uk> [mailto:xerte-dev-bounces at lists.nottingham.ac.uk] On Behalf Of Dave Burnett
Sent: 18 June 2013 15:50
To: xerte-dev at lists.nottingham.ac.uk<mailto:xerte-dev at lists.nottingham.ac.uk>
Subject: [Xerte-dev] Event horizon


I have a text entry that uses an onKeyPress/rootIcon event setup to evaluate each key as it is pressed.

Now, there is a help screen that the user can invoke, and to dismiss it they can "Press any Key".
That also traps for the onKeyPress/rootIcon event

Of course, my text entry now stops functioning.
Once an event is re-used is the original gone?
Can a keypress event iconid be more local?
(I've never got it to work with anything but rootIcon as the broadcaster).

Dave


This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it.   Please do not use, copy or disclose the information contained in this message or in any attachment.  Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham.

This message has been checked for viruses but the contents of an attachment may still contain software viruses which could damage your computer system, you are advised to perform your own checks. Email communications with the University of Nottingham may be monitored as permitted by UK legislation.


Glasgow Caledonian University is a registered Scottish charity, number SC021474

Winner: Times Higher Education's Widening Participation Initiative of the Year 2009 and Herald Society's Education Initiative of the Year 2009.
http://www.gcu.ac.uk/newsevents/news/bycategory/theuniversity/1/name,6219,en.html

Winner: Times Higher Education's Outstanding Support for Early Career Researchers of the Year 2010, GCU as a lead with Universities Scotland partners.
http://www.gcu.ac.uk/newsevents/news/bycategory/theuniversity/1/name,15691,en.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nottingham.ac.uk/pipermail/xerte-dev/attachments/20130618/7ae92578/attachment.html>


More information about the Xerte-dev mailing list