5 Replies Latest reply on Dec 4, 2011 6:39 AM by kglad

    msgzFull.htmlText +=msgA[1]+" Company:"+"<br>"+msgA[2]+"<br>"+msgA[0]+"<br><br>";

    Ron Colmen Level 2

      How do I set three seperate text formats to msgA[0] and msgA[1] and msgA[2]?

       

      my code so far (not working though):

      var format1:TextFormat = new TextFormat();

      format1.bold = true;

      format1.color = 0xFFFFFF;

      format1.size = 12;

      format1.font = "Font1";

       

      var format2:TextFormat = new TextFormat(); // I want to set this format to msgA[0]

      format2.font = "Font1";

      format2.color =  0xFFFFFF;

      format2.size = 15;

       

      var formatA:TextFormat = new TextFormat();

      formatA.font = "Font1";

      formatA.color = 0x999999;

      formatA.size = 11;

       

      receiveLoad.onData = function(src) {

           var messageA:Array = src.split(",,,");

           messageA.pop();

           var charCount = 0;

           var formatIndices = new Array();

           msgzFull.html=true;

           for(var i:Number=0; i<messageA.length; i++){

                 var msgA:Array = messageA[i].split(",,");

                 msgzFull.htmlText +=msgA[1]+" company:"+"<br>"+msgA[2]+"<br>"+msgA[0]+"<br><br>";

                 formatIndices[i] = {startAt: charCount, endAt: charCount+msgA[1].length+6};

                 charCount = msgzFull.text.length;

           }

           msgzFull.setTextFormat(formatA);

           msgzFull.embedFonts = true;

           for(var j:Number=0; j<formatIndices.length; j++){

                 msgzFull.setTextFormat(formatIndices[j].startAt, formatIndices[j].endAt, format1);

           }

      }