A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: [F8] XML Path Problem??? Please help...i'm desperate (deadline)

  1. #1
    Junior Member
    Join Date
    Jul 2004
    Posts
    16

    [F8] XML Path Problem??? Please help...i'm desperate (deadline)

    Hello.

    Could someone give me a hand on this thing i'm working on? I'm trying to get this xml 'image_loader' (similar to kde wipes) rotation thing working for this page i'm working on. i have to make some adjustments with the path to the files according to how it is going to work on this site i'm working on. i'm not sure how or where to change the path in the actionscript to get to the path.

    i've included a folder called '- example working without paths' which is to show how it is supposed to look. this works when everything is in one folder. but, when i setup the site structure the swf can't find the xml or the images to load...so i'm not really sure how to fix it. the 'root.hml' in the root folder represents the main html file that i'm using for the site.

    could someone take a look at the file? any help at all is GREATLY appreciated...i'm desperate.

    thanks a MILLION in advance.

    - skinnybonez
    Attached Files Attached Files

  2. #2
    Junior Member
    Join Date
    Jul 2004
    Posts
    16
    i thought i would include the code where i think the problem is.

    Code:
    // ** init class ** //
    ImageFader.prototype.__init__ = function () {
    	this._xscale = 100
    	this._yscale = 100
    	this.bounding_box.unloadMovie()	
    	this._fader_.unloadMovie()
    	this._dataProvider = new Array ();
    	this._count = 0;
    	this._depth = 1;
    	this._isLoaded = -1;
    	if (this._S_) {
    		clearInterval (this._S_);
    	}
    	if (this._xmlfile != "xmlstuff/images.xml") {
    		this.loadXML (this._xmlfile);
    	}
    };
    // *** load the external xml ** //
    ImageFader.prototype.loadXML = function (x) {
    	var _xml = new XML ();
    	_xml.ignoreWhite = true;
    	_xml.path = this;
    	_xml.load (x);
    	_xml.onLoad = function () {
    		for (var a = 0; a < this.firstChild.childNodes.length; a++) {
    			var _trans = this.firstChild.childNodes[a].attributes.TRANSITION;
    			var _pause = this.firstChild.attributes.PAUSE
    			var _img = this.firstChild.childNodes[a].firstChild.nodeValue;
    			this.path._dataProvider.push ({img:_img, transition:_trans, pause:_pause});
    		}
    		this.path.startFading ();
    		delete this;
    	};
    };
    here's the xml file:
    Code:
    <?xml version="1.0"?>
    <!-- 
    set transition number from 1 to 9
    set transition number to 0 for random effect
     -->
    <RSS PAUSE="12000">
    	<IMAGE TRANSITION="1">IM000241.jpg</IMAGE>
    	<IMAGE TRANSITION="2">IM000282.jpg</IMAGE>
    	<IMAGE TRANSITION="3">IM000283.jpg</IMAGE>
    </RSS>
    the directory structure is like this:

    - (root folder)
    root.html
    - -(flash)
    root.swf
    - -(images)
    3 jpg images are in here
    - -(xmlstuff)
    images.xml

  3. #3
    Registered User nunomira's Avatar
    Join Date
    May 2002
    Location
    portugal
    Posts
    7,003
    Hi,

    if your folder structure works locally, but stops working online, because the .swf is not in the same folder as the .html, consider using the base attribute.
    See this post.

  4. #4
    Junior Member
    Join Date
    Jul 2004
    Posts
    16
    hey nunomira

    nope...it doesn't work locally. i am using the swfobject so that isn't the problem...i am 99% sure it's the path in the AS to the files..i just don't know how to declare it in the AS.

  5. #5
    Junior Member
    Join Date
    Jul 2004
    Posts
    16
    but, maybe i'm confusing what you are saying after i thought about the link to the post. could you post a quick example?

  6. #6
    Registered User nunomira's Avatar
    Join Date
    May 2002
    Location
    portugal
    Posts
    7,003
    I wasn't clear enough. By "works locally" I meant - "everything works" when you test it from Flash (in the Test Player).
    Does it work?

    If it doesn't, and you get loading errors in the Output Panel, you'll have to correct the path(s).

    If everything works, but when you upload the files and folders to the server, even though you maintain the folder structure you've placed the .swf file in a different folder other than where the .html is, the relative paths change.
    Using the base attribute solves this.

    If you maintain the folder structure, set the base attribute to the folder where the .swf is. Something like:
    Code:
    <script type="text/javascript">
       var so = new SWFObject("movie.swf", "mymovie", "600", "400", "7", "#FFFFFF");
       so.addParam("base", "../flash/");
       so.write("flashcontent");
    </script>

  7. #7
    World Kit Vote Holder Abelius's Avatar
    Join Date
    Feb 2002
    Location
    US
    Posts
    963
    This just might do the trick... :P
    Cordially,
    Abelius
    www.worldkit.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center