Flash初哥

February 26, 2010

我对ActionScript语言函数重载的理解

Filed under: Flash,Flash技術文章 — Tags: , — KAV @ 7:52 am

ActionScript与JavaScript类似,都是符合ECMAScript语言规范的语言。ActionScript 3.0更是向面向对象语言靠近了一大步。相对而言,JavaScript则在停留在基于对象的层次上(曾经看到一份资料,说Firefox对JavaScript的支持有一个时间表,大概到07年春季就能支持JavaScript2.0,目前也就是1.5左右)。
(more…)

February 24, 2010

[轉]Adobe Flash Catalyst

Filed under: Flash,Flash相關 — Tags: , — KAV @ 7:58 am


我想大家一定都有聽過Thermo
而我今天亂逛網站時看到了另一個新產品名
叫做Adobe Flash Catalyst
聽Ryan在介紹時
才發現原來Thermo已經更名成Adobe Flash Catalyst
我真的是有給他落伍到了XD
馬上跑到Adobe Lab逛逛充電一下
以下就來簡單介紹一下Adobe Flash Catalyst
不清楚他在做什麼的朋友們
可以順便了解一下這個跨時代的設計工具
我也順便先來記錄一下
以免忘記注意他的動向啦^^』

(more…)

[轉][AS3]-免費的AS3 Particle System Library

Filed under: Flash,Flash演示 — Tags: , — KAV @ 7:42 am

這禮拜週末沒有活動
所以就趕快先來寫一下文章
以免之後一忙又隔很久才有時間發文
今天來介紹一個滿屌的ActionScript3.0 Library
Flint Particle System
簡單講就是粒子系統效果的函式庫
非常實用的一個library
不多說~往下看個究竟吧~~~

Flint Particle System
這個AS3 Library其實我很久之前就發現了
只是一直忘了跟大家分享^^||
他的範例效果真的滿猛的
這個要自己寫真的需要點功力拉
在這個凡事講求效率的環境之下
有像Flint這樣免費開放原始碼的Library
對我們這些開發人員來說絕對是一大福音囉
講那麼多廢話不如直接看官網的範例效果囉
Flint Particle System Example
裡面有圖片爆炸效果、煙火效果、布朗運動、雪花效果等等
而且連Flocking都有
只有一個字可以形容~~~Awesome!!!
另外Library的文件請參考這邊
要下載這個Library請到Flint在Google Code上的網站
有需要的大大就趕快收藏起來吧^^

from: http://mitchbox.wordpress.com/2009/04/06/flint-particle-system/

February 10, 2010

[ActionScript3.0]ArrayUtility v1.01

Filed under: Flash,Flash技術文章 — Tags: , , — KAV @ 3:23 am
?View Code ACTIONSCRIPT
	//Author  http://www.theplanzero.com
	//Version 1.1
 
	public class ArrayUtility
	{
		public function ArrayUtility(){}
		static public function removeNull(input:Array):Array
		{
			var output:Array = new Array();
			for (var i:int = 0; i <= input.length-1; i++)
			{
				if (input[i] != null)
					output.push(input[i]);
			}
			return output;
		}
 
		//echo all elements in an array with the arrayName
		static public function printWithName(arrayName:String,input:Array):void
		{
			for (var i:int  = 0 ; i <= input.length-1; i++)
			{
				trace(arrayName + "[" + i + "] " + input[i]);
			}
		}
 
		//echo all elements in an array 
		static public function print(input:Array):void
		{
			for (var i:int  = 0 ; i <= input.length-1; i++)
			{
				trace("[" + i + "] " + input[i]);
			}
 
		}
 
		//check if elements are identical ( no considering order )
		static public function isElementIdentical(A1:Array,A2:Array):Boolean
		{
			if ( A1.length != A2.length )  return false;
			var B1:Array = A1.concat();
			var B2:Array = A2.concat();
			B1.sort();
			B2.sort();
			for (var i:int = 0 ; i <= B1.length-1; i++)
			{
				if (B1[i] != B2[i])
					return false;
			}
			return true;
		}
 
		//check if elements are identical ( no considering order ) and showing each comparing step
		static public function isElementIdenticalShowTrace(A1:Array,A2:Array):Boolean
		{
			if ( A1.length != A2.length )  return false;
			var B1:Array = A1.concat();
			var B2:Array = A2.concat();
			B1.sort();
			B2.sort();
			for (var i:int = 0 ; i <= B1.length-1; i++)
			{
				if (B1[i] != B2[i])
				{
					trace("A1[" +  i + "]: " + B1[i] + "  A2[" +  i + "]: " + B2[i]);
					return false;
				}
			}
			return true;
		}
 
		//search the first occur of request in the Array and resutn the index , return -1 if not found
		static public function search(input:Array,request:Object):int
		{
			for ( var i:int = 0 ; i <= input.length-1; i++ )
				if ( input[i] == request )
					return i;
			return -1;
		}
	}

