accessibility
key listener
full screen
flash vars
swc files
dissapearing text (set text format, make text field bigger, make sure font embeded)
Tuesday, 30 March 2010
?: conditional Operator
expression1 ? expression2 : expression3
Evaluates expression1, and if the value of expression1 is true, the result is the value of expression2; otherwise the result is the value of expression3.
Evaluates expression1, and if the value of expression1 is true, the result is the value of expression2; otherwise the result is the value of expression3.
Wednesday, 24 March 2010
getters and setters
public class Database {
private var _test:Number = 666
public function get test():Number {
return _test
}
public function set test(n:Number):void{
_test = n
}
}
public class Main {
public Main() {
var databse:Database = new Database()
trace(databse.test)
databse.test = 1
trace(databse.test)
}
}
Saturday, 20 March 2010
Thursday, 18 March 2010
change colour of a movieclip
var colorTransform:ColorTransform = myMC.transform.colorTransform;
colorTransform.color = 0xFF0000;
myMC.transform.colorTransform = colorTransform;
Monday, 1 March 2010
dynamic fonts
1. Add a new font to the Library.
2. Give it a Name and export for ActionScript.
3. If you want a Bold or Italic font set it as so in the Style drop down.
4. Add the following code:
5. You can also set the text format like this:
2. Give it a Name and export for ActionScript.
3. If you want a Bold or Italic font set it as so in the Style drop down.
4. Add the following code:
var myFont = new FontClassName();
var myTextFormat = new TextFormat()
myTextFormat.font = myFont.fontName
var myTextField = new TextField()
myTextField.embedFonts = true
myTextField.text = ""
myTextField.defaultTextFormat = myTextFormat
addChild(myTextField)
5. You can also set the text format like this:
myTextField.setTextFormat(myTextFormat)
Subscribe to:
Posts (Atom)