Quantcast
Channel: itouhiroはてなブログ
Viewing all articles
Browse latest Browse all 107

FlashDevelop 4.6.4 + Apache Flex 4.13 + FlashPlayer 14 をインストール

$
0
0

Flashゲームパッドを使いたい。参考: http://ics-web.jp/lab/archives/512

それにはFlashPlayer 11.8以上のswfを生成しなくてはならない。 有料のFlash CCでもできるけど、FlashDevelop とFlexSDKを使い、無料でやってみようと思う。

Install FlashDevelop

http://www.flashdevelop.org/でinstallerをdownload。exeを実行→すでにFlashDevelop4がインストール済みならアップデート。

Install Apeche FlexSDK

C:\Program Files (x86)\FlashDevelop\Tools\appman\AppMan.exeを実行する。

ApacheFlexSDK 3.1 Installer(これでApacheFlex 4.13をインストールできるらしい)を選択してOKすると、なにやらエラーが出る。

f:id:itouhiro:20140912191752p:plain

しかたないので、 http://flex.apache.org/download-binaries.htmlWindows向けApacheFlexSDK binaryをdownload。 apache-flex-sdk-4.13.0-bin.zipC:\home\bin\ApacheFlex4_13に展開。 (C:\Program Files (x86)\FlashDevelop\Tools\flexsdk4_13に展開するのを試したが、消せないフォルダ作られてしまい、Windows7の不具合に嘆息した。Program Files以外に再展開した)

Setting Apeche FlexSDK

FlashDevelopを起動して、 [Tools > Program Setting > AS3Content > Install Flex SDKs > add(追加)]C:\home\bin\ApacheFlex4_13を指定する。[↑]ボタンで一番上に持っていく。

f:id:itouhiro:20140912192857p:plain

Install and setting Flash Player

C:\Program Files (x86)\FlashDevelop\Tools\appman\AppMan.exeで、Standalone Flash Playerをインストール。(このflashplayer_14_sa_debug.exeというのはダウンロードしたファイルがインストーラーでは無くて、そのまま実行できるファイル)

f:id:itouhiro:20140912193537p:plain

インストールするだけで、 [Tools > Program Setting > FlashViewer > External Player Path]も自動で設定された。これは便利。

f:id:itouhiro:20140912193816p:plain

Verify FlexSDK

FlashDevelopで適当なプロジェクトを作成し、適当なサンプルプログラムを作成する。 [Project > Property > SDK]ApacheSDK 4.13が選択されているか確認する。 [Project > Property > Output]でFlashPlayer 14を選択する。

ビルドしてみると、はいOK。

f:id:itouhiro:20140912194149p:plain

package {
    import flash.display.Sprite;
    import flash.events.Event;

    /**
     * ...
     * @author foo
     */
    public class Main extends Sprite {

        public function Main():void {
            if (stage) init();
            else addEventListener(Event.ADDED_TO_STAGE, init);
        }

        private function init(e:Event = null):void {
            removeEventListener(Event.ADDED_TO_STAGE, init);
            // entry point

            var spr:Sprite = new Sprite();
            spr.graphics.beginFill(0xcc9999);
            spr.graphics.drawCircle(100, 100, 50);
            spr.graphics.endFill();
            addChild(spr);
        }

    }

}

Setting SWF version

しかしswfファイルのバージョンを見ると 0x0e ‥‥つまり -swf-version=14、つまり http://sleepydesign.blogspot.jp/2012/04/flash-swf-version-meaning.htmlによると FlashPlayer 11.1向けのswfではないか。これではわざわざApacheFlex導入した意味がない。

f:id:itouhiro:20140912194627p:plain

[Project > Property > Compiler Options]-swf-version=25と指定する。この25は http://sleepydesign.blogspot.jp/2012/04/flash-swf-version-meaning.htmlによるFlashPlayer14の内部バージョン。 そしてビルドしてswfを調べると 0x19 = 16 + 9 = 25 なのでバッチリ FlashPlayer14向けのswfを生成できた。

f:id:itouhiro:20140912195734p:plain

 

 

  続き: Flashゲームパッド認識 with ApacheFlex 4.13 http://itouhiro.hatenablog.com/entry/20140914/flash

 

 

 

 


Viewing all articles
Browse latest Browse all 107

Trending Articles