[Xerte] Xerte3: Loading external data

Julian Tenney Julian.Tenney at nottingham.ac.uk
Tue Jun 15 14:59:43 BST 2010


Set up the HTTPService

Give it an iconID, set the ul to your xml file

In a  script you call myHTTP.send();

You handle the result in an event handler - the event name is 'result'

Then debug(event.result) for the data. See attached.

-----Original Message-----
From: xerte-bounces at lists.nottingham.ac.uk
[mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Peter
Huppertz
Sent: 15 June 2010 14:43
To: Xerte discussion list
Subject: Re: [Xerte] Xerte3: Loading external data

So, I wasn't sure how to use the HTTPService. I tried to place a script
calling myHTTPIcon.load() beneath the myHTTPIcon, but that gave a
reference error. I also looked up the examples, but could not find one
for the HTTPService.


On 15.06.2010, at 15:38, Julian Tenney wrote:

> Did the HTTPService not work, or did you just decide it was easier to
> use the templateData
> 
> -----Original Message-----
> From: Tenney Julian 
> Sent: 15 June 2010 14:36
> To: 'Xerte discussion list'
> Subject: RE: [Xerte] Xerte3: Loading external data
> 
> Sure, why not.
> 
> -----Original Message-----
> From: xerte-bounces at lists.nottingham.ac.uk
> [mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Peter
> Huppertz
> Sent: 15 June 2010 14:36
> To: Xerte discussion list
> Subject: Re: [Xerte] Xerte3: Loading external data
> 
> I'm using the templateDataSource of the Application icon. This works
> like a charm. I use it to load a XML file which holds all the text of
my
> piece, so I'm ready to translate it to different languages by just
> adding a new language to my xml. Would you do it that way?
> 
> Peter
> 
> 
> 
> On 15.06.2010, at 14:29, Julian Tenney wrote:
> 
>> I think you need to call iconID.load()?
>> 
>> -----Original Message-----
>> From: xerte-bounces at lists.nottingham.ac.uk
>> [mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Peter
>> Huppertz
>> Sent: 15 June 2010 13:15
>> To: Xerte discussion list
>> Subject: [Xerte] Xerte3: Loading external data
>> 
>> There are a number of Data icons in Xerte3. As far as I can see
>> HTTPService is the only icon which is working at the moment. Can I
use
>> this icon to load a XML file which is located in the same directory
as
>> my Xerte piece?
>> 
>> I tried the following:
>> HTTPService, url = languages.xml
>> -- EventHandler "result", debug(event.target.data)
>> but nothing comes up.
>> 
>> Alternatively I tried to load it using a script icon:
>> 
>> import flash.net.URLLoader;
>> import flash.net.URLRequest;
>> var loader:URLLoader = new URLLoader();
>> loader.addEventListener(Event.COMPLETE, loadXML);
>> loader.load(new URLRequest("languages.xml"));
>> function loadXML(e:Event):void {
>> xml = new XML(e.target.data);
>> debug(xml);
>> }
>> 
>> This gives me: Parse Error: msg.no.paren.arg [line:5/k04]
>> 
>> Any ideas?
>> 
>> Peter
>> 
>> 
>> ==================================
>> Peter Huppertz
>> E-learning and IT Specialist
>> International Centre for Asset Recovery
>> Basel Institute on Governance
>> Phone: +41 61 205 55 18
>> Fax: +41 61 267 55 19
>> 
>> _______________________________________________
>> 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
> 
> ==================================
> Peter Huppertz
> E-learning and IT Specialist
> International Centre for Asset Recovery
> Basel Institute on Governance
> Phone: +41 61 205 55 18
> Fax: +41 61 267 55 19
> 
> _______________________________________________
> 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

==================================
Peter Huppertz
E-learning and IT Specialist
International Centre for Asset Recovery
Basel Institute on Governance
Phone: +41 61 205 55 18
Fax: +41 61 267 55 19

_______________________________________________
Xerte mailing list
Xerte at lists.nottingham.ac.uk
http://lists.nottingham.ac.uk/mailman/listinfo/xerte
-------------- next part --------------
A non-text attachment was scrubbed...
Name: httpService.x3o
Type: application/octet-stream
Size: 306 bytes
Desc: httpService.x3o
Url : http://lists.nottingham.ac.uk/pipermail/xerte/attachments/20100615/141476bd/httpService.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: data.xml
Type: text/xml
Size: 67 bytes
Desc: data.xml
Url : http://lists.nottingham.ac.uk/pipermail/xerte/attachments/20100615/141476bd/data.xml


More information about the Xerte mailing list