input text and gotoAndPlay

New Here ,
Mar 29, 2021 Mar 29, 2021

Copy link to clipboard

Copied

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.

Views

30

Likes

Translate

Translate

Report

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
Adobe Community Professional ,
Mar 29, 2021 Mar 29, 2021

Copy link to clipboard

Copied

LATEST

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

Likes

Translate

Translate

Report

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