[Xerte] rootIcon.preloadMedia(); - Preloading Media

Julian Tenney Julian.Tenney at nottingham.ac.uk
Fri Jan 15 16:52:56 GMT 2010


I'd probably make a component to do it, and then punt it an array of
paths? Be better as a swf than Xerte code I think, but essentially you
just need to loop over the array and create clips or sounds to load the
content into and then as each piece loads, have it tick off a tracking
list of some sort. When the tracking list is empty, you're done, and the
component can fire an event to Xerte to let it know.

 

The component could have a progress bar / mask the screen / however you
like to do this,

 

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 4:53 PM
To: 'Xerte discussion list'
Subject: RE: [Xerte] rootIcon.preloadMedia(); - Preloading Media

 

Ok, thanks mate have a good weekend J

 

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 16:34
To: Xerte discussion list
Subject: RE: [Xerte] rootIcon.preloadMedia(); - Preloading Media

 

Yes, of course, but you'll need the paths

 

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 4:36 PM
To: 'Xerte discussion list'
Subject: RE: [Xerte] rootIcon.preloadMedia(); - Preloading Media

 

Can I preload specific files manually?

 

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 15:48
To: Xerte discussion list
Subject: RE: [Xerte] rootIcon.preloadMedia(); - Preloading Media

 

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/62d0d199/attachment.html


More information about the Xerte mailing list