Flash 8 class properties
Some properties used in Flash 8
Stage.height
The height property of the Stage object is read only. The stage is the area that your root timeline is. That is, the rectangle of your flash file. The height of course is the vertical size of the stage in pixels. A common example of its use is to determine when a MovieClip goes out of the Stage area. Here is an example:
if(car_mc._y >= Stage.height){
// if it hits bottom send it up a bit
car_mc._y = Stage.height - 50;
}
Stage.width
The width property of the Stage is the horizontal size of your flash movie in pixels. Here is an example similar to the above one where the car is pushed up if it goes below the bottom of the Stage.
if(car_mc._x >= Stage.width){
car_mc._x = Stage.width - 50;
}
hitArea
hitArea is a property of the MovieClip class. It specifies the area that can be hit by another object or the mouse. Say for example if you have a space ship firing bullets at an alien then the bullets would be set to do something when the hitArea of the Alien is penetrated. This example shows how you can set the hitArea to another MovieClip.
round_mc.hitArea = square_mc;
round_mc.onRelease = function() {
trace("hit! "+this._name);
};
TextField.html
The html property of the TextField class is a Boolean true/false value that defines whether the text is formatted as html or not. The html property is both readable and writable.
TextField.htmlText
The htmlText property of the TextField class has the value of html text that the TextField has. This example sets a TextField to html and sets the htmlText value.
some_txt.html = true;
some_txt.htmlText = " Make this bold text. “;
XML.ignoreWhite
The ignoreWhite property of the XML class tells the XML parser to ignore any white space in the values. This example creates the XML object and sets the ignoreWhite property.
var theList:XML = new XML();
// ignore white spaces
theList.ignoreWhite = true;
Array.length
The property length of the Array class gives the value of how many objects are in the array in integers. It is usually used in looping through arrays as in this example.
for(var i=0;i
}
TextField.multiline
The multiline property of the TextField class is a Boolean value of true or false that defines whether the TextField is either multiline or a single line.
some_txt.multiline = true;
some_txt.text = "This is a long line and will have to wrap to the next line in the Flash TextField which is multiline and set to true";
NaN
This is a property of the Number class that has a null value or Not A Value. It means that you have not set your Number to any value or there is some sort of error in your calculations such as dividing by zero.
TextField.text
The text property of the TextField class is a string value that contains the text of the string.
some_txt.text = "This string is the text property of the TextField";
