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

Error in program. Palindrome ActionScript3.0

Community Beginner ,
Jul 25, 2018 Jul 25, 2018

Need help identifying the error. Here is the code

// This line makes the button, btnCheck wait for a mouse click

// When the button is clicked, the checkWord function is called

btnCheck.addEventListener(MouseEvent.CLICK, checkWord);

// This is the checkWord function

// e:MouseEvent is the click event experienced by the button

// void indicates that the function does not return a value

function checkWord(e:MouseEvent):void

{

//declare the variables

var word:String;

// text in word

word = (txtinWord.text);

// reverse the word

if

(word = word); {

lblPalindrome.text = "This word is a palindrome";

}

else

{

lblPalindrome.text = "This word is not a palindrome";

}

}

program

418
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

correct answers 1 Correct answer

Jul 30, 2018 Jul 30, 2018

I have found an Action Script code for Palindrome.

Please try the below code and let us know if that works for you.

function isPalindrome(str:String):Boolean

{

for(var first:uint = 0, second:uint = str.length - 1; first < second; first++, second--)

if(str.charAt(first) != str.charAt(second)) return false;

return true;

}

Thanks!

Ankush

Translate
LEGEND ,
Jul 25, 2018 Jul 25, 2018

Sorry, I don't see what this has to do with C++.

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
Community Beginner ,
Jul 25, 2018 Jul 25, 2018

Its actionscript 3.0, I am using Adobe Animate. Thats all I know.

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
Community Beginner ,
Jul 25, 2018 Jul 25, 2018

Never mind it saying c++

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
Adobe Employee ,
Jul 26, 2018 Jul 26, 2018

In the time that the expert gets back, have a look at this link for any insights https://snipplr.com/view/50850/palindrome/

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
Jul 30, 2018 Jul 30, 2018
LATEST

I have found an Action Script code for Palindrome.

Please try the below code and let us know if that works for you.

function isPalindrome(str:String):Boolean

{

for(var first:uint = 0, second:uint = str.length - 1; first < second; first++, second--)

if(str.charAt(first) != str.charAt(second)) return false;

return true;

}

Thanks!

Ankush

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