Skip to main content
Participant
March 29, 2021
Question

input text and gotoAndPlay

  • March 29, 2021
  • 1 reply
  • 174 views

hello everyone, I tried to make an application with adobe animate but it still doesn't work. are you guys can perfect this code: 

 

function onButton_85(e:MouseEvent):void

{
switch (input1.text)
  {

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

 

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

 

   default:
   gotoAndStop(46);
   break;

  }

}

 

I want to make an application for elementary students about the solar system. so when students enter keywords and click the search button, an animation will appear. I am using AS 3.

 

"input1" is the name of the input text and "button_85" is the name for the search button while "moon" and "sun" are examples of keywords to be searched for.
the problem is when i use this code there is no error code notification, but the search button doesn't work.

    This topic has been closed for replies.

    1 reply

    Legend
    March 29, 2021

    As always, use trace() statements to verify the value of input1.text and that the function is even being called.