# Migrate this code from AS2 to AS3

**URL:** <https://forum.kirupa.com/t/migrate-this-code-from-as2-to-as3/327610>\
**Category:** flash\
**Created:** [March 14, 2012, 2:02pm UTC](https://forum.kirupa.com/t/migrate-this-code-from-as2-to-as3/327610 "2012-03-14T14:02:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![felipegm](https://avatars.discourse-cdn.com/v4/letter/f/e9bcb4/32.png) [@felipegm](https://forum.kirupa.com/u/felipegm)\
**Post date:** [March 14, 2012, 2:02pm UTC](https://forum.kirupa.com/t/migrate-this-code-from-as2-to-as3/327610/1 "2012-03-14T14:02:27Z")

</div>

Hello all!

I´n trying to migrate this code from as2 to as3 but can´t make it work.  
Could someone please give me a hand on this?

```auto

var myXML:XML = new XML();
myXML.ignoreWhite = true;
myXML.load("teste.xml");
myXML.onLoad = function(success)
{
	if (success)
	{
		var myImage = myXML.firstChild.childNodes;
		var myURL = myXML.firstChild.childNodes.childNodes;
		for (i = 0; i < myImage.length; i++)
		{
			var imageNumber = i + 1;
			var imageURL= myImage*.attributes.url;
			var imageName = myImage*.firstChild.nodeValue;
			//trace("My image number " + imageNumber + " is titled " + imageName + " and its URL is " + imageURL + ".");
			container_mc.loadMovie (imageName);
                        container.onRelease = function (){
                        getURL (imageURL);
                        }
			
			}
		}
	}

```

Fla and XML attached.

Thanks a lot!
