Section 1
//JSON (api.serialization.json.JSON)
package api.serialization.json {
public class JSON {
public function JSON(){
super();
}
public static function decode(s:String){
var decoder:JSONDecoder = new JSONDecoder(s);
return (decoder.getValue());
}
public static function encode(o:Object):String{
var encoder:JSONEncoder = new JSONEncoder(o);
return (encoder.getString());
}
}
}//package api.serialization.json
Section 2
//JSONDecoder (api.serialization.json.JSONDecoder)
package api.serialization.json {
public class JSONDecoder {
private var value;
private var tokenizer:JSONTokenizer;
private var token:JSONToken;
public function JSONDecoder(s:String){
super();
tokenizer = new JSONTokenizer(s);
nextToken();
value = parseValue();
}
private function parseObject():Object{
var key:String;
var o:Object = new Object();
nextToken();
if (token.type == JSONTokenType.RIGHT_BRACE){
return (o);
};
while (true) {
if (token.type == JSONTokenType.STRING){
key = String(token.value);
nextToken();
if (token.type == JSONTokenType.COLON){
nextToken();
o[key] = parseValue();
nextToken();
if (token.type == JSONTokenType.RIGHT_BRACE){
return (o);
};
if (token.type == JSONTokenType.COMMA){
nextToken();
} else {
tokenizer.parseError(("Expecting } or , but found " + token.value));
};
} else {
tokenizer.parseError(("Expecting : but found " + token.value));
};
} else {
tokenizer.parseError(("Expecting string but found " + token.value));
};
};
return (null);
}
private function parseValue():Object{
switch (token.type){
case JSONTokenType.LEFT_BRACE:
return (parseObject());
case JSONTokenType.LEFT_BRACKET:
return (parseArray());
case JSONTokenType.STRING:
case JSONTokenType.NUMBER:
case JSONTokenType.TRUE:
case JSONTokenType.FALSE:
case JSONTokenType.NULL:
return (token.value);
default:
tokenizer.parseError(("Unexpected " + token.value));
};
return (null);
}
private function nextToken():JSONToken{
return ((token = tokenizer.getNextToken()));
}
public function getValue(){
return (value);
}
private function parseArray():Array{
var a:Array = new Array();
nextToken();
if (token.type == JSONTokenType.RIGHT_BRACKET){
return (a);
};
while (true) {
a.push(parseValue());
nextToken();
if (token.type == JSONTokenType.RIGHT_BRACKET){
return (a);
};
if (token.type == JSONTokenType.COMMA){
nextToken();
} else {
tokenizer.parseError(("Expecting ] or , but found " + token.value));
};
};
return (null);
}
}
}//package api.serialization.json
Section 3
//JSONEncoder (api.serialization.json.JSONEncoder)
package api.serialization.json {
import flash.utils.*;
public class JSONEncoder {
private var jsonString:String;
public function JSONEncoder(value){
super();
jsonString = convertToString(value);
}
private function escapeString(str:String):String{
var ch:String;
var hexCode:String;
var zeroPad:String;
var s:String = "";
var len:Number = str.length;
var i:int;
while (i < len) {
ch = str.charAt(i);
switch (ch){
case "\"":
s = (s + "\\\"");
break;
case "\\":
s = (s + "\\\\");
break;
case "\b":
s = (s + "\\b");
break;
case "\f":
s = (s + "\\f");
break;
case "\n":
s = (s + "\\n");
break;
case "\r":
s = (s + "\\r");
break;
case "\t":
s = (s + "\\t");
break;
default:
if (ch < " "){
hexCode = ch.charCodeAt(0).toString(16);
zeroPad = ((hexCode.length == 2)) ? "00" : "000";
s = (s + (("\\u" + zeroPad) + hexCode));
} else {
s = (s + ch);
};
};
i++;
};
return ((("\"" + s) + "\""));
}
private function arrayToString(a:Array):String{
var s:String = "";
var i:int;
while (i < a.length) {
if (s.length > 0){
s = (s + ",");
};
s = (s + convertToString(a[i]));
i++;
};
return ((("[" + s) + "]"));
}
public function getString():String{
return (jsonString);
}
private function objectToString(o:Object):String{
var value:Object;
var key:String;
var v:XML;
var o = o;
var s = "";
var classInfo:XML = describeType(o);
if (classInfo.@name.toString() == "Object"){
for (key in o) {
value = o[key];
if ((value is Function)){
} else {
if (s.length > 0){
s = (s + ",");
};
s = (s + ((escapeString(key) + ":") + convertToString(value)));
};
};
} else {
for each (v in classInfo..*.(((name() == "variable")) || ((name() == "accessor")))) {
if (s.length > 0){
s = (s + ",");
};
s = (s + ((escapeString(v.@name.toString()) + ":") + convertToString(o[v.@name])));
};
};
return ((("{" + s) + "}"));
}
private function convertToString(value):String{
if ((value is String)){
return (escapeString((value as String)));
};
if ((value is Number)){
return ((isFinite((value as Number))) ? value.toString() : "null");
} else {
if ((value is Boolean)){
return ((value) ? "true" : "false");
} else {
if ((value is Array)){
return (arrayToString((value as Array)));
};
if ((((value is Object)) && (!((value == null))))){
return (objectToString(value));
};
};
};
return ("null");
}
}
}//package api.serialization.json
Section 4
//JSONParseError (api.serialization.json.JSONParseError)
package api.serialization.json {
public class JSONParseError extends Error {
private var _location:int;
private var _text:String;
public function JSONParseError(message:String="", location:int=0, text:String=""){
super(message);
_location = location;
_text = text;
}
public function get location():int{
return (_location);
}
public function get text():String{
return (_text);
}
}
}//package api.serialization.json
Section 5
//JSONToken (api.serialization.json.JSONToken)
package api.serialization.json {
public class JSONToken {
private var _value:Object;
private var _type:int;
public function JSONToken(type:int=-1, value:Object=null){
super();
_type = type;
_value = value;
}
public function get value():Object{
return (_value);
}
public function get type():int{
return (_type);
}
public function set type(value:int):void{
_type = value;
}
public function set value(v:Object):void{
_value = v;
}
}
}//package api.serialization.json
Section 6
//JSONTokenizer (api.serialization.json.JSONTokenizer)
package api.serialization.json {
public class JSONTokenizer {
private var loc:int;
private var ch:String;
private var obj:Object;
private var jsonString:String;
public function JSONTokenizer(s:String){
super();
jsonString = s;
loc = 0;
nextChar();
}
private function skipComments():void{
if (ch == "/"){
nextChar();
switch (ch){
case "/":
do {
nextChar();
} while (((!((ch == "\n"))) && (!((ch == "")))));
nextChar();
break;
case "*":
nextChar();
while (true) {
if (ch == "*"){
nextChar();
if (ch == "/"){
nextChar();
break;
};
} else {
nextChar();
};
if (ch == ""){
parseError("Multi-line comment not closed");
};
};
break;
default:
parseError((("Unexpected " + ch) + " encountered (expecting '/' or '*' )"));
};
};
}
private function isDigit(ch:String):Boolean{
return ((((ch >= "0")) && ((ch <= "9"))));
}
private function readString():JSONToken{
var _local5:String;
var i:int;
var token:JSONToken = new JSONToken();
token.type = JSONTokenType.STRING;
var string:String = "";
nextChar();
while (((!((ch == "\""))) && (!((ch == ""))))) {
if (ch == "\\"){
nextChar();
switch (ch){
case "\"":
string = (string + "\"");
break;
case "/":
string = (string + "/");
break;
case "\\":
string = (string + "\\");
break;
case "b":
string = (string + "\b");
break;
case "f":
string = (string + "\f");
break;
case "n":
string = (string + "\n");
break;
case "r":
string = (string + "\r");
break;
case "t":
string = (string + "\t");
break;
case "u":
_local5 = "";
i = 0;
while (i < 4) {
if (!isHexDigit(nextChar())){
parseError((" Excepted a hex digit, but found: " + ch));
};
_local5 = (_local5 + ch);
i++;
};
string = (string + String.fromCharCode(parseInt(_local5, 16)));
break;
default:
string = (string + ("\\" + ch));
};
} else {
string = (string + ch);
};
nextChar();
};
if (ch == ""){
parseError("Unterminated string literal");
};
nextChar();
token.value = string;
return (token);
}
private function nextChar():String{
return ((ch = jsonString.charAt(loc++)));
}
public function getNextToken():JSONToken{
var _local2:String;
var _local3:String;
var _local4:String;
var token:JSONToken = new JSONToken();
skipIgnored();
switch (ch){
case "{":
token.type = JSONTokenType.LEFT_BRACE;
token.value = "{";
nextChar();
break;
case "}":
token.type = JSONTokenType.RIGHT_BRACE;
token.value = "}";
nextChar();
break;
case "[":
token.type = JSONTokenType.LEFT_BRACKET;
token.value = "[";
nextChar();
break;
case "]":
token.type = JSONTokenType.RIGHT_BRACKET;
token.value = "]";
nextChar();
break;
case ",":
token.type = JSONTokenType.COMMA;
token.value = ",";
nextChar();
break;
case ":":
token.type = JSONTokenType.COLON;
token.value = ":";
nextChar();
break;
case "t":
_local2 = ((("t" + nextChar()) + nextChar()) + nextChar());
if (_local2 == "true"){
token.type = JSONTokenType.TRUE;
token.value = true;
nextChar();
} else {
parseError(("Expecting 'true' but found " + _local2));
};
break;
case "f":
_local3 = (((("f" + nextChar()) + nextChar()) + nextChar()) + nextChar());
if (_local3 == "false"){
token.type = JSONTokenType.FALSE;
token.value = false;
nextChar();
} else {
parseError(("Expecting 'false' but found " + _local3));
};
break;
case "n":
_local4 = ((("n" + nextChar()) + nextChar()) + nextChar());
if (_local4 == "null"){
token.type = JSONTokenType.NULL;
token.value = null;
nextChar();
} else {
parseError(("Expecting 'null' but found " + _local4));
};
break;
case "\"":
token = readString();
break;
default:
if (((isDigit(ch)) || ((ch == "-")))){
token = readNumber();
} else {
if (ch == ""){
return (null);
};
parseError((("Unexpected " + ch) + " encountered"));
};
};
return (token);
}
private function skipWhite():void{
while (isWhiteSpace(ch)) {
nextChar();
};
}
public function parseError(message:String):void{
throw (new JSONParseError(message, loc, jsonString));
}
private function isWhiteSpace(ch:String):Boolean{
return ((((((ch == " ")) || ((ch == "\t")))) || ((ch == "\n"))));
}
private function skipIgnored():void{
skipWhite();
skipComments();
skipWhite();
}
private function isHexDigit(ch:String):Boolean{
var uc:String = ch.toUpperCase();
return (((isDigit(ch)) || ((((uc >= "A")) && ((uc <= "F"))))));
}
private function readNumber():JSONToken{
var token:JSONToken = new JSONToken();
token.type = JSONTokenType.NUMBER;
var input:String = "";
if (ch == "-"){
input = (input + "-");
nextChar();
};
if (!isDigit(ch)){
parseError("Expecting a digit");
};
if (ch == "0"){
input = (input + ch);
nextChar();
if (isDigit(ch)){
parseError("A digit cannot immediately follow 0");
};
} else {
while (isDigit(ch)) {
input = (input + ch);
nextChar();
};
};
if (ch == "."){
input = (input + ".");
nextChar();
if (!isDigit(ch)){
parseError("Expecting a digit");
};
while (isDigit(ch)) {
input = (input + ch);
nextChar();
};
};
if ((((ch == "e")) || ((ch == "E")))){
input = (input + "e");
nextChar();
if ((((ch == "+")) || ((ch == "-")))){
input = (input + ch);
nextChar();
};
if (!isDigit(ch)){
parseError("Scientific notation number needs exponent value");
};
while (isDigit(ch)) {
input = (input + ch);
nextChar();
};
};
var num:Number = Number(input);
if (((isFinite(num)) && (!(isNaN(num))))){
token.value = num;
return (token);
};
parseError((("Number " + num) + " is not valid!"));
return (null);
}
}
}//package api.serialization.json
Section 7
//JSONTokenType (api.serialization.json.JSONTokenType)
package api.serialization.json {
public class JSONTokenType {
public static const NUMBER:int = 11;
public static const FALSE:int = 8;
public static const RIGHT_BRACKET:int = 4;
public static const NULL:int = 9;
public static const TRUE:int = 7;
public static const RIGHT_BRACE:int = 2;
public static const UNKNOWN:int = -1;
public static const COMMA:int = 0;
public static const LEFT_BRACKET:int = 3;
public static const STRING:int = 10;
public static const LEFT_BRACE:int = 1;
public static const COLON:int = 6;
public function JSONTokenType(){
super();
}
}
}//package api.serialization.json
Section 8
//DebugProtocol (com.darkonline.DebugProtocol)
package com.darkonline {
public class DebugProtocol {
public static var LC_NAME:String = "LOCAL_DEBUG_CONNECTION";
public static var W:Number = 640;
public static var H:Number = 480;
public function DebugProtocol(){
super();
}
}
}//package com.darkonline
Section 9
//PropTween (com.greensock.core.PropTween)
package com.greensock.core {
public class PropTween {
public var priority:int;
public var start:Number;
public var prevNode:PropTween;
public var change:Number;
public var target:Object;
public var name:String;
public var property:String;
public var nextNode:PropTween;
public var isPlugin:Boolean;
public function PropTween(target:Object, property:String, start:Number, change:Number, name:String, isPlugin:Boolean, nextNode:PropTween=null, priority:int=0){
super();
this.target = target;
this.property = property;
this.start = start;
this.change = change;
this.name = name;
this.isPlugin = isPlugin;
if (nextNode){
nextNode.prevNode = this;
this.nextNode = nextNode;
};
this.priority = priority;
}
}
}//package com.greensock.core
Section 10
//SimpleTimeline (com.greensock.core.SimpleTimeline)
package com.greensock.core {
public class SimpleTimeline extends TweenCore {
public var autoRemoveChildren:Boolean;
protected var _lastChild:TweenCore;
protected var _firstChild:TweenCore;
public function SimpleTimeline(vars:Object=null){
super(0, vars);
}
override public function renderTime(time:Number, suppressEvents:Boolean=false, force:Boolean=false):void{
var dur:Number;
var next:TweenCore;
var tween:TweenCore = _firstChild;
this.cachedTotalTime = time;
this.cachedTime = time;
while (tween) {
next = tween.nextNode;
if (((tween.active) || ((((((time >= tween.cachedStartTime)) && (!(tween.cachedPaused)))) && (!(tween.gc)))))){
if (!tween.cachedReversed){
tween.renderTime(((time - tween.cachedStartTime) * tween.cachedTimeScale), suppressEvents, false);
} else {
dur = (tween.cacheIsDirty) ? tween.totalDuration : tween.cachedTotalDuration;
tween.renderTime((dur - ((time - tween.cachedStartTime) * tween.cachedTimeScale)), suppressEvents, false);
};
};
tween = next;
};
}
public function addChild(tween:TweenCore):void{
if (((!(tween.cachedOrphan)) && (tween.timeline))){
tween.timeline.remove(tween, true);
};
tween.timeline = this;
if (tween.gc){
tween.setEnabled(true, true);
};
if (_firstChild){
_firstChild.prevNode = tween;
};
tween.nextNode = _firstChild;
_firstChild = tween;
tween.prevNode = null;
tween.cachedOrphan = false;
}
public function remove(tween:TweenCore, skipDisable:Boolean=false):void{
if (tween.cachedOrphan){
return;
};
if (!skipDisable){
tween.setEnabled(false, true);
};
if (tween.nextNode){
tween.nextNode.prevNode = tween.prevNode;
} else {
if (_lastChild == tween){
_lastChild = tween.prevNode;
};
};
if (tween.prevNode){
tween.prevNode.nextNode = tween.nextNode;
} else {
if (_firstChild == tween){
_firstChild = tween.nextNode;
};
};
tween.cachedOrphan = true;
}
public function get rawTime():Number{
return (this.cachedTotalTime);
}
}
}//package com.greensock.core
Section 11
//TweenCore (com.greensock.core.TweenCore)
package com.greensock.core {
import com.greensock.*;
public class TweenCore {
public var initted:Boolean;
protected var _hasUpdate:Boolean;
public var active:Boolean;
protected var _delay:Number;
public var cachedTime:Number;
public var cachedReversed:Boolean;
public var nextNode:TweenCore;
protected var _rawPrevTime:Number;// = -1
public var vars:Object;
public var cachedTotalTime:Number;
public var data;
public var timeline:SimpleTimeline;
public var cachedOrphan:Boolean;
public var cachedStartTime:Number;
public var prevNode:TweenCore;
public var cachedDuration:Number;
public var gc:Boolean;
protected var _pauseTime:Number;
public var cacheIsDirty:Boolean;
public var cachedPaused:Boolean;
public var cachedTimeScale:Number;
public var cachedTotalDuration:Number;
public static const version:Number = 1.382;
protected static var _classInitted:Boolean;
public function TweenCore(duration:Number=0, vars:Object=null){
super();
this.vars = ((vars)!=null) ? vars : {};
this.cachedDuration = (this.cachedTotalDuration = duration);
_delay = (this.vars.delay) ? Number(this.vars.delay) : 0;
this.cachedTimeScale = (this.vars.timeScale) ? Number(this.vars.timeScale) : 1;
this.active = Boolean((((((duration == 0)) && ((_delay == 0)))) && (!((this.vars.immediateRender == false)))));
this.cachedTotalTime = (this.cachedTime = 0);
this.data = this.vars.data;
if (!_classInitted){
if (isNaN(TweenLite.rootFrame)){
TweenLite.initClass();
_classInitted = true;
} else {
return;
};
};
var tl:SimpleTimeline = ((this.vars.timeline is SimpleTimeline)) ? this.vars.timeline : (this.vars.useFrames) ? TweenLite.rootFramesTimeline : TweenLite.rootTimeline;
this.cachedStartTime = (tl.cachedTotalTime + _delay);
tl.addChild(this);
if (this.vars.reversed){
this.cachedReversed = true;
};
if (this.vars.paused){
this.paused = true;
};
}
public function renderTime(time:Number, suppressEvents:Boolean=false, force:Boolean=false):void{
}
public function get delay():Number{
return (_delay);
}
public function restart(includeDelay:Boolean=false, suppressEvents:Boolean=true):void{
this.reversed = false;
this.paused = false;
this.setTotalTime((includeDelay) ? -(_delay) : 0, suppressEvents);
}
public function get duration():Number{
return (this.cachedDuration);
}
public function set reversed(b:Boolean):void{
if (b != this.cachedReversed){
this.cachedReversed = b;
setTotalTime(this.cachedTotalTime, true);
};
}
public function set startTime(n:Number):void{
var adjust:Boolean = Boolean(((!((this.timeline == null))) && (((!((n == this.cachedStartTime))) || (this.gc)))));
this.cachedStartTime = n;
if (adjust){
this.timeline.addChild(this);
};
}
public function set delay(n:Number):void{
this.startTime = (this.startTime + (n - _delay));
_delay = n;
}
public function resume():void{
this.paused = false;
}
public function get paused():Boolean{
return (this.cachedPaused);
}
public function play():void{
this.reversed = false;
this.paused = false;
}
public function set duration(n:Number):void{
this.cachedDuration = (this.cachedTotalDuration = n);
setDirtyCache(false);
}
public function invalidate():void{
}
public function complete(skipRender:Boolean=false, suppressEvents:Boolean=false):void{
if (!skipRender){
renderTime(this.totalDuration, suppressEvents, false);
return;
};
if (this.timeline.autoRemoveChildren){
this.setEnabled(false, false);
} else {
this.active = false;
};
if (!suppressEvents){
if (((((this.vars.onComplete) && ((this.cachedTotalTime == this.cachedTotalDuration)))) && (!(this.cachedReversed)))){
this.vars.onComplete.apply(null, this.vars.onCompleteParams);
} else {
if (((((this.cachedReversed) && ((this.cachedTotalTime == 0)))) && (this.vars.onReverseComplete))){
this.vars.onReverseComplete.apply(null, this.vars.onReverseCompleteParams);
};
};
};
}
public function get reversed():Boolean{
return (this.cachedReversed);
}
public function get totalTime():Number{
return (this.cachedTotalTime);
}
public function get startTime():Number{
return (this.cachedStartTime);
}
public function set currentTime(n:Number):void{
setTotalTime(n, false);
}
protected function setDirtyCache(includeSelf:Boolean=true):void{
var tween:TweenCore = (includeSelf) ? this : this.timeline;
while (tween) {
tween.cacheIsDirty = true;
tween = tween.timeline;
};
}
public function reverse(forceResume:Boolean=true):void{
this.reversed = true;
if (forceResume){
this.paused = false;
} else {
if (this.gc){
this.setEnabled(true, false);
};
};
}
public function set paused(b:Boolean):void{
if (((!((b == this.cachedPaused))) && (this.timeline))){
if (b){
_pauseTime = this.timeline.rawTime;
} else {
this.cachedStartTime = (this.cachedStartTime + (this.timeline.rawTime - _pauseTime));
_pauseTime = NaN;
setDirtyCache(false);
};
this.cachedPaused = b;
this.active = Boolean(((((!(this.cachedPaused)) && ((this.cachedTotalTime > 0)))) && ((this.cachedTotalTime < this.cachedTotalDuration))));
};
if (((!(b)) && (this.gc))){
this.setTotalTime(this.cachedTotalTime, false);
this.setEnabled(true, false);
};
}
public function kill():void{
setEnabled(false, false);
}
public function set totalTime(n:Number):void{
setTotalTime(n, false);
}
public function get currentTime():Number{
return (this.cachedTime);
}
protected function setTotalTime(time:Number, suppressEvents:Boolean=false):void{
var tlTime:Number;
var dur:Number;
if (this.timeline){
tlTime = (((_pauseTime) || ((_pauseTime == 0)))) ? _pauseTime : this.timeline.cachedTotalTime;
if (this.cachedReversed){
dur = (this.cacheIsDirty) ? this.totalDuration : this.cachedTotalDuration;
this.cachedStartTime = (tlTime - ((dur - time) / this.cachedTimeScale));
} else {
this.cachedStartTime = (tlTime - (time / this.cachedTimeScale));
};
if (!this.timeline.cacheIsDirty){
setDirtyCache(false);
};
if (this.cachedTotalTime != time){
renderTime(time, suppressEvents, false);
};
};
}
public function pause():void{
this.paused = true;
}
public function set totalDuration(n:Number):void{
this.duration = n;
}
public function get totalDuration():Number{
return (this.cachedTotalDuration);
}
public function setEnabled(enabled:Boolean, ignoreTimeline:Boolean=false):Boolean{
this.gc = !(enabled);
if (enabled){
this.active = Boolean(((((!(this.cachedPaused)) && ((this.cachedTotalTime > 0)))) && ((this.cachedTotalTime < this.cachedTotalDuration))));
if (((!(ignoreTimeline)) && (this.cachedOrphan))){
this.timeline.addChild(this);
};
} else {
this.active = false;
if (((!(ignoreTimeline)) && (!(this.cachedOrphan)))){
this.timeline.remove(this, true);
};
};
return (false);
}
}
}//package com.greensock.core
Section 12
//Cubic (com.greensock.easing.Cubic)
package com.greensock.easing {
public class Cubic {
public static const power:uint = 2;
public function Cubic(){
super();
}
public static function easeOut(t:Number, b:Number, c:Number, d:Number):Number{
t = ((t / d) - 1);
return (((c * (((t * t) * t) + 1)) + b));
}
public static function easeIn(t:Number, b:Number, c:Number, d:Number):Number{
t = (t / d);
return (((((c * t) * t) * t) + b));
}
public static function easeInOut(t:Number, b:Number, c:Number, d:Number):Number{
t = (t / (d * 0.5));
if (t < 1){
return ((((((c * 0.5) * t) * t) * t) + b));
};
t = (t - 2);
return ((((c * 0.5) * (((t * t) * t) + 2)) + b));
}
}
}//package com.greensock.easing
Section 13
//Expo (com.greensock.easing.Expo)
package com.greensock.easing {
public class Expo {
public function Expo(){
super();
}
public static function easeOut(t:Number, b:Number, c:Number, d:Number):Number{
return (((t)==d) ? (b + c) : ((c * (-(Math.pow(2, ((-10 * t) / d))) + 1)) + b));
}
public static function easeIn(t:Number, b:Number, c:Number, d:Number):Number{
return (((t)==0) ? b : (((c * Math.pow(2, (10 * ((t / d) - 1)))) + b) - (c * 0.001)));
}
public static function easeInOut(t:Number, b:Number, c:Number, d:Number):Number{
if (t == 0){
return (b);
};
if (t == d){
return ((b + c));
};
t = (t / (d * 0.5));
if (t < 1){
return ((((c * 0.5) * Math.pow(2, (10 * (t - 1)))) + b));
};
--t;
return ((((c * 0.5) * (-(Math.pow(2, (-10 * t))) + 2)) + b));
}
}
}//package com.greensock.easing
Section 14
//Linear (com.greensock.easing.Linear)
package com.greensock.easing {
public class Linear {
public static const power:uint = 0;
public function Linear(){
super();
}
public static function easeOut(t:Number, b:Number, c:Number, d:Number):Number{
return ((((c * t) / d) + b));
}
public static function easeIn(t:Number, b:Number, c:Number, d:Number):Number{
return ((((c * t) / d) + b));
}
public static function easeNone(t:Number, b:Number, c:Number, d:Number):Number{
return ((((c * t) / d) + b));
}
public static function easeInOut(t:Number, b:Number, c:Number, d:Number):Number{
return ((((c * t) / d) + b));
}
}
}//package com.greensock.easing
Section 15
//Quad (com.greensock.easing.Quad)
package com.greensock.easing {
public class Quad {
public static const power:uint = 1;
public function Quad(){
super();
}
public static function easeOut(t:Number, b:Number, c:Number, d:Number):Number{
t = (t / d);
return ((((-(c) * t) * (t - 2)) + b));
}
public static function easeIn(t:Number, b:Number, c:Number, d:Number):Number{
t = (t / d);
return ((((c * t) * t) + b));
}
public static function easeInOut(t:Number, b:Number, c:Number, d:Number):Number{
t = (t / (d * 0.5));
if (t < 1){
return (((((c * 0.5) * t) * t) + b));
};
--t;
return ((((-(c) * 0.5) * ((t * (t - 2)) - 1)) + b));
}
}
}//package com.greensock.easing
Section 16
//TweenEvent (com.greensock.events.TweenEvent)
package com.greensock.events {
import flash.events.*;
public class TweenEvent extends Event {
public static const COMPLETE:String = "complete";
public static const START:String = "start";
public static const UPDATE:String = "change";
public static const REVERSE_COMPLETE:String = "reverseComplete";
public static const INIT:String = "init";
public static const VERSION:Number = 1.1;
public static const REPEAT:String = "repeat";
public function TweenEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false){
super(type, bubbles, cancelable);
}
override public function clone():Event{
return (new TweenEvent(this.type, this.bubbles, this.cancelable));
}
}
}//package com.greensock.events
Section 17
//AutoAlphaPlugin (com.greensock.plugins.AutoAlphaPlugin)
package com.greensock.plugins {
import flash.display.*;
import com.greensock.*;
public class AutoAlphaPlugin extends TweenPlugin {
protected var _target:Object;
protected var _ignoreVisible:Boolean;
public static const API:Number = 1;
public function AutoAlphaPlugin(){
super();
this.propName = "autoAlpha";
this.overwriteProps = ["alpha", "visible"];
}
override public function killProps(lookup:Object):void{
super.killProps(lookup);
_ignoreVisible = Boolean(("visible" in lookup));
}
override public function onInitTween(target:Object, value, tween:TweenLite):Boolean{
_target = target;
addTween(target, "alpha", target.alpha, value, "alpha");
return (true);
}
override public function set changeFactor(n:Number):void{
updateTweens(n);
if (!_ignoreVisible){
_target.visible = Boolean(!((_target.alpha == 0)));
};
}
}
}//package com.greensock.plugins
Section 18
//BevelFilterPlugin (com.greensock.plugins.BevelFilterPlugin)
package com.greensock.plugins {
import flash.display.*;
import com.greensock.*;
import flash.filters.*;
public class BevelFilterPlugin extends FilterPlugin {
public static const API:Number = 1;
private static var _propNames:Array = ["distance", "angle", "highlightColor", "highlightAlpha", "shadowColor", "shadowAlpha", "blurX", "blurY", "strength", "quality"];
public function BevelFilterPlugin(){
super();
this.propName = "bevelFilter";
this.overwriteProps = ["bevelFilter"];
}
override public function onInitTween(target:Object, value, tween:TweenLite):Boolean{
_target = target;
_type = BevelFilter;
initFilter(value, new BevelFilter(0, 0, 0xFFFFFF, 0.5, 0, 0.5, 2, 2, 0, ((value.quality) || (2))), _propNames);
return (true);
}
}
}//package com.greensock.plugins
Section 19
//BezierPlugin (com.greensock.plugins.BezierPlugin)
package com.greensock.plugins {
import com.greensock.*;
import com.greensock.core.*;
public class BezierPlugin extends TweenPlugin {
protected var _future:Object;
protected var _orient:Boolean;
protected var _orientData:Array;
protected var _target:Object;
protected var _beziers:Object;
public static const API:Number = 1;
protected static const _RAD2DEG:Number = 57.2957795130823;
public function BezierPlugin(){
_future = {};
super();
this.propName = "bezier";
this.overwriteProps = [];
}
override public function killProps(lookup:Object):void{
var p:String;
for (p in _beziers) {
if ((p in lookup)){
delete _beziers[p];
};
};
super.killProps(lookup);
}
protected function init(tween:TweenLite, beziers:Array, through:Boolean):void{
var i:int;
var p:String;
var killVarsLookup:Object;
_target = tween.target;
var enumerables:Object = ((tween.vars.isTV)==true) ? tween.vars.exposedVars : tween.vars;
if (enumerables.orientToBezier == true){
_orientData = [["x", "y", "rotation", 0, 0.01]];
_orient = true;
} else {
if ((enumerables.orientToBezier is Array)){
_orientData = enumerables.orientToBezier;
_orient = true;
};
};
var props:Object = {};
i = 0;
while (i < beziers.length) {
for (p in beziers[i]) {
if (props[p] == undefined){
props[p] = [tween.target[p]];
};
if (typeof(beziers[i][p]) == "number"){
props[p].push(beziers[i][p]);
} else {
props[p].push((tween.target[p] + Number(beziers[i][p])));
};
};
i++;
};
for (p in props) {
this.overwriteProps[this.overwriteProps.length] = p;
if (enumerables[p] != undefined){
if (typeof(enumerables[p]) == "number"){
props[p].push(enumerables[p]);
} else {
props[p].push((tween.target[p] + Number(enumerables[p])));
};
killVarsLookup = {};
killVarsLookup[p] = true;
tween.killVars(killVarsLookup, false);
delete enumerables[p];
};
};
_beziers = parseBeziers(props, through);
}
override public function onInitTween(target:Object, value, tween:TweenLite):Boolean{
if (!(value is Array)){
return (false);
};
init(tween, (value as Array), false);
return (true);
}
override public function set changeFactor(n:Number):void{
var i:int;
var p:String;
var b:Object;
var t:Number;
var segments:uint;
var val:Number;
var curVals:Object;
var dx:Number;
var dy:Number;
var cotb:Array;
var toAdd:Number;
var oldTarget:Object;
var oldRound:Boolean;
if (n == 1){
for (p in _beziers) {
i = (_beziers[p].length - 1);
_target[p] = _beziers[p][i][2];
};
} else {
for (p in _beziers) {
segments = _beziers[p].length;
if (n < 0){
i = 0;
} else {
if (n >= 1){
i = (segments - 1);
} else {
i = int((segments * n));
};
};
t = ((n - (i * (1 / segments))) * segments);
b = _beziers[p][i];
if (this.round){
val = (b[0] + (t * (((2 * (1 - t)) * (b[1] - b[0])) + (t * (b[2] - b[0])))));
_target[p] = ((val)>0) ? int((val + 0.5)) : int((val - 0.5));
} else {
_target[p] = (b[0] + (t * (((2 * (1 - t)) * (b[1] - b[0])) + (t * (b[2] - b[0])))));
};
};
};
if (_orient){
i = _orientData.length;
curVals = {};
while (i--) {
cotb = _orientData[i];
curVals[cotb[0]] = _target[cotb[0]];
curVals[cotb[1]] = _target[cotb[1]];
};
oldTarget = _target;
oldRound = this.round;
_target = _future;
this.round = false;
_orient = false;
i = _orientData.length;
while (i--) {
cotb = _orientData[i];
this.changeFactor = (n + ((cotb[4]) || (0.01)));
toAdd = ((cotb[3]) || (0));
dx = (_future[cotb[0]] - curVals[cotb[0]]);
dy = (_future[cotb[1]] - curVals[cotb[1]]);
oldTarget[cotb[2]] = ((Math.atan2(dy, dx) * _RAD2DEG) + toAdd);
};
_target = oldTarget;
this.round = oldRound;
_orient = true;
};
}
public static function parseBeziers(props:Object, through:Boolean=false):Object{
var i:int;
var a:Array;
var b:Object;
var p:String;
var all:Object = {};
if (through){
for (p in props) {
a = props[p];
b = [];
all[p] = b;
if (a.length > 2){
b[b.length] = [a[0], (a[1] - ((a[2] - a[0]) / 4)), a[1]];
i = 1;
while (i < (a.length - 1)) {
b[b.length] = [a[i], (a[i] + (a[i] - b[(i - 1)][1])), a[(i + 1)]];
i++;
};
} else {
b[b.length] = [a[0], ((a[0] + a[1]) / 2), a[1]];
};
};
} else {
for (p in props) {
a = props[p];
b = [];
all[p] = b;
if (a.length > 3){
b[b.length] = [a[0], a[1], ((a[1] + a[2]) / 2)];
i = 2;
while (i < (a.length - 2)) {
b[b.length] = [b[(i - 2)][2], a[i], ((a[i] + a[(i + 1)]) / 2)];
i++;
};
b[b.length] = [b[(b.length - 1)][2], a[(a.length - 2)], a[(a.length - 1)]];
} else {
if (a.length == 3){
b[b.length] = [a[0], a[1], a[2]];
} else {
if (a.length == 2){
b[b.length] = [a[0], ((a[0] + a[1]) / 2), a[1]];
};
};
};
};
};
return (all);
}
}
}//package com.greensock.plugins
Section 20
//BezierThroughPlugin (com.greensock.plugins.BezierThroughPlugin)
package com.greensock.plugins {
import com.greensock.*;
public class BezierThroughPlugin extends BezierPlugin {
public static const API:Number = 1;
public function BezierThroughPlugin(){
super();
this.propName = "bezierThrough";
}
override public function onInitTween(target:Object, value, tween:TweenLite):Boolean{
if (!(value is Array)){
return (false);
};
init(tween, (value as Array), true);
return (true);
}
}
}//package com.greensock.plugins
Section 21
//BlurFilterPlugin (com.greensock.plugins.BlurFilterPlugin)
package com.greensock.plugins {
import flash.display.*;
import com.greensock.*;
import flash.filters.*;
public class BlurFilterPlugin extends FilterPlugin {
public static const API:Number = 1;
private static var _propNames:Array = ["blurX", "blurY", "quality"];
public function BlurFilterPlugin(){
super();
this.propName = "blurFilter";
this.overwriteProps = ["blurFilter"];
}
override public function onInitTween(target:Object, value, tween:TweenLite):Boolean{
_target = target;
_type = BlurFilter;
initFilter(value, new BlurFilter(0, 0, ((value.quality) || (2))), _propNames);
return (true);
}
}
}//package com.greensock.plugins
Section 22
//ColorMatrixFilterPlugin (com.greensock.plugins.ColorMatrixFilterPlugin)
package com.greensock.plugins {
import flash.display.*;
import com.greensock.*;
import flash.filters.*;
public class ColorMatrixFilterPlugin extends FilterPlugin {
protected var _matrix:Array;
protected var _matrixTween:EndArrayPlugin;
public static const API:Number = 1;
private static var _propNames:Array = [];
protected static var _lumG:Number = 0.71516;
protected static var _lumR:Number = 0.212671;
protected static var _idMatrix:Array = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0];
protected static var _lumB:Number = 0.072169;
public function ColorMatrixFilterPlugin(){
super();
this.propName = "colorMatrixFilter";
this.overwriteProps = ["colorMatrixFilter"];
}
override public function onInitTween(target:Object, value, tween:TweenLite):Boolean{
_target = target;
_type = ColorMatrixFilter;
var cmf:Object = value;
initFilter({remove:value.remove, index:value.index, addFilter:value.addFilter}, new ColorMatrixFilter(_idMatrix.slice()), _propNames);
_matrix = ColorMatrixFilter(_filter).matrix;
var endMatrix:Array = [];
if (((!((cmf.matrix == null))) && ((cmf.matrix is Array)))){
endMatrix = cmf.matrix;
} else {
if (cmf.relative == true){
endMatrix = _matrix.slice();
} else {
endMatrix = _idMatrix.slice();
};
endMatrix = setBrightness(endMatrix, cmf.brightness);
endMatrix = setContrast(endMatrix, cmf.contrast);
endMatrix = setHue(endMatrix, cmf.hue);
endMatrix = setSaturation(endMatrix, cmf.saturation);
endMatrix = setThreshold(endMatrix, cmf.threshold);
if (!isNaN(cmf.colorize)){
endMatrix = colorize(endMatrix, cmf.colorize, cmf.amount);
};
};
_matrixTween = new EndArrayPlugin();
_matrixTween.init(_matrix, endMatrix);
return (true);
}
override public function set changeFactor(n:Number):void{
_matrixTween.changeFactor = n;
ColorMatrixFilter(_filter).matrix = _matrix;
super.changeFactor = n;
}
public static function setSaturation(m:Array, n:Number):Array{
if (isNaN(n)){
return (m);
};
var inv:Number = (1 - n);
var r:Number = (inv * _lumR);
var g:Number = (inv * _lumG);
var b:Number = (inv * _lumB);
var temp:Array = [(r + n), g, b, 0, 0, r, (g + n), b, 0, 0, r, g, (b + n), 0, 0, 0, 0, 0, 1, 0];
return (applyMatrix(temp, m));
}
public static function setHue(m:Array, n:Number):Array{
if (isNaN(n)){
return (m);
};
n = (n * (Math.PI / 180));
var c:Number = Math.cos(n);
var s:Number = Math.sin(n);
var temp:Array = [((_lumR + (c * (1 - _lumR))) + (s * -(_lumR))), ((_lumG + (c * -(_lumG))) + (s * -(_lumG))), ((_lumB + (c * -(_lumB))) + (s * (1 - _lumB))), 0, 0, ((_lumR + (c * -(_lumR))) + (s * 0.143)), ((_lumG + (c * (1 - _lumG))) + (s * 0.14)), ((_lumB + (c * -(_lumB))) + (s * -0.283)), 0, 0, ((_lumR + (c * -(_lumR))) + (s * -((1 - _lumR)))), ((_lumG + (c * -(_lumG))) + (s * _lumG)), ((_lumB + (c * (1 - _lumB))) + (s * _lumB)), 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1];
return (applyMatrix(temp, m));
}
public static function setContrast(m:Array, n:Number):Array{
if (isNaN(n)){
return (m);
};
n = (n + 0.01);
var temp:Array = [n, 0, 0, 0, (128 * (1 - n)), 0, n, 0, 0, (128 * (1 - n)), 0, 0, n, 0, (128 * (1 - n)), 0, 0, 0, 1, 0];
return (applyMatrix(temp, m));
}
public static function applyMatrix(m:Array, m2:Array):Array{
var y:int;
var x:int;
if (((!((m is Array))) || (!((m2 is Array))))){
return (m2);
};
var temp:Array = [];
var i:int;
var z:int;
y = 0;
while (y < 4) {
x = 0;
while (x < 5) {
if (x == 4){
z = m[(i + 4)];
} else {
z = 0;
};
temp[(i + x)] = (((((m[i] * m2[x]) + (m[(i + 1)] * m2[(x + 5)])) + (m[(i + 2)] * m2[(x + 10)])) + (m[(i + 3)] * m2[(x + 15)])) + z);
x++;
};
i = (i + 5);
y++;
};
return (temp);
}
public static function setThreshold(m:Array, n:Number):Array{
if (isNaN(n)){
return (m);
};
var temp:Array = [(_lumR * 0x0100), (_lumG * 0x0100), (_lumB * 0x0100), 0, (-256 * n), (_lumR * 0x0100), (_lumG * 0x0100), (_lumB * 0x0100), 0, (-256 * n), (_lumR * 0x0100), (_lumG * 0x0100), (_lumB * 0x0100), 0, (-256 * n), 0, 0, 0, 1, 0];
return (applyMatrix(temp, m));
}
public static function colorize(m:Array, color:Number, amount:Number=1):Array{
if (isNaN(color)){
return (m);
};
if (isNaN(amount)){
amount = 1;
};
var r:Number = (((color >> 16) & 0xFF) / 0xFF);
var g:Number = (((color >> 8) & 0xFF) / 0xFF);
var b:Number = ((color & 0xFF) / 0xFF);
var inv:Number = (1 - amount);
var temp:Array = [(inv + ((amount * r) * _lumR)), ((amount * r) * _lumG), ((amount * r) * _lumB), 0, 0, ((amount * g) * _lumR), (inv + ((amount * g) * _lumG)), ((amount * g) * _lumB), 0, 0, ((amount * b) * _lumR), ((amount * b) * _lumG), (inv + ((amount * b) * _lumB)), 0, 0, 0, 0, 0, 1, 0];
return (applyMatrix(temp, m));
}
public static function setBrightness(m:Array, n:Number):Array{
if (isNaN(n)){
return (m);
};
n = ((n * 100) - 100);
return (applyMatrix([1, 0, 0, 0, n, 0, 1, 0, 0, n, 0, 0, 1, 0, n, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1], m));
}
}
}//package com.greensock.plugins
Section 23
//ColorTransformPlugin (com.greensock.plugins.ColorTransformPlugin)
package com.greensock.plugins {
import flash.display.*;
import flash.geom.*;
import com.greensock.*;
public class ColorTransformPlugin extends TintPlugin {
public static const API:Number = 1;
public function ColorTransformPlugin(){
super();
this.propName = "colorTransform";
}
override public function onInitTween(target:Object, value, tween:TweenLite):Boolean{
var p:String;
var ratio:Number;
if (!(target is DisplayObject)){
return (false);
};
var end:ColorTransform = target.transform.colorTransform;
for (p in value) {
if ((((p == "tint")) || ((p == "color")))){
if (value[p] != null){
end.color = int(value[p]);
};
} else {
if ((((((p == "tintAmount")) || ((p == "exposure")))) || ((p == "brightness")))){
} else {
end[p] = value[p];
};
};
};
if (!isNaN(value.tintAmount)){
ratio = (value.tintAmount / (1 - (((end.redMultiplier + end.greenMultiplier) + end.blueMultiplier) / 3)));
end.redOffset = (end.redOffset * ratio);
end.greenOffset = (end.greenOffset * ratio);
end.blueOffset = (end.blueOffset * ratio);
end.redMultiplier = (end.greenMultiplier = (end.blueMultiplier = (1 - value.tintAmount)));
} else {
if (!isNaN(value.exposure)){
end.redOffset = (end.greenOffset = (end.blueOffset = (0xFF * (value.exposure - 1))));
end.redMultiplier = (end.greenMultiplier = (end.blueMultiplier = 1));
} else {
if (!isNaN(value.brightness)){
end.redOffset = (end.greenOffset = (end.blueOffset = Math.max(0, ((value.brightness - 1) * 0xFF))));
end.redMultiplier = (end.greenMultiplier = (end.blueMultiplier = (1 - Math.abs((value.brightness - 1)))));
};
};
};
_ignoreAlpha = Boolean(((!((tween.vars.alpha == undefined))) && ((value.alphaMultiplier == undefined))));
init((target as DisplayObject), end);
return (true);
}
}
}//package com.greensock.plugins
Section 24
//DropShadowFilterPlugin (com.greensock.plugins.DropShadowFilterPlugin)
package com.greensock.plugins {
import flash.display.*;
import com.greensock.*;
import flash.filters.*;
public class DropShadowFilterPlugin extends FilterPlugin {
public static const API:Number = 1;
private static var _propNames:Array = ["distance", "angle", "color", "alpha", "blurX", "blurY", "strength", "quality", "inner", "knockout", "hideObject"];
public function DropShadowFilterPlugin(){
super();
this.propName = "dropShadowFilter";
this.overwriteProps = ["dropShadowFilter"];
}
override public function onInitTween(target:Object, value, tween:TweenLite):Boolean{
_target = target;
_type = DropShadowFilter;
initFilter(value, new DropShadowFilter(0, 45, 0, 0, 0, 0, 1, ((value.quality) || (2)), value.inner, value.knockout, value.hideObject), _propNames);
return (true);
}
}
}//package com.greensock.plugins
Section 25
//EndArrayPlugin (com.greensock.plugins.EndArrayPlugin)
package com.greensock.plugins {
import flash.display.*;
import com.greensock.*;
public class EndArrayPlugin extends TweenPlugin {
protected var _a:Array;
protected var _info:Array;
public static const API:Number = 1;
public function EndArrayPlugin(){
_info = [];
super();
this.propName = "endArray";
this.overwriteProps = ["endArray"];
}
public function init(start:Array, end:Array):void{
_a = start;
var i:int = end.length;
while (i--) {
if (((!((start[i] == end[i]))) && (!((start[i] == null))))){
_info[_info.length] = new ArrayTweenInfo(i, _a[i], (end[i] - _a[i]));
};
};
}
override public function onInitTween(target:Object, value, tween:TweenLite):Boolean{
if (((!((target is Array))) || (!((value is Array))))){
return (false);
};
init((target as Array), value);
return (true);
}
override public function set changeFactor(n:Number):void{
var ti:ArrayTweenInfo;
var val:Number;
var i:int = _info.length;
if (this.round){
while (i--) {
ti = _info[i];
val = (ti.start + (ti.change * n));
_a[ti.index] = ((val)>0) ? int((val + 0.5)) : int((val - 0.5));
};
} else {
while (i--) {
ti = _info[i];
_a[ti.index] = (ti.start + (ti.change * n));
};
};
}
}
}//package com.greensock.plugins
class ArrayTweenInfo {
public var change:Number;
public var start:Number;
public var index:uint;
private function ArrayTweenInfo(index:uint, start:Number, change:Number){
super();
this.index = index;
this.start = start;
this.change = change;
}
}
Section 26
//FilterPlugin (com.greensock.plugins.FilterPlugin)
package com.greensock.plugins {
import flash.display.*;
import com.greensock.*;
import com.greensock.core.*;
import flash.filters.*;
public class FilterPlugin extends TweenPlugin {
protected var _remove:Boolean;
protected var _target:Object;
protected var _index:int;
protected var _filter:BitmapFilter;
protected var _type:Class;
public static const VERSION:Number = 2.03;
public static const API:Number = 1;
public function FilterPlugin(){
super();
}
public function onCompleteTween():void{
var filters:Array;
var i:int;
if (_remove){
filters = _target.filters;
if (!(filters[_index] is _type)){
i = filters.length;
while (i--) {
if ((filters[i] is _type)){
filters.splice(i, 1);
break;
};
};
} else {
filters.splice(_index, 1);
};
_target.filters = filters;
};
}
protected function initFilter(props:Object, defaultFilter:BitmapFilter, propNames:Array):void{
var p:String;
var i:int;
var colorTween:HexColorsPlugin;
var filters:Array = _target.filters;
var extras:Object = ((props is BitmapFilter)) ? {} : props;
_index = -1;
if (extras.index != null){
_index = extras.index;
} else {
i = filters.length;
while (i--) {
if ((filters[i] is _type)){
_index = i;
break;
};
};
};
if ((((((_index == -1)) || ((filters[_index] == null)))) || ((extras.addFilter == true)))){
_index = ((extras.index)!=null) ? extras.index : filters.length;
filters[_index] = defaultFilter;
_target.filters = filters;
};
_filter = filters[_index];
if (extras.remove == true){
_remove = true;
this.onComplete = onCompleteTween;
};
i = propNames.length;
while (i--) {
p = propNames[i];
if ((((p in props)) && (!((_filter[p] == props[p]))))){
if ((((((p == "color")) || ((p == "highlightColor")))) || ((p == "shadowColor")))){
colorTween = new HexColorsPlugin();
colorTween.initColor(_filter, p, _filter[p], props[p]);
_tweens[_tweens.length] = new PropTween(colorTween, "changeFactor", 0, 1, p, false);
} else {
if ((((((((p == "quality")) || ((p == "inner")))) || ((p == "knockout")))) || ((p == "hideObject")))){
_filter[p] = props[p];
} else {
addTween(_filter, p, _filter[p], props[p], p);
};
};
};
};
}
override public function set changeFactor(n:Number):void{
var ti:PropTween;
var i:int = _tweens.length;
var filters:Array = _target.filters;
while (i--) {
ti = _tweens[i];
ti.target[ti.property] = (ti.start + (ti.change * n));
};
if (!(filters[_index] is _type)){
i = (_index = filters.length);
while (i--) {
if ((filters[i] is _type)){
_index = i;
break;
};
};
};
filters[_index] = _filter;
_target.filters = filters;
}
}
}//package com.greensock.plugins
Section 27
//FrameLabelPlugin (com.greensock.plugins.FrameLabelPlugin)
package com.greensock.plugins {
import flash.display.*;
import com.greensock.*;
public class FrameLabelPlugin extends FramePlugin {
public static const API:Number = 1;
public function FrameLabelPlugin(){
super();
this.propName = "frameLabel";
}
override public function onInitTween(target:Object, value, tween:TweenLite):Boolean{
if ((!(tween.target) is MovieClip)){
return (false);
};
_target = (target as MovieClip);
this.frame = _target.currentFrame;
var labels:Array = _target.currentLabels;
var label:String = value;
var endFrame:int = _target.currentFrame;
var i:int = labels.length;
while (i--) {
if (labels[i].name == label){
endFrame = labels[i].frame;
break;
};
};
if (this.frame != endFrame){
addTween(this, "frame", this.frame, endFrame, "frame");
};
return (true);
}
}
}//package com.greensock.plugins
Section 28
//FramePlugin (com.greensock.plugins.FramePlugin)
package com.greensock.plugins {
import flash.display.*;
import com.greensock.*;
public class FramePlugin extends TweenPlugin {
protected var _target:MovieClip;
public var frame:int;
public static const API:Number = 1;
public function FramePlugin(){
super();
this.propName = "frame";
this.overwriteProps = ["frame", "frameLabel"];
this.round = true;
}
override public function onInitTween(target:Object, value, tween:TweenLite):Boolean{
if (((!((target is MovieClip))) || (isNaN(value)))){
return (false);
};
_target = (target as MovieClip);
this.frame = _target.currentFrame;
addTween(this, "frame", this.frame, value, "frame");
return (true);
}
override public function set changeFactor(n:Number):void{
updateTweens(n);
_target.gotoAndStop(this.frame);
}
}
}//package com.greensock.plugins
Section 29
//GlowFilterPlugin (com.greensock.plugins.GlowFilterPlugin)
package com.greensock.plugins {
import flash.display.*;
import com.greensock.*;
import flash.filters.*;
public class GlowFilterPlugin extends FilterPlugin {
public static const API:Number = 1;
private static var _propNames:Array = ["color", "alpha", "blurX", "blurY", "strength", "quality", "inner", "knockout"];
public function GlowFilterPlugin(){
super();
this.propName = "glowFilter";
this.overwriteProps = ["glowFilter"];
}
override public function onInitTween(target:Object, value, tween:TweenLite):Boolean{
_target = target;
_type = GlowFilter;
initFilter(value, new GlowFilter(0xFFFFFF, 0, 0, 0, ((value.strength) || (1)), ((value.quality) || (2)), value.inner, value.knockout), _propNames);
return (true);
}
}
}//package com.greensock.plugins
Section 30
//HexColorsPlugin (com.greensock.plugins.HexColorsPlugin)
package com.greensock.plugins {
import flash.display.*;
import com.greensock.*;
public class HexColorsPlugin extends TweenPlugin {
protected var _colors:Array;
public static const API:Number = 1;
public function HexColorsPlugin(){
super();
this.propName = "hexColors";
this.overwriteProps = [];
_colors = [];
}
override public function killProps(lookup:Object):void{
var i:int = (_colors.length - 1);
while (i > -1) {
if (lookup[_colors[i][1]] != undefined){
_colors.splice(i, 1);
};
i--;
};
super.killProps(lookup);
}
public function initColor(target:Object, propName:String, start:uint, end:uint):void{
var r:Number;
var g:Number;
var b:Number;
if (start != end){
r = (start >> 16);
g = ((start >> 8) & 0xFF);
b = (start & 0xFF);
_colors[_colors.length] = [target, propName, r, ((end >> 16) - r), g, (((end >> 8) & 0xFF) - g), b, ((end & 0xFF) - b)];
this.overwriteProps[this.overwriteProps.length] = propName;
};
}
override public function set changeFactor(n:Number):void{
var i:int;
var a:Array;
i = (_colors.length - 1);
while (i > -1) {
a = _colors[i];
a[0][a[1]] = ((((a[2] + (n * a[3])) << 16) | ((a[4] + (n * a[5])) << 8)) | (a[6] + (n * a[7])));
i--;
};
}
override public function onInitTween(target:Object, value, tween:TweenLite):Boolean{
var p:String;
for (p in value) {
initColor(target, p, uint(target[p]), uint(value[p]));
};
return (true);
}
}
}//package com.greensock.plugins
Section 31
//RemoveTintPlugin (com.greensock.plugins.RemoveTintPlugin)
package com.greensock.plugins {
public class RemoveTintPlugin extends TintPlugin {
public static const API:Number = 1;
public function RemoveTintPlugin(){
super();
this.propName = "removeTint";
}
}
}//package com.greensock.plugins
Section 32
//RoundPropsPlugin (com.greensock.plugins.RoundPropsPlugin)
package com.greensock.plugins {
import flash.display.*;
import com.greensock.*;
public class RoundPropsPlugin extends TweenPlugin {
public static const API:Number = 1;
public function RoundPropsPlugin(){
super();
this.propName = "roundProps";
this.overwriteProps = [];
this.round = true;
}
public function add(object:Object, propName:String, start:Number, change:Number):void{
addTween(object, propName, start, (start + change), propName);
this.overwriteProps[this.overwriteProps.length] = propName;
}
}
}//package com.greensock.plugins
Section 33
//ShortRotationPlugin (com.greensock.plugins.ShortRotationPlugin)
package com.greensock.plugins {
import flash.display.*;
import com.greensock.*;
public class ShortRotationPlugin extends TweenPlugin {
public static const API:Number = 1;
public function ShortRotationPlugin(){
super();
this.propName = "shortRotation";
this.overwriteProps = [];
}
override public function onInitTween(target:Object, value, tween:TweenLite):Boolean{
var p:String;
if (typeof(value) == "number"){
return (false);
};
for (p in value) {
initRotation(target, p, target[p], ((typeof(value[p]))=="number") ? Number(value[p]) : (target[p] + Number(value[p])));
};
return (true);
}
public function initRotation(target:Object, propName:String, start:Number, end:Number):void{
var dif:Number = ((end - start) % 360);
if (dif != (dif % 180)){
dif = ((dif)<0) ? (dif + 360) : (dif - 360);
};
addTween(target, propName, start, (start + dif), propName);
this.overwriteProps[this.overwriteProps.length] = propName;
}
}
}//package com.greensock.plugins
Section 34
//TintPlugin (com.greensock.plugins.TintPlugin)
package com.greensock.plugins {
import flash.display.*;
import flash.geom.*;
import com.greensock.*;
import com.greensock.core.*;
public class TintPlugin extends TweenPlugin {
protected var _ct:ColorTransform;
protected var _transform:Transform;
protected var _ignoreAlpha:Boolean;
public static const API:Number = 1;
protected static var _props:Array = ["redMultiplier", "greenMultiplier", "blueMultiplier", "alphaMultiplier", "redOffset", "greenOffset", "blueOffset", "alphaOffset"];
public function TintPlugin(){
super();
this.propName = "tint";
this.overwriteProps = ["tint"];
}
override public function onInitTween(target:Object, value, tween:TweenLite):Boolean{
if (!(target is DisplayObject)){
return (false);
};
var end:ColorTransform = new ColorTransform();
if (((!((value == null))) && (!((tween.vars.removeTint == true))))){
end.color = uint(value);
};
_ignoreAlpha = true;
init((target as DisplayObject), end);
return (true);
}
override public function set changeFactor(n:Number):void{
var ct:ColorTransform;
updateTweens(n);
if (_ignoreAlpha){
ct = _transform.colorTransform;
_ct.alphaMultiplier = ct.alphaMultiplier;
_ct.alphaOffset = ct.alphaOffset;
};
_transform.colorTransform = _ct;
}
public function init(target:DisplayObject, end:ColorTransform):void{
var p:String;
_transform = target.transform;
_ct = _transform.colorTransform;
var i:int = _props.length;
while (i--) {
p = _props[i];
if (_ct[p] != end[p]){
_tweens[_tweens.length] = new PropTween(_ct, p, _ct[p], (end[p] - _ct[p]), "tint", false);
};
};
}
}
}//package com.greensock.plugins
Section 35
//TweenPlugin (com.greensock.plugins.TweenPlugin)
package com.greensock.plugins {
import com.greensock.*;
import com.greensock.core.*;
public class TweenPlugin {
public var activeDisable:Boolean;
protected var _changeFactor:Number;// = 0
protected var _tweens:Array;
public var onDisable:Function;
public var propName:String;
public var round:Boolean;
public var onEnable:Function;
public var priority:int;// = 0
public var overwriteProps:Array;
public var onComplete:Function;
public static const VERSION:Number = 1.31;
public static const API:Number = 1;
public function TweenPlugin(){
_tweens = [];
super();
}
protected function updateTweens(changeFactor:Number):void{
var pt:PropTween;
var val:Number;
var i:int = _tweens.length;
if (this.round){
while (i--) {
pt = _tweens[i];
val = (pt.start + (pt.change * changeFactor));
pt.target[pt.property] = ((val)>0) ? int((val + 0.5)) : int((val - 0.5));
};
} else {
while (i--) {
pt = _tweens[i];
pt.target[pt.property] = (pt.start + (pt.change * changeFactor));
};
};
}
protected function addTween(object:Object, propName:String, start:Number, end, overwriteProp:String=null):void{
var change:Number;
if (end != null){
change = ((typeof(end))=="number") ? (Number(end) - start) : Number(end);
if (change != 0){
_tweens[_tweens.length] = new PropTween(object, propName, start, change, ((overwriteProp) || (propName)), false);
};
};
}
public function get changeFactor():Number{
return (_changeFactor);
}
public function onInitTween(target:Object, value, tween:TweenLite):Boolean{
addTween(target, this.propName, target[this.propName], value, this.propName);
return (true);
}
public function killProps(lookup:Object):void{
var i:int = this.overwriteProps.length;
while (i--) {
if ((this.overwriteProps[i] in lookup)){
this.overwriteProps.splice(i, 1);
};
};
i = _tweens.length;
while (i--) {
if ((PropTween(_tweens[i]).name in lookup)){
_tweens.splice(i, 1);
};
};
}
public function set changeFactor(n:Number):void{
updateTweens(n);
_changeFactor = n;
}
public static function activate(plugins:Array):Boolean{
var instance:Object;
TweenLite.onPluginEvent = TweenPlugin.onTweenEvent;
var i:int = plugins.length;
while (i--) {
if (plugins[i].hasOwnProperty("API")){
instance = new ((plugins[i] as Class));
TweenLite.plugins[instance.propName] = plugins[i];
};
};
return (true);
}
private static function onTweenEvent(type:String, tween:TweenLite):Boolean{
var changed:Boolean;
var tweens:Array;
var i:int;
var pt:PropTween = tween.cachedPT1;
if (type == "onInit"){
tweens = [];
while (pt) {
tweens[tweens.length] = pt;
pt = pt.nextNode;
};
tweens.sortOn("priority", (Array.NUMERIC | Array.DESCENDING));
i = tweens.length;
while (i--) {
PropTween(tweens[i]).nextNode = tweens[(i + 1)];
PropTween(tweens[i]).prevNode = tweens[(i - 1)];
};
tween.cachedPT1 = tweens[0];
} else {
while (pt) {
if (((pt.isPlugin) && (pt.target[type]))){
if (pt.target.activeDisable){
changed = true;
};
var _local7 = pt.target;
_local7[type]();
};
pt = pt.nextNode;
};
};
return (changed);
}
}
}//package com.greensock.plugins
Section 36
//VisiblePlugin (com.greensock.plugins.VisiblePlugin)
package com.greensock.plugins {
import flash.display.*;
import com.greensock.*;
public class VisiblePlugin extends TweenPlugin {
protected var _target:Object;
protected var _initVal:Boolean;
protected var _visible:Boolean;
protected var _tween:TweenLite;
public static const API:Number = 1;
public function VisiblePlugin(){
super();
this.propName = "visible";
this.overwriteProps = ["visible"];
}
override public function onInitTween(target:Object, value, tween:TweenLite):Boolean{
_target = target;
_tween = tween;
_initVal = _target.visible;
_visible = Boolean(value);
return (true);
}
override public function set changeFactor(n:Number):void{
if ((((n == 1)) && ((((_tween.cachedDuration == _tween.cachedTime)) || ((_tween.cachedTime == 0)))))){
_target.visible = _visible;
} else {
_target.visible = _initVal;
};
}
}
}//package com.greensock.plugins
Section 37
//VolumePlugin (com.greensock.plugins.VolumePlugin)
package com.greensock.plugins {
import flash.display.*;
import com.greensock.*;
import flash.media.*;
public class VolumePlugin extends TweenPlugin {
protected var _target:Object;
protected var _st:SoundTransform;
public static const API:Number = 1;
public function VolumePlugin(){
super();
this.propName = "volume";
this.overwriteProps = ["volume"];
}
override public function onInitTween(target:Object, value, tween:TweenLite):Boolean{
if (((isNaN(value)) || (!(target.hasOwnProperty("soundTransform"))))){
return (false);
};
_target = target;
_st = _target.soundTransform;
addTween(_st, "volume", _st.volume, value, "volume");
return (true);
}
override public function set changeFactor(n:Number):void{
updateTweens(n);
_target.soundTransform = _st;
}
}
}//package com.greensock.plugins
Section 38
//OverwriteManager (com.greensock.OverwriteManager)
package com.greensock {
import com.greensock.core.*;
import flash.utils.*;
import flash.errors.*;
public class OverwriteManager {
public static const ALL_ONSTART:int = 4;
public static const CONCURRENT:int = 3;
public static const ALL_IMMEDIATE:int = 1;
public static const PREEXISTING:int = 5;
public static const AUTO:int = 2;
public static const version:Number = 6.02;
public static const NONE:int = 0;
public static var enabled:Boolean;
public static var mode:int;
public function OverwriteManager(){
super();
}
public static function getGlobalPaused(tween:TweenCore):Boolean{
while (tween) {
if (tween.cachedPaused){
return (true);
};
tween = tween.timeline;
};
return (false);
}
public static function init(defaultMode:int=2):int{
if (TweenLite.version < 11.1){
throw (new Error("Warning: Your TweenLite class needs to be updated to work with OverwriteManager (or you may need to clear your ASO files). Please download and install the latest version from http://www.tweenlite.com."));
};
TweenLite.overwriteManager = OverwriteManager;
mode = defaultMode;
enabled = true;
return (mode);
}
public static function manageOverwrites(tween:TweenLite, props:Object, targetTweens:Array, mode:uint):Boolean{
var i:int;
var changed:Boolean;
var curTween:TweenLite;
var l:uint;
var combinedTimeScale:Number;
var combinedStartTime:Number;
var cousin:TweenCore;
var cousinStartTime:Number;
var timeline:SimpleTimeline;
if (mode >= 4){
l = targetTweens.length;
i = 0;
while (i < l) {
curTween = targetTweens[i];
if (curTween != tween){
if (curTween.setEnabled(false, false)){
changed = true;
};
} else {
if (mode == 5){
break;
};
};
i++;
};
return (changed);
};
var startTime:Number = (tween.cachedStartTime + 1E-10);
var overlaps:Array = [];
var cousins:Array = [];
var cCount:uint;
var oCount:uint;
i = targetTweens.length;
while (--i > -1) {
curTween = targetTweens[i];
if ((((curTween == tween)) || (curTween.gc))){
} else {
if (curTween.timeline != tween.timeline){
if (!getGlobalPaused(curTween)){
var _temp1 = cCount;
cCount = (cCount + 1);
var _local19 = _temp1;
cousins[_local19] = curTween;
};
} else {
if ((((((curTween.cachedStartTime <= startTime)) && ((((curTween.cachedStartTime + curTween.totalDuration) + 1E-10) > startTime)))) && (!(getGlobalPaused(curTween))))){
var _temp2 = oCount;
oCount = (oCount + 1);
_local19 = _temp2;
overlaps[_local19] = curTween;
};
};
};
};
if (cCount != 0){
combinedTimeScale = tween.cachedTimeScale;
combinedStartTime = startTime;
timeline = tween.timeline;
while (timeline) {
combinedTimeScale = (combinedTimeScale * timeline.cachedTimeScale);
combinedStartTime = (combinedStartTime + timeline.cachedStartTime);
timeline = timeline.timeline;
};
startTime = (combinedTimeScale * combinedStartTime);
i = cCount;
while (--i > -1) {
cousin = cousins[i];
combinedTimeScale = cousin.cachedTimeScale;
combinedStartTime = cousin.cachedStartTime;
timeline = cousin.timeline;
while (timeline) {
combinedTimeScale = (combinedTimeScale * timeline.cachedTimeScale);
combinedStartTime = (combinedStartTime + timeline.cachedStartTime);
timeline = timeline.timeline;
};
cousinStartTime = (combinedTimeScale * combinedStartTime);
if ((((cousinStartTime <= startTime)) && ((((((cousinStartTime + (cousin.totalDuration * combinedTimeScale)) + 1E-10) > startTime)) || ((cousin.cachedDuration == 0)))))){
var _temp3 = oCount;
oCount = (oCount + 1);
_local19 = _temp3;
overlaps[_local19] = cousin;
};
};
};
if (oCount == 0){
return (changed);
};
i = oCount;
if (mode == 2){
while (--i > -1) {
curTween = overlaps[i];
if (curTween.killVars(props)){
changed = true;
};
if ((((curTween.cachedPT1 == null)) && (curTween.initted))){
curTween.setEnabled(false, false);
};
};
} else {
while (--i > -1) {
if (TweenLite(overlaps[i]).setEnabled(false, false)){
changed = true;
};
};
};
return (changed);
}
}
}//package com.greensock
Section 39
//TimelineLite (com.greensock.TimelineLite)
package com.greensock {
import com.greensock.core.*;
import flash.utils.*;
public class TimelineLite extends SimpleTimeline {
protected var _endCaps:Array;
protected var _labels:Object;
public static const version:Number = 1.382;
private static var _overwriteMode:int = (OverwriteManager.enabled) ? OverwriteManager.mode : OverwriteManager.init(2);
;
public function TimelineLite(vars:Object=null){
super(vars);
_endCaps = [null, null];
_labels = {};
this.autoRemoveChildren = Boolean((this.vars.autoRemoveChildren == true));
_hasUpdate = Boolean((typeof(this.vars.onUpdate) == "function"));
if ((this.vars.tweens is Array)){
this.insertMultiple(this.vars.tweens, 0, ((this.vars.align)!=null) ? this.vars.align : "normal", (this.vars.stagger) ? Number(this.vars.stagger) : 0);
};
}
public function set timeScale(n:Number):void{
if (n == 0){
n = 0.0001;
};
var tlTime:Number = (((_pauseTime) || ((_pauseTime == 0)))) ? _pauseTime : this.timeline.cachedTotalTime;
this.cachedStartTime = (tlTime - (((tlTime - this.cachedStartTime) * this.cachedTimeScale) / n));
this.cachedTimeScale = n;
setDirtyCache(false);
}
public function stop():void{
this.paused = true;
}
override public function renderTime(time:Number, suppressEvents:Boolean=false, force:Boolean=false):void{
var tween:TweenCore;
var isComplete:Boolean;
var rendered:Boolean;
var next:TweenCore;
var dur:Number;
if (this.gc){
this.setEnabled(true, false);
} else {
if (((!(this.active)) && (!(this.cachedPaused)))){
this.active = true;
};
};
var totalDur:Number = (this.cacheIsDirty) ? this.totalDuration : this.cachedTotalDuration;
var prevTime:Number = this.cachedTime;
var prevStart:Number = this.cachedStartTime;
var prevTimeScale:Number = this.cachedTimeScale;
var prevPaused:Boolean = this.cachedPaused;
if (time >= totalDur){
if ((((_rawPrevTime <= totalDur)) && (!((_rawPrevTime == time))))){
this.cachedTotalTime = (this.cachedTime = totalDur);
forceChildrenToEnd(totalDur, suppressEvents);
isComplete = !(this.hasPausedChild());
rendered = true;
if ((((((this.cachedDuration == 0)) && (isComplete))) && ((((time == 0)) || ((_rawPrevTime < 0)))))){
force = true;
};
};
} else {
if (time <= 0){
if (time < 0){
this.active = false;
if ((((this.cachedDuration == 0)) && ((_rawPrevTime > 0)))){
force = true;
isComplete = true;
};
};
if ((((_rawPrevTime >= 0)) && (!((_rawPrevTime == time))))){
forceChildrenToBeginning(0, suppressEvents);
this.cachedTotalTime = 0;
this.cachedTime = 0;
rendered = true;
if (this.cachedReversed){
isComplete = true;
};
};
} else {
this.cachedTotalTime = (this.cachedTime = time);
};
};
_rawPrevTime = time;
if ((((this.cachedTime == prevTime)) && (!(force)))){
return;
};
if (!this.initted){
this.initted = true;
};
if ((((((((prevTime == 0)) && (this.vars.onStart))) && (!((this.cachedTime == 0))))) && (!(suppressEvents)))){
this.vars.onStart.apply(null, this.vars.onStartParams);
};
if (rendered){
} else {
if ((this.cachedTime - prevTime) > 0){
tween = _firstChild;
while (tween) {
next = tween.nextNode;
if (((this.cachedPaused) && (!(prevPaused)))){
break;
} else {
if (((tween.active) || (((((!(tween.cachedPaused)) && ((tween.cachedStartTime <= this.cachedTime)))) && (!(tween.gc)))))){
if (!tween.cachedReversed){
tween.renderTime(((this.cachedTime - tween.cachedStartTime) * tween.cachedTimeScale), suppressEvents, false);
} else {
dur = (tween.cacheIsDirty) ? tween.totalDuration : tween.cachedTotalDuration;
tween.renderTime((dur - ((this.cachedTime - tween.cachedStartTime) * tween.cachedTimeScale)), suppressEvents, false);
};
};
};
tween = next;
};
} else {
tween = _lastChild;
while (tween) {
next = tween.prevNode;
if (((this.cachedPaused) && (!(prevPaused)))){
break;
} else {
if (((tween.active) || (((((!(tween.cachedPaused)) && ((tween.cachedStartTime <= prevTime)))) && (!(tween.gc)))))){
if (!tween.cachedReversed){
tween.renderTime(((this.cachedTime - tween.cachedStartTime) * tween.cachedTimeScale), suppressEvents, false);
} else {
dur = (tween.cacheIsDirty) ? tween.totalDuration : tween.cachedTotalDuration;
tween.renderTime((dur - ((this.cachedTime - tween.cachedStartTime) * tween.cachedTimeScale)), suppressEvents, false);
};
};
};
tween = next;
};
};
};
if (((_hasUpdate) && (!(suppressEvents)))){
this.vars.onUpdate.apply(null, this.vars.onUpdateParams);
};
if (((((isComplete) && ((((prevStart == this.cachedStartTime)) || (!((prevTimeScale == this.cachedTimeScale))))))) && ((((totalDur >= this.totalDuration)) || ((this.cachedTime == 0)))))){
complete(true, suppressEvents);
};
}
override public function remove(tween:TweenCore, skipDisable:Boolean=false):void{
if (tween.cachedOrphan){
return;
};
if (!skipDisable){
tween.setEnabled(false, true);
};
var first:TweenCore = (this.gc) ? _endCaps[0] : _firstChild;
var last:TweenCore = (this.gc) ? _endCaps[1] : _lastChild;
if (tween.nextNode){
tween.nextNode.prevNode = tween.prevNode;
} else {
if (last == tween){
last = tween.prevNode;
};
};
if (tween.prevNode){
tween.prevNode.nextNode = tween.nextNode;
} else {
if (first == tween){
first = tween.nextNode;
};
};
if (this.gc){
_endCaps[0] = first;
_endCaps[1] = last;
} else {
_firstChild = first;
_lastChild = last;
};
tween.cachedOrphan = true;
setDirtyCache(true);
}
public function get currentProgress():Number{
return ((this.cachedTime / this.duration));
}
override public function get totalDuration():Number{
var max:Number;
var end:Number;
var tween:TweenCore;
var prevStart:Number;
var next:TweenCore;
if (this.cacheIsDirty){
max = 0;
tween = (this.gc) ? _endCaps[0] : _firstChild;
prevStart = -(Infinity);
while (tween) {
next = tween.nextNode;
if (tween.cachedStartTime < prevStart){
this.addChild(tween);
prevStart = tween.prevNode.cachedStartTime;
} else {
prevStart = tween.cachedStartTime;
};
if (tween.cachedStartTime < 0){
max = (max - tween.cachedStartTime);
this.shiftChildren(-(tween.cachedStartTime), false, -9999999999);
};
end = (tween.cachedStartTime + (tween.totalDuration / tween.cachedTimeScale));
if (end > max){
max = end;
};
tween = next;
};
this.cachedDuration = (this.cachedTotalDuration = max);
this.cacheIsDirty = false;
};
return (this.cachedTotalDuration);
}
public function gotoAndPlay(timeOrLabel, suppressEvents:Boolean=true):void{
setTotalTime(parseTimeOrLabel(timeOrLabel), suppressEvents);
play();
}
public function appendMultiple(tweens:Array, offset:Number=0, align:String="normal", stagger:Number=0):void{
insertMultiple(tweens, (this.duration + offset), align, stagger);
}
public function set currentProgress(n:Number):void{
setTotalTime((this.duration * n), false);
}
public function clear(tweens:Array=null):void{
if (tweens == null){
tweens = getChildren(false, true, true);
};
var i:int = tweens.length;
while (--i > -1) {
TweenCore(tweens[i]).setEnabled(false, false);
};
}
public function prepend(tween:TweenCore, adjustLabels:Boolean=false):void{
shiftChildren(((tween.totalDuration / tween.cachedTimeScale) + tween.delay), adjustLabels, 0);
insert(tween, 0);
}
public function removeLabel(label:String):Number{
var n:Number = _labels[label];
delete _labels[label];
return (n);
}
protected function parseTimeOrLabel(timeOrLabel):Number{
if (typeof(timeOrLabel) == "string"){
if (!(timeOrLabel in _labels)){
throw (new Error((("TimelineLite error: the " + timeOrLabel) + " label was not found.")));
};
return (getLabelTime(String(timeOrLabel)));
};
return (Number(timeOrLabel));
}
public function addLabel(label:String, time:Number):void{
_labels[label] = time;
}
public function hasPausedChild():Boolean{
var tween:TweenCore = (this.gc) ? _endCaps[0] : _firstChild;
while (tween) {
if (((tween.cachedPaused) || ((((tween is TimelineLite)) && ((tween as TimelineLite).hasPausedChild()))))){
return (true);
};
tween = tween.nextNode;
};
return (false);
}
public function getTweensOf(target:Object, nested:Boolean=true):Array{
var i:int;
var tweens:Array = getChildren(nested, true, false);
var a:Array = [];
var l:uint = tweens.length;
var cnt:uint;
i = 0;
while (i < l) {
if (TweenLite(tweens[i]).target == target){
var _temp1 = cnt;
cnt = (cnt + 1);
var _local8 = _temp1;
a[_local8] = tweens[i];
};
i++;
};
return (a);
}
public function gotoAndStop(timeOrLabel, suppressEvents:Boolean=true):void{
setTotalTime(parseTimeOrLabel(timeOrLabel), suppressEvents);
this.paused = true;
}
public function append(tween:TweenCore, offset:Number=0):void{
insert(tween, (this.duration + offset));
}
override public function get duration():Number{
var d:Number;
if (this.cacheIsDirty){
d = this.totalDuration;
};
return (this.cachedDuration);
}
public function get useFrames():Boolean{
var tl:SimpleTimeline = this.timeline;
while (tl.timeline) {
tl = tl.timeline;
};
return (Boolean((tl == TweenLite.rootFramesTimeline)));
}
public function shiftChildren(amount:Number, adjustLabels:Boolean=false, ignoreBeforeTime:Number=0):void{
var p:String;
var tween:TweenCore = (this.gc) ? _endCaps[0] : _firstChild;
while (tween) {
if (tween.cachedStartTime >= ignoreBeforeTime){
tween.cachedStartTime = (tween.cachedStartTime + amount);
};
tween = tween.nextNode;
};
if (adjustLabels){
for (p in _labels) {
if (_labels[p] >= ignoreBeforeTime){
_labels[p] = (_labels[p] + amount);
};
};
};
this.setDirtyCache(true);
}
public function goto(timeOrLabel, suppressEvents:Boolean=true):void{
setTotalTime(parseTimeOrLabel(timeOrLabel), suppressEvents);
}
public function killTweensOf(target:Object, nested:Boolean=true, vars:Object=null):Boolean{
var tween:TweenLite;
var tweens:Array = getTweensOf(target, nested);
var i:int = tweens.length;
while (--i > -1) {
tween = tweens[i];
if (vars != null){
tween.killVars(vars);
};
if ((((vars == null)) || ((((tween.cachedPT1 == null)) && (tween.initted))))){
tween.setEnabled(false, false);
};
};
return (Boolean((tweens.length > 0)));
}
override public function invalidate():void{
var tween:TweenCore = (this.gc) ? _endCaps[0] : _firstChild;
while (tween) {
tween.invalidate();
tween = tween.nextNode;
};
}
public function insertMultiple(tweens:Array, timeOrLabel=0, align:String="normal", stagger:Number=0):void{
var i:int;
var tween:TweenCore;
var curTime:Number = ((Number(timeOrLabel)) || (0));
var l:uint = tweens.length;
if (typeof(timeOrLabel) == "string"){
if (!(timeOrLabel in _labels)){
addLabel(timeOrLabel, this.duration);
};
curTime = _labels[timeOrLabel];
};
i = 0;
while (i < l) {
tween = (tweens[i] as TweenCore);
insert(tween, curTime);
if (align == "sequence"){
curTime = (tween.cachedStartTime + (tween.totalDuration / tween.cachedTimeScale));
} else {
if (align == "start"){
tween.cachedStartTime = (tween.cachedStartTime - tween.delay);
};
};
curTime = (curTime + stagger);
i++;
};
}
public function getLabelTime(label:String):Number{
return (((label in _labels)) ? Number(_labels[label]) : -1);
}
override public function get rawTime():Number{
if (((!((this.cachedTotalTime == 0))) && (!((this.cachedTotalTime == this.cachedTotalDuration))))){
return (this.cachedTotalTime);
};
return (((this.timeline.rawTime - this.cachedStartTime) * this.cachedTimeScale));
}
override public function set duration(n:Number):void{
if (((!((this.duration == 0))) && (!((n == 0))))){
this.timeScale = (this.duration / n);
};
}
override public function set totalDuration(n:Number):void{
if (((!((this.totalDuration == 0))) && (!((n == 0))))){
this.timeScale = (this.totalDuration / n);
};
}
public function getChildren(nested:Boolean=true, tweens:Boolean=true, timelines:Boolean=true, ignoreBeforeTime:Number=-9999999999):Array{
var a:Array = [];
var cnt:uint;
var tween:TweenCore = (this.gc) ? _endCaps[0] : _firstChild;
while (tween) {
if (tween.cachedStartTime < ignoreBeforeTime){
} else {
if ((tween is TweenLite)){
if (tweens){
var _temp1 = cnt;
cnt = (cnt + 1);
var _local8 = _temp1;
a[_local8] = tween;
};
} else {
if (timelines){
var _temp2 = cnt;
cnt = (cnt + 1);
_local8 = _temp2;
a[_local8] = tween;
};
if (nested){
a = a.concat(TimelineLite(tween).getChildren(true, tweens, timelines));
};
};
};
tween = tween.nextNode;
};
return (a);
}
protected function forceChildrenToEnd(time:Number, suppressEvents:Boolean=false):Number{
var next:TweenCore;
var dur:Number;
var tween:TweenCore = _firstChild;
var prevPaused:Boolean = this.cachedPaused;
while (tween) {
next = tween.nextNode;
if (((this.cachedPaused) && (!(prevPaused)))){
break;
} else {
if (((tween.active) || (((((!(tween.cachedPaused)) && (!(tween.gc)))) && (((!((tween.cachedTotalTime == tween.cachedTotalDuration))) || ((tween.cachedDuration == 0)))))))){
if ((((time == this.cachedDuration)) && (((!((tween.cachedDuration == 0))) || ((tween.cachedStartTime == this.cachedDuration)))))){
tween.renderTime((tween.cachedReversed) ? 0 : tween.cachedTotalDuration, suppressEvents, false);
} else {
if (!tween.cachedReversed){
tween.renderTime(((time - tween.cachedStartTime) * tween.cachedTimeScale), suppressEvents, false);
} else {
dur = (tween.cacheIsDirty) ? tween.totalDuration : tween.cachedTotalDuration;
tween.renderTime((dur - ((time - tween.cachedStartTime) * tween.cachedTimeScale)), suppressEvents, false);
};
};
};
};
tween = next;
};
return (time);
}
protected function forceChildrenToBeginning(time:Number, suppressEvents:Boolean=false):Number{
var next:TweenCore;
var dur:Number;
var tween:TweenCore = _lastChild;
var prevPaused:Boolean = this.cachedPaused;
while (tween) {
next = tween.prevNode;
if (((this.cachedPaused) && (!(prevPaused)))){
break;
} else {
if (((tween.active) || (((((!(tween.cachedPaused)) && (!(tween.gc)))) && (((!((tween.cachedTotalTime == 0))) || ((tween.cachedDuration == 0)))))))){
if ((((time == 0)) && (((!((tween.cachedDuration == 0))) || ((tween.cachedStartTime == 0)))))){
tween.renderTime((tween.cachedReversed) ? tween.cachedTotalDuration : 0, suppressEvents, false);
} else {
if (!tween.cachedReversed){
tween.renderTime(((time - tween.cachedStartTime) * tween.cachedTimeScale), suppressEvents, false);
} else {
dur = (tween.cacheIsDirty) ? tween.totalDuration : tween.cachedTotalDuration;
tween.renderTime((dur - ((time - tween.cachedStartTime) * tween.cachedTimeScale)), suppressEvents, false);
};
};
};
};
tween = next;
};
return (time);
}
public function insert(tween:TweenCore, timeOrLabel=0):void{
if (typeof(timeOrLabel) == "string"){
if (!(timeOrLabel in _labels)){
addLabel(timeOrLabel, this.duration);
};
timeOrLabel = Number(_labels[timeOrLabel]);
};
tween.cachedStartTime = (Number(timeOrLabel) + tween.delay);
addChild(tween);
}
override public function addChild(tween:TweenCore):void{
var curTween:TweenCore;
var st:Number;
if (((!(tween.cachedOrphan)) && (tween.timeline))){
tween.timeline.remove(tween, true);
};
tween.timeline = this;
if (tween.gc){
tween.setEnabled(true, true);
};
setDirtyCache(true);
var first:TweenCore = (this.gc) ? _endCaps[0] : _firstChild;
var last:TweenCore = (this.gc) ? _endCaps[1] : _lastChild;
if (last == null){
last = tween;
first = last;
tween.nextNode = (tween.prevNode = null);
} else {
curTween = last;
st = tween.cachedStartTime;
while (((!((curTween == null))) && ((st <= curTween.cachedStartTime)))) {
curTween = curTween.prevNode;
};
if (curTween == null){
first.prevNode = tween;
tween.nextNode = first;
tween.prevNode = null;
first = tween;
} else {
if (curTween.nextNode){
curTween.nextNode.prevNode = tween;
} else {
if (curTween == last){
last = tween;
};
};
tween.prevNode = curTween;
tween.nextNode = curTween.nextNode;
curTween.nextNode = tween;
};
};
tween.cachedOrphan = false;
if (this.gc){
_endCaps[0] = first;
_endCaps[1] = last;
} else {
_firstChild = first;
_lastChild = last;
};
}
public function get timeScale():Number{
return (this.cachedTimeScale);
}
public function prependMultiple(tweens:Array, align:String="normal", stagger:Number=0, adjustLabels:Boolean=false):void{
var tl:TimelineLite = new TimelineLite({tweens:tweens, align:align, stagger:stagger});
shiftChildren(tl.duration, adjustLabels, 0);
insertMultiple(tweens, 0, align, stagger);
tl.kill();
}
override public function setEnabled(enabled:Boolean, ignoreTimeline:Boolean=false):Boolean{
var tween:TweenCore;
var next:TweenCore;
if (enabled == this.gc){
if (enabled){
tween = _endCaps[0];
_firstChild = tween;
_lastChild = _endCaps[1];
_endCaps = [null, null];
} else {
tween = _firstChild;
_endCaps = [_firstChild, _lastChild];
_firstChild = (_lastChild = null);
};
while (tween) {
tween.setEnabled(enabled, true);
tween = tween.nextNode;
};
};
return (super.setEnabled(enabled, ignoreTimeline));
}
}
}//package com.greensock
Section 40
//TimelineMax (com.greensock.TimelineMax)
package com.greensock {
import flash.events.*;
import com.greensock.core.*;
import flash.utils.*;
import com.greensock.events.*;
public class TimelineMax extends TimelineLite implements IEventDispatcher {
protected var _cyclesComplete:uint;
protected var _dispatcher:EventDispatcher;
protected var _hasUpdateListener:Boolean;
public var yoyo:Boolean;
protected var _repeatDelay:Number;
protected var _repeat:int;
public static const version:Number = 1.381;
public function TimelineMax(vars:Object=null){
super(vars);
_repeat = (this.vars.repeat) ? Number(this.vars.repeat) : 0;
_repeatDelay = (this.vars.repeatDelay) ? Number(this.vars.repeatDelay) : 0;
_cyclesComplete = 0;
this.yoyo = Boolean((this.vars.yoyo == true));
this.cacheIsDirty = true;
if (((((((((!((this.vars.onCompleteListener == null))) || (!((this.vars.onUpdateListener == null))))) || (!((this.vars.onStartListener == null))))) || (!((this.vars.onRepeatListener == null))))) || (!((this.vars.onReverseCompleteListener == null))))){
initDispatcher();
};
}
public function dispatchEvent(e:Event):Boolean{
return (((_dispatcher)==null) ? false : _dispatcher.dispatchEvent(e));
}
public function get currentLabel():String{
return (getLabelBefore((this.cachedTime + 1E-8)));
}
override public function renderTime(time:Number, suppressEvents:Boolean=false, force:Boolean=false):void{
var tween:TweenCore;
var isComplete:Boolean;
var rendered:Boolean;
var repeated:Boolean;
var next:TweenCore;
var dur:Number;
var cycleDuration:Number;
var prevCycles:int;
var forward:Boolean;
var prevForward:Boolean;
var wrap:Boolean;
if (this.gc){
this.setEnabled(true, false);
} else {
if (((!(this.active)) && (!(this.cachedPaused)))){
this.active = true;
};
};
var totalDur:Number = (this.cacheIsDirty) ? this.totalDuration : this.cachedTotalDuration;
var prevTime:Number = this.cachedTime;
var prevStart:Number = this.cachedStartTime;
var prevTimeScale:Number = this.cachedTimeScale;
var prevPaused:Boolean = this.cachedPaused;
if (time >= totalDur){
if ((((_rawPrevTime <= totalDur)) && (!((_rawPrevTime == time))))){
if (((((!(this.cachedReversed)) && (this.yoyo))) && (!(((_repeat % 2) == 0))))){
forceChildrenToBeginning(0, suppressEvents);
this.cachedTime = 0;
} else {
forceChildrenToEnd(this.cachedDuration, suppressEvents);
this.cachedTime = this.cachedDuration;
};
this.cachedTotalTime = totalDur;
isComplete = !(this.hasPausedChild());
rendered = true;
if ((((((this.cachedDuration == 0)) && (isComplete))) && ((((time == 0)) || ((_rawPrevTime < 0)))))){
force = true;
};
};
} else {
if (time <= 0){
if (time < 0){
this.active = false;
if ((((this.cachedDuration == 0)) && ((_rawPrevTime > 0)))){
force = true;
isComplete = true;
};
};
if ((((_rawPrevTime >= 0)) && (!((_rawPrevTime == time))))){
this.cachedTotalTime = 0;
forceChildrenToBeginning(0, suppressEvents);
this.cachedTime = 0;
rendered = true;
if (this.cachedReversed){
isComplete = true;
};
};
} else {
this.cachedTotalTime = (this.cachedTime = time);
};
};
_rawPrevTime = time;
if (_repeat != 0){
cycleDuration = (this.cachedDuration + _repeatDelay);
if (isComplete){
if (((this.yoyo) && ((_repeat % 2)))){
this.cachedTime = 0;
};
} else {
if (time > 0){
prevCycles = _cyclesComplete;
_cyclesComplete = int((this.cachedTotalTime / cycleDuration));
if (_cyclesComplete == (this.cachedTotalTime / cycleDuration)){
_cyclesComplete--;
};
if (prevCycles != _cyclesComplete){
repeated = true;
};
this.cachedTime = (((this.cachedTotalTime / cycleDuration) - _cyclesComplete) * cycleDuration);
if (((this.yoyo) && ((_cyclesComplete % 2)))){
this.cachedTime = (this.cachedDuration - this.cachedTime);
} else {
if (this.cachedTime >= this.cachedDuration){
this.cachedTime = this.cachedDuration;
};
};
if (this.cachedTime < 0){
this.cachedTime = 0;
};
};
};
if (((((repeated) && (!(isComplete)))) && (((!((this.cachedTime == prevTime))) || (force))))){
forward = Boolean(((!(this.yoyo)) || (((_cyclesComplete % 2) == 0))));
prevForward = Boolean(((!(this.yoyo)) || (((prevCycles % 2) == 0))));
wrap = Boolean((forward == prevForward));
if (prevCycles > _cyclesComplete){
prevForward = !(prevForward);
};
if (prevForward){
prevTime = forceChildrenToEnd(this.cachedDuration, suppressEvents);
if (wrap){
prevTime = forceChildrenToBeginning(0, true);
};
} else {
prevTime = forceChildrenToBeginning(0, suppressEvents);
if (wrap){
prevTime = forceChildrenToEnd(this.cachedDuration, true);
};
};
rendered = false;
};
};
if ((((this.cachedTime == prevTime)) && (!(force)))){
return;
};
if (!this.initted){
this.initted = true;
};
if ((((((prevTime == 0)) && (!((this.cachedTotalTime == 0))))) && (!(suppressEvents)))){
if (this.vars.onStart){
this.vars.onStart.apply(null, this.vars.onStartParams);
};
if (_dispatcher){
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.START));
};
};
if (rendered){
} else {
if ((this.cachedTime - prevTime) > 0){
tween = _firstChild;
while (tween) {
next = tween.nextNode;
if (((this.cachedPaused) && (!(prevPaused)))){
break;
} else {
if (((tween.active) || (((((!(tween.cachedPaused)) && ((tween.cachedStartTime <= this.cachedTime)))) && (!(tween.gc)))))){
if (!tween.cachedReversed){
tween.renderTime(((this.cachedTime - tween.cachedStartTime) * tween.cachedTimeScale), suppressEvents, false);
} else {
dur = (tween.cacheIsDirty) ? tween.totalDuration : tween.cachedTotalDuration;
tween.renderTime((dur - ((this.cachedTime - tween.cachedStartTime) * tween.cachedTimeScale)), suppressEvents, false);
};
};
};
tween = next;
};
} else {
tween = _lastChild;
while (tween) {
next = tween.prevNode;
if (((this.cachedPaused) && (!(prevPaused)))){
break;
} else {
if (((tween.active) || (((((!(tween.cachedPaused)) && ((tween.cachedStartTime <= prevTime)))) && (!(tween.gc)))))){
if (!tween.cachedReversed){
tween.renderTime(((this.cachedTime - tween.cachedStartTime) * tween.cachedTimeScale), suppressEvents, false);
} else {
dur = (tween.cacheIsDirty) ? tween.totalDuration : tween.cachedTotalDuration;
tween.renderTime((dur - ((this.cachedTime - tween.cachedStartTime) * tween.cachedTimeScale)), suppressEvents, false);
};
};
};
tween = next;
};
};
};
if (((_hasUpdate) && (!(suppressEvents)))){
this.vars.onUpdate.apply(null, this.vars.onUpdateParams);
};
if (((_hasUpdateListener) && (!(suppressEvents)))){
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.UPDATE));
};
if (((((isComplete) && ((((prevStart == this.cachedStartTime)) || (!((prevTimeScale == this.cachedTimeScale))))))) && ((((totalDur >= this.totalDuration)) || ((this.cachedTime == 0)))))){
complete(true, suppressEvents);
} else {
if (((repeated) && (!(suppressEvents)))){
if (this.vars.onRepeat){
this.vars.onRepeat.apply(null, this.vars.onRepeatParams);
};
if (_dispatcher){
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.REPEAT));
};
};
};
}
public function addCallback(callback:Function, timeOrLabel, params:Array=null):TweenLite{
var cb:TweenLite = new TweenLite(callback, 0, {onComplete:callback, onCompleteParams:params, overwrite:0, immediateRender:false});
insert(cb, timeOrLabel);
return (cb);
}
public function tweenFromTo(fromTimeOrLabel, toTimeOrLabel, vars:Object=null):TweenLite{
var tl:TweenLite = tweenTo(toTimeOrLabel, vars);
tl.vars.onInitParams[2] = parseTimeOrLabel(fromTimeOrLabel);
tl.duration = (Math.abs((Number(tl.vars.currentTime) - tl.vars.onInitParams[2])) / this.cachedTimeScale);
return (tl);
}
public function removeEventListener(type:String, listener:Function, useCapture:Boolean=false):void{
if (_dispatcher != null){
_dispatcher.removeEventListener(type, listener, useCapture);
};
}
override public function set currentTime(n:Number):void{
if (_cyclesComplete == 0){
setTotalTime(n, false);
} else {
if (((this.yoyo) && (((_cyclesComplete % 2) == 1)))){
setTotalTime(((this.duration - n) + (_cyclesComplete * (this.cachedDuration + _repeatDelay))), false);
} else {
setTotalTime((n + (_cyclesComplete * (this.duration + _repeatDelay))), false);
};
};
}
public function addEventListener(type:String, listener:Function, useCapture:Boolean=false, priority:int=0, useWeakReference:Boolean=false):void{
if (_dispatcher == null){
initDispatcher();
};
if (type == TweenEvent.UPDATE){
_hasUpdateListener = true;
};
_dispatcher.addEventListener(type, listener, useCapture, priority, useWeakReference);
}
public function tweenTo(timeOrLabel, vars:Object=null):TweenLite{
var p:String;
var tl:TweenLite;
var varsCopy:Object = {ease:easeNone, overwrite:2, useFrames:this.useFrames, immediateRender:false};
for (p in vars) {
varsCopy[p] = vars[p];
};
varsCopy.onInit = onInitTweenTo;
varsCopy.onInitParams = [null, this, NaN];
varsCopy.currentTime = parseTimeOrLabel(timeOrLabel);
tl = new TweenLite(this, (((Math.abs((Number(varsCopy.currentTime) - this.cachedTime)) / this.cachedTimeScale)) || (0.001)), varsCopy);
tl.vars.onInitParams[0] = tl;
return (tl);
}
public function hasEventListener(type:String):Boolean{
return (((_dispatcher)==null) ? false : _dispatcher.hasEventListener(type));
}
protected function initDispatcher():void{
if (_dispatcher == null){
_dispatcher = new EventDispatcher(this);
};
if ((this.vars.onStartListener is Function)){
_dispatcher.addEventListener(TweenEvent.START, this.vars.onStartListener, false, 0, true);
};
if ((this.vars.onUpdateListener is Function)){
_dispatcher.addEventListener(TweenEvent.UPDATE, this.vars.onUpdateListener, false, 0, true);
_hasUpdateListener = true;
};
if ((this.vars.onCompleteListener is Function)){
_dispatcher.addEventListener(TweenEvent.COMPLETE, this.vars.onCompleteListener, false, 0, true);
};
if ((this.vars.onRepeatListener is Function)){
_dispatcher.addEventListener(TweenEvent.REPEAT, this.vars.onRepeatListener, false, 0, true);
};
if ((this.vars.onReverseCompleteListener is Function)){
_dispatcher.addEventListener(TweenEvent.REVERSE_COMPLETE, this.vars.onReverseCompleteListener, false, 0, true);
};
}
public function get repeat():int{
return (_repeat);
}
public function getLabelBefore(time:Number=NaN):String{
if (((!(time)) && (!((time == 0))))){
time = this.cachedTime;
};
var labels:Array = getLabelsArray();
var i:int = labels.length;
while (--i > -1) {
if (labels[i].time < time){
return (labels[i].name);
};
};
return (null);
}
public function willTrigger(type:String):Boolean{
return (((_dispatcher)==null) ? false : _dispatcher.willTrigger(type));
}
public function get totalProgress():Number{
return ((this.cachedTotalTime / this.totalDuration));
}
public function set totalProgress(n:Number):void{
setTotalTime((this.totalDuration * n), false);
}
protected function getLabelsArray():Array{
var p:String;
var a:Array = [];
for (p in _labels) {
a[a.length] = {time:_labels[p], name:p};
};
a.sortOn("time", Array.NUMERIC);
return (a);
}
public function removeCallback(callback:Function, timeOrLabel=null):Boolean{
var a:Array;
var success:Boolean;
var i:int;
if (timeOrLabel == null){
return (killTweensOf(callback, false));
};
if (typeof(timeOrLabel) == "string"){
if (!(timeOrLabel in _labels)){
return (false);
};
timeOrLabel = _labels[timeOrLabel];
};
a = getTweensOf(callback, false);
i = a.length;
while (--i > -1) {
if (a[i].cachedStartTime == timeOrLabel){
remove((a[i] as TweenCore));
success = true;
};
};
return (success);
}
public function get repeatDelay():Number{
return (_repeatDelay);
}
public function set repeatDelay(n:Number):void{
_repeatDelay = n;
setDirtyCache(true);
}
public function set repeat(n:int):void{
_repeat = n;
setDirtyCache(true);
}
override public function get totalDuration():Number{
var temp:Number;
if (this.cacheIsDirty){
temp = super.totalDuration;
this.cachedTotalDuration = ((_repeat)==-1) ? 999999999999 : ((this.cachedDuration * (_repeat + 1)) + (_repeatDelay * _repeat));
};
return (this.cachedTotalDuration);
}
override public function complete(skipRender:Boolean=false, suppressEvents:Boolean=false):void{
super.complete(skipRender, suppressEvents);
if (((_dispatcher) && (!(suppressEvents)))){
if (((((this.cachedReversed) && ((this.cachedTotalTime == 0)))) && (!((this.cachedDuration == 0))))){
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.REVERSE_COMPLETE));
} else {
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.COMPLETE));
};
};
}
override public function invalidate():void{
_repeat = (this.vars.repeat) ? Number(this.vars.repeat) : 0;
_repeatDelay = (this.vars.repeatDelay) ? Number(this.vars.repeatDelay) : 0;
this.yoyo = Boolean((this.vars.yoyo == true));
if (((((((((!((this.vars.onCompleteListener == null))) || (!((this.vars.onUpdateListener == null))))) || (!((this.vars.onStartListener == null))))) || (!((this.vars.onRepeatListener == null))))) || (!((this.vars.onReverseCompleteListener == null))))){
initDispatcher();
};
setDirtyCache(true);
super.invalidate();
}
public function getActive(nested:Boolean=true, tweens:Boolean=true, timelines:Boolean=false):Array{
var i:int;
var a:Array = [];
var all:Array = getChildren(nested, tweens, timelines);
var l:uint = all.length;
var cnt:uint;
i = 0;
while (i < l) {
if (TweenCore(all[i]).active){
var _temp1 = cnt;
cnt = (cnt + 1);
var _local9 = _temp1;
a[_local9] = all[i];
};
i++;
};
return (a);
}
public function getLabelAfter(time:Number=NaN):String{
if (((!(time)) && (!((time == 0))))){
time = this.cachedTime;
};
var labels:Array = getLabelsArray();
var l:uint = labels.length;
var i:int;
while (i < l) {
if (labels[i].time > time){
return (labels[i].name);
};
i++;
};
return (null);
}
private static function easeNone(t:Number, b:Number, c:Number, d:Number):Number{
return ((t / d));
}
private static function onInitTweenTo(tween:TweenLite, timeline:TimelineMax, fromTime:Number):void{
timeline.paused = true;
if (!isNaN(fromTime)){
timeline.currentTime = fromTime;
};
if (tween.vars.currentTime != timeline.currentTime){
tween.duration = (Math.abs((Number(tween.vars.currentTime) - timeline.currentTime)) / timeline.cachedTimeScale);
};
}
}
}//package com.greensock
Section 41
//TweenLite (com.greensock.TweenLite)
package com.greensock {
import flash.events.*;
import flash.display.*;
import com.greensock.core.*;
import com.greensock.plugins.*;
import flash.utils.*;
public class TweenLite extends TweenCore {
protected var _hasPlugins:Boolean;
public var propTweenLookup:Object;
public var cachedPT1:PropTween;
protected var _overwrite:uint;
protected var _ease:Function;
public var target:Object;
public var ratio:Number;// = 0
protected var _overwrittenProps:Object;
protected var _notifyPluginsOfEnabled:Boolean;
public static const version:Number = 11.36;
public static var rootTimeline:SimpleTimeline;
public static var fastEaseLookup:Dictionary = new Dictionary(false);
public static var onPluginEvent:Function;
public static var rootFramesTimeline:SimpleTimeline;
public static var defaultEase:Function = TweenLite.easeOut;
public static var plugins:Object = {};
public static var masterList:Dictionary = new Dictionary(false);
public static var overwriteManager:Object;
public static var rootFrame:Number;
public static var killDelayedCallsTo:Function = TweenLite.killTweensOf;
private static var _shape:Shape = new Shape();
protected static var _reservedProps:Object = {ease:1, delay:1, overwrite:1, onComplete:1, onCompleteParams:1, useFrames:1, runBackwards:1, startAt:1, onUpdate:1, onUpdateParams:1, roundProps:1, onStart:1, onStartParams:1, onInit:1, onInitParams:1, onReverseComplete:1, onReverseCompleteParams:1, onRepeat:1, onRepeatParams:1, proxiedEase:1, easeParams:1, yoyo:1, onCompleteListener:1, onUpdateListener:1, onStartListener:1, onReverseCompleteListener:1, onRepeatListener:1, orientToBezier:1, timeScale:1, immediateRender:1, repeat:1, repeatDelay:1, timeline:1, data:1, paused:1};
public function TweenLite(target:Object, duration:Number, vars:Object){
var sibling:TweenLite;
super(duration, vars);
this.target = target;
if ((((this.target is TweenCore)) && (this.vars.timeScale))){
this.cachedTimeScale = 1;
};
propTweenLookup = {};
_ease = defaultEase;
_overwrite = (((!((Number(vars.overwrite) > -1))) || (((!(overwriteManager.enabled)) && ((vars.overwrite > 1)))))) ? overwriteManager.mode : int(vars.overwrite);
var a:Array = masterList[target];
if (!a){
masterList[target] = [this];
} else {
if (_overwrite == 1){
for each (sibling in a) {
if (!sibling.gc){
sibling.setEnabled(false, false);
};
};
masterList[target] = [this];
} else {
a[a.length] = this;
};
};
if (((this.active) || (this.vars.immediateRender))){
renderTime(0, false, true);
};
}
protected function easeProxy(t:Number, b:Number, c:Number, d:Number):Number{
return (this.vars.proxiedEase.apply(null, arguments.concat(this.vars.easeParams)));
}
override public function renderTime(time:Number, suppressEvents:Boolean=false, force:Boolean=false):void{
var isComplete:Boolean;
var prevTime:Number = this.cachedTime;
if (time >= this.cachedDuration){
this.cachedTotalTime = (this.cachedTime = this.cachedDuration);
this.ratio = 1;
isComplete = true;
if (this.cachedDuration == 0){
if ((((((time == 0)) || ((_rawPrevTime < 0)))) && (!((_rawPrevTime == time))))){
force = true;
};
_rawPrevTime = time;
};
} else {
if (time <= 0){
this.cachedTotalTime = (this.cachedTime = (this.ratio = 0));
if (time < 0){
this.active = false;
if (this.cachedDuration == 0){
if (_rawPrevTime > 0){
force = true;
isComplete = true;
};
_rawPrevTime = time;
};
};
if (((this.cachedReversed) && (!((prevTime == 0))))){
isComplete = true;
};
} else {
this.cachedTotalTime = (this.cachedTime = time);
this.ratio = _ease(time, 0, 1, this.cachedDuration);
};
};
if ((((this.cachedTime == prevTime)) && (!(force)))){
return;
};
if (!this.initted){
init();
if (((!(isComplete)) && (this.cachedTime))){
this.ratio = _ease(this.cachedTime, 0, 1, this.cachedDuration);
};
};
if (((!(this.active)) && (!(this.cachedPaused)))){
this.active = true;
};
if ((((((((prevTime == 0)) && (this.vars.onStart))) && (!((this.cachedTime == 0))))) && (!(suppressEvents)))){
this.vars.onStart.apply(null, this.vars.onStartParams);
};
var pt:PropTween = this.cachedPT1;
while (pt) {
pt.target[pt.property] = (pt.start + (this.ratio * pt.change));
pt = pt.nextNode;
};
if (((_hasUpdate) && (!(suppressEvents)))){
this.vars.onUpdate.apply(null, this.vars.onUpdateParams);
};
if (isComplete){
if (((_hasPlugins) && (this.cachedPT1))){
onPluginEvent("onComplete", this);
};
complete(true, suppressEvents);
};
}
override public function setEnabled(enabled:Boolean, ignoreTimeline:Boolean=false):Boolean{
var a:Array;
if (enabled){
a = TweenLite.masterList[this.target];
if (!a){
TweenLite.masterList[this.target] = [this];
} else {
a[a.length] = this;
};
};
super.setEnabled(enabled, ignoreTimeline);
if (((_notifyPluginsOfEnabled) && (this.cachedPT1))){
return (onPluginEvent((enabled) ? "onEnable" : "onDisable", this));
};
return (false);
}
protected function init():void{
var p:String;
var i:int;
var plugin:*;
var prioritize:Boolean;
var siblings:Array;
var pt:PropTween;
if (this.vars.onInit){
this.vars.onInit.apply(null, this.vars.onInitParams);
};
if (typeof(this.vars.ease) == "function"){
_ease = this.vars.ease;
};
if (this.vars.easeParams){
this.vars.proxiedEase = _ease;
_ease = easeProxy;
};
this.cachedPT1 = null;
this.propTweenLookup = {};
for (p in this.vars) {
if ((((p in _reservedProps)) && (!((((p == "timeScale")) && ((this.target is TweenCore))))))){
} else {
if ((((p in plugins)) && (new ((plugins[p] as Class)).onInitTween(this.target, this.vars[p], this)))){
this.cachedPT1 = new PropTween(plugin, "changeFactor", 0, 1, ((plugin.overwriteProps.length)==1) ? plugin.overwriteProps[0] : "_MULTIPLE_", true, this.cachedPT1);
if (this.cachedPT1.name == "_MULTIPLE_"){
i = plugin.overwriteProps.length;
while (--i > -1) {
this.propTweenLookup[plugin.overwriteProps[i]] = this.cachedPT1;
};
} else {
this.propTweenLookup[this.cachedPT1.name] = this.cachedPT1;
};
if (plugin.priority){
this.cachedPT1.priority = plugin.priority;
prioritize = true;
};
if (((plugin.onDisable) || (plugin.onEnable))){
_notifyPluginsOfEnabled = true;
};
_hasPlugins = true;
} else {
this.cachedPT1 = new PropTween(this.target, p, Number(this.target[p]), ((typeof(this.vars[p]))=="number") ? (Number(this.vars[p]) - this.target[p]) : Number(this.vars[p]), p, false, this.cachedPT1);
this.propTweenLookup[p] = this.cachedPT1;
};
};
};
if (prioritize){
onPluginEvent("onInit", this);
};
if (this.vars.runBackwards){
pt = this.cachedPT1;
while (pt) {
pt.start = (pt.start + pt.change);
pt.change = -(pt.change);
pt = pt.nextNode;
};
};
_hasUpdate = Boolean(!((this.vars.onUpdate == null)));
if (_overwrittenProps){
killVars(_overwrittenProps);
if (this.cachedPT1 == null){
this.setEnabled(false, false);
};
};
if ((((((((_overwrite > 1)) && (this.cachedPT1))) && (masterList[this.target]))) && ((siblings.length > 1)))){
if (overwriteManager.manageOverwrites(this, this.propTweenLookup, siblings, _overwrite)){
init();
};
};
this.initted = true;
}
public function killVars(vars:Object, permanent:Boolean=true):Boolean{
var p:String;
var pt:PropTween;
var changed:Boolean;
if (_overwrittenProps == null){
_overwrittenProps = {};
};
for (p in vars) {
if ((p in propTweenLookup)){
pt = propTweenLookup[p];
if (((pt.isPlugin) && ((pt.name == "_MULTIPLE_")))){
pt.target.killProps(vars);
if (pt.target.overwriteProps.length == 0){
pt.name = "";
};
};
if (pt.name != "_MULTIPLE_"){
if (pt.nextNode){
pt.nextNode.prevNode = pt.prevNode;
};
if (pt.prevNode){
pt.prevNode.nextNode = pt.nextNode;
} else {
if (this.cachedPT1 == pt){
this.cachedPT1 = pt.nextNode;
};
};
if (((pt.isPlugin) && (pt.target.onDisable))){
pt.target.onDisable();
if (pt.target.activeDisable){
changed = true;
};
};
delete propTweenLookup[p];
};
};
if (((permanent) && (!((vars == _overwrittenProps))))){
_overwrittenProps[p] = 1;
};
};
return (changed);
}
override public function invalidate():void{
if (((_notifyPluginsOfEnabled) && (this.cachedPT1))){
onPluginEvent("onDisable", this);
};
this.cachedPT1 = null;
_overwrittenProps = null;
_hasUpdate = (this.initted = (this.active = (_notifyPluginsOfEnabled = false)));
this.propTweenLookup = {};
}
public static function initClass():void{
rootFrame = 0;
rootTimeline = new SimpleTimeline(null);
rootFramesTimeline = new SimpleTimeline(null);
rootTimeline.cachedStartTime = (getTimer() * 0.001);
rootFramesTimeline.cachedStartTime = rootFrame;
rootTimeline.autoRemoveChildren = true;
rootFramesTimeline.autoRemoveChildren = true;
_shape.addEventListener(Event.ENTER_FRAME, updateAll, false, 0, true);
if (overwriteManager == null){
overwriteManager = {mode:1, enabled:false};
};
}
public static function killTweensOf(target:Object, complete:Boolean=false, vars:Object=null):void{
var a:Array;
var i:int;
var tween:TweenLite;
if ((target in masterList)){
a = masterList[target];
i = a.length;
while (--i > -1) {
tween = a[i];
if (!tween.gc){
if (complete){
tween.complete(false, false);
};
if (vars != null){
tween.killVars(vars);
};
if ((((vars == null)) || ((((tween.cachedPT1 == null)) && (tween.initted))))){
tween.setEnabled(false, false);
};
};
};
if (vars == null){
delete masterList[target];
};
};
}
public static function from(target:Object, duration:Number, vars:Object):TweenLite{
vars.runBackwards = true;
if (!("immediateRender" in vars)){
vars.immediateRender = true;
};
return (new TweenLite(target, duration, vars));
}
protected static function easeOut(t:Number, b:Number, c:Number, d:Number):Number{
t = (1 - (t / d));
return ((1 - (t * t)));
}
public static function delayedCall(delay:Number, onComplete:Function, onCompleteParams:Array=null, useFrames:Boolean=false):TweenLite{
return (new TweenLite(onComplete, 0, {delay:delay, onComplete:onComplete, onCompleteParams:onCompleteParams, immediateRender:false, useFrames:useFrames, overwrite:0}));
}
protected static function updateAll(e:Event=null):void{
var ml:Dictionary;
var tgt:Object;
var a:Array;
var i:int;
rootTimeline.renderTime((((getTimer() * 0.001) - rootTimeline.cachedStartTime) * rootTimeline.cachedTimeScale), false, false);
rootFrame++;
rootFramesTimeline.renderTime(((rootFrame - rootFramesTimeline.cachedStartTime) * rootFramesTimeline.cachedTimeScale), false, false);
if (!(rootFrame % 60)){
ml = masterList;
for (tgt in ml) {
a = ml[tgt];
i = a.length;
while (--i > -1) {
if (TweenLite(a[i]).gc){
a.splice(i, 1);
};
};
if (a.length == 0){
delete ml[tgt];
};
};
};
}
public static function to(target:Object, duration:Number, vars:Object):TweenLite{
return (new TweenLite(target, duration, vars));
}
}
}//package com.greensock
Section 42
//TweenMax (com.greensock.TweenMax)
package com.greensock {
import flash.events.*;
import flash.display.*;
import com.greensock.core.*;
import com.greensock.plugins.*;
import com.greensock.events.*;
import flash.utils.*;
public class TweenMax extends TweenLite implements IEventDispatcher {
protected var _cyclesComplete:uint;// = 0
protected var _dispatcher:EventDispatcher;
protected var _hasUpdateListener:Boolean;
protected var _easeType:uint;
protected var _repeatDelay:Number;// = 0
public var yoyo:Boolean;
protected var _easePower:uint;
protected var _repeat:int;// = 0
public static const version:Number = 11.37;
private static var _overwriteMode:int = (OverwriteManager.enabled) ? OverwriteManager.mode : OverwriteManager.init(2);
;
public static var killTweensOf:Function = TweenLite.killTweensOf;
public static var killDelayedCallsTo:Function = TweenLite.killTweensOf;
public function TweenMax(target:Object, duration:Number, vars:Object){
super(target, duration, vars);
if (TweenLite.version < 11.2){
throw (new Error("TweenMax error! Please update your TweenLite class or try deleting your ASO files. TweenMax requires a more recent version. Download updates at http://www.TweenMax.com."));
};
this.yoyo = Boolean(this.vars.yoyo);
_repeat = (this.vars.repeat) ? int(this.vars.repeat) : 0;
_repeatDelay = (this.vars.repeatDelay) ? Number(this.vars.repeatDelay) : 0;
this.cacheIsDirty = true;
if (((((((((((this.vars.onCompleteListener) || (this.vars.onInitListener))) || (this.vars.onUpdateListener))) || (this.vars.onStartListener))) || (this.vars.onRepeatListener))) || (this.vars.onReverseCompleteListener))){
initDispatcher();
if ((((duration == 0)) && ((_delay == 0)))){
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.UPDATE));
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.COMPLETE));
};
};
if (((this.vars.timeScale) && (!((this.target is TweenCore))))){
this.cachedTimeScale = this.vars.timeScale;
};
}
public function dispatchEvent(e:Event):Boolean{
return (((_dispatcher)==null) ? false : _dispatcher.dispatchEvent(e));
}
public function set timeScale(n:Number):void{
if (n == 0){
n = 0.0001;
};
var tlTime:Number = (((_pauseTime) || ((_pauseTime == 0)))) ? _pauseTime : this.timeline.cachedTotalTime;
this.cachedStartTime = (tlTime - (((tlTime - this.cachedStartTime) * this.cachedTimeScale) / n));
this.cachedTimeScale = n;
setDirtyCache(false);
}
override public function renderTime(time:Number, suppressEvents:Boolean=false, force:Boolean=false):void{
var isComplete:Boolean;
var repeated:Boolean;
var setRatio:Boolean;
var cycleDuration:Number;
var prevCycles:int;
var power:int;
var val:Number;
var totalDur:Number = (this.cacheIsDirty) ? this.totalDuration : this.cachedTotalDuration;
var prevTime:Number = this.cachedTime;
if (time >= totalDur){
this.cachedTotalTime = totalDur;
this.cachedTime = this.cachedDuration;
this.ratio = 1;
isComplete = true;
if (this.cachedDuration == 0){
if ((((((time == 0)) || ((_rawPrevTime < 0)))) && (!((_rawPrevTime == time))))){
force = true;
};
_rawPrevTime = time;
};
} else {
if (time <= 0){
if (time < 0){
this.active = false;
if (this.cachedDuration == 0){
if (_rawPrevTime > 0){
force = true;
isComplete = true;
};
_rawPrevTime = time;
};
};
this.cachedTotalTime = (this.cachedTime = (this.ratio = 0));
if (((this.cachedReversed) && (!((prevTime == 0))))){
isComplete = true;
};
} else {
this.cachedTotalTime = (this.cachedTime = time);
setRatio = true;
};
};
if (_repeat != 0){
cycleDuration = (this.cachedDuration + _repeatDelay);
if (isComplete){
if (((this.yoyo) && ((_repeat % 2)))){
this.cachedTime = (this.ratio = 0);
};
} else {
if (time > 0){
prevCycles = _cyclesComplete;
_cyclesComplete = int((this.cachedTotalTime / cycleDuration));
if (_cyclesComplete == (this.cachedTotalTime / cycleDuration)){
_cyclesComplete--;
};
if (prevCycles != _cyclesComplete){
repeated = true;
};
this.cachedTime = (((this.cachedTotalTime / cycleDuration) - _cyclesComplete) * cycleDuration);
if (((this.yoyo) && ((_cyclesComplete % 2)))){
this.cachedTime = (this.cachedDuration - this.cachedTime);
} else {
if (this.cachedTime >= this.cachedDuration){
this.cachedTime = this.cachedDuration;
this.ratio = 1;
setRatio = false;
};
};
if (this.cachedTime <= 0){
this.cachedTime = (this.ratio = 0);
setRatio = false;
};
};
};
};
if ((((prevTime == this.cachedTime)) && (!(force)))){
return;
};
if (!this.initted){
init();
};
if (((!(this.active)) && (!(this.cachedPaused)))){
this.active = true;
};
if (setRatio){
if (_easeType){
power = _easePower;
val = (this.cachedTime / this.cachedDuration);
if (_easeType == 2){
val = (1 - val);
this.ratio = val;
while (--power > -1) {
this.ratio = (val * this.ratio);
};
this.ratio = (1 - this.ratio);
} else {
if (_easeType == 1){
this.ratio = val;
while (--power > -1) {
this.ratio = (val * this.ratio);
};
} else {
if (val < 0.5){
val = (val * 2);
this.ratio = val;
while (--power > -1) {
this.ratio = (val * this.ratio);
};
this.ratio = (this.ratio * 0.5);
} else {
val = ((1 - val) * 2);
this.ratio = val;
while (--power > -1) {
this.ratio = (val * this.ratio);
};
this.ratio = (1 - (0.5 * this.ratio));
};
};
};
} else {
this.ratio = _ease(this.cachedTime, 0, 1, this.cachedDuration);
};
};
if ((((((prevTime == 0)) && (!((this.cachedTotalTime == 0))))) && (!(suppressEvents)))){
if (this.vars.onStart){
this.vars.onStart.apply(null, this.vars.onStartParams);
};
if (_dispatcher){
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.START));
};
};
var pt:PropTween = this.cachedPT1;
while (pt) {
pt.target[pt.property] = (pt.start + (this.ratio * pt.change));
pt = pt.nextNode;
};
if (((_hasUpdate) && (!(suppressEvents)))){
this.vars.onUpdate.apply(null, this.vars.onUpdateParams);
};
if (((_hasUpdateListener) && (!(suppressEvents)))){
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.UPDATE));
};
if (isComplete){
if (((_hasPlugins) && (this.cachedPT1))){
onPluginEvent("onComplete", this);
};
complete(true, suppressEvents);
} else {
if (((repeated) && (!(suppressEvents)))){
if (this.vars.onRepeat){
this.vars.onRepeat.apply(null, this.vars.onRepeatParams);
};
if (_dispatcher){
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.REPEAT));
};
};
};
}
override public function set totalDuration(n:Number):void{
if (_repeat == -1){
return;
};
this.duration = ((n - (_repeat * _repeatDelay)) / (_repeat + 1));
}
public function addEventListener(type:String, listener:Function, useCapture:Boolean=false, priority:int=0, useWeakReference:Boolean=false):void{
if (_dispatcher == null){
initDispatcher();
};
if (type == TweenEvent.UPDATE){
_hasUpdateListener = true;
};
_dispatcher.addEventListener(type, listener, useCapture, priority, useWeakReference);
}
protected function insertPropTween(target:Object, property:String, start:Number, end, name:String, isPlugin:Boolean, nextNode:PropTween):PropTween{
var op:Array;
var i:int;
var pt:PropTween = new PropTween(target, property, start, ((typeof(end))=="number") ? (end - start) : Number(end), name, isPlugin, nextNode);
if (((isPlugin) && ((name == "_MULTIPLE_")))){
op = target.overwriteProps;
i = op.length;
while (--i > -1) {
this.propTweenLookup[op[i]] = pt;
};
} else {
this.propTweenLookup[name] = pt;
};
return (pt);
}
override protected function init():void{
var startTween:TweenMax;
var j:int;
var prop:String;
var multiProps:String;
var rp:Array;
var plugin:Object;
var ptPlugin:PropTween;
var pt:PropTween;
var i:int;
if (this.vars.startAt){
this.vars.startAt.overwrite = 0;
this.vars.startAt.immediateRender = true;
startTween = new TweenMax(this.target, 0, this.vars.startAt);
};
if (_dispatcher){
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.INIT));
};
super.init();
if ((_ease in fastEaseLookup)){
_easeType = fastEaseLookup[_ease][0];
_easePower = fastEaseLookup[_ease][1];
};
if (((!((this.vars.roundProps == null))) && (("roundProps" in TweenLite.plugins)))){
rp = this.vars.roundProps;
i = rp.length;
while (--i > -1) {
prop = rp[i];
pt = this.cachedPT1;
while (pt) {
if (pt.name == prop){
if (pt.isPlugin){
pt.target.round = true;
} else {
if (plugin == null){
plugin = new TweenLite.plugins.roundProps();
plugin.add(pt.target, prop, pt.start, pt.change);
_hasPlugins = true;
ptPlugin = insertPropTween(plugin, "changeFactor", 0, 1, "_MULTIPLE_", true, this.cachedPT1);
this.cachedPT1 = ptPlugin;
} else {
plugin.add(pt.target, prop, pt.start, pt.change);
};
this.removePropTween(pt);
this.propTweenLookup[prop] = ptPlugin;
};
} else {
if (((((pt.isPlugin) && ((pt.name == "_MULTIPLE_")))) && (!(pt.target.round)))){
multiProps = ((" " + pt.target.overwriteProps.join(" ")) + " ");
if (multiProps.indexOf(((" " + prop) + " ")) != -1){
pt.target.round = true;
};
};
};
pt = pt.nextNode;
};
};
};
}
public function removeEventListener(type:String, listener:Function, useCapture:Boolean=false):void{
if (_dispatcher){
_dispatcher.removeEventListener(type, listener, useCapture);
};
}
public function setDestination(property:String, value, adjustStartValues:Boolean=true):void{
var vars:Object = {};
vars[property] = value;
updateTo(vars, !(adjustStartValues));
}
public function willTrigger(type:String):Boolean{
return (((_dispatcher)==null) ? false : _dispatcher.willTrigger(type));
}
public function hasEventListener(type:String):Boolean{
return (((_dispatcher)==null) ? false : _dispatcher.hasEventListener(type));
}
protected function initDispatcher():void{
if (_dispatcher == null){
_dispatcher = new EventDispatcher(this);
};
if ((this.vars.onInitListener is Function)){
_dispatcher.addEventListener(TweenEvent.INIT, this.vars.onInitListener, false, 0, true);
};
if ((this.vars.onStartListener is Function)){
_dispatcher.addEventListener(TweenEvent.START, this.vars.onStartListener, false, 0, true);
};
if ((this.vars.onUpdateListener is Function)){
_dispatcher.addEventListener(TweenEvent.UPDATE, this.vars.onUpdateListener, false, 0, true);
_hasUpdateListener = true;
};
if ((this.vars.onCompleteListener is Function)){
_dispatcher.addEventListener(TweenEvent.COMPLETE, this.vars.onCompleteListener, false, 0, true);
};
if ((this.vars.onRepeatListener is Function)){
_dispatcher.addEventListener(TweenEvent.REPEAT, this.vars.onRepeatListener, false, 0, true);
};
if ((this.vars.onReverseCompleteListener is Function)){
_dispatcher.addEventListener(TweenEvent.REVERSE_COMPLETE, this.vars.onReverseCompleteListener, false, 0, true);
};
}
public function set currentProgress(n:Number):void{
if (_cyclesComplete == 0){
setTotalTime((this.duration * n), false);
} else {
setTotalTime(((this.duration * n) + (_cyclesComplete * this.cachedDuration)), false);
};
}
public function get totalProgress():Number{
return ((this.cachedTotalTime / this.totalDuration));
}
public function set totalProgress(n:Number):void{
setTotalTime((this.totalDuration * n), false);
}
protected function removePropTween(propTween:PropTween):Boolean{
if (propTween.nextNode){
propTween.nextNode.prevNode = propTween.prevNode;
};
if (propTween.prevNode){
propTween.prevNode.nextNode = propTween.nextNode;
} else {
if (this.cachedPT1 == propTween){
this.cachedPT1 = propTween.nextNode;
};
};
if (((propTween.isPlugin) && (propTween.target.onDisable))){
propTween.target.onDisable();
if (propTween.target.activeDisable){
return (true);
};
};
return (false);
}
public function get currentProgress():Number{
return ((this.cachedTime / this.duration));
}
public function get repeat():int{
return (_repeat);
}
public function updateTo(vars:Object, resetDuration:Boolean=false):void{
var p:String;
var inv:Number;
var pt:PropTween;
var endValue:Number;
var curRatio:Number = this.ratio;
if (((((resetDuration) && (!((this.timeline == null))))) && ((this.cachedStartTime < this.timeline.cachedTime)))){
this.cachedStartTime = this.timeline.cachedTime;
this.setDirtyCache(false);
if (this.gc){
this.setEnabled(true, false);
} else {
this.timeline.addChild(this);
};
};
for (p in vars) {
this.vars[p] = vars[p];
};
if (this.initted){
this.initted = false;
if (!resetDuration){
init();
if (((((!(resetDuration)) && ((this.cachedTime > 0)))) && ((this.cachedTime < this.cachedDuration)))){
inv = (1 / (1 - curRatio));
pt = this.cachedPT1;
while (pt) {
endValue = (pt.start + pt.change);
pt.change = (pt.change * inv);
pt.start = (endValue - pt.change);
pt = pt.nextNode;
};
};
};
};
}
override public function set currentTime(n:Number):void{
if (_cyclesComplete == 0){
} else {
if (((this.yoyo) && (((_cyclesComplete % 2) == 1)))){
n = ((this.duration - n) + (_cyclesComplete * (this.cachedDuration + _repeatDelay)));
} else {
n = (n + (_cyclesComplete * (this.duration + _repeatDelay)));
};
};
setTotalTime(n, false);
}
public function get repeatDelay():Number{
return (_repeatDelay);
}
public function killProperties(names:Array):void{
var v:Object = {};
var i:int = names.length;
while (--i > -1) {
v[names[i]] = true;
};
killVars(v);
}
public function set repeatDelay(n:Number):void{
_repeatDelay = n;
setDirtyCache(true);
}
public function set repeat(n:int):void{
_repeat = n;
setDirtyCache(true);
}
override public function complete(skipRender:Boolean=false, suppressEvents:Boolean=false):void{
super.complete(skipRender, suppressEvents);
if (((!(suppressEvents)) && (_dispatcher))){
if ((((this.cachedTotalTime == this.cachedTotalDuration)) && (!(this.cachedReversed)))){
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.COMPLETE));
} else {
if (((this.cachedReversed) && ((this.cachedTotalTime == 0)))){
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.REVERSE_COMPLETE));
};
};
};
}
override public function invalidate():void{
this.yoyo = Boolean((this.vars.yoyo == true));
_repeat = (this.vars.repeat) ? Number(this.vars.repeat) : 0;
_repeatDelay = (this.vars.repeatDelay) ? Number(this.vars.repeatDelay) : 0;
_hasUpdateListener = false;
if (((((!((this.vars.onCompleteListener == null))) || (!((this.vars.onUpdateListener == null))))) || (!((this.vars.onStartListener == null))))){
initDispatcher();
};
setDirtyCache(true);
super.invalidate();
}
public function get timeScale():Number{
return (this.cachedTimeScale);
}
override public function get totalDuration():Number{
if (this.cacheIsDirty){
this.cachedTotalDuration = ((_repeat)==-1) ? 999999999999 : ((this.cachedDuration * (_repeat + 1)) + (_repeatDelay * _repeat));
this.cacheIsDirty = false;
};
return (this.cachedTotalDuration);
}
public static function set globalTimeScale(n:Number):void{
if (n == 0){
n = 0.0001;
};
if (TweenLite.rootTimeline == null){
TweenLite.to({}, 0, {});
};
var tl:SimpleTimeline = TweenLite.rootTimeline;
var curTime:Number = (getTimer() * 0.001);
tl.cachedStartTime = (curTime - (((curTime - tl.cachedStartTime) * tl.cachedTimeScale) / n));
tl = TweenLite.rootFramesTimeline;
curTime = TweenLite.rootFrame;
tl.cachedStartTime = (curTime - (((curTime - tl.cachedStartTime) * tl.cachedTimeScale) / n));
TweenLite.rootFramesTimeline.cachedTimeScale = (TweenLite.rootTimeline.cachedTimeScale = n);
}
public static function fromTo(target:Object, duration:Number, fromVars:Object, toVars:Object):TweenMax{
toVars.startAt = fromVars;
if (fromVars.immediateRender){
toVars.immediateRender = true;
};
return (new TweenMax(target, duration, toVars));
}
public static function allFromTo(targets:Array, duration:Number, fromVars:Object, toVars:Object, stagger:Number=0, onCompleteAll:Function=null, onCompleteAllParams:Array=null):Array{
toVars.startAt = fromVars;
if (fromVars.immediateRender){
toVars.immediateRender = true;
};
return (allTo(targets, duration, toVars, stagger, onCompleteAll, onCompleteAllParams));
}
public static function pauseAll(tweens:Boolean=true, delayedCalls:Boolean=true):void{
changePause(true, tweens, delayedCalls);
}
public static function getTweensOf(target:Object):Array{
var i:int;
var cnt:uint;
var a:Array = masterList[target];
var toReturn:Array = [];
if (a){
i = a.length;
cnt = 0;
while (--i > -1) {
if (!a[i].gc){
var _temp1 = cnt;
cnt = (cnt + 1);
var _local6 = _temp1;
toReturn[_local6] = a[i];
};
};
};
return (toReturn);
}
public static function get globalTimeScale():Number{
return (((TweenLite.rootTimeline)==null) ? 1 : TweenLite.rootTimeline.cachedTimeScale);
}
public static function killChildTweensOf(parent:DisplayObjectContainer, complete:Boolean=false):void{
var curTarget:Object;
var curParent:DisplayObjectContainer;
var a:Array = getAllTweens();
var i:int = a.length;
while (--i > -1) {
curTarget = a[i].target;
if ((curTarget is DisplayObject)){
curParent = curTarget.parent;
while (curParent) {
if (curParent == parent){
if (complete){
a[i].complete(false);
} else {
a[i].setEnabled(false, false);
};
};
curParent = curParent.parent;
};
};
};
}
public static function delayedCall(delay:Number, onComplete:Function, onCompleteParams:Array=null, useFrames:Boolean=false):TweenMax{
return (new TweenMax(onComplete, 0, {delay:delay, onComplete:onComplete, onCompleteParams:onCompleteParams, immediateRender:false, useFrames:useFrames, overwrite:0}));
}
public static function isTweening(target:Object):Boolean{
var tween:TweenLite;
var a:Array = getTweensOf(target);
var i:int = a.length;
while (--i > -1) {
tween = a[i];
if (((tween.active) || ((((tween.cachedStartTime == tween.timeline.cachedTime)) && (tween.timeline.active))))){
return (true);
};
};
return (false);
}
public static function killAll(complete:Boolean=false, tweens:Boolean=true, delayedCalls:Boolean=true):void{
var isDC:Boolean;
var a:Array = getAllTweens();
var i:int = a.length;
while (--i > -1) {
isDC = (a[i].target == a[i].vars.onComplete);
if ((((isDC == delayedCalls)) || (!((isDC == tweens))))){
if (complete){
a[i].complete(false);
} else {
a[i].setEnabled(false, false);
};
};
};
}
private static function changePause(pause:Boolean, tweens:Boolean=true, delayedCalls:Boolean=false):void{
var isDC:Boolean;
var a:Array = getAllTweens();
var i:int = a.length;
while (--i > -1) {
isDC = (TweenLite(a[i]).target == TweenLite(a[i]).vars.onComplete);
if ((((isDC == delayedCalls)) || (!((isDC == tweens))))){
TweenCore(a[i]).paused = pause;
};
};
}
public static function from(target:Object, duration:Number, vars:Object):TweenMax{
vars.runBackwards = true;
if (!("immediateRender" in vars)){
vars.immediateRender = true;
};
return (new TweenMax(target, duration, vars));
}
public static function allFrom(targets:Array, duration:Number, vars:Object, stagger:Number=0, onCompleteAll:Function=null, onCompleteAllParams:Array=null):Array{
vars.runBackwards = true;
if (!("immediateRender" in vars)){
vars.immediateRender = true;
};
return (allTo(targets, duration, vars, stagger, onCompleteAll, onCompleteAllParams));
}
public static function getAllTweens():Array{
var a:Array;
var i:int;
var ml:Dictionary = masterList;
var cnt:uint;
var toReturn:Array = [];
for each (a in ml) {
i = a.length;
while (--i > -1) {
if (!TweenLite(a[i]).gc){
var _temp1 = cnt;
cnt = (cnt + 1);
var _local8 = _temp1;
toReturn[_local8] = a[i];
};
};
};
return (toReturn);
}
public static function resumeAll(tweens:Boolean=true, delayedCalls:Boolean=true):void{
changePause(false, tweens, delayedCalls);
}
public static function to(target:Object, duration:Number, vars:Object):TweenMax{
return (new TweenMax(target, duration, vars));
}
public static function allTo(targets:Array, duration:Number, vars:Object, stagger:Number=0, onCompleteAll:Function=null, onCompleteAllParams:Array=null):Array{
var i:int;
var varsDup:Object;
var p:String;
var onCompleteProxy:Function;
var onCompleteParamsProxy:Array;
var targets = targets;
var duration = duration;
var vars = vars;
var stagger = stagger;
var onCompleteAll = onCompleteAll;
var onCompleteAllParams = onCompleteAllParams;
var l:uint = targets.length;
var a:Array = [];
var curDelay:Number = (("delay" in vars)) ? Number(vars.delay) : 0;
onCompleteProxy = vars.onComplete;
onCompleteParamsProxy = vars.onCompleteParams;
var lastIndex:int = ((stagger)<=0) ? 0 : (l - 1);
i = 0;
while (i < l) {
varsDup = {};
for (p in vars) {
varsDup[p] = vars[p];
};
varsDup.delay = curDelay;
if ((((i == lastIndex)) && (!((onCompleteAll == null))))){
varsDup.onComplete = function ():void{
if (onCompleteProxy != null){
onCompleteProxy.apply(null, onCompleteParamsProxy);
};
onCompleteAll.apply(null, onCompleteAllParams);
};
};
a[a.length] = new TweenMax(targets[i], duration, varsDup);
curDelay = (curDelay + stagger);
i = (i + 1);
};
return (a);
}
TweenPlugin.activate([AutoAlphaPlugin, EndArrayPlugin, FramePlugin, RemoveTintPlugin, TintPlugin, VisiblePlugin, VolumePlugin, BevelFilterPlugin, BezierPlugin, BezierThroughPlugin, BlurFilterPlugin, ColorMatrixFilterPlugin, ColorTransformPlugin, DropShadowFilterPlugin, FrameLabelPlugin, GlowFilterPlugin, HexColorsPlugin, RoundPropsPlugin, ShortRotationPlugin, {}]);
}
}//package com.greensock
Section 43
//Debug (com.utils.Debug)
package com.utils {
import flash.utils.*;
public class Debug {
public static var useLocalConnection:Boolean = false;
public function Debug(){
super();
}
public static function shortDump(object:Object):String{
var key:String;
var s:String = "\n";
for (key in object) {
s = (s + (((("\t[" + key) + "]:\t") + object[key]) + "\n"));
};
return (s);
}
public static function getStackTrace():String{
return (new Error("user generated").getStackTrace());
}
public static function error(caller, message:String, newError:Error=null):void{
var s = (((caller.toString() + ":\terror: ") + message) + "\n");
if (newError){
s = (s + ((newError.message + "\n") + newError.getStackTrace()));
};
if (useLocalConnection){
DebugClient.getInstance().sendMessage(s);
};
trace(s);
}
public static function dump(object, indent:String=""):void{
var s:String;
indent = (indent + "\t");
if ((((object is XML)) || ((object is XMLList)))){
if (useLocalConnection){
DebugClient.getInstance().sendMessage(s);
};
trace(object);
} else {
for (s in object) {
trace((indent + s), object[s], getQualifiedClassName(object[s]));
if (useLocalConnection){
DebugClient.getInstance().sendMessage((((((indent + s) + ", ") + object[s]) + ", ") + getQualifiedClassName(object[s])));
};
dump(object[s], indent);
};
};
}
public static function log(caller, ... _args):void{
var s = (caller.toString() + ":\t");
var i:int;
while (i < _args.length) {
s = (s + (String(_args[i]) + " "));
i++;
};
if (useLocalConnection){
DebugClient.getInstance().sendMessage(s);
};
trace(s);
}
}
}//package com.utils
Section 44
//DebugClient (com.utils.DebugClient)
package com.utils {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.net.*;
import com.darkonline.*;
public class DebugClient extends Sprite {
private var sendBtn:Sprite;
private var message:TextField;
private var conn:LocalConnection;
private var messageLabel:TextField;
private static var _instance:DebugClient;
public function DebugClient(){
super();
_instance = this;
conn = new LocalConnection();
conn.addEventListener(StatusEvent.STATUS, onStatus);
trace("DebugClient initialized");
}
private function onStatus(event:StatusEvent):void{
switch (event.level){
case "status":
break;
case "error":
break;
};
}
public function sendMessage(newMessage:String):void{
conn.send(DebugProtocol.LC_NAME, "lcHandler", newMessage);
}
public static function getInstance():DebugClient{
if (_instance){
return (_instance);
};
return (new (DebugClient));
}
}
}//package com.utils
Section 45
//Util (com.utils.Util)
package com.utils {
import flash.display.*;
import flash.geom.*;
import flash.text.*;
import flash.filters.*;
import flash.utils.*;
public class Util {
public function Util(){
super();
}
public static function destroy(object):void{
var z:int;
if (!object){
return;
};
if ((object is MovieClip)){
object.stop();
};
if ((((object is DisplayObject)) && (object.parent))){
object.parent.removeChild(object);
};
if ((object is DisplayObjectContainer)){
z = 0;
while (z < object.numChildren) {
destroy(object.getChildAt(z));
z++;
};
};
object = null;
}
public static function unwrap(s:String):String{
return (s.replace("[", "{").replace(/\~/ig, "\""));
}
public static function getSimpleCopy(object:Object):Object{
var s:String;
var copy:Object = new Object();
for (s in object) {
copy[s] = object[s];
};
return (copy);
}
public static function safelyRemove(displayObject:DisplayObject):void{
if (((displayObject) && (displayObject.parent))){
displayObject.parent.removeChild(displayObject);
};
}
public static function wrap(s:String):String{
return (s.replace("{", "[").replace(/"/ig, "~"));
}
public static function setTextFieldByName(displayObjectContainer:DisplayObjectContainer, fieldName:String, value:String, applyTextFormat:TextFormat=null):TextField{
if (!displayObjectContainer){
Debug.error("Debug", ("couldn't find container " + displayObjectContainer), new Error());
return (null);
};
var tf:TextField = (displayObjectContainer.getChildByName(fieldName) as TextField);
if (tf){
tf.text = value;
if (applyTextFormat){
tf.setTextFormat(applyTextFormat);
};
tf.mouseEnabled = false;
} else {
Debug.error("Debug", ((("couldn't find child " + fieldName) + " in ") + displayObjectContainer));
};
return (tf);
}
public static function traceParent(newParent):void{
Debug.log("trace", newParent, "mouseEnabled", newParent.mouseEnabled, "mouseChildren", newParent.mouseChildren);
if (newParent.parent){
traceParent(newParent.parent);
};
}
public static function getRectFromObject(displayObjectContainer:DisplayObjectContainer, objName:String, remove:Boolean=false, limitScrollRect:Boolean=true):Sprite{
var sprite:Sprite;
if (!displayObjectContainer){
return (null);
};
var child:DisplayObject = displayObjectContainer.getChildByName(objName);
if (!child){
return (null);
};
var rect:Rectangle = child.getRect(displayObjectContainer);
sprite = new Sprite();
sprite.x = rect.x;
sprite.y = rect.y;
sprite.graphics.lineStyle(0.1, 0xFFFFFF, 0.01);
sprite.graphics.drawRect(0, 0, rect.width, rect.height);
if (limitScrollRect){
sprite.scrollRect = new Rectangle(0, 0, rect.width, rect.height);
};
var z:int = (displayObjectContainer.numChildren - 1);
if (remove){
z = displayObjectContainer.getChildIndex(child);
displayObjectContainer.removeChild(child);
};
displayObjectContainer.addChildAt(sprite, z);
return (sprite);
}
public static function createFilter(filterDesc){
var components:Array;
var filter:ColorMatrixFilter;
var s:String;
var filterDesc = filterDesc;
Debug.log("createFilter()", filterDesc.@name, filterDesc.@type);
switch (String(filterDesc.@type)){
case "glow":
return (new GlowFilter(((filterDesc.@color) || (0xFF0000)), ((filterDesc.@alpha) || (1)), ((filterDesc.@blur) || (6)), ((filterDesc.@strength) || (2)), ((filterDesc.@quality) || (1))));
case "colormatrix":
components = filterDesc.split(/,(?=(?:[^\"]*\”[^\"]*\”)*(?![^\"]*\”))/g);
for (s in components) {
components[s] = Number(components[s]);
};
filter = new ColorMatrixFilter(components);
return (filter);
default:
Debug.log("createFilter()", "not defined:", (("[" + filterDesc.@type) + "]"), getQualifiedClassName(filterDesc.@type));
};
//unresolved jump
var _slot1 = error;
Debug.error("Util", "createFilter()", _slot1);
return (null);
return (null);
}
public static function center(container:DisplayObjectContainer, child:DisplayObject):void{
var container = container;
var child = child;
child.x = (container.x + ((container.width - child.width) / 2));
child.y = (container.y + ((container.height - child.height) / 2));
//unresolved jump
var _slot1 = error;
Debug.log("addAndCenter", _slot1);
}
public static function removeChildByName(displayObjectContainer:DisplayObjectContainer, childName:String):void{
var child:DisplayObject = displayObjectContainer.getChildByName(childName);
if (child){
displayObjectContainer.removeChild(child);
};
}
public static function safelyRemoveChildren(displayObjectContainer:DisplayObjectContainer):void{
if (displayObjectContainer){
while (displayObjectContainer.numChildren) {
displayObjectContainer.removeChildAt(0);
};
};
}
public static function sortMap(map:Object, options=0):Array{
var key:String;
var array:Array = [];
for (key in map) {
if (map[key]){
array.push(key);
};
};
array.sort(options);
return (array);
}
}
}//package com.utils
Section 46
//Aftermath (dialog.Aftermath)
package dialog {
import flash.events.*;
import game.*;
import flash.display.*;
import statics.*;
import moving.craft.*;
import com.greensock.*;
import mochi.as3.*;
import flash.utils.*;
import flash.text.*;
import com.greensock.easing.*;
import com.utils.*;
public class Aftermath extends Sprite {
private var _gameOverMode:Boolean;
private var _menu:MovieClip;
public function Aftermath(gameOver:Boolean, levelScore:int, totalScore:int, levelCoins:int){
var text:String;
super();
_gameOverMode = gameOver;
Settings.level = (gameOver) ? 0 : (Settings.level + 1);
graphics.beginFill(0, 0.25);
graphics.drawRect(0, 0, 500, 500);
Settings.score = totalScore;
if (gameOver){
text = "GAME OVER";
} else {
if (Settings.level == 5){
text = "YOU WIN!";
_gameOverMode = true;
} else {
text = "LEVEL COMPLETED!";
};
};
createTextField(text, 250, 50);
createTextField(("LEVEL SCORE:\t" + levelScore), 500, 150);
createTextField(("COINS COLLECTED:\t" + levelCoins), 750, 200);
createTextField(("TOTAL SCORE:\t" + totalScore), 1000, 250);
var coinsBonus = (("" + (levelCoins * 1000)) + " PTS");
if (!gameOver){
if (levelCoins >= 50){
coinsBonus = "MEGABONUS!";
Craft.getInstance().restoreLife();
Craft.getInstance().powerup();
Craft.getInstance().restoreShield();
} else {
if (levelCoins >= 30){
coinsBonus = "EXTRA LIFE!";
Craft.getInstance().restoreLife();
} else {
if (levelCoins >= 20){
coinsBonus = "POWER UP!";
Craft.getInstance().powerup();
} else {
if (levelCoins >= 10){
Craft.getInstance().restoreShield();
coinsBonus = "SHIELD";
};
};
};
};
};
createTextField(("COINS BONUS: " + coinsBonus), 1750, 300, 0.5, 0xFF9000);
createTextField("CLICK TO CONTINUE", 1500, 350, 0.01);
addEventListener(MouseEvent.MOUSE_DOWN, onMouseEvent, false, 0, true);
}
private function createTextField(text:String, t:Number, y:Number, seconds:Number=0.5, color:uint=32):void{
var text = text;
var t = t;
var y = y;
var seconds = seconds;
var color = color;
setTimeout(function ():void{
var sprite:Sprite;
var tf:TextField = new TextField();
tf.embedFonts = true;
tf.defaultTextFormat = new TextFormat("THE_FONT", 24, 0xFFFFFF);
tf.text = text;
tf.selectable = false;
tf.autoSize = TextFieldAutoSize.LEFT;
tf.x = ((Protocol.SCREEN_WIDTH - tf.textWidth) / 2);
sprite = new Sprite();
sprite.graphics.beginFill(color, 0.5);
sprite.graphics.drawRect(0, 0, Protocol.SCREEN_WIDTH, 40);
sprite.addChild(tf);
addChild(sprite);
sprite.y = y;
TweenMax.from(sprite, seconds, {x:-(Protocol.SCREEN_WIDTH), ease:Expo.easeOut});
}, t);
}
private function onMouseEvent(mouseEvent:MouseEvent):void{
TweenMax.to(this, 0.33, {x:500, onComplete:die, ease:Expo.easeOut});
}
private function die():void{
TweenMax.killAll();
Util.safelyRemoveChildren(Settings.root);
if (_gameOverMode){
MainMenu.getInstance().submit();
} else {
MochiAd.showInterLevelAd({clip:Settings.root, id:"1c5e2f3c7fa00457", res:"500x500", ad_finished:Game.getInstance().start});
};
}
}
var _local1:* = TweenPlugin.activate([GlowFilterPlugin]);
return (_local1);
}//package dialog
Section 47
//MainMenu (dialog.MainMenu)
package dialog {
import flash.events.*;
import game.*;
import flash.display.*;
import statics.*;
import soundmanager.*;
import flash.geom.*;
import com.greensock.*;
import flash.text.*;
import flash.net.*;
import com.utils.*;
public class MainMenu extends Sprite {
public var shape:Shape;
private var _outState:Object;
private var _menu:DisplayObjectContainer;
private var _input:TextField;
private var _menuClass:Class;
private var _overState:Object;
private static var _instance:MainMenu;
public function MainMenu(){
_menuClass = MainMenu__menuClass;
_menu = new _menuClass();
_outState = {glowFilter:{color:0, blurX:8, blurY:8, strength:2, alpha:1}};
_overState = {glowFilter:{color:33023, blurX:24, blurY:24, strength:3, alpha:1}};
shape = new Shape();
super();
_instance = this;
addChild(_menu);
_input = (_menu.getChildByName("input") as TextField);
_input.text = Config.getInstance().name;
_input.restrict = "A-Za-z0-9";
_input.maxChars = 12;
addEventListener(MouseEvent.MOUSE_DOWN, onMouseEvent, false, 0, true);
addEventListener(MouseEvent.MOUSE_OUT, onMouseEvent, false, 0, true);
addEventListener(MouseEvent.MOUSE_OVER, onMouseEvent, false, 0, true);
addChild(shape);
}
private function cleanup():void{
Settings.level = 0;
Settings.power = 0;
Settings.score = 0;
}
public function hide():void{
Util.safelyRemove(this);
}
private function handleButtonClick(buttonName:String):void{
Debug.log(this, "handleButtonClick()", buttonName);
switch (buttonName){
case "submit":
Submitter.sendScore(_input.text, Settings.score);
Config.getInstance().name = _input.text;
Config.getInstance().flush();
cleanup();
case "dontsubmit":
TweenMax.to(this, 0.25, {x:0});
cleanup();
break;
case "more":
navigateToURL(new URLRequest("http://www.stumpygames.com/gamein.php?id=1130&source=2"), "_blank");
break;
case "plays1":
navigateToURL(new URLRequest("http://www.stumpygames.com/gamein.php?id=1130&source=2&togame=1000"), "_blank");
break;
case "plays2":
navigateToURL(new URLRequest("http://www.stumpygames.com/gamein.php?id=1130&source=2&togame=1040"), "_blank");
break;
case "wg":
navigateToURL(new URLRequest("http://wrenchgames.com/s3/"), "_blank");
break;
case "go":
Game.getInstance().start();
hide();
break;
case "options":
TweenMax.to(this, 0.25, {x:-500});
break;
case "ok":
TweenMax.to(this, 0.25, {x:0});
break;
case "mon":
SoundManager.getInstance().musicEnabled = true;
Config.getInstance().flush();
break;
case "moff":
SoundManager.getInstance().musicEnabled = false;
Config.getInstance().flush();
break;
case "son":
SoundManager.getInstance().soundEnabled = true;
Config.getInstance().flush();
case "soff":
SoundManager.getInstance().soundEnabled = false;
Config.getInstance().flush();
break;
};
update();
}
private function onChange(event:Event):void{
Settings.level = (int(event.target.text) - 1);
}
private function update():void{
shape.graphics.clear();
strike((SoundManager.getInstance().soundEnabled) ? "son" : "soff");
strike((SoundManager.getInstance().musicEnabled) ? "mon" : "moff");
}
private function enableMouse(enable:Boolean):void{
mouseChildren = enable;
mouseEnabled = enable;
}
private function strike(what:String):void{
var child:DisplayObject = _menu.getChildByName(what);
var rect:Rectangle = child.getRect(_menu);
shape.graphics.beginFill(0xFFFF00, 0.75);
shape.graphics.drawRect(rect.x, rect.bottom, rect.width, 6);
}
public function submit():void{
x = 500;
Settings.root.addChild(this);
}
private function onMouseEvent(mouseEvent:MouseEvent):void{
switch (mouseEvent.type){
case MouseEvent.MOUSE_DOWN:
handleButtonClick(mouseEvent.target.name);
break;
case MouseEvent.MOUSE_OUT:
TweenMax.to(mouseEvent.target, 2, _outState);
break;
case MouseEvent.MOUSE_OVER:
TweenMax.to(mouseEvent.target, 0.5, _overState);
break;
};
}
public function show():void{
Settings.root.addChild(this);
x = 0;
}
public static function getInstance():MainMenu{
return ((_instance) ? _instance : new (MainMenu));
}
}
var _local1:* = TweenPlugin.activate([GlowFilterPlugin]);
return (_local1);
}//package dialog
Section 48
//MainMenu__menuClass (dialog.MainMenu__menuClass)
package dialog {
import flash.display.*;
import mx.core.*;
public class MainMenu__menuClass extends SpriteAsset {
public var green:DisplayObject;
public var level:DisplayObject;
public var lives:DisplayObject;
public var saucer:DisplayObject;
public var mon:DisplayObject;
public var redspecial:DisplayObject;
public var bigred:DisplayObject;
public var score:DisplayObject;
public var submit:DisplayObject;
public var coins:DisplayObject;
public var soff:DisplayObject;
public var options:DisplayObject;
public var son:DisplayObject;
public var jet:DisplayObject;
public var jet2:DisplayObject;
public var red:DisplayObject;
public var bigred2:DisplayObject;
public var boat:DisplayObject;
public var input:DisplayObject;
public var wg:DisplayObject;
public var eject:DisplayObject;
public var plays1:DisplayObject;
public var plays2:DisplayObject;
public var more:DisplayObject;
public var ok:DisplayObject;
public var powerup:DisplayObject;
public var mine:DisplayObject;
public var bossBar:DisplayObject;
public var moff:DisplayObject;
public var shieldBar:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var go:DisplayObject;
public var dontsubmit:DisplayObject;
public var ibm:DisplayObject;
public var lifeBar:DisplayObject;
public var spawn:DisplayObject;
}
}//package dialog
Section 49
//Msg2 (dialog.Msg2)
package dialog {
import statics.*;
import com.greensock.*;
import flash.text.*;
import com.greensock.easing.*;
import com.utils.*;
import flash.filters.*;
public class Msg2 {
public function Msg2(){
super();
}
public static function displayScore(text:String, x:Number, y:Number):void{
var tf:TextField;
var text = text;
var x = x;
var y = y;
tf = new TextField();
tf.embedFonts = true;
var format:TextFormat = new TextFormat("THE_FONT", 24, 13378082);
format.kerning = true;
tf.defaultTextFormat = format;
tf.text = text;
tf.selectable = false;
tf.autoSize = TextFieldAutoSize.LEFT;
tf.x = x;
tf.y = y;
tf.filters = [new GlowFilter(0xFFFFFF, 1, 2, 2, 15, 2)];
Settings.root.addChild(tf);
TweenMax.to(tf, 1, {y:"-50", alpha:0.33, ease:Expo.easeOut, onComplete:function ():void{
Util.safelyRemove(tf);
}});
}
public static function display(text:String):void{
var tf:TextField;
var text = text;
tf = new TextField();
tf.embedFonts = true;
var format:TextFormat = new TextFormat("THE_FONT", 32, 13378082);
format.kerning = true;
tf.defaultTextFormat = format;
tf.text = text;
tf.selectable = false;
tf.autoSize = TextFieldAutoSize.LEFT;
tf.x = ((Protocol.SCREEN_WIDTH - tf.textWidth) / 2);
tf.y = (Protocol.SCREEN_HEIGHT / 3);
tf.filters = [new GlowFilter(0xFFFFFF, 1, 5, 5, 15, 2)];
Settings.root.addChild(tf);
TweenMax.from(tf, 1, {y:700, ease:Expo.easeOut});
TweenMax.to(tf, 1, {delay:1, y:-100, ease:Expo.easeOut, onComplete:function ():void{
Util.safelyRemove(tf);
}});
}
}
}//package dialog
Section 50
//Submitter (dialog.Submitter)
package dialog {
import flash.net.*;
public class Submitter {
public function Submitter(){
super();
}
public static function sendScore(name:String, score:int):void{
var highScoreURL:String = "";
var user:String = name;
user = escape(user);
var encodedScore:String = "";
highScoreURL = (("http://www.stumpygames.com/gamein.php?id=1130&user=joe&source=3&user=" + user) + "&score=");
var strScore:String = score.toString();
var encodeDigit1:String = "";
var encodeDigit2:String = "";
var encodeDigit3:String = "";
var randomLetter:String = "";
var i:int;
while (i < strScore.length) {
encodeDigit1 = String.fromCharCode((strScore.charCodeAt(i) + 57));
encodeDigit2 = String.fromCharCode((strScore.charCodeAt(i) + 60));
encodeDigit3 = String.fromCharCode((strScore.charCodeAt(i) + 20));
randomLetter = String.fromCharCode((Math.floor((Math.random() * 26)) + 97));
if ((i % 4) == 0){
encodedScore = ((((encodedScore + randomLetter) + encodeDigit1) + encodeDigit2) + encodeDigit3);
} else {
if ((i % 4) == 1){
encodedScore = ((((encodedScore + encodeDigit1) + randomLetter) + encodeDigit2) + encodeDigit3);
} else {
if ((i % 4) == 2){
encodedScore = ((((encodedScore + encodeDigit1) + encodeDigit2) + randomLetter) + encodeDigit3);
} else {
if ((i % 4) == 3){
encodedScore = ((((encodedScore + encodeDigit1) + encodeDigit2) + encodeDigit3) + randomLetter);
};
};
};
};
i++;
};
highScoreURL = (highScoreURL + ("&score=" + encodedScore));
trace("highScoreURL", highScoreURL);
navigateToURL(new URLRequest(highScoreURL), "_blank");
}
}
}//package dialog
Section 51
//Fx (game.Fx)
package game {
import flash.display.*;
import com.utils.*;
public class Fx {
private static var _cloudClass:Class = Fx__cloudClass;
private static var _sparxClass:Class = Fx__sparxClass;
private static var _boomClass:Class = Fx__boomClass;
private static var _ricoClass:Class = Fx__ricoClass;
public function Fx(){
super();
}
public static function createSparx(x:Number, y:Number):void{
createFx(x, y, _sparxClass);
}
public static function createBoom(x:Number, y:Number):void{
createFx(x, y, _boomClass);
}
private static function createFx(x:Number, y:Number, fxClass:Class, scale:Number=1, add:Boolean=true):void{
var fx:MovieClip;
var x = x;
var y = y;
var fxClass = fxClass;
var scale = scale;
var add = add;
fx = new (fxClass);
fx.cacheAsBitmap = true;
fx.rotation = (Math.random() * 360);
fx.x = x;
fx.y = y;
fx.scaleX = scale;
fx.scaleY = scale;
fx.blendMode = (add) ? BlendMode.ADD : BlendMode.NORMAL;
var i = 1;
while (i < fx.totalFrames) {
fx.addFrameScript(i, function ():void{
fx.alpha = (fx.alpha - 0.1);
});
i = (i + 1);
};
fx.addFrameScript((fx.totalFrames - 1), function ():void{
Util.safelyRemove(fx);
});
Game.getInstance().addFx(fx);
}
public static function createBigBoom(x:Number, y:Number):void{
createFx(x, y, _boomClass, 1, false);
}
public static function createBoomPlusSparx(x:Number, y:Number):void{
createFx(x, y, _boomClass, 0.55);
createFx(x, y, _sparxClass);
}
public static function createCloud(x:Number, y:Number):void{
createFx(x, y, _cloudClass);
}
public static function createSmallBoom(x:Number, y:Number):void{
createFx(x, y, _boomClass, 0.55);
}
public static function createRico(x:Number, y:Number):void{
createFx(x, y, _ricoClass);
}
}
}//package game
Section 52
//Fx__boomClass (game.Fx__boomClass)
package game {
import flash.display.*;
import mx.core.*;
public class Fx__boomClass extends MovieClipAsset {
public var green:DisplayObject;
public var level:DisplayObject;
public var lives:DisplayObject;
public var saucer:DisplayObject;
public var mon:DisplayObject;
public var redspecial:DisplayObject;
public var bigred:DisplayObject;
public var score:DisplayObject;
public var submit:DisplayObject;
public var coins:DisplayObject;
public var soff:DisplayObject;
public var options:DisplayObject;
public var son:DisplayObject;
public var jet:DisplayObject;
public var jet2:DisplayObject;
public var red:DisplayObject;
public var bigred2:DisplayObject;
public var boat:DisplayObject;
public var input:DisplayObject;
public var wg:DisplayObject;
public var eject:DisplayObject;
public var plays1:DisplayObject;
public var plays2:DisplayObject;
public var more:DisplayObject;
public var ok:DisplayObject;
public var powerup:DisplayObject;
public var mine:DisplayObject;
public var bossBar:DisplayObject;
public var moff:DisplayObject;
public var shieldBar:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var go:DisplayObject;
public var dontsubmit:DisplayObject;
public var ibm:DisplayObject;
public var lifeBar:DisplayObject;
public var spawn:DisplayObject;
}
}//package game
Section 53
//Fx__cloudClass (game.Fx__cloudClass)
package game {
import flash.display.*;
import mx.core.*;
public class Fx__cloudClass extends MovieClipAsset {
public var green:DisplayObject;
public var level:DisplayObject;
public var lives:DisplayObject;
public var saucer:DisplayObject;
public var mon:DisplayObject;
public var redspecial:DisplayObject;
public var bigred:DisplayObject;
public var score:DisplayObject;
public var submit:DisplayObject;
public var coins:DisplayObject;
public var soff:DisplayObject;
public var options:DisplayObject;
public var son:DisplayObject;
public var jet:DisplayObject;
public var jet2:DisplayObject;
public var red:DisplayObject;
public var bigred2:DisplayObject;
public var boat:DisplayObject;
public var input:DisplayObject;
public var wg:DisplayObject;
public var eject:DisplayObject;
public var plays1:DisplayObject;
public var plays2:DisplayObject;
public var more:DisplayObject;
public var ok:DisplayObject;
public var powerup:DisplayObject;
public var mine:DisplayObject;
public var bossBar:DisplayObject;
public var moff:DisplayObject;
public var shieldBar:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var go:DisplayObject;
public var dontsubmit:DisplayObject;
public var ibm:DisplayObject;
public var lifeBar:DisplayObject;
public var spawn:DisplayObject;
}
}//package game
Section 54
//Fx__ricoClass (game.Fx__ricoClass)
package game {
import flash.display.*;
import mx.core.*;
public class Fx__ricoClass extends MovieClipAsset {
public var green:DisplayObject;
public var level:DisplayObject;
public var lives:DisplayObject;
public var saucer:DisplayObject;
public var mon:DisplayObject;
public var redspecial:DisplayObject;
public var bigred:DisplayObject;
public var score:DisplayObject;
public var submit:DisplayObject;
public var coins:DisplayObject;
public var soff:DisplayObject;
public var options:DisplayObject;
public var son:DisplayObject;
public var jet:DisplayObject;
public var jet2:DisplayObject;
public var red:DisplayObject;
public var bigred2:DisplayObject;
public var boat:DisplayObject;
public var input:DisplayObject;
public var wg:DisplayObject;
public var eject:DisplayObject;
public var plays1:DisplayObject;
public var plays2:DisplayObject;
public var more:DisplayObject;
public var ok:DisplayObject;
public var powerup:DisplayObject;
public var mine:DisplayObject;
public var bossBar:DisplayObject;
public var moff:DisplayObject;
public var shieldBar:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var go:DisplayObject;
public var dontsubmit:DisplayObject;
public var ibm:DisplayObject;
public var lifeBar:DisplayObject;
public var spawn:DisplayObject;
}
}//package game
Section 55
//Fx__sparxClass (game.Fx__sparxClass)
package game {
import flash.display.*;
import mx.core.*;
public class Fx__sparxClass extends MovieClipAsset {
public var green:DisplayObject;
public var level:DisplayObject;
public var lives:DisplayObject;
public var saucer:DisplayObject;
public var mon:DisplayObject;
public var redspecial:DisplayObject;
public var bigred:DisplayObject;
public var score:DisplayObject;
public var submit:DisplayObject;
public var coins:DisplayObject;
public var soff:DisplayObject;
public var options:DisplayObject;
public var son:DisplayObject;
public var jet:DisplayObject;
public var jet2:DisplayObject;
public var red:DisplayObject;
public var bigred2:DisplayObject;
public var boat:DisplayObject;
public var input:DisplayObject;
public var wg:DisplayObject;
public var eject:DisplayObject;
public var plays1:DisplayObject;
public var plays2:DisplayObject;
public var more:DisplayObject;
public var ok:DisplayObject;
public var powerup:DisplayObject;
public var mine:DisplayObject;
public var bossBar:DisplayObject;
public var moff:DisplayObject;
public var shieldBar:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var go:DisplayObject;
public var dontsubmit:DisplayObject;
public var ibm:DisplayObject;
public var lifeBar:DisplayObject;
public var spawn:DisplayObject;
}
}//package game
Section 56
//Game (game.Game)
package game {
import flash.events.*;
import flash.display.*;
import moving.*;
import dialog.*;
import statics.*;
import soundmanager.*;
import flash.geom.*;
import moving.craft.*;
import com.greensock.*;
import flash.utils.*;
import flash.text.*;
import com.greensock.easing.*;
import com.utils.*;
public class Game extends Sprite {
private const SPEED_T:Number = 0.015;
private const TIME_T:Number = 15;
private var _coins:TextField;
private var _grass01:Class;
private var _bossBarW:Number;// = 105.1
private var _levelHeight:Number;// = 0
private var _tileUpper:DisplayObjectContainer;
private var _bossBar:DisplayObjectContainer;
private var _town01:Class;
private var _desert01:Class;
private var _desert02:Class;
private var _lifeBar:DisplayObject;
public var recentKills:Array;
private var _level04:Class;
private var _bottom:Class;
private var _seaToGrass:Class;
private var _martia01:Class;
private var _layout:DisplayObjectContainer;
private var _level05:Class;
private var _levelText:TextField;
private var _level04Boss:Class;
private var _livesText:TextField;
private var _grassToSea:Class;
private var _scoreText:TextField;
private var _desert03Town:Class;
private var _shieldBar:DisplayObject;
private var _test:Class;
private var _indie20:Class;
private var _indie21:Class;
private var _indie22:Class;
private var _beingRemoved:Boolean;
private var _isle01:Class;
private var _coinsCollected:int;
private var _running:Boolean;// = false
private var _tileLower:DisplayObjectContainer;
private var _tiles:Array;
private var _bossBarClass:Class;
private var _score:int;
private var _cumulativeBonus:int;
private var _layoutClass:Class;
private var _enemyShots:Array;
private var _timeline:TimelineMax;
private var _shots:Array;
private var _martia2Desert:Class;
private var _city01:Class;
private var _tileCopy1:DisplayObjectContainer;
private var _startTime:int;
private var _level05Boss:Class;
private var _inter:Class;
private var _tileCopy2:DisplayObjectContainer;
private var _movementLayer:Sprite;
private var _enemies:Array;
private var _strPoints:String;
private var _screenTime:Number;
private static var _instance:Game;
public function Game(){
_bottom = Game__bottom;
_inter = Game__inter;
_layoutClass = Game__layoutClass;
_bossBarClass = Game__bossBarClass;
_grass01 = Game__grass01;
_grassToSea = Game__grassToSea;
_seaToGrass = Game__seaToGrass;
_isle01 = Game__isle01;
_town01 = Game__town01;
_city01 = Game__city01;
_indie20 = Game__indie20;
_indie22 = Game__indie22;
_indie21 = Game__indie21;
_martia01 = Game__martia01;
_martia2Desert = Game__martia2Desert;
_desert01 = Game__desert01;
_desert02 = Game__desert02;
_desert03Town = Game__desert03Town;
_level04 = Game__level04;
_level04Boss = Game__level04Boss;
_level05 = Game__level05;
_level05Boss = Game__level05Boss;
_test = Game__test;
_movementLayer = new Sprite();
_screenTime = (SPEED_T * Protocol.SCREEN_HEIGHT);
super();
_instance = this;
_bossBar = new _bossBarClass();
_layout = new _layoutClass();
var ejectBtn:SimpleButton = (_layout.getChildByName("eject") as SimpleButton);
ejectBtn.addEventListener(MouseEvent.MOUSE_DOWN, onEject, false, 0, true);
_coins = (_layout.getChildByName("coins") as TextField);
_scoreText = (_layout.getChildByName("score") as TextField);
_scoreText.cacheAsBitmap = true;
_lifeBar = _layout.getChildByName("lifeBar");
_levelText = (_layout.getChildByName("level") as TextField);
_livesText = (_layout.getChildByName("lives") as TextField);
_shieldBar = _layout.getChildByName("shieldBar");
}
public function addEnemyShot(target:MovieClip):void{
var target = target;
target.addFrameScript((target.totalFrames - 1), function ():void{
removeShot(target, _enemyShots);
});
_enemyShots.push(target);
_movementLayer.addChildAt(target, 0);
}
private function release():void{
var enemy:Moving;
trace("_movementLayer.numChildren", _movementLayer.numChildren);
var bitmap:Bitmap = new _inter();
Settings.root.graphics.beginBitmapFill(bitmap.bitmapData);
Settings.root.graphics.drawRect(0, 0, Protocol.SCREEN_WIDTH, Protocol.SCREEN_HEIGHT);
for each (enemy in _enemies) {
enemy.hide();
};
Settings.root.removeEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
Settings.root.removeEventListener(Event.ENTER_FRAME, onEnterFrame);
_tileCopy1 = null;
_tileCopy1 = null;
_tileLower = null;
_tileUpper = null;
if (_timeline){
_timeline.kill();
};
_timeline = null;
_running = false;
}
private function getSpawnInfo(tile:DisplayObjectContainer, tileOffset:Number):void{
var child:*;
var dy:Number;
var dt:Number;
var tileBottom:Number = tile.getRect(tile).bottom;
var z:int = (tile.numChildren - 1);
while (z >= 0) {
child = tile.getChildAt(z);
if (ObjFactory.willDo(child)){
tile.removeChild(child);
dy = (tileBottom - child.y);
dt = (((tileOffset + dy) - Protocol.SCREEN_HEIGHT) * SPEED_T);
_timeline.addCallback(spawn, dt, [child]);
};
z--;
};
}
private function removeLowerTile():void{
Util.safelyRemove(_tileLower);
}
public function get enemies():Array{
return (_enemies);
}
public function resume():void{
TweenMax.resumeAll();
_running = true;
}
private function onEject(mouseEvent:MouseEvent):void{
over();
}
public function addShot(target:MovieClip):void{
var target = target;
target.addFrameScript((target.totalFrames - 1), function ():void{
removeShot(target, _shots);
});
_shots.push(target);
_movementLayer.addChildAt(target, 0);
}
public function setBossMode():void{
_timeline.kill();
addBossBar();
updateBossBar(1);
}
public function fixTilesGap():void{
var rect:Rectangle;
if (_tileLower){
_tileLower.y = Math.floor(_tileLower.y);
if (_tileUpper){
rect = _tileLower.getRect(_tileLower);
_tileUpper.y = Math.floor((rect.top - _tileUpper.height));
};
};
TweenMax.resumeAll();
}
public function addFx(target:MovieClip):void{
_movementLayer.addChild(target);
}
public function nextLevel():void{
if (_beingRemoved){
return;
};
_beingRemoved = true;
release();
TweenMax.pauseAll();
TweenMax.killTweensOf(Craft.getInstance());
Settings.root.addChild(new Aftermath(false, _score, totalScore, _coinsCollected));
Settings.power = 0;
Craft.getInstance().getClip().gotoAndPlay(4);
}
private function pullIn(tile:DisplayObjectContainer, yOffset:Number=0):void{
var ty:Number;
if (tile){
_tileUpper = createTile(tile);
_tileUpper.y = (_tileUpper.y + yOffset);
ty = (_tileUpper.height - yOffset);
addChildAt(_tileUpper, 0);
TweenMax.to(_tileUpper, (SPEED_T * (_tileUpper.height - yOffset)), {y:ty.toString(), ease:Linear.easeNone, onComplete:swapTiles});
};
}
public function addEnemy(target:Moving):void{
var craftZ:int = _movementLayer.getChildIndex(Craft.getInstance());
_enemies.push(target);
if (target.HOVER){
_movementLayer.addChildAt(target, craftZ);
} else {
_movementLayer.addChildAt(target, 0);
};
}
public function removeEnemy(target:Moving):void{
var s:String;
for (s in _enemies) {
if (_enemies[s] == target){
delete _enemies[s];
break;
};
};
}
public function updateBossBar(perc:Number):void{
var bar:DisplayObject = _bossBar.getChildByName("bossBar");
TweenMax.to(bar, 0.5, {scaleX:perc});
}
private function spawn(child:DisplayObject):void{
addEnemy(ObjFactory.create(child));
}
public function start():void{
_beingRemoved = false;
var bitmap:Bitmap = new _bottom();
recentKills = [];
Settings.root.graphics.beginBitmapFill(bitmap.bitmapData);
Settings.root.graphics.drawRect(0, 0, Protocol.SCREEN_WIDTH, Protocol.SCREEN_HEIGHT);
Util.safelyRemoveChildren(this);
_timeline = new TimelineMax();
switch (Settings.level){
case 4:
_tiles = [_level05Boss, _level05];
break;
case 3:
_tiles = [_level04, _level04, _level04Boss];
break;
case 2:
_tiles = [_indie20, _indie21, _indie20, _indie21, _indie20, _indie22];
break;
case 1:
_tiles = [_martia01, _martia01, _martia2Desert, _desert03Town, _desert01, _desert02, _desert01];
break;
default:
_tiles = [_grass01, _grassToSea, _city01, _isle01, _seaToGrass, _grass01, _town01, _grassToSea, _seaToGrass, _grass01];
};
_levelText.text = ("level " + (Settings.level + 1));
_score = 0;
_coinsCollected = 0;
_coins.text = "x0";
_enemies = [];
_enemyShots = [];
_shots = [];
_startTime = getTimer();
_cumulativeBonus = 0;
Settings.root.addEventListener(MouseEvent.MOUSE_MOVE, onMouseMove, false, 0, true);
Settings.root.addEventListener(Event.ENTER_FRAME, onEnterFrame, false, 0, true);
precache();
pullIn(_tiles.shift(), Protocol.SCREEN_HEIGHT);
_movementLayer.addChild(Craft.getInstance());
_lifeBar.scaleX = 0;
_shieldBar.scaleX = 0;
addScore(0);
Settings.root.addChild(this);
addChild(_movementLayer);
Settings.root.addChild(_layout);
Craft.getInstance().create();
_timeline.play();
resume();
}
public function addBossBar():void{
Settings.root.addChild(_bossBar);
}
public function addScore(points:int):void{
_score = (_score + points);
_strPoints = _score.toString();
while (_strPoints.length < 9) {
_strPoints = ("0" + _strPoints);
};
}
public function removeShot(target:MovieClip, container:Array):void{
var s:String;
Util.safelyRemove(target);
for (s in container) {
if (container[s] == target){
delete container[s];
break;
};
};
}
private function swapTiles():void{
_tileLower = _tileUpper;
if (!_tiles.length){
_tiles.push(_tileCopy1, _tileCopy2);
};
pullIn(_tiles.shift());
TweenMax.to(_tileLower, _screenTime, {y:Protocol.SCREEN_HEIGHT.toString(), ease:Linear.easeNone, onComplete:removeLowerTile});
}
private function onEnterFrame(event:Event):void{
var enemy:Moving;
var shot:MovieClip;
var rect:Rectangle;
var enemyShot:MovieClip;
var craftPos:Point;
var craft:Craft = Craft.getInstance();
if (!_running){
return;
};
var p:Point = new Point(_movementLayer.mouseX, _movementLayer.mouseY);
p.x = Math.max(Math.min(p.x, 720), 30);
p.y = Math.max(Math.min(p.y, 470), 20);
var dir:Number = (p.x - craft.x);
var t:Number = 5;
var d:Number = Point.distance(new Point(craft.x, Craft.getInstance().y), p);
if (dir < -(t)){
craft.left();
} else {
if (dir > t){
craft.right();
} else {
craft.center();
};
};
var craftOK = !(craft.isBlink);
for each (enemy in _enemies) {
if (enemy.BONUS){
if (Point.distance(enemy.toPoint(), craft.toPoint()) < 50){
enemy.die();
//unresolved jump
};
} else {
if (((!(craft.isBlink)) && (craft.checkCollision(enemy)))){
craft.hit(craft.collisionDamage);
enemy.hit(craft.collisionDamage);
};
};
for each (shot in _shots) {
if (((enemy.BONUS) && (!(enemy.MINE)))){
} else {
if (enemy.checkCollision(shot)){
enemy.hit(craft.shotPower);
rect = shot.getRect(shot.parent);
removeShot(shot, _shots);
Fx.createRico(rect.x, rect.y);
SoundManager.getInstance().rico();
//unresolved jump
};
};
};
};
if (craftOK){
for each (enemyShot in _enemyShots) {
if (enemyShot.hitTestObject(craft.getClip())){
craft.hit(((Settings.level > 1)) ? (craft.collisionDamage * 2) : craft.collisionDamage);
craftPos = craft.toPoint();
Fx.createRico(craftPos.x, craftPos.y);
removeShot(enemyShot, _enemyShots);
SoundManager.getInstance().rico();
};
};
};
TweenMax.to(craft, 0.125, {x:p.x, y:p.y});
_scoreText.text = _strPoints;
}
public function get totalScore():int{
return ((_score + (_coinsCollected * 100)));
}
public function reportKill(killedName:String, newX:Number, newY:Number):void{
var s:String;
var n:String;
var victimName:String = ((killedName == "redspecial")) ? "red" : killedName;
var time:int = getTimer();
recentKills.push({name:victimName, time:time});
var killsByNames:Object = {};
for (s in recentKills) {
if (recentKills[s].time < (time - 3333)){
delete recentKills[s];
} else {
n = recentKills[s].name;
killsByNames[n] = (killsByNames.hasOwnProperty(n)) ? (killsByNames[n] + 1) : 1;
};
};
for (s in killsByNames) {
if (killsByNames[s] >= 3){
_cumulativeBonus++;
_score = (_score + (_cumulativeBonus * 100));
Msg2.displayScore(("+" + (_cumulativeBonus * 100)), newX, newY);
};
if (_cumulativeBonus > 3){
_cumulativeBonus = 0;
addEnemy(ObjFactory.createRandomBonus(Craft.getInstance().x, 0));
recentKills = [];
return;
};
};
}
public function updateLives(lives:int):void{
_livesText.text = lives.toString();
Msg2.display(("LIVES: " + lives));
}
private function precache():void{
var tileOffset:Number;
var tileClass:Class;
var s:String;
var i:int;
tileOffset = 0;
for (s in _tiles) {
tileClass = _tiles[s];
_tiles[s] = new (tileClass);
_tiles[s].cacheAsBitmap = true;
_levelHeight = (_levelHeight + _tiles[s].height);
getSpawnInfo(_tiles[s], tileOffset);
tileOffset = (tileOffset + _tiles[s].height);
};
_tileCopy1 = new (tileClass);
_tileCopy1.cacheAsBitmap = true;
getSpawnInfo(_tileCopy1, tileOffset);
tileOffset = (tileOffset + _tileCopy1.height);
_tileCopy2 = new (tileClass);
_tileCopy2.cacheAsBitmap = true;
getSpawnInfo(_tileCopy2, tileOffset);
trace("_tileCopy1", _tileCopy1, "_tileCopy2", _tileCopy2);
_timeline.addCallback(function ():void{
addEnemy(ObjFactory.createPowerup());
}, 3);
_timeline.addCallback(function ():void{
addEnemy(ObjFactory.createPowerup());
}, 7);
i = 0;
while (i < 10) {
_timeline.addCallback(function ():void{
addEnemy(ObjFactory.createPowerup());
}, (10 + (i * 40)));
i = (i + 1);
};
//unresolved jump
var _slot1 = error;
Debug.error(this, "in precache()", _slot1);
}
private function createTile(tile:DisplayObjectContainer):DisplayObjectContainer{
var rect:Rectangle = tile.getRect(tile);
var ty:Number = -(rect.top);
tile.y = (-(rect.top) - rect.height);
return (tile);
}
public function unlinkBossBar():void{
Util.safelyRemove(_bossBar);
setTimeout(nextLevel, 3);
}
public function over():void{
if (_beingRemoved){
return;
};
Settings.power = 0;
_beingRemoved = true;
release();
TweenMax.pauseAll();
TweenMax.killTweensOf(Craft.getInstance());
Settings.root.addChild(new Aftermath(true, _score, totalScore, _coinsCollected));
Util.safelyRemove(Craft.getInstance());
Craft.getInstance().power = 0;
Craft.getInstance().lives = 3;
}
public function addCoin():void{
_coinsCollected++;
_coins.text = ("x" + _coinsCollected);
}
public function get running():Boolean{
return (_running);
}
public function get movementLayer():DisplayObjectContainer{
return (_movementLayer);
}
public function adjustBars(health:Number, shield:Number):void{
TweenMax.to(_lifeBar, 1, {scaleX:Math.max(health, 0)});
TweenMax.to(_shieldBar, 1, {scaleX:Math.max(shield, 0)});
}
public function pause():void{
TweenMax.pauseAll();
_running = false;
}
private function onMouseMove(mouseEvent:MouseEvent):void{
var p:Number;
var tx:Number;
if (_running){
p = ((Settings.root.mouseX - 250) / 500);
tx = ((-250 * p) - 125);
TweenMax.to(this, 1, {x:tx});
};
}
public static function getInstance():Game{
return ((_instance) ? _instance : new (Game));
}
}
}//package game
Section 57
//Game__bossBarClass (game.Game__bossBarClass)
package game {
import flash.display.*;
import mx.core.*;
public class Game__bossBarClass extends SpriteAsset {
public var boat:DisplayObject;
public var bigred2:DisplayObject;
public var green:DisplayObject;
public var level:DisplayObject;
public var redspecial:DisplayObject;
public var saucer:DisplayObject;
public var lives:DisplayObject;
public var eject:DisplayObject;
public var mine:DisplayObject;
public var red:DisplayObject;
public var score:DisplayObject;
public var powerup:DisplayObject;
public var bossBar:DisplayObject;
public var jet:DisplayObject;
public var shieldBar:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var coins:DisplayObject;
public var lifeBar:DisplayObject;
public var spawn:DisplayObject;
}
}//package game
Section 58
//Game__bottom (game.Game__bottom)
package game {
import mx.core.*;
public class Game__bottom extends BitmapAsset {
}
}//package game
Section 59
//Game__city01 (game.Game__city01)
package game {
import flash.display.*;
import mx.core.*;
public class Game__city01 extends SpriteAsset {
public var boat:DisplayObject;
public var bigred2:DisplayObject;
public var green:DisplayObject;
public var level:DisplayObject;
public var redspecial:DisplayObject;
public var saucer:DisplayObject;
public var lives:DisplayObject;
public var eject:DisplayObject;
public var mine:DisplayObject;
public var red:DisplayObject;
public var score:DisplayObject;
public var powerup:DisplayObject;
public var bossBar:DisplayObject;
public var jet:DisplayObject;
public var shieldBar:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var coins:DisplayObject;
public var lifeBar:DisplayObject;
public var spawn:DisplayObject;
}
}//package game
Section 60
//Game__desert01 (game.Game__desert01)
package game {
import flash.display.*;
import mx.core.*;
public class Game__desert01 extends SpriteAsset {
public var boat:DisplayObject;
public var bigred2:DisplayObject;
public var red:DisplayObject;
public var redspecial:DisplayObject;
public var any:DisplayObject;
}
}//package game
Section 61
//Game__desert02 (game.Game__desert02)
package game {
import flash.display.*;
import mx.core.*;
public class Game__desert02 extends SpriteAsset {
public var boat:DisplayObject;
public var bigred2:DisplayObject;
public var red:DisplayObject;
public var redspecial:DisplayObject;
public var any:DisplayObject;
}
}//package game
Section 62
//Game__desert03Town (game.Game__desert03Town)
package game {
import flash.display.*;
import mx.core.*;
public class Game__desert03Town extends SpriteAsset {
public var boat:DisplayObject;
public var bigred2:DisplayObject;
public var green:DisplayObject;
public var level:DisplayObject;
public var redspecial:DisplayObject;
public var saucer:DisplayObject;
public var lives:DisplayObject;
public var eject:DisplayObject;
public var mine:DisplayObject;
public var red:DisplayObject;
public var score:DisplayObject;
public var powerup:DisplayObject;
public var jet:DisplayObject;
public var shieldBar:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var coins:DisplayObject;
public var lifeBar:DisplayObject;
public var spawn:DisplayObject;
}
}//package game
Section 63
//Game__grass01 (game.Game__grass01)
package game {
import flash.display.*;
import mx.core.*;
public class Game__grass01 extends SpriteAsset {
public var boat:DisplayObject;
public var bigred2:DisplayObject;
public var level:DisplayObject;
public var redspecial:DisplayObject;
public var coins:DisplayObject;
public var eject:DisplayObject;
public var score:DisplayObject;
public var lives:DisplayObject;
public var red:DisplayObject;
public var jet:DisplayObject;
public var shieldBar:DisplayObject;
public var any:DisplayObject;
public var lifeBar:DisplayObject;
}
}//package game
Section 64
//Game__grassToSea (game.Game__grassToSea)
package game {
import flash.display.*;
import mx.core.*;
public class Game__grassToSea extends SpriteAsset {
public var boat:DisplayObject;
public var bigred2:DisplayObject;
public var green:DisplayObject;
public var level:DisplayObject;
public var redspecial:DisplayObject;
public var saucer:DisplayObject;
public var lives:DisplayObject;
public var eject:DisplayObject;
public var mine:DisplayObject;
public var bigred:DisplayObject;
public var score:DisplayObject;
public var powerup:DisplayObject;
public var bossBar:DisplayObject;
public var jet:DisplayObject;
public var shieldBar:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var coins:DisplayObject;
public var lifeBar:DisplayObject;
public var jet2:DisplayObject;
public var spawn:DisplayObject;
public var red:DisplayObject;
}
}//package game
Section 65
//Game__indie20 (game.Game__indie20)
package game {
import flash.display.*;
import mx.core.*;
public class Game__indie20 extends SpriteAsset {
public var boat:DisplayObject;
public var bigred2:DisplayObject;
public var green:DisplayObject;
public var level:DisplayObject;
public var redspecial:DisplayObject;
public var saucer:DisplayObject;
public var lives:DisplayObject;
public var eject:DisplayObject;
public var mine:DisplayObject;
public var red:DisplayObject;
public var score:DisplayObject;
public var powerup:DisplayObject;
public var bossBar:DisplayObject;
public var jet:DisplayObject;
public var shieldBar:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var coins:DisplayObject;
public var lifeBar:DisplayObject;
public var jet2:DisplayObject;
public var spawn:DisplayObject;
}
}//package game
Section 66
//Game__indie21 (game.Game__indie21)
package game {
import flash.display.*;
import mx.core.*;
public class Game__indie21 extends SpriteAsset {
public var boat:DisplayObject;
public var bigred2:DisplayObject;
public var green:DisplayObject;
public var level:DisplayObject;
public var redspecial:DisplayObject;
public var saucer:DisplayObject;
public var lives:DisplayObject;
public var eject:DisplayObject;
public var mine:DisplayObject;
public var bigred:DisplayObject;
public var score:DisplayObject;
public var powerup:DisplayObject;
public var bossBar:DisplayObject;
public var shieldBar:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var coins:DisplayObject;
public var ibm:DisplayObject;
public var lifeBar:DisplayObject;
public var jet2:DisplayObject;
public var spawn:DisplayObject;
public var jet:DisplayObject;
public var red:DisplayObject;
}
}//package game
Section 67
//Game__indie22 (game.Game__indie22)
package game {
import flash.display.*;
import mx.core.*;
public class Game__indie22 extends SpriteAsset {
public var boat:DisplayObject;
public var bigred2:DisplayObject;
public var green:DisplayObject;
public var level:DisplayObject;
public var redspecial:DisplayObject;
public var saucer:DisplayObject;
public var lives:DisplayObject;
public var eject:DisplayObject;
public var mine:DisplayObject;
public var bigred:DisplayObject;
public var score:DisplayObject;
public var powerup:DisplayObject;
public var bossBar:DisplayObject;
public var shieldBar:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var coins:DisplayObject;
public var ibm:DisplayObject;
public var lifeBar:DisplayObject;
public var jet2:DisplayObject;
public var spawn:DisplayObject;
public var jet:DisplayObject;
public var red:DisplayObject;
}
}//package game
Section 68
//Game__inter (game.Game__inter)
package game {
import mx.core.*;
public class Game__inter extends BitmapAsset {
}
}//package game
Section 69
//Game__isle01 (game.Game__isle01)
package game {
import flash.display.*;
import mx.core.*;
public class Game__isle01 extends SpriteAsset {
public var boat:DisplayObject;
public var bigred2:DisplayObject;
public var green:DisplayObject;
public var level:DisplayObject;
public var redspecial:DisplayObject;
public var coins:DisplayObject;
public var lives:DisplayObject;
public var eject:DisplayObject;
public var score:DisplayObject;
public var mine:DisplayObject;
public var jet:DisplayObject;
public var powerup:DisplayObject;
public var shieldBar:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var lifeBar:DisplayObject;
public var red:DisplayObject;
}
}//package game
Section 70
//Game__layoutClass (game.Game__layoutClass)
package game {
import flash.display.*;
import mx.core.*;
public class Game__layoutClass extends SpriteAsset {
public var eject:DisplayObject;
public var bigred2:DisplayObject;
public var level:DisplayObject;
public var lives:DisplayObject;
public var coins:DisplayObject;
public var shieldBar:DisplayObject;
public var any:DisplayObject;
public var boat:DisplayObject;
public var red:DisplayObject;
public var score:DisplayObject;
public var lifeBar:DisplayObject;
public var redspecial:DisplayObject;
}
}//package game
Section 71
//Game__level04 (game.Game__level04)
package game {
import flash.display.*;
import mx.core.*;
public class Game__level04 extends SpriteAsset {
public var boat:DisplayObject;
public var bigred2:DisplayObject;
public var green:DisplayObject;
public var level:DisplayObject;
public var redspecial:DisplayObject;
public var saucer:DisplayObject;
public var lives:DisplayObject;
public var eject:DisplayObject;
public var mine:DisplayObject;
public var red:DisplayObject;
public var score:DisplayObject;
public var powerup:DisplayObject;
public var bossBar:DisplayObject;
public var jet:DisplayObject;
public var shieldBar:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var coins:DisplayObject;
public var lifeBar:DisplayObject;
public var jet2:DisplayObject;
public var spawn:DisplayObject;
}
}//package game
Section 72
//Game__level04Boss (game.Game__level04Boss)
package game {
import flash.display.*;
import mx.core.*;
public class Game__level04Boss extends SpriteAsset {
public var boat:DisplayObject;
public var bigred2:DisplayObject;
public var level:DisplayObject;
public var redspecial:DisplayObject;
public var coins:DisplayObject;
public var lives:DisplayObject;
public var eject:DisplayObject;
public var score:DisplayObject;
public var mine:DisplayObject;
public var red:DisplayObject;
public var jet:DisplayObject;
public var shieldBar:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var lifeBar:DisplayObject;
}
}//package game
Section 73
//Game__level05 (game.Game__level05)
package game {
import flash.display.*;
import mx.core.*;
public class Game__level05 extends SpriteAsset {
public var boat:DisplayObject;
public var bigred2:DisplayObject;
public var green:DisplayObject;
public var level:DisplayObject;
public var redspecial:DisplayObject;
public var saucer:DisplayObject;
public var lives:DisplayObject;
public var eject:DisplayObject;
public var mine:DisplayObject;
public var red:DisplayObject;
public var score:DisplayObject;
public var powerup:DisplayObject;
public var bossBar:DisplayObject;
public var jet:DisplayObject;
public var shieldBar:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var coins:DisplayObject;
public var lifeBar:DisplayObject;
public var jet2:DisplayObject;
public var spawn:DisplayObject;
}
}//package game
Section 74
//Game__level05Boss (game.Game__level05Boss)
package game {
import flash.display.*;
import mx.core.*;
public class Game__level05Boss extends SpriteAsset {
public var boat:DisplayObject;
public var bigred2:DisplayObject;
public var green:DisplayObject;
public var level:DisplayObject;
public var redspecial:DisplayObject;
public var saucer:DisplayObject;
public var lives:DisplayObject;
public var eject:DisplayObject;
public var mine:DisplayObject;
public var red:DisplayObject;
public var score:DisplayObject;
public var powerup:DisplayObject;
public var bossBar:DisplayObject;
public var jet:DisplayObject;
public var shieldBar:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var coins:DisplayObject;
public var lifeBar:DisplayObject;
public var jet2:DisplayObject;
public var spawn:DisplayObject;
}
}//package game
Section 75
//Game__martia01 (game.Game__martia01)
package game {
import flash.display.*;
import mx.core.*;
public class Game__martia01 extends SpriteAsset {
public var boat:DisplayObject;
public var bigred2:DisplayObject;
public var green:DisplayObject;
public var level:DisplayObject;
public var redspecial:DisplayObject;
public var saucer:DisplayObject;
public var lives:DisplayObject;
public var eject:DisplayObject;
public var mine:DisplayObject;
public var red:DisplayObject;
public var score:DisplayObject;
public var powerup:DisplayObject;
public var bossBar:DisplayObject;
public var jet:DisplayObject;
public var shieldBar:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var coins:DisplayObject;
public var lifeBar:DisplayObject;
public var jet2:DisplayObject;
public var spawn:DisplayObject;
}
}//package game
Section 76
//Game__martia2Desert (game.Game__martia2Desert)
package game {
import flash.display.*;
import mx.core.*;
public class Game__martia2Desert extends SpriteAsset {
public var boat:DisplayObject;
public var bigred2:DisplayObject;
public var green:DisplayObject;
public var level:DisplayObject;
public var redspecial:DisplayObject;
public var saucer:DisplayObject;
public var lives:DisplayObject;
public var eject:DisplayObject;
public var mine:DisplayObject;
public var red:DisplayObject;
public var score:DisplayObject;
public var powerup:DisplayObject;
public var bossBar:DisplayObject;
public var jet:DisplayObject;
public var shieldBar:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var coins:DisplayObject;
public var lifeBar:DisplayObject;
public var jet2:DisplayObject;
public var spawn:DisplayObject;
}
}//package game
Section 77
//Game__seaToGrass (game.Game__seaToGrass)
package game {
import flash.display.*;
import mx.core.*;
public class Game__seaToGrass extends SpriteAsset {
public var boat:DisplayObject;
public var bigred2:DisplayObject;
public var green:DisplayObject;
public var level:DisplayObject;
public var redspecial:DisplayObject;
public var saucer:DisplayObject;
public var lives:DisplayObject;
public var eject:DisplayObject;
public var mine:DisplayObject;
public var red:DisplayObject;
public var score:DisplayObject;
public var powerup:DisplayObject;
public var bossBar:DisplayObject;
public var jet:DisplayObject;
public var shieldBar:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var coins:DisplayObject;
public var lifeBar:DisplayObject;
public var jet2:DisplayObject;
public var spawn:DisplayObject;
}
}//package game
Section 78
//Game__test (game.Game__test)
package game {
import flash.display.*;
import mx.core.*;
public class Game__test extends SpriteAsset {
public var boat:DisplayObject;
public var bigred2:DisplayObject;
public var green:DisplayObject;
public var level:DisplayObject;
public var redspecial:DisplayObject;
public var saucer:DisplayObject;
public var lives:DisplayObject;
public var eject:DisplayObject;
public var mine:DisplayObject;
public var red:DisplayObject;
public var score:DisplayObject;
public var powerup:DisplayObject;
public var jet:DisplayObject;
public var shieldBar:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var coins:DisplayObject;
public var lifeBar:DisplayObject;
}
}//package game
Section 79
//Game__town01 (game.Game__town01)
package game {
import flash.display.*;
import mx.core.*;
public class Game__town01 extends SpriteAsset {
public var boat:DisplayObject;
public var bigred2:DisplayObject;
public var green:DisplayObject;
public var level:DisplayObject;
public var redspecial:DisplayObject;
public var saucer:DisplayObject;
public var lives:DisplayObject;
public var eject:DisplayObject;
public var mine:DisplayObject;
public var bigred:DisplayObject;
public var score:DisplayObject;
public var powerup:DisplayObject;
public var bossBar:DisplayObject;
public var jet:DisplayObject;
public var shieldBar:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var coins:DisplayObject;
public var lifeBar:DisplayObject;
public var jet2:DisplayObject;
public var spawn:DisplayObject;
public var red:DisplayObject;
}
}//package game
Section 80
//Tilt (game.Tilt)
package game {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import com.greensock.*;
public class Tilt {
private static const _tiltData:Array = [1, 1.01, 1.02, 1.01, 1.03, 1.01, 1.04];
private static var _displayObject:DisplayObject;
private static var _index:int;
public function Tilt(){
super();
}
public static function setup(displayObject:DisplayObject):void{
if (_index){
return;
};
TweenMax.pauseAll();
_displayObject = displayObject;
_displayObject.addEventListener(Event.ENTER_FRAME, onEnterFrame, false, 0, true);
_index = (_tiltData.length - 1);
_displayObject.transform.colorTransform = new ColorTransform(12, 12, 12);
}
private static function onEnterFrame(event:Event):void{
_displayObject.scaleX = _tiltData[_index];
_displayObject.scaleY = _displayObject.scaleX;
if (_index){
_index--;
} else {
_displayObject.removeEventListener(Event.ENTER_FRAME, onEnterFrame);
Game.getInstance().fixTilesGap();
_displayObject.transform.colorTransform = new ColorTransform();
};
}
}
}//package game
Section 81
//MochiAd (mochi.as3.MochiAd)
package mochi.as3 {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
public class MochiAd {
public function MochiAd(){
super();
}
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function showClickAwayAd(options:Object):void{
var clip:Object;
var mc:MovieClip;
var chk:MovieClip;
var options = options;
var DEFAULTS:Object = {ad_timeout:5500, regpt:"o", method:"showClickAwayAd", res:"300x250", no_bg:true, ad_started:function ():void{
}, ad_finished:function ():void{
}, ad_loaded:function (width:Number, height:Number):void{
}, ad_failed:function ():void{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function ():void{
}};
options = MochiAd._parseOptions(options, DEFAULTS);
clip = options.clip;
var ad_timeout:Number = options.ad_timeout;
delete options.ad_timeout;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
MochiAd._cleanup(mc);
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_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
mc.unloadAd = function ():void{
MochiAd.unload(clip);
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.rpc = function (callbackID:Number, arg:Object):void{
MochiAd.rpc(clip, callbackID, arg);
};
chk["onEnterFrame"] = function ():void{
var total:Number;
if (!this.parent){
delete this.onEnterFrame;
return;
};
var ad_clip:Object = this.parent._mochiad_ctr;
var elapsed:Number = (getTimer() - this.started);
var finished:Boolean;
if (!chk.showing){
total = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (total > 0){
chk.showing = true;
finished = true;
chk.started = getTimer();
} else {
if (elapsed > chk.ad_timeout){
options.ad_failed();
finished = true;
};
};
};
if (this.root == null){
finished = true;
};
if (finished){
delete this.onEnterFrame;
};
};
doOnEnterFrame(chk);
}
public static function _isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function _allowDomains(server:String):String{
var hostname:String = server.split("/")[2].split(":")[0];
if (Security.sandboxType == "application"){
return (hostname);
};
Security.allowDomain("*");
Security.allowDomain(hostname);
Security.allowInsecureDomain("*");
Security.allowInsecureDomain(hostname);
return (hostname);
}
public static function unload(clip:Object):Boolean{
if (((clip.clip) && (clip.clip._mochiad))){
clip = clip.clip;
};
if (clip.origFrameRate != undefined){
clip.stage.frameRate = clip.origFrameRate;
};
if (!clip._mochiad){
return (false);
};
if (clip._mochiad._containerLCName != undefined){
clip._mochiad.lc.send(clip._mochiad._containerLCName, "notify", {id:"unload"});
};
if (clip._mochiad.onUnload){
clip._mochiad.onUnload();
};
delete clip._mochiad_loaded;
delete clip._mochiad;
return (true);
}
public static function showInterLevelAd(options:Object):void{
var clip:Object;
var mc:MovieClip;
var chk:MovieClip;
var options = options;
var DEFAULTS:Object = {ad_timeout:5500, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function ():void{
if ((this.clip is MovieClip)){
this.clip.stop();
} else {
throw (new Error("MochiAd.showInterLevelAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_finished:function ():void{
if ((this.clip is MovieClip)){
this.clip.play();
} else {
throw (new Error("MochiAd.showInterLevelAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_loaded:function (width:Number, height:Number):void{
}, ad_failed:function ():void{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function ():void{
}};
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_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
MochiAd._cleanup(mc);
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{
if (!this.parent){
delete this.onEnterFrame;
delete this.fadeFunction;
return;
};
var p:Number = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (p > 0){
this.parent.alpha = (p * 0.01);
} else {
MochiAd.unload(clip);
delete this["onEnterFrame"];
};
};
mc.unloadAd = function ():void{
MochiAd.unload(clip);
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.adjustProgress = function (msec:Number):void{
var _chk:Object = mc._mochiad_wait;
_chk.server_control = true;
_chk.showing = true;
_chk.started = getTimer();
_chk.ad_msec = (msec - 250);
};
mc.rpc = function (callbackID:Number, arg:Object):void{
MochiAd.rpc(clip, callbackID, arg);
};
chk["onEnterFrame"] = function ():void{
var total:Number;
if (!this.parent){
delete this.onEnterFrame;
delete this.fadeFunction;
return;
};
var ad_clip:Object = this.parent._mochiad_ctr;
var elapsed:Number = (getTimer() - this.started);
var finished:Boolean;
if (!chk.showing){
total = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (total > 0){
chk.showing = true;
chk.started = getTimer();
MochiAd.adShowing(clip);
} else {
if (elapsed > chk.ad_timeout){
options.ad_failed();
finished = true;
};
};
};
if (elapsed > chk.ad_msec){
finished = true;
};
if (finished){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function _parseOptions(options:Object, defaults:Object):Object{
var k:String;
var pairs:Array;
var i:Number;
var kv:Array;
var optcopy:Object = {};
for (k in defaults) {
optcopy[k] = defaults[k];
};
if (options){
for (k in options) {
optcopy[k] = options[k];
};
};
if (optcopy.clip == undefined){
throw (new Error("MochiAd is missing the 'clip' parameter. This should be a MovieClip, Sprite or an instance of a class that extends MovieClip or Sprite."));
};
options = optcopy.clip.loaderInfo.parameters.mochiad_options;
if (options){
pairs = options.split("&");
i = 0;
while (i < pairs.length) {
kv = pairs[i].split("=");
optcopy[unescape(kv[0])] = unescape(kv[1]);
i++;
};
};
if (optcopy.id == "test"){
trace("[MochiAd] WARNING: Using the MochiAds test identifier, make sure to use the code from your dashboard, not this example!");
};
return (optcopy);
}
public static function _cleanup(mc:Object):void{
var k:String;
var lc:LocalConnection;
var f:Function;
var mc = mc;
if (("lc" in mc)){
lc = mc.lc;
f = function ():void{
lc.client = null;
lc.close();
//unresolved jump
var _slot1 = e;
};
setTimeout(f, 0);
};
var idx:Number = DisplayObjectContainer(mc).numChildren;
while (idx > 0) {
idx = (idx - 1);
DisplayObjectContainer(mc).removeChildAt(idx);
};
for (k in mc) {
delete mc[k];
};
}
public static function load(options:Object):MovieClip{
var clip:Object;
var mc:MovieClip;
var k:String;
var server:String;
var hostname:String;
var lc:LocalConnection;
var name:String;
var loader:Loader;
var g:Function;
var req:URLRequest;
var v:Object;
var options = options;
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();
clip = options.clip;
if (!(clip is DisplayObject)){
trace("Warning: Object passed as container clip not a descendant of the DisplayObject type");
return (null);
};
if (MovieClip(clip).stage == null){
trace("Warning: Container clip for ad is not attached to the stage");
return (null);
};
if (!MochiAd._isNetworkAvailable()){
return (null);
};
if (clip._mochiad_loaded){
return (null);
};
//unresolved jump
var _slot1 = e;
throw (new Error("MochiAd requires a clip that is an instance of a dynamic class. If your class extends Sprite or MovieClip, you must make it dynamic."));
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;
if (clip.loaderInfo.loaderURL.indexOf("http") == 0){
options.as3_swf = clip.loaderInfo.loaderURL;
} else {
trace("[MochiAd] NOTE: Security Sandbox Violation errors below are normal");
};
var lv:URLVariables = new URLVariables();
for (k in options) {
v = options[k];
if (!(v is Function)){
lv[k] = v;
};
};
server = lv.server;
delete lv.server;
hostname = _allowDomains(server);
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.lc = lc;
mc.lcName = name;
lv.lc = name;
lv.st = getTimer();
mc.regContLC = function (lc_name:String):void{
mc._containerLCName = lc_name;
};
loader = new Loader();
g = function (ev:Object):void{
ev.target.removeEventListener(ev.type, arguments.callee);
MochiAd.unload(clip);
};
loader.contentLoaderInfo.addEventListener(Event.UNLOAD, g);
req = new URLRequest(((server + ".swf?cacheBust=") + new Date().getTime()));
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, function (io:IOErrorEvent):void{
trace("[MochiAds] Blocked URL");
});
if (!options.skip){
loader.load(req);
};
mc.addChild(loader);
mc._mochiad_ctr = loader;
return (mc);
}
public static function runMethod(base:Object, methodName:String, argsArray:Array):Object{
var nameArray:Array = methodName.split(".");
var i:Number = 0;
while (i < (nameArray.length - 1)) {
if ((((base[nameArray[i]] == undefined)) || ((base[nameArray[i]] == null)))){
return (undefined);
};
base = base[nameArray[i]];
i++;
};
if (typeof(base[nameArray[i]]) == "function"){
return (base[nameArray[i]].apply(base, argsArray));
};
return (undefined);
}
public static function createEmptyMovieClip(parent:Object, name:String, depth:Number):MovieClip{
var mc:MovieClip = new MovieClip();
if (((false) && (depth))){
parent.addChildAt(mc, depth);
} else {
parent.addChild(mc);
};
parent[name] = mc;
mc["_name"] = name;
return (mc);
}
public static function _getRes(options:Object, clip:Object):Array{
var xy:Array;
var b:Object = clip.getBounds(clip.root);
var w:Number = 0;
var h:Number = 0;
if (typeof(options.res) != "undefined"){
xy = options.res.split("x");
w = parseFloat(xy[0]);
h = parseFloat(xy[1]);
} else {
w = (b.right - b.left);
h = (b.top - b.bottom);
};
if ((((w == 0)) || ((h == 0)))){
w = clip.stage.stageWidth;
h = clip.stage.stageHeight;
};
return ([w, h]);
}
public static function adShowing(mc:Object):void{
mc.origFrameRate = mc.stage.frameRate;
mc.stage.frameRate = 30;
}
public static function getValue(base:Object, objectName:String):Object{
var nameArray:Array = objectName.split(".");
var i:Number = 0;
while (i < (nameArray.length - 1)) {
if ((((base[nameArray[i]] == undefined)) || ((base[nameArray[i]] == null)))){
return (undefined);
};
base = base[nameArray[i]];
i++;
};
return (base[nameArray[i]]);
}
public static function rpc(clip:Object, callbackID:Number, arg:Object):void{
var _local4:Object;
var _local5:Object;
switch (arg.id){
case "setValue":
MochiAd.setValue(clip, arg.objectName, arg.value);
break;
case "getValue":
_local4 = MochiAd.getValue(clip, arg.objectName);
clip._mochiad.lc.send(clip._mochiad._containerLCName, "rpcResult", callbackID, _local4);
break;
case "runMethod":
_local5 = MochiAd.runMethod(clip, arg.method, arg.args);
clip._mochiad.lc.send(clip._mochiad._containerLCName, "rpcResult", callbackID, _local5);
break;
default:
trace(("[mochiads rpc] unknown rpc id: " + arg.id));
};
}
public static function setValue(base:Object, objectName:String, value:Object):void{
var nameArray:Array = objectName.split(".");
var i:Number = 0;
while (i < (nameArray.length - 1)) {
if ((((base[nameArray[i]] == undefined)) || ((base[nameArray[i]] == null)))){
return;
};
base = base[nameArray[i]];
i++;
};
base[nameArray[i]] = value;
}
public static function showPreGameAd(options:Object):void{
var clip:Object;
var mc:MovieClip;
var chk:MovieClip;
var bar:MovieClip;
var complete:Boolean;
var unloaded:Boolean;
var sendHostProgress:Boolean;
var fn:Function;
var r:MovieClip;
var options = options;
var DEFAULTS:Object = {ad_timeout:5500, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:0xFF8A00, background:16777161, outline:13994812, no_progress_bar:false, ad_started:function ():void{
if ((this.clip is MovieClip)){
this.clip.stop();
} else {
throw (new Error("MochiAd.showPreGameAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_finished:function ():void{
if ((this.clip is MovieClip)){
this.clip.play();
} else {
throw (new Error("MochiAd.showPreGameAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_loaded:function (width:Number, height:Number):void{
}, ad_failed:function ():void{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function ():void{
}, ad_progress:function (percent:Number):void{
}, progress_override:function (_clip:Object):Number{
return (NaN);
}, bar_offset:0};
options = MochiAd._parseOptions(options, DEFAULTS);
if ("c862232051e0a94e1c3609b3916ddb17".substr(0) == "dfeada81ac97cde83665f81c12da7def"){
options.ad_started();
fn = function ():void{
options.ad_finished();
};
setTimeout(fn, 100);
return;
};
clip = options.clip;
var ad_msec:Number = 11000;
var ad_timeout:Number = options.ad_timeout;
if (options.skip){
ad_timeout = 0;
};
delete options.ad_timeout;
var fadeout_time:Number = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
MochiAd._cleanup(mc);
var fn:Function = function ():void{
options.ad_finished();
};
setTimeout(fn, 100);
};
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);
bar = createEmptyMovieClip(chk, "_mochiad_bar", 4);
if (options.no_progress_bar){
bar.visible = false;
delete options.no_progress_bar;
} else {
bar.x = (10 + options.bar_offset);
bar.y = (h - 20);
};
var bar_w:Number = ((w - bar.x) - 10);
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(bar_w, 0);
backing.lineTo(bar_w, 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(bar_w, 0);
inside.lineTo(bar_w, 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(bar_w, 0);
outline.lineTo(bar_w, 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 p:Number = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (p > 0){
this.parent.alpha = (p * 0.01);
} else {
MochiAd.unload(clip);
delete this["onEnterFrame"];
};
};
complete = false;
unloaded = false;
var progress:Number = Math.min(1, options.progress_override(clip));
var f:Function = function (ev:Event):void{
ev.target.removeEventListener(ev.type, arguments.callee);
complete = true;
if (unloaded){
MochiAd.unload(clip);
};
};
if (!isNaN(progress)){
complete = (progress == 1);
} else {
if (clip.loaderInfo.bytesLoaded == clip.loaderInfo.bytesTotal){
complete = true;
} else {
if ((clip.root is MovieClip)){
r = (clip.root as MovieClip);
if (r.framesLoaded >= r.totalFrames){
complete = true;
} else {
clip.loaderInfo.addEventListener(Event.COMPLETE, f);
};
} else {
clip.loaderInfo.addEventListener(Event.COMPLETE, f);
};
};
};
mc.unloadAd = function ():void{
unloaded = true;
if (complete){
MochiAd.unload(clip);
};
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.adjustProgress = function (msec:Number):void{
var _chk:Object = mc._mochiad_wait;
_chk.server_control = true;
_chk.showing = true;
_chk.started = getTimer();
_chk.ad_msec = msec;
};
mc.rpc = function (callbackID:Number, arg:Object):void{
MochiAd.rpc(clip, callbackID, arg);
};
mc.rpcTestFn = function (s:String):Object{
trace(("[MOCHIAD rpcTestFn] " + s));
return (s);
};
sendHostProgress = false;
mc.sendHostLoadProgress = function (lc_name:String):void{
sendHostProgress = true;
};
chk["onEnterFrame"] = function ():void{
var total:Number;
if (((!(this.parent)) || (!(this.parent.parent)))){
delete this["onEnterFrame"];
return;
};
var _clip:Object = this.parent.parent.root;
var ad_clip:Object = this.parent._mochiad_ctr;
var elapsed:Number = (getTimer() - this.started);
var finished:Boolean;
var clip_total:Number = _clip.loaderInfo.bytesTotal;
var clip_loaded:Number = _clip.loaderInfo.bytesLoaded;
var clip_progress:Number = Math.min(1, options.progress_override(_clip));
if (clip_progress == 1){
complete = true;
};
if (complete){
clip_loaded = Math.max(1, clip_loaded);
clip_total = clip_loaded;
};
var clip_pcnt:Number = ((100 * clip_loaded) / clip_total);
if (!isNaN(clip_progress)){
clip_pcnt = (100 * clip_progress);
};
var ad_pcnt:Number = ((100 * elapsed) / chk.ad_msec);
var _inside:Object = this._mochiad_bar._inside;
var pcnt:Number = Math.min(100, Math.min(((clip_pcnt) || (0)), ad_pcnt));
pcnt = Math.max(this.last_pcnt, pcnt);
this.last_pcnt = pcnt;
_inside.scaleX = (pcnt * 0.01);
options.ad_progress(pcnt);
if (sendHostProgress){
clip._mochiad.lc.send(clip._mochiad._containerLCName, "notify", {id:"hostLoadPcnt", pcnt:clip_pcnt});
if (clip_pcnt >= 100){
sendHostProgress = false;
};
};
if (!chk.showing){
total = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (total > 0){
chk.showing = true;
chk.started = getTimer();
MochiAd.adShowing(clip);
} else {
if ((((elapsed > chk.ad_timeout)) && ((clip_pcnt == 100)))){
options.ad_failed();
finished = true;
};
};
};
if (elapsed > chk.ad_msec){
finished = true;
};
if (((complete) && (finished))){
if (unloaded){
MochiAd.unload(_clip);
} else {
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
};
};
};
};
doOnEnterFrame(chk);
}
public static function showPreloaderAd(options:Object):void{
trace("[MochiAd] DEPRECATED: showPreloaderAd was renamed to showPreGameAd in 2.0");
MochiAd.showPreGameAd(options);
}
public static function showTimedAd(options:Object):void{
trace("[MochiAd] DEPRECATED: showTimedAd was renamed to showInterLevelAd in 2.0");
MochiAd.showInterLevelAd(options);
}
public static function doOnEnterFrame(mc:MovieClip):void{
var mc = mc;
var f:Function = function (ev:Object):void{
if (((("onEnterFrame" in mc)) && (mc.onEnterFrame))){
mc.onEnterFrame();
} else {
ev.target.removeEventListener(ev.type, arguments.callee);
};
};
mc.addEventListener(Event.ENTER_FRAME, f);
}
}
}//package mochi.as3
Section 82
//MochiCoins (mochi.as3.MochiCoins)
package mochi.as3 {
public class MochiCoins {
public static const STORE_HIDE:String = "StoreHide";
public static const NO_USER:String = "NoUser";
public static const IO_ERROR:String = "IOError";
public static const ITEM_NEW:String = "ItemNew";
public static const ITEM_OWNED:String = "ItemOwned";
public static const STORE_ITEMS:String = "StoreItems";
public static const ERROR:String = "Error";
public static const STORE_SHOW:String = "StoreShow";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public static var _inventory:MochiInventory;
public function MochiCoins(){
super();
}
public static function triggerEvent(eventType:String, args:Object):void{
_dispatcher.triggerEvent(eventType, args);
}
public static function removeEventListener(eventType:String, delegate:Function):void{
_dispatcher.removeEventListener(eventType, delegate);
}
public static function addEventListener(eventType:String, delegate:Function):void{
_dispatcher.addEventListener(eventType, delegate);
}
public static function getStoreItems():void{
MochiServices.send("coins_getStoreItems");
}
public static function get inventory():MochiInventory{
return (_inventory);
}
public static function showStore(options:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("coins_showStore", {options:options}, null, null);
}
public static function requestFunding(properties:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("social_requestFunding", properties);
}
public static function showItem(options:Object=null):void{
if (((!(options)) || (!((typeof(options.item) == "string"))))){
trace("ERROR: showItem call must pass an Object with an item key");
return;
};
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("coins_showItem", {options:options}, null, null);
}
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function showVideo(options:Object=null):void{
if (((!(options)) || (!((typeof(options.item) == "string"))))){
trace("ERROR: showVideo call must pass an Object with an item key");
return;
};
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("coins_showVideo", {options:options}, null, null);
}
addEventListener(MochiSocial.LOGGED_IN, function (args:Object):void{
_inventory = new MochiInventory();
});
addEventListener(MochiSocial.LOGGED_OUT, function (args:Object):void{
_inventory = null;
});
}
}//package mochi.as3
Section 83
//MochiDigits (mochi.as3.MochiDigits)
package mochi.as3 {
public final class MochiDigits {
private var Sibling:MochiDigits;
private var Fragment:Number;
private var Encoder:Number;
public function MochiDigits(digit:Number=0, index:uint=0):void{
super();
Encoder = 0;
setValue(digit, index);
}
public function reencode():void{
var newEncode:uint = int((2147483647 * Math.random()));
Fragment = (Fragment ^ (newEncode ^ Encoder));
Encoder = newEncode;
}
public function set value(v:Number):void{
setValue(v);
}
public function toString():String{
var s:String = String.fromCharCode((Fragment ^ Encoder));
if (Sibling != null){
s = (s + Sibling.toString());
};
return (s);
}
public function setValue(digit:Number=0, index:uint=0):void{
var s:String = digit.toString();
var _temp1 = index;
index = (index + 1);
Fragment = (s.charCodeAt(_temp1) ^ Encoder);
if (index < s.length){
Sibling = new MochiDigits(digit, index);
} else {
Sibling = null;
};
reencode();
}
public function get value():Number{
return (Number(this.toString()));
}
public function addValue(inc:Number):void{
value = (value + inc);
}
}
}//package mochi.as3
Section 84
//MochiEventDispatcher (mochi.as3.MochiEventDispatcher)
package mochi.as3 {
public class MochiEventDispatcher {
private var eventTable:Object;
public function MochiEventDispatcher():void{
super();
eventTable = {};
}
public function triggerEvent(event:String, args:Object):void{
var i:Object;
if (eventTable[event] == undefined){
return;
};
for (i in eventTable[event]) {
var _local6 = eventTable[event];
_local6[i](args);
};
}
public function removeEventListener(event:String, delegate:Function):void{
var s:Object;
if (eventTable[event] == undefined){
eventTable[event] = [];
return;
};
for (s in eventTable[event]) {
if (eventTable[event][s] != delegate){
} else {
eventTable[event].splice(Number(s), 1);
};
};
}
public function addEventListener(event:String, delegate:Function):void{
removeEventListener(event, delegate);
eventTable[event].push(delegate);
}
}
}//package mochi.as3
Section 85
//MochiEvents (mochi.as3.MochiEvents)
package mochi.as3 {
import flash.display.*;
public class MochiEvents {
public static const ALIGN_BOTTOM_LEFT:String = "ALIGN_BL";
public static const FORMAT_LONG:String = "LongForm";
public static const ALIGN_BOTTOM:String = "ALIGN_B";
public static const ACHIEVEMENT_RECEIVED:String = "AchievementReceived";
public static const FORMAT_SHORT:String = "ShortForm";
public static const ALIGN_TOP_RIGHT:String = "ALIGN_TR";
public static const ALIGN_BOTTOM_RIGHT:String = "ALIGN_BR";
public static const ALIGN_TOP:String = "ALIGN_T";
public static const ALIGN_LEFT:String = "ALIGN_L";
public static const ALIGN_RIGHT:String = "ALIGN_R";
public static const ALIGN_TOP_LEFT:String = "ALIGN_TL";
public static const ALIGN_CENTER:String = "ALIGN_C";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
private static var gameStart:Number;
private static var levelStart:Number;
public function MochiEvents(){
super();
}
public static function endPlay():void{
MochiServices.send("events_clearRoundID", null, null, null);
}
public static function addEventListener(eventType:String, delegate:Function):void{
_dispatcher.addEventListener(eventType, delegate);
}
public static function trackEvent(tag:String, value=null):void{
MochiServices.send("events_trackEvent", {tag:tag, value:value}, null, null);
}
public static function removeEventListener(eventType:String, delegate:Function):void{
_dispatcher.removeEventListener(eventType, delegate);
}
public static function startSession(achievementID:String):void{
MochiServices.send("events_beginSession", {achievementID:achievementID}, null, null);
}
public static function triggerEvent(eventType:String, args:Object):void{
_dispatcher.triggerEvent(eventType, args);
}
public static function setNotifications(clip:MovieClip, style:Object):void{
var s:Object;
var args:Object = {};
for (s in style) {
args[s] = style[s];
};
args.clip = clip;
MochiServices.send("events_setNotifications", args, null, null);
}
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function startPlay(tag:String="gameplay"):void{
MochiServices.send("events_setRoundID", {tag:String(tag)}, null, null);
}
}
}//package mochi.as3
Section 86
//MochiInventory (mochi.as3.MochiInventory)
package mochi.as3 {
import flash.events.*;
import flash.utils.*;
public dynamic class MochiInventory extends Proxy {
private var _timer:Timer;
private var _names:Array;
private var _syncID:Number;
private var _consumableProperties:Object;
private var _storeSync:Object;
private var _outstandingID:Number;
private var _syncPending:Boolean;
public static const READY:String = "InvReady";
public static const ERROR:String = "Error";
public static const IO_ERROR:String = "IoError";
private static const KEY_SALT:String = " syncMaint";
public static const WRITTEN:String = "InvWritten";
public static const NOT_READY:String = "InvNotReady";
public static const VALUE_ERROR:String = "InvValueError";
private static const CONSUMER_KEY:String = "MochiConsumables";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public function MochiInventory():void{
super();
MochiCoins.addEventListener(MochiCoins.ITEM_OWNED, itemOwned);
MochiCoins.addEventListener(MochiCoins.ITEM_NEW, newItems);
MochiSocial.addEventListener(MochiSocial.LOGGED_IN, loggedIn);
MochiSocial.addEventListener(MochiSocial.LOGGED_OUT, loggedOut);
_storeSync = new Object();
_syncPending = false;
_outstandingID = 0;
_syncID = 0;
_timer = new Timer(1000);
_timer.addEventListener(TimerEvent.TIMER, sync);
_timer.start();
if (MochiSocial.loggedIn){
loggedIn();
} else {
loggedOut();
};
}
private function newItems(event:Object):void{
if (!this[(event.id + KEY_SALT)]){
this[(event.id + KEY_SALT)] = 0;
};
if (!this[event.id]){
this[event.id] = 0;
};
this[(event.id + KEY_SALT)] = (this[(event.id + KEY_SALT)] + event.count);
this[event.id] = (this[event.id] + event.count);
if (((event.privateProperties) && (event.privateProperties.consumable))){
if (!this[event.privateProperties.tag]){
this[event.privateProperties.tag] = 0;
};
this[event.privateProperties.tag] = (this[event.privateProperties.tag] + (event.privateProperties.inc * event.count));
};
}
public function release():void{
MochiCoins.removeEventListener(MochiCoins.ITEM_NEW, newItems);
MochiSocial.removeEventListener(MochiSocial.LOGGED_IN, loggedIn);
MochiSocial.removeEventListener(MochiSocial.LOGGED_OUT, loggedOut);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function getProperty(name){
if (_consumableProperties == null){
triggerEvent(ERROR, {type:NOT_READY});
return (-1);
};
if (_consumableProperties[name]){
return (MochiDigits(_consumableProperties[name]).value);
};
return (undefined);
}
private function loggedIn(args:Object=null):void{
MochiUserData.get(CONSUMER_KEY, getConsumableBag);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function hasProperty(name):Boolean{
if (_consumableProperties == null){
triggerEvent(ERROR, {type:NOT_READY});
return (false);
};
if (_consumableProperties[name] == undefined){
return (false);
};
return (true);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function nextNameIndex(index:int):int{
return (((index)>=_names.length) ? 0 : (index + 1));
}
private function putConsumableBag(userData:MochiUserData):void{
_syncPending = false;
if (userData.error){
triggerEvent(ERROR, {type:IO_ERROR, error:userData.error});
_outstandingID = -1;
};
triggerEvent(WRITTEN, {});
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function setProperty(name, value):void{
var d:MochiDigits;
if (_consumableProperties == null){
triggerEvent(ERROR, {type:NOT_READY});
return;
};
if (!(value is Number)){
triggerEvent(ERROR, {type:VALUE_ERROR, error:"Invalid type", arg:value});
return;
};
if (_consumableProperties[name]){
d = MochiDigits(_consumableProperties[name]);
if (d.value == value){
return;
};
d.value = value;
} else {
_names.push(name);
_consumableProperties[name] = new MochiDigits(value);
};
_syncID++;
}
private function itemOwned(event:Object):void{
_storeSync[event.id] = {properties:event.properties, count:event.count};
}
private function sync(e:Event=null):void{
var key:String;
if (((_syncPending) || ((_syncID == _outstandingID)))){
return;
};
_outstandingID = _syncID;
var output:Object = {};
for (key in _consumableProperties) {
output[key] = MochiDigits(_consumableProperties[key]).value;
};
MochiUserData.put(CONSUMER_KEY, output, putConsumableBag);
_syncPending = true;
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function nextName(index:int):String{
return (_names[(index - 1)]);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function deleteProperty(name):Boolean{
if (!_consumableProperties[name]){
return (false);
};
_names.splice(_names.indexOf(name), 1);
delete _consumableProperties[name];
return (true);
}
private function getConsumableBag(userData:MochiUserData):void{
var key:String;
var unsynced:Number;
if (userData.error){
triggerEvent(ERROR, {type:IO_ERROR, error:userData.error});
return;
};
_consumableProperties = {};
_names = new Array();
if (userData.data){
for (key in userData.data) {
_names.push(key);
_consumableProperties[key] = new MochiDigits(userData.data[key]);
};
};
for (key in _storeSync) {
unsynced = _storeSync[key].count;
if (_consumableProperties[(key + KEY_SALT)]){
unsynced = (unsynced - _consumableProperties[(key + KEY_SALT)].value);
};
if (unsynced == 0){
} else {
newItems({id:key, count:unsynced, properties:_storeSync[key].properties});
};
};
triggerEvent(READY, {});
}
private function loggedOut(args:Object=null):void{
_consumableProperties = null;
}
public static function triggerEvent(eventType:String, args:Object):void{
_dispatcher.triggerEvent(eventType, args);
}
public static function removeEventListener(eventType:String, delegate:Function):void{
_dispatcher.removeEventListener(eventType, delegate);
}
public static function addEventListener(eventType:String, delegate:Function):void{
_dispatcher.addEventListener(eventType, delegate);
}
}
}//package mochi.as3
Section 87
//MochiServices (mochi.as3.MochiServices)
package mochi.as3 {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
public class MochiServices {
public static const CONNECTED:String = "onConnected";
private static var _container:Object;
private static var _connected:Boolean = false;
private static var _queue:Array;
private static var _swfVersion:String;
private static var _preserved:Object;
public static var netupAttempted:Boolean = false;
private static var _sendChannel:LocalConnection;
private static var _nextCallbackID:Number;
private static var _clip:MovieClip;
private static var _loader:Loader;
private static var _id:String;
private static var _services:String = "services.swf";
private static var _servURL:String = "http://www.mochiads.com/static/lib/services/";
public static var widget:Boolean = false;
private static var _timer:Timer;
private static var _sendChannelName:String;
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
private static var _callbacks:Object;
private static var _connecting:Boolean = false;
private static var _mochiLocalConnection:MovieClip;
private static var _listenChannelName:String = "__ms_";
public static var onError:Object;
public static var netup:Boolean = true;
private static var _mochiLC:String = "MochiLC.swf";
public function MochiServices(){
super();
}
public static function isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function get connected():Boolean{
return (_connected);
}
private static function onReceive(pkg:Object):void{
var methodName:String;
var pkg = pkg;
var cb:String = pkg.callbackID;
var cblst:Object = _callbacks[cb];
if (!cblst){
return;
};
var method:* = cblst.callbackMethod;
methodName = "";
var obj:Object = cblst.callbackObject;
if (((obj) && ((typeof(method) == "string")))){
methodName = method;
if (obj[method] != null){
method = obj[method];
} else {
trace((("Error: Method " + method) + " does not exist."));
};
};
if (method != undefined){
method.apply(obj, pkg.args);
//unresolved jump
var _slot1 = error;
trace(((("Error invoking callback method '" + methodName) + "': ") + _slot1.toString()));
} else {
if (obj != null){
obj(pkg.args);
//unresolved jump
var _slot1 = error;
trace(("Error invoking method on object: " + _slot1.toString()));
};
};
delete _callbacks[cb];
}
public static function send(methodName:String, args:Object=null, callbackObject:Object=null, callbackMethod:Object=null):void{
if (_connected){
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:methodName, args:args, callbackID:_nextCallbackID});
} else {
if ((((_clip == null)) || (!(_connecting)))){
trace(("Error: MochiServices not connected. Please call MochiServices.connect(). Function: " + methodName));
handleError(args, callbackObject, callbackMethod);
flush(true);
return;
};
_queue.push({methodName:methodName, args:args, callbackID:_nextCallbackID});
};
if (_clip != null){
if (_callbacks != null){
_callbacks[_nextCallbackID] = {callbackObject:callbackObject, callbackMethod:callbackMethod};
_nextCallbackID++;
};
};
}
private static function init(id:String, clip:Object):void{
_id = id;
if (clip != null){
_container = clip;
loadCommunicator(id, _container);
};
}
private static function clickMovie(url:String, cb:Function):MovieClip{
var b:int;
var loader:Loader;
var avm1_bytecode:Array = [150, 21, 0, 7, 1, 0, 0, 0, 0, 98, 116, 110, 0, 7, 2, 0, 0, 0, 0, 116, 104, 105, 115, 0, 28, 150, 22, 0, 0, 99, 114, 101, 97, 116, 101, 69, 109, 112, 116, 121, 77, 111, 118, 105, 101, 67, 108, 105, 112, 0, 82, 135, 1, 0, 0, 23, 150, 13, 0, 4, 0, 0, 111, 110, 82, 101, 108, 101, 97, 115, 101, 0, 142, 8, 0, 0, 0, 0, 2, 42, 0, 114, 0, 150, 17, 0, 0, 32, 0, 7, 1, 0, 0, 0, 8, 0, 0, 115, 112, 108, 105, 116, 0, 82, 135, 1, 0, 1, 23, 150, 7, 0, 4, 1, 7, 0, 0, 0, 0, 78, 150, 8, 0, 0, 95, 98, 108, 97, 110, 107, 0, 154, 1, 0, 0, 150, 7, 0, 0, 99, 108, 105, 99, 107, 0, 150, 7, 0, 4, 1, 7, 1, 0, 0, 0, 78, 150, 27, 0, 7, 2, 0, 0, 0, 7, 0, 0, 0, 0, 0, 76, 111, 99, 97, 108, 67, 111, 110, 110, 101, 99, 116, 105, 111, 110, 0, 64, 150, 6, 0, 0, 115, 101, 110, 100, 0, 82, 79, 150, 15, 0, 4, 0, 0, 95, 97, 108, 112, 104, 97, 0, 7, 0, 0, 0, 0, 79, 150, 23, 0, 7, 0xFF, 0, 0xFF, 0, 7, 1, 0, 0, 0, 4, 0, 0, 98, 101, 103, 105, 110, 70, 105, 108, 108, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 109, 111, 118, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 16, 0, 7, 0, 0, 0, 0, 4, 0, 0, 101, 110, 100, 70, 105, 108, 108, 0, 82, 23];
var header:Array = [104, 0, 31, 64, 0, 7, 208, 0, 0, 12, 1, 0, 67, 2, 0xFF, 0xFF, 0xFF, 63, 3];
var footer:Array = [0, 64, 0, 0, 0];
var mc:MovieClip = new MovieClip();
var lc:LocalConnection = new LocalConnection();
var lc_name:String = ((("_click_" + Math.floor((Math.random() * 999999))) + "_") + Math.floor(new Date().time));
lc = new LocalConnection();
mc.lc = lc;
mc.click = cb;
lc.client = mc;
lc.connect(lc_name);
var ba:ByteArray = new ByteArray();
var cpool:ByteArray = new ByteArray();
cpool.endian = Endian.LITTLE_ENDIAN;
cpool.writeShort(1);
cpool.writeUTFBytes(((url + " ") + lc_name));
cpool.writeByte(0);
var actionLength:uint = ((avm1_bytecode.length + cpool.length) + 4);
var fileLength:uint = (actionLength + 35);
ba.endian = Endian.LITTLE_ENDIAN;
ba.writeUTFBytes("FWS");
ba.writeByte(8);
ba.writeUnsignedInt(fileLength);
for each (b in header) {
ba.writeByte(b);
};
ba.writeUnsignedInt(actionLength);
ba.writeByte(136);
ba.writeShort(cpool.length);
ba.writeBytes(cpool);
for each (b in avm1_bytecode) {
ba.writeByte(b);
};
for each (b in footer) {
ba.writeByte(b);
};
loader = new Loader();
loader.loadBytes(ba);
mc.addChild(loader);
return (mc);
}
private static function detach(event:Event):void{
var loader:LoaderInfo = LoaderInfo(event.target);
loader.removeEventListener(Event.COMPLETE, detach);
loader.removeEventListener(IOErrorEvent.IO_ERROR, detach);
loader.removeEventListener(Event.COMPLETE, loadLCBridgeComplete);
loader.removeEventListener(IOErrorEvent.IO_ERROR, loadError);
}
public static function stayOnTop():void{
_container.addEventListener(Event.ENTER_FRAME, MochiServices.bringToTop, false, 0, true);
if (_clip != null){
_clip.visible = true;
};
}
private static function loadLCBridgeComplete(e:Event):void{
var loader:Loader = LoaderInfo(e.target).loader;
_mochiLocalConnection = MovieClip(loader.content);
listen();
}
public static function disconnect():void{
if (((_connected) || (_connecting))){
if (_clip != null){
if (_clip.parent != null){
if ((_clip.parent is Sprite)){
Sprite(_clip.parent).removeChild(_clip);
_clip = null;
};
};
};
_connecting = (_connected = false);
flush(true);
_mochiLocalConnection.close();
//unresolved jump
var _slot1 = error;
};
if (_timer != null){
_timer.stop();
_timer.removeEventListener(TimerEvent.TIMER, connectWait);
_timer = null;
//unresolved jump
var _slot1 = error;
};
}
public static function allowDomains(server:String):String{
var hostname:String;
if (Security.sandboxType != "application"){
Security.allowDomain("*");
Security.allowInsecureDomain("*");
};
if (server.indexOf("http://") != -1){
hostname = server.split("/")[2].split(":")[0];
if (Security.sandboxType != "application"){
Security.allowDomain(hostname);
Security.allowInsecureDomain(hostname);
};
};
return (hostname);
}
public static function getVersion():String{
return ("3.9.1 as3");
}
public static function doClose():void{
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
}
public static function warnID(bid:String, leaderboard:Boolean):void{
bid = bid.toLowerCase();
if (bid.length != 16){
trace((("WARNING: " + (leaderboard) ? "board" : "game") + " ID is not the appropriate length"));
return;
} else {
if (bid == "1e113c7239048b3f"){
if (leaderboard){
trace("WARNING: Using testing board ID");
} else {
trace("WARNING: Using testing board ID as game ID");
};
return;
} else {
if (bid == "84993a1de4031cd8"){
if (leaderboard){
trace("WARNING: Using testing game ID as board ID");
} else {
trace("WARNING: Using testing game ID");
};
return;
};
};
};
var i:Number = 0;
while (i < bid.length) {
switch (bid.charAt(i)){
case "0":
case "1":
case "2":
case "3":
case "4":
case "5":
case "6":
case "7":
case "8":
case "9":
case "a":
case "b":
case "c":
case "d":
case "e":
case "f":
break;
default:
trace(("WARNING: Board ID contains illegal characters: " + bid));
return;
};
i++;
};
}
private static function flush(error:Boolean):void{
var request:Object;
var callback:Object;
if (((_clip) && (_queue))){
while (_queue.length > 0) {
request = _queue.shift();
callback = null;
if (request != null){
if (request.callbackID != null){
callback = _callbacks[request.callbackID];
};
delete _callbacks[request.callbackID];
if (((error) && (!((callback == null))))){
handleError(request.args, callback.callbackObject, callback.callbackMethod);
};
};
};
};
}
public static function get id():String{
return (_id);
}
private static function onEvent(pkg:Object):void{
var target:String = pkg.target;
var event:String = pkg.event;
switch (target){
case "services":
MochiServices.triggerEvent(pkg.event, pkg.args);
break;
case "events":
MochiEvents.triggerEvent(pkg.event, pkg.args);
break;
case "coins":
MochiCoins.triggerEvent(pkg.event, pkg.args);
break;
case "social":
MochiSocial.triggerEvent(pkg.event, pkg.args);
break;
};
}
private static function urlOptions(clip:Object):Object{
var options:String;
var pairs:Array;
var i:Number;
var kv:Array;
var opts:Object = {};
if (clip.stage){
options = clip.stage.loaderInfo.parameters.mochiad_options;
} else {
options = clip.loaderInfo.parameters.mochiad_options;
};
if (options){
pairs = options.split("&");
i = 0;
while (i < pairs.length) {
kv = pairs[i].split("=");
opts[unescape(kv[0])] = unescape(kv[1]);
i++;
};
};
return (opts);
}
public static function addLinkEvent(url:String, burl:String, btn:DisplayObjectContainer, onClick:Function=null):void{
var avm1Click:DisplayObject;
var x:String;
var req:URLRequest;
var loader:Loader;
var setURL:Function;
var err:Function;
var complete:Function;
var url = url;
var burl = burl;
var btn = btn;
var onClick = onClick;
var vars:Object = new Object();
vars["mav"] = getVersion();
vars["swfv"] = "9";
vars["swfurl"] = btn.loaderInfo.loaderURL;
vars["fv"] = Capabilities.version;
vars["os"] = Capabilities.os;
vars["lang"] = Capabilities.language;
vars["scres"] = ((Capabilities.screenResolutionX + "x") + Capabilities.screenResolutionY);
var s = "?";
var i:Number = 0;
for (x in vars) {
if (i != 0){
s = (s + "&");
};
i = (i + 1);
s = (((s + x) + "=") + escape(vars[x]));
};
req = new URLRequest("http://link.mochiads.com/linkping.swf");
loader = new Loader();
setURL = function (url:String):void{
if (avm1Click){
btn.removeChild(avm1Click);
};
avm1Click = clickMovie(url, onClick);
var rect:Rectangle = btn.getBounds(btn);
btn.addChild(avm1Click);
avm1Click.x = rect.x;
avm1Click.y = rect.y;
avm1Click.scaleX = (0.01 * rect.width);
avm1Click.scaleY = (0.01 * rect.height);
};
err = function (ev:Object):void{
netup = false;
ev.target.removeEventListener(ev.type, arguments.callee);
setURL(burl);
};
complete = function (ev:Object):void{
ev.target.removeEventListener(ev.type, arguments.callee);
};
if (netup){
setURL((url + s));
} else {
setURL(burl);
};
if (!((netupAttempted) || (_connected))){
netupAttempted = true;
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, err);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, complete);
loader.load(req);
};
}
public static function setContainer(container:Object=null, doAdd:Boolean=true):void{
if (_clip.parent){
_clip.parent.removeChild(_clip);
};
if (container != null){
if ((container is DisplayObjectContainer)){
_container = container;
};
};
if (doAdd){
if ((_container is DisplayObjectContainer)){
DisplayObjectContainer(_container).addChild(_clip);
};
};
}
private static function handleError(args:Object, callbackObject:Object, callbackMethod:Object):void{
var args = args;
var callbackObject = callbackObject;
var callbackMethod = callbackMethod;
if (args != null){
if (args.onError != null){
args.onError.apply(null, ["NotConnected"]);
};
if (((!((args.options == null))) && (!((args.options.onError == null))))){
args.options.onError.apply(null, ["NotConnected"]);
};
};
if (callbackMethod != null){
args = {};
args.error = true;
args.errorCode = "NotConnected";
if (((!((callbackObject == null))) && ((callbackMethod is String)))){
var _local5 = callbackObject;
_local5[callbackMethod](args);
//unresolved jump
var _slot1 = error;
} else {
if (callbackMethod != null){
callbackMethod.apply(args);
//unresolved jump
var _slot1 = error;
};
};
};
}
private static function loadError(ev:Object):void{
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load.");
MochiServices.disconnect();
MochiServices.onError("IOError");
}
public static function get childClip():Object{
return (_clip);
}
private static function initComChannels():void{
if (!_connected){
trace("[SERVICES_API] connected!");
_connecting = false;
_connected = true;
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:"registerGame", preserved:_preserved, id:_id, version:getVersion(), parentURL:_container.loaderInfo.loaderURL});
_clip.onReceive = onReceive;
_clip.onEvent = onEvent;
_clip.onError = function ():void{
MochiServices.onError("IOError");
};
while (_queue.length > 0) {
_mochiLocalConnection.send(_sendChannelName, "onReceive", _queue.shift());
};
};
}
public static function triggerEvent(eventType:String, args:Object):void{
_dispatcher.triggerEvent(eventType, args);
}
public static function removeEventListener(eventType:String, delegate:Function):void{
_dispatcher.removeEventListener(eventType, delegate);
}
private static function listen():void{
_mochiLocalConnection.connect(_listenChannelName);
_clip.handshake = function (args:Object):void{
MochiServices.comChannelName = args.newChannel;
};
trace("Waiting for MochiAds services to connect...");
}
public static function addEventListener(eventType:String, delegate:Function):void{
_dispatcher.addEventListener(eventType, delegate);
}
private static function loadLCBridge(clip:Object):void{
var loader:Loader = new Loader();
var mochiLCURL:String = (_servURL + _mochiLC);
var req:URLRequest = new URLRequest(mochiLCURL);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, detach);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, detach);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadLCBridgeComplete);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError);
loader.load(req);
clip.addChild(loader);
}
public static function set comChannelName(val:String):void{
if (val != null){
if (val.length > 3){
_sendChannelName = (val + "_fromgame");
initComChannels();
};
};
}
private static function loadCommunicator(id:String, clip:Object):MovieClip{
if (_clip != null){
return (_clip);
};
if (!MochiServices.isNetworkAvailable()){
return (null);
};
if (urlOptions(clip).servURL){
_servURL = urlOptions(clip).servURL;
};
var servicesURL:String = (_servURL + _services);
if (urlOptions(clip).servicesURL){
servicesURL = urlOptions(clip).servicesURL;
};
_listenChannelName = (_listenChannelName + ((Math.floor(new Date().time) + "_") + Math.floor((Math.random() * 99999))));
MochiServices.allowDomains(servicesURL);
_clip = new MovieClip();
loadLCBridge(_clip);
_loader = new Loader();
_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, detach);
_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, detach);
_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError);
var req:URLRequest = new URLRequest(servicesURL);
var vars:URLVariables = new URLVariables();
vars.listenLC = _listenChannelName;
vars.mochiad_options = clip.loaderInfo.parameters.mochiad_options;
vars.api_version = getVersion();
if (widget){
vars.widget = true;
};
req.data = vars;
_loader.load(req);
_clip.addChild(_loader);
_sendChannel = new LocalConnection();
_queue = [];
_nextCallbackID = 0;
_callbacks = {};
_timer = new Timer(10000, 1);
_timer.addEventListener(TimerEvent.TIMER, connectWait);
_timer.start();
return (_clip);
}
public static function get clip():Object{
return (_container);
}
public static function connect(id:String, clip:Object, onError:Object=null):void{
var id = id;
var clip = clip;
var onError = onError;
warnID(id, false);
if ((clip is DisplayObject)){
if (clip.stage == null){
trace("MochiServices connect requires the containing clip be attached to the stage");
};
if (((!(_connected)) && ((_clip == null)))){
trace("MochiServices Connecting...");
_connecting = true;
init(id, clip);
};
} else {
trace("Error, MochiServices requires a Sprite, Movieclip or instance of the stage.");
};
if (onError != null){
MochiServices.onError = onError;
} else {
if (MochiServices.onError == null){
MochiServices.onError = function (errorCode:String):void{
trace(errorCode);
};
};
};
}
public static function bringToTop(e:Event=null):void{
var e = e;
if (((!((MochiServices.clip == null))) && (!((MochiServices.childClip == null))))){
if (MochiServices.clip.numChildren > 1){
MochiServices.clip.setChildIndex(MochiServices.childClip, (MochiServices.clip.numChildren - 1));
};
//unresolved jump
var _slot1 = errorObject;
trace("Warning: Depth sort error.");
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
};
}
public static function connectWait(e:TimerEvent):void{
if (!_connected){
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load. (timeout)");
MochiServices.disconnect();
MochiServices.onError("IOError");
} else {
_timer.stop();
_timer.removeEventListener(TimerEvent.TIMER, connectWait);
_timer = null;
};
}
}
}//package mochi.as3
Section 88
//MochiSocial (mochi.as3.MochiSocial)
package mochi.as3 {
public class MochiSocial {
public static const LOGGED_IN:String = "LoggedIn";
public static const ACTION_CANCELED:String = "onCancel";
public static const PROPERTIES_SIZE:String = "PropertiesSize";
public static const IO_ERROR:String = "IOError";
public static const NO_USER:String = "NoUser";
public static const FRIEND_LIST:String = "FriendsList";
public static const PROFILE_DATA:String = "ProfileData";
public static const GAMEPLAY_DATA:String = "GameplayData";
public static const ACTION_COMPLETE:String = "onComplete";
public static const LOGIN_SHOW:String = "LoginShow";
public static const PROFILE_HIDE:String = "ProfileHide";
public static const USER_INFO:String = "UserInfo";
public static const PROPERTIES_SAVED:String = "PropertySaved";
public static const WIDGET_LOADED:String = "WidgetLoaded";
public static const ERROR:String = "Error";
public static const LOGGED_OUT:String = "LoggedOut";
public static const PROFILE_SHOW:String = "ProfileShow";
public static const LOGIN_HIDE:String = "LoginHide";
public static const LOGIN_SHOWN:String = "LoginShown";
public static var _user_info:Object = null;
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public function MochiSocial(){
super();
}
public static function requestFan(properties:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("social_requestFan", properties);
}
public static function postToStream(properties:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("social_postToStream", properties);
}
public static function getFriendsList(properties:Object=null):void{
MochiServices.send("social_getFriendsList", properties);
}
public static function requestLogin(properties:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("social_requestLogin", properties);
}
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function saveUserProperties(properties:Object):void{
MochiServices.send("social_saveUserProperties", properties);
}
public static function triggerEvent(eventType:String, args:Object):void{
_dispatcher.triggerEvent(eventType, args);
}
public static function removeEventListener(eventType:String, delegate:Function):void{
_dispatcher.removeEventListener(eventType, delegate);
}
public static function inviteFriends(properties:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("social_inviteFriends", properties);
}
public static function get loggedIn():Boolean{
return (!((_user_info == null)));
}
public static function addEventListener(eventType:String, delegate:Function):void{
_dispatcher.addEventListener(eventType, delegate);
}
public static function showLoginWidget(options:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("social_showLoginWidget", {options:options});
}
public static function getAPIURL():String{
if (!_user_info){
return (null);
};
return (_user_info.api_url);
}
public static function hideLoginWidget():void{
MochiServices.send("social_hideLoginWidget");
}
public static function getAPIToken():String{
if (!_user_info){
return (null);
};
return (_user_info.api_token);
}
MochiSocial.addEventListener(MochiSocial.LOGGED_IN, function (args:Object):void{
_user_info = args;
});
MochiSocial.addEventListener(MochiSocial.LOGGED_OUT, function (args:Object):void{
_user_info = null;
});
}
}//package mochi.as3
Section 89
//MochiUserData (mochi.as3.MochiUserData)
package mochi.as3 {
import flash.events.*;
import flash.utils.*;
import flash.net.*;
public class MochiUserData extends EventDispatcher {
public var callback:Function;// = null
public var operation:String;// = null
public var error:Event;// = null
public var data;// = null
public var _loader:URLLoader;
public var key:String;// = null
public function MochiUserData(key:String="", callback:Function=null){
super();
this.key = key;
this.callback = callback;
}
public function serialize(obj):ByteArray{
var arr:ByteArray = new ByteArray();
arr.objectEncoding = ObjectEncoding.AMF3;
arr.writeObject(obj);
arr.compress();
return (arr);
}
public function errorHandler(event:IOErrorEvent):void{
data = null;
error = event;
if (callback != null){
performCallback();
} else {
dispatchEvent(event);
};
close();
}
public function putEvent(obj):void{
request("put", serialize(obj));
}
public function deserialize(arr:ByteArray){
arr.objectEncoding = ObjectEncoding.AMF3;
arr.uncompress();
return (arr.readObject());
}
public function securityErrorHandler(event:SecurityErrorEvent):void{
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("security error: " + event.toString())));
}
public function getEvent():void{
request("get", serialize(null));
}
override public function toString():String{
return ((((((((("[MochiUserData operation=" + operation) + " key=\"") + key) + "\" data=") + data) + " error=\"") + error) + "\"]"));
}
public function performCallback():void{
callback(this);
//unresolved jump
var _slot1 = e;
trace(("[MochiUserData] exception during callback: " + _slot1));
}
public function request(_operation:String, _data:ByteArray):void{
var _operation = _operation;
var _data = _data;
operation = _operation;
var api_url:String = MochiSocial.getAPIURL();
var api_token:String = MochiSocial.getAPIToken();
if ((((api_url == null)) || ((api_token == null)))){
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, "not logged in"));
return;
};
_loader = new URLLoader();
var args:URLVariables = new URLVariables();
args.op = _operation;
args.key = key;
var req:URLRequest = new URLRequest((((MochiSocial.getAPIURL() + "/") + "MochiUserData?") + args.toString()));
req.method = URLRequestMethod.POST;
req.contentType = "application/x-mochi-userdata";
req.requestHeaders = [new URLRequestHeader("x-mochi-services-version", MochiServices.getVersion()), new URLRequestHeader("x-mochi-api-token", api_token)];
req.data = _data;
_loader.dataFormat = URLLoaderDataFormat.BINARY;
_loader.addEventListener(Event.COMPLETE, completeHandler);
_loader.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
_loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
_loader.load(req);
//unresolved jump
var _slot1 = e;
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("security error: " + _slot1.toString())));
}
public function completeHandler(event:Event):void{
var event = event;
if (_loader.data.length){
data = deserialize(_loader.data);
} else {
data = null;
};
//unresolved jump
var _slot1 = e;
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("deserialize error: " + _slot1.toString())));
return;
if (callback != null){
performCallback();
} else {
dispatchEvent(event);
};
close();
}
public function close():void{
if (_loader){
_loader.removeEventListener(Event.COMPLETE, completeHandler);
_loader.removeEventListener(IOErrorEvent.IO_ERROR, errorHandler);
_loader.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
_loader.close();
_loader = null;
};
error = null;
callback = null;
}
public static function get(key:String, callback:Function):void{
var userData:MochiUserData = new MochiUserData(key, callback);
userData.getEvent();
}
public static function put(key:String, obj, callback:Function):void{
var userData:MochiUserData = new MochiUserData(key, callback);
userData.putEvent(obj);
}
}
}//package mochi.as3
Section 90
//Craft (moving.craft.Craft)
package moving.craft {
import flash.events.*;
import game.*;
import flash.display.*;
import moving.*;
import dialog.*;
import statics.*;
import soundmanager.*;
import flash.geom.*;
import com.greensock.*;
import flash.utils.*;
import com.utils.*;
public class Craft extends Moving {
public var power:int;// = 0
public var lives:int;// = 3
private var _odd:Boolean;
private var _justSpawned:Boolean;// = false
private var _shotClass:Class;
private var _shotPower:int;// = 50
private var _shots:Array;
public var collisionDamage:int;// = 15
private var _fireFuncID:uint;
private var _craftClass:Class;
private var _mouseDown:Boolean;
private var _shieldHits:int;
private var _shotClass1:Class;
private var _shotClass2:Class;
private var _shotClass3:Class;
private var _shotClass4:Class;
private var _shotClass5:Class;
private var _spawnTime:Number;
private var _shotClass6:Class;
private var _shotClass7:Class;
private static var _instance:Craft;
public function Craft(){
_craftClass = Craft__craftClass;
_shotClass = Craft__shotClass;
_shotClass1 = Craft__shotClass1;
_shotClass2 = Craft__shotClass2;
_shotClass3 = Craft__shotClass3;
_shotClass4 = Craft__shotClass4;
_shotClass5 = Craft__shotClass5;
_shotClass6 = Craft__shotClass6;
_shotClass7 = Craft__shotClass7;
_shots = [_shotClass, _shotClass1, _shotClass2, _shotClass3, _shotClass4, _shotClass5, _shotClass6, _shotClass7, _shotClass7, _shotClass7];
super();
_instance = this;
_startingHealth = 80;
_fireFuncID = setInterval(fire, 200);
fxFactory = fx;
setClip(new _craftClass());
MovieClip(getClip()).addFrameScript((MovieClip(getClip()).totalFrames - 1), hide);
x = (Protocol.SCREEN_WIDTH / 2);
y = (Protocol.SCREEN_HEIGHT * 0.75);
center();
Settings.root.stage.addEventListener(MouseEvent.MOUSE_DOWN, onMouseEvent, false, 0, true);
Settings.root.stage.addEventListener(MouseEvent.MOUSE_UP, onMouseEvent, false, 0, true);
BLINK_INTERVAL = 125;
BLINK_TIMES = 13;
precacheLocators(getClip());
}
public function restoreHealth():void{
HEALTH = Math.min((HEALTH + (_startingHealth / 4)), _startingHealth);
Game.getInstance().adjustBars((HEALTH / _startingHealth), (_shieldHits / 4));
}
override public function hit(damage:int):void{
if (damage){
if (_shieldHits){
_shieldHits--;
} else {
super.hit(damage);
};
} else {
super.hit(damage);
};
Game.getInstance().adjustBars((HEALTH / _startingHealth), (_shieldHits / 4));
}
public function restoreShield():void{
_shieldHits = 4;
Game.getInstance().adjustBars((HEALTH / _startingHealth), (_shieldHits / 4));
}
override public function die():void{
lives = Math.max((lives - 1), 0);
fx(x, y);
SoundManager.getInstance().exlposion();
SoundManager.getInstance().exlposion();
SoundManager.getInstance().exlposion();
Game.getInstance().updateLives(lives);
if (lives){
respawn();
} else {
super.die();
Game.getInstance().over();
};
}
public function restoreLife():void{
lives = Math.min((lives + 1), 7);
Game.getInstance().updateLives(lives);
}
public function get shotPower():Number{
return ((_shotPower + (power * 25)));
}
public function respawn():void{
_justSpawned = true;
Msg2.display(("LIVES: " + lives));
setInterval(function ():void{
_justSpawned = false;
}, 5000);
HEALTH = _startingHealth;
hit(0);
_spawnTime = getTimer();
Game.getInstance().updateLives(lives);
if (power){
power--;
};
_shieldHits = 1;
setTimeout(function ():void{
Game.getInstance().adjustBars((HEALTH / _startingHealth), (_shieldHits / 4));
//unresolved jump
var _slot1 = error;
trace(this, "error on respawn", #InvalidMultinameIndex#);
}, 1000);
}
private function onMouseEvent(mouseEvent:MouseEvent):void{
switch (mouseEvent.type){
case MouseEvent.MOUSE_DOWN:
_mouseDown = true;
break;
case MouseEvent.MOUSE_UP:
_mouseDown = false;
break;
};
}
private function fire():void{
var shotClass:Class;
var shot:MovieClip;
if (((((_mouseDown) && (Game.getInstance().running))) && (((getTimer() - _spawnTime) > 400)))){
_odd = !(_odd);
shotClass = _shots[Math.min(power, (_shots.length - 1))];
shot = new (shotClass);
shot.blendMode = BlendMode.ADD;
shot.x = x;
shot.y = (y - 10);
Game.getInstance().addShot(shot);
SoundManager.getInstance().shoot();
};
}
public function leave():void{
TweenMax.to(this, 1, {y:"-1000", onComplete:hide});
}
override protected function createShadow():void{
Util.safelyRemove(_shadow);
if (_shadow){
_shadow.bitmapData.dispose();
};
_shadow = new Bitmap(new BitmapData((_mc.width * _shadowScale), (_mc.height * _shadowScale), true, 0), "auto", true);
var rect:Rectangle = _mc.getRect(_mc);
_shadow.bitmapData.draw(_mc, new Matrix(_shadowScale, 0, 0, _shadowScale, (-(rect.x) * _shadowScale), (-(rect.y) * _shadowScale)), new ColorTransform(0, 0, 0, 0.33));
_shadow.x = -100;
_shadow.y = -100;
addChildAt(_shadow, 0);
}
override public function hide():void{
Util.safelyRemove(this);
}
private function fx(newX:Number, newY:Number):void{
var newX = newX;
var newY = newY;
var i:int;
while (i < 5) {
setTimeout(function ():void{
Fx.createSmallBoom(((x + (Math.random() * 20)) - 20), ((y + (Math.random() * 20)) - 20));
}, (i * 100));
i = (i + 1);
};
}
public function powerup():void{
power = Math.min((power + 1), (_shots.length - 1));
Msg2.display(("WEAPON LEVEL: " + (power + 1)));
}
public function shield():void{
_shieldHits = Math.min(4, (_shieldHits + 1));
}
override protected function get blinkTransform():ColorTransform{
return ((_justSpawned) ? new ColorTransform(1, 1, 1, 0) : new ColorTransform(1, 1, 1, 0.75, 63, 63, 63));
}
public function directHit():void{
HEALTH = (HEALTH / 2);
Game.getInstance().adjustBars((HEALTH / _startingHealth), (_shieldHits / 4));
hit(1);
trace(this, HEALTH);
}
public function create():void{
Craft.getInstance().respawn();
power = Settings.power;
trace("Craft::create(), power:", power);
}
public static function getInstance():Craft{
return ((_instance) ? _instance : new (Craft));
}
}
}//package moving.craft
Section 91
//Craft__craftClass (moving.craft.Craft__craftClass)
package moving.craft {
import flash.display.*;
import mx.core.*;
public class Craft__craftClass extends MovieClipAsset {
public var green:DisplayObject;
public var level:DisplayObject;
public var lives:DisplayObject;
public var saucer:DisplayObject;
public var mon:DisplayObject;
public var redspecial:DisplayObject;
public var bigred:DisplayObject;
public var score:DisplayObject;
public var submit:DisplayObject;
public var coins:DisplayObject;
public var soff:DisplayObject;
public var options:DisplayObject;
public var son:DisplayObject;
public var jet:DisplayObject;
public var jet2:DisplayObject;
public var red:DisplayObject;
public var bigred2:DisplayObject;
public var boat:DisplayObject;
public var input:DisplayObject;
public var wg:DisplayObject;
public var eject:DisplayObject;
public var plays1:DisplayObject;
public var plays2:DisplayObject;
public var more:DisplayObject;
public var ok:DisplayObject;
public var powerup:DisplayObject;
public var mine:DisplayObject;
public var bossBar:DisplayObject;
public var moff:DisplayObject;
public var shieldBar:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var go:DisplayObject;
public var dontsubmit:DisplayObject;
public var ibm:DisplayObject;
public var lifeBar:DisplayObject;
public var spawn:DisplayObject;
}
}//package moving.craft
Section 92
//Craft__shotClass (moving.craft.Craft__shotClass)
package moving.craft {
import flash.display.*;
import mx.core.*;
public class Craft__shotClass extends MovieClipAsset {
public var green:DisplayObject;
public var level:DisplayObject;
public var lives:DisplayObject;
public var saucer:DisplayObject;
public var mon:DisplayObject;
public var redspecial:DisplayObject;
public var bigred:DisplayObject;
public var score:DisplayObject;
public var submit:DisplayObject;
public var coins:DisplayObject;
public var soff:DisplayObject;
public var options:DisplayObject;
public var son:DisplayObject;
public var jet:DisplayObject;
public var jet2:DisplayObject;
public var red:DisplayObject;
public var bigred2:DisplayObject;
public var boat:DisplayObject;
public var input:DisplayObject;
public var wg:DisplayObject;
public var eject:DisplayObject;
public var plays1:DisplayObject;
public var plays2:DisplayObject;
public var more:DisplayObject;
public var ok:DisplayObject;
public var powerup:DisplayObject;
public var mine:DisplayObject;
public var bossBar:DisplayObject;
public var moff:DisplayObject;
public var shieldBar:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var go:DisplayObject;
public var dontsubmit:DisplayObject;
public var ibm:DisplayObject;
public var lifeBar:DisplayObject;
public var spawn:DisplayObject;
}
}//package moving.craft
Section 93
//Craft__shotClass1 (moving.craft.Craft__shotClass1)
package moving.craft {
import flash.display.*;
import mx.core.*;
public class Craft__shotClass1 extends MovieClipAsset {
public var green:DisplayObject;
public var level:DisplayObject;
public var lives:DisplayObject;
public var saucer:DisplayObject;
public var mon:DisplayObject;
public var redspecial:DisplayObject;
public var bigred:DisplayObject;
public var score:DisplayObject;
public var submit:DisplayObject;
public var coins:DisplayObject;
public var soff:DisplayObject;
public var options:DisplayObject;
public var son:DisplayObject;
public var jet:DisplayObject;
public var jet2:DisplayObject;
public var red:DisplayObject;
public var bigred2:DisplayObject;
public var boat:DisplayObject;
public var input:DisplayObject;
public var wg:DisplayObject;
public var eject:DisplayObject;
public var plays1:DisplayObject;
public var plays2:DisplayObject;
public var more:DisplayObject;
public var ok:DisplayObject;
public var powerup:DisplayObject;
public var mine:DisplayObject;
public var bossBar:DisplayObject;
public var moff:DisplayObject;
public var shieldBar:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var go:DisplayObject;
public var dontsubmit:DisplayObject;
public var ibm:DisplayObject;
public var lifeBar:DisplayObject;
public var spawn:DisplayObject;
}
}//package moving.craft
Section 94
//Craft__shotClass2 (moving.craft.Craft__shotClass2)
package moving.craft {
import flash.display.*;
import mx.core.*;
public class Craft__shotClass2 extends MovieClipAsset {
public var green:DisplayObject;
public var level:DisplayObject;
public var lives:DisplayObject;
public var saucer:DisplayObject;
public var mon:DisplayObject;
public var redspecial:DisplayObject;
public var bigred:DisplayObject;
public var score:DisplayObject;
public var submit:DisplayObject;
public var coins:DisplayObject;
public var soff:DisplayObject;
public var options:DisplayObject;
public var son:DisplayObject;
public var jet:DisplayObject;
public var jet2:DisplayObject;
public var red:DisplayObject;
public var bigred2:DisplayObject;
public var boat:DisplayObject;
public var input:DisplayObject;
public var wg:DisplayObject;
public var eject:DisplayObject;
public var plays1:DisplayObject;
public var plays2:DisplayObject;
public var more:DisplayObject;
public var ok:DisplayObject;
public var powerup:DisplayObject;
public var mine:DisplayObject;
public var bossBar:DisplayObject;
public var moff:DisplayObject;
public var shieldBar:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var go:DisplayObject;
public var dontsubmit:DisplayObject;
public var ibm:DisplayObject;
public var lifeBar:DisplayObject;
public var spawn:DisplayObject;
}
}//package moving.craft
Section 95
//Craft__shotClass3 (moving.craft.Craft__shotClass3)
package moving.craft {
import flash.display.*;
import mx.core.*;
public class Craft__shotClass3 extends MovieClipAsset {
public var green:DisplayObject;
public var level:DisplayObject;
public var lives:DisplayObject;
public var saucer:DisplayObject;
public var mon:DisplayObject;
public var redspecial:DisplayObject;
public var bigred:DisplayObject;
public var score:DisplayObject;
public var submit:DisplayObject;
public var coins:DisplayObject;
public var soff:DisplayObject;
public var options:DisplayObject;
public var son:DisplayObject;
public var jet:DisplayObject;
public var jet2:DisplayObject;
public var red:DisplayObject;
public var bigred2:DisplayObject;
public var boat:DisplayObject;
public var input:DisplayObject;
public var wg:DisplayObject;
public var eject:DisplayObject;
public var plays1:DisplayObject;
public var plays2:DisplayObject;
public var more:DisplayObject;
public var ok:DisplayObject;
public var powerup:DisplayObject;
public var mine:DisplayObject;
public var bossBar:DisplayObject;
public var moff:DisplayObject;
public var shieldBar:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var go:DisplayObject;
public var dontsubmit:DisplayObject;
public var ibm:DisplayObject;
public var lifeBar:DisplayObject;
public var spawn:DisplayObject;
}
}//package moving.craft
Section 96
//Craft__shotClass4 (moving.craft.Craft__shotClass4)
package moving.craft {
import flash.display.*;
import mx.core.*;
public class Craft__shotClass4 extends MovieClipAsset {
public var green:DisplayObject;
public var level:DisplayObject;
public var lives:DisplayObject;
public var saucer:DisplayObject;
public var mon:DisplayObject;
public var redspecial:DisplayObject;
public var bigred:DisplayObject;
public var score:DisplayObject;
public var submit:DisplayObject;
public var coins:DisplayObject;
public var soff:DisplayObject;
public var options:DisplayObject;
public var son:DisplayObject;
public var jet:DisplayObject;
public var jet2:DisplayObject;
public var red:DisplayObject;
public var bigred2:DisplayObject;
public var boat:DisplayObject;
public var input:DisplayObject;
public var wg:DisplayObject;
public var eject:DisplayObject;
public var plays1:DisplayObject;
public var plays2:DisplayObject;
public var more:DisplayObject;
public var ok:DisplayObject;
public var powerup:DisplayObject;
public var mine:DisplayObject;
public var bossBar:DisplayObject;
public var moff:DisplayObject;
public var shieldBar:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var go:DisplayObject;
public var dontsubmit:DisplayObject;
public var ibm:DisplayObject;
public var lifeBar:DisplayObject;
public var spawn:DisplayObject;
}
}//package moving.craft
Section 97
//Craft__shotClass5 (moving.craft.Craft__shotClass5)
package moving.craft {
import flash.display.*;
import mx.core.*;
public class Craft__shotClass5 extends MovieClipAsset {
public var green:DisplayObject;
public var level:DisplayObject;
public var lives:DisplayObject;
public var saucer:DisplayObject;
public var mon:DisplayObject;
public var redspecial:DisplayObject;
public var bigred:DisplayObject;
public var score:DisplayObject;
public var submit:DisplayObject;
public var coins:DisplayObject;
public var soff:DisplayObject;
public var options:DisplayObject;
public var son:DisplayObject;
public var jet:DisplayObject;
public var jet2:DisplayObject;
public var red:DisplayObject;
public var bigred2:DisplayObject;
public var boat:DisplayObject;
public var input:DisplayObject;
public var wg:DisplayObject;
public var eject:DisplayObject;
public var plays1:DisplayObject;
public var plays2:DisplayObject;
public var more:DisplayObject;
public var ok:DisplayObject;
public var powerup:DisplayObject;
public var mine:DisplayObject;
public var bossBar:DisplayObject;
public var moff:DisplayObject;
public var shieldBar:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var go:DisplayObject;
public var dontsubmit:DisplayObject;
public var ibm:DisplayObject;
public var lifeBar:DisplayObject;
public var spawn:DisplayObject;
}
}//package moving.craft
Section 98
//Craft__shotClass6 (moving.craft.Craft__shotClass6)
package moving.craft {
import flash.display.*;
import mx.core.*;
public class Craft__shotClass6 extends MovieClipAsset {
public var green:DisplayObject;
public var level:DisplayObject;
public var lives:DisplayObject;
public var saucer:DisplayObject;
public var mon:DisplayObject;
public var redspecial:DisplayObject;
public var bigred:DisplayObject;
public var score:DisplayObject;
public var submit:DisplayObject;
public var coins:DisplayObject;
public var soff:DisplayObject;
public var options:DisplayObject;
public var son:DisplayObject;
public var jet:DisplayObject;
public var jet2:DisplayObject;
public var red:DisplayObject;
public var bigred2:DisplayObject;
public var boat:DisplayObject;
public var input:DisplayObject;
public var wg:DisplayObject;
public var eject:DisplayObject;
public var plays1:DisplayObject;
public var plays2:DisplayObject;
public var more:DisplayObject;
public var ok:DisplayObject;
public var powerup:DisplayObject;
public var mine:DisplayObject;
public var bossBar:DisplayObject;
public var moff:DisplayObject;
public var shieldBar:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var go:DisplayObject;
public var dontsubmit:DisplayObject;
public var ibm:DisplayObject;
public var lifeBar:DisplayObject;
public var spawn:DisplayObject;
}
}//package moving.craft
Section 99
//Craft__shotClass7 (moving.craft.Craft__shotClass7)
package moving.craft {
import flash.display.*;
import mx.core.*;
public class Craft__shotClass7 extends MovieClipAsset {
public var green:DisplayObject;
public var level:DisplayObject;
public var lives:DisplayObject;
public var saucer:DisplayObject;
public var mon:DisplayObject;
public var redspecial:DisplayObject;
public var bigred:DisplayObject;
public var score:DisplayObject;
public var submit:DisplayObject;
public var coins:DisplayObject;
public var soff:DisplayObject;
public var options:DisplayObject;
public var son:DisplayObject;
public var jet:DisplayObject;
public var jet2:DisplayObject;
public var red:DisplayObject;
public var bigred2:DisplayObject;
public var boat:DisplayObject;
public var input:DisplayObject;
public var wg:DisplayObject;
public var eject:DisplayObject;
public var plays1:DisplayObject;
public var plays2:DisplayObject;
public var more:DisplayObject;
public var ok:DisplayObject;
public var powerup:DisplayObject;
public var mine:DisplayObject;
public var bossBar:DisplayObject;
public var moff:DisplayObject;
public var shieldBar:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var go:DisplayObject;
public var dontsubmit:DisplayObject;
public var ibm:DisplayObject;
public var lifeBar:DisplayObject;
public var spawn:DisplayObject;
}
}//package moving.craft
Section 100
//BonusBoom (moving.enemys.bonus.BonusBoom)
package moving.enemys.bonus {
import game.*;
import moving.*;
import statics.*;
import soundmanager.*;
import moving.craft.*;
import com.greensock.*;
import flash.utils.*;
import com.greensock.easing.*;
public class BonusBoom extends Moving {
private var _assetClass:Class;
private var _moves:int;// = 5
public function BonusBoom(){
_assetClass = BonusBoom__assetClass;
super();
fxFactory = Fx.createBoom;
y = -100;
setClip(new _assetClass());
POINTS = 1000;
BONUS = 1;
TweenMax.to(this, 1.75, {y:"300", onComplete:nextPoint});
}
override public function die():void{
fxFactory(x, y);
hide();
Tilt.setup(Settings.root);
SoundManager.getInstance().exlposion();
setTimeout(function ():void{
var enemy:Moving;
for each (enemy in Game.getInstance().enemies) {
if (!((((enemy.BONUS) || (enemy.BOSS))) || ((enemy is Craft)))){
enemy.die();
};
};
}, 250);
}
override protected function createShadow():void{
}
public function nextPoint():void{
_moves--;
if (_moves){
TweenMax.to(this, 1.75, {x:((Math.random() * 20) - 20).toString(), y:((Math.random() * 20) - 20).toString(), onComplete:nextPoint});
} else {
TweenMax.to(this, 1.75, {y:"400", ease:Expo.easeIn, onComplete:hide});
};
}
}
}//package moving.enemys.bonus
Section 101
//BonusBoom__assetClass (moving.enemys.bonus.BonusBoom__assetClass)
package moving.enemys.bonus {
import flash.display.*;
import mx.core.*;
public class BonusBoom__assetClass extends MovieClipAsset {
public var green:DisplayObject;
public var level:DisplayObject;
public var lives:DisplayObject;
public var saucer:DisplayObject;
public var mon:DisplayObject;
public var redspecial:DisplayObject;
public var bigred:DisplayObject;
public var score:DisplayObject;
public var submit:DisplayObject;
public var coins:DisplayObject;
public var soff:DisplayObject;
public var options:DisplayObject;
public var son:DisplayObject;
public var jet:DisplayObject;
public var jet2:DisplayObject;
public var red:DisplayObject;
public var bigred2:DisplayObject;
public var boat:DisplayObject;
public var input:DisplayObject;
public var wg:DisplayObject;
public var eject:DisplayObject;
public var plays1:DisplayObject;
public var plays2:DisplayObject;
public var more:DisplayObject;
public var ok:DisplayObject;
public var powerup:DisplayObject;
public var mine:DisplayObject;
public var bossBar:DisplayObject;
public var moff:DisplayObject;
public var shieldBar:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var go:DisplayObject;
public var dontsubmit:DisplayObject;
public var ibm:DisplayObject;
public var lifeBar:DisplayObject;
public var spawn:DisplayObject;
}
}//package moving.enemys.bonus
Section 102
//BonusHealth (moving.enemys.bonus.BonusHealth)
package moving.enemys.bonus {
import game.*;
import moving.*;
import soundmanager.*;
import moving.craft.*;
import com.greensock.*;
public class BonusHealth extends Moving {
private var _assetClass:Class;
public function BonusHealth(){
_assetClass = BonusHealth__assetClass;
super();
fxFactory = Fx.createBoom;
y = -100;
setClip(new _assetClass());
POINTS = 1000;
BONUS = 1;
TweenMax.to(this, 1.75, {y:"300", onComplete:nextPoint});
}
override public function die():void{
fxFactory(x, y);
hide();
Craft.getInstance().restoreHealth();
SoundManager.getInstance().bonus();
}
override protected function createShadow():void{
}
public function nextPoint():void{
TweenMax.to(this, 1.75, {x:((Math.random() * 40) - 20).toString(), y:((Math.random() * 20) - 10).toString(), onComplete:nextPoint});
}
}
}//package moving.enemys.bonus
Section 103
//BonusHealth__assetClass (moving.enemys.bonus.BonusHealth__assetClass)
package moving.enemys.bonus {
import flash.display.*;
import mx.core.*;
public class BonusHealth__assetClass extends MovieClipAsset {
public var green:DisplayObject;
public var level:DisplayObject;
public var lives:DisplayObject;
public var saucer:DisplayObject;
public var mon:DisplayObject;
public var redspecial:DisplayObject;
public var bigred:DisplayObject;
public var score:DisplayObject;
public var locator:DisplayObject;
public var submit:DisplayObject;
public var jet:DisplayObject;
public var coins:DisplayObject;
public var soff:DisplayObject;
public var options:DisplayObject;
public var missile:DisplayObject;
public var son:DisplayObject;
public var jet2:DisplayObject;
public var red:DisplayObject;
public var bigred2:DisplayObject;
public var boat:DisplayObject;
public var main:DisplayObject;
public var input:DisplayObject;
public var wg:DisplayObject;
public var eject:DisplayObject;
public var plays1:DisplayObject;
public var plays2:DisplayObject;
public var more:DisplayObject;
public var mine:DisplayObject;
public var ok:DisplayObject;
public var powerup:DisplayObject;
public var moff:DisplayObject;
public var prop:DisplayObject;
public var bossBar:DisplayObject;
public var direct:DisplayObject;
public var shieldBar:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var go:DisplayObject;
public var dontsubmit:DisplayObject;
public var ibm:DisplayObject;
public var lifeBar:DisplayObject;
public var spawn:DisplayObject;
}
}//package moving.enemys.bonus
Section 104
//BonusLife (moving.enemys.bonus.BonusLife)
package moving.enemys.bonus {
import game.*;
import moving.*;
import soundmanager.*;
import moving.craft.*;
import com.greensock.*;
public class BonusLife extends Moving {
private var _assetClass:Class;
public function BonusLife(){
_assetClass = BonusLife__assetClass;
super();
fxFactory = Fx.createBoom;
y = -100;
setClip(new _assetClass());
POINTS = 1000;
BONUS = 1;
TweenMax.to(this, 1.75, {y:"300", onComplete:nextPoint});
}
override public function die():void{
fxFactory(x, y);
hide();
Craft.getInstance().restoreLife();
SoundManager.getInstance().bonus();
}
override protected function createShadow():void{
}
public function nextPoint():void{
TweenMax.to(this, 1.75, {x:((Math.random() * 40) - 20).toString(), y:((Math.random() * 20) - 10).toString(), onComplete:nextPoint});
}
}
}//package moving.enemys.bonus
Section 105
//BonusLife__assetClass (moving.enemys.bonus.BonusLife__assetClass)
package moving.enemys.bonus {
import flash.display.*;
import mx.core.*;
public class BonusLife__assetClass extends MovieClipAsset {
public var green:DisplayObject;
public var level:DisplayObject;
public var lives:DisplayObject;
public var saucer:DisplayObject;
public var mon:DisplayObject;
public var redspecial:DisplayObject;
public var bigred:DisplayObject;
public var score:DisplayObject;
public var locator:DisplayObject;
public var submit:DisplayObject;
public var coins:DisplayObject;
public var soff:DisplayObject;
public var options:DisplayObject;
public var son:DisplayObject;
public var jet:DisplayObject;
public var jet2:DisplayObject;
public var red:DisplayObject;
public var bigred2:DisplayObject;
public var boat:DisplayObject;
public var input:DisplayObject;
public var wg:DisplayObject;
public var eject:DisplayObject;
public var plays1:DisplayObject;
public var plays2:DisplayObject;
public var more:DisplayObject;
public var ok:DisplayObject;
public var powerup:DisplayObject;
public var mine:DisplayObject;
public var prop:DisplayObject;
public var bossBar:DisplayObject;
public var moff:DisplayObject;
public var shieldBar:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var go:DisplayObject;
public var dontsubmit:DisplayObject;
public var ibm:DisplayObject;
public var lifeBar:DisplayObject;
public var spawn:DisplayObject;
}
}//package moving.enemys.bonus
Section 106
//BonusPowerup (moving.enemys.bonus.BonusPowerup)
package moving.enemys.bonus {
import game.*;
import moving.*;
import soundmanager.*;
import moving.craft.*;
import com.greensock.*;
import com.greensock.easing.*;
public class BonusPowerup extends Moving {
private var _assetClass:Class;
private var _moves:int;// = 7
public function BonusPowerup(){
_assetClass = BonusPowerup__assetClass;
super();
fxFactory = Fx.createBoom;
y = -100;
setClip(new _assetClass());
POINTS = 1000;
BONUS = 1;
TweenMax.to(this, 1.75, {y:"300", onComplete:nextPoint});
}
override public function die():void{
super.die();
Craft.getInstance().powerup();
SoundManager.getInstance().powerup();
}
override protected function createShadow():void{
}
public function nextPoint():void{
var a:Number;
var tx:Number;
var ty:Number;
_moves--;
if (_moves){
TweenMax.to(this, 1.75, {x:((Math.random() * 60) - 60).toString(), y:((Math.random() * 60) - 60).toString(), onComplete:nextPoint});
} else {
a = ((Math.random() * 2) * Math.PI);
tx = (Math.cos(a) * 500);
ty = (Math.sin(a) * 500);
TweenMax.to(this, 0.75, {x:tx.toString(), y:ty.toString(), ease:Expo.easeIn, onComplete:hide});
};
}
}
}//package moving.enemys.bonus
Section 107
//BonusPowerup__assetClass (moving.enemys.bonus.BonusPowerup__assetClass)
package moving.enemys.bonus {
import flash.display.*;
import mx.core.*;
public class BonusPowerup__assetClass extends MovieClipAsset {
public var green:DisplayObject;
public var level:DisplayObject;
public var lives:DisplayObject;
public var saucer:DisplayObject;
public var mon:DisplayObject;
public var redspecial:DisplayObject;
public var bigred:DisplayObject;
public var score:DisplayObject;
public var locator:DisplayObject;
public var submit:DisplayObject;
public var coins:DisplayObject;
public var soff:DisplayObject;
public var options:DisplayObject;
public var son:DisplayObject;
public var jet:DisplayObject;
public var jet2:DisplayObject;
public var red:DisplayObject;
public var bigred2:DisplayObject;
public var boat:DisplayObject;
public var input:DisplayObject;
public var wg:DisplayObject;
public var eject:DisplayObject;
public var plays1:DisplayObject;
public var plays2:DisplayObject;
public var more:DisplayObject;
public var ok:DisplayObject;
public var powerup:DisplayObject;
public var mine:DisplayObject;
public var prop:DisplayObject;
public var bossBar:DisplayObject;
public var moff:DisplayObject;
public var shieldBar:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var go:DisplayObject;
public var dontsubmit:DisplayObject;
public var ibm:DisplayObject;
public var lifeBar:DisplayObject;
public var spawn:DisplayObject;
}
}//package moving.enemys.bonus
Section 108
//BonusShield (moving.enemys.bonus.BonusShield)
package moving.enemys.bonus {
import game.*;
import moving.*;
import soundmanager.*;
import moving.craft.*;
import com.greensock.*;
public class BonusShield extends Moving {
private var _assetClass:Class;
public function BonusShield(){
_assetClass = BonusShield__assetClass;
super();
fxFactory = Fx.createBoom;
y = -100;
setClip(new _assetClass());
POINTS = 1000;
BONUS = 1;
TweenMax.to(this, 1.75, {y:"300", onComplete:nextPoint});
}
override public function die():void{
fxFactory(x, y);
hide();
Craft.getInstance().restoreShield();
SoundManager.getInstance().bonus();
}
override protected function createShadow():void{
}
public function nextPoint():void{
TweenMax.to(this, 1.75, {x:((Math.random() * 40) - 20).toString(), y:((Math.random() * 20) - 10).toString(), onComplete:nextPoint});
}
}
}//package moving.enemys.bonus
Section 109
//BonusShield__assetClass (moving.enemys.bonus.BonusShield__assetClass)
package moving.enemys.bonus {
import flash.display.*;
import mx.core.*;
public class BonusShield__assetClass extends MovieClipAsset {
public var green:DisplayObject;
public var level:DisplayObject;
public var lives:DisplayObject;
public var saucer:DisplayObject;
public var mon:DisplayObject;
public var redspecial:DisplayObject;
public var bigred:DisplayObject;
public var score:DisplayObject;
public var locator:DisplayObject;
public var submit:DisplayObject;
public var coins:DisplayObject;
public var soff:DisplayObject;
public var options:DisplayObject;
public var son:DisplayObject;
public var jet:DisplayObject;
public var jet2:DisplayObject;
public var red:DisplayObject;
public var bigred2:DisplayObject;
public var boat:DisplayObject;
public var input:DisplayObject;
public var wg:DisplayObject;
public var eject:DisplayObject;
public var plays1:DisplayObject;
public var plays2:DisplayObject;
public var more:DisplayObject;
public var ok:DisplayObject;
public var powerup:DisplayObject;
public var mine:DisplayObject;
public var prop:DisplayObject;
public var bossBar:DisplayObject;
public var moff:DisplayObject;
public var shieldBar:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var go:DisplayObject;
public var dontsubmit:DisplayObject;
public var ibm:DisplayObject;
public var lifeBar:DisplayObject;
public var spawn:DisplayObject;
}
}//package moving.enemys.bonus
Section 110
//Coin (moving.enemys.bonus.Coin)
package moving.enemys.bonus {
import game.*;
import moving.*;
import statics.*;
import soundmanager.*;
import com.greensock.*;
import com.greensock.easing.*;
public class Coin extends Moving {
private var _assetClass:Class;
public function Coin(){
_assetClass = Coin__assetClass;
super();
fxFactory = Fx.createSmallBoom;
y = -100;
setClip(new _assetClass());
TweenMax.to(this, 12, {y:(Protocol.SCREEN_HEIGHT + 200).toString(), ease:Linear.easeNone, onComplete:hide});
POINTS = 1000;
BONUS = 1;
}
override public function die():void{
super.die();
Game.getInstance().addCoin();
SoundManager.getInstance().coin();
}
override protected function createShadow():void{
}
}
}//package moving.enemys.bonus
Section 111
//Coin__assetClass (moving.enemys.bonus.Coin__assetClass)
package moving.enemys.bonus {
import flash.display.*;
import mx.core.*;
public class Coin__assetClass extends MovieClipAsset {
public var green:DisplayObject;
public var level:DisplayObject;
public var lives:DisplayObject;
public var saucer:DisplayObject;
public var mon:DisplayObject;
public var redspecial:DisplayObject;
public var bigred:DisplayObject;
public var score:DisplayObject;
public var locator:DisplayObject;
public var submit:DisplayObject;
public var coins:DisplayObject;
public var soff:DisplayObject;
public var options:DisplayObject;
public var son:DisplayObject;
public var jet:DisplayObject;
public var jet2:DisplayObject;
public var red:DisplayObject;
public var bigred2:DisplayObject;
public var boat:DisplayObject;
public var input:DisplayObject;
public var wg:DisplayObject;
public var eject:DisplayObject;
public var plays1:DisplayObject;
public var plays2:DisplayObject;
public var more:DisplayObject;
public var ok:DisplayObject;
public var powerup:DisplayObject;
public var mine:DisplayObject;
public var prop:DisplayObject;
public var bossBar:DisplayObject;
public var moff:DisplayObject;
public var shieldBar:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var go:DisplayObject;
public var dontsubmit:DisplayObject;
public var ibm:DisplayObject;
public var lifeBar:DisplayObject;
public var spawn:DisplayObject;
}
}//package moving.enemys.bonus
Section 112
//Missile (moving.enemys.missile.Missile)
package moving.enemys.missile {
import game.*;
import moving.*;
import flash.geom.*;
import moving.craft.*;
import com.greensock.*;
import com.greensock.easing.*;
public class Missile extends Moving {
private var _startX:Number;
private var _assetClass:Class;
private var _maxMoves:int;
public function Missile(){
_assetClass = Missile__assetClass;
_maxMoves = (20 + randomHalf(8));
super();
fxFactory = Fx.createSmallBoom;
y = -100;
setClip(new _assetClass());
center();
setHealth(1, 100);
move();
}
private function leave():void{
TweenMax.to(this, (5 + Math.random()), {y:"500", ease:Cubic.easeIn, onComplete:hide});
}
private function move():void{
var a:Number;
var tx:Number;
var ty:Number;
_maxMoves--;
if (_maxMoves){
a = (((rotation - 180) * 0.017453292) + (Math.PI / 2));
if (a >= Math.PI){
a = (a - (Math.PI * 2));
} else {
if (a <= -(Math.PI)){
a = (a + (Math.PI * 2));
};
};
tx = (Math.cos(a) * 33.3);
ty = (Math.sin(a) * 33.3);
TweenMax.to(this, 0.2, {x:tx.toString(), y:ty.toString(), ease:Linear.easeNone, onComplete:seek});
} else {
die();
};
}
override protected function createShadow():void{
}
private function seek():void{
var p:Point = Craft.getInstance().toPoint();
var cp:Point = toPoint();
var a:Number = (Math.atan2((p.y - cp.y), (p.x - cp.x)) + (Math.PI / 2));
if (a > Math.PI){
a = (a - (Math.PI * 2));
} else {
if (a < -(Math.PI)){
a = (a + (Math.PI * 2));
};
};
rotation = (a * 57.2957795);
move();
}
}
}//package moving.enemys.missile
Section 113
//Missile__assetClass (moving.enemys.missile.Missile__assetClass)
package moving.enemys.missile {
import flash.display.*;
import mx.core.*;
public class Missile__assetClass extends SpriteAsset {
public var green:DisplayObject;
public var level:DisplayObject;
public var lives:DisplayObject;
public var saucer:DisplayObject;
public var mon:DisplayObject;
public var redspecial:DisplayObject;
public var bigred:DisplayObject;
public var score:DisplayObject;
public var submit:DisplayObject;
public var coins:DisplayObject;
public var soff:DisplayObject;
public var options:DisplayObject;
public var son:DisplayObject;
public var jet:DisplayObject;
public var jet2:DisplayObject;
public var red:DisplayObject;
public var bigred2:DisplayObject;
public var boat:DisplayObject;
public var input:DisplayObject;
public var wg:DisplayObject;
public var eject:DisplayObject;
public var plays1:DisplayObject;
public var plays2:DisplayObject;
public var more:DisplayObject;
public var ok:DisplayObject;
public var powerup:DisplayObject;
public var mine:DisplayObject;
public var bossBar:DisplayObject;
public var moff:DisplayObject;
public var shieldBar:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var go:DisplayObject;
public var dontsubmit:DisplayObject;
public var ibm:DisplayObject;
public var lifeBar:DisplayObject;
public var spawn:DisplayObject;
}
}//package moving.enemys.missile
Section 114
//BigRed (moving.enemys.BigRed)
package moving.enemys {
import game.*;
import moving.*;
import com.greensock.*;
import com.greensock.easing.*;
public class BigRed extends Moving {
private var _startX:Number;
private var _assetClass:Class;
private var _maxMoves:int;// = 20
public function BigRed(){
_assetClass = BigRed__assetClass;
super();
_repeatFire = 200;
fxFactory = Fx.createBigBoom;
y = -100;
setClip(new _assetClass());
center();
setHealth(5000, 15000);
var dir:String = ((x < 375)) ? "-100" : "100";
TweenMax.to(this, 3, {x:375, y:150, ease:Cubic.easeOut, onComplete:nextPoint});
setBossMode();
}
override public function die():void{
super.die();
Game.getInstance().nextLevel();
}
private function nextPoint():void{
var idx:int = (Math.random() * 10);
var t:Number = (5 + (Math.random() * 2));
switch (idx){
case 0:
TweenMax.to(this, t, {x:100, y:150, ease:Expo.easeOut, onComplete:nextPoint});
break;
case 1:
TweenMax.to(this, t, {x:650, y:150, ease:Expo.easeOut, onComplete:nextPoint});
break;
case 2:
TweenMax.to(this, t, {x:150, y:250, ease:Expo.easeOut, onComplete:nextPoint});
break;
case 3:
TweenMax.to(this, t, {x:600, y:250, ease:Expo.easeOut, onComplete:nextPoint});
break;
case 4:
TweenMax.to(this, t, {x:350, y:250, ease:Expo.easeOut, onComplete:nextPoint});
break;
case 5:
TweenMax.to(this, t, {x:250, y:100, ease:Expo.easeOut, onComplete:nextPoint});
break;
case 6:
TweenMax.to(this, t, {x:500, y:100, ease:Expo.easeOut, onComplete:nextPoint});
break;
default:
retreat();
};
}
private function retreat():void{
TweenMax.to(this, 2.5, {x:randomHalf(50).toString(), y:randomHalf(50).toString(), ease:Expo.easeOut, onComplete:nextPoint});
}
}
}//package moving.enemys
Section 115
//BigRed__assetClass (moving.enemys.BigRed__assetClass)
package moving.enemys {
import flash.display.*;
import mx.core.*;
public class BigRed__assetClass extends SpriteAsset {
public var green:DisplayObject;
public var level:DisplayObject;
public var lives:DisplayObject;
public var saucer:DisplayObject;
public var mon:DisplayObject;
public var redspecial:DisplayObject;
public var bigred:DisplayObject;
public var score:DisplayObject;
public var locator:DisplayObject;
public var submit:DisplayObject;
public var jet:DisplayObject;
public var coins:DisplayObject;
public var soff:DisplayObject;
public var options:DisplayObject;
public var prop0:DisplayObject;
public var prop1:DisplayObject;
public var son:DisplayObject;
public var missile:DisplayObject;
public var jet2:DisplayObject;
public var bigred2:DisplayObject;
public var boat:DisplayObject;
public var main:DisplayObject;
public var input:DisplayObject;
public var wg:DisplayObject;
public var eject:DisplayObject;
public var plays1:DisplayObject;
public var plays2:DisplayObject;
public var more:DisplayObject;
public var red:DisplayObject;
public var ok:DisplayObject;
public var powerup:DisplayObject;
public var mine:DisplayObject;
public var bossBar:DisplayObject;
public var moff:DisplayObject;
public var prop:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var go:DisplayObject;
public var direct:DisplayObject;
public var shieldBar:DisplayObject;
public var ibm:DisplayObject;
public var lifeBar:DisplayObject;
public var dontsubmit:DisplayObject;
public var spawn:DisplayObject;
}
}//package moving.enemys
Section 116
//BigRed2 (moving.enemys.BigRed2)
package moving.enemys {
import game.*;
import moving.*;
import com.greensock.*;
import com.greensock.easing.*;
public class BigRed2 extends Moving {
private var _startX:Number;
private var _assetClass:Class;
private var _maxMoves:int;// = 20
public function BigRed2(){
_assetClass = BigRed2__assetClass;
super();
_repeatFire = 200;
fxFactory = Fx.createBigBoom;
y = -100;
setClip(new _assetClass());
center();
setHealth(5000, 15000);
var dir:String = ((x < 375)) ? "-100" : "100";
TweenMax.to(this, 3, {x:375, y:150, ease:Cubic.easeOut, onComplete:nextPoint});
setBossMode();
}
override public function die():void{
super.die();
Game.getInstance().nextLevel();
}
private function nextPoint():void{
var idx:int = (Math.random() * 10);
var t:Number = (5 + (Math.random() * 2));
switch (idx){
case 0:
TweenMax.to(this, t, {x:100, y:150, ease:Expo.easeOut, onComplete:nextPoint});
break;
case 1:
TweenMax.to(this, t, {x:650, y:150, ease:Expo.easeOut, onComplete:nextPoint});
break;
case 2:
TweenMax.to(this, t, {x:150, y:250, ease:Expo.easeOut, onComplete:nextPoint});
break;
case 3:
TweenMax.to(this, t, {x:600, y:250, ease:Expo.easeOut, onComplete:nextPoint});
break;
case 4:
TweenMax.to(this, t, {x:350, y:250, ease:Expo.easeOut, onComplete:nextPoint});
break;
case 5:
TweenMax.to(this, t, {x:250, y:100, ease:Expo.easeOut, onComplete:nextPoint});
break;
case 6:
TweenMax.to(this, t, {x:500, y:100, ease:Expo.easeOut, onComplete:nextPoint});
break;
default:
retreat();
};
}
private function retreat():void{
TweenMax.to(this, 2.5, {x:randomHalf(50).toString(), y:randomHalf(50).toString(), ease:Expo.easeOut, onComplete:nextPoint});
}
}
}//package moving.enemys
Section 117
//BigRed2__assetClass (moving.enemys.BigRed2__assetClass)
package moving.enemys {
import flash.display.*;
import mx.core.*;
public class BigRed2__assetClass extends SpriteAsset {
public var green:DisplayObject;
public var level:DisplayObject;
public var lives:DisplayObject;
public var saucer:DisplayObject;
public var mon:DisplayObject;
public var redspecial:DisplayObject;
public var bigred:DisplayObject;
public var score:DisplayObject;
public var locator:DisplayObject;
public var submit:DisplayObject;
public var jet:DisplayObject;
public var coins:DisplayObject;
public var soff:DisplayObject;
public var options:DisplayObject;
public var missile:DisplayObject;
public var son:DisplayObject;
public var jet2:DisplayObject;
public var red:DisplayObject;
public var bigred2:DisplayObject;
public var boat:DisplayObject;
public var main:DisplayObject;
public var input:DisplayObject;
public var wg:DisplayObject;
public var eject:DisplayObject;
public var plays1:DisplayObject;
public var plays2:DisplayObject;
public var more:DisplayObject;
public var mine:DisplayObject;
public var ok:DisplayObject;
public var powerup:DisplayObject;
public var moff:DisplayObject;
public var prop:DisplayObject;
public var bossBar:DisplayObject;
public var direct:DisplayObject;
public var shieldBar:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var go:DisplayObject;
public var dontsubmit:DisplayObject;
public var ibm:DisplayObject;
public var lifeBar:DisplayObject;
public var spawn:DisplayObject;
}
}//package moving.enemys
Section 118
//Blue (moving.enemys.Blue)
package moving.enemys {
import game.*;
import moving.*;
import statics.*;
import com.greensock.*;
import com.greensock.easing.*;
public class Blue extends Moving {
private var _assetClass:Class;
public function Blue(){
_assetClass = Blue__assetClass;
super();
fxFactory = Fx.createBoomPlusSparx;
y = -100;
setClip(new _assetClass());
TweenMax.to(this, 5, {y:(Protocol.SCREEN_HEIGHT / 3), ease:Quad.easeOut, onComplete:leave});
center();
setHealth(200, 250);
fixHealthByLevel();
}
private function leave():void{
TweenMax.to(this, 2, {delay:3.5, y:(Protocol.SCREEN_HEIGHT + 200).toString(), ease:Quad.easeOut, onComplete:hide});
}
}
}//package moving.enemys
Section 119
//Blue__assetClass (moving.enemys.Blue__assetClass)
package moving.enemys {
import flash.display.*;
import mx.core.*;
public class Blue__assetClass extends SpriteAsset {
public var green:DisplayObject;
public var level:DisplayObject;
public var lives:DisplayObject;
public var saucer:DisplayObject;
public var mon:DisplayObject;
public var redspecial:DisplayObject;
public var bigred:DisplayObject;
public var score:DisplayObject;
public var locator:DisplayObject;
public var submit:DisplayObject;
public var jet:DisplayObject;
public var coins:DisplayObject;
public var soff:DisplayObject;
public var options:DisplayObject;
public var prop0:DisplayObject;
public var prop1:DisplayObject;
public var son:DisplayObject;
public var missile:DisplayObject;
public var jet2:DisplayObject;
public var bigred2:DisplayObject;
public var boat:DisplayObject;
public var main:DisplayObject;
public var input:DisplayObject;
public var wg:DisplayObject;
public var eject:DisplayObject;
public var plays1:DisplayObject;
public var plays2:DisplayObject;
public var more:DisplayObject;
public var red:DisplayObject;
public var ok:DisplayObject;
public var powerup:DisplayObject;
public var mine:DisplayObject;
public var bossBar:DisplayObject;
public var moff:DisplayObject;
public var prop:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var go:DisplayObject;
public var direct:DisplayObject;
public var shieldBar:DisplayObject;
public var ibm:DisplayObject;
public var lifeBar:DisplayObject;
public var dontsubmit:DisplayObject;
public var spawn:DisplayObject;
}
}//package moving.enemys
Section 120
//Boat (moving.enemys.Boat)
package moving.enemys {
import game.*;
import moving.*;
import com.greensock.*;
import com.greensock.easing.*;
public class Boat extends Moving {
private var _startX:Number;
private var _assetClass:Class;
private var _maxMoves:int;// = 20
public function Boat(){
_assetClass = Boat__assetClass;
super();
fxFactory = Fx.createSmallBoom;
setClip(new _assetClass());
center();
HEALTH = 1500;
POINTS = HEALTH;
TweenMax.to(this, 8, {y:"350", ease:Cubic.easeIn, onComplete:leave});
HOVER = false;
fixHealthByLevel();
}
private function leave():void{
TweenMax.to(this, 3, {delay:3, y:"400", ease:Cubic.easeIn, onComplete:hide});
}
override protected function createShadow():void{
}
}
}//package moving.enemys
Section 121
//Boat__assetClass (moving.enemys.Boat__assetClass)
package moving.enemys {
import flash.display.*;
import mx.core.*;
public class Boat__assetClass extends SpriteAsset {
public var green:DisplayObject;
public var level:DisplayObject;
public var lives:DisplayObject;
public var saucer:DisplayObject;
public var mon:DisplayObject;
public var redspecial:DisplayObject;
public var bigred:DisplayObject;
public var score:DisplayObject;
public var locator:DisplayObject;
public var submit:DisplayObject;
public var jet:DisplayObject;
public var coins:DisplayObject;
public var soff:DisplayObject;
public var options:DisplayObject;
public var missile:DisplayObject;
public var son:DisplayObject;
public var jet2:DisplayObject;
public var red:DisplayObject;
public var bigred2:DisplayObject;
public var boat:DisplayObject;
public var main:DisplayObject;
public var input:DisplayObject;
public var wg:DisplayObject;
public var eject:DisplayObject;
public var plays1:DisplayObject;
public var plays2:DisplayObject;
public var more:DisplayObject;
public var mine:DisplayObject;
public var ok:DisplayObject;
public var powerup:DisplayObject;
public var moff:DisplayObject;
public var prop:DisplayObject;
public var bossBar:DisplayObject;
public var direct:DisplayObject;
public var shieldBar:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var go:DisplayObject;
public var dontsubmit:DisplayObject;
public var ibm:DisplayObject;
public var lifeBar:DisplayObject;
public var spawn:DisplayObject;
}
}//package moving.enemys
Section 122
//Boss (moving.enemys.Boss)
package moving.enemys {
import flash.events.*;
import game.*;
import flash.display.*;
import moving.*;
import flash.geom.*;
import com.greensock.*;
import com.greensock.easing.*;
public class Boss extends Moving {
private var _startX:Number;
private var _assetClass:Class;
private var _maxMoves:int;// = 20
public function Boss(){
_assetClass = Boss__assetClass;
super();
_repeatFire = 200;
fxFactory = Fx.createBigBoom;
y = -100;
_shadow = new Bitmap(new BitmapData(350, 240, true, 0), "auto", true);
setClip(new _assetClass());
center();
setHealth(8200, 25000);
var dir:String = ((x < 375)) ? "-100" : "100";
TweenMax.to(this, 3, {y:300, ease:Cubic.easeOut, onComplete:nextPoint});
addEventListener(Event.ENTER_FRAME, onEnterFrame, false, 0, true);
addChildAt(_shadow, 0);
setBossMode();
}
override public function die():void{
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
super.die();
}
private function nextPoint():void{
var idx:int = (Math.random() * 10);
var t:Number = (2 + Math.random());
switch (idx){
case 0:
TweenMax.to(this, t, {x:100, y:150, ease:Expo.easeOut, onComplete:nextPoint});
break;
case 1:
TweenMax.to(this, t, {x:650, y:150, ease:Expo.easeOut, onComplete:nextPoint});
break;
case 2:
TweenMax.to(this, t, {x:150, y:250, ease:Expo.easeOut, onComplete:nextPoint});
break;
case 3:
TweenMax.to(this, t, {x:600, y:250, ease:Expo.easeOut, onComplete:nextPoint});
break;
case 4:
TweenMax.to(this, t, {x:350, y:250, ease:Expo.easeOut, onComplete:nextPoint});
break;
case 5:
TweenMax.to(this, t, {x:250, y:400, ease:Expo.easeOut, onComplete:nextPoint});
break;
case 6:
TweenMax.to(this, t, {x:500, y:400, ease:Expo.easeOut, onComplete:nextPoint});
break;
default:
retreat();
};
}
private function retreat():void{
TweenMax.to(this, 2.5, {x:randomHalf(77).toString(), y:randomHalf(55).toString(), ease:Expo.easeOut, onComplete:nextPoint});
}
private function onEnterFrame(event:Event):void{
createShadow();
}
override protected function createShadow():void{
var rect:Rectangle;
if (_shadow){
_shadow.bitmapData.fillRect(_shadow.bitmapData.rect, 0);
rect = _mc.getRect(_mc);
_shadow.bitmapData.draw(_mc, new Matrix(_shadowScale, 0, 0, _shadowScale, 175, 90), new ColorTransform(0, 0, 0, 0.33));
_shadow.x = -300;
_shadow.y = -200;
};
}
}
}//package moving.enemys
Section 123
//Boss__assetClass (moving.enemys.Boss__assetClass)
package moving.enemys {
import flash.display.*;
import mx.core.*;
public class Boss__assetClass extends SpriteAsset {
public var green:DisplayObject;
public var level:DisplayObject;
public var lives:DisplayObject;
public var saucer:DisplayObject;
public var mon:DisplayObject;
public var redspecial:DisplayObject;
public var bigred:DisplayObject;
public var score:DisplayObject;
public var locator:DisplayObject;
public var submit:DisplayObject;
public var jet:DisplayObject;
public var coins:DisplayObject;
public var soff:DisplayObject;
public var options:DisplayObject;
public var missile:DisplayObject;
public var son:DisplayObject;
public var jet2:DisplayObject;
public var red:DisplayObject;
public var bigred2:DisplayObject;
public var boat:DisplayObject;
public var main:DisplayObject;
public var input:DisplayObject;
public var wg:DisplayObject;
public var eject:DisplayObject;
public var plays1:DisplayObject;
public var plays2:DisplayObject;
public var more:DisplayObject;
public var mine:DisplayObject;
public var ok:DisplayObject;
public var powerup:DisplayObject;
public var moff:DisplayObject;
public var prop:DisplayObject;
public var bossBar:DisplayObject;
public var direct:DisplayObject;
public var shieldBar:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var go:DisplayObject;
public var dontsubmit:DisplayObject;
public var ibm:DisplayObject;
public var lifeBar:DisplayObject;
public var spawn:DisplayObject;
}
}//package moving.enemys
Section 124
//Green (moving.enemys.Green)
package moving.enemys {
import game.*;
import moving.*;
import com.greensock.*;
import com.greensock.easing.*;
public class Green extends Moving {
private var _startX:Number;
private var _assetClass:Class;
private var _maxMoves:int;// = 20
public function Green(){
_assetClass = Green__assetClass;
super();
fxFactory = Fx.createSmallBoom;
y = -100;
setClip(new _assetClass());
center();
HEALTH = 500;
POINTS = 500;
var dir:String = ((x < 375)) ? "-200" : "200";
TweenMax.to(this, 12, {y:"700", ease:Cubic.easeOut, onComplete:hide});
TweenMax.to(this, 8, {x:dir, repeat:3, yoyo:true});
fixHealthByLevel();
}
}
}//package moving.enemys
Section 125
//Green__assetClass (moving.enemys.Green__assetClass)
package moving.enemys {
import flash.display.*;
import mx.core.*;
public class Green__assetClass extends SpriteAsset {
public var green:DisplayObject;
public var level:DisplayObject;
public var lives:DisplayObject;
public var saucer:DisplayObject;
public var mon:DisplayObject;
public var redspecial:DisplayObject;
public var bigred:DisplayObject;
public var score:DisplayObject;
public var locator:DisplayObject;
public var submit:DisplayObject;
public var coins:DisplayObject;
public var soff:DisplayObject;
public var options:DisplayObject;
public var son:DisplayObject;
public var jet:DisplayObject;
public var jet2:DisplayObject;
public var red:DisplayObject;
public var bigred2:DisplayObject;
public var boat:DisplayObject;
public var input:DisplayObject;
public var wg:DisplayObject;
public var eject:DisplayObject;
public var plays1:DisplayObject;
public var plays2:DisplayObject;
public var more:DisplayObject;
public var ok:DisplayObject;
public var powerup:DisplayObject;
public var mine:DisplayObject;
public var prop:DisplayObject;
public var bossBar:DisplayObject;
public var moff:DisplayObject;
public var shieldBar:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var go:DisplayObject;
public var dontsubmit:DisplayObject;
public var ibm:DisplayObject;
public var lifeBar:DisplayObject;
public var spawn:DisplayObject;
}
}//package moving.enemys
Section 126
//Ibm (moving.enemys.Ibm)
package moving.enemys {
import game.*;
import moving.*;
import com.greensock.*;
import com.greensock.easing.*;
public class Ibm extends Moving {
private var _startX:Number;
private var _assetClass:Class;
private var _maxMoves:int;// = 20
public function Ibm(){
_assetClass = Ibm__assetClass;
super();
_repeatFire = 200;
fxFactory = Fx.createBigBoom;
y = -100;
setClip(new _assetClass());
center();
setHealth(5000, 15000);
var dir:String = ((x < 375)) ? "-100" : "100";
TweenMax.to(this, 3, {x:375, y:150, ease:Cubic.easeOut, onComplete:nextPoint});
setBossMode();
}
override public function die():void{
super.die();
Game.getInstance().nextLevel();
}
private function nextPoint():void{
var idx:int = (Math.random() * 10);
var t:Number = (8 + (Math.random() * 2));
switch (idx){
case 0:
TweenMax.to(this, t, {x:100, y:150, ease:Expo.easeOut, onComplete:nextPoint});
break;
case 1:
TweenMax.to(this, t, {x:650, y:150, ease:Expo.easeOut, onComplete:nextPoint});
break;
case 2:
TweenMax.to(this, t, {x:150, y:250, ease:Expo.easeOut, onComplete:nextPoint});
break;
case 3:
TweenMax.to(this, t, {x:600, y:250, ease:Expo.easeOut, onComplete:nextPoint});
break;
case 4:
TweenMax.to(this, t, {x:350, y:250, ease:Expo.easeOut, onComplete:nextPoint});
break;
case 5:
TweenMax.to(this, t, {x:250, y:100, ease:Expo.easeOut, onComplete:nextPoint});
break;
case 6:
TweenMax.to(this, t, {x:500, y:100, ease:Expo.easeOut, onComplete:nextPoint});
break;
default:
retreat();
};
}
private function retreat():void{
TweenMax.to(this, 2.5, {x:randomHalf(50).toString(), y:randomHalf(50).toString(), ease:Expo.easeOut, onComplete:nextPoint});
}
}
}//package moving.enemys
Section 127
//Ibm__assetClass (moving.enemys.Ibm__assetClass)
package moving.enemys {
import flash.display.*;
import mx.core.*;
public class Ibm__assetClass extends SpriteAsset {
public var green:DisplayObject;
public var level:DisplayObject;
public var lives:DisplayObject;
public var saucer:DisplayObject;
public var mon:DisplayObject;
public var redspecial:DisplayObject;
public var bigred:DisplayObject;
public var score:DisplayObject;
public var locator:DisplayObject;
public var submit:DisplayObject;
public var jet:DisplayObject;
public var coins:DisplayObject;
public var soff:DisplayObject;
public var options:DisplayObject;
public var prop0:DisplayObject;
public var prop1:DisplayObject;
public var son:DisplayObject;
public var missile:DisplayObject;
public var jet2:DisplayObject;
public var bigred2:DisplayObject;
public var boat:DisplayObject;
public var main:DisplayObject;
public var input:DisplayObject;
public var wg:DisplayObject;
public var eject:DisplayObject;
public var plays1:DisplayObject;
public var plays2:DisplayObject;
public var more:DisplayObject;
public var red:DisplayObject;
public var ok:DisplayObject;
public var powerup:DisplayObject;
public var mine:DisplayObject;
public var bossBar:DisplayObject;
public var moff:DisplayObject;
public var prop:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var go:DisplayObject;
public var direct:DisplayObject;
public var shieldBar:DisplayObject;
public var ibm:DisplayObject;
public var lifeBar:DisplayObject;
public var dontsubmit:DisplayObject;
public var spawn:DisplayObject;
}
}//package moving.enemys
Section 128
//Jet (moving.enemys.Jet)
package moving.enemys {
import game.*;
import moving.*;
import com.greensock.*;
import com.greensock.easing.*;
public class Jet extends Moving {
private var _startX:Number;
private var _assetClass:Class;
public function Jet(){
_assetClass = Jet__assetClass;
super();
fxFactory = Fx.createBigBoom;
y = -100;
setClip(new _assetClass());
center();
HEALTH = 200;
POINTS = 200;
TweenMax.to(this, 3, {y:225, ease:Cubic.easeOut, onComplete:leave});
fixHealthByLevel();
}
private function leave():void{
TweenMax.to(this, 2, {delay:2.5, y:800, ease:Cubic.easeIn, onComplete:hide});
}
}
}//package moving.enemys
Section 129
//Jet__assetClass (moving.enemys.Jet__assetClass)
package moving.enemys {
import flash.display.*;
import mx.core.*;
public class Jet__assetClass extends SpriteAsset {
public var green:DisplayObject;
public var level:DisplayObject;
public var lives:DisplayObject;
public var saucer:DisplayObject;
public var mon:DisplayObject;
public var redspecial:DisplayObject;
public var bigred:DisplayObject;
public var score:DisplayObject;
public var locator:DisplayObject;
public var submit:DisplayObject;
public var jet:DisplayObject;
public var coins:DisplayObject;
public var soff:DisplayObject;
public var options:DisplayObject;
public var missile:DisplayObject;
public var son:DisplayObject;
public var jet2:DisplayObject;
public var red:DisplayObject;
public var bigred2:DisplayObject;
public var boat:DisplayObject;
public var main:DisplayObject;
public var input:DisplayObject;
public var wg:DisplayObject;
public var eject:DisplayObject;
public var plays1:DisplayObject;
public var plays2:DisplayObject;
public var more:DisplayObject;
public var mine:DisplayObject;
public var ok:DisplayObject;
public var powerup:DisplayObject;
public var moff:DisplayObject;
public var prop:DisplayObject;
public var bossBar:DisplayObject;
public var direct:DisplayObject;
public var shieldBar:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var go:DisplayObject;
public var dontsubmit:DisplayObject;
public var ibm:DisplayObject;
public var lifeBar:DisplayObject;
public var spawn:DisplayObject;
}
}//package moving.enemys
Section 130
//Jet2 (moving.enemys.Jet2)
package moving.enemys {
import game.*;
import moving.*;
import com.greensock.*;
import com.greensock.easing.*;
public class Jet2 extends Moving {
private var _startX:Number;
private var _assetClass:Class;
public function Jet2(){
_assetClass = Jet2__assetClass;
super();
fxFactory = Fx.createBigBoom;
y = 600;
setClip(new _assetClass());
center();
setHealth(250, 500);
var dir:String = ((Math.random() * 200) - 100).toString();
TweenMax.to(this, 3, {y:"-400", ease:Cubic.easeIn, onComplete:leave});
TweenMax.to(this, 6, {x:dir, ease:Cubic.easeIn});
fixHealthByLevel();
}
private function leave():void{
TweenMax.to(this, 3, {delay:3, y:"-500", ease:Expo.easeIn, onComplete:hide});
}
}
}//package moving.enemys
Section 131
//Jet2__assetClass (moving.enemys.Jet2__assetClass)
package moving.enemys {
import flash.display.*;
import mx.core.*;
public class Jet2__assetClass extends SpriteAsset {
public var green:DisplayObject;
public var level:DisplayObject;
public var lives:DisplayObject;
public var saucer:DisplayObject;
public var mon:DisplayObject;
public var redspecial:DisplayObject;
public var bigred:DisplayObject;
public var score:DisplayObject;
public var locator:DisplayObject;
public var submit:DisplayObject;
public var jet:DisplayObject;
public var coins:DisplayObject;
public var soff:DisplayObject;
public var options:DisplayObject;
public var prop0:DisplayObject;
public var prop1:DisplayObject;
public var son:DisplayObject;
public var missile:DisplayObject;
public var jet2:DisplayObject;
public var bigred2:DisplayObject;
public var boat:DisplayObject;
public var main:DisplayObject;
public var input:DisplayObject;
public var wg:DisplayObject;
public var eject:DisplayObject;
public var plays1:DisplayObject;
public var plays2:DisplayObject;
public var more:DisplayObject;
public var red:DisplayObject;
public var ok:DisplayObject;
public var powerup:DisplayObject;
public var mine:DisplayObject;
public var bossBar:DisplayObject;
public var moff:DisplayObject;
public var prop:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var go:DisplayObject;
public var direct:DisplayObject;
public var shieldBar:DisplayObject;
public var ibm:DisplayObject;
public var lifeBar:DisplayObject;
public var dontsubmit:DisplayObject;
public var spawn:DisplayObject;
}
}//package moving.enemys
Section 132
//Mine (moving.enemys.Mine)
package moving.enemys {
import game.*;
import moving.*;
import flash.geom.*;
import moving.craft.*;
import com.greensock.*;
import com.greensock.easing.*;
import com.utils.*;
public class Mine extends Moving {
private var _assetClass:Class;
public function Mine(){
_assetClass = Mine__assetClass;
super();
fxFactory = Fx.createBoomPlusSparx;
y = -100;
setClip(new _assetClass());
TweenMax.to(this, 5, {y:(320 + (Math.random() * 20)).toString(), ease:Linear.easeNone, onComplete:nextPoint});
HEALTH = 500;
POINTS = 100;
BONUS = 1;
MINE = true;
}
override public function die():void{
if (Point.distance(toPoint(), Craft.getInstance().toPoint()) < 100){
Craft.getInstance().directHit();
};
super.die();
//unresolved jump
var _slot1 = error;
Debug.error(this, "in die()", _slot1);
}
override protected function createShadow():void{
}
private function nextPoint():void{
TweenMax.to(this, 1.75, {x:((Math.random() * 20) - 10).toString(), y:((Math.random() * 20) - 10).toString(), onComplete:nextPoint});
}
}
}//package moving.enemys
Section 133
//Mine__assetClass (moving.enemys.Mine__assetClass)
package moving.enemys {
import flash.display.*;
import mx.core.*;
public class Mine__assetClass extends MovieClipAsset {
public var green:DisplayObject;
public var level:DisplayObject;
public var lives:DisplayObject;
public var saucer:DisplayObject;
public var mon:DisplayObject;
public var redspecial:DisplayObject;
public var bigred:DisplayObject;
public var score:DisplayObject;
public var locator:DisplayObject;
public var submit:DisplayObject;
public var coins:DisplayObject;
public var soff:DisplayObject;
public var options:DisplayObject;
public var son:DisplayObject;
public var jet:DisplayObject;
public var jet2:DisplayObject;
public var red:DisplayObject;
public var bigred2:DisplayObject;
public var boat:DisplayObject;
public var input:DisplayObject;
public var wg:DisplayObject;
public var eject:DisplayObject;
public var plays1:DisplayObject;
public var plays2:DisplayObject;
public var more:DisplayObject;
public var ok:DisplayObject;
public var powerup:DisplayObject;
public var mine:DisplayObject;
public var prop:DisplayObject;
public var bossBar:DisplayObject;
public var moff:DisplayObject;
public var shieldBar:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var go:DisplayObject;
public var dontsubmit:DisplayObject;
public var ibm:DisplayObject;
public var lifeBar:DisplayObject;
public var spawn:DisplayObject;
}
}//package moving.enemys
Section 134
//Red (moving.enemys.Red)
package moving.enemys {
import game.*;
import moving.*;
import com.greensock.*;
import com.greensock.easing.*;
public class Red extends Moving {
private var _startX:Number;
private var _assetClass:Class;
private var _maxMoves:int;// = 20
public function Red(){
_assetClass = Red__assetClass;
super();
fxFactory = Fx.createSmallBoom;
y = -100;
setClip(new _assetClass());
center();
setHealth(10, 500);
POINTS = HEALTH;
var idir:int = ((x < 375)) ? 1 : -1;
var dir:String = ((idir * 50) + (Math.random() * 100)).toString();
TweenMax.to(this, (3 + Math.random()), {y:(200 + (Math.random() * 100)).toString(), ease:Cubic.easeIn, onComplete:leave});
TweenMax.to(this, (3 + Math.random()), {x:dir, repeat:5, yoyo:true});
fixHealthByLevel();
}
private function leave():void{
TweenMax.to(this, (5 + Math.random()), {y:"500", ease:Cubic.easeIn, onComplete:hide});
}
}
}//package moving.enemys
Section 135
//Red__assetClass (moving.enemys.Red__assetClass)
package moving.enemys {
import flash.display.*;
import mx.core.*;
public class Red__assetClass extends SpriteAsset {
public var green:DisplayObject;
public var level:DisplayObject;
public var lives:DisplayObject;
public var saucer:DisplayObject;
public var mon:DisplayObject;
public var redspecial:DisplayObject;
public var bigred:DisplayObject;
public var score:DisplayObject;
public var locator:DisplayObject;
public var submit:DisplayObject;
public var coins:DisplayObject;
public var soff:DisplayObject;
public var options:DisplayObject;
public var son:DisplayObject;
public var jet:DisplayObject;
public var jet2:DisplayObject;
public var red:DisplayObject;
public var bigred2:DisplayObject;
public var boat:DisplayObject;
public var input:DisplayObject;
public var wg:DisplayObject;
public var eject:DisplayObject;
public var plays1:DisplayObject;
public var plays2:DisplayObject;
public var more:DisplayObject;
public var ok:DisplayObject;
public var powerup:DisplayObject;
public var mine:DisplayObject;
public var prop:DisplayObject;
public var bossBar:DisplayObject;
public var moff:DisplayObject;
public var shieldBar:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var go:DisplayObject;
public var dontsubmit:DisplayObject;
public var ibm:DisplayObject;
public var lifeBar:DisplayObject;
public var spawn:DisplayObject;
}
}//package moving.enemys
Section 136
//RedSpecial (moving.enemys.RedSpecial)
package moving.enemys {
import game.*;
import moving.*;
import flash.geom.*;
import moving.craft.*;
import com.greensock.*;
import com.greensock.easing.*;
public class RedSpecial extends Moving {
private var _a:int;// = 90
private var _assetClass:Class;
private var _startX:Number;
private var _rad:Number;// = 122
private var _dir:int;
private var _maxMoves:int;// = 10
public static var DIR:int = -1;
public function RedSpecial(){
_assetClass = RedSpecial__assetClass;
super();
DIR = (DIR * -1);
_dir = DIR;
fxFactory = Fx.createSmallBoom;
_startX = x;
y = -100;
setClip(new _assetClass());
center();
setHealth(10, 1000);
POINTS = HEALTH;
TweenMax.to(this, 1.125, {y:0, ease:Linear.easeNone, onComplete:nextPoint});
fixHealthByLevel();
}
public function nextPoint():void{
var p:Point = new Point(Craft.getInstance().x, Craft.getInstance().y);
_a = (_a + (30 * _dir));
if (_a > 360){
_a = 0;
};
if (_a < 0){
_a = 360;
};
var _n:Number = ((_a - 180) * 0.0174532925);
p.x = (p.x + ((Math.cos(_n) * _rad) * 1.66));
p.y = (p.y + (Math.sin(_n) * _rad));
_maxMoves--;
if (_maxMoves){
TweenMax.to(this, 0.75, {x:p.x, y:p.y, ease:Linear.easeNone, onComplete:nextPoint});
} else {
TweenMax.to(this, 1, {y:"500", onComplete:hide});
};
}
}
}//package moving.enemys
Section 137
//RedSpecial__assetClass (moving.enemys.RedSpecial__assetClass)
package moving.enemys {
import flash.display.*;
import mx.core.*;
public class RedSpecial__assetClass extends SpriteAsset {
public var green:DisplayObject;
public var level:DisplayObject;
public var lives:DisplayObject;
public var saucer:DisplayObject;
public var mon:DisplayObject;
public var redspecial:DisplayObject;
public var bigred:DisplayObject;
public var score:DisplayObject;
public var locator:DisplayObject;
public var submit:DisplayObject;
public var jet:DisplayObject;
public var coins:DisplayObject;
public var soff:DisplayObject;
public var options:DisplayObject;
public var missile:DisplayObject;
public var son:DisplayObject;
public var jet2:DisplayObject;
public var red:DisplayObject;
public var bigred2:DisplayObject;
public var boat:DisplayObject;
public var input:DisplayObject;
public var wg:DisplayObject;
public var eject:DisplayObject;
public var plays1:DisplayObject;
public var plays2:DisplayObject;
public var more:DisplayObject;
public var mine:DisplayObject;
public var ok:DisplayObject;
public var powerup:DisplayObject;
public var moff:DisplayObject;
public var prop:DisplayObject;
public var bossBar:DisplayObject;
public var direct:DisplayObject;
public var shieldBar:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var go:DisplayObject;
public var dontsubmit:DisplayObject;
public var ibm:DisplayObject;
public var lifeBar:DisplayObject;
public var spawn:DisplayObject;
}
}//package moving.enemys
Section 138
//Saucer (moving.enemys.Saucer)
package moving.enemys {
import game.*;
import moving.*;
import com.greensock.*;
import com.greensock.easing.*;
public class Saucer extends Moving {
private var _maxMoves:int;// = 20
private var _assetClass:Class;
private var _startX:Number;
private var _enemyShotClass:Class;
private var _spawnTimeline:TimelineMax;
public function Saucer(){
_assetClass = Saucer__assetClass;
_enemyShotClass = Saucer__enemyShotClass;
_spawnTimeline = new TimelineMax();
super();
_repeatFire = 511;
fxFactory = Fx.createBigBoom;
y = -100;
_timeBetweenSalvos = 5;
_timeBetweenLocators = 0.1;
_extraSalvos = 5;
setClip(new _assetClass());
center();
setHealth(10000, 50000);
TweenMax.to(this, 4, {y:"400", ease:Cubic.easeOut, onComplete:yoyo});
setBossMode();
_useThisShotClass = _enemyShotClass;
_spawnTimeline.addCallback(spawn1, 1);
_spawnTimeline.addCallback(spawn2, 4);
_spawnTimeline.repeat = 400;
}
override public function die():void{
super.die();
if (_spawnTimeline){
_spawnTimeline.kill();
};
_spawnTimeline = null;
}
override protected function createShadow():void{
}
public function moveRight():void{
TweenMax.to(this, 3, {x:600, onComplete:moveLeft, ease:Expo.easeOut});
}
public function yoyo():void{
TweenMax.to(this, 9, {y:300, ease:Cubic.easeOut, repeat:999, yoyo:true});
moveLeft();
}
private function spawn1():void{
var target:Moving = new Red();
target.x = (350 + randomHalf(200));
target.y = -100;
Game.getInstance().addEnemy(target);
}
private function spawn2():void{
var target:Moving = new RedSpecial();
target.x = (350 + randomHalf(300));
target.y = -100;
Game.getInstance().addEnemy(target);
}
override protected function periodicFire(locatorIndex:int):void{
if (locatorIndex == 0){
TweenMax.to(this, 3, {rotation:360, ease:Linear.easeNone});
};
super.periodicFire(locatorIndex);
}
public function moveLeft():void{
TweenMax.to(this, 3, {x:150, onComplete:moveRight, ease:Expo.easeOut});
}
}
}//package moving.enemys
Section 139
//Saucer__assetClass (moving.enemys.Saucer__assetClass)
package moving.enemys {
import flash.display.*;
import mx.core.*;
public class Saucer__assetClass extends SpriteAsset {
public var green:DisplayObject;
public var level:DisplayObject;
public var lives:DisplayObject;
public var saucer:DisplayObject;
public var mon:DisplayObject;
public var redspecial:DisplayObject;
public var bigred:DisplayObject;
public var score:DisplayObject;
public var locator:DisplayObject;
public var submit:DisplayObject;
public var jet:DisplayObject;
public var coins:DisplayObject;
public var soff:DisplayObject;
public var options:DisplayObject;
public var missile:DisplayObject;
public var son:DisplayObject;
public var jet2:DisplayObject;
public var red:DisplayObject;
public var bigred2:DisplayObject;
public var boat:DisplayObject;
public var input:DisplayObject;
public var wg:DisplayObject;
public var eject:DisplayObject;
public var plays1:DisplayObject;
public var plays2:DisplayObject;
public var more:DisplayObject;
public var mine:DisplayObject;
public var ok:DisplayObject;
public var powerup:DisplayObject;
public var moff:DisplayObject;
public var prop:DisplayObject;
public var bossBar:DisplayObject;
public var direct:DisplayObject;
public var shieldBar:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var go:DisplayObject;
public var dontsubmit:DisplayObject;
public var ibm:DisplayObject;
public var lifeBar:DisplayObject;
public var spawn:DisplayObject;
}
}//package moving.enemys
Section 140
//Saucer__enemyShotClass (moving.enemys.Saucer__enemyShotClass)
package moving.enemys {
import flash.display.*;
import mx.core.*;
public class Saucer__enemyShotClass extends MovieClipAsset {
public var green:DisplayObject;
public var level:DisplayObject;
public var lives:DisplayObject;
public var saucer:DisplayObject;
public var mon:DisplayObject;
public var redspecial:DisplayObject;
public var bigred:DisplayObject;
public var score:DisplayObject;
public var locator:DisplayObject;
public var submit:DisplayObject;
public var jet:DisplayObject;
public var coins:DisplayObject;
public var soff:DisplayObject;
public var options:DisplayObject;
public var missile:DisplayObject;
public var son:DisplayObject;
public var jet2:DisplayObject;
public var red:DisplayObject;
public var bigred2:DisplayObject;
public var boat:DisplayObject;
public var input:DisplayObject;
public var wg:DisplayObject;
public var eject:DisplayObject;
public var plays1:DisplayObject;
public var plays2:DisplayObject;
public var more:DisplayObject;
public var mine:DisplayObject;
public var ok:DisplayObject;
public var powerup:DisplayObject;
public var moff:DisplayObject;
public var prop:DisplayObject;
public var bossBar:DisplayObject;
public var direct:DisplayObject;
public var shieldBar:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var go:DisplayObject;
public var dontsubmit:DisplayObject;
public var ibm:DisplayObject;
public var lifeBar:DisplayObject;
public var spawn:DisplayObject;
}
}//package moving.enemys
Section 141
//Moving (moving.Moving)
package moving {
import game.*;
import flash.display.*;
import statics.*;
import soundmanager.*;
import flash.geom.*;
import moving.craft.*;
import com.greensock.*;
import flash.utils.*;
import moving.enemys.missile.*;
import com.utils.*;
public class Moving extends Sprite {
private var _exhaustLocatorClass:Class;
protected var _repeatFire:int;// = 20
private var _enemyShotClass:Class;
protected var _timeBetweenSalvos:Number;// = 3
public var HOVER:Boolean;// = true
private var _timeline:TimelineMax;
protected var _extraSalvos:int;// = 1
private var _dying:Boolean;// = false
protected var _mc;
protected var _useThisShotClass:Class;
private var _fireLocatorClass:Class;
protected var _shadow:Bitmap;
private var _blinkID:int;
private var _hidden:Boolean;// = false
protected var _shadowScale:Number;// = 0.75
private var _traceClass:Class;
public var MINE:Boolean;// = false
private var _fireFuncID:uint;
public var fxFactory:Function;
protected var _startingHealth:int;
private var _blinksLeft:int;
public var HEALTH:int;// = 100
public var BLINK_INTERVAL:int;// = 100
public var BLINK_TIMES:int;// = 3
public var BOSS:Boolean;// = false
protected var _timeBetweenLocators:Number;// = 0.05
public var POINTS:int;
protected var _locators:Array;
public var BONUS:int;// = 0
public static var died:int = 0;
public static var hidden:int = 0;
public static var total:int = 0;
public function Moving(){
_enemyShotClass = Moving__enemyShotClass;
_exhaustLocatorClass = Moving__exhaustLocatorClass;
_fireLocatorClass = Moving__fireLocatorClass;
_traceClass = Moving__traceClass;
fxFactory = Fx.createSparx;
_locators = [];
_useThisShotClass = _enemyShotClass;
POINTS = HEALTH;
super();
total++;
}
protected function periodicFire(locatorIndex:int):void{
var locator:DisplayObject;
var shot:MovieClip;
var matrix:Matrix;
var missile:Moving;
var cp:Point;
var p:Point;
var a:Number;
if (y > -1){
locator = _locators[locatorIndex];
shot = new _useThisShotClass();
matrix = locator.transform.matrix.clone();
matrix.concat(this.transform.matrix);
if (locator.name == "direct"){
shot.transform.matrix = matrix;
} else {
if (locator.name == "missile"){
missile = new Missile();
missile.transform.matrix = matrix;
Game.getInstance().addEnemy(missile);
return;
};
cp = Craft.getInstance().toPoint();
p = toPoint();
a = (-(Math.atan2((p.y - cp.y), (p.x - cp.x))) + (Math.PI / 2));
if (a > Math.PI){
a = (a - (Math.PI * 2));
};
if (a < -(Math.PI)){
a = (a + (Math.PI * 2));
};
shot.transform.matrix = new Matrix(Math.cos(a), -(Math.sin(a)), Math.sin(a), Math.cos(a), matrix.tx, matrix.ty);
};
Game.getInstance().addEnemyShot(shot);
};
}
public function toPoint():Point{
return (new Point(x, y));
}
public function precacheLocators(d, indent:String=""):void{
var z:int;
var traceClip:MovieClip;
d.cacheAsBitmap = true;
if ((d is DisplayObjectContainer)){
z = (d.numChildren - 1);
while (z >= 0) {
precacheLocators(d.getChildAt(z), (indent + "\t"));
z--;
};
};
if ((d is _fireLocatorClass)){
_locators.push(d);
Util.safelyRemove(d);
};
if ((d is _exhaustLocatorClass)){
traceClip = new _traceClass();
traceClip.transform.matrix = d.transform.matrix.clone();
traceClip.blendMode = BlendMode.ADD;
addChild(traceClip);
Util.safelyRemove(d);
};
}
public function die():void{
var matrix:Matrix;
if (!_dying){
died++;
if (!BONUS){
matrix = transform.concatenatedMatrix;
Game.getInstance().reportKill(name, matrix.tx, matrix.ty);
};
fxFactory(x, y);
hide();
Game.getInstance().addScore(POINTS);
};
if (!BONUS){
SoundManager.getInstance().exlposion();
};
_dying = true;
}
protected function get blinkTransform():ColorTransform{
return (new ColorTransform(1, 1, 1, 0.75, 63, 63, 63));
}
public function blink():void{
if (((_mc) && (_blinksLeft))){
_blinksLeft--;
if ((_blinksLeft % 2)){
_mc.transform.colorTransform = blinkTransform;
} else {
_mc.transform.colorTransform = new ColorTransform();
};
} else {
clearInterval(_blinkID);
_blinkID = 0;
};
}
public function checkCollision(target:DisplayObject):Boolean{
if (!((((parent) && (target))) && (target.parent))){
return (false);
};
var r1:Rectangle = _mc.getRect(parent);
var r2:Rectangle = target.getRect(target.parent);
if (!r1.intersects(r2)){
return (false);
};
var rx:Rectangle = r1.intersection(r2);
if ((((rx.width < 1)) || ((rx.height < 1)))){
return (false);
};
var testBitmap:BitmapData = new BitmapData(rx.width, rx.height, false, 4294967295);
var mt:Matrix = target.transform.concatenatedMatrix;
testBitmap.draw(_mc, new Matrix(1, 0, 0, 1, (-(rx.x) + x), (-(rx.y) + y)), new ColorTransform(1, 1, 1, 1, 0xFF, -255, -255, 0xFF));
testBitmap.draw(((target is Moving)) ? (target as Moving).getClip() : target, new Matrix(mt.a, mt.b, mt.c, mt.d, (-(rx.x) + target.x), (-(rx.y) + target.y)), new ColorTransform(1, 1, 1, 1, 0xFF, 0xFF, 0xFF, 0xFF), "difference");
var result:Rectangle = testBitmap.getColorBoundsRect(4294967295, 4278255615);
return (!((result.width == 0)));
}
public function left():void{
if (_mc){
_mc.gotoAndStop(2);
createShadow();
};
}
public function hit(damage:int):void{
if (!_blinkID){
HEALTH = (HEALTH - damage);
if (HEALTH <= 0){
die();
} else {
_blinksLeft = BLINK_TIMES;
_blinkID = setInterval(blink, BLINK_INTERVAL);
};
};
if (((damage) && ((!(this) is Craft)))){
Game.getInstance().addScore(10);
};
if (BOSS){
Game.getInstance().updateBossBar((HEALTH / _startingHealth));
};
}
protected function randomHalf(n:Number):Number{
return (((Math.random() * n) - (n / 2)));
}
public function right():void{
if (_mc){
_mc.gotoAndStop(3);
createShadow();
};
}
protected function setBossMode():void{
Game.getInstance().setBossMode();
BOSS = true;
_startingHealth = HEALTH;
}
protected function createShadow():void{
Util.safelyRemove(_shadow);
if (_shadow){
_shadow.bitmapData.dispose();
};
_shadow = new Bitmap(new BitmapData((_mc.width * _shadowScale), (_mc.height * _shadowScale), true, 0), "auto", true);
var rect:Rectangle = _mc.getRect(_mc);
_shadow.bitmapData.draw(_mc, new Matrix(_shadowScale, 0, 0, _shadowScale, (-(rect.x) * _shadowScale), (-(rect.y) * _shadowScale)), new ColorTransform(0, 0, 0, 0.33));
_shadow.x = -100;
_shadow.y = -100;
addChildAt(_shadow, 0);
}
public function hide():void{
if (!_hidden){
if (_timeline){
_timeline.kill();
};
_timeline = null;
Util.safelyRemove(this);
Util.destroy(this);
Game.getInstance().removeEnemy(this);
_mc = null;
if (_shadow){
_shadow.bitmapData.dispose();
};
_shadow = null;
if (BOSS){
Game.getInstance().unlinkBossBar();
};
_locators = null;
hidden++;
_hidden = true;
};
}
public function getClip(){
return (_mc);
}
public function get isBlink():Boolean{
return (!((_blinksLeft == 0)));
}
protected function setHealth(health:int, points:int):void{
_startingHealth = health;
POINTS = (points) ? points : health;
HEALTH = (health + (20 * Settings.level));
}
public function center():void{
if (_mc){
_mc.gotoAndStop(1);
createShadow();
};
}
public function fixHealthByLevel():void{
}
public function setClip(newMC):void{
var locIndex:int;
var i:int;
if ((newMC is MovieClip)){
_mc = newMC;
} else {
_mc = new MovieClip();
_mc.addChild(newMC);
};
createShadow();
precacheLocators(_mc);
addChild(_mc);
cacheAsBitmap = true;
if (_locators.length){
_timeline = new TimelineMax();
locIndex = 0;
while (locIndex < _locators.length) {
i = 0;
while (i < _extraSalvos) {
_timeline.addCallback(periodicFire, (_timeBetweenSalvos + (_timeBetweenLocators * (i + locIndex))), [locIndex]);
i++;
};
_timeline.repeat = _repeatFire;
locIndex++;
};
_timeline.play();
};
}
}
}//package moving
Section 142
//Moving__enemyShotClass (moving.Moving__enemyShotClass)
package moving {
import flash.display.*;
import mx.core.*;
public class Moving__enemyShotClass extends MovieClipAsset {
public var green:DisplayObject;
public var level:DisplayObject;
public var lives:DisplayObject;
public var saucer:DisplayObject;
public var mon:DisplayObject;
public var redspecial:DisplayObject;
public var bigred:DisplayObject;
public var score:DisplayObject;
public var submit:DisplayObject;
public var coins:DisplayObject;
public var soff:DisplayObject;
public var options:DisplayObject;
public var son:DisplayObject;
public var jet:DisplayObject;
public var jet2:DisplayObject;
public var red:DisplayObject;
public var bigred2:DisplayObject;
public var boat:DisplayObject;
public var input:DisplayObject;
public var wg:DisplayObject;
public var eject:DisplayObject;
public var plays1:DisplayObject;
public var plays2:DisplayObject;
public var more:DisplayObject;
public var ok:DisplayObject;
public var powerup:DisplayObject;
public var mine:DisplayObject;
public var bossBar:DisplayObject;
public var moff:DisplayObject;
public var shieldBar:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var go:DisplayObject;
public var dontsubmit:DisplayObject;
public var ibm:DisplayObject;
public var lifeBar:DisplayObject;
public var spawn:DisplayObject;
}
}//package moving
Section 143
//Moving__exhaustLocatorClass (moving.Moving__exhaustLocatorClass)
package moving {
import flash.display.*;
import mx.core.*;
public class Moving__exhaustLocatorClass extends SpriteAsset {
public var green:DisplayObject;
public var level:DisplayObject;
public var lives:DisplayObject;
public var saucer:DisplayObject;
public var mon:DisplayObject;
public var redspecial:DisplayObject;
public var bigred:DisplayObject;
public var score:DisplayObject;
public var submit:DisplayObject;
public var coins:DisplayObject;
public var soff:DisplayObject;
public var options:DisplayObject;
public var son:DisplayObject;
public var jet:DisplayObject;
public var jet2:DisplayObject;
public var red:DisplayObject;
public var bigred2:DisplayObject;
public var boat:DisplayObject;
public var input:DisplayObject;
public var wg:DisplayObject;
public var eject:DisplayObject;
public var plays1:DisplayObject;
public var plays2:DisplayObject;
public var more:DisplayObject;
public var ok:DisplayObject;
public var powerup:DisplayObject;
public var mine:DisplayObject;
public var bossBar:DisplayObject;
public var moff:DisplayObject;
public var shieldBar:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var go:DisplayObject;
public var dontsubmit:DisplayObject;
public var ibm:DisplayObject;
public var lifeBar:DisplayObject;
public var spawn:DisplayObject;
}
}//package moving
Section 144
//Moving__fireLocatorClass (moving.Moving__fireLocatorClass)
package moving {
import flash.display.*;
import mx.core.*;
public class Moving__fireLocatorClass extends SpriteAsset {
public var green:DisplayObject;
public var level:DisplayObject;
public var lives:DisplayObject;
public var saucer:DisplayObject;
public var mon:DisplayObject;
public var redspecial:DisplayObject;
public var bigred:DisplayObject;
public var score:DisplayObject;
public var submit:DisplayObject;
public var coins:DisplayObject;
public var soff:DisplayObject;
public var options:DisplayObject;
public var son:DisplayObject;
public var jet:DisplayObject;
public var jet2:DisplayObject;
public var red:DisplayObject;
public var bigred2:DisplayObject;
public var boat:DisplayObject;
public var input:DisplayObject;
public var wg:DisplayObject;
public var eject:DisplayObject;
public var plays1:DisplayObject;
public var plays2:DisplayObject;
public var more:DisplayObject;
public var ok:DisplayObject;
public var powerup:DisplayObject;
public var mine:DisplayObject;
public var bossBar:DisplayObject;
public var moff:DisplayObject;
public var shieldBar:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var go:DisplayObject;
public var dontsubmit:DisplayObject;
public var ibm:DisplayObject;
public var lifeBar:DisplayObject;
public var spawn:DisplayObject;
}
}//package moving
Section 145
//Moving__traceClass (moving.Moving__traceClass)
package moving {
import flash.display.*;
import mx.core.*;
public class Moving__traceClass extends MovieClipAsset {
public var green:DisplayObject;
public var level:DisplayObject;
public var lives:DisplayObject;
public var saucer:DisplayObject;
public var mon:DisplayObject;
public var redspecial:DisplayObject;
public var bigred:DisplayObject;
public var score:DisplayObject;
public var submit:DisplayObject;
public var coins:DisplayObject;
public var soff:DisplayObject;
public var options:DisplayObject;
public var son:DisplayObject;
public var jet:DisplayObject;
public var jet2:DisplayObject;
public var red:DisplayObject;
public var bigred2:DisplayObject;
public var boat:DisplayObject;
public var input:DisplayObject;
public var wg:DisplayObject;
public var eject:DisplayObject;
public var plays1:DisplayObject;
public var plays2:DisplayObject;
public var more:DisplayObject;
public var ok:DisplayObject;
public var powerup:DisplayObject;
public var mine:DisplayObject;
public var bossBar:DisplayObject;
public var moff:DisplayObject;
public var shieldBar:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var go:DisplayObject;
public var dontsubmit:DisplayObject;
public var ibm:DisplayObject;
public var lifeBar:DisplayObject;
public var spawn:DisplayObject;
}
}//package moving
Section 146
//BitmapAsset (mx.core.BitmapAsset)
package mx.core {
import flash.display.*;
public class BitmapAsset extends FlexBitmap implements IFlexAsset, IFlexDisplayObject {
mx_internal static const VERSION:String = "3.5.0.12683";
public function BitmapAsset(bitmapData:BitmapData=null, pixelSnapping:String="auto", smoothing:Boolean=false){
super(bitmapData, pixelSnapping, smoothing);
}
public function get measuredWidth():Number{
if (bitmapData){
return (bitmapData.width);
};
return (0);
}
public function get measuredHeight():Number{
if (bitmapData){
return (bitmapData.height);
};
return (0);
}
public function setActualSize(newWidth:Number, newHeight:Number):void{
width = newWidth;
height = newHeight;
}
public function move(x:Number, y:Number):void{
this.x = x;
this.y = y;
}
}
}//package mx.core
Section 147
//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.5.0.12683";
public static const EMPTY:EdgeMetrics = new EdgeMetrics(0, 0, 0, 0);
;
public function EdgeMetrics(left:Number=0, top:Number=0, right:Number=0, bottom:Number=0){
super();
this.left = left;
this.top = top;
this.right = right;
this.bottom = bottom;
}
public function clone():EdgeMetrics{
return (new EdgeMetrics(left, top, right, bottom));
}
}
}//package mx.core
Section 148
//FlexBitmap (mx.core.FlexBitmap)
package mx.core {
import flash.display.*;
import mx.utils.*;
public class FlexBitmap extends Bitmap {
mx_internal static const VERSION:String = "3.5.0.12683";
public function FlexBitmap(bitmapData:BitmapData=null, pixelSnapping:String="auto", smoothing:Boolean=false){
var bitmapData = bitmapData;
var pixelSnapping = pixelSnapping;
var smoothing = smoothing;
super(bitmapData, pixelSnapping, smoothing);
name = NameUtil.createUniqueName(this);
//unresolved jump
var _slot1 = e;
}
override public function toString():String{
return (NameUtil.displayObjectToString(this));
}
}
}//package mx.core
Section 149
//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.5.0.12683";
public function FlexMovieClip(){
super();
name = NameUtil.createUniqueName(this);
//unresolved jump
var _slot1 = e;
}
override public function toString():String{
return (NameUtil.displayObjectToString(this));
}
}
}//package mx.core
Section 150
//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.5.0.12683";
public function FlexSprite(){
super();
name = NameUtil.createUniqueName(this);
//unresolved jump
var _slot1 = e;
}
override public function toString():String{
return (NameUtil.displayObjectToString(this));
}
}
}//package mx.core
Section 151
//FontAsset (mx.core.FontAsset)
package mx.core {
import flash.text.*;
public class FontAsset extends Font implements IFlexAsset {
mx_internal static const VERSION:String = "3.5.0.12683";
public function FontAsset(){
super();
}
}
}//package mx.core
Section 152
//IBorder (mx.core.IBorder)
package mx.core {
public interface IBorder {
function get borderMetrics():EdgeMetrics;
}
}//package mx.core
Section 153
//IFlexAsset (mx.core.IFlexAsset)
package mx.core {
public interface IFlexAsset {
}
}//package mx.core
Section 154
//IFlexDisplayObject (mx.core.IFlexDisplayObject)
package mx.core {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.accessibility.*;
public interface IFlexDisplayObject extends IBitmapDrawable, IEventDispatcher {
function get visible():Boolean;
function get rotation():Number;
function localToGlobal(void:Point):Point;
function get name():String;
function set width(flash.display:Number):void;
function get measuredHeight():Number;
function get blendMode():String;
function get scale9Grid():Rectangle;
function set name(flash.display:String):void;
function set scaleX(flash.display:Number):void;
function set scaleY(flash.display:Number):void;
function get measuredWidth():Number;
function get accessibilityProperties():AccessibilityProperties;
function set scrollRect(flash.display:Rectangle):void;
function get cacheAsBitmap():Boolean;
function globalToLocal(void:Point):Point;
function get height():Number;
function set blendMode(flash.display:String):void;
function get parent():DisplayObjectContainer;
function getBounds(String:DisplayObject):Rectangle;
function get opaqueBackground():Object;
function set scale9Grid(flash.display:Rectangle):void;
function setActualSize(_arg1:Number, _arg2:Number):void;
function set alpha(flash.display:Number):void;
function set accessibilityProperties(flash.display:AccessibilityProperties):void;
function get width():Number;
function hitTestPoint(_arg1:Number, _arg2:Number, _arg3:Boolean=false):Boolean;
function set cacheAsBitmap(flash.display:Boolean):void;
function get scaleX():Number;
function get scaleY():Number;
function get scrollRect():Rectangle;
function get mouseX():Number;
function get mouseY():Number;
function set height(flash.display:Number):void;
function set mask(flash.display:DisplayObject):void;
function getRect(String:DisplayObject):Rectangle;
function get alpha():Number;
function set transform(flash.display:Transform):void;
function move(_arg1:Number, _arg2:Number):void;
function get loaderInfo():LoaderInfo;
function get root():DisplayObject;
function hitTestObject(mx.core:IFlexDisplayObject/mx.core:IFlexDisplayObject:stage/get:DisplayObject):Boolean;
function set opaqueBackground(flash.display:Object):void;
function set visible(flash.display:Boolean):void;
function get mask():DisplayObject;
function set x(flash.display:Number):void;
function set y(flash.display:Number):void;
function get transform():Transform;
function set filters(flash.display:Array):void;
function get x():Number;
function get y():Number;
function get filters():Array;
function set rotation(flash.display:Number):void;
function get stage():Stage;
}
}//package mx.core
Section 155
//IRepeaterClient (mx.core.IRepeaterClient)
package mx.core {
public interface IRepeaterClient {
function get instanceIndices():Array;
function set instanceIndices(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;IRepeaterClient.as:Array):void;
function get isDocument():Boolean;
function set repeaters(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;IRepeaterClient.as:Array):void;
function initializeRepeaterArrays(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;IRepeaterClient.as:IRepeaterClient):void;
function get repeaters():Array;
function set repeaterIndices(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;IRepeaterClient.as:Array):void;
function get repeaterIndices():Array;
}
}//package mx.core
Section 156
//MovieClipAsset (mx.core.MovieClipAsset)
package mx.core {
public class MovieClipAsset extends FlexMovieClip implements IFlexAsset, IFlexDisplayObject, IBorder {
private var _measuredHeight:Number;
private var _measuredWidth:Number;
mx_internal static const VERSION:String = "3.5.0.12683";
public function MovieClipAsset(){
super();
_measuredWidth = width;
_measuredHeight = height;
}
public function get measuredWidth():Number{
return (_measuredWidth);
}
public function get measuredHeight():Number{
return (_measuredHeight);
}
public function setActualSize(newWidth:Number, newHeight:Number):void{
width = newWidth;
height = newHeight;
}
public function move(x:Number, y:Number):void{
this.x = x;
this.y = y;
}
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 157
//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 158
//SoundAsset (mx.core.SoundAsset)
package mx.core {
import flash.media.*;
public class SoundAsset extends Sound implements IFlexAsset {
mx_internal static const VERSION:String = "3.5.0.12683";
public function SoundAsset(){
super();
}
}
}//package mx.core
Section 159
//SpriteAsset (mx.core.SpriteAsset)
package mx.core {
public class SpriteAsset extends FlexSprite implements IFlexAsset, IFlexDisplayObject, IBorder {
private var _measuredHeight:Number;
private var _measuredWidth:Number;
mx_internal static const VERSION:String = "3.5.0.12683";
public function SpriteAsset(){
super();
_measuredWidth = width;
_measuredHeight = height;
}
public function get measuredWidth():Number{
return (_measuredWidth);
}
public function get measuredHeight():Number{
return (_measuredHeight);
}
public function setActualSize(newWidth:Number, newHeight:Number):void{
width = newWidth;
height = newHeight;
}
public function move(x:Number, y:Number):void{
this.x = x;
this.y = y;
}
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 160
//NameUtil (mx.utils.NameUtil)
package mx.utils {
import flash.display.*;
import mx.core.*;
import flash.utils.*;
public class NameUtil {
mx_internal static const VERSION:String = "3.5.0.12683";
private static var counter:int = 0;
public function NameUtil(){
super();
}
public static function displayObjectToString(displayObject:DisplayObject):String{
var result:String;
var o:DisplayObject;
var s:String;
var indices:Array;
var displayObject = displayObject;
o = displayObject;
while (o != null) {
if (((((o.parent) && (o.stage))) && ((o.parent == o.stage)))){
break;
};
s = o.name;
if ((o is IRepeaterClient)){
indices = IRepeaterClient(o).instanceIndices;
if (indices){
s = (s + (("[" + indices.join("][")) + "]"));
};
};
result = ((result == null)) ? s : ((s + ".") + result);
o = o.parent;
};
//unresolved jump
var _slot1 = e;
return (result);
}
public static function createUniqueName(object:Object):String{
if (!object){
return (null);
};
var name:String = getQualifiedClassName(object);
var index:int = name.indexOf("::");
if (index != -1){
name = name.substr((index + 2));
};
var charCode:int = name.charCodeAt((name.length - 1));
if ((((charCode >= 48)) && ((charCode <= 57)))){
name = (name + "_");
};
return ((name + counter++));
}
}
}//package mx.utils
Section 161
//SoundManager (soundmanager.SoundManager)
package soundmanager {
import flash.media.*;
public final class SoundManager {
private var _missileShot:Class;
private var _hitClass:Class;
private var _rico1Class:Class;
private var _soundEnabled:Boolean;// = true
private var ShotSound:Class;
private var _rico2Class:Class;
private var UfoEngineSound:Class;
private var _engineSound:Class;
private var _silenceClass:Class;
private var _musicEnabled:Boolean;// = true
private var _bonusClass:Class;
private var _rico3Class:Class;
private var ExplosionSound1:Class;
private var ExplosionSound2:Class;
private var ExplosionSound3:Class;
private var _lifeBonusSound:Class;
private var _musicClass:Class;
private var _powerupSound:Class;
private var UfoShotSound:Class;
private var _musicChannel:SoundChannel;
private static var _instance:SoundManager;
public function SoundManager(){
_musicClass = SoundManager__musicClass;
_silenceClass = SoundManager__silenceClass;
_missileShot = SoundManager__missileShot;
_hitClass = SoundManager__hitClass;
_bonusClass = SoundManager__bonusClass;
_lifeBonusSound = SoundManager__lifeBonusSound;
_powerupSound = SoundManager__powerupSound;
_engineSound = SoundManager__engineSound;
UfoEngineSound = SoundManager_UfoEngineSound;
UfoShotSound = SoundManager_UfoShotSound;
ShotSound = SoundManager_ShotSound;
ExplosionSound1 = SoundManager_ExplosionSound1;
ExplosionSound2 = SoundManager_ExplosionSound2;
ExplosionSound3 = SoundManager_ExplosionSound3;
_rico1Class = SoundManager__rico1Class;
_rico2Class = SoundManager__rico2Class;
_rico3Class = SoundManager__rico3Class;
super();
_instance = this;
}
public function exlposion():void{
var sounds:Array;
var _class:Class;
if (_soundEnabled){
sounds = [ExplosionSound1, ExplosionSound2, ExplosionSound3];
_class = sounds[int((Math.random() * 2))];
Sound(new (_class)).play();
};
}
public function coin():void{
if (_soundEnabled){
Sound(new _lifeBonusSound()).play();
};
}
public function shoot():void{
if (_soundEnabled){
Sound(new ShotSound()).play();
};
}
public function bonus():void{
if (_soundEnabled){
Sound(new _bonusClass()).play();
};
}
public function get soundEnabled():Boolean{
return (_soundEnabled);
}
public function set musicEnabled(enable:Boolean):void{
_musicEnabled = enable;
playMusic();
trace(("music " + (_musicEnabled) ? "on" : "off"));
}
public function playMusic():void{
if (_musicChannel){
_musicChannel.stop();
};
_musicChannel = (_musicEnabled) ? (new _musicClass() as Sound).play(0, 999) : (new _silenceClass() as Sound).play(0, 999);
}
public function powerup():void{
if (_soundEnabled){
Sound(new _powerupSound()).play();
};
}
public function rico():void{
var sounds:Array;
var _class:Class;
if (_soundEnabled){
sounds = [_rico1Class, _rico2Class, _rico3Class, _rico1Class, _rico3Class];
_class = sounds[int((Math.random() * 4))];
Sound(new (_class)).play();
};
}
public function set soundEnabled(enable:Boolean):void{
_soundEnabled = enable;
trace(("sound " + (_soundEnabled) ? "on" : "off"));
}
public function get musicEnabled():Boolean{
return (_musicEnabled);
}
public static function getInstance():SoundManager{
return ((_instance) ? _instance : new (SoundManager));
}
}
}//package soundmanager
Section 162
//SoundManager__bonusClass (soundmanager.SoundManager__bonusClass)
package soundmanager {
import flash.display.*;
import mx.core.*;
public class SoundManager__bonusClass extends SoundAsset {
public var green:DisplayObject;
public var level:DisplayObject;
public var lives:DisplayObject;
public var saucer:DisplayObject;
public var mon:DisplayObject;
public var redspecial:DisplayObject;
public var bigred:DisplayObject;
public var score:DisplayObject;
public var submit:DisplayObject;
public var coins:DisplayObject;
public var soff:DisplayObject;
public var options:DisplayObject;
public var son:DisplayObject;
public var jet:DisplayObject;
public var jet2:DisplayObject;
public var red:DisplayObject;
public var bigred2:DisplayObject;
public var boat:DisplayObject;
public var input:DisplayObject;
public var wg:DisplayObject;
public var eject:DisplayObject;
public var plays1:DisplayObject;
public var plays2:DisplayObject;
public var more:DisplayObject;
public var ok:DisplayObject;
public var powerup:DisplayObject;
public var mine:DisplayObject;
public var bossBar:DisplayObject;
public var moff:DisplayObject;
public var shieldBar:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var go:DisplayObject;
public var dontsubmit:DisplayObject;
public var ibm:DisplayObject;
public var lifeBar:DisplayObject;
public var spawn:DisplayObject;
}
}//package soundmanager
Section 163
//SoundManager__engineSound (soundmanager.SoundManager__engineSound)
package soundmanager {
import flash.display.*;
import mx.core.*;
public class SoundManager__engineSound extends SoundAsset {
public var green:DisplayObject;
public var level:DisplayObject;
public var lives:DisplayObject;
public var saucer:DisplayObject;
public var mon:DisplayObject;
public var redspecial:DisplayObject;
public var bigred:DisplayObject;
public var score:DisplayObject;
public var submit:DisplayObject;
public var coins:DisplayObject;
public var soff:DisplayObject;
public var options:DisplayObject;
public var son:DisplayObject;
public var jet:DisplayObject;
public var jet2:DisplayObject;
public var red:DisplayObject;
public var bigred2:DisplayObject;
public var boat:DisplayObject;
public var input:DisplayObject;
public var wg:DisplayObject;
public var eject:DisplayObject;
public var plays1:DisplayObject;
public var plays2:DisplayObject;
public var more:DisplayObject;
public var ok:DisplayObject;
public var powerup:DisplayObject;
public var mine:DisplayObject;
public var bossBar:DisplayObject;
public var moff:DisplayObject;
public var shieldBar:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var go:DisplayObject;
public var dontsubmit:DisplayObject;
public var ibm:DisplayObject;
public var lifeBar:DisplayObject;
public var spawn:DisplayObject;
}
}//package soundmanager
Section 164
//SoundManager__hitClass (soundmanager.SoundManager__hitClass)
package soundmanager {
import flash.display.*;
import mx.core.*;
public class SoundManager__hitClass extends SoundAsset {
public var green:DisplayObject;
public var level:DisplayObject;
public var lives:DisplayObject;
public var saucer:DisplayObject;
public var mon:DisplayObject;
public var redspecial:DisplayObject;
public var bigred:DisplayObject;
public var score:DisplayObject;
public var submit:DisplayObject;
public var coins:DisplayObject;
public var soff:DisplayObject;
public var options:DisplayObject;
public var son:DisplayObject;
public var jet:DisplayObject;
public var jet2:DisplayObject;
public var red:DisplayObject;
public var bigred2:DisplayObject;
public var boat:DisplayObject;
public var input:DisplayObject;
public var wg:DisplayObject;
public var eject:DisplayObject;
public var plays1:DisplayObject;
public var plays2:DisplayObject;
public var more:DisplayObject;
public var ok:DisplayObject;
public var powerup:DisplayObject;
public var mine:DisplayObject;
public var bossBar:DisplayObject;
public var moff:DisplayObject;
public var shieldBar:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var go:DisplayObject;
public var dontsubmit:DisplayObject;
public var ibm:DisplayObject;
public var lifeBar:DisplayObject;
public var spawn:DisplayObject;
}
}//package soundmanager
Section 165
//SoundManager__lifeBonusSound (soundmanager.SoundManager__lifeBonusSound)
package soundmanager {
import flash.display.*;
import mx.core.*;
public class SoundManager__lifeBonusSound extends SoundAsset {
public var green:DisplayObject;
public var level:DisplayObject;
public var lives:DisplayObject;
public var saucer:DisplayObject;
public var mon:DisplayObject;
public var redspecial:DisplayObject;
public var bigred:DisplayObject;
public var score:DisplayObject;
public var submit:DisplayObject;
public var coins:DisplayObject;
public var soff:DisplayObject;
public var options:DisplayObject;
public var son:DisplayObject;
public var jet:DisplayObject;
public var jet2:DisplayObject;
public var red:DisplayObject;
public var bigred2:DisplayObject;
public var boat:DisplayObject;
public var input:DisplayObject;
public var wg:DisplayObject;
public var eject:DisplayObject;
public var plays1:DisplayObject;
public var plays2:DisplayObject;
public var more:DisplayObject;
public var ok:DisplayObject;
public var powerup:DisplayObject;
public var mine:DisplayObject;
public var bossBar:DisplayObject;
public var moff:DisplayObject;
public var shieldBar:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var go:DisplayObject;
public var dontsubmit:DisplayObject;
public var ibm:DisplayObject;
public var lifeBar:DisplayObject;
public var spawn:DisplayObject;
}
}//package soundmanager
Section 166
//SoundManager__missileShot (soundmanager.SoundManager__missileShot)
package soundmanager {
import flash.display.*;
import mx.core.*;
public class SoundManager__missileShot extends SoundAsset {
public var green:DisplayObject;
public var level:DisplayObject;
public var lives:DisplayObject;
public var saucer:DisplayObject;
public var mon:DisplayObject;
public var redspecial:DisplayObject;
public var bigred:DisplayObject;
public var score:DisplayObject;
public var submit:DisplayObject;
public var coins:DisplayObject;
public var soff:DisplayObject;
public var options:DisplayObject;
public var son:DisplayObject;
public var jet:DisplayObject;
public var jet2:DisplayObject;
public var red:DisplayObject;
public var bigred2:DisplayObject;
public var boat:DisplayObject;
public var input:DisplayObject;
public var wg:DisplayObject;
public var eject:DisplayObject;
public var plays1:DisplayObject;
public var plays2:DisplayObject;
public var more:DisplayObject;
public var ok:DisplayObject;
public var powerup:DisplayObject;
public var mine:DisplayObject;
public var bossBar:DisplayObject;
public var moff:DisplayObject;
public var shieldBar:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var go:DisplayObject;
public var dontsubmit:DisplayObject;
public var ibm:DisplayObject;
public var lifeBar:DisplayObject;
public var spawn:DisplayObject;
}
}//package soundmanager
Section 167
//SoundManager__musicClass (soundmanager.SoundManager__musicClass)
package soundmanager {
import mx.core.*;
public class SoundManager__musicClass extends SoundAsset {
}
}//package soundmanager
Section 168
//SoundManager__powerupSound (soundmanager.SoundManager__powerupSound)
package soundmanager {
import flash.display.*;
import mx.core.*;
public class SoundManager__powerupSound extends SoundAsset {
public var green:DisplayObject;
public var level:DisplayObject;
public var lives:DisplayObject;
public var saucer:DisplayObject;
public var mon:DisplayObject;
public var redspecial:DisplayObject;
public var bigred:DisplayObject;
public var score:DisplayObject;
public var submit:DisplayObject;
public var coins:DisplayObject;
public var soff:DisplayObject;
public var options:DisplayObject;
public var son:DisplayObject;
public var jet:DisplayObject;
public var jet2:DisplayObject;
public var red:DisplayObject;
public var bigred2:DisplayObject;
public var boat:DisplayObject;
public var input:DisplayObject;
public var wg:DisplayObject;
public var eject:DisplayObject;
public var plays1:DisplayObject;
public var plays2:DisplayObject;
public var more:DisplayObject;
public var ok:DisplayObject;
public var powerup:DisplayObject;
public var mine:DisplayObject;
public var bossBar:DisplayObject;
public var moff:DisplayObject;
public var shieldBar:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var go:DisplayObject;
public var dontsubmit:DisplayObject;
public var ibm:DisplayObject;
public var lifeBar:DisplayObject;
public var spawn:DisplayObject;
}
}//package soundmanager
Section 169
//SoundManager__rico1Class (soundmanager.SoundManager__rico1Class)
package soundmanager {
import flash.display.*;
import mx.core.*;
public class SoundManager__rico1Class extends SoundAsset {
public var green:DisplayObject;
public var level:DisplayObject;
public var lives:DisplayObject;
public var saucer:DisplayObject;
public var mon:DisplayObject;
public var redspecial:DisplayObject;
public var bigred:DisplayObject;
public var score:DisplayObject;
public var submit:DisplayObject;
public var coins:DisplayObject;
public var soff:DisplayObject;
public var options:DisplayObject;
public var son:DisplayObject;
public var jet:DisplayObject;
public var jet2:DisplayObject;
public var red:DisplayObject;
public var bigred2:DisplayObject;
public var boat:DisplayObject;
public var input:DisplayObject;
public var wg:DisplayObject;
public var eject:DisplayObject;
public var plays1:DisplayObject;
public var plays2:DisplayObject;
public var more:DisplayObject;
public var ok:DisplayObject;
public var powerup:DisplayObject;
public var mine:DisplayObject;
public var bossBar:DisplayObject;
public var moff:DisplayObject;
public var shieldBar:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var go:DisplayObject;
public var dontsubmit:DisplayObject;
public var ibm:DisplayObject;
public var lifeBar:DisplayObject;
public var spawn:DisplayObject;
}
}//package soundmanager
Section 170
//SoundManager__rico2Class (soundmanager.SoundManager__rico2Class)
package soundmanager {
import flash.display.*;
import mx.core.*;
public class SoundManager__rico2Class extends SoundAsset {
public var green:DisplayObject;
public var level:DisplayObject;
public var lives:DisplayObject;
public var saucer:DisplayObject;
public var mon:DisplayObject;
public var redspecial:DisplayObject;
public var bigred:DisplayObject;
public var score:DisplayObject;
public var submit:DisplayObject;
public var coins:DisplayObject;
public var soff:DisplayObject;
public var options:DisplayObject;
public var son:DisplayObject;
public var jet:DisplayObject;
public var jet2:DisplayObject;
public var red:DisplayObject;
public var bigred2:DisplayObject;
public var boat:DisplayObject;
public var input:DisplayObject;
public var wg:DisplayObject;
public var eject:DisplayObject;
public var plays1:DisplayObject;
public var plays2:DisplayObject;
public var more:DisplayObject;
public var ok:DisplayObject;
public var powerup:DisplayObject;
public var mine:DisplayObject;
public var bossBar:DisplayObject;
public var moff:DisplayObject;
public var shieldBar:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var go:DisplayObject;
public var dontsubmit:DisplayObject;
public var ibm:DisplayObject;
public var lifeBar:DisplayObject;
public var spawn:DisplayObject;
}
}//package soundmanager
Section 171
//SoundManager__rico3Class (soundmanager.SoundManager__rico3Class)
package soundmanager {
import flash.display.*;
import mx.core.*;
public class SoundManager__rico3Class extends SoundAsset {
public var green:DisplayObject;
public var level:DisplayObject;
public var lives:DisplayObject;
public var saucer:DisplayObject;
public var mon:DisplayObject;
public var redspecial:DisplayObject;
public var bigred:DisplayObject;
public var score:DisplayObject;
public var submit:DisplayObject;
public var coins:DisplayObject;
public var soff:DisplayObject;
public var options:DisplayObject;
public var son:DisplayObject;
public var jet:DisplayObject;
public var jet2:DisplayObject;
public var red:DisplayObject;
public var bigred2:DisplayObject;
public var boat:DisplayObject;
public var input:DisplayObject;
public var wg:DisplayObject;
public var eject:DisplayObject;
public var plays1:DisplayObject;
public var plays2:DisplayObject;
public var more:DisplayObject;
public var ok:DisplayObject;
public var powerup:DisplayObject;
public var mine:DisplayObject;
public var bossBar:DisplayObject;
public var moff:DisplayObject;
public var shieldBar:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var go:DisplayObject;
public var dontsubmit:DisplayObject;
public var ibm:DisplayObject;
public var lifeBar:DisplayObject;
public var spawn:DisplayObject;
}
}//package soundmanager
Section 172
//SoundManager__silenceClass (soundmanager.SoundManager__silenceClass)
package soundmanager {
import mx.core.*;
public class SoundManager__silenceClass extends SoundAsset {
}
}//package soundmanager
Section 173
//SoundManager_ExplosionSound1 (soundmanager.SoundManager_ExplosionSound1)
package soundmanager {
import flash.display.*;
import mx.core.*;
public class SoundManager_ExplosionSound1 extends SoundAsset {
public var green:DisplayObject;
public var level:DisplayObject;
public var lives:DisplayObject;
public var saucer:DisplayObject;
public var mon:DisplayObject;
public var redspecial:DisplayObject;
public var bigred:DisplayObject;
public var score:DisplayObject;
public var submit:DisplayObject;
public var coins:DisplayObject;
public var soff:DisplayObject;
public var options:DisplayObject;
public var son:DisplayObject;
public var jet:DisplayObject;
public var jet2:DisplayObject;
public var red:DisplayObject;
public var bigred2:DisplayObject;
public var boat:DisplayObject;
public var input:DisplayObject;
public var wg:DisplayObject;
public var eject:DisplayObject;
public var plays1:DisplayObject;
public var plays2:DisplayObject;
public var more:DisplayObject;
public var ok:DisplayObject;
public var powerup:DisplayObject;
public var mine:DisplayObject;
public var bossBar:DisplayObject;
public var moff:DisplayObject;
public var shieldBar:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var go:DisplayObject;
public var dontsubmit:DisplayObject;
public var ibm:DisplayObject;
public var lifeBar:DisplayObject;
public var spawn:DisplayObject;
}
}//package soundmanager
Section 174
//SoundManager_ExplosionSound2 (soundmanager.SoundManager_ExplosionSound2)
package soundmanager {
import flash.display.*;
import mx.core.*;
public class SoundManager_ExplosionSound2 extends SoundAsset {
public var green:DisplayObject;
public var level:DisplayObject;
public var lives:DisplayObject;
public var saucer:DisplayObject;
public var mon:DisplayObject;
public var redspecial:DisplayObject;
public var bigred:DisplayObject;
public var score:DisplayObject;
public var submit:DisplayObject;
public var coins:DisplayObject;
public var soff:DisplayObject;
public var options:DisplayObject;
public var son:DisplayObject;
public var jet:DisplayObject;
public var jet2:DisplayObject;
public var red:DisplayObject;
public var bigred2:DisplayObject;
public var boat:DisplayObject;
public var input:DisplayObject;
public var wg:DisplayObject;
public var eject:DisplayObject;
public var plays1:DisplayObject;
public var plays2:DisplayObject;
public var more:DisplayObject;
public var ok:DisplayObject;
public var powerup:DisplayObject;
public var mine:DisplayObject;
public var bossBar:DisplayObject;
public var moff:DisplayObject;
public var shieldBar:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var go:DisplayObject;
public var dontsubmit:DisplayObject;
public var ibm:DisplayObject;
public var lifeBar:DisplayObject;
public var spawn:DisplayObject;
}
}//package soundmanager
Section 175
//SoundManager_ExplosionSound3 (soundmanager.SoundManager_ExplosionSound3)
package soundmanager {
import flash.display.*;
import mx.core.*;
public class SoundManager_ExplosionSound3 extends SoundAsset {
public var green:DisplayObject;
public var level:DisplayObject;
public var lives:DisplayObject;
public var saucer:DisplayObject;
public var mon:DisplayObject;
public var redspecial:DisplayObject;
public var bigred:DisplayObject;
public var score:DisplayObject;
public var submit:DisplayObject;
public var coins:DisplayObject;
public var soff:DisplayObject;
public var options:DisplayObject;
public var son:DisplayObject;
public var jet:DisplayObject;
public var jet2:DisplayObject;
public var red:DisplayObject;
public var bigred2:DisplayObject;
public var boat:DisplayObject;
public var input:DisplayObject;
public var wg:DisplayObject;
public var eject:DisplayObject;
public var plays1:DisplayObject;
public var plays2:DisplayObject;
public var more:DisplayObject;
public var ok:DisplayObject;
public var powerup:DisplayObject;
public var mine:DisplayObject;
public var bossBar:DisplayObject;
public var moff:DisplayObject;
public var shieldBar:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var go:DisplayObject;
public var dontsubmit:DisplayObject;
public var ibm:DisplayObject;
public var lifeBar:DisplayObject;
public var spawn:DisplayObject;
}
}//package soundmanager
Section 176
//SoundManager_ShotSound (soundmanager.SoundManager_ShotSound)
package soundmanager {
import flash.display.*;
import mx.core.*;
public class SoundManager_ShotSound extends SoundAsset {
public var green:DisplayObject;
public var level:DisplayObject;
public var lives:DisplayObject;
public var saucer:DisplayObject;
public var mon:DisplayObject;
public var redspecial:DisplayObject;
public var bigred:DisplayObject;
public var score:DisplayObject;
public var submit:DisplayObject;
public var coins:DisplayObject;
public var soff:DisplayObject;
public var options:DisplayObject;
public var son:DisplayObject;
public var jet:DisplayObject;
public var jet2:DisplayObject;
public var red:DisplayObject;
public var bigred2:DisplayObject;
public var boat:DisplayObject;
public var input:DisplayObject;
public var wg:DisplayObject;
public var eject:DisplayObject;
public var plays1:DisplayObject;
public var plays2:DisplayObject;
public var more:DisplayObject;
public var ok:DisplayObject;
public var powerup:DisplayObject;
public var mine:DisplayObject;
public var bossBar:DisplayObject;
public var moff:DisplayObject;
public var shieldBar:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var go:DisplayObject;
public var dontsubmit:DisplayObject;
public var ibm:DisplayObject;
public var lifeBar:DisplayObject;
public var spawn:DisplayObject;
}
}//package soundmanager
Section 177
//SoundManager_UfoEngineSound (soundmanager.SoundManager_UfoEngineSound)
package soundmanager {
import flash.display.*;
import mx.core.*;
public class SoundManager_UfoEngineSound extends SoundAsset {
public var green:DisplayObject;
public var level:DisplayObject;
public var lives:DisplayObject;
public var saucer:DisplayObject;
public var mon:DisplayObject;
public var redspecial:DisplayObject;
public var bigred:DisplayObject;
public var score:DisplayObject;
public var submit:DisplayObject;
public var coins:DisplayObject;
public var soff:DisplayObject;
public var options:DisplayObject;
public var son:DisplayObject;
public var jet:DisplayObject;
public var jet2:DisplayObject;
public var red:DisplayObject;
public var bigred2:DisplayObject;
public var boat:DisplayObject;
public var input:DisplayObject;
public var wg:DisplayObject;
public var eject:DisplayObject;
public var plays1:DisplayObject;
public var plays2:DisplayObject;
public var more:DisplayObject;
public var ok:DisplayObject;
public var powerup:DisplayObject;
public var mine:DisplayObject;
public var bossBar:DisplayObject;
public var moff:DisplayObject;
public var shieldBar:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var go:DisplayObject;
public var dontsubmit:DisplayObject;
public var ibm:DisplayObject;
public var lifeBar:DisplayObject;
public var spawn:DisplayObject;
}
}//package soundmanager
Section 178
//SoundManager_UfoShotSound (soundmanager.SoundManager_UfoShotSound)
package soundmanager {
import flash.display.*;
import mx.core.*;
public class SoundManager_UfoShotSound extends SoundAsset {
public var green:DisplayObject;
public var level:DisplayObject;
public var lives:DisplayObject;
public var saucer:DisplayObject;
public var mon:DisplayObject;
public var redspecial:DisplayObject;
public var bigred:DisplayObject;
public var score:DisplayObject;
public var submit:DisplayObject;
public var coins:DisplayObject;
public var soff:DisplayObject;
public var options:DisplayObject;
public var son:DisplayObject;
public var jet:DisplayObject;
public var jet2:DisplayObject;
public var red:DisplayObject;
public var bigred2:DisplayObject;
public var boat:DisplayObject;
public var input:DisplayObject;
public var wg:DisplayObject;
public var eject:DisplayObject;
public var plays1:DisplayObject;
public var plays2:DisplayObject;
public var more:DisplayObject;
public var ok:DisplayObject;
public var powerup:DisplayObject;
public var mine:DisplayObject;
public var bossBar:DisplayObject;
public var moff:DisplayObject;
public var shieldBar:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var go:DisplayObject;
public var dontsubmit:DisplayObject;
public var ibm:DisplayObject;
public var lifeBar:DisplayObject;
public var spawn:DisplayObject;
}
}//package soundmanager
Section 179
//Config (statics.Config)
package statics {
import soundmanager.*;
import flash.net.*;
import com.utils.*;
public class Config {
private const version:String = "1.012";
private const cookieName:String = "SKYLARK303";
public var name:String;// = "ANONYMOUS"
private var so:SharedObject;
private static var _instance:Config;
public function Config(){
super();
_instance = this;
so = SharedObject.getLocal(cookieName);
Debug.dump(so.data, "so.data");
if (((so.data.version) && ((so.data.version == version)))){
name = so.data.name;
SoundManager.getInstance().soundEnabled = so.data.sound;
SoundManager.getInstance().musicEnabled = so.data.music;
} else {
SoundManager.getInstance().musicEnabled = true;
SoundManager.getInstance().soundEnabled = true;
flush();
};
}
public function flush():void{
trace("flush");
so.data.music = SoundManager.getInstance().musicEnabled;
so.data.sound = SoundManager.getInstance().soundEnabled;
so.data.name = name;
so.data.version = version;
so.flush();
//unresolved jump
var _slot1 = e;
trace("cannot flush (!)", _slot1);
}
public static function getInstance():Config{
return ((_instance) ? _instance : new (Config));
}
}
}//package statics
Section 180
//ObjFactory (statics.ObjFactory)
package statics {
import flash.display.*;
import moving.*;
import moving.enemys.bonus.*;
import moving.enemys.*;
public class ObjFactory {
private static var _bonusClass:Class = ObjFactory__bonusClass;
private static var _spawnClass:Class = ObjFactory__spawnClass;
private static var _coinClass:Class = ObjFactory__coinClass;
public function ObjFactory(){
super();
}
public static function create(child:DisplayObject):Moving{
var object:Moving;
var _local3:Array;
var _local4:int;
if ((child is _bonusClass)){
switch (child.name){
case "any":
_local3 = [BonusBoom, BonusHealth, BonusLife, BonusPowerup, BonusShield, BonusHealth, BonusPowerup, BonusShield];
_local4 = (Math.random() * (_local3.length - 1));
object = new (_local3[_local4]);
break;
case "boom":
object = new BonusBoom();
break;
case "health":
object = new BonusHealth();
break;
case "shield":
object = new BonusShield();
break;
case "powerup":
default:
object = new BonusPowerup();
};
} else {
if ((child is _coinClass)){
object = new Coin();
} else {
if ((child is _spawnClass)){
switch (child.name){
case "bigred":
object = new BigRed();
break;
case "bigred2":
object = new BigRed2();
break;
case "boat":
object = new Boat();
break;
case "boss":
object = new Boss();
break;
case "green":
object = new Green();
break;
case "ibm":
object = new Ibm();
break;
case "jet":
object = new Jet();
break;
case "jet2":
object = new Jet2();
break;
case "mine":
object = new Mine();
break;
case "red":
object = new Red();
break;
case "redspecial":
object = new RedSpecial();
break;
case "saucer":
object = new Saucer();
break;
case "blue":
default:
object = new Blue();
};
};
};
};
object.name = child.name;
object.x = child.x;
if (object.y < 100){
object.y = -(object.height);
} else {
trace("created object y", object.y);
};
return (object);
}
public static function createPowerup():Moving{
var object:Moving;
object = new BonusPowerup();
object.x = (250 + (Math.random() * 250));
object.y = -50;
return (object);
}
public static function createRandomBonus(x:Number, y:Number):Moving{
var classes:Array = [BonusShield, BonusHealth, BonusHealth, BonusShield, BonusBoom, BonusShield, BonusHealth, BonusBoom, BonusHealth, BonusLife];
var bonusClass:Class = classes[int(((Math.random() * classes.length) - 1))];
var object:Moving = new (bonusClass);
object.x = x;
object.y = y;
return (object);
}
public static function willDo(testObject:DisplayObject):Boolean{
return ((((((testObject is _bonusClass)) || ((testObject is _coinClass)))) || ((testObject is _spawnClass))));
}
}
}//package statics
Section 181
//ObjFactory__bonusClass (statics.ObjFactory__bonusClass)
package statics {
import flash.display.*;
import mx.core.*;
public class ObjFactory__bonusClass extends SpriteAsset {
public var green:DisplayObject;
public var level:DisplayObject;
public var lives:DisplayObject;
public var saucer:DisplayObject;
public var mon:DisplayObject;
public var redspecial:DisplayObject;
public var bigred:DisplayObject;
public var score:DisplayObject;
public var submit:DisplayObject;
public var coins:DisplayObject;
public var soff:DisplayObject;
public var options:DisplayObject;
public var son:DisplayObject;
public var jet:DisplayObject;
public var jet2:DisplayObject;
public var red:DisplayObject;
public var bigred2:DisplayObject;
public var boat:DisplayObject;
public var input:DisplayObject;
public var wg:DisplayObject;
public var eject:DisplayObject;
public var plays1:DisplayObject;
public var plays2:DisplayObject;
public var more:DisplayObject;
public var ok:DisplayObject;
public var powerup:DisplayObject;
public var mine:DisplayObject;
public var bossBar:DisplayObject;
public var moff:DisplayObject;
public var shieldBar:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var go:DisplayObject;
public var dontsubmit:DisplayObject;
public var ibm:DisplayObject;
public var lifeBar:DisplayObject;
public var spawn:DisplayObject;
}
}//package statics
Section 182
//ObjFactory__coinClass (statics.ObjFactory__coinClass)
package statics {
import flash.display.*;
import mx.core.*;
public class ObjFactory__coinClass extends SpriteAsset {
public var green:DisplayObject;
public var level:DisplayObject;
public var lives:DisplayObject;
public var saucer:DisplayObject;
public var mon:DisplayObject;
public var redspecial:DisplayObject;
public var bigred:DisplayObject;
public var score:DisplayObject;
public var submit:DisplayObject;
public var coins:DisplayObject;
public var soff:DisplayObject;
public var options:DisplayObject;
public var son:DisplayObject;
public var jet:DisplayObject;
public var jet2:DisplayObject;
public var red:DisplayObject;
public var bigred2:DisplayObject;
public var boat:DisplayObject;
public var input:DisplayObject;
public var wg:DisplayObject;
public var eject:DisplayObject;
public var plays1:DisplayObject;
public var plays2:DisplayObject;
public var more:DisplayObject;
public var ok:DisplayObject;
public var powerup:DisplayObject;
public var mine:DisplayObject;
public var bossBar:DisplayObject;
public var moff:DisplayObject;
public var shieldBar:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var go:DisplayObject;
public var dontsubmit:DisplayObject;
public var ibm:DisplayObject;
public var lifeBar:DisplayObject;
public var spawn:DisplayObject;
}
}//package statics
Section 183
//ObjFactory__spawnClass (statics.ObjFactory__spawnClass)
package statics {
import flash.display.*;
import mx.core.*;
public class ObjFactory__spawnClass extends SpriteAsset {
public var green:DisplayObject;
public var level:DisplayObject;
public var lives:DisplayObject;
public var saucer:DisplayObject;
public var mon:DisplayObject;
public var redspecial:DisplayObject;
public var bigred:DisplayObject;
public var score:DisplayObject;
public var submit:DisplayObject;
public var coins:DisplayObject;
public var soff:DisplayObject;
public var options:DisplayObject;
public var son:DisplayObject;
public var jet:DisplayObject;
public var jet2:DisplayObject;
public var red:DisplayObject;
public var bigred2:DisplayObject;
public var boat:DisplayObject;
public var input:DisplayObject;
public var wg:DisplayObject;
public var eject:DisplayObject;
public var plays1:DisplayObject;
public var plays2:DisplayObject;
public var more:DisplayObject;
public var ok:DisplayObject;
public var powerup:DisplayObject;
public var mine:DisplayObject;
public var bossBar:DisplayObject;
public var moff:DisplayObject;
public var shieldBar:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var go:DisplayObject;
public var dontsubmit:DisplayObject;
public var ibm:DisplayObject;
public var lifeBar:DisplayObject;
public var spawn:DisplayObject;
}
}//package statics
Section 184
//Protocol (statics.Protocol)
package statics {
public class Protocol {
public static var SCREEN_HEIGHT:Number = 500;
public static var SCREEN_WIDTH:Number = 500;
public function Protocol(){
super();
}
}
}//package statics
Section 185
//Settings (statics.Settings)
package statics {
import flash.display.*;
public class Settings {
public static var score:int;
public static var root:MovieClip;
public static var level:int = 0;
public static var power:int = 0;
public function Settings(){
super();
}
}
}//package statics
Section 186
//MochiBot (MochiBot)
package {
import flash.display.*;
import flash.net.*;
import flash.system.*;
public dynamic class MochiBot extends Sprite {
public function MochiBot(){
super();
}
public static function track(parent:Sprite, tag:String):MochiBot{
if (Security.sandboxType == "localWithFile"){
return (null);
};
var self:MochiBot = new (MochiBot);
parent.addChild(self);
Security.allowDomain("*");
Security.allowInsecureDomain("*");
var server:String = "http://core.mochibot.com/my/core.swf";
var lv:URLVariables = new URLVariables();
lv["sb"] = Security.sandboxType;
lv["v"] = Capabilities.version;
lv["swfid"] = tag;
lv["mv"] = "8";
lv["fv"] = "9";
var url:String = self.root.loaderInfo.loaderURL;
if (url.indexOf("http") == 0){
lv["url"] = url;
} else {
lv["url"] = "local";
};
var req:URLRequest = new URLRequest(server);
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
var loader:Loader = new Loader();
self.addChild(loader);
loader.load(req);
return (self);
}
}
}//package
Section 187
//Preloader (Preloader)
package {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import com.greensock.*;
import flash.text.*;
import api.serialization.json.*;
import com.utils.*;
import statics.*;
import com.greensock.easing.*;
import flash.net.*;
import flash.utils.*;
import flash.system.*;
public dynamic class Preloader extends MovieClip {
private var _adjustByConfig:Boolean;// = false
private var _animComplete:Boolean;// = false
private var _asset;
private var _text:TextField;
private var _bar:DisplayObject;
private var _loadingComplete:Boolean;// = false
private static var _assetClass:Class = Preloader__assetClass;
public function Preloader(){
var url:String;
var loader:URLLoader;
_asset = new _assetClass();
super();
MochiBot.track(this, "787b7aab");
MochiBot.track(this, "5f3e3d87");
trace("MochiBot.track() worked");
//unresolved jump
var _slot1 = error;
trace("MochiBot.track() failed");
Security.allowDomain("*");
stop();
Settings.root = this;
addEventListener(Event.ADDED_TO_STAGE, onAddedToStage, false, 0, true);
addEventListener(Event.ENTER_FRAME, onEnterFrame, false, 0, true);
addEventListener(MouseEvent.MOUSE_DOWN, onClick, false, 0, true);
loaderInfo.addEventListener(Event.COMPLETE, onComplete, false, 0, true);
_bar = _asset.getChildByName("progressBar");
_text = _asset.getChildByName("loadingText");
_bar.scaleX = 0;
TweenMax.to(_bar, 8, {scaleX:1, ease:Linear.easeNone, onComplete:function ():void{
_animComplete = true;
}});
addChild(_asset);
buttonMode = true;
url = this.loaderInfo.url.replace(/.swf$/ig, ".cfg");
loader = new URLLoader(new URLRequest(url));
loader.addEventListener(IOErrorEvent.IO_ERROR, onError, false, 0, true);
loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onError, false, 0, true);
loader.addEventListener(Event.COMPLETE, onConfigLoaded, false, 0, true);
//unresolved jump
var _slot1 = error;
trace("in preloader", _slot1);
}
private function onClick(mouseEvent:MouseEvent):void{
navigateToURL(new URLRequest("http://www.stumpygames.com/gamein.php?id=1130&source=1"), "_blank");
}
private function onAddedToStage(event:Event):void{
if (!_adjustByConfig){
trace("configure stage, onAddedToStage()");
stage.frameRate = 31;
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
};
scrollRect = new Rectangle(0, 0, Protocol.SCREEN_WIDTH, Protocol.SCREEN_HEIGHT);
stage.addEventListener(Event.RESIZE, onResize, false, 0, true);
}
private function onConfigLoaded(event:Event):void{
var response:Object;
var event = event;
response = JSON.decode(event.target.data);
trace("config has been read, response:", Debug.shortDump(response));
_adjustByConfig = true;
stage.frameRate = ((int(response.fps)) || (31));
stage.scaleMode = ((response.scale) || (StageScaleMode.NO_SCALE));
stage.align = ((response.align) || (StageAlign.TOP_LEFT));
trace(stage.align, stage.scaleMode);
//unresolved jump
var _slot1 = error;
trace("when decoding:", _slot1);
}
private function onResize(event:Event):void{
trace(stage.width, stage.height);
}
private function onError(response):void{
trace("config not loaded: ", response);
}
private function onEnterFrame(event:Event):void{
var mainClass:Class;
var p:Number = (loaderInfo.bytesLoaded / loaderInfo.bytesTotal);
_text.text = (("" + int((p * 100))) + "%");
if (((_animComplete) && (_loadingComplete))){
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
removeEventListener(MouseEvent.MOUSE_DOWN, onClick);
buttonMode = false;
nextFrame();
Util.safelyRemoveChildren(this);
mainClass = (getDefinitionByName("skylark3") as Class);
addChild(new (mainClass));
};
}
private function onComplete(event:Event):void{
trace("complete loading");
_loadingComplete = true;
}
}
}//package
Section 188
//Preloader__assetClass (Preloader__assetClass)
package {
import flash.display.*;
import mx.core.*;
public class Preloader__assetClass extends SpriteAsset {
public var green:DisplayObject;
public var level:DisplayObject;
public var lives:DisplayObject;
public var loadingText:DisplayObject;
public var mon:DisplayObject;
public var redspecial:DisplayObject;
public var saucer:DisplayObject;
public var bigred:DisplayObject;
public var score:DisplayObject;
public var locator:DisplayObject;
public var submit:DisplayObject;
public var coins:DisplayObject;
public var soff:DisplayObject;
public var options:DisplayObject;
public var jet:DisplayObject;
public var missile:DisplayObject;
public var prop1:DisplayObject;
public var prop0:DisplayObject;
public var progressBar:DisplayObject;
public var jet2:DisplayObject;
public var bigred2:DisplayObject;
public var boat:DisplayObject;
public var main:DisplayObject;
public var input:DisplayObject;
public var son:DisplayObject;
public var wg:DisplayObject;
public var eject:DisplayObject;
public var plays1:DisplayObject;
public var plays2:DisplayObject;
public var more:DisplayObject;
public var red:DisplayObject;
public var mine:DisplayObject;
public var powerup:DisplayObject;
public var moff:DisplayObject;
public var ok:DisplayObject;
public var bossBar:DisplayObject;
public var direct:DisplayObject;
public var prop:DisplayObject;
public var any:DisplayObject;
public var boss:DisplayObject;
public var go:DisplayObject;
public var dontsubmit:DisplayObject;
public var shieldBar:DisplayObject;
public var ibm:DisplayObject;
public var preLoaderStroke:DisplayObject;
public var lifeBar:DisplayObject;
public var spawn:DisplayObject;
}
}//package
Section 189
//skylark3 (skylark3)
package {
import flash.events.*;
import game.*;
import flash.display.*;
import dialog.*;
import statics.*;
import mochi.as3.*;
import flash.text.*;
public class skylark3 extends Sprite {
private var _fontClass:Class;
public function skylark3(){
_fontClass = skylark3__fontClass;
super();
Font.registerFont(_fontClass);
var _mochiads_game_id:String = "1c5e2f3c7fa00457";
MainMenu.getInstance().show();
addEventListener(FocusEvent.FOCUS_OUT, onFocus, false, 0, true);
addEventListener(FocusEvent.FOCUS_IN, onFocus, false, 0, true);
Config.getInstance();
trace("MochiAd._isNetworkAvailable()", MochiAd._isNetworkAvailable());
}
public function onFocus(event:Event):void{
switch (event.type){
case FocusEvent.FOCUS_IN:
Game.getInstance().resume();
break;
case FocusEvent.FOCUS_OUT:
Game.getInstance().pause();
break;
};
}
}
}//package
Section 190
//skylark3__fontClass (skylark3__fontClass)
package {
import mx.core.*;
public class skylark3__fontClass extends FontAsset {
}
}//package