Skip to main content
Participant
March 27, 2021
Question

input text

  • March 27, 2021
  • 1 reply
  • 173 views

hi everyone, can anyone help me code input.text and go to another play frame.
I'm using AS3. consists of an input box and a search button

 

function onButton_85(e:MouseEvent):void

{
switch (input1.text)
  {

  case "sun" :
  gotoAndPlay(15);
  break;

 

   case "moon":
   gotoAndPlay(25);
   break;

 

   default:
   gotoAndStop(46);
   break;

  }

}

 

My serch button is name "buton_85" and my input box is name "input1".

when I use this code there is no error notification, but my search button doesn't work, I've tried changing the code but it doesn't work. is my code wrong?

    This topic has been closed for replies.

    1 reply

    kglad
    Community Expert
    Community Expert
    April 9, 2021

    i don't see an event listener. eg,

     

    buton_85.addEventListener(MouseEvent.CLICK, onButton_85);