embed xml

[sourcecode language=”actionscript3″]
[Embed(source="info.xml", mimeType="application/octet-stream")]
protected var EmbeddedXML:Class;

var ba : ByteArray = (new EmbeddedXML()) as ByteArray;
var s : String = ba.readUTFBytes( ba.length );
xml = new XML( s );
[/sourcecode]

papervision, 關於上色

cube20100325

陰影很怪。

這個本應使用了 FlatShadeMaterial 去直接打光上去上色。

在 cube 上再加上一塊 bitmap mapping / movieClip mapping / colorMaterial

[sourcecode language=”actionscript3″]
material = new CompositeMaterial();
var mat = new ColorMaterial(ColorLibrary.YELLOW_COLOR, THREE_D_OBJ_ALHPA);
material.addMaterial(mat);
var mat = new FlatShadeMaterial(_light, Conf.LIGHT_COLOR, Conf.AMBIENT_COLOR, 20, THREE_D_OBJ_ALHPA);
material.addMaterial(mat);[/sourcecode]

將兩個 material 合埋使用,

因為立體有了自身的顏身再上 flatShade 咁就靚曬啦!

明天就是 deadline! (一)

24032010

還有很多立體要畫。

用了 papervision 。但經過不斷的 research, 聽聞 away3d 更好。

(聽聞)只少在 import 3D卡通時較易上手。

之後很想學 blender 或者 3D studio max,做一d 得意既 3D 動畫或者網站!

P.S. 明天就是 deadline,後面加了 (一),好明顯我知道這類 Post 應該以後陸續有黎!

external assets swf (getDefinition)

[sourcecode language=”actionscript3″]
package {
/*
the main swf that loads everything, starting with assets swf…
*/
import flash.display.*;
import flash.net.URLRequest;
import flash.utils.*;
import flash.events.Event;</code>

public class Requiem extends MovieClip {
private var AssetLoader:Loader;
private var Request:URLRequest;
private var AssetsURL:String = "RequiemAssets.swf"

public function Requiem (){
var Request = new URLRequest(AssetsURL)
var AssetLoader = new Loader()
AssetLoader.load(Request)
AssetLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete)

}

private function onComplete(e:Event):void{
trace ("Load Complete")
var ldrInfo = e.currentTarget as LoaderInfo;
ldrInfo.removeListener (Event.COMPLETE, onComplete)

var assets:MovieClip = e.currentTarget as MovieClip;
var Home:Class = assets.loaderInfo.applicationDomain.getDefinition("home")
var home:MovieClip = new Home()
addChild (home)
}
}
}
[/sourcecode]

用黎 load 一個 swf,拎佢 library 裡面d 野出黎

Developer Blog, Site 推薦 (一)

一定要 keep 住睇! 日本 developer 既蒲點,好多 idea 可以係到搵到
http://wonderfl.net/
http://beautifl.net/

比較淺
http://tutorials.flashmymind.com/

呢個係賣code 既,睇下都學到好多野
http://activeden.net/

一個鍾意玩 pv3d 既人既 blog
http://sebleedelisle.com/

show news 多
http://www.flashmagazine.com/

比較淺,可睇可唔睇
http://www.riacodes.com/

一定要睇,show 新 technique 多過教你寫 code
http://www.everydayflash.com/

papervision technical 野多
http://blog.zupko.info/

effect technical 野多,較難,推薦
http://www.dehash.com/

閒話家常,technical 唔多
http://www.blog.lessrain.com/

可以一看
http://flashenabledblog.com/

日本野! Good!
http://www.be-interactive.org/

好勁既 papervision3d blog
http://professionalpapervision.wordpress.com/

Flex Community, show news 多
http://blog.flexcommunity.net/

一個鍾意玩 Augmented Reality 既人既 blog
http://www.harrynorthover.com/blog/

Flash Framework

GAIA Flash Framework
http://www.gaiaflashframework.com/
寫網站時試用,包了 swfAddress 同自動分頁

Papervision 3D
http://blog.papervision3d.org/
不用介紹吧,正在研究

PureMVC
http://puremvc.org/
MVC Model,還在研究中

XIFF
http://www.igniterealtime.org/
做 real-time community 用,例如 chatting,還在研究中

TweenLite
http://www.greensock.com/tweenlite/
做 motion tween 用

JiglibFlash
http://www.jiglibflash.com/blog/
Physics Engine For 3D,還在研究中

CASA Lib
http://casalib.org/
提供一大堆有用既 Class

BetweenAS3 (TweenLite d friend)
http://www.be-interactive.org/works/20090911/slide_betweenas3.html

Popforge
http://code.google.com/p/popforge/
Sound Library

Five3D

http://five3d.mathieu-badimon.com/
主要用翻 flash 10 個 3D engine 去做既 library