Tag Archives: web

Font Embed Bug on Flash Builder 4.5

Embedding fonts in Flash Builder is so easy as follows. However, in some cases that I have no idea, Flash Builder changes the fonts in your application. To fix that, just goto topbar Project->Clean…Then Flash Builder refreshes your project and everything is gonna be fine 🙂 This is just a reminder for myself. I’m sure, I’ll forget the fix for this issue when I exprience it again.

[Embed(source="com/alptugan/assets/font/HelveticaNeueLTPro-Roman.otf", embedAsCFF="false", fontName="roman", mimeType="application/x-font")]
public var Roman:Class;

[Embed(source="com/alptugan/assets/font/HelveticaNeueLTPro-Bd.otf", embedAsCFF="false", fontName="helvetica-bold", mimeType="application/x-font")]
public var Bold:Class;

[Embed(source="com/alptugan/assets/font/HelveticaNeueLTPro-ThCn.otf", embedAsCFF="false", fontName="helvetica-thin", mimeType="application/x-font")]
public var Thin:Class;

Quick Tip – Return Vector Array


If you try to return a Vector typed array in flash, you’ll get the following error.

public function getMainItems():Vector
{
	//Length of Main items
	MainItemLn = xml.item.length();

	//Vector class of MainItems
	var MainVO:Vector     = new Vector.<VOItem>(MainItemLn,true);

	for(var i:int = 0; i < MainItemLn; ++i)
	{
		MainVO[i]        = new VOItem();
		MainVO[i].id     = i;
		MainVO[i].title  = xml.item[i].@title;
		MainVO[i].img = xml.item[i].@img;
	}

	return MainVO
}

1067: Implicit coercion of a value of type __AS3__.vec:Vector.<com.Gallery:VOItem> to an unrelated type __AS3__.vec:Vector.

It is because Vector.<VOItem> isn’t the same type as Vector. That means;

public function getMainItems():Vector.<VOItem>
{
	//Length of Main items
	MainItemLn = xml.item.length();

	//Vector class of MainItems
	var MainVO:Vector     = new Vector.<VOItem>(MainItemLn,true);

	for(var i:int = 0; i < MainItemLn; ++i)
	{
		MainVO[i]        = new VOItem();
		MainVO[i].id     = i;
		MainVO[i].title  = xml.item[i].@title;
		MainVO[i].img = xml.item[i].@img;
	}

	return MainVO
}

And you can get your Vector array values like;

trace(getMainItems()[0].title);
//or
trace(getMainItems()[1].title);
//and so on..
.
.
.

**Note: VOItem is my custom Value Object Class. It doesn’t matter what it is. It can be movieclip, sprite, etc…

Redirecting domains to www with .htaccess file

If you have Linux server on your web site, you can easily redirect your “domain.com” to “www.domain.com” with .htaccess file. Every Linux based servers have .htaccess file. However, because of the “.”, it’s a hidden file. So, you can’t view unless you set your ftp client’s “view” property to “show invisible files”. You can turn on “show invisible files” with most of the ftp clients such as FileZilla, Transmit and etc…Even if you enable “show invisble files”, can’t you see the file? So there is an easy way. Just create by yourself in one of the text edit software such as Textedit or Notpad.

1- Open a blank document file with Notepad or Text Edit.

2-

Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^domain.com [nc]
rewriterule ^(.*)$ http://www.domain.com/$1 [r=301,nc]

**change domain.com and www.domain.com with your domain name.

3- Save the file as .htaccess without any extension.

4- Upload the file to your server with your ftp client

that’s all. Now check your browser and it’ll work. If you type onto your browser “http://domain.com”, it will be redirected to “http://www.domain.com”

Awards from Flash Web-Design Contest

“Flash Ödülleri” web design awards, by http://www.flasharsivi.com – a member of Adobe Flash User Group in Turkey-  emerged from the idea to have a contest among the members of the web site,  in 2008.

The contest aims  to increase the use of Flash software and encourage designers to create action script (programming language) based web sites.

Alp Tuğan’s two web design works were nominated for the first 30 designs of 2010. and got the second and

the sixth place in the “Flash Ödülleri” contest that is also sponsored by Adobe Company this year.

second place    : http://www.brandmood.org
sixth place     : http://www.muratgermen.com

For further information http://www.flashodulleri.com/