dcsimg
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Read XML on a certain page

  1. #1
    Junior Member
    Join Date
    Apr 2010
    Posts
    4

    Read XML on a certain page

    I have a gallery that I need to read from a certain xml when it's on a certain page and read from a different database when it's on a different page. I have my xml loading in database info, but I need to use a $_GET['id'] for my pages. How can I put this either in the flash file or in the xml so if I'm on page display_wedding.php?id=1 my gallery is different than if I'm on display_wedding.php?id=2?

  2. #2
    Senior Moderator
    Defender of the Faith
    Pope de Flash's Avatar
    Join Date
    Feb 2000
    Posts
    3,429
    a simple way to do it is to pass a flash var into the swf when the page changes. So you simply declare a var like the code below. I am using a var called "current" to set what state I need in the player. This creates a var in the swf root with the name current. So I can call that var in my player with the argument _root.current so simply have the player load the right xml by creating a trigger that uses your flash var. You could simply pass the entire url for the xml as a flash var. The first way you can pass different vars in and change content without having to change pages.

    <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,18,0" width="800" height="600" align="middle" id="fullscreen">
    <param name="allowFullScreen" value="true" />

    <param name="movie" value="Uni_player.swf?current=3&amp;Vid=/media/flashvideo/100609_4.flv&amp;yo=dnu&amp;xml=/xml/dnu/20100609.xml&amp;path=14578&amp;downl=/media/wm.nmc.global/100609_4.wmv" />
    <param name="bgcolor" value="#000000" />
    <embed src="Uni_player.swf?current=3&amp;Vid=/media/flashvideo/100609_4.flv&amp;yo=dnu&amp;xml=/xml/dnu/20100609.xml&amp;path=14578&amp;downl=/media/wm.nmc.global/100609_4.wmv" allowFullScreen="true" bgcolor="#000000" width="800" height="600" name="fullscreen" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
    </object>
    Macromedians 1:1

    In the beginning the web was without shape and color, and the hype covered the darkness of the net. Then there was a Flash and life came to the web and vision became reality.

    Footer... We dont need no Stinking Footers!!!!

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