# Unserializing an xml passed from php

**URL:** <https://forum.kirupa.com/t/unserializing-an-xml-passed-from-php/315926>\
**Category:** Uncategorized\
**Created:** [November 8, 2010, 2:17am UTC](https://forum.kirupa.com/t/unserializing-an-xml-passed-from-php/315926 "2010-11-08T02:17:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![wildliferescuer](https://avatars.discourse-cdn.com/v4/letter/w/edb3f5/32.png) [@wildliferescuer](https://forum.kirupa.com/u/wildliferescuer)\
**Post date:** [November 8, 2010, 2:17am UTC](https://forum.kirupa.com/t/unserializing-an-xml-passed-from-php/315926/1 "2010-11-08T02:17:55Z")

</div>

Hi there  
I am working on a site that contains a variable called $xml that contains an xml file.  
I have passed the variable to flash using

```auto
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
  codebase="http://macromedia.com/cabs/swflash.cab#version=6,0,0,0"
  ID=testxml WIDTH=250 HEIGHT=250>
  <PARAM NAME=movie VALUE="txml.swf">
  <PARAM NAME=FlashVars VALUE="txml=<?php echo (urlencode(utf8_encode(serialize($xml))));?>"
  <PARAM NAME=quality VALUE=medium>
  <PARAM NAME=bgcolor VALUE=#99CC33>
  <EMBED src="txml.swf" FlashVars="txml=<?php echo (urlencode(utf8_encode(serialize($xml))));?>"
    bgcolor=#99CC33 WIDTH=250 HEIGHT=250
    TYPE="application/x-shockwave-flash">
  </EMBED>
</OBJECT>

```

Now I am having a problem getting the data back into an array in flash.  
I have been trying to use the serializer class though I have never used it before and I am not getting the result I want.  
This is the Action Script I have tried using to retrieve and unserialize the array though it is not working:

```auto
import SerializerClass
newdata = new Serializer().unserialize(this.txml);

```

If anyone has experience in using the serializer class or has any idea why my code isn’t working your help or tips would be greatly appreciated!!!
