Showing posts with label AS3. Show all posts
Showing posts with label AS3. Show all posts

Sunday, December 25, 2011

Flexcover - Flex code coverage tool

Flexcover http://code.google.com/p/flexcover/ is a code coverage tool for Flex, Air and AS3.

Download Flexcover : http://code.google.com/p/flexcover/downloads/list

Learn how the modified sdk works : http://code.google.com/p/flexcover-sdk/wiki/HowFlexcoverWorks

Tuesday, October 19, 2010

Adobe Labs - ActionScript Code Coverage Plug-in for Flash Builder

ActionScript Code Coverage Plug-in for Flash Builder , now in its prerelease version, is a tool that enables Flex developers identify which portions of code are executed (and which parts are not) while an application is executing.

Download ActionScript Code Coverage Plug-in for Flash Builder from http://labs.adobe.com/downloads/ascode_coverage.html

Documentation for this tool can be found at http://labs.adobe.com/wiki/index.php/ActionScript_Code_Coverage:Using

Sunday, November 1, 2009

Applying TextFormat in AS3

Let’s say you wanted to apply a TextFormat to a TextField with the setTextFormat method and you script the following code in AS3

var t:TextField=new TextField();
var tf:TextFormat=new TextFormat();
tf.font="Verdana";
tf.size=24;
tf.bold=true;
tf.color=0xff0000;
t.width=160;
t.setTextFormat(tf);
t.text="test text";


To your surprise, the resultant text does not get the textFormat you applied. The result is




Do not panic. Just swap the last two lines of code like below.

var t:TextField=new TextField();
var tf:TextFormat=new TextFormat();
tf.font="Verdana";
tf.size=24;
tf.bold=true;
tf.color=0xff0000;
t.width=160;
t.text="test text";
t.setTextFormat(tf);


And everything’s fine.




If you were to set the text once again with, say, t.text=”Another text”, you should apply the desired TextFormat once again with the SetTextFormat method. This is because every time you set the ‘text’ property of a TextField, it is the DefaultTextFormat which will be applied.

In fact if you were doing quite a bit of text handling, you are better off setting the DefaultTextFormat of the TextField with the following code

t.defaultTextFormat=tf;

Sunday, August 23, 2009

3D Tic Tac Toe

A very simple Tic Tac Toe engine ... you need to try very hard to lose.
Used papervision3d for the cubes.