[Xerte] How do you detect someone clicking on text that has beenmarked with the hot text tags?

Julian Tenney Julian.Tenney at nottingham.ac.uk
Thu Sep 3 12:13:09 BST 2009


Good question.

I don't know. What I would try first of all is getting an event handling
myTextIcon.txt.onSetFocus. Then try using the Selection.getCaretIndex()
to get the position of the caret in the text, and figure things out from
there. You need to turn on selectableText on the LO icon to allow the
text field to have the caret placed into it. I've got it this far... see
attached.

Problem I get is Selection.getFocus() returns null, so might need a
short delay before looking for Selection.getBeginIndex(), and then using
substr / indexOf to find out where you are in the string.

There might be other approaches.


-----Original Message-----
From: xerte-bounces at lists.nottingham.ac.uk
[mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Johnathan
Kemp
Sent: Thursday, September 03, 2009 12:02 PM
To: Xerte discussion list
Subject: [Xerte] How do you detect someone clicking on text that has
beenmarked with the hot text tags?

Dear Xerte Team,

I have a text icon which contains text that is to long to fit in the
text box, so I am using a scroll bar. However I want to trap the user
clicking on sections of the text.

If I use a hot spot this becomes out of position when the user scrolls
the text icon, as the text moves but the hot spot does not.

Could I use the hot text tags to mark the text I want the user to click
on?

If so how would I then trap the event, distinguishing between one
section of text within the icon and another?

I am trying to avoid breakApart() as the text icon in question is being
used as a display area, being populated by script that reads the text
property of the appropriate text icon to be displayed and then using
setText() to set the text of the display text icon. If I can just put
tags in the text that would be ideal.

Kind regards

Johnathan


Johnathan Kemp
ICT Development Coordinator
Connexions Staffordshire
www.cxstaffs.co.uk
01785 355714


This email and any files transmitted with it are confidential and are
intended solely for the use of the individual(s) or entity(s) to whom
they are addressed. All messages are monitored for virus, high risk
files and inappropriate content. As a result users should be aware that
this mail maybe accessed, read and the right is reserved to reject,
return, remove attachments or delete if considered to be inappropriate
or unsuitable. Liability cannot be accepted for any loss or damage
arising from this email (or any attachments) or from scripts or any
virus transmitted.



This communication represents the originator's personal views and
opinions, which do not necessarily reflect those of Connexions
Staffordshire. If you are not the original recipient or the person
responsible for delivering the email to the intended recipient, be
advised that you have received this email in error, and that any use,
dissemination, forwarding, printing, or copying of this email is
strictly prohibited. If you received this email in error, please
immediately reply to the sender or notify postmaster at cxstaffs.co.uk





Connexions Staffordshire Limited is registered in England No.4355170

Registered office: Foregate House, 70 Foregate Street, Stafford,
Staffordshire, ST16 2PX

_______________________________________________
Xerte mailing list
Xerte at lists.nottingham.ac.uk
http://lists.nottingham.ac.uk/mailman/listinfo/xerte
-------------- next part --------------
A non-text attachment was scrubbed...
Name: whereAreWeClicking.rlo
Type: application/octet-stream
Size: 1497 bytes
Desc: whereAreWeClicking.rlo
Url : http://lists.nottingham.ac.uk/pipermail/xerte/attachments/20090903/6340ecb1/whereAreWeClicking.obj


More information about the Xerte mailing list