# MovieClip Color

**URL:** <https://forum.kirupa.com/t/movieclip-color/138389>\
**Category:** Uncategorized\
**Created:** [February 22, 2005, 10:24am UTC](https://forum.kirupa.com/t/movieclip-color/138389 "2005-02-22T10:24:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Konijn](https://avatars.discourse-cdn.com/v4/letter/k/ea666f/32.png) [@Konijn](https://forum.kirupa.com/u/Konijn)\
**Post date:** [February 22, 2005, 10:24am UTC](https://forum.kirupa.com/t/movieclip-color/138389/1 "2005-02-22T10:24:05Z")

</div>

Hey,

I have created an xml navigation and there are some differen categories in it.  
But now I want that the button will have a color that is his categorie.  
I used this code:

```auto
if( menuItem*.attributes.cat == "Vector work"){

				var myColor:Color = new Color();
				this.myColor.setRGB(0xff0000);
			}

```

But that won’t do nothing.  
This is the complete code:

```auto
menuXml = new XML();
menuXml.ignoreWhite = true;
menuXml.onLoad = function(success) {
	if (success) {
		menuItem = this.firstChild.childNodes;
		
		//tijdelijke variabelen
		// y_as onthoud de y positie
		// x_as onthoud de x positie
		// tmp onthoud de beginwaarde.
		//--------------------- Start positionering
		var y_as= 40;
		var x_as= 20;
		var tmp = 20;
		for (var i = 0; i<menuItem.length; i++){
		item = attachMovie("itemClip", "itemClip"+i, i);
		//Color
		if( menuItem*.attributes.cat == "Vector work"){

				var myColor:Color = new Color();
				this.myColor.setRGB(0xff0000);
			}
		//hoog tmp op met 40 om knop naast de vorige te plaatsen.
		tmp = tmp+30;
		//ken de tijdelijke tmp toe aan x_as
		x_as = tmp;
		//telling begint met nul, om de if-statement te laten werken moet er één bij worden opgeteld.
		var x = i+1;
		//niet het laatste element van een rij
		if(x%7 != 0){
		 item._x = x_as;
		 item._y = y_as;
		}else if(i==0){

		 item._x = x_as;
		 item._y = y_as;
		 }else{
		  item._x = x_as;
		  //terugzetten naar oude waarden.
		  tmp = 20;
		  x_as = 20;
		  item._y = y_as;
		  y_as = y_as + 30;
		  }
		  
		//---------------------------- Einde positionering

```

And you can see the xml file on www.freshface.be/myData.xml

I hope that somebody can tell me what to do.  
Thx
