forked from: nengafl
forked from nengafl (diff: 62)
Tweener
ActionScript3 source code
/**
* Copyright h_sakurai ( http://wonderfl.net/user/h_sakurai )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/7Tac
*/
// forked from nengafl's nengafl
package {
import flash.accessibility.Accessibility;
import flash.display.Loader;
import flash.text.TextFormat;
import flash.text.TextField;
import flash.display.Sprite;
import flash.net.*;
import caurina.transitions.Tweener; //Tweener
[SWF( width="465", height="465", backgroundColor="0x000000", frameRate="30" )]
public class Nengafl extends Sprite {
public function Nengafl() {
var loader:Loader = new Loader();// 画像ローダー
// 画像をロード
loader.load( new URLRequest( "http://gazou.blueneo.jp/img/parody/0260.jpg" ) );
addChild( loader );// ローダーを表示
loader.x =500;// 画像の初期位置
loader.scaleY = loader.scaleX = 0.1 // スケールを小さく
var format:TextFormat = new TextFormat();// テキストフォーマット
format.size = 50;// 文字サイズを50に
var nengaTextBox:TextField = new TextField();// テキスト表示
nengaTextBox.width = 465; // 幅
nengaTextBox.height = 200; // 高さ
nengaTextBox.x = 0;// x座標
nengaTextBox.y = 500; // y座標
nengaTextBox.scaleX = 50; // y座標
nengaTextBox.multiline = true; // 複数行
nengaTextBox.wordWrap = true; // 右まで行ったら左に
nengaTextBox.border = false;// 枠線なし
nengaTextBox.defaultTextFormat = format;// フォーマット指定
// htmlを表示
nengaTextBox.htmlText = "<b><font color='#ff0000' size='150'>虎</font><font color='#ffffff'>バターなりかけ</font></b>";
// 1秒で 0,0でスケールを1にする
Tweener.addTween(loader, {x:0, y:0,scaleX:1, scaleY:1, time:1, transition:"easeOutElastic"});
// 2秒待ってから、0.1秒で0,330に移動する
Tweener.addTween(nengaTextBox, {x:0, y:330, scaleX:1, delay:2, time:.1, transition:"linear"});
addChild(nengaTextBox);
}
}
}