need help with textfield thingy

  • fifin04
  • Student
  • Student
  • fifin04
  • Posts: 70

Post 3+ Months Ago

Hi there...

I just need help with my textfield issues....Ok I have 2 group of textfields which store in cross_cw1 and down_cw1 array...

Code: [ Select ]

//array to store 2 groups of textfield
var cross_cw1:Array = new Array(b1,b2,b3,before,b5,b6,b7,b8);
var crosslen1:Number = cross_cw1.length;

var down_cw1:Array = new Array(b6,b9,b10,b11,b12,b13,b14);
var downlen1:Number = down_cw1.length;
  1. //array to store 2 groups of textfield
  2. var cross_cw1:Array = new Array(b1,b2,b3,before,b5,b6,b7,b8);
  3. var crosslen1:Number = cross_cw1.length;
  4. var down_cw1:Array = new Array(b6,b9,b10,b11,b12,b13,b14);
  5. var downlen1:Number = down_cw1.length;


And I will detecting if user setFocus either on 1st value on both array which is "b1" or "b6" it will highlight all the textfield in respective group array.I do manage to highlight the textfield and change the background color of textfield..but my problem is when by the time I setfocus on next textfield on textfield groups it will eliminated the background colour to white..eg; Ok when I setFocus on b1..it will change the background colour all of the textfields on cross_cw1 array...but when i go to next textfield "b2" it will change the background colour to white back..so how to remain the highlight colour as long as Im not setFocus on others group of textfield...another things is how to make it automatically advance cursor to next textfield after 1st letter being insert..Heres' the code currently Im using..sorry for the snoobish questions and not so elegant code...

Code: [ Select ]
//determines which group 1st being setFocus
var txt1st:Array = new Array(b1,b6);
var len:Number = txt1st.length;


for(var i:Number=0;i<len;i++){
    txt1st[i].id = i;
    txt1st[i].onSetFocus = highlightGroupTxt;
    txt1st[i].onKillFocus = unHighlightGroupTxt;
}


////////////highlight group of textfield

function highlightGroupTxt():Void{
    if(txt1st[this.id] == b1){
        for(var i:Number=0;i<crosslen1;i++){
            cross_cw1[i].backgroundColor = 0x89D0FE;
        }
    }else if(txt1st[this.id] == b6){
        for(var j:Number=0;j<downlen1;j++){
            down_cw1[j].backgroundColor = 0x89D0FE;
        }
    }
}


////////////unhighlight group of textfield


function unHighlightGroupTxt():Void{
    if(txt1st[this.id] == b1){
        for(var i:Number=0;i<crosslen1;i++){
            cross_cw1[i].backgroundColor = 0xFFFFFF;
        }
    }else if(txt1st[this.id] == b6){
        for(var j:Number=0;j<downlen1;j++){
            down_cw1[j].backgroundColor = 0xFFFFFF;
        }
    }
}
  1. //determines which group 1st being setFocus
  2. var txt1st:Array = new Array(b1,b6);
  3. var len:Number = txt1st.length;
  4. for(var i:Number=0;i<len;i++){
  5.     txt1st[i].id = i;
  6.     txt1st[i].onSetFocus = highlightGroupTxt;
  7.     txt1st[i].onKillFocus = unHighlightGroupTxt;
  8. }
  9. ////////////highlight group of textfield
  10. function highlightGroupTxt():Void{
  11.     if(txt1st[this.id] == b1){
  12.         for(var i:Number=0;i<crosslen1;i++){
  13.             cross_cw1[i].backgroundColor = 0x89D0FE;
  14.         }
  15.     }else if(txt1st[this.id] == b6){
  16.         for(var j:Number=0;j<downlen1;j++){
  17.             down_cw1[j].backgroundColor = 0x89D0FE;
  18.         }
  19.     }
  20. }
  21. ////////////unhighlight group of textfield
  22. function unHighlightGroupTxt():Void{
  23.     if(txt1st[this.id] == b1){
  24.         for(var i:Number=0;i<crosslen1;i++){
  25.             cross_cw1[i].backgroundColor = 0xFFFFFF;
  26.         }
  27.     }else if(txt1st[this.id] == b6){
  28.         for(var j:Number=0;j<downlen1;j++){
  29.             down_cw1[j].backgroundColor = 0xFFFFFF;
  30.         }
  31.     }
  32. }



Hope someone can give me some shed of light on this...unless can give me lead..at least Im struggling and trying...guys...thanks in advanced...

Post Information

  • Total Posts in this topic: 1 post
  • Users browsing this forum: No registered users and 5 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.