Groups | Blog | Home
all groups > flash data integration > november 2005 >

flash data integration : Relative URLs fail with XML.load


goodbyemoto
11/30/2005 4:36:33 PM
It seems impossible to use relative URLs when calling an ASP page (that returns
a valid XML document) via XML.load

Everything works fine when the URL is absolute. I usually use a globally
defined variable ABS_PATH set to, say, "http://server.com/" so that I can
easily switch between servers during testing, eg
myXML.load(ABS_PATH+"GetXML.asp");

However, on my current project this is not possible as the client wants to be
able to move the files around from time to time.

I have seen a thread elswehere touching on this, but really need a definitive
'official' answer. Is there a reason why this will not work?
Motion Maker
11/30/2005 11:35:27 PM
Are you doing this inside of Control->Test Movie? If so you need the http
because the Flash authoring tool is not running from a server.

In any case I would trace ABS_PATH+"GetXML.asp" and see what you get. It
should have file://// if you are running from the test mode.

What I do to help me forget this is to add a test for

System.capabilities.playerType == "External"
and if true hardwire the ABS_PATH to the full http path on my test server
and to "" if false.

--
Lon Hosford
www.lonhosford.com
May many happy bits flow your way!
[quoted text, click to view]
It seems impossible to use relative URLs when calling an ASP page (that
returns
a valid XML document) via XML.load

Everything works fine when the URL is absolute. I usually use a globally
defined variable ABS_PATH set to, say, "http://server.com/" so that I can
easily switch between servers during testing, eg
myXML.load(ABS_PATH+"GetXML.asp");

However, on my current project this is not possible as the client wants to
be
able to move the files around from time to time.

I have seen a thread elswehere touching on this, but really need a
definitive
'official' answer. Is there a reason why this will not work?

Motion Maker
12/1/2005 9:32:14 AM
I hate resolving Flash issues once running under http. I found to make that
more pleasan I have a Debug version that loads a floating draggable
textfield so I can trace variables while running on the server and avoid the
Flash debugger.

Perhaps you might want to create a simple dynamice multiline Textfield
somewhere on the app and attach a UIScroller and dump some values to it.

In any case I ran a test on a live server as follows:

Using PHP on an Apache server I ran a test of an app we are currently
developing that calls both PHP returning XML and then proceeds to load SWFs:
A bunch of XML sendAndLoad and loadClip the next swf kind of thing.

Before the test the server script was in the same folder as the swf and
after I moved it to a sub folder. In both cases the path was relative.

I moved the .PHP script to a subfolder for the test and it seemed to work
using XML.sendAndLoad

appScriptPath = "_Testing/"
script = Config_Response.php"
trace (tr("\tappScriptPath + script = " , appScriptPath + script))
myRequest_xml.sendAndLoad(appScriptPath + script, myResponse_xml)

Trace showed: appScriptPath + script = : _Testing/Config_Response.php

Once the XML load is fired with success the program based on the download
swf name provided data goes off to load a swf using MovieClipLoader again
relative to the main.swf.

Not sure that should be any different with an ASP server side.

--
Lon Hosford
www.lonhosford.com
May many happy bits flow your way!
[quoted text, click to view]
No, I know exactly where it's running: what I'm trying to do is run the
movie
on a live web server, but it must use relative URLs. Absolute URLs, which I
normally use, are no good for this application.

The problem is that, when using relative URLs, Flash will happily open
other
local SWFs (that's local to the server, not local as on my machine) but will
not properly call an ASP page (via XML.load) that returns valid XML.

goodbyemoto
12/1/2005 10:31:09 AM
No, I know exactly where it's running: what I'm trying to do is run the movie
on a live web server, but it must use relative URLs. Absolute URLs, which I
normally use, are no good for this application.

The problem is that, when using relative URLs, Flash will happily open other
local SWFs (that's local to the server, not local as on my machine) but will
not properly call an ASP page (via XML.load) that returns valid XML.
AddThis Social Bookmark Button