5 Replies Latest reply on May 6, 2012 3:04 PM by Ned Murphy

    colorChangeF(tf_mcHT_2.tf,0x000000);

    Ron Colmen Level 2

      I want to change the color of a text. Below is my code. Everything works except for colorChangeF(textNumNowCol,0x000000);

       

      It works when I try replacing

      colorChangeF(textNumNowCol,0x000000);

      with

      colorChangeF(tf_mcHT_1.tf,0x000000); or colorChangeF(tf_mcHT_2.tf,0x000000); or colorChangeF(tf_mcHT_3.tf,0x000000); ....

       

       

       

      /////first part of the code:

      var textNum:Number = 1;

      var tf_mcHT:MovieClip = tl.attachMovie("tfID"+typeNow_tx.text,"tf_mcHT_"+textNum++,tl.getNextHighestDepth());

      textNumNow = textNum -1;

       

       

      ////second part of the code:

      textNumNowCol = "tf_mcHT_"+textNumNow+".tf";

      trace (textNumNowCol) // shows correctly as tf_mcHT_1.tf or tf_mcHT_2.tf or tf_mcHT_3.tf...

      colorChangeF(textNumNowCol,0x000000);

      {   _root.CN5.text= _root.CN55.text="BLACK"}

      {   _root.defTC.text="0x000000"}

      }

       

      function colorChangeF(mc:MovieClip, col:Number):Void {

          mc.c = new Color(mc);

          mc.c.setRGB(col);

      }