How to include a PHP generated XML file into flash vars, while ALSO passing through the current php functions into it?

Posted by Sam on Stack Overflow See other posts from Stack Overflow or by Sam
Published on 2010-12-22T01:59:36Z Indexed on 2010/12/22 3:54 UTC
Read the original article Hit count: 450

Filed under:
|
|
|
|

Hello Given situation: In webpage.php the flashscript is calling a flash script with a flashvar: the playlist file which is a PHP generated XML file: playlist.php, it does that well so long as there are no extra functions in there. Now, in that XML-format playlistfile there needs to be a special function, besides the usual echo("");, namely the very special echo __(""); function that is already declared in webpage.php which needs to do something with the paragraphs residing within that xml file.

However, currently the retrieved file misses the function echo __();and says "no such function declared in that xml-format [playlist.php] file". The php functions that are currently included at the very top of webpage.php somehow do not pass-through-the necessary functions into the playlist file for it to recognise how to handle it, in order for that playlist to get those necessary functions working.

Apparently these are not passed through automatically/properly when residing in the flashvars?? Cause the echo __(""); works fine when called within webpage.php or via a normal php include(""); if those functions are in a different php file. But not working from the playlist.php file.

Any ideas why/what is going on here?
I appreciate your clues for this prob +1. Thanks very much.


WEBPAGE.PHP the webpage, has at the top an include with functions:

<?php include (functions.php); ?> 
//  function that know what to do with echo __("paragraph")

<script language="JavaScript" type="text/javascript">
    run(
      'play', 'true',
      'loop', 'true',
      'flashvars', 'xmlFile=/incl/playlist.php',    // <<<< !!
      'wmode', 'transparent',
      'allowScriptAccess','sameDomain',
    );
</script>

<noscript>
   <object classid="blabla">
   <param name="allowScriptAccess" value="sameDomain" />
   <param name="movie" value="/movies/movie.swf" />
   <param name="flashvars" value="xmlFile=/incl/playlist.php" />  // <<< !!
   <embed src="/movies/movies.swf" type="application/x-shockwave-flash"/>
   </object>
</noscript>

PLAYLIST.PHP The PHP generated XML file which is retrieved into the webpage as flash variable (see above)

<?php
echo ('<?xml version="1.0" encoding="UTF-8"?>');
echo ('<songs>');
    echo ('<song version="1. "') . __("boom blue blow bell bowl") . ('/>');
    echo ('<song version="2. "') . __("ball bail beam bike base") . ('/>');
echo ('</songs>');
?>

© Stack Overflow or respective owner

Related posts about php

Related posts about Xml