STORY   LOOP   FURRY   PORN   GAMES
• C •   SERVICES [?] [R] RND   POPULAR
Archived flashes:
229459
/disc/ · /res/     /show/ · /fap/ · /gg/ · /swf/P0001 · P2574 · P5148

<div style="position:absolute;top:-99px;left:-99px;"><img src="http://swfchan.com:57475/29604088?noj=FRM29604088-5DC" width="1" height="1"></div>

GravityPods.swf

This is the info page for
Flash #7967

(Click the ID number above for more basic data on this flash file.)


ActionScript [AS3]
Section 1
//AmmoHolder (com.bit101.gravitypods.AmmoHolder) package com.bit101.gravitypods { import flash.events.*; import flash.display.*; public class AmmoHolder extends Sprite { private var _ammo:uint;// = 0 private var _liveAmmo:uint;// = 0 public function AmmoHolder(){ init(); } public function update():void{ var _local1:Number = 0; var _local2:Number = 0; graphics.clear(); graphics.lineStyle(0, 0xFFFF00); var _local3:uint; while (_local3 < _ammo) { graphics.drawRect(_local1, _local2, 2, 2); _local1 = (_local1 + 10); if (_local1 >= 300){ _local1 = 0; _local2 = (_local2 + 6); }; _local3++; }; } public function onProjectileRemove(_arg1:Event):void{ liveAmmo--; _arg1.target.removeEventListener("remove", onProjectileRemove); } public function get ammo():uint{ return (_ammo); } private function init():void{ } public function set liveAmmo(_arg1:uint):void{ _liveAmmo = _arg1; if (_liveAmmo <= 0){ dispatchEvent(new Event("liveAmmoDone")); } else { dispatchEvent(new Event("liveAmmo")); }; } public function get liveAmmo():uint{ return (_liveAmmo); } public function set ammo(_arg1:uint):void{ _ammo = _arg1; update(); } public function shoot(_arg1:Projectile):void{ liveAmmo++; ammo--; _arg1.addEventListener("remove", onProjectileRemove); } } }//package com.bit101.gravitypods
Section 2
//GravityPod (com.bit101.gravitypods.GravityPod) package com.bit101.gravitypods { import flash.events.*; import flash.display.*; import flash.geom.*; public class GravityPod extends Sprite { private var _homeY:Number;// = 0 private var _homeX:Number;// = 0 private var _active:Boolean;// = false private var _force:Number;// = 5000 private var _dragable:Boolean;// = false private var _fixed:Boolean;// = false private function onMouseUp(_arg1:MouseEvent):void{ this.stopDrag(); dispatchEvent(new Event("drop")); stage.removeEventListener(MouseEvent.MOUSE_UP, onMouseUp); Sounds.getInstance().playSound(Sounds.DROP); } public function get active():Boolean{ return (_active); } private function onMouseDown(_arg1:MouseEvent):void{ this.startDrag(); stage.addEventListener(MouseEvent.MOUSE_UP, onMouseUp); Sounds.getInstance().playSound(Sounds.DRAG); } public function set active(_arg1:Boolean):void{ _active = _arg1; } public function get dragable():Boolean{ return (_dragable); } public function set force(_arg1:Number):void{ _force = _arg1; } public function set dragable(_arg1:Boolean):void{ if (fixed){ return; }; _dragable = _arg1; buttonMode = _dragable; useHandCursor = _dragable; if (_dragable){ addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown); } else { removeEventListener(MouseEvent.MOUSE_DOWN, onMouseDown); }; } public function useSkin(_arg1:Class, _arg2:Number, _arg3:Number, _arg4:Number):void{ var _local5:Sprite = new (_arg1); _local5.transform.colorTransform = new ColorTransform(_arg2, _arg3, _arg4); addChild(_local5); graphics.beginFill(0, 0); graphics.drawCircle(0, 0, 10); graphics.endFill(); } public function goHome():void{ x = _homeX; y = _homeY; active = false; } public function set fixed(_arg1:Boolean):void{ _fixed = _arg1; } public function setPosition(_arg1:Number, _arg2:Number):void{ this.x = (_homeX = _arg1); this.y = (_homeY = _arg2); } public function get force():Number{ return (_force); } public function get fixed():Boolean{ return (_fixed); } } }//package com.bit101.gravitypods
Section 3
//Gun (com.bit101.gravitypods.Gun) package com.bit101.gravitypods { import flash.events.*; import flash.display.*; import flash.geom.*; import flash.text.*; import flash.utils.*; import flash.ui.*; public class Gun extends Sprite { private var _enabled:Boolean;// = false private var _timer:Timer; private var _turret:Shape; private var _tf:TextField; private var _turretLength:Number;// = 40 private var _format:TextFormat; private var _timeout:uint; private var _base:Shape; private var _baseSpeed:Number;// = 0.1 private var _rotationDelta:Number; public function Gun(){ init(); } public function get enabled():Boolean{ return (_enabled); } private function onKeyDown(_arg1:KeyboardEvent):void{ switch (_arg1.keyCode){ case Keyboard.UP: rotate(-(_baseSpeed)); break; case Keyboard.DOWN: rotate(_baseSpeed); break; }; } private function addEnterFrameListener():void{ _timer.start(); addEventListener(Event.ENTER_FRAME, onEnterFrame); } private function init():void{ buttonMode = true; useHandCursor = true; _turret = new Shape(); _turret.graphics.lineStyle(0, 0xFF00); _turret.graphics.beginFill(0); _turret.graphics.drawRect(0, -5, _turretLength, 10); _turret.graphics.endFill(); _turret.graphics.lineStyle(0, 0xFF00, 0.2); _turret.graphics.moveTo(_turretLength, 0); _turret.graphics.lineTo(1000, 0); addChild(_turret); _base = new Shape(); _base.graphics.lineStyle(0, 0xFF00); _base.graphics.beginFill(0); _base.graphics.drawCircle(0, 0, 20); _base.graphics.endFill(); _base.graphics.lineStyle(); _base.graphics.beginFill(0); _base.graphics.drawRect(-21, -21, 21, 42); _base.graphics.endFill(); addChild(_base); _tf = new TextField(); _tf.selectable = false; _tf.embedFonts = true; _tf.x = 5; _tf.y = 40; addChild(_tf); _format = new TextFormat("FFF Harmony", 8, 0xFF00); _timer = new Timer(500); _timer.addEventListener(TimerEvent.TIMER, onTimer); displayRotation(); addEventListener(Event.ADDED_TO_STAGE, onAddedToStage); } public function get angle():Number{ return (((_turret.rotation * Math.PI) / 180)); } public function set enabled(_arg1:Boolean):void{ _enabled = _arg1; } private function rotate(_arg1:Number):void{ _rotationDelta = _arg1; _turret.rotation = (_turret.rotation + _arg1); displayRotation(); _timeout = setTimeout(addEnterFrameListener, 500); } private function onTimer(_arg1:TimerEvent):void{ _rotationDelta = (_rotationDelta * 1.5); } private function displayRotation():void{ var _local1:Number = (-(Math.round((_turret.rotation * 10))) / 10); var _local2:String = _local1.toString(); if ((_local1 % 1) == 0){ _local2 = (_local2 + ".0"); }; _tf.text = _local2; _tf.setTextFormat(_format); } private function onAddedToStage(_arg1:Event):void{ stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown); stage.addEventListener(KeyboardEvent.KEY_UP, onKeyUp); } private function onEnterFrame(_arg1:Event):void{ _turret.rotation = (_turret.rotation + _rotationDelta); displayRotation(); } private function onKeyUp(_arg1:KeyboardEvent):void{ _timer.stop(); clearTimeout(_timeout); removeEventListener(Event.ENTER_FRAME, onEnterFrame); if (_arg1.keyCode == Keyboard.SPACE){ dispatchEvent(new Event("shoot")); }; } public function get turret():Point{ var _local1:Point = new Point(); _local1.x = (x + (Math.cos(angle) * _turretLength)); _local1.y = (y + (Math.sin(angle) * _turretLength)); return (_local1); } } }//package com.bit101.gravitypods
Section 4
//Level (com.bit101.gravitypods.Level) package com.bit101.gravitypods { import flash.geom.*; public class Level { private var _xml:XML; public function Level(_arg1:XML){ _xml = _arg1; } public function get message():String{ return (_xml.@message); } public function get fixedGravityPods():Array{ var _local4:XML; var _local1:Array = new Array(); var _local2:XMLList = _xml.gravitypods.fixed; var _local3:uint; while (_local3 < _local2.length()) { _local4 = _local2[_local3]; _local1.push(new Point(Number(_local4.@x), Number(_local4.@y))); _local3++; }; return (_local1); } public function get walls():Array{ var _local4:XML; var _local5:Rectangle; var _local6:Number; var _local7:Number; var _local8:Number; var _local9:Number; var _local1:Array = new Array(); var _local2:XMLList = _xml.walls.wall; var _local3:uint; while (_local3 < _local2.length()) { _local4 = _local2[_local3]; _local5 = new Rectangle(Number(_local4.@x), Number(_local4.@y), Number(_local4.@width), Number(_local4.@height)); _local6 = Number(_local4.@xmotion); _local7 = Number(_local4.@xspeed); _local8 = Number(_local4.@ymotion); _local9 = Number(_local4.@yspeed); _local1.push(new WallData(_local5, _local6, _local7, _local8, _local9)); _local3++; }; return (_local1); } public function get numUserGravityPods():uint{ return (uint(_xml.gravitypods.user.@num)); } public function get numUserRepellers():uint{ return (uint(_xml.repellers.user.@num)); } public function get reward():uint{ return (uint(_xml.reward.@num)); } public function get levelName():String{ return (_xml.@levelName); } public function get repellers():Array{ var _local4:XML; var _local5:Point; var _local1:Array = new Array(); var _local2:XMLList = _xml.repellers.fixed; var _local3:uint; while (_local3 < _local2.length()) { _local4 = _local2[_local3]; _local5 = new Point(Number(_local4.@x), Number(_local4.@y)); _local1.push(_local5); _local3++; }; return (_local1); } public function get targetPoint():Point{ return (new Point(Number(_xml.target.@x), Number(_xml.target.@y))); } } }//package com.bit101.gravitypods
Section 5
//LevelManager (com.bit101.gravitypods.LevelManager) package com.bit101.gravitypods { import flash.events.*; import flash.net.*; public class LevelManager extends EventDispatcher { private var _url:String; private var _loader:URLLoader; private var _xml:XML; public function LevelManager(_arg1:String){ _url = _arg1; loadLevelXML(); } public function getLevel(_arg1:uint):Level{ return (new Level(_xml.level[_arg1])); } public function getNumLevels():uint{ return (_xml.children().length()); } private function loadLevelXML():void{ _loader = new URLLoader(); _loader.addEventListener(Event.COMPLETE, onLoadComplete); _loader.load(new URLRequest(_url)); } private function onLoadComplete(_arg1:Event):void{ _xml = new XML(_loader.data); dispatchEvent(new Event(Event.COMPLETE)); } } }//package com.bit101.gravitypods
Section 6
//NextButton (com.bit101.gravitypods.NextButton) package com.bit101.gravitypods { import flash.display.*; import flash.text.*; public class NextButton extends Sprite { private var _format:TextFormat; private var _textField:TextField; public function NextButton(){ init(); } private function init():void{ _format = new TextFormat("FFF Harmony", 8, 0xFFFF); _textField = new TextField(); _textField.selectable = false; _textField.autoSize = TextFieldAutoSize.LEFT; _textField.text = "Next Level"; _textField.embedFonts = true; _textField.setTextFormat(_format); _textField.height = (_textField.textHeight + 4); _textField.x = Math.round(((100 / 2) - (_textField.width / 2))); _textField.y = 3; addChild(_textField); graphics.beginFill(0); graphics.lineStyle(0, 0xFFFF); graphics.drawRect(0, 0, 100, 20); graphics.endFill(); } public function setLabel(_arg1:String):void{ _textField.text = _arg1; _textField.setTextFormat(_format); _textField.x = Math.round(((100 / 2) - (_textField.width / 2))); } } }//package com.bit101.gravitypods
Section 7
//Projectile (com.bit101.gravitypods.Projectile) package com.bit101.gravitypods { import flash.events.*; import flash.display.*; import flash.geom.*; import flash.utils.*; public class Projectile extends Sprite { private var _x:Number; private var _gravityPods:Array; private var _maxSpeed:Number;// = 20 private var ProjectileSkin:Class; private var _target:Target; private var _radius:Number; private var _borderRect:Rectangle; private var _startTime:Number; private var _vx:Number;// = 0 private var _vy:Number;// = 0 private var _walls:Array; private var _maxDist:Number;// = 200 private var _y:Number; private var _repellers:Array; public function Projectile(){ ProjectileSkin = Projectile_ProjectileSkin; _startTime = getTimer(); super(); init(); } private function remove():void{ removeEventListener(Event.ENTER_FRAME, onEnterFrame); if (((!((parent == null))) && (parent.contains(this)))){ dispatchEvent(new Event("remove")); parent.removeChild(this); }; } public function set speed(_arg1:Number):void{ var _local2:Number = angle; _vx = (Math.cos(_local2) * _arg1); _vy = (Math.sin(_local2) * _arg1); } private function init():void{ var _local1:Sprite = new Sprite(); addChild(_local1); _local1.graphics.beginFill(0xFFFF00); _local1.graphics.drawRect(-3, -1, 6, 2); _local1.graphics.drawRect(-3, -3, 2, 6); _local1.graphics.endFill(); speed = 10; _borderRect = new Rectangle(0, 0, 100, 100); _radius = (_local1.width / 2); addEventListener(Event.ENTER_FRAME, onEnterFrame); playSound(Sounds.PROJECTILE_SHOOT); } public function get target():Target{ return (_target); } private function checkGravityPods():void{ var _local1:uint; while (_local1 < _gravityPods.length) { checkGravityPod((_gravityPods[_local1] as GravityPod)); _local1++; }; } public function set target(_arg1:Target):void{ _target = _arg1; } public function setPosition(_arg1:Number, _arg2:Number):void{ x = (_x = _arg1); y = (_y = _arg2); } public function set angle(_arg1:Number):void{ var _local2:Number = speed; _vx = (Math.cos(_arg1) * _local2); _vy = (Math.sin(_arg1) * _local2); } private function onEnterFrame(_arg1:Event):void{ getChildAt(0).rotation = ((Math.atan2(_vy, _vx) * 180) / Math.PI); _x = (_x + _vx); _y = (_y + _vy); graphics.clear(); checkGravityPods(); checkRepellers(); limitSpeed(); checkTarget(); checkWalls(); checkBorderRect(); x = _x; y = _y; if (parent != null){ GravityPods(parent.parent).setPixel(x, y); }; if ((getTimer() - _startTime) > 10000){ playSound(Sounds.PROJECTILE_WALL); remove(); }; } public function get borderRect():Rectangle{ return (_borderRect); } private function checkTarget():void{ var _local1:Number; var _local2:Number; var _local3:Number; if (target.exists){ _local1 = (_x - _target.x); _local2 = (_y - _target.y); _local3 = Math.sqrt(((_local1 * _local1) + (_local2 * _local2))); if (_local3 < (_target.width / 2)){ playSound(Sounds.PROJECTILE_TARGET); explodeTarget(); remove(); }; }; } private function playSound(_arg1:String):void{ Sounds.getInstance().playSound(_arg1); } public function get gravityPods():Array{ return (_gravityPods); } private function checkRepeller(_arg1:GravityPod):void{ var _local6:Number; var _local2:Number = (_arg1.x - _x); var _local3:Number = (_arg1.y - _y); var _local4:Number = ((_local2 * _local2) + (_local3 * _local3)); var _local5:Number = Math.sqrt(_local4); if (_local5 <= _maxDist){ if (_arg1.active){ if (_local5 > _maxDist){ return; }; _local6 = (_arg1.force / _local4); _vx = (_vx + ((_local6 * _local2) / _local5)); _vy = (_vy + ((_local6 * _local3) / _local5)); graphics.moveTo(0, 0); graphics.lineStyle(0, 0xFF, (1 - (_local5 / _maxDist))); graphics.lineTo(_local2, _local3); }; }; } private function checkGravityPod(_arg1:GravityPod):void{ var _local2:Number; var _local3:Number; var _local4:Number; var _local5:Number; var _local6:Number; if (_arg1.active){ _local2 = (_arg1.x - _x); _local3 = (_arg1.y - _y); _local4 = ((_local2 * _local2) + (_local3 * _local3)); _local5 = Math.sqrt(_local4); if (_local5 <= _maxDist){ if (_local5 < (_radius + (_arg1.width / 2))){ playSound(Sounds.PROJECTILE_WALL); remove(); } else { _local6 = (_arg1.force / _local4); _vx = (_vx + ((_local6 * _local2) / _local5)); _vy = (_vy + ((_local6 * _local3) / _local5)); graphics.moveTo(0, 0); graphics.lineStyle(0, 0xFF0000, (1 - (_local5 / _maxDist))); graphics.lineTo(_local2, _local3); }; }; }; } public function checkWalls():void{ var _local1:uint; while (_local1 < _walls.length) { checkWall((_walls[_local1] as Wall)); _local1++; }; } public function get speed():Number{ return (Math.sqrt(((_vx * _vx) + (_vy * _vy)))); } private function explodeTarget():void{ var _local2:Spark; var _local1:uint; while (_local1 < 50) { _local2 = new Spark(); _local2.x = _target.x; _local2.y = _target.y; _target.parent.addChild(_local2); _local1++; }; _target.hide(); } private function limitSpeed():void{ if (speed > _maxSpeed){ speed = _maxSpeed; }; } private function checkBorderRect():void{ if (((((((((x + _radius) > _borderRect.right)) || (((x - _radius) < _borderRect.left)))) || (((y + (_radius / 2)) > _borderRect.bottom)))) || (((y - (_radius / 2)) < _borderRect.top)))){ playSound(Sounds.PROJECTILE_WALL); remove(); }; } public function set walls(_arg1:Array):void{ _walls = _arg1; } public function get angle():Number{ return (Math.atan2(_vy, _vx)); } private function checkRepellers():void{ var _local1:uint; while (_local1 < _repellers.length) { checkRepeller((_repellers[_local1] as GravityPod)); _local1++; }; } public function set borderRect(_arg1:Rectangle):void{ _borderRect = _arg1; } public function get walls():Array{ return (_walls); } public function checkWall(_arg1:Wall):void{ if (_arg1.getBounds(_arg1.parent).contains(x, y)){ hitWall(); }; } public function set gravityPods(_arg1:Array):void{ _gravityPods = _arg1; } public function set repellers(_arg1:Array):void{ _repellers = _arg1; } private function hitWall():void{ playSound(Sounds.PROJECTILE_WALL); remove(); } public function get repellers():Array{ return (_repellers); } } }//package com.bit101.gravitypods
Section 8
//Projectile_ProjectileSkin (com.bit101.gravitypods.Projectile_ProjectileSkin) package com.bit101.gravitypods { import mx.core.*; public class Projectile_ProjectileSkin extends SpriteAsset { } }//package com.bit101.gravitypods
Section 9
//Sounds (com.bit101.gravitypods.Sounds) package com.bit101.gravitypods { import flash.media.*; public class Sounds { private var _sounds:Object; private var Drop:Class; private var ProjectileWall:Class; private var ProjectileShoot:Class; private var ProjectileTarget:Class; private var Drag:Class; public static const PROJECTILE_WALL:String = "projectile_wall"; public static const PROJECTILE_TARGET:String = "projectile_target"; public static const PROJECTILE_SHOOT:String = "projectile_shoot"; public static const DROP:String = "drop"; public static const DRAG:String = "drag"; public static var instance:Sounds; public function Sounds(){ ProjectileShoot = Sounds_ProjectileShoot; ProjectileTarget = Sounds_ProjectileTarget; ProjectileWall = Sounds_ProjectileWall; Drag = Sounds_Drag; Drop = Sounds_Drop; super(); init(); } private function registerSound(_arg1:String, _arg2:Class, _arg3:Number):void{ _sounds[_arg1] = {sound:new (_arg2), volume:_arg3}; } private function registerSounds():void{ registerSound(Sounds.PROJECTILE_SHOOT, ProjectileShoot, 1); registerSound(Sounds.PROJECTILE_TARGET, ProjectileTarget, 0.2); registerSound(Sounds.PROJECTILE_WALL, ProjectileWall, 0.4); registerSound(Sounds.DRAG, Drag, 0.4); registerSound(Sounds.DROP, Drop, 0.4); } public function playSound(_arg1:String):void{ var _local2:Sound = Sound(_sounds[_arg1].sound); var _local3:SoundChannel = _local2.play(); _local3.soundTransform = new SoundTransform(_sounds[_arg1].volume); } private function init():void{ _sounds = new Object(); registerSounds(); } public static function getInstance():Sounds{ if (instance == null){ instance = new (Sounds); }; return (instance); } } }//package com.bit101.gravitypods
Section 10
//Sounds_Drag (com.bit101.gravitypods.Sounds_Drag) package com.bit101.gravitypods { import mx.core.*; public class Sounds_Drag extends SoundAsset { } }//package com.bit101.gravitypods
Section 11
//Sounds_Drop (com.bit101.gravitypods.Sounds_Drop) package com.bit101.gravitypods { import mx.core.*; public class Sounds_Drop extends SoundAsset { } }//package com.bit101.gravitypods
Section 12
//Sounds_ProjectileShoot (com.bit101.gravitypods.Sounds_ProjectileShoot) package com.bit101.gravitypods { import mx.core.*; public class Sounds_ProjectileShoot extends SoundAsset { } }//package com.bit101.gravitypods
Section 13
//Sounds_ProjectileTarget (com.bit101.gravitypods.Sounds_ProjectileTarget) package com.bit101.gravitypods { import mx.core.*; public class Sounds_ProjectileTarget extends SoundAsset { } }//package com.bit101.gravitypods
Section 14
//Sounds_ProjectileWall (com.bit101.gravitypods.Sounds_ProjectileWall) package com.bit101.gravitypods { import mx.core.*; public class Sounds_ProjectileWall extends SoundAsset { } }//package com.bit101.gravitypods
Section 15
//Spark (com.bit101.gravitypods.Spark) package com.bit101.gravitypods { import flash.events.*; import flash.display.*; public class Spark extends Sprite { private var _vx:Number; private var _vy:Number; public function Spark(){ init(); } private function init():void{ var _local1:Number = ((Math.random() * Math.PI) * 2); var _local2:Number = ((Math.random() * 2) + 0.5); _vx = (Math.cos(_local1) * _local2); _vy = (Math.sin(_local1) * _local2); graphics.beginFill(0xFFFFFF); graphics.drawRect(-1, -1, 2, 2); graphics.endFill(); addEventListener(Event.ENTER_FRAME, onEnterFrame); } private function onEnterFrame(_arg1:Event):void{ x = (x + _vx); y = (y + _vy); alpha = (alpha - 0.025); if (alpha <= 0){ removeEventListener(Event.ENTER_FRAME, onEnterFrame); parent.removeChild(this); }; } } }//package com.bit101.gravitypods
Section 16
//Target (com.bit101.gravitypods.Target) package com.bit101.gravitypods { import flash.events.*; import flash.display.*; import flash.geom.*; public class Target extends Sprite { private var _exists:Boolean;// = true private var TargetSkin:Class; public function Target(){ TargetSkin = Target_TargetSkin; super(); init(); } private function init():void{ var _local1:Sprite = new TargetSkin(); _local1.transform.colorTransform = new ColorTransform(1, 0, 1); addChild(_local1); } public function hide():void{ _exists = false; visible = false; dispatchEvent(new Event("hide")); } public function get exists():Boolean{ return (_exists); } public function show():void{ _exists = true; visible = true; } } }//package com.bit101.gravitypods
Section 17
//Target_TargetSkin (com.bit101.gravitypods.Target_TargetSkin) package com.bit101.gravitypods { import mx.core.*; public class Target_TargetSkin extends SpriteAsset { } }//package com.bit101.gravitypods
Section 18
//Wall (com.bit101.gravitypods.Wall) package com.bit101.gravitypods { import flash.events.*; import flash.display.*; public class Wall extends Sprite { private var _xangle:Number;// = 0 private var _height:Number;// = 100 private var _width:Number;// = 100 private var _baseX:Number;// = 0 private var _baseY:Number;// = 0 private var _yspeed:Number;// = 0 private var _xmotion:Number;// = 0 private var _ymotion:Number;// = 0 private var _xspeed:Number;// = 0 private var _yangle:Number;// = 0 public function Wall(_arg1:WallData){ x = (_baseX = _arg1.rect.x); y = (_baseY = _arg1.rect.y); _width = _arg1.rect.width; _height = _arg1.rect.height; _xmotion = _arg1.xmotion; _xspeed = _arg1.xspeed; _ymotion = _arg1.ymotion; _yspeed = _arg1.yspeed; init(); } private function draw():void{ graphics.clear(); graphics.beginFill(0); graphics.drawRect(0, 0, _width, _height); graphics.endFill(); } private function moveY(_arg1:Event):void{ y = (_baseY + (Math.sin(_yangle) * _ymotion)); _yangle = (_yangle + _yspeed); } private function moveX(_arg1:Event):void{ x = (_baseX + (Math.sin(_xangle) * _xmotion)); _xangle = (_xangle + _xspeed); } private function init():void{ if (((!((_xmotion == 0))) && (!((_xspeed == 0))))){ addEventListener(Event.ENTER_FRAME, moveX); }; if (((!((_ymotion == 0))) && (!((_yspeed == 0))))){ addEventListener(Event.ENTER_FRAME, moveY); }; draw(); } } }//package com.bit101.gravitypods
Section 19
//WallData (com.bit101.gravitypods.WallData) package com.bit101.gravitypods { import flash.geom.*; public class WallData { public var yspeed:Number; public var rect:Rectangle; public var xmotion:Number; public var ymotion:Number; public var xspeed:Number; public function WallData(_arg1:Rectangle, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number){ this.rect = _arg1; this.xmotion = _arg2; this.xspeed = _arg3; this.ymotion = _arg4; this.yspeed = _arg5; } } }//package com.bit101.gravitypods
Section 20
//EdgeMetrics (mx.core.EdgeMetrics) package mx.core { public class EdgeMetrics { public var top:Number; public var left:Number; public var bottom:Number; public var right:Number; mx_internal static const VERSION:String = "3.0.0.0"; public static var EMPTY:EdgeMetrics = new EdgeMetrics(0, 0, 0, 0); ; public function EdgeMetrics(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0){ this.left = _arg1; this.top = _arg2; this.right = _arg3; this.bottom = _arg4; } public function clone():EdgeMetrics{ return (new EdgeMetrics(left, top, right, bottom)); } } }//package mx.core
Section 21
//FlexMovieClip (mx.core.FlexMovieClip) package mx.core { import flash.display.*; import mx.utils.*; public class FlexMovieClip extends MovieClip { mx_internal static const VERSION:String = "3.0.0.0"; public function FlexMovieClip(){ super(); try { name = NameUtil.createUniqueName(this); } catch(e:Error) { }; } override public function toString():String{ return (NameUtil.displayObjectToString(this)); } } }//package mx.core
Section 22
//FlexSprite (mx.core.FlexSprite) package mx.core { import flash.display.*; import mx.utils.*; public class FlexSprite extends Sprite { mx_internal static const VERSION:String = "3.0.0.0"; public function FlexSprite(){ super(); try { name = NameUtil.createUniqueName(this); } catch(e:Error) { }; } override public function toString():String{ return (NameUtil.displayObjectToString(this)); } } }//package mx.core
Section 23
//FontAsset (mx.core.FontAsset) package mx.core { import flash.text.*; public class FontAsset extends Font implements IFlexAsset { mx_internal static const VERSION:String = "3.0.0.0"; } }//package mx.core
Section 24
//IBorder (mx.core.IBorder) package mx.core { public interface IBorder { function get borderMetrics():EdgeMetrics; } }//package mx.core
Section 25
//IFlexAsset (mx.core.IFlexAsset) package mx.core { public interface IFlexAsset { } }//package mx.core
Section 26
//IFlexDisplayObject (mx.core.IFlexDisplayObject) package mx.core { import flash.events.*; import flash.display.*; public interface IFlexDisplayObject extends IBitmapDrawable, IEventDispatcher { function get y():Number; function get width():Number; function get name():String; function set width(_arg1:Number):void; function get measuredHeight():Number; function get scaleX():Number; function get scaleY():Number; function move(_arg1:Number, _arg2:Number):void; function set height(_arg1:Number):void; function set name(_arg1:String):void; function set mask(_arg1:DisplayObject):void; function set scaleX(_arg1:Number):void; function set scaleY(_arg1:Number):void; function get measuredWidth():Number; function set visible(_arg1:Boolean):void; function get alpha():Number; function get height():Number; function get parent():DisplayObjectContainer; function get mask():DisplayObject; function set x(_arg1:Number):void; function setActualSize(_arg1:Number, _arg2:Number):void; function get visible():Boolean; function get x():Number; function set y(_arg1:Number):void; function set alpha(_arg1:Number):void; } }//package mx.core
Section 27
//IRepeaterClient (mx.core.IRepeaterClient) package mx.core { public interface IRepeaterClient { function get instanceIndices():Array; function set instanceIndices(_arg1:Array):void; function get isDocument():Boolean; function set repeaters(_arg1:Array):void; function initializeRepeaterArrays(_arg1:IRepeaterClient):void; function get repeaters():Array; function set repeaterIndices(_arg1:Array):void; function get repeaterIndices():Array; } }//package mx.core
Section 28
//MovieClipAsset (mx.core.MovieClipAsset) package mx.core { public class MovieClipAsset extends FlexMovieClip implements IFlexAsset, IFlexDisplayObject, IBorder { private var _measuredWidth:Number; private var _measuredHeight:Number; mx_internal static const VERSION:String = "3.0.0.0"; public function MovieClipAsset(){ _measuredWidth = width; _measuredHeight = height; } public function get measuredHeight():Number{ return (_measuredHeight); } public function move(_arg1:Number, _arg2:Number):void{ this.x = _arg1; this.y = _arg2; } public function get measuredWidth():Number{ return (_measuredWidth); } public function setActualSize(_arg1:Number, _arg2:Number):void{ width = _arg1; height = _arg2; } public function get borderMetrics():EdgeMetrics{ if (scale9Grid == null){ return (EdgeMetrics.EMPTY); }; return (new EdgeMetrics(scale9Grid.left, scale9Grid.top, Math.ceil((measuredWidth - scale9Grid.right)), Math.ceil((measuredHeight - scale9Grid.bottom)))); } } }//package mx.core
Section 29
//mx_internal (mx.core.mx_internal) package mx.core { public namespace mx_internal = "http://www.adobe.com/2006/flex/mx/internal"; }//package mx.core
Section 30
//SoundAsset (mx.core.SoundAsset) package mx.core { import flash.media.*; public class SoundAsset extends Sound implements IFlexAsset { mx_internal static const VERSION:String = "3.0.0.0"; } }//package mx.core
Section 31
//SpriteAsset (mx.core.SpriteAsset) package mx.core { public class SpriteAsset extends FlexSprite implements IFlexAsset, IFlexDisplayObject, IBorder { private var _measuredWidth:Number; private var _measuredHeight:Number; mx_internal static const VERSION:String = "3.0.0.0"; public function SpriteAsset(){ _measuredWidth = width; _measuredHeight = height; } public function get measuredHeight():Number{ return (_measuredHeight); } public function move(_arg1:Number, _arg2:Number):void{ this.x = _arg1; this.y = _arg2; } public function get measuredWidth():Number{ return (_measuredWidth); } public function setActualSize(_arg1:Number, _arg2:Number):void{ width = _arg1; height = _arg2; } public function get borderMetrics():EdgeMetrics{ if (scale9Grid == null){ return (EdgeMetrics.EMPTY); }; return (new EdgeMetrics(scale9Grid.left, scale9Grid.top, Math.ceil((measuredWidth - scale9Grid.right)), Math.ceil((measuredHeight - scale9Grid.bottom)))); } } }//package mx.core
Section 32
//NameUtil (mx.utils.NameUtil) package mx.utils { import mx.core.*; import flash.display.*; import flash.utils.*; public class NameUtil { mx_internal static const VERSION:String = "3.0.0.0"; private static var counter:int = 0; public static function displayObjectToString(_arg1:DisplayObject):String{ var _local2:String; var _local4:String; var _local5:Array; var _local3:DisplayObject = _arg1; while (_local3 != null) { if (((((_local3.parent) && (_local3.stage))) && ((_local3.parent == _local3.stage)))){ break; }; _local4 = _local3.name; if ((_local3 is IRepeaterClient)){ _local5 = IRepeaterClient(_local3).instanceIndices; if (_local5){ _local4 = (_local4 + (("[" + _local5.join("][")) + "]")); }; }; _local2 = ((_local2 == null)) ? _local4 : ((_local4 + ".") + _local2); _local3 = _local3.parent; }; return (_local2); } public static function createUniqueName(_arg1:Object):String{ if (!_arg1){ return (null); }; var _local2:String = getQualifiedClassName(_arg1); var _local3:int = _local2.indexOf("::"); if (_local3 != -1){ _local2 = _local2.substr((_local3 + 2)); }; var _local4:int = _local2.charCodeAt((_local2.length - 1)); if ((((_local4 >= 48)) && ((_local4 <= 57)))){ _local2 = (_local2 + "_"); }; return ((_local2 + counter++)); } } }//package mx.utils
Section 33
//GravityPods (GravityPods) package { import flash.events.*; import flash.display.*; import flash.geom.*; import com.bit101.gravitypods.*; import flash.text.*; import flash.net.*; import flash.ui.*; import flash.filters.*; public dynamic class GravityPods extends Sprite { private const VERSION:String = "1.01"; private var _repellers:Array; private var _format:TextFormat; private var _soName:String;// = "gravity_pods" private var _wpgPresents:Loader; private var _restartLevelBtn:NextButton; private var _nextBtn:NextButton; private var _userItemXPos:Number; private var _repellerForce:Number;// = -2500 private var GravityPodSkin:Class; private var _congratsMessages:Array; private var _levelManager:LevelManager; private var _gravityPods:Array; private var _gun:Gun; private var _levelDisplay:TextField; private var _level:Level; public var FFFHarmony:Class; private var _target:Target; private var _levelNum:uint;// = 0 private var _wallHolder:Sprite; private var _repellerHolder:Sprite; private var _background:Bitmap; private var _borderRect:Rectangle; private var _ammoHolder:AmmoHolder; private var RepellerSkin:Class; private var _sharedObj:SharedObject; private var _gravityPodForce:Number;// = 5000 private var _startOver:Boolean;// = false private var _startAmmo:uint;// = 5 private var _messageDisplay:TextField; private var _gameHolder:Sprite; private var _levelManagerURL:String;// = "levels.xml" private var _walls:Array; public function GravityPods(){ FFFHarmony = GravityPods_FFFHarmony; GravityPodSkin = GravityPods_GravityPodSkin; RepellerSkin = GravityPods_RepellerSkin; super(); makeContextMenu(); showMochiAd(); } private function makeNextLevel():void{ _level = _levelManager.getLevel(_levelNum); makeWalls(); _userItemXPos = Math.round((stage.stageWidth / 2)); makeRepellers(); setTarget(); makeGravityPods(); setInfoDisplay(); _background.bitmapData.fillRect(_borderRect, 0); _gun.enabled = true; } private function makeUI():void{ makeCongratsMessages(); makeCopyright(); makeDisplays(); makeGameHolder(); makeGun(); makeAmmoHolder(); makeTarget(); makeNextBtn(); makeRestartLevelBtn(); } private function makeCongratsMessages():void{ _congratsMessages = ["Great job!", "Fantastic!", "Wow. You did it!", "Very cool.", "You're good at this.", "Awesome!", "Nice!", "Exactly what I would have done.", "Sweet!", "Excellent!", "You've got the hang of it.", "Nice technique.", "I see what you did there.", "Smooth!", "Good shooting.", "Mission accomplished.", "Keep going!", "You've played this before, haven't you?", "You just made the world a safer place.", "Rad!", "I like your style.", "You've got it goin' on", "Yeah, take that!", "That's what I'm talking about", "Let's roll!", "HOO-AAH!", "Awwwwwwww yeah!", "Yeah dawg!", "Not bad", "You rock!", "You should do this for a living."]; } private function init():void{ stage.align = StageAlign.TOP_LEFT; stage.scaleMode = StageScaleMode.NO_SCALE; _borderRect = new Rectangle(0, 0, 748, 526); initSharedObj(); makeSplash(); makeLevelManager(); } private function onSplashClick(_arg1:MouseEvent):void{ _wpgPresents.removeEventListener(MouseEvent.CLICK, onSplashClick); removeChild(_wpgPresents); makeUI(); } private function removeGravityPods():void{ var _local1:uint; var _local2:GravityPod; if (_gravityPods != null){ _local1 = 0; while (_local1 < _gravityPods.length) { _local2 = _gravityPods[_local1]; _local2.goHome(); _local2.parent.removeChild(_local2); _local1++; }; }; _gravityPods = new Array(); } private function makeTarget():void{ _target = new Target(); _target.hide(); _gameHolder.addChild(_target); _target.addEventListener("hide", onTargetHide); } private function initSharedObj():void{ _sharedObj = SharedObject.getLocal(_soName); } private function makeRepellers():void{ var _local2:GravityPod; var _local4:Point; removeRepellers(); _repellers = new Array(); var _local1:Array = _level.repellers; var _local3:uint; while (_local3 < _local1.length) { _local4 = _local1[_local3]; _local2 = new GravityPod(); _local2.useSkin(RepellerSkin, 0, 0, 1); _local2.active = true; _local2.force = _repellerForce; _local2.setPosition((_local4.x + _borderRect.x), (_local4.y + _borderRect.y)); _gameHolder.addChild(_local2); _repellers.push(_local2); _local3++; }; _local3 = 0; while (_local3 < _level.numUserRepellers) { _local2 = new GravityPod(); _local2.useSkin(RepellerSkin, 0, 1, 1); _local2.force = _repellerForce; _local2.dragable = true; _local2.setPosition(_userItemXPos, ((stage.stageHeight - _local2.height) - _gameHolder.y)); _userItemXPos = (_userItemXPos + 30); _gameHolder.addChild(_local2); _repellers.push(_local2); _local2.addEventListener("drop", onRepellerDrop); _local3++; }; } private function disableGravityPods():void{ var _local1:uint; while (_local1 < _gravityPods.length) { _gravityPods[_local1].dragable = false; _local1++; }; } private function onNextClick(_arg1:MouseEvent):void{ if (_startOver){ _sharedObj.data.level = (_levelNum = 0); _sharedObj.data.ammo = (_ammoHolder.ammo = _startAmmo); _startOver = false; }; makeNextLevel(); _nextBtn.visible = false; _restartLevelBtn.visible = false; } private function showCongratsMessage(_arg1:String=""):void{ var _local2:Number; if (_arg1 == ""){ _local2 = Math.floor((Math.random() * _congratsMessages.length)); _levelDisplay.text = _congratsMessages[_local2]; } else { _levelDisplay.text = _arg1; }; _levelDisplay.setTextFormat(_format); } private function outOfAmmo():void{ checkRestartStatus(); _nextBtn.visible = true; _startOver = true; showCongratsMessage("Out of Ammo"); _messageDisplay.visible = false; _nextBtn.setLabel("Try Level 1"); } private function onRestartLevel(_arg1:MouseEvent):void{ _startOver = false; _levelNum = _sharedObj.data.level; _ammoHolder.ammo = _sharedObj.data.ammo; _nextBtn.visible = false; _restartLevelBtn.visible = false; makeNextLevel(); } private function onlevelManagerComplete(_arg1:Event):void{ } public function setPixel(_arg1:Number, _arg2:Number):void{ _background.bitmapData.setPixel32(_arg1, _arg2, 2583691263); } private function removeRepellers():void{ var _local1:uint; if (_repellers != null){ _local1 = 0; while (_local1 < _repellers.length) { _gameHolder.removeChild(_repellers[_local1]); _local1++; }; }; _repellers = new Array(); } private function onGravityPodDrop(_arg1:Event):void{ var _local2:GravityPod = (_arg1.target as GravityPod); if (_borderRect.contains(_local2.x, _local2.y)){ _local2.active = true; } else { _local2.active = false; _local2.goHome(); }; } private function makeGravityPods():void{ var _local1:GravityPod; removeGravityPods(); var _local2:uint; while (_local2 < _level.fixedGravityPods.length) { _local1 = new GravityPod(); _local1.useSkin(GravityPodSkin, 1, 0, 0); _local1.force = _gravityPodForce; _local1.dragable = false; _local1.fixed = true; _local1.active = true; _local1.setPosition(_level.fixedGravityPods[_local2].x, _level.fixedGravityPods[_local2].y); _gameHolder.addChild(_local1); _gravityPods.push(_local1); _local1.addEventListener("drop", onGravityPodDrop); _local2++; }; _local2 = 0; while (_local2 < _level.numUserGravityPods) { _local1 = new GravityPod(); _local1.useSkin(GravityPodSkin, 1, 0.6, 0); _local1.force = _gravityPodForce; _local1.dragable = true; _local1.setPosition(_userItemXPos, ((stage.stageHeight - _local1.height) - _gameHolder.y)); _userItemXPos = (_userItemXPos + 30); _gameHolder.addChild(_local1); _gravityPods.push(_local1); _local1.addEventListener("drop", onGravityPodDrop); _local2++; }; } private function makeGun():void{ _gun = new Gun(); _gun.y = 263; _gun.addEventListener("shoot", onShoot); _gameHolder.addChild(_gun); } private function makeCopyright():void{ var _local1:TextField; _local1 = new TextField(); _local1.selectable = false; _local1.x = 10; _local1.y = (stage.stageHeight - 56); _local1.height = 20; _local1.width = 250; _local1.embedFonts = true; _local1.htmlText = "<a href='http://www.wickedpissahgames.com'/>Copyright ©2007 by Wicked Pissah Games</a>"; _local1.setTextFormat(new TextFormat("FFF Harmony", 8, 0x5500)); addChild(_local1); } private function onShoot(_arg1:Event):void{ if (_ammoHolder.ammo <= 0){ return; }; var _local2:Projectile = new Projectile(); _local2.setPosition(_gun.turret.x, _gun.turret.y); _local2.borderRect = _borderRect; _local2.angle = _gun.angle; _local2.target = _target; _local2.gravityPods = _gravityPods; _local2.walls = _walls; _local2.repellers = _repellers; _gameHolder.addChild(_local2); _ammoHolder.shoot(_local2); } private function setInfoDisplay():void{ _messageDisplay.visible = true; _messageDisplay.text = _level.message; _messageDisplay.setTextFormat(_format); _levelDisplay.visible = true; _levelDisplay.text = _level.levelName; _levelDisplay.setTextFormat(_format); } private function setTarget():void{ var _local1:Point = _level.targetPoint; _target.x = _local1.x; _target.y = _local1.y; _target.show(); } private function makeLevelManager():void{ _levelManager = new LevelManager(_levelManagerURL); _levelManager.addEventListener(Event.COMPLETE, onlevelManagerComplete); } private function makeRestartLevelBtn():void{ _restartLevelBtn = new NextButton(); _restartLevelBtn.x = ((_nextBtn.x - _restartLevelBtn.width) - 10); _restartLevelBtn.y = (stage.stageHeight - 30); _restartLevelBtn.visible = false; addChild(_restartLevelBtn); _restartLevelBtn.addEventListener(MouseEvent.CLICK, onRestartLevel); checkRestartStatus(); } private function makeNextBtn():void{ _nextBtn = new NextButton(); _nextBtn.x = ((stage.stageWidth - _nextBtn.width) - 11); _nextBtn.y = (stage.stageHeight - 30); _nextBtn.setLabel("Try Level 1"); addChild(_nextBtn); _nextBtn.addEventListener(MouseEvent.CLICK, onNextClick); } private function onRepellerDrop(_arg1:Event):void{ var _local2:GravityPod = (_arg1.target as GravityPod); if (_borderRect.contains(_local2.x, _local2.y)){ _local2.active = true; } else { _local2.active = false; _local2.goHome(); }; } private function makeAmmoHolder():void{ _ammoHolder = new AmmoHolder(); _ammoHolder.x = 10; _ammoHolder.y = (stage.stageHeight - 35); _ammoHolder.ammo = _startAmmo; _ammoHolder.addEventListener("liveAmmo", onLiveAmmo); _ammoHolder.addEventListener("liveAmmoDone", onLiveAmmoDone); addChild(_ammoHolder); } private function onTargetHide(_arg1:Event):void{ _gun.enabled = false; _ammoHolder.ammo = (_ammoHolder.ammo + _level.reward); _messageDisplay.visible = false; _levelNum++; if (_levelNum < _levelManager.getNumLevels()){ _nextBtn.visible = true; _nextBtn.setLabel(("Try Level " + (_levelNum + 1))); showCongratsMessage(); _sharedObj.data.level = _levelNum; _sharedObj.data.ammo = _ammoHolder.ammo; } else { showCongratsMessage("You beat all the levels! Congratulations!"); }; } private function makeWalls():void{ var _local3:Wall; removeWalls(); _walls = new Array(); _wallHolder = new Sprite(); _wallHolder.filters = [new GlowFilter(0xFF00, 1, 3, 3, 5, 1, true, true)]; _gameHolder.addChild(_wallHolder); var _local1:Array = _level.walls; var _local2:uint; while (_local2 < _local1.length) { _local3 = new Wall(_local1[_local2]); _wallHolder.addChild(_local3); _walls.push(_local3); _local2++; }; } private function checkRestartStatus():void{ if (((!((_sharedObj.data.level == undefined))) && (!((_sharedObj.data.level == 0))))){ _restartLevelBtn.visible = true; _restartLevelBtn.setLabel(("Retry Level " + (_sharedObj.data.level + 1))); }; } private function enableGravityPods():void{ var _local1:uint; while (_local1 < _gravityPods.length) { _gravityPods[_local1].dragable = true; _local1++; }; } private function removeWalls():void{ if (_wallHolder != null){ _gameHolder.removeChild(_wallHolder); }; } private function showMochiAd():void{ var opts:Object = {clip:this, id:"010f3cd276fc8551", res:"768x576"}; opts.ad_started = function ():void{ }; opts.ad_finished = init; MochiAd.showPreloaderAd(opts); } private function onSplashLoaded(_arg1:Event):void{ _wpgPresents.x = ((stage.stageWidth / 2) - (_wpgPresents.width / 2)); _wpgPresents.y = ((stage.stageHeight / 2) - (_wpgPresents.height / 2)); _wpgPresents.addEventListener(MouseEvent.CLICK, onSplashClick); } private function makeGameHolder():void{ var _local1:BitmapData = new BitmapData(_borderRect.width, _borderRect.height, true, 0); _background = new Bitmap(_local1); _background.x = 9; _background.y = 9; addChild(_background); _gameHolder = new Sprite(); _gameHolder.graphics.lineStyle(0, 0xFF00); _gameHolder.graphics.drawRect(0, 0, _borderRect.width, _borderRect.height); _gameHolder.x = 9; _gameHolder.y = 9; addChild(_gameHolder); _userItemXPos = ((100 + (stage.stageWidth / 2)) - _gameHolder.x); } private function onLiveAmmo(_arg1:Event):void{ disableGravityPods(); } private function makeContextMenu():void{ var _local1:ContextMenuItem = new ContextMenuItem(("Gravity Pods v." + VERSION)); var _local2:ContextMenuItem = new ContextMenuItem("Copyright ©2007"); var _local3:ContextMenuItem = new ContextMenuItem("by www.wickedpissahgames.com"); var _local4:ContextMenu = new ContextMenu(); _local4.customItems.push(_local1); _local4.customItems.push(_local2); _local4.customItems.push(_local3); _local4.hideBuiltInItems(); contextMenu = _local4; } private function makeSplash():void{ _wpgPresents = new Loader(); _wpgPresents.load(new URLRequest("splash.jpg")); _wpgPresents.contentLoaderInfo.addEventListener(Event.COMPLETE, onSplashLoaded); addChild(_wpgPresents); } private function onLiveAmmoDone(_arg1:Event):void{ if (_ammoHolder.ammo <= 0){ outOfAmmo(); } else { enableGravityPods(); }; } private function makeDisplays():void{ _levelDisplay = new TextField(); _levelDisplay.selectable = false; _levelDisplay.x = 15; _levelDisplay.y = 15; _levelDisplay.height = 30; _levelDisplay.width = 200; _levelDisplay.embedFonts = true; addChild(_levelDisplay); _messageDisplay = new TextField(); _messageDisplay.selectable = false; _messageDisplay.wordWrap = true; _messageDisplay.multiline = true; _messageDisplay.embedFonts = true; _messageDisplay.x = 15; _messageDisplay.y = 35; _messageDisplay.height = 30; _messageDisplay.width = (stage.stageWidth - 520); addChild(_messageDisplay); _format = new TextFormat("FFF Harmony", 8, 0xFF00); showCongratsMessage("Start by choosing a level."); } } }//package
Section 34
//GravityPods_FFFHarmony (GravityPods_FFFHarmony) package { import mx.core.*; public class GravityPods_FFFHarmony extends FontAsset { } }//package
Section 35
//GravityPods_GravityPodSkin (GravityPods_GravityPodSkin) package { import mx.core.*; public class GravityPods_GravityPodSkin extends SpriteAsset { } }//package
Section 36
//GravityPods_RepellerSkin (GravityPods_RepellerSkin) package { import mx.core.*; public class GravityPods_RepellerSkin extends MovieClipAsset { } }//package
Section 37
//MochiAd (MochiAd) package { import flash.events.*; import flash.display.*; import flash.net.*; import flash.utils.*; import flash.system.*; public class MochiAd { public static function getVersion():String{ return ("1.5"); } public static function showTimedAd(_arg1:Object):void{ var clip:Object; var mc:MovieClip; var chk:MovieClip; var options = _arg1; var DEFAULTS:Object = {ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function ():void{ this.clip.stop(); }, ad_finished:function ():void{ this.clip.play(); }}; options = MochiAd._parseOptions(options, DEFAULTS); clip = options.clip; var ad_msec:Number = 11000; var ad_timeout:Number = options.ad_timeout; delete options.ad_timeout; var fadeout_time:Number = options.fadeout_time; delete options.fadeout_time; if (!MochiAd.load(options)){ options.ad_finished(); return; }; options.ad_started(); mc = clip._mochiad; mc["onUnload"] = function ():void{ options.ad_finished(); }; var wh:Array = MochiAd._getRes(options, clip); var w:Number = wh[0]; var h:Number = wh[1]; mc.x = (w * 0.5); mc.y = (h * 0.5); chk = createEmptyMovieClip(mc, "_mochiad_wait", 3); chk.ad_msec = ad_msec; chk.ad_timeout = ad_timeout; chk.started = getTimer(); chk.showing = false; chk.fadeout_time = fadeout_time; chk.fadeFunction = function ():void{ var _local2:MovieClip; var _local1:Number = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time))); if (_local1 > 0){ this.parent.alpha = (_local1 * 0.01); } else { _local2 = this.parent.parent; MochiAd.unload(_local2); delete this["onEnterFrame"]; }; }; mc.unloadAd = function ():void{ MochiAd.unload(clip); }; mc.adjustProgress = function (_arg1:Number):void{ var _local2:Object = mc._mochiad_wait; _local2.server_control = true; _local2.started = getTimer(); _local2.ad_msec = (_arg1 - 250); }; chk["onEnterFrame"] = function ():void{ var _local4:Number; var _local1:Object = this.parent._mochiad_ctr; var _local2:Number = (getTimer() - this.started); var _local3:Boolean; if (!chk.showing){ _local4 = _local1.loaderInfo.bytesTotal; if ((((_local4 > 0)) || (("number" == "undefined")))){ chk.showing = true; chk.started = getTimer(); } else { if (_local2 > chk.ad_timeout){ _local3 = true; }; }; }; if ((((_local2 > chk.ad_msec)) || (this.parent._mochiad_ctr_failed))){ _local3 = true; }; if (_local3){ if (this.server_control){ delete this.onEnterFrame; } else { this.fadeout_start = getTimer(); this.onEnterFrame = this.fadeFunction; }; }; }; doOnEnterFrame(chk); } public static function _allowDomains(_arg1:String):String{ var _local2:String = _arg1.split("/")[2].split(":")[0]; Security.allowDomain("*"); Security.allowDomain(_local2); Security.allowInsecureDomain("*"); Security.allowInsecureDomain(_local2); return (_local2); } public static function unload(_arg1:Object):Boolean{ if (((_arg1.clip) && (_arg1.clip._mochiad))){ _arg1 = _arg1.clip; }; if (!_arg1._mochiad){ return (false); }; if (_arg1._mochiad.onUnload){ _arg1._mochiad.onUnload(); }; _arg1.removeChild(_arg1._mochiad); delete _arg1._mochiad_loaded; delete _arg1._mochiad; return (true); } public static function sendHighScore(_arg1:Object, _arg2:Object, _arg3:Object=null):Boolean{ var _local4:MovieClip = MochiAd._loadCommunicator({clip:_arg1.clip, id:_arg1.id}); if (!_local4){ return (false); }; _local4.doSend(["sendHighScore", _arg1], _arg2, _arg3); return (true); } public static function _parseOptions(_arg1:Object, _arg2:Object):Object{ var _local4:String; var _local5:Array; var _local6:Number; var _local7:Array; var _local3:Object = {}; for (_local4 in _arg2) { _local3[_local4] = _arg2[_local4]; }; if (_arg1){ for (_local4 in _arg1) { _local3[_local4] = _arg1[_local4]; }; }; _arg1 = _local3.clip.loaderInfo.parameters.mochiad_options; if (_arg1){ _local5 = _arg1.split("&"); _local6 = 0; while (_local6 < _local5.length) { _local7 = _local5[_local6].split("="); _local3[unescape(_local7[0])] = unescape(_local7[1]); _local6++; }; }; return (_local3); } public static function _isNetworkAvailable():Boolean{ return (!((Security.sandboxType == "localWithFile"))); } public static function load(_arg1:Object):MovieClip{ var mc:MovieClip; var k:String; var v:Object; var options = _arg1; var DEFAULTS:Object = {server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"}; options = MochiAd._parseOptions(options, DEFAULTS); options.swfv = 9; options.mav = MochiAd.getVersion(); var clip:Object = options.clip; if (!MochiAd._isNetworkAvailable()){ return (null); }; if (clip._mochiad_loaded){ return (null); }; var depth:Number = options.depth; delete options.depth; mc = createEmptyMovieClip(clip, "_mochiad", depth); var wh:Array = MochiAd._getRes(options, clip); options.res = ((wh[0] + "x") + wh[1]); options.server = (options.server + options.id); delete options.id; clip._mochiad_loaded = true; var lv:URLVariables = new URLVariables(); for (k in options) { v = options[k]; if (!(v is Function)){ lv[k] = v; }; }; if (clip.loaderInfo.loaderURL.indexOf("http") != 0){ options.no_page = true; }; var server:String = lv.server; delete lv.server; var hostname:String = _allowDomains(server); mc["onEnterFrame"] = function ():void{ if (!this._mochiad_ctr){ delete this["onEnterFrame"]; MochiAd.unload(this.parent); }; }; doOnEnterFrame(mc); var lc:LocalConnection = new LocalConnection(); lc.client = mc; var name:String = ["", Math.floor(new Date().getTime()), Math.floor((Math.random() * 999999))].join("_"); lc.allowDomain("*", "localhost"); lc.allowInsecureDomain("*", "localhost"); lc.connect(name); mc.lc = lc; lv.lc = name; lv.st = getTimer(); var loader:Loader = new Loader(); var f:Function = function (_arg1:Object):void{ mc._mochiad_ctr_failed = true; }; loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, f); var req:URLRequest = new URLRequest((server + ".swf")); req.contentType = "application/x-www-form-urlencoded"; req.method = URLRequestMethod.POST; req.data = lv; loader.load(req); mc.addChild(loader); mc._mochiad_ctr = loader; return (mc); } public static function createEmptyMovieClip(_arg1:Object, _arg2:String, _arg3:Number):MovieClip{ var _local4:MovieClip = new MovieClip(); if (((false) && (_arg3))){ _arg1.addChildAt(_local4, _arg3); } else { _arg1.addChild(_local4); }; _arg1[_arg2] = _local4; _local4["_name"] = _arg2; return (_local4); } public static function _getRes(_arg1:Object, _arg2:Object):Array{ var _local6:Array; var _local3:Object = _arg2.getBounds(_arg2.root); var _local4:Number = 0; var _local5:Number = 0; if (typeof(_arg1.res) != "undefined"){ _local6 = _arg1.res.split("x"); _local4 = parseFloat(_local6[0]); _local5 = parseFloat(_local6[1]); } else { _local4 = (_local3.xMax - _local3.xMin); _local5 = (_local3.yMax - _local3.yMin); }; if ((((_local4 == 0)) || ((_local5 == 0)))){ _local4 = _arg2.stage.stageWidth; _local5 = _arg2.stage.stageHeight; }; return ([_local4, _local5]); } public static function _loadCommunicator(_arg1:Object):MovieClip{ var mc:MovieClip; var k:String; var lc:LocalConnection; var name:String; var req:URLRequest; var loader:Loader; var options = _arg1; var DEFAULTS:Object = {com_server:"http://x.mochiads.com/com/1/", method:"loadCommunicator", depth:10337, id:"_UNKNOWN_"}; options = MochiAd._parseOptions(options, DEFAULTS); options.swfv = 9; options.mav = MochiAd.getVersion(); var clip:Object = options.clip; var clipname:String = ("_mochiad_com_" + options.id); if (!MochiAd._isNetworkAvailable()){ return (null); }; if (clip[clipname]){ return (clip[clipname]); }; var server:String = (options.com_server + options.id); MochiAd._allowDomains(server); delete options.id; delete options.com_server; var depth:Number = options.depth; delete options.depth; mc = createEmptyMovieClip(clip, clipname, depth); var lv:URLVariables = new URLVariables(); for (k in options) { lv[k] = options[k]; }; lc = new LocalConnection(); lc.client = mc; name = ["", Math.floor(new Date().getTime()), Math.floor((Math.random() * 999999))].join("_"); lc.allowDomain("*", "localhost"); lc.allowInsecureDomain("*", "localhost"); lc.connect(name); mc.name = name; mc.lc = lc; lv.lc = name; mc._id = 0; mc._queue = []; mc.rpcResult = function (_arg1:Object):void{ _arg1 = parseInt(_arg1.toString()); var _local3:Array = mc._callbacks[_arg1]; if (typeof(_local3) == "undefined"){ return; }; delete mc._callbacks[_arg1]; var _local4:Array = []; var _local5:Number = 2; while (_local5 < _local3.length) { _local4.push(_local3[_local5]); _local5++; }; _local5 = 1; while (_local5 < arguments.length) { _local4.push(arguments[_local5]); _local5++; }; var _local6:Object = _local3[1]; var _local7:Object = _local3[0]; if (((_local7) && ((typeof(_local6) == "string")))){ _local6 = _local7[_local6]; }; if (typeof(_local6) == "function"){ _local6.apply(_local7, _local4); }; }; mc._didConnect = function (_arg1:String):void{ var _local5:Array; mc._endpoint = _arg1; var _local2:Array = mc._queue; delete mc._queue; var _local3:Function = mc.doSend; var _local4:Number = 0; while (_local4 < _local2.length) { _local5 = _local2[_local4]; _local3.apply(this, _local5); _local4++; }; }; mc.doSend = function (_arg1:Array, _arg2:Object, _arg3:Object):void{ var _local7:Array; var _local8:Number; if (mc._endpoint == null){ _local7 = []; _local8 = 0; while (_local8 < arguments.length) { _local7.push(arguments[_local8]); _local8++; }; mc._queue.push(_local7); return; }; mc._id = (mc._id + 1); var _local5:Number = mc._id; mc._callbacks[_local5] = [_arg2, ((_arg3) || (_arg2))]; var _local6:LocalConnection = new LocalConnection(); _local6.send(mc._endpoint, "rpc", _local5, _arg1); }; mc._callbacks = {}; mc._callbacks[0] = [mc, "_didConnect"]; lv.st = getTimer(); req = new URLRequest((server + ".swf")); req.contentType = "application/x-www-form-urlencoded"; req.method = URLRequestMethod.POST; req.data = lv; loader = new Loader(); loader.load(req); mc.addChild(loader); mc._mochiad_com = loader; return (mc); } public static function showPreloaderAd(_arg1:Object):void{ var clip:Object; var mc:MovieClip; var chk:MovieClip; var options = _arg1; var DEFAULTS:Object = {ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:0xFF8A00, background:16777161, outline:13994812, ad_started:function ():void{ this.clip.stop(); }, ad_finished:function ():void{ this.clip.play(); }}; options = MochiAd._parseOptions(options, DEFAULTS); clip = options.clip; var ad_msec:Number = 11000; var ad_timeout:Number = options.ad_timeout; delete options.ad_timeout; var fadeout_time:Number = options.fadeout_time; delete options.fadeout_time; if (!MochiAd.load(options)){ options.ad_finished(); return; }; options.ad_started(); mc = clip._mochiad; mc["onUnload"] = function ():void{ options.ad_finished(); }; var wh:Array = MochiAd._getRes(options, clip); var w:Number = wh[0]; var h:Number = wh[1]; mc.x = (w * 0.5); mc.y = (h * 0.5); chk = createEmptyMovieClip(mc, "_mochiad_wait", 3); chk.x = (w * -0.5); chk.y = (h * -0.5); var bar:MovieClip = createEmptyMovieClip(chk, "_mochiad_bar", 4); bar.x = 10; bar.y = (h - 20); var bar_color:Number = options.color; delete options.color; var bar_background:Number = options.background; delete options.background; var bar_outline:Number = options.outline; delete options.outline; var backing_mc:MovieClip = createEmptyMovieClip(bar, "_outline", 1); var backing:Object = backing_mc.graphics; backing.beginFill(bar_background); backing.moveTo(0, 0); backing.lineTo((w - 20), 0); backing.lineTo((w - 20), 10); backing.lineTo(0, 10); backing.lineTo(0, 0); backing.endFill(); var inside_mc:MovieClip = createEmptyMovieClip(bar, "_inside", 2); var inside:Object = inside_mc.graphics; inside.beginFill(bar_color); inside.moveTo(0, 0); inside.lineTo((w - 20), 0); inside.lineTo((w - 20), 10); inside.lineTo(0, 10); inside.lineTo(0, 0); inside.endFill(); inside_mc.scaleX = 0; var outline_mc:MovieClip = createEmptyMovieClip(bar, "_outline", 3); var outline:Object = outline_mc.graphics; outline.lineStyle(0, bar_outline, 100); outline.moveTo(0, 0); outline.lineTo((w - 20), 0); outline.lineTo((w - 20), 10); outline.lineTo(0, 10); outline.lineTo(0, 0); chk.ad_msec = ad_msec; chk.ad_timeout = ad_timeout; chk.started = getTimer(); chk.showing = false; chk.last_pcnt = 0; chk.fadeout_time = fadeout_time; chk.fadeFunction = function ():void{ var _local2:MovieClip; var _local1:Number = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time))); if (_local1 > 0){ this.parent.alpha = (_local1 * 0.01); } else { _local2 = this.parent.parent; MochiAd.unload(_local2); delete this["onEnterFrame"]; }; }; mc.unloadAd = function ():void{ MochiAd.unload(clip); }; mc.adjustProgress = function (_arg1:Number):void{ var _local2:Object = mc._mochiad_wait; _local2.server_control = true; _local2.started = getTimer(); _local2.ad_msec = _arg1; }; chk["onEnterFrame"] = function ():void{ var _local11:Number; var _local1:Object = this.parent.parent.root; if (!_local1){ delete this["onEnterFrame"]; return; }; var _local2:Object = this.parent._mochiad_ctr; var _local3:Number = (getTimer() - this.started); var _local4:Boolean; var _local5:Number = _local1.loaderInfo.bytesTotal; var _local6:Number = _local1.loaderInfo.bytesLoaded; var _local7:Number = ((100 * _local6) / _local5); var _local8:Number = ((100 * _local3) / chk.ad_msec); var _local9:Object = this._mochiad_bar._inside; var _local10:Number = Math.min(100, Math.min(((_local7) || (0)), _local8)); _local10 = Math.max(this.last_pcnt, _local10); this.last_pcnt = _local10; _local9.scaleX = (_local10 * 0.01); if (!chk.showing){ _local11 = _local2.loaderInfo.bytesTotal; if ((((_local11 > 0)) || (("number" == "undefined")))){ chk.showing = true; chk.started = getTimer(); } else { if (_local3 > chk.ad_timeout){ _local4 = true; }; }; }; if ((((_local3 > chk.ad_msec)) || (this.parent._mochiad_ctr_failed))){ _local4 = true; }; if ((((((_local5 > 0)) && ((_local6 >= _local5)))) && (_local4))){ if (this.server_control){ delete this.onEnterFrame; } else { this.fadeout_start = getTimer(); this.onEnterFrame = chk.fadeFunction; }; }; }; doOnEnterFrame(chk); } public static function fetchHighScores(_arg1:Object, _arg2:Object, _arg3:Object=null):Boolean{ var _local4:MovieClip = MochiAd._loadCommunicator({clip:_arg1.clip, id:_arg1.id}); if (!_local4){ return (false); }; _local4.doSend(["fetchHighScores", _arg1], _arg2, _arg3); return (true); } public static function doOnEnterFrame(_arg1:MovieClip):void{ var f:Function; var mc = _arg1; f = function (_arg1:Object):void{ if (((("onEnterFrame" in mc)) && (mc.onEnterFrame))){ mc.onEnterFrame(); } else { mc.removeEventListener(Event.ENTER_FRAME, f); }; }; mc.addEventListener(Event.ENTER_FRAME, f); } } }//package

