Flashscript classes (ActionScript 3) | Home | MX | MX 2004 | Flash 8 | Flash 9 |Flash 10 |PHP |Components | Snippets | Contact |

SplitString

Package:
Class:
Inheritance:
biz.flashscript.text
public class SplitString
N/A
The SplitString class is a text class and splits strings into numbers and letters, however only the first numbers or letters of a string. Use the constructor SplitString.getInstance().
Public Methods
Method Defined By
SplitString.getInstance()
Creates a new instance of the SplitString class.
SplitString
getString(mst:String):String
Returns the letter part of a string.
SplitString
getNumber(mst:String):Number
Returns the number part of a string.
SplitString
Constructor Detail
SplitString.getInstance()
Intializes a new SplitString instance.
Method Detail

getString ():String  method
public function getString(mst:String):String

This method will return a letter part of a string.

Parameters

  • mst:String ____ Specifies the string to split.

getNumber ():String  method
public function getNumber(mst:String):String

This method will return the number part of a string as numbers.

Parameters

  • mst:String ____ Specifies the string to split.
Examples
Create a new fla file and name it SplitStrings.fla. Place the fla in the same folder as the biz folder. Then create an Actionscript file, name it SplitStrings.as and place this script.
package 
{
	import flash.display.Sprite;
	import biz.flashscript.text.SplitString;

	public class SplitStrings extends Sprite
	{
		public function SplitStrings ():void
		{
			var findString:SplitString = SplitString.getInstance();
			var ms:String = "abcde123";
			trace (findString.getString(ms));
			ms = "abcde123";
			trace (findString.getNumber(ms));
		}
	}
}