Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

input text and gotoAndPlay

New Here ,
Mar 29, 2021 Mar 29, 2021

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.

151
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 29, 2021 Mar 29, 2021
LATEST

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines