Protocol:
rtmpt://
Formats:
filename.f4v : "mp4:filename.f4v"
filename.flv : "filename" (remove ".flv")
Monday, 18 October 2010
Thursday, 15 April 2010
FlashDevelop: Unable to start java.exe: The system cannot find the file specified
1. Find the jvm.config file in /flex_sdk/bin/
2. Set java.home= to point to the Java Virtual Machine directory. For example: C:\Program Files\Java\jre1.6.0_06\bin
3. Restart all applications.
2. Set java.home= to point to the Java Virtual Machine directory. For example: C:\Program Files\Java\jre1.6.0_06\bin
3. Restart all applications.
Tuesday, 30 March 2010
to do
accessibility
key listener
full screen
flash vars
swc files
dissapearing text (set text format, make text field bigger, make sure font embeded)
key listener
full screen
flash vars
swc files
dissapearing text (set text format, make text field bigger, make sure font embeded)
?: 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)
bitmap copy with blur
var offsetMatrix:Matrix = new Matrix();
offsetMatrix.translate(toCopy.x, toCopy.y);
var bmd:BitmapData = new BitmapData(toCopy.width, toCopy.height);
bmd.draw(toCopy, offsetMatrix);
bitmap = new Bitmap(bmd);
addChild(bitmap);
var filter:BitmapFilter = new BlurFilter(8, 8, BitmapFilterQuality.HIGH)
bitmap.filters = [filter]
greyscale a movieclip
myMovie.filters = [ new ColorMatrixFilter(getSaturationMatrix(0) ]
private function getSaturationMatrix(value:Number):Array {
var nRed:Number = 0.3086;
var nGreen:Number = 0.6094;
var nBlue:Number = 0.0820;
var nA:Number = (1 - value) * nRed + value;
var nB:Number = (1 - value) * nGreen;
var nC:Number = (1 - value) * nBlue;
var nD:Number = (1 - value) * nRed;
var nE:Number = (1 - value) * nGreen + value;
var nF:Number = (1 - value) * nBlue;
var nG:Number = (1 - value) * nRed;
var nH:Number = (1 - value) * nGreen;
var nI:Number = (1 - value) * nBlue + value;
return [nA, nB, nC, 0, 0, nD, nE, nF, 0, 0, nG, nH, nI, 0, 0, 0, 0, 0, 1, 0];
}
To turn off the greyscale:
myMovie.filters = [ ]
simplest loader
var loader:Loader = new Loader()
addChild(loader)
loader.load( new URLRequest("myFolder/myFile.jpg") )
Friday, 19 February 2010
shuffle an array
var total_questions:int = 10
var temp:Array = new Array()
var random_order:Array = new Array()
for (var i:int; i < total_questions; i++) {
temp.push(i)
}
while (temp.length > 0) {
var r:int = Math.floor(Math.random() * temp.length)
random_order.push(temp[r])
temp.splice(r, 1)
}
Subscribe to:
Posts (Atom)