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

Character count in as3?

Guest
Oct 15, 2012 Oct 15, 2012

Hello guys,

I need some help making a program that count vowels.

The user inputs a sentece, then clicks a button and the OutputText.text=The number of vowels

I'm quiet sure where to start the function.

I've tried

trace(string.match(/[a|e|u|i|o]/gi).length);

but the output in this case renders to Flash CS and not to the Flash player or OutputText.text

TOPICS
ActionScript
2.3K
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

Community Expert , Oct 15, 2012 Oct 15, 2012

use:

var n:int = string.match(/[a|e|u|i|o]/gi).length;

OutputText.text=n.toString();

Translate
Community Expert ,
Oct 15, 2012 Oct 15, 2012

use:

var n:int = string.match(/[a|e|u|i|o]/gi).length;

OutputText.text=n.toString();

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
Guest
Oct 16, 2012 Oct 16, 2012

This worked!

Once again, thank you kglad!

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 Expert ,
Oct 16, 2012 Oct 16, 2012
LATEST

you're welcome.

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