Fw: [Xerte] Loading External Content

steve.frank at lucite.com steve.frank at lucite.com
Thu Mar 5 08:49:13 GMT 2009


Thanks for the help guys..

 I take the point regarding the XMLEngine.swf location and typing the full 
path to the text file solves the problem.

When I try to use FileLocation in the way described it returns 'undefined' 
i.e. Flash throws up an error opening URL 
"file:///....../Media/Pane1/undefinedOverview.txt"

Is this a limitation of the version of Flash that I am using (MX 2004)?

Steve


__________________________________________________________________________________
Lucite International Group Limited. Registered in England No. 5671799. 
Registered Office: Queens Gate, 15-17 Queens Terrace, Southampton SO14 
3BP, United Kingdom
Holding Company for the Lucite International Group
 
----- Forwarded by Steve J Frank/GB/ACRYLICS on 05/03/2009 08:19 -----

Julian Tenney <Julian.Tenney at nottingham.ac.uk>
Sent by: xerte-bounces at lists.nottingham.ac.uk
04/03/2009 16:32
Please respond to
Xerte discussion list <xerte at lists.nottingham.ac.uk>


To
"Xerte discussion list" <xerte at lists.nottingham.ac.uk>
cc

Subject
RE: [Xerte] Loading External Content






You need to use the FileLocation variable to get the full path to the 
external path. 
 
myData.load("Overview.txt");
 
works in the browser, because the XMLEngine.swf is in the same folder; 
when in authoring mode, the XMLEngine.swf is in the Xerte application 
folder, so it looks in that folder when you only specify the fiename.
 
You can use _level0.engine.FileLocation to get the first bit of the path, 
i.e:
 
myData.load(_level0.engine.FileLocation + "Overview.txt");
 
HTH,
 
J
 
 
From: xerte-bounces at lists.nottingham.ac.uk 
[mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Patrick Lockley
Sent: Wednesday, March 04, 2009 4:09 PM
To: Xerte discussion list
Subject: RE: [Xerte] Loading External Content
 
Hi Steve,
 
It fails me for me when I press the f5 key – but it works fine if I 
publish it then look at in a web browser (via index.htm).
 
Might be a sandbox / security setting on your flash player?
 
Hope this helps.
 
Pat
 
From: xerte-bounces at lists.nottingham.ac.uk 
[mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of 
steve.frank at lucite.com
Sent: 04 March 2009 15:46
To: xerte at lists.nottingham.ac.uk
Subject: [Xerte] Loading External Content
 

I am attempting to load some external content into a Xerte project but I'm 
having difficulty getting this to work when the content itself gets data 
from an external file. 

The project uses a custom interface and  contains a couple of graphics 
icons together with a number of flex style accordian panes, listitems and 
tabs. Selecting the appropriate combination should load the required 
external content into the graphic icons using the loadImage() method. e.g. 
displayGraphic.loadImage(FileLocation + 'Media/Pane1/Graphics.swf') 

The external content is always in the form of an .swf file however there 
are two distinct types. 
One contains a number of scenes that are linked by some actionscript. All 
the graphics are contained within the .swf and this type of file loads and 
operates without issue. 
The second type contains only a single dynamic text block together with a 
ScrollPane component. The timeline contains the following ActionScript to 
load the text from a plaintext file at runtime: 

myData = new LoadVars(); 
myData.onLoad = function(success){ 
        if (success) { 
                myText_txt.htmlText = this.text; 
        } else { 
                myText_txt.htmlText = "<b>Flash has failed to load the 
text file!<b>"; 
        } 
}; 

myData.load("Overview.txt"); 

Overview.txt is located in the same directory as the .swf and is in the 
form "text=Required text etc. etc. etc..." 

When I test the .swf, it loads and displays the content of Overview.txt as 
expected, however when I try to get Xerte to load this file I get the 
"Flash has failed to load the text file!" message. 

Displaying text from an external source file is going to be a major part 
of this project so I need to get this to work. 

Being an Authorware refugee, I'm only just getting started with Flash and 
Xerte so would appreciate any help! 

Steve

__________________________________________________________________________________
Lucite International Group Limited. Registered in England No. 5671799. 
Registered Office: Queens Gate, 15-17 Queens Terrace, Southampton SO14 
3BP, United Kingdom
Holding Company for the Lucite International Group
 
IMPORTANT NOTICE::- This email is confidential, may be legally privileged, 
and is solely for the use of the intended recipient. Access, disclosure, 
copying, distribution, or reliance on any of it by anyone else is 
prohibited and may be a criminal offence. 
If you have received this e-mail by mistake, please notify the sender 
immediately by e-mail and delete this e-mail from your system. The sender 
has taken reasonable precautions to ensure no viruses are present in this 
e-mail however the company cannot accept 
responsibility for any loss or damage arising from the use of this e-mail 
or attachments. Please note that this e-mail has been created in the 
knowledge that Internet e-mail is not a 100% secure communications medium. 

We advise that you understand and consider this lack of security when 
e-mailing us.


Message from Lucite International EMail Administration:
This mail has been scanned for spam content and passed. If however it is 
actually spam please accept our apology for any inconvenience and assist 
us in improving our scanning system accuracy by reporting the email using 
the link below.
Click here to report this email as spam.
_______________________________________________
Xerte mailing list
Xerte at lists.nottingham.ac.uk
http://lists.nottingham.ac.uk/mailman/listinfo/xerte

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.nottingham.ac.uk/pipermail/xerte/attachments/20090305/480c69f2/attachment.html


More information about the Xerte mailing list