diff --git a/demo/gun_swap/ant/build.xml b/demo/gun_swap/ant/build.xml deleted file mode 100644 index 5149728..0000000 --- a/demo/gun_swap/ant/build.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/demo/gun_swap/bin/gun_swap.swf b/demo/gun_swap/bin/gun_swap.swf deleted file mode 100644 index 58a216e..0000000 Binary files a/demo/gun_swap/bin/gun_swap.swf and /dev/null differ diff --git a/demo/gun_swap/design/gun_swap.fla b/demo/gun_swap/design/gun_swap.fla deleted file mode 100644 index 8f2bc22..0000000 Binary files a/demo/gun_swap/design/gun_swap.fla and /dev/null differ diff --git a/demo/gun_swap/design/gun_swap.swf b/demo/gun_swap/design/gun_swap.swf deleted file mode 100644 index a9a1726..0000000 Binary files a/demo/gun_swap/design/gun_swap.swf and /dev/null differ diff --git a/demo/gun_swap/design/gun_swap.zip b/demo/gun_swap/design/gun_swap.zip deleted file mode 100644 index 3454687..0000000 Binary files a/demo/gun_swap/design/gun_swap.zip and /dev/null differ diff --git a/demo/gun_swap/src/GunSwapMain.as b/demo/gun_swap/src/GunSwapMain.as deleted file mode 100644 index 51945b3..0000000 --- a/demo/gun_swap/src/GunSwapMain.as +++ /dev/null @@ -1,20 +0,0 @@ -package -{ - import starling.core.Starling; - - import flash.display.Sprite; - import flash.geom.Rectangle; - - [SWF(backgroundColor="#FFFFFF", frameRate="60", width="800", height="600")] - public class GunSwapMain extends Sprite - { - private var _starling: Starling; - - public function GunSwapMain() - { - _starling = new Starling(GunSwapStarling, stage, new Rectangle(0, 0, 800, 600)); - _starling.showStats = true; - _starling.start(); - } - } -} diff --git a/demo/gun_swap/src/GunSwapStarling.as b/demo/gun_swap/src/GunSwapStarling.as deleted file mode 100644 index a70c99c..0000000 --- a/demo/gun_swap/src/GunSwapStarling.as +++ /dev/null @@ -1,88 +0,0 @@ -package -{ - import com.catalystapps.gaf.data.GAFTimeline; - import com.catalystapps.gaf.data.GAFBundle; - import com.catalystapps.gaf.display.IGAFTexture; - import com.catalystapps.gaf.display.GAFImage; - import starling.display.Sprite; - import starling.events.Touch; - import starling.events.TouchEvent; - import starling.events.TouchPhase; - - import com.catalystapps.gaf.core.ZipToGAFAssetConverter; - import com.catalystapps.gaf.display.GAFMovieClip; - - import flash.events.Event; - import flash.utils.ByteArray; - - /** - * @author Ivan Avdeenko - */ - public class GunSwapStarling extends Sprite - { - private var _gafMovieClip: GAFMovieClip; - private var _gunSlot: GAFImage; - private var _gun1: IGAFTexture; - private var _gun2: IGAFTexture; - private var _currentGun: IGAFTexture; - - [Embed(source="../design/gun_swap.zip", mimeType="application/octet-stream")] - private var asset: Class; - - public function GunSwapStarling() - { - var zip: ByteArray = new asset(); - var converter: ZipToGAFAssetConverter = new ZipToGAFAssetConverter(); - converter.addEventListener(Event.COMPLETE, this.onConverted); - converter.convert(zip); - } - - private function onConverted(event: Event): void - { - var converter: ZipToGAFAssetConverter = event.target as ZipToGAFAssetConverter; - var gafBundle: GAFBundle = converter.gafBundle; - //"gun_swap" - the name of the SWF which was converted to GAF - //"rootTimeline" - the linkage name of the Main Timeline generated by GAF Converter - var gafTimeline: GAFTimeline = gafBundle.getGAFTimeline("gun_swap", "rootTimeline"); - - this._gafMovieClip = new GAFMovieClip(gafTimeline); - this._gafMovieClip.play(true); - - this._gunSlot = this._gafMovieClip.getChildByName("GUN") as GAFImage; - - this._gun1 = gafBundle.getCustomRegion("gun_swap", "gun1"); - this._gun2 = gafBundle.getCustomRegion("gun_swap", "gun2"); - //"gun2" texture is made from Bitmap - //thus we need to adjust its' pivot matrix - this._gun2.pivotMatrix.translate(-24.2, -41.55); - - this.setGun(this._gun1); - - this.addChild(this._gafMovieClip); - - stage.addEventListener(TouchEvent.TOUCH, this.onTouch); - } - - private function onTouch(event: TouchEvent): void - { - var touch: Touch = event.getTouch(this, TouchPhase.BEGAN); - if (touch) - { - if (this._currentGun == this._gun2) - { - this.setGun(this._gun1); - } - else - { - this.setGun(this._gun2); - } - } - } - - private function setGun(gun: IGAFTexture): void - { - this._currentGun = gun; - this._gunSlot.changeTexture(gun); - } - } -}