Using Javascript variables to change XML file

Discussion in 'HTML & Website Design' started by Mizyan, Apr 20, 2011.

  1. #1
    Hello everybody, i have a video controller skin that i want to use in my website. The controller uses an XML file to define some parameters including the name and path of the flv video.
    What i want to do is to use multiple links to videos and when clicking on a link the name of the video in the controller ( which is found in the XML file) will change to the corresponding name for the clicked link, and reload the controller by reloading the controller, without reopening the page or opening a new one.
    In such case i need to use a javascript variable containing each time the name of the video link clicked, and change the name of the video in the XML file.
    Is there a way to use javascript to change a value existing in the XML file, and then to reset the controller. By the way i dont know XML but i it wasnt hard to get the name of the video found in the XML file.
    And if it helps Here is the XML code:
    <?xml version="1.0" encoding="UTF-8" ?>
    <flash_parameters copyright="socusoftFLVPlayerTheme">
        <preferences>
            <global>
                <basic_property movieWidth="500" movieHeight="400" html_title="Title" loadStyle="res/style(circle2).swf" hideAdobeMenu="true" enableURL="false" autoPlay="false" autoRepeat="false" backgroundColor="0xc0dcc0" bufferTime="5" defaultvolume="100"/>
                <panel_property panelbackgroundColor="0xc0c0c0" buttonColor="0x4b4b4b" buttonbackgroundColor="0x808080" currentbuttonColor="0xc0dcc0" dragbarColor="0x1e1e1e" bufferColor="0xc54339" slideColor="0xff0000" slidebgColor="0x000080" showTime="true" timeColor="0x808080"/>
                <video_property topPadding="1" bottomPadding="40" leftPadding="2" rightPadding="2"/>
                <title_property showTitle="false" titleColor="0xfffbf0" backgroundColor="0xa0a0a4" alpha="30" align="top"/>
                <description_property enable="true" textColor="0xfffbf0" backgroundColor="0x000080" backgroundAlpha="30" cssText="a:link{text-decoration: underline;} a:hover{color:#ff0000; text-decoration: none;} a:active{color:#0000ff;text-decoration: none;} .blue {color:#0000ff; font-size:15px; font-style:italic; text-decoration: underline;} .body{color:#ff5500;font-size:20px;}"  align="bottom"/>
            </global>
            <thumbnail>
                <basic_property enablethumBack="false" thumBackColor="0xff00ff" thumsAlpha="72" thumsradius="55" enablecurrentColor="false" currentBorderColor="0x0000ff" enableBorderColor="false" borderColor="" thumTextColor=""/>
            </thumbnail>
        </preferences>
        <album>
    	        <slide jpegURL="1/thumbs/1.jpg" d_URL="1/slides/1.jpg" v_URL="1/flv/1.flv" URLTarget="0" url="" title="1"/>
        </album>
    </flash_parameters>
    Code (markup):
    And the code in the HTML file is:
    <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="500" height="400" id="tech" align="middle">
            <param name="allowFullScreen" value="true"/>
    		<param name="allowScriptAccess" value="sameDomain" />
    		<param name="movie" value="cool.swf?xml_path=1.xml" />
    		<param name="quality" value="high" />
                    <param name="wmode" value="transparent">
    		<embed src="cool.swf?xml_path=1.xml" quality="high" wmode="transparent" width="500" height="400" name="tech" align="middle" allowScriptAccess="sameDomain" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
    	</object>
    Code (markup):

     
    Mizyan, Apr 20, 2011 IP