Showing posts with label flash cs3. Show all posts
Showing posts with label flash cs3. Show all posts

Wednesday, August 1, 2007

AS3: Layout class for Flash CS3

Once again Senocular present us some examples of Flash CS3, this time handling the Layout Class. For those don’t know, this class let you constrain objects to the top, right, bottom, left, or center them horizontally or vertically within a layout. There are also controls for height and width as well as a property for maintaining aspect ratio.

You can find the examples and documentation here.

Brgds,

Monday, July 30, 2007

Embedding fonts in Flash CS3/AS3

source:http://maohao.wordpress.com/2007/07/29/embedding-fonts-in-flash-cs3as3/

package
{
import flash.display.Sprite;
import flash.text.TextField;import flash.text.Font;
import flash.utils.getDefinitionByName;public class SimpleTextPaneTestDrive01 extends Sprite
{
private static var embeddedFont:Font = null;
public function SimpleTextPaneTestDrive01()
{
var embeddedFontClass:Class = getDefinitionByName(”Font1″) as Class;
Font.registerFont(embeddedFontClass);
var embeddedFontsArray:Array = Font.enumerateFonts(false);
embeddedFont = embeddedFontsArray[0];var fmt:TextFormat = new TextFormat();
//fmt.bold = true;
fmt.color =0xffffff;
fmt.size = 16;//Old day fashion: If you embed it in a textfield on stage
// fmt.font = “Helvetica”;
fmt.font = embeddedFont.fontName;

var tf:TextField = new TextField();
tf.text = “hello world!”;

tf.setTextFormat(fmt);

}

}
}