1. 需要 manage_notifications permission

2. 需為 canvas app

step1. 取得 app access_token
https://graph.facebook.com/oauth/access_token?client_id=APP_ID&client_secret=APP_SECRET&grant_type=client_credentials

step2. call Notifications API

l1796969 發表在 痞客邦 留言(0) 人氣()

最近在win7 64bit上使用flash cs5 (英文版),
卻發現cs3, cs4(中文版)的extensions無法順利安裝在cs5上,
查了很久發現是路徑問題,


l1796969 發表在 痞客邦 留言(0) 人氣()


package{ import flash.display.Sprite;    import flash.events.Event;      import jp.progression.commands.lists.SerialList;        import mat.progression.commands.DoAlphaIn;      import mat.progression.commands.DoAlphaOut;     import org.papervision3d.core.proto.MaterialObject3D;   import org.papervision3d.events.FileLoadEvent;  import org.papervision3d.events.InteractiveScene3DEvent;        import org.papervision3d.materials.BitmapFileMaterial;  import org.papervision3d.objects.DisplayObject3D;       import org.papervision3d.objects.parsers.DAE;   import org.papervision3d.view.BasicView;        public class LoadModel extends Sprite   {               private var view        :BasicView;             private var dae         :DAE;//DAE物件              private var _bol        :Boolean = false;                               public function LoadModel(){                    init3DEngine();                 init3DObject();         }               private function init3DEngine():void{                   view = new BasicView(0, 0, true, true);                 this.addChild(view);                    this.addEventListener(Event.ENTER_FRAME, _onEventRender3D);             }               private function init3DObject():void {                                          //載入dae                   dae = new DAE();                        dae.scale = 150;                        dae.addEventListener(FileLoadEvent.LOAD_COMPLETE, _onLoadComplete);                     dae.load("dae/cow.dae");                                                view.scene.addChild(dae);               }                               private function _onLoadComplete(e:FileLoadEvent):void          {                       //dae載入完成                   trace("_onLoadComplete()")                                              //將dae內所有材質的interactive屬性設為true                    setInteractive(dae, true);                      dae.useOwnContainer = true;                                             //指定偵聽                      addEventListeners(dae, InteractiveScene3DEvent.OBJECT_PRESS, _onPress );                        addEventListeners(dae, InteractiveScene3DEvent.OBJECT_OVER, _onOver );                  addEventListeners(dae, InteractiveScene3DEvent.OBJECT_OUT, _onOut );            }                               private function _onPress(e:InteractiveScene3DEvent):void               {                       _bol = !_bol;                                           var _cmd:SerialList = new SerialList(null,                              new DoAlphaOut(dae),                            function():void {                                       //更換材質                                      var _matSrc:String = _bol ? "dae/cow_yallow.png" : "dae/cow.png";                                       var mat:BitmapFileMaterial = new BitmapFileMaterial(_matSrc);                                   mat.interactive = true;                                 dae.replaceMaterialByName(mat, "material0"); //material0為dae內的材質id名稱                           },                              new DoAlphaIn(dae)                      );                      _cmd.execute();                                 }                               private function _onOver(e:InteractiveScene3DEvent):void { view.buttonMode = true; }                            private function _onOut(e:InteractiveScene3DEvent):void { view.buttonMode = false; }                            private function setInteractive(pTarget3D:DisplayObject3D, pBol:Boolean):void           {                       for each (var mat:MaterialObject3D in pTarget3D.materials.materialsByName)                      {                               mat.interactive = true;                 }               }                               private function addEventListeners(pTarget3D:DisplayObject3D, pEventType:String, pListener:Function):void               {                       pTarget3D.addEventListener(pEventType, pListener);                                              for each (var child:DisplayObject3D in pTarget3D.children)                      {                               addEventListeners(child, pEventType, pListener);                        }               }                               private function _onEventRender3D(e:Event):void{                        dae.rotationY += 2;                     view.camera.x += (Math.sin(mouseX / stage.stageWidth * 3 * Math.PI) * 1000 - view.camera.x) * .1;                       view.camera.z += (Math.cos(mouseX / stage.stageWidth * 3 * Math.PI) * 1000 - view.camera.z) * .1;                       view.camera.y += (mouseY / stage.stageHeight * 2000 - 500 - view.camera.y) * .05;                       view.singleRender();            }       }}

 


l1796969 發表在 痞客邦 留言(0) 人氣()


var _ldr:Loader = new Loader();var _player:Object = new Object();Security.allowDomain("www.youtube.com");_ldr.contentLoaderInfo.addEventListener(Event.INIT, _onInit);_ldr.load(new URLRequest("http://www.youtube.com/apiplayer?version=3"));private function _onInit(e:Event):void {   ytLoader.addChild(_ldr);        _ldr.content.addEventListener("onReady", _onReady);     _ldr.content.addEventListener("onStateChange", _onStateChange);}private function _onReady(e:Event):void {       _player = _ldr.content; _player.setSize(450, 269);              _player.cueVideoById("VIDEO_ID", 0, "hd720");   _player.playVideo();}private function _onStateChange(e:Event):void {    if (_player.getPlayerState == 0) {              _player.destroy();      }}//官方說明文件http://code.google.com/intl/zh-TW/apis/youtube/flash_api_reference.html

 


l1796969 發表在 痞客邦 留言(0) 人氣()


var _bmpdata:BitmapData = new BitmapData(165, 244, true, 0x000000);_bmpdata.draw(photo_mc);var _bmp:Bitmap = new Bitmap(_bmpdata);_bmp.smoothing = true;

 


l1796969 發表在 痞客邦 留言(0) 人氣()

f4v是fp10以上支援的高畫質影音格式(要用CS4 Encoder轉檔),
畫質更好檔案更小,
如果要發佈到網路上使用,
要把副檔名"f4v"改成"flv",不然會發現找不到檔案的問題。


l1796969 發表在 痞客邦 留言(0) 人氣()


package{ import flash.display.*; import flash.events.*;  import flash.utils.Timer;               import idv.phantom.actors.ActorMovieClip;               public class CountDown extends ActorMovieClip   {                       private var _end:Date = new Date(2010, 3, 1, 0, 0); //月減要減1         private var _now:Date = new Date();             private var _timer:Timer;               function CountDown () { };                              override protected function init():void                 {                       _timer = new Timer(1000);                       _timer.addEventListener(TimerEvent.TIMER, _onTimer);                    _timer.start();         }                               private function _onTimer(e:TimerEvent):void            {                       var _overtime:Number;                                           _now.seconds = _now.seconds + 1;                        _overtime = _end.getTime() - _now.getTime();                                            var _day:Number = Math.floor(_overtime / 24 / 60 / 60 / 1000);                  var _hr :Number = Math.floor(_overtime / 60 / 60 / 1000) % 24;                  var _min:Number = Math.floor(_overtime / 60 / 1000) % 60;                                               day.text = String(_day < 10 ? "0" + _day : _day);                    hr.text = String(_hr < 10 ? "0" + _hr : _hr);                        min.text = String(_min < 10 ? "0" + _min : _min);            }                       }//end of class}

 


l1796969 發表在 痞客邦 留言(0) 人氣()

 

例如音樂節拍為144
則bpm = 分鐘 / 144 = 0.42毫秒

l1796969 發表在 痞客邦 留言(0) 人氣()


_mc.x = (i % _maxWidth) * _mc.width;_mc.y = Math.flooer(i % _maxWidth) * _mc.height;

 


l1796969 發表在 痞客邦 留言(0) 人氣()

CustomEvent:

package{ import flash.events.Event;              [Event(name = "CUSTOM_EVENT" , type = "")]              public class CustomEvent extends Event  {               public static const CUSTOM_EVENT:String = "customEvent";                                private var _data:*;            public function CustomEvent(type:String)                {                       super(type);            }                               //////////////////////////////開放存取data屬性,設為*可丟入任意物件             public function set data(pData:*) { _data = pData; }            public function get data():*{ return _data; }   }       }


l1796969 發表在 痞客邦 留言(0) 人氣()

singleton pattern在AS3裡該如何運用?


關於singleton的介紹可以參考這裡

l1796969 發表在 痞客邦 留言(0) 人氣()


Google Calander

隨時記錄、掌握專案製作上線時間,如果沒有它我的schedul一定是大混亂......

l1796969 發表在 痞客邦 留言(0) 人氣()

整個設計很有日本風的tone!
這次的專案只小小的支援了一個互動單元...


質感...好有質感啊!!

l1796969 發表在 痞客邦 留言(0) 人氣()


9/6下午五點多在


華中橋

l1796969 發表在 痞客邦 留言(0) 人氣()

_mc.width = 1024; _mc.scaleY = _mc.sacleX;


l1796969 發表在 痞客邦 留言(0) 人氣()