Tweener _autoAlpha プロパティ

_autoAlpha はアルファ0にしたあと visible=falseにしてくれる。
1にすると visible=trueにしてから アルファ1になるー

import caurina.transitions.*;
import caurina.transitions.properties.*;
DisplayShortcuts.init();

a.buttonMode = true;
a.addEventListener(MouseEvent.CLICK, onClick);
function onClick(e){
  Tweener.addTween(a, { _autoAlpha:0, time:0.3, transition:Equations.easeOutCubic } );
  Tweener.addTween(a, { _autoAlpha:1, time:0.3, delay:0.5, transition:Equations.easeOutCubic } );
}

他にも便利なプロパティが
http://soohei.net/blog/archives/2008/01/10015045.html

Flash + ベーシック認証

サーバーにベーシック認証かけると、
ローカルからAPIがたたけなくなった。。。
なんで?
と思ったら、こんな事をしないといけないらしい。


AS2
http://www.neetranger.com/red/2006/12/flash_basic.html

AS3
http://haricot.tumblr.com/post/41549486/as3-flashide

でもFlash Player のバージョン 9,0,115,0だとだめ
ここ


でもエラーが...
結局できず...

AS3のSound

as3になって、何やら面倒くさくなってるー。

イベントとるのに SoundChannel
ボリューム変えるのに SoundTransform

public function init(sound:Sound):void {
     _muteFlg = true;
     _sound = sound;
     _soundChannel = _sound.play();
     _soundChannel.addEventListener( Event.SOUND_COMPLETE, soundComplete );
     this.addEventListener(MouseEvent.MOUSE_UP, switchOnOff);
     _soundTransform = new SoundTransform();
}
private function switchOnOff(e:MouseEvent):void {
     _muteFlg =! _muteFlg;
     _soundTransform.volume = (_muteFlg)?1:0;
     _labelMc.gotoAndStop( (_muteFlg)?"on":"off" );
     _soundChannel.soundTransform = _soundTransform;
}
function soundComplete( eventObject:Event = null ):void {
     // 完了後にまた再生でループ
     _soundChannel = _sound.play( 0 );
     _soundChannel.soundTransform = _soundTransform;
     _soundChannel.addEventListener( Event.SOUND_COMPLETE, soundComplete );
}

MOUSE_LEAVEイベント  Flash外に出た

MOUSE_LEAVEなるイベント。
マウスカーソルがFlashから外れた時にイベントが発生するらしい。
AS3から。

ただ、Flashにマウスが戻ってきた時のイベントがない。。。
結局stageにMOUSE_OVERしかないみたい。

じゃぁstageのMOUSE_LEAVEとMOUSE_OUTの違いはなんなんだ???


http://designdrill.heteml.jp/2007/08/mouse_leave.html

SWFObjectでFlashVars as3

HTML側

var so = new SWFObject("index.swf", "swf-content", "100%", "100%", "9,0,0,0", "#ffffff");
so.addParam("quality", "high");
so.addParam("scale", "noscale");
so.addParam("wmode", "transparent");
so.addParam("align", "top");
so.addParam("loop", "false");
//↓こんな感じで書くと
so.addVariable("country", country);
so.addVariable("area", area);
so.write("flashcontent");

AS側

import flash.display.LoaderInfo;

var params:Object = loaderInfo.parameters;
var area:String = params["area"];
var country:String = params["country"]

で受け取れる。
便利ぃー

中心点と半径から 円周上の座標

・ X座標 ・・・・ 中心のx座標 + 円周の半径 * Math.cos(角度のラジアン値)
・ Y座標 ・・・・ 中心のy座標 - 円周の半径 * Math.sin(角度のラジアン値)

y座標のとこ プラスだと逆まわりぃ〜

http://homepage1.nifty.com/kodayan/java2/data04/apt427.html