Skip navigation
Currently Being Moderated

Keeping the same stuff in a textfield when going from frame 1 to frame2

Jul 10, 2012 8:16 PM

Hello

 

I have just finished a virtual keyboard, but there is one problem. When I write the small letters, and click a button to take me to frame 2 to write the big letters, the small letters disappear giving way to the big letters. How can I keep what I wrote in the frame 1 ?

 
Replies
  • kglad
    62,004 posts
    Jul 21, 2002
    Currently Being Moderated
    Jul 10, 2012 9:26 PM   in reply to Samsimms

    keep the same textfield in frame 2 as frame 1.  or, if that isn't what you want, assign a variable's value to be the text property of your frame 1 textfield.  then use that variable in frame 2 to assign the text property to your frame 2 textfield.

     
    |
    Mark as:
  • kglad
    62,004 posts
    Jul 21, 2002
    Currently Being Moderated
    Jul 11, 2012 8:06 AM   in reply to Samsimms

    looking at the link you posted, it appears you should not change frames. 

     

    use:

     

     

    var upperCase:Boolean;

     

    capitButton.addEventListener(MouseEvent.CLICK, aButtonClickListener28aB);

    function aButtonClickListener28aB(e:MouseEvent):void

    {

    upperCase=!upperCase;

    }

     

    // you should already have something like this:

    stage.addEventListener(KeyboardEvent.KEY_DOWN,keydownF);

    function keydownF(e:KeyboardEvent):void{
    if(upperCase){
    // the code from your frame 2 listener function
    } else {
    // the code from your frame 1 listener function
    }
    }
     
    |
    Mark as:
  • kglad
    62,004 posts
    Jul 21, 2002
    Currently Being Moderated
    Jul 11, 2012 4:18 PM   in reply to Samsimms

    use:

     

     

     

    var upperCase:Boolean;

     

    capitButton.addEventListener(MouseEvent.CLICK, capListener);

    function capListener(e:MouseEvent):void

    {

    upperCase=!upperCase;

    }

     

     

    qButton.addEventListener(MouseEvent.CLICK, aButtonClickListener);

    function aButtonClickListener(e:MouseEvent):void

    {

    if(upperCase){

    inputTxt.appendText("Q");

    } else {

    inputTxt.appendText("q");

    }

     

    and so on for all the letters.....

     
    |
    Mark as:
  • kglad
    62,004 posts
    Jul 21, 2002
    Currently Being Moderated
    Jul 11, 2012 9:29 PM   in reply to Samsimms

    you're very welcome.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points