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

SpamHolder

Package:
Class:
Inheritance:
biz.flashscript.text
public class SpamHolder
Sprite
The SpamHolder class is a text class, which is used to create colored textfields with displaced text as used in many forms. Use the constructor new SpamHolder().
Public Properties
Property Defined By
All inherited properties of the Sprite class. N/A
Public Methods
Method Defined By
SpamHolder()
Creates a new instance of the SpamHolder class.
SpamHolder
prevSpam(spamArray:Array, target:Object, yPosition:Number):void
Initiates creating a spamholder.
SpamHolder
returnCode():String
Returns the string from the textfield.
SpamHolder
Events
Event Defined By
All inherited events for the Sprite class. N/A
Constructor Detail
SpamHolder ()  Constructor
public function SpamHolder()
Intializes a new SpamHolder instance.
Method Detail

prevSpam ():void  method
public function prevSpam(spamArray:Array, target:Object, yPosition:Number)

This method will initiate the creation of the spamholder.

Parameters

  • spamArray:Array ____ Specifies an array of individual phrases/numbers.
  • target:String ____ Specifies the object the spamholder will be placed.
  • yPosition:Number=false ____ Y position of the spamholder. X position is determined by a textfield/button.

returnCode ():String  method
public function returnCode():String

This method will return the phrase in the textfield, which can be compared against a user's entry.

Examples
Create a new fla file and name it Spamprevents.fla. Place the fla in the same folder as the biz folder. Then create an Actionscript file, name it Spamprevents.as and place this script.
package 
{
	import flash.display.Sprite;
	import biz.flashscript.text.SpamHolder;

	public class Spamprevents extends Sprite
	{
		public function Spamprevents ():void
		{
			var spamArray:Array = new Array("nuL3 flASh","IHAte SpAm","Prev Crime","IloVe Lucy","rr321 ffGG");
			var mc:SpamHolder=new SpamHolder();
			mc.x = 100;
			mc.y = 100;
			addChild (mc);
			mc.prevSpam (spamArray,mc,10);
			trace (mc.returnCode());
		}
	}
}