title: Flash: AS3 – Bring symbol to front on rollover within movie
body: <p>I have created a map of Europe in Flash using AS3. I am an absolute beginner. Each country has been converted into a movie (using lasso tool). These movies are on one layer (with slight outline visible) on main timeline. On the other main timeline layer is the original outline map of Europe.</p>
  
  <p>I have managed to make it so when a country is rolled over, a box tweens in scale to full size (to later insert text in).</p>
  
  <p>I need to make it so that when each country is rolled over, that country's text box (which appears on Roll_Over) comes 'to the front'. </p>
  
  <p>At the moment a couple of countries' text boxes work perfectly (ie: filled with white and completely visible), but most are either buried beneath the main map, or threading randomly through the faint movie clip outlines (which are at the front).</p>
  
  <p>I'm guessing that this has to do with the display list. The countries that work perfectly are probably at the top. But how do I make it so that the country rolled over immediately goes to the top and returns on Roll_Out?</p>
  
  <p>This would complete my map so any help would be VERY MUCH appreciated.</p>
  
  <p>I have used following code:</p>
  
  <p>//FRAME ONE</p>
  
  <pre><code>this.stop();
  movieClip_6.addEventListener(MouseEvent.ROLL_OVER, fl_MouseOverHandler_15);
  function fl_MouseOverHandler_15(event:MouseEvent):void
  {
  gotoAndPlay(2); 
  }
  movieClip_6.addEventListener(MouseEvent.ROLL_OUT, fl_MouseOutHandler_67);
  function fl_MouseOutHandler_67(event:MouseEvent):void
  {
  gotoAndStop(1); 
  }
  </code></pre>
  
  <p>//SECTION BELOW IS MY PROBLEM</p>
  
  <pre><code>movieclip_6.addEventListener(MouseEvent.ROLL_OVER,Rollover,false,0,true);
  function Rollover(event:MouseEvent): void
  { 
  setChildIndex(MovieClip(e.target),this.numChildren-1);
  } 
  </code></pre>
  
  <p>Many thanks in advance.</p>