# Thumbs + xml + ROLL\_OUT = problems?

**URL:** <https://forum.kirupa.com/t/thumbs-xml-roll-out-problems/319237>\
**Category:** flash\
**Created:** [February 13, 2011, 9:14pm UTC](https://forum.kirupa.com/t/thumbs-xml-roll-out-problems/319237 "2011-02-13T21:14:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![entharas](https://avatars.discourse-cdn.com/v4/letter/e/ecae2f/32.png) [@entharas](https://forum.kirupa.com/u/entharas)\
**Post date:** [February 13, 2011, 9:14pm UTC](https://forum.kirupa.com/t/thumbs-xml-roll-out-problems/319237/1 "2011-02-13T21:14:56Z")

</div>

Hi 🙂  
I wanna make a gallery using xml. Every photo is gray, after ROLL\_OVER on it position loads it’s colored copy, and after ROLL\_OUT copy dissapears. After click, it should navigate to URL. And I have 2 problems:

1. ROLL\_OUT doesn’t work correctly: it’s strange, but it work after ROLL\_OVER … :\<
2. how to make linking, hm… for example, if it’s first thumb, to “proj/1”, if second to ‘proj/2’ etc…  
it’s my code:

```auto

import flash.net.URLRequest;
import flash.events.MouseEvent;
import flash.display.MovieClip;
import flash.display.Loader;
import fl.transitions.Tween;
import fl.transitions.easing.*;
var imageLoader:Loader;
var szary = new Loader();
var xml:XML;
var xmlList:XMLList;
var fadeTween:Tween;
var xmlLoader:URLLoader = new URLLoader();
xmlLoader.load(new URLRequest("images.xml"));

xmlLoader.addEventListener(Event.COMPLETE, xmlLoaded);

function xmlLoaded(event:Event):void
{
	xml = XML(event.target.data);
	xmlList = xml.children();
	for (var i:int = 0; i < xmlList.length(); i++)
	{
		imageLoader = new Loader();
		imageLoader.load(new URLRequest(xmlList*.attribute("thumb")));
		imageLoader.x = i * 167;
		imageLoader.y = 0;
		imageLoader.name = xmlList*.attribute("source");
		addChild(imageLoader);
		imageLoader.addEventListener(MouseEvent.CLICK, onClick);
		imageLoader.addEventListener(MouseEvent.ROLL_OVER, color);
		imageLoader.addEventListener(MouseEvent.ROLL_OUT, gray);

	}

}

function color(event:MouseEvent):void
{
	szary.load(new URLRequest(event.target.name));
	szary.x = event.target.x;
	fadeTween = new Tween(szary,"alpha",Regular.easeOut,0,1,1,true);
	addChild(szary);
}
function gray(event:MouseEvent):void
{
trace('s')
}
function onClick(event:MouseEvent):void
{
	var link:URLRequest = new URLRequest('proj/1/01.jpg');
	navigateToURL(link);
}

```

thank You in advance! 🙂
