6 Replies - 1273 Views - Last Post: 28 December 2010 - 01:55 AM

#1 reyco1  Icon User is offline

  • New D.I.C Head
  • member icon

Reputation: 2
  • View blog
  • Posts: 43
  • Joined: 20-March 05

myTextBox.text.hasHowManyWords()

Posted 05 April 2005 - 06:40 PM

Description: place the proto in the first frame of your movie and have a text field instance named "myTextBox" with some writing in it. usage is in the script.Now that we're on the "string" tip, check out this prototype which returns the number of words in a text box.
String.prototype.hasHowManyWords = function() {
     return this.split(" ").length;
};
//////////////////////usage//////////////////////////
/*one usage*/ 
trace(myTextBox.text.hasHowManyWords())
/*another usage (basically the same :p)*/
var thisAmountOf = myTextBox.text.hasHowManyWords()
trace ("My text box has "+thisAmountOf+" words.")


Is This A Good Question/Topic? 0
  • +

Replies To: myTextBox.text.hasHowManyWords()

#2 ryiteous  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 0
  • Joined: 25-May 10

Re: myTextBox.text.hasHowManyWords()

Posted 25 May 2010 - 10:55 AM

hi
Was This Post Helpful? 0
  • +
  • -

#3 ryiteous  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 0
  • Joined: 25-May 10

Re: myTextBox.text.hasHowManyWords()

Posted 25 May 2010 - 10:58 AM


Was This Post Helpful? 0
  • +
  • -

#4 krow  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 0
  • Joined: 23-July 10

Re: myTextBox.text.hasHowManyWords()

Posted 23 July 2010 - 05:43 AM

i am a student.
Was This Post Helpful? 0
  • +
  • -

#5 cosmos12  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 0
  • Joined: 24-August 10

Re: myTextBox.text.hasHowManyWords()

Posted 24 August 2010 - 02:11 AM

hello
Was This Post Helpful? 0
  • +
  • -

#6 emmanuelson  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 0
  • Joined: 10-September 10

Re: myTextBox.text.hasHowManyWords()

Posted 10 September 2010 - 12:11 PM

hello
Was This Post Helpful? 0
  • +
  • -

#7 usmiller27  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 0
  • Joined: 28-December 10

Re: myTextBox.text.hasHowManyWords()

Posted 28 December 2010 - 01:55 AM

Hello dear ...
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1