A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Saving XML to Disk

  1. #1
    strandedgenius.com
    Join Date
    Apr 2005
    Location
    Toronto
    Posts
    187

    Saving XML to Disk

    In AS3 I have a swf that talks to a PHP file. That PHP should take a passed variable from Flash in this case an XML object, and save that to disk.

    This is my PHP script tell me where I went wrong:

    Code:
    <?php
    
    $xmlstr = $HTTP_POST_VARS['xmldoc'];
    $action = $HTTP_POST_VARS['action'];
    
    if ($action == "send") {
    
    	$default_dir = "NEW_BLAH.xml";
    
    	$fp = fopen($default_dir,'w');
    
    	$write = fwrite($fp,$xmlstr);
    
    	$flcose = fclose($fp);
    
    	//$test = $dom->save("C:/new_config.xml");
    
    	echo "XML Saved";
    	
    }
    
    ?>
    JScarlip,
    That Was Nice!

  2. #2
    Registered User
    Join Date
    Feb 2001
    Posts
    13,041
    Hi,

    so in your flash code you have a loadvars object, and set its xmldoc member to that xml object?

    Musicman

  3. #3
    strandedgenius.com
    Join Date
    Apr 2005
    Location
    Toronto
    Posts
    187
    Yeah except in AS3 LoadVars doesn't exist anymore. It's now URLVariables URLRequest and URLLoader classes. But some basic idea. Let's just assume that PHP does pick up that variable which is an XML Object, what do I do from there?
    JScarlip,
    That Was Nice!

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