[Xerte] Is there a way to make an exit button?
Paul Swanson
Paul.Swanson at harlandfs.com
Fri Aug 8 17:46:29 BST 2008
Julian, it never ceases to amaze me how quickly you add functionality to
Xerte!
callJS works great. I placed the following code within the same
<script></script> tags as the 'myRLO = new rloObject()' code:
function closeWindow () {
// closes this window
self.close ();
}
and call it in Xerte with callJS ('closeWindow', ''); The stage exits,
and no warning message from the browser since I use JS to open the
course in a pop-up new window. Just like I wanted.
Thanks again, Jules!
Paul
________________________________
From: xerte-bounces at lists.nottingham.ac.uk
[mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Julian Tenney
Sent: Friday, August 08, 2008 1:03 AM
To: Xerte discussion list
Subject: RE: [Xerte] Is there a way to make an exit button?
I have no idea why getURL doesn't work, but it just doesn't. I
know it used to.
I added a new function 'callJS(functionName, parameters)' which
wraps Flash's ExternalInterface.call method.
It allows you to synchronously communicate with javascript and
is a much better way of going about things because it's cross platform
and it works. Download the latest build and it's in there. Use it like
this:
callJS('myJavascriptFunctionName', 'parameters');
Also in the latest build is a completely overhauled help file
which I'm still working on, so any comments on that would be timely.
J
________________________________
From: xerte-bounces at lists.nottingham.ac.uk
[mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Paul Swanson
Sent: 07 August 2008 23:32
To: Xerte discussion list
Subject: RE: [Xerte] Is there a way to make an exit button?
Good idea, Dave. Tried it, but same results, dang it.
________________________________
From: xerte-bounces at lists.nottingham.ac.uk
[mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Dave Burnett
Sent: Thursday, August 07, 2008 3:25 PM
To: Xerte discussion list
Subject: RE: [Xerte] Is there a way to make an exit
button?
Susbstitute an alert for the close logic.
Just to see if the function is executing.
________________________________
Subject: RE: [Xerte] Is there a way to make an exit
button?
Date: Thu, 7 Aug 2008 15:15:42 -0700
From: Paul.Swanson at harlandfs.com
To: xerte at lists.nottingham.ac.uk
Not an alert. I just ran the code as I've written it
below. The getURL caused a blank tab to open while leaving the window
the course is running in open.
________________________________
From: xerte-bounces at lists.nottingham.ac.uk
[mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Dave Burnett
Sent: Thursday, August 07, 2008 3:10 PM
To: Xerte discussion list
Subject: RE: [Xerte] Is there a way to make an
exit button?
It doesn't close the window, but you said you
tested it with an alert in the JS and it is actually trying to do
something?
Or am I having a senior moment?
________________________________
Subject: RE: [Xerte] Is there a way to make an
exit button?
Date: Thu, 7 Aug 2008 14:42:44 -0700
From: Paul.Swanson at harlandfs.com
To: xerte at lists.nottingham.ac.uk
I changed the case to
getURL('javascript:closeWindow()'); but it still doesn't work. I also
tried adding the following to the main setup script:
// set security to allow access to scripts in
our domain.
System.security.allowDomain('*.harlandds.com');
System.security.allowDomain('localhost');
I'm testing on localhost. The updated file still
doesn't close the window. It does (and did this with getURL) cause
Firefox to open a new tab, but it's blank. The Xerte window stays open.
Oh, and Firebug (a Firefox plugin for web developers) reports
"closeWindow is not defined" as a javascript error. I'm sure that's
because it isn't finding the JS code in the web page.
P
________________________________
From:
xerte-bounces at lists.nottingham.ac.uk
[mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Julian Tenney
Sent: Thursday, August 07, 2008 2:08 PM
To: Xerte discussion list
Subject: RE: [Xerte] Is there a way to
make an exit button?
getURL should work. Check the case.
________________________________
From:
xerte-bounces at lists.nottingham.ac.uk on behalf of Paul Swanson
Sent: Thu 07/08/2008 18:10
To: Xerte discussion list
Subject: RE: [Xerte] Is there a way to
make an exit button?
So how do you access external
javascript? I've added the following to the script section of the html
page:
function closeWindow () {
// closes this window
self.close ();
}
I've tried calling it with:
getUrl('javascript:closeWindow()');
and:
ExternalInterface.call('closeWindow');
Neither work, so I know I'm not doing it
right. What's the correct command and syntax? fsCommand?
Paul
________________________________
From:
xerte-bounces at lists.nottingham.ac.uk
[mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Julian Tenney
Sent: Thursday, August 07, 2008 12:56 AM
To: Xerte discussion list
Subject: RE: [Xerte] Is there a way to
make an exit button?
You've got it - it will have to be some
javascript. I don't know if you can close the window without that 'a
script is trying to close this window' security dialog.
Let me know how you get on - I could add
a close function to the html pages Xerte publishes,
J
________________________________
From:
xerte-bounces at lists.nottingham.ac.uk
[mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Paul Swanson
Sent: 06 August 2008 23:45
To: Xerte discussion list
Subject: [Xerte] Is there a way to make
an exit button?
Is there a command that will close the
Flash window? rootIcon.exit(); leaves the "Loading Complete" message on
screen. Or will I have to call some javascript in the html page that
launches the course?
_____________________________
Paul Swanson
Portland, Oregon, USA
_____________________________
________________________________
Your PC, mobile phone, and online services work
together like never before. See how Windows(r) fits your life
<http://clk.atdmt.com/MRT/go/108587394/direct/01/>
________________________________
Get Windows Live and get whatever you need, wherever you
are. Start here.
<http://www.windowslive.com/default.html?ocid=TXT_TAGLM_WL_Home_082008>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.nottingham.ac.uk/pipermail/xerte/attachments/20080808/4a53b213/attachment.html
More information about the Xerte
mailing list