[Xerte] Can a button respond to both onRelease and onRollOver?

Julian Tenney Julian.Tenney at nottingham.ac.uk
Wed Aug 19 13:20:58 BST 2009


Put all the responses on the same interaction...?

-----Original Message-----
From: xerte-bounces at lists.nottingham.ac.uk
[mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Johnathan
Kemp
Sent: Wednesday, August 19, 2009 12:44 PM
To: Xerte discussion list
Subject: RE: [Xerte] Can a button respond to both onRelease and
onRollOver?

I have set up a test project which I have zipped and attached.

Project structure is
Page
	Interaction
		Button
			Interaction
				Event (onRelease)
					Script
				Event (onRollOver)
					Script
				Event (onKeyDown)
					Script

The button is using the aquaBtn.swf

In preview mode the button initially fails to trigger an onRollOver
event.
When it is first clicked on it triggers two onRollOver events.
>From then on
	when it is rolled over it triggers an onRollOver event and 
	when it is clicked it triggers an onRelease event.

When clicked on the button graphic does not change to display the
pressed state.

If you add an ID value to the button the button animation now responds
to being clicked, but the events attached to the buttons interaction no
longer fire. If you then add a script directly to the button, the script
runs when the button is clicked.

Inspecting the button it appears that the onRollOut event is not
available ?

Kind regards

Johnathan
 


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


 


-----Original Message-----
From: xerte-bounces at lists.nottingham.ac.uk
[mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Julian Tenney
Sent: 19 August 2009 11:16
To: Xerte discussion list
Subject: RE: [Xerte] Can a button respond to both onRelease and
onRollOver?

Give the button the 'rs' property 'myBtn'

After the button add an event response, icon: myBtn; eventName:
onRollOver.

That works - no need for the workaround. 'rs' is a rubbish name for a
property I grant you, but it refers to the actual response, the button
in this case. The id refers to the page of content that is parsed when
the button is clicked. An interaction response is two things: the
interactive item, and the page of content.

-----Original Message-----
From: xerte-bounces at lists.nottingham.ac.uk
[mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Johnathan
Kemp
Sent: Wednesday, August 19, 2009 9:17 AM
To: Xerte discussion list
Subject: RE: [Xerte] Can a button respond to both onRelease and
onRollOver?

Welcome back,

I hope you have had a great holiday.

The button is a swf, it's the aquaBtn.swf from the loDemo example file.

Kind regards

Johnathan 


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


 


-----Original Message-----
From: xerte-bounces at lists.nottingham.ac.uk
[mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Julian Tenney
Sent: 19 August 2009 09:04
To: Xerte discussion list
Subject: RE: [Xerte] Can a button respond to both onRelease and
onRollOver?

This doesn't sound quite right - is this a native Xerte button or a
custom one?

-----Original Message-----
From: xerte-bounces at lists.nottingham.ac.uk
[mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Johnathan
Kemp
Sent: Monday, August 17, 2009 3:28 PM
To: Xerte discussion list
Subject: RE: [Xerte] Can a button respond to both onRelease and
onRollOver?

>From the tests I have conducted so far it appears that if the button
has
an ID then it will behave like a button, but if you want to detect the
onRollOver event you have to give the button an RS value and remove the
ID, at which point it forgets it is a button.

After sending the email I suddenly realised how to work around this.

Leave the button as a button and only trap the mouse click.
Add a hotspot that is large enough to provide a one pixel border around
the button and ensure it is beneath the button, then the button is not
blocked out by the hotspot and the 1 pixel border has to be crossed by
the mouse before you can point at the button, triggering the onRollOver
event. 

A bit of cludge but it works :-) 


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


 


-----Original Message-----
From: xerte-bounces at lists.nottingham.ac.uk
[mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Patrick
Lockley
Sent: 17 August 2009 15:12
To: Xerte discussion list
Subject: RE: [Xerte] Can a button respond to both onRelease and
onRollOver?

Bit past what I know but try an onRollOver and an onClick event for the
"button"

-----Original Message-----
From: xerte-bounces at lists.nottingham.ac.uk
[mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Johnathan
Kemp
Sent: 17 August 2009 15:13
To: Xerte discussion list
Subject: [Xerte] Can a button respond to both onRelease and onRollOver?

I have a page with space for a text icon to be displayed and a number of
buttons.

The idea is that if you mouse over the button the text object specific
to that button will be displayed and if you click on the button then you
will be taken to a new page - the one that relates to that button.

I am using a swf borrowed from one of your examples for the button
(aquaBtn.swf)

If I include the button in an interaction on the page, and add a script
to the button then the button animates its pressed image when clicked
and the script fires.

If I add an event to the interaction, to detect the onRollOver event for
the button, I have to add an RS value to the button and set the event to
use the button's rs value. The button will now fire an onRollOver event,
triggering the script attached to the event. However the button now
ceases to act as a button. The animation no longer shows when it is
clicked and the script attached to the button no longer fires.

If I now add an ID to the button, the button operates as a button once
more, animating when clicked and firing the attached script, but the
onRollOver event is no longer detected, even if the ID and RS values for
the button are the same.

If I leave the button as a button (remove the RS value) and try placing
a hotspot over it, the hotspot triggers the onRollOver event, but
effectively masks the button, so again no animation and no reaction to
being clicked.

Is it possible to have a button that behaves like a button but also to
have the onRollOver event trapped so that it fires a script?

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
_______________________________________________
Xerte mailing list
Xerte at lists.nottingham.ac.uk
http://lists.nottingham.ac.uk/mailman/listinfo/xerte

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
_______________________________________________
Xerte mailing list
Xerte at lists.nottingham.ac.uk
http://lists.nottingham.ac.uk/mailman/listinfo/xerte

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
_______________________________________________
Xerte mailing list
Xerte at lists.nottingham.ac.uk
http://lists.nottingham.ac.uk/mailman/listinfo/xerte

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


More information about the Xerte mailing list