February 9, 2010

[Flash][AS3.0]how to dulpricate an array?

Filed under: Flash,Flash技術文章 — Tags: , — KAV @ 11:46 am

var B:array = A.concat();

[Flash][AS3.0]sort Array

Filed under: Flash,Flash技術文章 — Tags: , — KAV @ 11:08 am

as3.0语法:function sort(… args):Array

对数组中的元素进行排序。Flash 根据 Unicode 值排序。(ASCII 是 Unicode 的一个子集。)
(more…)

[Flash][AS3.0]A class for dealing with Array null element

Filed under: Flash,Flash技術文章 — Tags: , — KAV @ 10:57 am

一個AS3.0既Array處理class. 還很簡單,現在只能去掉null element, 還有輸出~

?View Code ACTIONSCRIPT
        //Author  http://www.theplanzero.com
	//Version 1.0
 
	public class ArrayUtility
	{
		public function ArrayUtility(){}
		static public function removeNull(input:Array):Array
		{
			var output:Array = new Array();
			for (var i:int = 0; i &lt;= input.length-1; i++)
			{
				if (input[i] != null)
					output.push(input[i]);
			}
			return output;
		}
 
		//echo all elements in an array with the arrayName
		static public function printWithName(arrayName:String,input:Array):void
		{
			for (var i:int  = 0 ; i &lt;= input.length-1; i++)
			{
				trace(arrayName + "[" + i + "] " + input[i]);
			}
		}
 
		//echo all elements in an array
		static public function print(input:Array):void
		{
			for (var i:int  = 0 ; i &lt;= input.length-1; i++)
			{
				trace("[" + i + "] " + input[i]);
			}
 
		}
	}

[Flash][AS3.0]原來AS3.0還是不支持方法重载

Filed under: Flash,Flash技術文章 — Tags: , — KAV @ 10:47 am

首先需要申明的一点是:在As3.0中仍然不支持方法重载,我们只能通过简单的模拟来实现重载.我在网上看到有不少人 把override称为重载,这是不对的.事实上override提供给子类来定义替换继承的方法的,从动作上理解只是覆盖。而方法重载的原本定义为通过 传入不同的参数来实现调用不同的方法.这两个是决然不可混为一谈的.

[轉][Flash]AS3.0开发事项

Filed under: Flash,Flash技術文章 — Tags: , — KAV @ 10:45 am

AS开发多年,刚接触3.0不久,总结了些开发事项,希望对各位有用,都是在项目中总结的,经过实践的,在Flex Builder as3下使用的。
(more…)

[Flash]AS3.0 的隨機數產生方法

Filed under: Flash,Flash技術文章 — Tags: , — KAV @ 10:44 am

Math.random()

會產生一個由 0-1 的小數

其中 該數不會等於1, 會有可能等於0
0 <= n < 1

Older Posts »

Powered by WordPress