iPhone の Flash 対応はあるのかないのか & ASonJS

iPhone 3G の発表がありましたが

Flash 対応についてはまったく触れられてませんね。まだダメなのかな。Flash再生用アプリケーションとかできるのかね。

ということでiPhone熱が盛り上がったので

ASonJS更新。ason080610.jsでフレームスクリプトを書けるようにしてみました。

左のお猿は最終フレームまで再生したら頭出し。
右のお猿は最終フレームまできたら1回ジャンプ。着地のタイミングでランダムなフレームに巻き戻し。

さしあたり、次に作るゲームで gotoAndPlay でラベル指定して飛んでループのアニメーションを切り替え…的に使う予定。


var _root = Stage.init({element : document.getElementById('main') ,fps : 12});

var normalmonkey = _root.attachMovie('monkey','normalmonkey',_root.getNextHighestDepth(),{_x:70, _y:110, _xscale:200, _yscale:200});
var crazymonkey = _root.attachMovie('monkey','crazymonkey',_root.getNextHighestDepth(),{_x:190,_y:110, _xscale:200, _yscale:200});

//normalmonkey loops at 5th frame.
normalmonkey.addFrameScript(5,function(){
this.gotoAndPlay(1);
});

//crazymonkey jumps at its last frame, and rewind to random frame when it lands.
crazymonkey.addFrameScript(crazymonkey._totalframes,function(){
this.stop();
this.onEnterFrame = (function(){
var vy = -10;
return function(){
this._y += vy;
if(vy==10){
delete this.onEnterFrame;
this.gotoAndPlay(Math.floor(Math.random()*3)+1);
}
vy++;
}
})()
});

上のiframeの張り付けは

http://d.hatena.ne.jp/Gimite/20080114/1200313343
を使わせていただきました。ありがとうございます。