Library Items

Symbol 1 GraphicUsed by:2
Symbol 2 MovieClip {GravityPods_GravityPodSkin} [GravityPodSkin]Uses:1
Symbol 3 Font {GravityPods_FFFHarmony} [GravityPods_FFFHarmony]
Symbol 4 GraphicUsed by:5
Symbol 5 MovieClipUses:4Used by:6 7 8
Symbol 6 MovieClip {GravityPods_RepellerSkin} [RepellerSkin]Uses:5
Symbol 7 MovieClipUses:5Used by:9
Symbol 8 MovieClipUses:5Used by:9
Symbol 9 MovieClip {com.bit101.gravitypods.Target_TargetSkin} [TargetSkin]Uses:7 8
Symbol 10 GraphicUsed by:11
Symbol 11 MovieClip {com.bit101.gravitypods.Projectile_ProjectileSkin} [ProjectileSkin01]Uses:10
Symbol 12 Sound {com.bit101.gravitypods.Sounds_Drop} [com.bit101.gravitypods.Sounds_Drop]
Symbol 13 Sound {com.bit101.gravitypods.Sounds_ProjectileWall} [com.bit101.gravitypods.Sounds_ProjectileWall]
Symbol 14 Sound {com.bit101.gravitypods.Sounds_Drag} [com.bit101.gravitypods.Sounds_Drag]
Symbol 15 Sound {com.bit101.gravitypods.Sounds_ProjectileShoot} [com.bit101.gravitypods.Sounds_ProjectileShoot]
Symbol 16 Sound {com.bit101.gravitypods.Sounds_ProjectileTarget} [com.bit101.gravitypods.Sounds_ProjectileTarget]
Symbol 17 Font

