[Xerte] rootIcon.preloadMedia(); - Preloading Media
Julian Tenney
Julian.Tenney at nottingham.ac.uk
Fri Jan 15 15:48:13 GMT 2010
It isn't going to work on templates. In templates, often the path to the
image is an expression, not the URL, like
{templateData.blah[0].something[0].url}
The engine knows nothing of that script - it's Xerte script, and hasn't
run yet - and it can't evaluate the expression until any setup script
has run to create it the various variables / objects referred to.
You call preloadMedia()
PreloadMedia finds an expression in the XML:
{templateData.pageData[0].url}
BUT
preloadMedia / the engine cannot evaluate it - templateData does not
exist yet.
J
From: xerte-bounces at lists.nottingham.ac.uk
[mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Paul Beckwith
Sent: Friday, January 15, 2010 2:04 PM
To: 'Xerte discussion list'
Subject: RE: [Xerte] rootIcon.preloadMedia(); - Preloading Media
Nah no joy on onInit, still: rootIcon.preloadMedia(); ?
From: xerte-bounces at lists.nottingham.ac.uk
[mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Julian Tenney
Sent: 15 January 2010 13:48
To: Xerte discussion list
Subject: RE: [Xerte] rootIcon.preloadMedia(); - Preloading Media
Try calling it once the models have loaded then, and see what happens...
Set up an event handler for onInit and call preloadMedia() from there -
looks like it ought to work...
From: xerte-bounces at lists.nottingham.ac.uk
[mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Paul Beckwith
Sent: Friday, January 15, 2010 1:41 PM
To: 'Xerte discussion list'
Subject: RE: [Xerte] rootIcon.preloadMedia(); - Preloading Media
Is there a way around it? The lesson loads the rlm files upfront, what's
it doing, just making the pages?
From: xerte-bounces at lists.nottingham.ac.uk
[mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Julian Tenney
Sent: 15 January 2010 11:45
To: Xerte discussion list
Subject: RE: [Xerte] rootIcon.preloadMedia(); - Preloading Media
You can't because the models haven't loaded yet, so it isn't clear what
media is required,
J
From: xerte-bounces at lists.nottingham.ac.uk
[mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Paul Beckwith
Sent: Friday, January 15, 2010 10:17 AM
To: 'Xerte discussion list'
Subject: [Xerte] rootIcon.preloadMedia(); - Preloading Media
Hi everyone,
I have used rootIcon.preloadMedia(); before in lessons which has always
worked fine but can't seem to get it to do anything with the Xerte
template wizard when it's packaged. Is there something I need to do? I'm
calling it in the first script icon in the entry frame...
Paul
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.nottingham.ac.uk/pipermail/xerte/attachments/20100115/b2c2081b/attachment.html
More information about the Xerte
mailing list