1

I have a flash file where I can pass xml from file :

  1. script type="text/javascript">

  2. var flashvars = {};

  3. flashvars.xmlSource = "XML.xml";
    ...

  4. /script>

Can I send xml from php in varible to flash example:

$xml = "?xml version="1.0 ...";

  1. script type="text/javascript">
  2. var flashvars = {};
  3. flashvars.xmlSource = ?php echo $xml; ?>; ...
  4. /script>

thank you

4
  • Yes, you can do that. You'd have to change your flash file to use an xml as a string instead of an filename though. Is there something elese to the question that we're missing? :) Commented Jun 27, 2011 at 12:57
  • but is there a way without changing flash file. Passing this xml string to flash. Commented Jun 27, 2011 at 13:00
  • You can output the xml from php and load it normally on Flash. You load the php file as if it was the xml file, and everything should work normally. Commented Jun 27, 2011 at 13:15
  • Can I convert this string to XML object and pass it to like file ? Commented Jun 27, 2011 at 13:22

1 Answer 1

1

Do like in your first example, but let XML.xml actually be a PHP file that echoes out the XML content. (Or call it xml.php and pass that as the xml filename)

Sign up to request clarification or add additional context in comments.

2 Comments

so Only solution is to create new file and generate xml? There is no way to convert this string and pass it directly.
No, you don't have to create a new file. flashvars.xmlSource = "xml.php" and in xml.php: echo "$xmlstuff";

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.