[Xerte-dev] Re: dumb question about variables and xerte content page type....

Julian Tenney Julian.Tenney at nottingham.ac.uk
Tue Feb 28 11:43:02 GMT 2012


Maybe it's just me but I wouldn't use those areas to store the data, not sure there is any reason not to, but it doesn't feel quite right.

I'd create a property on rootIcon, probably an object, and store data in that:

If (rootIcon.dataStore == undefined){ //we haven't already got one
  rootIcon.dataStore = new Object();
}

then later

rootIcon.dataStore.yourDataName = "some value";

It would be easy to add this to the engine and make it part of the framework, then you could have convenient methods for getting / setting the values. But it ought to work through your own script anyway.

From: xerte-dev-bounces at lists.nottingham.ac.uk [mailto:xerte-dev-bounces at lists.nottingham.ac.uk] On Behalf Of Ron Mitchell
Sent: 28 February 2012 11:39
To: 'For Xerte technical developers'
Subject: [Xerte-dev] dumb question about variables and xerte content page type....

Hi
this is probably a dumb question that I should know the answer to and I'm sure I'm doing or missing something stupid - my only excuse - been a bit under the weather :-(

I'm testing adding a couple of model files via xerte content to an XOT project. In the first model I want to capture text entries and store in a variable(s) and then access what was entered in the other model imported to a separate and later page. But I'm struggling to pick up those variables in the second model/page.

I've tried _root.myvariablename=myrs.text; _level0.myvariablename=myrs.text; _global.myvariablename=myrs.text;

What am I missing? Is it something to do with the way xerte content pages are loaded?

Cheers
Ron
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nottingham.ac.uk/pipermail/xerte-dev/attachments/20120228/1d2b02e1/attachment.html>


More information about the Xerte-dev mailing list