Flash/FlashDevelop Progression
提供: 初心者エンジニアの簡易メモ
目次
progression4ダウンロード
http://code.google.com/p/flashdevelopjp/downloads/list
- fd_p4proj_4022.zip をダウンロード
progression4インストール
解凍したファイル(Project, Macros, Template)を以下へ上書きコピー
C:\Documents and Settings\usrxxxx\Local Settings\Application Data\FlashDevelop (ツール/アプリケーションファイルで開くことも可能)
progression4マクロインストール
- マクロ/マクロ編集で右クリック/マクロをインポートでリリースビルドマクロ_インストール.fdmを選択
- エラーMSGが出るがすべてOK
起動
再起動し、プロジェクトで、Progressionを選択
Error: unable to open 'libs/player/9.0/playerglobal.swc'エラー
D:\flex\flex_sdk_4.0.0.14159\frameworks\libs\player\9.0にFlex3SDKに含まれているplayerGlobal.swcを追加する
コンパイル方法
Preloader.as3projとプロジェクトとして作成したもの(xxx.as3proj)をコンパイルする
helloworld
Helloworld.as
import flash.text.TextField;
import flash.display.Sprite;
public class Helloworld extends Sprite
{
public function Helloworld()
{
var txt:TextField = new TextField;
txt.text = "helloworld";
addChild(txt);
}
}
indexSence.as
import Helloworld;
public class IndexScene extends SceneObject
{
public var page:Helloworld;
/**
* 新しい IndexScene インスタンスを作成します。
*/
public function IndexScene()
{
// シーンタイトルを設定します。
title = "Helloworld";
page = new Helloworld();
}
override protected function atSceneInit():void
{
addCommand(
new AddChild(container, page)
);
}
/** 以下略 */
}
addCommand使い方
addCommand(
new Trace("1秒待つ"),
new Wait(1),
[
new Wait(1),
new Trace("同時に実行")
]
);
シーン切り替え
- 新規作成/Progression4/NewMySceneObject.asで切り替え先のシーンを作成
- IndexSceneと作成したシーンを繋げる
public var aboutScene:AboutScene;
public function IndexScene()
{
aboutScene = new AboutScene();
aboutScene.name = "about";
// 呼び出し元のIndexSceneに引数で設定したAboutSceneが繋がる
addScene(aboutScene);
}
- 新規作成/Progression4/NewMyCastButton.asでボタンを作成する
public function AboutButton(initObject:Object = null)
{
// 親クラスを初期化します。
super( initObject );
// 移動先となるシーン識別子を設定します。
sceneId = new SceneId( "/index/about" );
// 外部リンクの場合には href プロパティに設定します。
//href = "http://progression.jp/";
graphics.beginFill(0x00ff00);
graphics.drawRect(0, 0, 100, 100);
graphics.endFill();
}
- シーンにボタン追加
public class IndexScene extends SceneObject {
public var aboutButton:AboutButton;
public function IndexScene() {
aboutButton = new AboutButton();
aboutButton.y = 202;
}
アニメーションを使う
addCommand(
new DoTweener( aboutButton , { alpha:0 , x:-70 , time:.2 , transition:"easeInCirc" } )
);