Special Tags

FileAttributes (69)Timeline Frame 1Access network only, Metadata present, AS3.
SWFMetaData (77)Timeline Frame 1459 bytes "<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'><rdf:Description rdf:about='' xmlns ..."
ScriptLimits (65)Timeline Frame 1MaxRecursionDepth: 1000, ScriptTimeout: 60 seconds
ExportAssets (56)Timeline Frame 1Symbol 2 as "GravityPodSkin"
ExportAssets (56)Timeline Frame 1Symbol 3 as "GravityPods_FFFHarmony"
ExportAssets (56)Timeline Frame 1Symbol 6 as "RepellerSkin"
ExportAssets (56)Timeline Frame 1Symbol 9 as "TargetSkin"
ExportAssets (56)Timeline Frame 1Symbol 11 as "ProjectileSkin01"
ExportAssets (56)Timeline Frame 1Symbol 12 as "com.bit101.gravitypods.Sounds_Drop"
ExportAssets (56)Timeline Frame 1Symbol 13 as "com.bit101.gravitypods.Sounds_ProjectileWall"
ExportAssets (56)Timeline Frame 1Symbol 14 as "com.bit101.gravitypods.Sounds_Drag"
ExportAssets (56)Timeline Frame 1Symbol 15 as "com.bit101.gravitypods.Sounds_ProjectileShoot"
ExportAssets (56)Timeline Frame 1Symbol 16 as "com.bit101.gravitypods.Sounds_ProjectileTarget"
SerialNumber (41)Timeline Frame 1

Labels

"GravityPods"Frame 1




http://swfchan.com/2/7967/info.shtml
Created: 11/6 -2019 22:11:23 Last modified: 11/6 -2019 22:11:23 Server time: 05/11 -2024 15:37:54