开发者

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

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>');
?>
开发者_如何学编程


As I understand it, you pass the path to playlist.php to the Flash Player, which then connects to the server to call the actual php page. If that is true, you must include the __() function into the playlist.php as well, or otherwise it can't be called.


i'm not sure it's ok to give swf a relative url to server script

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