dcsimg
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Loading a SWF file into PHP via XML!

  1. #1
    Fusion Of Sound
    Join Date
    Jul 2005
    Location
    Birmingham, UK
    Posts
    12

    Loading a SWF file into PHP via XML!

    Hey there, I have a PHP file, an SWF and an XML which contains all the information to go into the PHP.

    The XML is as follows:

    Code:
    <polls>
    <poll title="Who do you think should win Pop Icons 2009?">
    	<answers>
    	<answer>
    		<name>Michael</name>
    		<tally>0</tally>		<image>www.clipart.com/test1.jpg</image>
    		<flash>songs/1.swf</flash>
    	</answer>
    	<answer>
    		<name>George</name>
    		<tally>0</tally>		<image>www.clipart.com/test2.jpg</image>
    		<flash>songs/2.swf</flash>
    	</answer>
    So far the PHP code has been working correctly to display a different name and image in each cell in a table. However, when I've tried to insert the code for flash I get nothing now! Here is what I have so far, can anybody see what could be wrong with just the flash part to make the whole thing stop working? Here is the PHP code I have including the non-working flash part on the last few lines..

    PHP Code:
            for ($i 0$i 4$i++) {
                echo 
    "<td>";        
                echo 
    "<input type=\"radio\" name=\"vote\" value=\"" $polls->poll[$pid]->answers->answer[$i]->name "\" />" $polls->poll[$pid]->answers->answer[$i]->name.    
                         (isset(
    $polls->poll[$pid]->answers->answer[$i]->image)? 
                                
    '<br/><img src="' $polls->poll[$pid]->answers->answer[$i]->image '">'
                                 
    :'').
                                 
                        (isset(
    $polls->poll[$pid]->answers->answer[$i]->flash)?
                                 
    '<br/><object width="100" height="30">'
                                '<br/><param name="movie" value="' 
                                 
    $polls->poll[$pid]->answers->answer[$i]->flash '">'
                                 '<br/><embed src="' 
    $polls->poll[$pid]->answers->answer[$i]->flash '">'
                                 '<br/></embed>'
                                 '<br/></object>'
                             
                                 
    :'').                                                              
                                 
                          
    "\n";
            }
        } 
    I think I'm nearly there and it's just a simple mistake but I can't work it out!
    Thanks a lot
    Chris

  2. #2
    I know nothing.
    Join Date
    Feb 2008
    Posts
    315
    Could you attached the files so I could test?

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