www.webdeveloper.com
Results 1 to 5 of 5

Thread: swf trouble reading XML document. Locally works.

  1. #1
    Join Date
    Dec 2010
    Posts
    3

    swf trouble reading XML document. Locally works.

    Hello.

    I've been busy to customise a flash banner with XML content.
    The XML document should call the images, texts and url.

    Well, running locally everything is fine but uploading the whole thing gives nothing.

    someone already tried to help me but they failed to. Probably the XML file isn't complete?!

    here the XML:

    <?xml version="1.0" encoding="utf-8" ?>
    <banner>
    <globals>
    <currentItem>0</currentItem>
    <width>700</width>
    <height>300</height>
    <radius>0</radius>
    <showButtons>1</showButtons>
    <showContent>1</showContent>
    <!--Blur Filter-->
    <blurX>0</blurX>
    <blurY>0</blurY>
    <!--Content-->
    <bgColor>#FFFFFF</bgColor>
    <bgAlpha>0.6</bgAlpha>
    <bgPaddingBottom>10</bgPaddingBottom>
    <buttonTitleColor>
    <default>#000000</default>
    <rollOver>#CD0000</rollOver>
    <current>#FFFFFF</current>
    </buttonTitleColor>
    <buttonDescriptionColor>
    <default>#444444</default>
    <rollOver>#FF0000</rollOver>
    <current>#F0F0F0</current>
    </buttonDescriptionColor>
    <titleColor>#00CCFF</titleColor>
    <titleFontSize>28</titleFontSize>
    <descriptionColor>#FFFFFF</descriptionColor>
    <descriptionFontSize>13</descriptionFontSize>
    </globals>
    <item>
    <image>/App_Themes/ol-OL/images/content/banner/rotating/images/1.jpg</image>
    <buttonTitle><![CDATA[HP Touchsmart]]></buttonTitle>
    <buttonDescription><![CDATA[IQ830, NQ852AA]]></buttonDescription>
    <title><![CDATA[]]></title>
    <description><![CDATA[]]></description>
    <timer>5</timer>
    <url>/NEL/Catalog/cat_sku.asp?CatIds=%2C%26webid=5812129%26affixedcode=WW</url>
    <target></target>
    </item>
    </banner>


    the HTML in a cms:

    <object width="700" height="140"> <embed src="/App_Themes/ol-OL/images/content/banner/rotating/banner.swf" height="140" width="700" align="center" border="0" wmode="transparent"> </embed> </object><!-- top_banner-->


    the SFW should automatically get the XML file at the same directory.

    Thanks,

    7/11

  2. #2
    Join Date
    Feb 2008
    Location
    NW Washington State
    Posts
    1,856
    Almost always when it works locally but not on the server, then it's a pathing issue. Since neither your .swf or the .xml file are in the same folder as the Web page, pathing is by far the most likely problem. You have to realize that once you place the .swf on a Web page in a different folder than the physical location of the .swf file, you are in effect, removing the .swf from that folder. So now... from the location on the web page... what is the path to the .xml file? The path to the xml needs to be relative to the location on the Web page, not it's physical location.
    From an old post:
    Pathing issues

    Almost always when it works on the local machine and not the server, it's a pathing problem.
    You can put your Flash related files in whatever folders you want, they do not have to be in the root. But if sticking them in there worked, then you know that the issue was a pathing problem.
    Just remember that paths become relative to the Web page on which those Flash files are used. So for example, if your .swf is in the flash/data folder and you use that .swf on a Web page in the root, you are in effect, removing that .swf from flash/data and putting it in root. So if the .swf is loading any related files (xml, etc), the path used inside the .swf to the .xml file has to be relative to it's new location in root and back down into flash/data. This is true even though when testing the .swf by itself, it can be inside flash/data and work just fine, since relative to it's location, the path is just fine, they are in the same folder. But if that same path is used when the .swf is placed on a page two folder levels up, the relative path has changed, the old "same folder" path will not work.
    So just be sure that you use addresses relative to the final locations and you can put the files wherever you want.
    Best wishes,
    Eye for Video
    www.cidigitalmedia.com

  3. #3
    Join Date
    Dec 2010
    Posts
    3
    Hi,

    Thank you for your answer. I also read the other thread, so I removed temporary the xml file and re-export the swf file. An error report came in looks like this:

    Streamfout. URL: file:///C|/Documents&#37;20and%20Settings/test/banner.xml
    at net.flashden.flashblue::Main/loadXML()
    at net.flashden.flashblue::Main/init()

    The question is: Where in the flash file can I change the path to a relative path?
    I checked the source code and nowhere seem to written to link to an xml file.


    Thanks again
    7/11

  4. #4
    Join Date
    Feb 2008
    Location
    NW Washington State
    Posts
    1,856
    Streamfout. URL: file:///C|/Documents%20and%20Settings/test/banner.xml
    This is a path on a local machine, is that what you entended?
    If the path from the Web page to the .swf is:
    Code:
    <embed src="/App_Themes/ol-OL/images/content/banner/rotating/banner.swf"
    and your .xml is in the same folder as that .swf, then the path from the .swf on the Web page back down to the .xml file would be:
    Code:
    /App_Themes/ol-OL/images/content/banner/rotating/your_file.xml
    The pathing issue is just one of any number of things that might be causing the problem. It's just a good idea to get the pathing correct and then move on if there are still other issues.
    When testing locally have you tested in both IE and FF? The reason I ask is that your <embed> code looks lacking. If you can get it to work in IE that way, fine, but <embed> is normally used just for FF and will not work in IE.
    If needed, you could place the Flash on the Web page like this:
    Code:
    <object data="path_to_file/file.swf" type="application/x-shockwave-flash" width="insert_width_of_movie" height="insert_height_of_movie">                    
              	<param name="movie" value="path_to_file/file.swf">
    	        <param name="SomeOtherParam" value="ParamValue">
    </object>
    Best wishes,
    Eye for Video

  5. #5
    Join Date
    Dec 2010
    Posts
    3
    Hey Eye for Video,

    Finally it works!! There was also an main.as hidden somewhere which had a URL path written to the XML document. I changed the path and used your object description.

    Thanks a lot!
    7/11

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



Recent Articles