Section 1
//AuxFunctions (caurina.transitions.AuxFunctions)
package caurina.transitions {
public class AuxFunctions {
public static function getObjectLength(p_object:Object):uint{
var pName:String;
var totalProperties:uint;
for (pName in p_object) {
totalProperties++;
};
return (totalProperties);
}
public static function numberToG(p_num:Number):Number{
return (((p_num & 0xFF00) >> 8));
}
public static function numberToB(p_num:Number):Number{
return ((p_num & 0xFF));
}
public static function numberToR(p_num:Number):Number{
return (((p_num & 0xFF0000) >> 16));
}
public static function concatObjects(... _args):Object{
var currentObject:Object;
var prop:String;
var finalObject:Object = {};
var i:int;
while (i < _args.length) {
currentObject = _args[i];
for (prop in currentObject) {
if (currentObject[prop] == null){
delete finalObject[prop];
} else {
finalObject[prop] = currentObject[prop];
};
};
i++;
};
return (finalObject);
}
}
}//package caurina.transitions
Section 2
//Equations (caurina.transitions.Equations)
package caurina.transitions {
public class Equations {
public function Equations(){
super();
trace("Equations is a static class and should not be instantiated.");
}
public static function easeOutBounce(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
t = (t / d);
if (t < (1 / 2.75)){
return (((c * ((7.5625 * t) * t)) + b));
};
if (t < (2 / 2.75)){
t = (t - (1.5 / 2.75));
return (((c * (((7.5625 * t) * t) + 0.75)) + b));
};
if (t < (2.5 / 2.75)){
t = (t - (2.25 / 2.75));
return (((c * (((7.5625 * t) * t) + 0.9375)) + b));
};
t = (t - (2.625 / 2.75));
return (((c * (((7.5625 * t) * t) + 0.984375)) + b));
}
public static function easeInOutElastic(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
var s:Number;
if (t == 0){
return (b);
};
t = (t / (d / 2));
if (t == 2){
return ((b + c));
};
var p:Number = (((!(Boolean(p_params))) || (isNaN(p_params.period)))) ? (d * (0.3 * 1.5)) : p_params.period;
var a:Number = (((!(Boolean(p_params))) || (isNaN(p_params.amplitude)))) ? 0 : p_params.amplitude;
if (((!(Boolean(a))) || ((a < Math.abs(c))))){
a = c;
s = (p / 4);
} else {
s = ((p / (2 * Math.PI)) * Math.asin((c / a)));
};
if (t < 1){
--t;
return (((-0.5 * ((a * Math.pow(2, (10 * t))) * Math.sin(((((t * d) - s) * (2 * Math.PI)) / p)))) + b));
};
--t;
return ((((((a * Math.pow(2, (-10 * t))) * Math.sin(((((t * d) - s) * (2 * Math.PI)) / p))) * 0.5) + c) + b));
}
public static function easeInOutQuad(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
t = (t / (d / 2));
if (t < 1){
return (((((c / 2) * t) * t) + b));
};
--t;
return ((((-(c) / 2) * ((t * (t - 2)) - 1)) + b));
}
public static function easeInOutBounce(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
if (t < (d / 2)){
return (((easeInBounce((t * 2), 0, c, d) * 0.5) + b));
};
return ((((easeOutBounce(((t * 2) - d), 0, c, d) * 0.5) + (c * 0.5)) + b));
}
public static function easeInOutBack(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
var s:Number = (((!(Boolean(p_params))) || (isNaN(p_params.overshoot)))) ? 1.70158 : p_params.overshoot;
t = (t / (d / 2));
if (t < 1){
s = (s * 1.525);
return ((((c / 2) * ((t * t) * (((s + 1) * t) - s))) + b));
};
t = (t - 2);
s = (s * 1.525);
return ((((c / 2) * (((t * t) * (((s + 1) * t) + s)) + 2)) + b));
}
public static function easeOutInCubic(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
if (t < (d / 2)){
return (easeOutCubic((t * 2), b, (c / 2), d, p_params));
};
return (easeInCubic(((t * 2) - d), (b + (c / 2)), (c / 2), d, p_params));
}
public static function easeNone(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
return ((((c * t) / d) + b));
}
public static function easeOutBack(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
var s:Number = (((!(Boolean(p_params))) || (isNaN(p_params.overshoot)))) ? 1.70158 : p_params.overshoot;
t = ((t / d) - 1);
return (((c * (((t * t) * (((s + 1) * t) + s)) + 1)) + b));
}
public static function easeInOutSine(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
return ((((-(c) / 2) * (Math.cos(((Math.PI * t) / d)) - 1)) + b));
}
public static function easeInBack(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
var s:Number = (((!(Boolean(p_params))) || (isNaN(p_params.overshoot)))) ? 1.70158 : p_params.overshoot;
t = (t / d);
return (((((c * t) * t) * (((s + 1) * t) - s)) + b));
}
public static function easeInQuart(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
t = (t / d);
return ((((((c * t) * t) * t) * t) + b));
}
public static function easeOutInQuint(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
if (t < (d / 2)){
return (easeOutQuint((t * 2), b, (c / 2), d, p_params));
};
return (easeInQuint(((t * 2) - d), (b + (c / 2)), (c / 2), d, p_params));
}
public static function easeOutInBounce(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
if (t < (d / 2)){
return (easeOutBounce((t * 2), b, (c / 2), d, p_params));
};
return (easeInBounce(((t * 2) - d), (b + (c / 2)), (c / 2), d, p_params));
}
public static function init():void{
Tweener.registerTransition("easenone", easeNone);
Tweener.registerTransition("linear", easeNone);
Tweener.registerTransition("easeinquad", easeInQuad);
Tweener.registerTransition("easeoutquad", easeOutQuad);
Tweener.registerTransition("easeinoutquad", easeInOutQuad);
Tweener.registerTransition("easeoutinquad", easeOutInQuad);
Tweener.registerTransition("easeincubic", easeInCubic);
Tweener.registerTransition("easeoutcubic", easeOutCubic);
Tweener.registerTransition("easeinoutcubic", easeInOutCubic);
Tweener.registerTransition("easeoutincubic", easeOutInCubic);
Tweener.registerTransition("easeinquart", easeInQuart);
Tweener.registerTransition("easeoutquart", easeOutQuart);
Tweener.registerTransition("easeinoutquart", easeInOutQuart);
Tweener.registerTransition("easeoutinquart", easeOutInQuart);
Tweener.registerTransition("easeinquint", easeInQuint);
Tweener.registerTransition("easeoutquint", easeOutQuint);
Tweener.registerTransition("easeinoutquint", easeInOutQuint);
Tweener.registerTransition("easeoutinquint", easeOutInQuint);
Tweener.registerTransition("easeinsine", easeInSine);
Tweener.registerTransition("easeoutsine", easeOutSine);
Tweener.registerTransition("easeinoutsine", easeInOutSine);
Tweener.registerTransition("easeoutinsine", easeOutInSine);
Tweener.registerTransition("easeincirc", easeInCirc);
Tweener.registerTransition("easeoutcirc", easeOutCirc);
Tweener.registerTransition("easeinoutcirc", easeInOutCirc);
Tweener.registerTransition("easeoutincirc", easeOutInCirc);
Tweener.registerTransition("easeinexpo", easeInExpo);
Tweener.registerTransition("easeoutexpo", easeOutExpo);
Tweener.registerTransition("easeinoutexpo", easeInOutExpo);
Tweener.registerTransition("easeoutinexpo", easeOutInExpo);
Tweener.registerTransition("easeinelastic", easeInElastic);
Tweener.registerTransition("easeoutelastic", easeOutElastic);
Tweener.registerTransition("easeinoutelastic", easeInOutElastic);
Tweener.registerTransition("easeoutinelastic", easeOutInElastic);
Tweener.registerTransition("easeinback", easeInBack);
Tweener.registerTransition("easeoutback", easeOutBack);
Tweener.registerTransition("easeinoutback", easeInOutBack);
Tweener.registerTransition("easeoutinback", easeOutInBack);
Tweener.registerTransition("easeinbounce", easeInBounce);
Tweener.registerTransition("easeoutbounce", easeOutBounce);
Tweener.registerTransition("easeinoutbounce", easeInOutBounce);
Tweener.registerTransition("easeoutinbounce", easeOutInBounce);
}
public static function easeOutExpo(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
return (((t)==d) ? (b + c) : (((c * 1.001) * (-(Math.pow(2, ((-10 * t) / d))) + 1)) + b));
}
public static function easeOutInBack(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
if (t < (d / 2)){
return (easeOutBack((t * 2), b, (c / 2), d, p_params));
};
return (easeInBack(((t * 2) - d), (b + (c / 2)), (c / 2), d, p_params));
}
public static function easeInExpo(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
return (((t)==0) ? b : (((c * Math.pow(2, (10 * ((t / d) - 1)))) + b) - (c * 0.001)));
}
public static function easeInCubic(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
t = (t / d);
return (((((c * t) * t) * t) + b));
}
public static function easeInQuint(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
t = (t / d);
return (((((((c * t) * t) * t) * t) * t) + b));
}
public static function easeInOutCirc(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
t = (t / (d / 2));
if (t < 1){
return ((((-(c) / 2) * (Math.sqrt((1 - (t * t))) - 1)) + b));
};
t = (t - 2);
return ((((c / 2) * (Math.sqrt((1 - (t * t))) + 1)) + b));
}
public static function easeInQuad(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
t = (t / d);
return ((((c * t) * t) + b));
}
public static function easeInBounce(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
return (((c - easeOutBounce((d - t), 0, c, d)) + b));
}
public static function easeOutInExpo(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
if (t < (d / 2)){
return (easeOutExpo((t * 2), b, (c / 2), d, p_params));
};
return (easeInExpo(((t * 2) - d), (b + (c / 2)), (c / 2), d, p_params));
}
public static function easeOutQuart(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
t = ((t / d) - 1);
return (((-(c) * ((((t * t) * t) * t) - 1)) + b));
}
public static function easeInSine(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
return ((((-(c) * Math.cos(((t / d) * (Math.PI / 2)))) + c) + b));
}
public static function easeInOutQuart(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
t = (t / (d / 2));
if (t < 1){
return (((((((c / 2) * t) * t) * t) * t) + b));
};
t = (t - 2);
return ((((-(c) / 2) * ((((t * t) * t) * t) - 2)) + b));
}
public static function easeOutQuad(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
t = (t / d);
return ((((-(c) * t) * (t - 2)) + b));
}
public static function easeOutInElastic(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
if (t < (d / 2)){
return (easeOutElastic((t * 2), b, (c / 2), d, p_params));
};
return (easeInElastic(((t * 2) - d), (b + (c / 2)), (c / 2), d, p_params));
}
public static function easeInElastic(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
var s:Number;
if (t == 0){
return (b);
};
t = (t / d);
if (t == 1){
return ((b + c));
};
var p:Number = (((!(Boolean(p_params))) || (isNaN(p_params.period)))) ? (d * 0.3) : p_params.period;
var a:Number = (((!(Boolean(p_params))) || (isNaN(p_params.amplitude)))) ? 0 : p_params.amplitude;
if (((!(Boolean(a))) || ((a < Math.abs(c))))){
a = c;
s = (p / 4);
} else {
s = ((p / (2 * Math.PI)) * Math.asin((c / a)));
};
--t;
return ((-(((a * Math.pow(2, (10 * t))) * Math.sin(((((t * d) - s) * (2 * Math.PI)) / p)))) + b));
}
public static function easeOutCubic(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
t = ((t / d) - 1);
return (((c * (((t * t) * t) + 1)) + b));
}
public static function easeOutQuint(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
t = ((t / d) - 1);
return (((c * (((((t * t) * t) * t) * t) + 1)) + b));
}
public static function easeOutInQuad(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
if (t < (d / 2)){
return (easeOutQuad((t * 2), b, (c / 2), d, p_params));
};
return (easeInQuad(((t * 2) - d), (b + (c / 2)), (c / 2), d, p_params));
}
public static function easeOutSine(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
return (((c * Math.sin(((t / d) * (Math.PI / 2)))) + b));
}
public static function easeInOutCubic(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
t = (t / (d / 2));
if (t < 1){
return ((((((c / 2) * t) * t) * t) + b));
};
t = (t - 2);
return ((((c / 2) * (((t * t) * t) + 2)) + b));
}
public static function easeInOutQuint(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
t = (t / (d / 2));
if (t < 1){
return ((((((((c / 2) * t) * t) * t) * t) * t) + b));
};
t = (t - 2);
return ((((c / 2) * (((((t * t) * t) * t) * t) + 2)) + b));
}
public static function easeInCirc(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
t = (t / d);
return (((-(c) * (Math.sqrt((1 - (t * t))) - 1)) + b));
}
public static function easeOutInSine(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
if (t < (d / 2)){
return (easeOutSine((t * 2), b, (c / 2), d, p_params));
};
return (easeInSine(((t * 2) - d), (b + (c / 2)), (c / 2), d, p_params));
}
public static function easeInOutExpo(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
if (t == 0){
return (b);
};
if (t == d){
return ((b + c));
};
t = (t / (d / 2));
if (t < 1){
return (((((c / 2) * Math.pow(2, (10 * (t - 1)))) + b) - (c * 0.0005)));
};
--t;
return (((((c / 2) * 1.0005) * (-(Math.pow(2, (-10 * t))) + 2)) + b));
}
public static function easeOutElastic(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
var s:Number;
if (t == 0){
return (b);
};
t = (t / d);
if (t == 1){
return ((b + c));
};
var p:Number = (((!(Boolean(p_params))) || (isNaN(p_params.period)))) ? (d * 0.3) : p_params.period;
var a:Number = (((!(Boolean(p_params))) || (isNaN(p_params.amplitude)))) ? 0 : p_params.amplitude;
if (((!(Boolean(a))) || ((a < Math.abs(c))))){
a = c;
s = (p / 4);
} else {
s = ((p / (2 * Math.PI)) * Math.asin((c / a)));
};
return (((((a * Math.pow(2, (-10 * t))) * Math.sin(((((t * d) - s) * (2 * Math.PI)) / p))) + c) + b));
}
public static function easeOutCirc(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
t = ((t / d) - 1);
return (((c * Math.sqrt((1 - (t * t)))) + b));
}
public static function easeOutInQuart(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
if (t < (d / 2)){
return (easeOutQuart((t * 2), b, (c / 2), d, p_params));
};
return (easeInQuart(((t * 2) - d), (b + (c / 2)), (c / 2), d, p_params));
}
public static function easeOutInCirc(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
if (t < (d / 2)){
return (easeOutCirc((t * 2), b, (c / 2), d, p_params));
};
return (easeInCirc(((t * 2) - d), (b + (c / 2)), (c / 2), d, p_params));
}
}
}//package caurina.transitions
Section 3
//PropertyInfoObj (caurina.transitions.PropertyInfoObj)
package caurina.transitions {
public class PropertyInfoObj {
public var modifierParameters:Array;
public var isSpecialProperty:Boolean;
public var valueComplete:Number;
public var modifierFunction:Function;
public var extra:Object;
public var valueStart:Number;
public var hasModifier:Boolean;
public var arrayIndex:Number;
public var originalValueComplete:Object;
public function PropertyInfoObj(p_valueStart:Number, p_valueComplete:Number, p_originalValueComplete:Object, p_arrayIndex:Number, p_extra:Object, p_isSpecialProperty:Boolean, p_modifierFunction:Function, p_modifierParameters:Array){
super();
valueStart = p_valueStart;
valueComplete = p_valueComplete;
originalValueComplete = p_originalValueComplete;
arrayIndex = p_arrayIndex;
extra = p_extra;
isSpecialProperty = p_isSpecialProperty;
hasModifier = Boolean(p_modifierFunction);
modifierFunction = p_modifierFunction;
modifierParameters = p_modifierParameters;
}
public function toString():String{
var returnStr:String = "\n[PropertyInfoObj ";
returnStr = (returnStr + ("valueStart:" + String(valueStart)));
returnStr = (returnStr + ", ");
returnStr = (returnStr + ("valueComplete:" + String(valueComplete)));
returnStr = (returnStr + ", ");
returnStr = (returnStr + ("originalValueComplete:" + String(originalValueComplete)));
returnStr = (returnStr + ", ");
returnStr = (returnStr + ("arrayIndex:" + String(arrayIndex)));
returnStr = (returnStr + ", ");
returnStr = (returnStr + ("extra:" + String(extra)));
returnStr = (returnStr + ", ");
returnStr = (returnStr + ("isSpecialProperty:" + String(isSpecialProperty)));
returnStr = (returnStr + ", ");
returnStr = (returnStr + ("hasModifier:" + String(hasModifier)));
returnStr = (returnStr + ", ");
returnStr = (returnStr + ("modifierFunction:" + String(modifierFunction)));
returnStr = (returnStr + ", ");
returnStr = (returnStr + ("modifierParameters:" + String(modifierParameters)));
returnStr = (returnStr + "]\n");
return (returnStr);
}
public function clone():PropertyInfoObj{
var nProperty:PropertyInfoObj = new PropertyInfoObj(valueStart, valueComplete, originalValueComplete, arrayIndex, extra, isSpecialProperty, modifierFunction, modifierParameters);
return (nProperty);
}
}
}//package caurina.transitions
Section 4
//SpecialProperty (caurina.transitions.SpecialProperty)
package caurina.transitions {
public class SpecialProperty {
public var parameters:Array;
public var getValue:Function;
public var preProcess:Function;
public var setValue:Function;
public function SpecialProperty(p_getFunction:Function, p_setFunction:Function, p_parameters:Array=null, p_preProcessFunction:Function=null){
super();
getValue = p_getFunction;
setValue = p_setFunction;
parameters = p_parameters;
preProcess = p_preProcessFunction;
}
public function toString():String{
var value:String = "";
value = (value + "[SpecialProperty ");
value = (value + ("getValue:" + String(getValue)));
value = (value + ", ");
value = (value + ("setValue:" + String(setValue)));
value = (value + ", ");
value = (value + ("parameters:" + String(parameters)));
value = (value + ", ");
value = (value + ("preProcess:" + String(preProcess)));
value = (value + "]");
return (value);
}
}
}//package caurina.transitions
Section 5
//SpecialPropertyModifier (caurina.transitions.SpecialPropertyModifier)
package caurina.transitions {
public class SpecialPropertyModifier {
public var getValue:Function;
public var modifyValues:Function;
public function SpecialPropertyModifier(p_modifyFunction:Function, p_getFunction:Function){
super();
modifyValues = p_modifyFunction;
getValue = p_getFunction;
}
public function toString():String{
var value:String = "";
value = (value + "[SpecialPropertyModifier ");
value = (value + ("modifyValues:" + String(modifyValues)));
value = (value + ", ");
value = (value + ("getValue:" + String(getValue)));
value = (value + "]");
return (value);
}
}
}//package caurina.transitions
Section 6
//SpecialPropertySplitter (caurina.transitions.SpecialPropertySplitter)
package caurina.transitions {
public class SpecialPropertySplitter {
public var parameters:Array;
public var splitValues:Function;
public function SpecialPropertySplitter(p_splitFunction:Function, p_parameters:Array){
super();
splitValues = p_splitFunction;
parameters = p_parameters;
}
public function toString():String{
var value:String = "";
value = (value + "[SpecialPropertySplitter ");
value = (value + ("splitValues:" + String(splitValues)));
value = (value + ", ");
value = (value + ("parameters:" + String(parameters)));
value = (value + "]");
return (value);
}
}
}//package caurina.transitions
Section 7
//Tweener (caurina.transitions.Tweener)
package caurina.transitions {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public class Tweener {
private static var _timeScale:Number = 1;
private static var _currentTimeFrame:Number;
private static var _specialPropertySplitterList:Object;
public static var autoOverwrite:Boolean = true;
private static var _engineExists:Boolean = false;
private static var _currentTime:Number;
private static var _tweenList:Array;
private static var _specialPropertyModifierList:Object;
private static var _specialPropertyList:Object;
private static var _transitionList:Object;
private static var _inited:Boolean = false;
private static var __tweener_controller__:MovieClip;
public function Tweener(){
super();
trace("Tweener is a static class and should not be instantiated.");
}
public static function registerSpecialPropertyModifier(p_name:String, p_modifyFunction:Function, p_getFunction:Function):void{
if (!_inited){
init();
};
var spm:SpecialPropertyModifier = new SpecialPropertyModifier(p_modifyFunction, p_getFunction);
_specialPropertyModifierList[p_name] = spm;
}
public static function registerSpecialProperty(p_name:String, p_getFunction:Function, p_setFunction:Function, p_parameters:Array=null, p_preProcessFunction:Function=null):void{
if (!_inited){
init();
};
var sp:SpecialProperty = new SpecialProperty(p_getFunction, p_setFunction, p_parameters, p_preProcessFunction);
_specialPropertyList[p_name] = sp;
}
public static function init(... _args):void{
_inited = true;
_transitionList = new Object();
Equations.init();
_specialPropertyList = new Object();
_specialPropertyModifierList = new Object();
_specialPropertySplitterList = new Object();
}
private static function updateTweens():Boolean{
var i:int;
if (_tweenList.length == 0){
return (false);
};
i = 0;
while (i < _tweenList.length) {
if ((((_tweenList[i] == undefined)) || (!(_tweenList[i].isPaused)))){
if (!updateTweenByIndex(i)){
removeTweenByIndex(i);
};
if (_tweenList[i] == null){
removeTweenByIndex(i, true);
i--;
};
};
i++;
};
return (true);
}
public static function addCaller(p_scopes:Object=null, p_parameters:Object=null):Boolean{
var i:Number;
var rScopes:Array;
var rTransition:Function;
var nTween:TweenListObj;
var myT:Number;
var trans:String;
if (!Boolean(p_scopes)){
return (false);
};
if ((p_scopes is Array)){
rScopes = p_scopes.concat();
} else {
rScopes = [p_scopes];
};
var p_obj:Object = p_parameters;
if (!_inited){
init();
};
if (((!(_engineExists)) || (!(Boolean(__tweener_controller__))))){
startEngine();
};
var rTime:Number = (isNaN(p_obj.time)) ? 0 : p_obj.time;
var rDelay:Number = (isNaN(p_obj.delay)) ? 0 : p_obj.delay;
if (typeof(p_obj.transition) == "string"){
trans = p_obj.transition.toLowerCase();
rTransition = _transitionList[trans];
} else {
rTransition = p_obj.transition;
};
if (!Boolean(rTransition)){
rTransition = _transitionList["easeoutexpo"];
};
i = 0;
while (i < rScopes.length) {
if (p_obj.useFrames == true){
nTween = new TweenListObj(rScopes[i], (_currentTimeFrame + (rDelay / _timeScale)), (_currentTimeFrame + ((rDelay + rTime) / _timeScale)), true, rTransition, p_obj.transitionParams);
} else {
nTween = new TweenListObj(rScopes[i], (_currentTime + ((rDelay * 1000) / _timeScale)), (_currentTime + (((rDelay * 1000) + (rTime * 1000)) / _timeScale)), false, rTransition, p_obj.transitionParams);
};
nTween.properties = null;
nTween.onStart = p_obj.onStart;
nTween.onUpdate = p_obj.onUpdate;
nTween.onComplete = p_obj.onComplete;
nTween.onOverwrite = p_obj.onOverwrite;
nTween.onStartParams = p_obj.onStartParams;
nTween.onUpdateParams = p_obj.onUpdateParams;
nTween.onCompleteParams = p_obj.onCompleteParams;
nTween.onOverwriteParams = p_obj.onOverwriteParams;
nTween.onStartScope = p_obj.onStartScope;
nTween.onUpdateScope = p_obj.onUpdateScope;
nTween.onCompleteScope = p_obj.onCompleteScope;
nTween.onOverwriteScope = p_obj.onOverwriteScope;
nTween.onErrorScope = p_obj.onErrorScope;
nTween.isCaller = true;
nTween.count = p_obj.count;
nTween.waitFrames = p_obj.waitFrames;
_tweenList.push(nTween);
if ((((rTime == 0)) && ((rDelay == 0)))){
myT = (_tweenList.length - 1);
updateTweenByIndex(myT);
removeTweenByIndex(myT);
};
i++;
};
return (true);
}
public static function pauseAllTweens():Boolean{
var i:uint;
if (!Boolean(_tweenList)){
return (false);
};
var paused:Boolean;
i = 0;
while (i < _tweenList.length) {
pauseTweenByIndex(i);
paused = true;
i++;
};
return (paused);
}
public static function removeTweens(p_scope:Object, ... _args):Boolean{
var i:uint;
var sps:SpecialPropertySplitter;
var specialProps:Array;
var j:uint;
var properties:Array = new Array();
i = 0;
while (i < _args.length) {
if ((((typeof(_args[i]) == "string")) && ((properties.indexOf(_args[i]) == -1)))){
if (_specialPropertySplitterList[_args[i]]){
sps = _specialPropertySplitterList[_args[i]];
specialProps = sps.splitValues(p_scope, null);
j = 0;
while (j < specialProps.length) {
properties.push(specialProps[j].name);
j++;
};
} else {
properties.push(_args[i]);
};
};
i++;
};
return (affectTweens(removeTweenByIndex, p_scope, properties));
}
public static function updateFrame():void{
_currentTimeFrame++;
}
public static function splitTweens(p_tween:Number, p_properties:Array):uint{
var i:uint;
var pName:String;
var found:Boolean;
var originalTween:TweenListObj = _tweenList[p_tween];
var newTween:TweenListObj = originalTween.clone(false);
i = 0;
while (i < p_properties.length) {
pName = p_properties[i];
if (Boolean(originalTween.properties[pName])){
originalTween.properties[pName] = undefined;
delete originalTween.properties[pName];
};
i++;
};
for (pName in newTween.properties) {
found = false;
i = 0;
while (i < p_properties.length) {
if (p_properties[i] == pName){
found = true;
break;
};
i++;
};
if (!found){
newTween.properties[pName] = undefined;
delete newTween.properties[pName];
};
};
_tweenList.push(newTween);
return ((_tweenList.length - 1));
}
public static function resumeTweenByIndex(p_tween:Number):Boolean{
var tTweening:TweenListObj = _tweenList[p_tween];
if ((((tTweening == null)) || (!(tTweening.isPaused)))){
return (false);
};
var cTime:Number = getCurrentTweeningTime(tTweening);
tTweening.timeStart = (tTweening.timeStart + (cTime - tTweening.timePaused));
tTweening.timeComplete = (tTweening.timeComplete + (cTime - tTweening.timePaused));
tTweening.timePaused = undefined;
tTweening.isPaused = false;
return (true);
}
public static function getVersion():String{
return ("AS3 1.33.74");
}
public static function onEnterFrame(e:Event):void{
updateTime();
updateFrame();
var hasUpdated:Boolean;
hasUpdated = updateTweens();
if (!hasUpdated){
stopEngine();
};
}
public static function updateTime():void{
_currentTime = getTimer();
}
private static function updateTweenByIndex(i:Number):Boolean{
var tTweening:TweenListObj;
var mustUpdate:Boolean;
var nv:Number;
var t:Number;
var b:Number;
var c:Number;
var d:Number;
var pName:String;
var eventScope:Object;
var tScope:Object;
var tProperty:Object;
var pv:Number;
var i = i;
tTweening = _tweenList[i];
if ((((tTweening == null)) || (!(Boolean(tTweening.scope))))){
return (false);
};
var isOver:Boolean;
var cTime:Number = getCurrentTweeningTime(tTweening);
if (cTime >= tTweening.timeStart){
tScope = tTweening.scope;
if (tTweening.isCaller){
do {
t = (((tTweening.timeComplete - tTweening.timeStart) / tTweening.count) * (tTweening.timesCalled + 1));
b = tTweening.timeStart;
c = (tTweening.timeComplete - tTweening.timeStart);
d = (tTweening.timeComplete - tTweening.timeStart);
nv = tTweening.transition(t, b, c, d);
//unresolved if
if (Boolean(tTweening.onUpdate)){
eventScope = (Boolean(tTweening.onUpdateScope)) ? tTweening.onUpdateScope : tScope;
tTweening.onUpdate.apply(eventScope, tTweening.onUpdateParams);
continue;
var _slot1 = e1;
handleError(tTweening, _slot1, "onUpdate");
};
} while (tTweening.timesCalled++, !(tTweening.timesCalled >= tTweening.count));
} else {
mustUpdate = (((((tTweening.skipUpdates < 1)) || (!(tTweening.skipUpdates)))) || ((tTweening.updatesSkipped >= tTweening.skipUpdates)));
if (cTime >= tTweening.timeComplete){
isOver = true;
mustUpdate = true;
};
if (!tTweening.hasStarted){
if (Boolean(tTweening.onStart)){
eventScope = (Boolean(tTweening.onStartScope)) ? tTweening.onStartScope : tScope;
tTweening.onStart.apply(eventScope, tTweening.onStartParams);
//unresolved jump
var _slot1 = e2;
handleError(tTweening, _slot1, "onStart");
};
for (pName in tTweening.properties) {
if (tTweening.properties[pName].isSpecialProperty){
if (Boolean(_specialPropertyList[pName].preProcess)){
tTweening.properties[pName].valueComplete = _specialPropertyList[pName].preProcess(tScope, _specialPropertyList[pName].parameters, tTweening.properties[pName].originalValueComplete, tTweening.properties[pName].extra);
};
pv = _specialPropertyList[pName].getValue(tScope, _specialPropertyList[pName].parameters, tTweening.properties[pName].extra);
} else {
pv = tScope[pName];
};
tTweening.properties[pName].valueStart = (isNaN(pv)) ? tTweening.properties[pName].valueComplete : pv;
};
mustUpdate = true;
tTweening.hasStarted = true;
};
if (mustUpdate){
for (pName in tTweening.properties) {
tProperty = tTweening.properties[pName];
if (isOver){
nv = tProperty.valueComplete;
} else {
if (tProperty.hasModifier){
t = (cTime - tTweening.timeStart);
d = (tTweening.timeComplete - tTweening.timeStart);
nv = tTweening.transition(t, 0, 1, d, tTweening.transitionParams);
nv = tProperty.modifierFunction(tProperty.valueStart, tProperty.valueComplete, nv, tProperty.modifierParameters);
} else {
t = (cTime - tTweening.timeStart);
b = tProperty.valueStart;
c = (tProperty.valueComplete - tProperty.valueStart);
d = (tTweening.timeComplete - tTweening.timeStart);
nv = tTweening.transition(t, b, c, d, tTweening.transitionParams);
};
};
if (tTweening.rounded){
nv = Math.round(nv);
};
if (tProperty.isSpecialProperty){
_specialPropertyList[pName].setValue(tScope, nv, _specialPropertyList[pName].parameters, tTweening.properties[pName].extra);
} else {
tScope[pName] = nv;
};
};
tTweening.updatesSkipped = 0;
if (Boolean(tTweening.onUpdate)){
eventScope = (Boolean(tTweening.onUpdateScope)) ? tTweening.onUpdateScope : tScope;
tTweening.onUpdate.apply(eventScope, tTweening.onUpdateParams);
//unresolved jump
var _slot1 = e3;
handleError(tTweening, _slot1, "onUpdate");
};
} else {
tTweening.updatesSkipped++;
};
};
if (((isOver) && (Boolean(tTweening.onComplete)))){
eventScope = (Boolean(tTweening.onCompleteScope)) ? tTweening.onCompleteScope : tScope;
tTweening.onComplete.apply(eventScope, tTweening.onCompleteParams);
//unresolved jump
var _slot1 = e4;
handleError(tTweening, _slot1, "onComplete");
};
return (!(isOver));
};
return (true);
}
public static function setTimeScale(p_time:Number):void{
var i:Number;
var cTime:Number;
if (isNaN(p_time)){
p_time = 1;
};
if (p_time < 1E-5){
p_time = 1E-5;
};
if (p_time != _timeScale){
if (_tweenList != null){
i = 0;
while (i < _tweenList.length) {
cTime = getCurrentTweeningTime(_tweenList[i]);
_tweenList[i].timeStart = (cTime - (((cTime - _tweenList[i].timeStart) * _timeScale) / p_time));
_tweenList[i].timeComplete = (cTime - (((cTime - _tweenList[i].timeComplete) * _timeScale) / p_time));
if (_tweenList[i].timePaused != undefined){
_tweenList[i].timePaused = (cTime - (((cTime - _tweenList[i].timePaused) * _timeScale) / p_time));
};
i++;
};
};
_timeScale = p_time;
};
}
public static function resumeAllTweens():Boolean{
var i:uint;
if (!Boolean(_tweenList)){
return (false);
};
var resumed:Boolean;
i = 0;
while (i < _tweenList.length) {
resumeTweenByIndex(i);
resumed = true;
i++;
};
return (resumed);
}
private static function handleError(pTweening:TweenListObj, pError:Error, pCallBackName:String):void{
var eventScope:Object;
var pTweening = pTweening;
var pError = pError;
var pCallBackName = pCallBackName;
if (((Boolean(pTweening.onError)) && ((pTweening.onError is Function)))){
eventScope = (Boolean(pTweening.onErrorScope)) ? pTweening.onErrorScope : pTweening.scope;
pTweening.onError.apply(eventScope, [pTweening.scope, pError]);
//unresolved jump
var _slot1 = metaError;
printError(((((String(pTweening.scope) + " raised an error while executing the 'onError' handler. Original error:\n ") + pError.getStackTrace()) + "\nonError error: ") + _slot1.getStackTrace()));
} else {
if (!Boolean(pTweening.onError)){
printError(((((String(pTweening.scope) + " raised an error while executing the '") + pCallBackName) + "'handler. \n") + pError.getStackTrace()));
};
};
}
private static function startEngine():void{
_engineExists = true;
_tweenList = new Array();
__tweener_controller__ = new MovieClip();
__tweener_controller__.addEventListener(Event.ENTER_FRAME, Tweener.onEnterFrame);
_currentTimeFrame = 0;
updateTime();
}
public static function removeAllTweens():Boolean{
var i:uint;
if (!Boolean(_tweenList)){
return (false);
};
var removed:Boolean;
i = 0;
while (i < _tweenList.length) {
removeTweenByIndex(i);
removed = true;
i++;
};
return (removed);
}
public static function addTween(p_scopes:Object=null, p_parameters:Object=null):Boolean{
var i:Number;
var j:Number;
var istr:String;
var rScopes:Array;
var rTransition:Function;
var nProperties:Object;
var nTween:TweenListObj;
var myT:Number;
var splitProperties:Array;
var splitProperties2:Array;
var tempModifiedProperties:Array;
var trans:String;
if (!Boolean(p_scopes)){
return (false);
};
if ((p_scopes is Array)){
rScopes = p_scopes.concat();
} else {
rScopes = [p_scopes];
};
var p_obj:Object = TweenListObj.makePropertiesChain(p_parameters);
if (!_inited){
init();
};
if (((!(_engineExists)) || (!(Boolean(__tweener_controller__))))){
startEngine();
};
var rTime:Number = (isNaN(p_obj.time)) ? 0 : p_obj.time;
var rDelay:Number = (isNaN(p_obj.delay)) ? 0 : p_obj.delay;
var rProperties:Array = new Array();
var restrictedWords:Object = {overwrite:true, time:true, delay:true, useFrames:true, skipUpdates:true, transition:true, transitionParams:true, onStart:true, onUpdate:true, onComplete:true, onOverwrite:true, onError:true, rounded:true, onStartParams:true, onUpdateParams:true, onCompleteParams:true, onOverwriteParams:true, onStartScope:true, onUpdateScope:true, onCompleteScope:true, onOverwriteScope:true, onErrorScope:true};
var modifiedProperties:Object = new Object();
for (istr in p_obj) {
if (!restrictedWords[istr]){
if (_specialPropertySplitterList[istr]){
splitProperties = _specialPropertySplitterList[istr].splitValues(p_obj[istr], _specialPropertySplitterList[istr].parameters);
i = 0;
while (i < splitProperties.length) {
if (_specialPropertySplitterList[splitProperties[i].name]){
splitProperties2 = _specialPropertySplitterList[splitProperties[i].name].splitValues(splitProperties[i].value, _specialPropertySplitterList[splitProperties[i].name].parameters);
j = 0;
while (j < splitProperties2.length) {
rProperties[splitProperties2[j].name] = {valueStart:undefined, valueComplete:splitProperties2[j].value, arrayIndex:splitProperties2[j].arrayIndex, isSpecialProperty:false};
j++;
};
} else {
rProperties[splitProperties[i].name] = {valueStart:undefined, valueComplete:splitProperties[i].value, arrayIndex:splitProperties[i].arrayIndex, isSpecialProperty:false};
};
i++;
};
} else {
if (_specialPropertyModifierList[istr] != undefined){
tempModifiedProperties = _specialPropertyModifierList[istr].modifyValues(p_obj[istr]);
i = 0;
while (i < tempModifiedProperties.length) {
modifiedProperties[tempModifiedProperties[i].name] = {modifierParameters:tempModifiedProperties[i].parameters, modifierFunction:_specialPropertyModifierList[istr].getValue};
i++;
};
} else {
rProperties[istr] = {valueStart:undefined, valueComplete:p_obj[istr]};
};
};
};
};
for (istr in rProperties) {
if (_specialPropertyList[istr] != undefined){
rProperties[istr].isSpecialProperty = true;
} else {
if (rScopes[0][istr] == undefined){
printError((((("The property '" + istr) + "' doesn't seem to be a normal object property of ") + String(rScopes[0])) + " or a registered special property."));
};
};
};
for (istr in modifiedProperties) {
if (rProperties[istr] != undefined){
rProperties[istr].modifierParameters = modifiedProperties[istr].modifierParameters;
rProperties[istr].modifierFunction = modifiedProperties[istr].modifierFunction;
};
};
if (typeof(p_obj.transition) == "string"){
trans = p_obj.transition.toLowerCase();
rTransition = _transitionList[trans];
} else {
rTransition = p_obj.transition;
};
if (!Boolean(rTransition)){
rTransition = _transitionList["easeoutexpo"];
};
i = 0;
while (i < rScopes.length) {
nProperties = new Object();
for (istr in rProperties) {
nProperties[istr] = new PropertyInfoObj(rProperties[istr].valueStart, rProperties[istr].valueComplete, rProperties[istr].valueComplete, rProperties[istr].arrayIndex, {}, rProperties[istr].isSpecialProperty, rProperties[istr].modifierFunction, rProperties[istr].modifierParameters);
};
if (p_obj.useFrames == true){
nTween = new TweenListObj(rScopes[i], (_currentTimeFrame + (rDelay / _timeScale)), (_currentTimeFrame + ((rDelay + rTime) / _timeScale)), true, rTransition, p_obj.transitionParams);
} else {
nTween = new TweenListObj(rScopes[i], (_currentTime + ((rDelay * 1000) / _timeScale)), (_currentTime + (((rDelay * 1000) + (rTime * 1000)) / _timeScale)), false, rTransition, p_obj.transitionParams);
};
nTween.properties = nProperties;
nTween.onStart = p_obj.onStart;
nTween.onUpdate = p_obj.onUpdate;
nTween.onComplete = p_obj.onComplete;
nTween.onOverwrite = p_obj.onOverwrite;
nTween.onError = p_obj.onError;
nTween.onStartParams = p_obj.onStartParams;
nTween.onUpdateParams = p_obj.onUpdateParams;
nTween.onCompleteParams = p_obj.onCompleteParams;
nTween.onOverwriteParams = p_obj.onOverwriteParams;
nTween.onStartScope = p_obj.onStartScope;
nTween.onUpdateScope = p_obj.onUpdateScope;
nTween.onCompleteScope = p_obj.onCompleteScope;
nTween.onOverwriteScope = p_obj.onOverwriteScope;
nTween.onErrorScope = p_obj.onErrorScope;
nTween.rounded = p_obj.rounded;
nTween.skipUpdates = p_obj.skipUpdates;
if (((p_obj.overwrite == undefined)) ? autoOverwrite : p_obj.overwrite){
removeTweensByTime(nTween.scope, nTween.properties, nTween.timeStart, nTween.timeComplete);
};
_tweenList.push(nTween);
if ((((rTime == 0)) && ((rDelay == 0)))){
myT = (_tweenList.length - 1);
updateTweenByIndex(myT);
removeTweenByIndex(myT);
};
i++;
};
return (true);
}
public static function registerTransition(p_name:String, p_function:Function):void{
if (!_inited){
init();
};
_transitionList[p_name] = p_function;
}
public static function printError(p_message:String):void{
trace(("## [Tweener] Error: " + p_message));
}
private static function affectTweens(p_affectFunction:Function, p_scope:Object, p_properties:Array):Boolean{
var i:uint;
var affectedProperties:Array;
var j:uint;
var objectProperties:uint;
var slicedTweenIndex:uint;
var affected:Boolean;
if (!Boolean(_tweenList)){
return (false);
};
i = 0;
while (i < _tweenList.length) {
if (((_tweenList[i]) && ((_tweenList[i].scope == p_scope)))){
if (p_properties.length == 0){
p_affectFunction(i);
affected = true;
} else {
affectedProperties = new Array();
j = 0;
while (j < p_properties.length) {
if (Boolean(_tweenList[i].properties[p_properties[j]])){
affectedProperties.push(p_properties[j]);
};
j++;
};
if (affectedProperties.length > 0){
objectProperties = AuxFunctions.getObjectLength(_tweenList[i].properties);
if (objectProperties == affectedProperties.length){
p_affectFunction(i);
affected = true;
} else {
slicedTweenIndex = splitTweens(i, affectedProperties);
p_affectFunction(slicedTweenIndex);
affected = true;
};
};
};
};
i++;
};
return (affected);
}
public static function getTweens(p_scope:Object):Array{
var i:uint;
var pName:String;
if (!Boolean(_tweenList)){
return ([]);
};
var tList:Array = new Array();
i = 0;
while (i < _tweenList.length) {
if (((Boolean(_tweenList[i])) && ((_tweenList[i].scope == p_scope)))){
for (pName in _tweenList[i].properties) {
tList.push(pName);
};
};
i++;
};
return (tList);
}
public static function isTweening(p_scope:Object):Boolean{
var i:uint;
if (!Boolean(_tweenList)){
return (false);
};
i = 0;
while (i < _tweenList.length) {
if (((Boolean(_tweenList[i])) && ((_tweenList[i].scope == p_scope)))){
return (true);
};
i++;
};
return (false);
}
public static function pauseTweenByIndex(p_tween:Number):Boolean{
var tTweening:TweenListObj = _tweenList[p_tween];
if ((((tTweening == null)) || (tTweening.isPaused))){
return (false);
};
tTweening.timePaused = getCurrentTweeningTime(tTweening);
tTweening.isPaused = true;
return (true);
}
public static function getCurrentTweeningTime(p_tweening:Object):Number{
return ((p_tweening.useFrames) ? _currentTimeFrame : _currentTime);
}
public static function getTweenCount(p_scope:Object):Number{
var i:uint;
if (!Boolean(_tweenList)){
return (0);
};
var c:Number = 0;
i = 0;
while (i < _tweenList.length) {
if (((Boolean(_tweenList[i])) && ((_tweenList[i].scope == p_scope)))){
c = (c + AuxFunctions.getObjectLength(_tweenList[i].properties));
};
i++;
};
return (c);
}
private static function stopEngine():void{
_engineExists = false;
_tweenList = null;
_currentTime = 0;
_currentTimeFrame = 0;
__tweener_controller__.removeEventListener(Event.ENTER_FRAME, Tweener.onEnterFrame);
__tweener_controller__ = null;
}
public static function removeTweensByTime(p_scope:Object, p_properties:Object, p_timeStart:Number, p_timeComplete:Number):Boolean{
var removedLocally:Boolean;
var i:uint;
var pName:String;
var eventScope:Object;
var p_scope = p_scope;
var p_properties = p_properties;
var p_timeStart = p_timeStart;
var p_timeComplete = p_timeComplete;
var removed:Boolean;
var tl:uint = _tweenList.length;
i = 0;
while (i < tl) {
if (((Boolean(_tweenList[i])) && ((p_scope == _tweenList[i].scope)))){
if ((((p_timeComplete > _tweenList[i].timeStart)) && ((p_timeStart < _tweenList[i].timeComplete)))){
removedLocally = false;
for (pName in _tweenList[i].properties) {
if (Boolean(p_properties[pName])){
if (Boolean(_tweenList[i].onOverwrite)){
eventScope = (Boolean(_tweenList[i].onOverwriteScope)) ? _tweenList[i].onOverwriteScope : _tweenList[i].scope;
_tweenList[i].onOverwrite.apply(eventScope, _tweenList[i].onOverwriteParams);
//unresolved jump
var _slot1 = e;
handleError(_tweenList[i], _slot1, "onOverwrite");
};
_tweenList[i].properties[pName] = undefined;
delete _tweenList[i].properties[pName];
removedLocally = true;
removed = true;
};
};
if (removedLocally){
if (AuxFunctions.getObjectLength(_tweenList[i].properties) == 0){
removeTweenByIndex(i);
};
};
};
};
i = (i + 1);
};
return (removed);
}
public static function registerSpecialPropertySplitter(p_name:String, p_splitFunction:Function, p_parameters:Array=null):void{
if (!_inited){
init();
};
var sps:SpecialPropertySplitter = new SpecialPropertySplitter(p_splitFunction, p_parameters);
_specialPropertySplitterList[p_name] = sps;
}
public static function removeTweenByIndex(i:Number, p_finalRemoval:Boolean=false):Boolean{
_tweenList[i] = null;
if (p_finalRemoval){
_tweenList.splice(i, 1);
};
return (true);
}
public static function resumeTweens(p_scope:Object, ... _args):Boolean{
var i:uint;
var properties:Array = new Array();
i = 0;
while (i < _args.length) {
if ((((typeof(_args[i]) == "string")) && ((properties.indexOf(_args[i]) == -1)))){
properties.push(_args[i]);
};
i++;
};
return (affectTweens(resumeTweenByIndex, p_scope, properties));
}
public static function pauseTweens(p_scope:Object, ... _args):Boolean{
var i:uint;
var properties:Array = new Array();
i = 0;
while (i < _args.length) {
if ((((typeof(_args[i]) == "string")) && ((properties.indexOf(_args[i]) == -1)))){
properties.push(_args[i]);
};
i++;
};
return (affectTweens(pauseTweenByIndex, p_scope, properties));
}
}
}//package caurina.transitions
Section 8
//TweenListObj (caurina.transitions.TweenListObj)
package caurina.transitions {
public class TweenListObj {
public var hasStarted:Boolean;
public var onUpdate:Function;
public var useFrames:Boolean;
public var count:Number;
public var onOverwriteParams:Array;
public var timeStart:Number;
public var timeComplete:Number;
public var onStartParams:Array;
public var onUpdateScope:Object;
public var rounded:Boolean;
public var onUpdateParams:Array;
public var properties:Object;
public var onComplete:Function;
public var transitionParams:Object;
public var updatesSkipped:Number;
public var onStart:Function;
public var onOverwriteScope:Object;
public var skipUpdates:Number;
public var onStartScope:Object;
public var scope:Object;
public var isCaller:Boolean;
public var timePaused:Number;
public var transition:Function;
public var onCompleteParams:Array;
public var onError:Function;
public var timesCalled:Number;
public var onErrorScope:Object;
public var onOverwrite:Function;
public var isPaused:Boolean;
public var waitFrames:Boolean;
public var onCompleteScope:Object;
public function TweenListObj(p_scope:Object, p_timeStart:Number, p_timeComplete:Number, p_useFrames:Boolean, p_transition:Function, p_transitionParams:Object){
super();
scope = p_scope;
timeStart = p_timeStart;
timeComplete = p_timeComplete;
useFrames = p_useFrames;
transition = p_transition;
transitionParams = p_transitionParams;
properties = new Object();
isPaused = false;
timePaused = undefined;
isCaller = false;
updatesSkipped = 0;
timesCalled = 0;
skipUpdates = 0;
hasStarted = false;
}
public function clone(omitEvents:Boolean):TweenListObj{
var pName:String;
var nTween:TweenListObj = new TweenListObj(scope, timeStart, timeComplete, useFrames, transition, transitionParams);
nTween.properties = new Array();
for (pName in properties) {
nTween.properties[pName] = properties[pName].clone();
};
nTween.skipUpdates = skipUpdates;
nTween.updatesSkipped = updatesSkipped;
if (!omitEvents){
nTween.onStart = onStart;
nTween.onUpdate = onUpdate;
nTween.onComplete = onComplete;
nTween.onOverwrite = onOverwrite;
nTween.onError = onError;
nTween.onStartParams = onStartParams;
nTween.onUpdateParams = onUpdateParams;
nTween.onCompleteParams = onCompleteParams;
nTween.onOverwriteParams = onOverwriteParams;
nTween.onStartScope = onStartScope;
nTween.onUpdateScope = onUpdateScope;
nTween.onCompleteScope = onCompleteScope;
nTween.onOverwriteScope = onOverwriteScope;
nTween.onErrorScope = onErrorScope;
};
nTween.rounded = rounded;
nTween.isPaused = isPaused;
nTween.timePaused = timePaused;
nTween.isCaller = isCaller;
nTween.count = count;
nTween.timesCalled = timesCalled;
nTween.waitFrames = waitFrames;
nTween.hasStarted = hasStarted;
return (nTween);
}
public function toString():String{
var i:String;
var returnStr:String = "\n[TweenListObj ";
returnStr = (returnStr + ("scope:" + String(scope)));
returnStr = (returnStr + ", properties:");
var isFirst:Boolean;
for (i in properties) {
if (!isFirst){
returnStr = (returnStr + ",");
};
returnStr = (returnStr + ("[name:" + properties[i].name));
returnStr = (returnStr + (",valueStart:" + properties[i].valueStart));
returnStr = (returnStr + (",valueComplete:" + properties[i].valueComplete));
returnStr = (returnStr + "]");
isFirst = false;
};
returnStr = (returnStr + (", timeStart:" + String(timeStart)));
returnStr = (returnStr + (", timeComplete:" + String(timeComplete)));
returnStr = (returnStr + (", useFrames:" + String(useFrames)));
returnStr = (returnStr + (", transition:" + String(transition)));
returnStr = (returnStr + (", transitionParams:" + String(transitionParams)));
if (skipUpdates){
returnStr = (returnStr + (", skipUpdates:" + String(skipUpdates)));
};
if (updatesSkipped){
returnStr = (returnStr + (", updatesSkipped:" + String(updatesSkipped)));
};
if (Boolean(onStart)){
returnStr = (returnStr + (", onStart:" + String(onStart)));
};
if (Boolean(onUpdate)){
returnStr = (returnStr + (", onUpdate:" + String(onUpdate)));
};
if (Boolean(onComplete)){
returnStr = (returnStr + (", onComplete:" + String(onComplete)));
};
if (Boolean(onOverwrite)){
returnStr = (returnStr + (", onOverwrite:" + String(onOverwrite)));
};
if (Boolean(onError)){
returnStr = (returnStr + (", onError:" + String(onError)));
};
if (onStartParams){
returnStr = (returnStr + (", onStartParams:" + String(onStartParams)));
};
if (onUpdateParams){
returnStr = (returnStr + (", onUpdateParams:" + String(onUpdateParams)));
};
if (onCompleteParams){
returnStr = (returnStr + (", onCompleteParams:" + String(onCompleteParams)));
};
if (onOverwriteParams){
returnStr = (returnStr + (", onOverwriteParams:" + String(onOverwriteParams)));
};
if (onStartScope){
returnStr = (returnStr + (", onStartScope:" + String(onStartScope)));
};
if (onUpdateScope){
returnStr = (returnStr + (", onUpdateScope:" + String(onUpdateScope)));
};
if (onCompleteScope){
returnStr = (returnStr + (", onCompleteScope:" + String(onCompleteScope)));
};
if (onOverwriteScope){
returnStr = (returnStr + (", onOverwriteScope:" + String(onOverwriteScope)));
};
if (onErrorScope){
returnStr = (returnStr + (", onErrorScope:" + String(onErrorScope)));
};
if (rounded){
returnStr = (returnStr + (", rounded:" + String(rounded)));
};
if (isPaused){
returnStr = (returnStr + (", isPaused:" + String(isPaused)));
};
if (timePaused){
returnStr = (returnStr + (", timePaused:" + String(timePaused)));
};
if (isCaller){
returnStr = (returnStr + (", isCaller:" + String(isCaller)));
};
if (count){
returnStr = (returnStr + (", count:" + String(count)));
};
if (timesCalled){
returnStr = (returnStr + (", timesCalled:" + String(timesCalled)));
};
if (waitFrames){
returnStr = (returnStr + (", waitFrames:" + String(waitFrames)));
};
if (hasStarted){
returnStr = (returnStr + (", hasStarted:" + String(hasStarted)));
};
returnStr = (returnStr + "]\n");
return (returnStr);
}
public static function makePropertiesChain(p_obj:Object):Object{
var chainedObject:Object;
var chain:Object;
var currChainObj:Object;
var len:Number;
var i:Number;
var k:Number;
var baseObject:Object = p_obj.base;
if (baseObject){
chainedObject = {};
if ((baseObject is Array)){
chain = [];
k = 0;
while (k < baseObject.length) {
chain.push(baseObject[k]);
k++;
};
} else {
chain = [baseObject];
};
chain.push(p_obj);
len = chain.length;
i = 0;
while (i < len) {
if (chain[i]["base"]){
currChainObj = AuxFunctions.concatObjects(makePropertiesChain(chain[i]["base"]), chain[i]);
} else {
currChainObj = chain[i];
};
chainedObject = AuxFunctions.concatObjects(chainedObject, currChainObj);
i++;
};
if (chainedObject["base"]){
delete chainedObject["base"];
};
return (chainedObject);
//unresolved jump
};
return (p_obj);
}
}
}//package caurina.transitions
Section 9
//Actor (Element.Actor)
package Element {
import flash.geom.*;
import flash.display.*;
import UserdefinedClass.*;
import Gamestage.*;
public class Actor extends MovieClip {
public var Maxvx:Number;// = 8
public var Maxvy:Number;// = 15
public var temptotal:Number;// = 0
public var PGroup:Array;
public var Lhitwall:Boolean;// = false
public var attackbtn:Boolean;// = false
public var airTimeCount:int;// = 0
public var jumpTime:int;// = 0
public var hitP:int;// = 0
public var secS:Number;// = 0.8
public var brake:MovieClip;
public var JUMP:MovieClip;
public var spState:Boolean;// = false
public var StateArr:Array;
public var testlen:int;// = 2
public var G:Number;// = 1
public var H:Number;
public var Rhitwall:Boolean;// = false
public var standattack1:MovieClip;
public var W:Number;
public var hitmc:MovieClip;
public var jumpbtn:Boolean;// = false
public var aircache:Boolean;// = false
public var LastState:int;// = -1
public var wallMaxvy:Number;// = 3
public var airstate:Boolean;// = true
public var run:MovieClip;
public var effect:Effect;
public var hit:MovieClip;
public var actorState:String;
public var rightBtn:Boolean;// = false
public var jumpcount:int;// = 0
public var stoptimecount:int;// = 0
public var spCount:int;// = 0
public var changeaircount:int;// = 0
public var Hitwall:MovieClip;
public var vx:Number;// = 0
public var vy:Number;// = 0
public var cancombo:Boolean;// = true
public var airChangeMaxCount:int;// = 130
public var basestage:BaseStage;
public var watch:MovieClip;
public var leftBtn:Boolean;// = false
public var stand:MovieClip;
public var addS:Number;// = 0.8
public var wallJumpvx:Number;// = 8
public var JumpMaxS:Number;// = 10
public var wallattack1:MovieClip;
public var hitwall:Boolean;// = false
public var attackSpeed:Number;// = 10
public var StateMc:Array;
public var attack2:MovieClip;
public var canjumpTime:int;// = 3
public var canattacktime:Boolean;// = true
public var drop:MovieClip;
public var walljump:MovieClip;
public var standcount:int;// = 0
public var runattack1:MovieClip;
public var climbwall:MovieClip;
public function Actor(obj:BaseStage=null){
PGroup = new Array();
StateArr = new Array("stand", "watch", "run", "brake", "JUMP", "drop", "Hitwall", "climbwall", "walljump", "standattack1", "runattack1", "attack2", "wallattack1");
StateMc = new Array();
super();
}
public function isair():Boolean{
var temphit:Boolean;
Lhitwall = false;
Rhitwall = false;
var b:Boolean;
var i:int;
while (i < 3) {
if (canmove(basestage.HitMc, DGroup(i).add(new Point(0, 1)))){
} else {
b = false;
};
i++;
};
if (b){
if (leftBtn){
temphit = true;
i = 0;
while (i < 5) {
if (canmove(basestage.HitMc, LGroup(i).add(new Point(-1, 0)))){
temphit = false;
};
i++;
};
if (temphit){
hitwall = true;
Lhitwall = true;
} else {
hitwall = false;
};
};
if (rightBtn){
temphit = true;
i = 0;
while (i < 5) {
if (canmove(basestage.HitMc, RGroup(i).add(new Point(1, 0)))){
temphit = false;
};
i++;
};
if (temphit){
hitwall = true;
Rhitwall = true;
} else {
hitwall = false;
};
};
if (((!(rightBtn)) && (!(leftBtn)))){
hitwall = false;
};
};
airstate = b;
return (b);
}
public function moveright(){
if (aircache){
return;
};
rightBtn = true;
if (!spState){
if ((vx < Maxvx)){
vx = (vx + addS);
} else {
vx = Maxvx;
};
};
if ((((this.scaleX < 0)) && (!(spState)))){
if (LastState == 6){
addMc(4, 15);
};
scaleX = (scaleX * -1);
};
}
public function timetostop(num:int){
stoptimecount = num;
}
public function updata(key:Boolean=false){
isair();
if (spState){
spCount--;
if (spCount == 0){
if (aircache){
aircache = false;
};
spState = false;
};
};
if (stoptimecount != 0){
stoptimecount--;
if (LastState == 11){
basestage.hitenemy(this.scaleX, Position);
};
if (stoptimecount == 0){
if (vx != 0){
vx = 0;
};
if (airstate){
addMc(4);
};
};
};
if (airstate){
if ((((LastState == 0)) || ((LastState == 1)))){
addMc(4, 15);
};
if (vy > 0){
airTimeCount = (airTimeCount + vy);
};
if (((vy + G) < Maxvy)){
vy = (vy + G);
} else {
vy = Maxvy;
};
if (hitwall){
if ((vy > wallMaxvy)){
vy = wallMaxvy;
} else {
vy;
};
};
} else {
if (airTimeCount >= airChangeMaxCount){
basestage.showyan();
aircache = true;
vx = 0;
setspState(19);
addMc(5);
};
airTimeCount = 0;
resetjump();
vy = 0;
};
if (jumpbtn){
canjump();
};
if (attackbtn){
canattack();
};
if (key){
if (vx > 0){
if (((vx - secS) > 0)){
vx = (vx - secS);
} else {
vx = 0;
};
} else {
if (((vx + secS) < 0)){
vx = (vx + secS);
} else {
vx = 0;
};
};
};
workX();
x = (x + (vx >> 0));
workY();
y = (y + (vy >> 0));
x = (x >> 0);
y = (y >> 0);
basestage.updatacamera();
workstate();
}
public function init(){
loaddata();
buildactor();
initMc();
addMc(0);
initEffect();
}
public function addMc(Num:int, frame:int=1, _stop:Boolean=false){
LastState = Num;
Clr.removeAllChildren(this);
this.addChild((StateMc[Num] as MovieClip));
if (_stop){
StateMc[Num].gotoAndStop(frame);
} else {
StateMc[Num].gotoAndPlay(frame);
};
}
public function canattack(){
if (spState){
return;
};
if (!canattacktime){
return;
};
canattacktime = false;
if ((this.scaleX > 0)){
vx = attackSpeed;
} else {
vx = -(attackSpeed);
};
setspState(20);
timetostop(20);
addMc(11);
Main.sowrdsd.playsound(1);
}
public function workstate(){
if (!airstate){
if (spState){
return;
};
if (vx == 0){
standcount++;
if ((((standcount > 120)) && ((standcount < 360)))){
((!((LastState == 1))) && (addMc(1)));
} else {
if ((((standcount <= 120)) || ((standcount >= 360)))){
((!((LastState == 0))) && (addMc(0)));
if (standcount > 360){
standcount = 0;
};
} else {
return;
};
};
} else {
if (Math.abs(vx) > 1){
if (((leftBtn) || (rightBtn))){
((!((LastState == 2))) && (addMc(2)));
} else {
((!((LastState == 3))) && (addMc(3)));
if (vx > 0){
if (scaleX < 0){
scaleX = (scaleX * -1);
};
} else {
if (scaleX > 0){
scaleX = (scaleX * -1);
};
};
};
};
};
changeaircount = 0;
} else {
if (hitwall){
airTimeCount = 0;
((!((LastState == 6))) && (addMc(6)));
} else {
if ((((((((((LastState == 6)) || ((LastState == 2)))) || ((LastState == 3)))) || ((LastState == 0)))) || ((LastState == 1)))){
if (changeaircount > 9){
changeaircount = 0;
((!((LastState == 4))) && (addMc(4, 15)));
};
changeaircount++;
};
};
};
}
public function get R3():Point{
return (new Point((Position.x + W), (Position.y - (H * 2))));
}
public function setactorXY():void{
this.x = basestage.actorXY[(basestage.lv - 1)][0];
this.y = basestage.actorXY[(basestage.lv - 1)][1];
}
public function restartMc(){
if (StateMc[LastState].totalFrames > 1){
if (StateMc[LastState].currentFrame != StateMc[LastState].totalFrames){
StateMc[LastState].gotoAndPlay(StateMc[LastState].currentFrame);
};
};
}
public function UGroup(num:int):Point{
var tempArr:Array = new Array(L1, M1, R1);
return (tempArr[num]);
}
public function get R2():Point{
return (new Point((Position.x + W), (Position.y - (H * 3))));
}
public function MGroup(num:int):Point{
var tempArr:Array = new Array(M1, M2);
return (tempArr[num]);
}
public function jump(){
jumpbtn = true;
}
public function get R5():Point{
return (new Point((Position.x + W), Position.y));
}
public function stopMc(){
if (StateMc[LastState].totalFrames > 1){
StateMc[LastState].stop();
};
}
public function workslope(p:Point, way:int, ud:int):int{
var tempArr:Array = new Array(R5, L5);
var tempP:Point = new Point((tempArr[way].x + p.x), (tempArr[way].y + p.y));
var tempNum:int;
var i = 20;
while (i > 0) {
if (!canmove(basestage.HitMc, tempP)){
tempP = tempP.add(new Point(0, ud));
tempNum--;
} else {
break;
};
i--;
};
return (tempNum);
}
public function get Position():Point{
return (MyMath.LtoG(basestage.debugsp, this));
}
public function get R1():Point{
return (new Point((Position.x + W), (Position.y - (H * 4))));
}
public function RGroup(num:int):Point{
var tempArr:Array = new Array(R1, R2, R3, R4, R5);
return (tempArr[num]);
}
public function buildactor(){
setactorXY();
basestage.actorsp.addChild(this);
}
public function canjump(){
if (aircache){
return;
};
hitwall = false;
if (jumpTime >= canjumpTime){
cancombo = false;
};
if (airstate){
if (cancombo){
if (jumpcount < 10){
jumpcount++;
vy = -(JumpMaxS);
if (LastState == 4){
addMc(4);
};
if (Lhitwall){
basestage.showyan(90, -(H));
((!((LastState == 8))) && (addMc(8)));
vx = (vx + wallJumpvx);
};
if (Rhitwall){
basestage.showyan(-90, -(H));
((!((LastState == 8))) && (addMc(8)));
vx = (vx - wallJumpvx);
};
};
};
} else {
y = (y - 1);
vy = -(JumpMaxS);
((!((LastState == 4))) && (addMc(4)));
if (Lhitwall){
((!((LastState == 8))) && (addMc(8)));
vx = (vx + wallJumpvx);
};
if (Rhitwall){
((!((LastState == 8))) && (addMc(8)));
vx = (vx - wallJumpvx);
};
};
}
public function moveleft(){
if (aircache){
return;
};
leftBtn = true;
if (!spState){
if ((vx > -(Maxvx))){
vx = (vx - addS);
} else {
vx = -(Maxvx);
};
};
if ((((this.scaleX > 0)) && (!(spState)))){
if (LastState == 6){
addMc(4, 15);
};
scaleX = (scaleX * -1);
};
}
public function get R4():Point{
return (new Point((Position.x + W), (Position.y - (H * 1))));
}
public function workdownslope(_vp:Point, way:int, ud:int):int{
var tempArr:Array = new Array(R5, L5);
var tempP:Point = new Point((tempArr[way].x + _vp.x), (tempArr[way].y + _vp.y));
var tempNum:int;
var i = 5;
while (i > 0) {
if (canmove(basestage.HitMc, tempP)){
tempP = tempP.add(new Point(0, ud));
tempNum++;
} else {
break;
};
i--;
};
return (tempNum);
}
public function workActorXY():void{
var hitbool:Boolean;
var tempArrR:Array = new Array(R1, R2, R3, R4, R5);
var tempArrL:Array = new Array(L1, L2, L3, L4, L5);
var tempArrU:Array = new Array(L1, M1, R1);
var tempArrD:Array = new Array(L5, M2, R5);
var tempTArr:Array = new Array(tempArrR, tempArrL, tempArrU, tempArrD);
var tempArr:Array = new Array();
var templen:int;
var j:int;
var k:int;
var tempAdd:Array = new Array(new Point(-1, 0), new Point(1, 0), new Point(0, 1), new Point(0, -1));
var i:int;
while (i < 4) {
templen = tempTArr[i].length;
tempArr = tempTArr[i];
k = 1;
hitbool = false;
while (k <= testlen) {
j = 0;
while (j < templen) {
if (!canmove(basestage.HitMc, tempArr[j])){
hitbool = true;
};
j++;
};
if (hitbool){
x = (x + tempAdd[i].x);
y = (y + tempAdd[i].y);
hitbool = false;
k++;
} else {
hitbool = false;
break;
};
};
i++;
};
}
public function get L2():Point{
return (new Point((Position.x - W), (Position.y - (H * 3))));
}
public function workX():void{
if (vx == 0){
return;
};
var Xway:int = ((vx >= 0)) ? 1 : -1;
var i:int = Math.abs(vx);
var done:Boolean;
var j:int;
if (Xway == 1){
while (i > 0) {
done = true;
j = 0;
while (j < 5) {
hitP = j;
if (canmove(basestage.HitMc, RGroup(j).add(new Point(vx, 0)))){
} else {
done = false;
break;
};
j++;
};
if (done){
break;
};
if (hitP == 4){
y = (y + workslope(new Point(vx, 0), 0, -1));
break;
} else {
vx = (vx - Xway);
i--;
};
};
} else {
while (i > 0) {
done = true;
j = 0;
while (j < 5) {
hitP = j;
if (canmove(basestage.HitMc, LGroup(j).add(new Point(vx, 0)))){
} else {
done = false;
break;
};
j++;
};
if (done){
break;
};
if (hitP == 4){
y = (y + workslope(new Point(vx, 0), 1, -1));
break;
} else {
vx = (vx - Xway);
i--;
};
};
};
hitP = 5;
if (Xway == 1){
j = 0;
while (j < 3) {
if (!canmove(basestage.HitMc, DGroup(j).add(new Point(0, 1)))){
hitP = j;
};
j++;
};
if (hitP == 0){
if (!canmove(basestage.HitMc, DGroup(0).add(new Point(-1, 0)))){
y = (y + workdownslope(new Point(vx, 0), 1, 1));
};
};
} else {
j = 2;
while (j >= 0) {
if (!canmove(basestage.HitMc, DGroup(j).add(new Point(0, 1)))){
hitP = j;
};
j--;
};
if (hitP == 2){
if (!canmove(basestage.HitMc, DGroup(2).add(new Point(1, 0)))){
y = (y + workdownslope(new Point(vx, 0), 0, 1));
};
};
};
}
public function get L1():Point{
return (new Point((Position.x - W), (Position.y - (H * 4))));
}
public function workY():void{
if (vy == 0){
return;
};
var Yway:int = ((vy >= 0)) ? 1 : -1;
var i:int = Math.abs(vy);
var done:Boolean;
var j:int;
if (Yway == 1){
while (i > 0) {
done = true;
j = 0;
while (j < 3) {
if (canmove(basestage.HitMc, DGroup(j).add(new Point(0, vy)))){
} else {
done = false;
};
j++;
};
if (done){
break;
};
vy = (vy - Yway);
i--;
};
} else {
while (i > 0) {
done = true;
j = 0;
while (j < 3) {
if (canmove(basestage.HitMc, UGroup(j).add(new Point(0, vy)))){
} else {
done = false;
};
j++;
};
if (done){
break;
};
vy = (vy - Yway);
i--;
};
};
}
public function get L5():Point{
return (new Point((Position.x - W), Position.y));
}
public function attack(){
attackbtn = true;
}
public function get L3():Point{
return (new Point((Position.x - W), (Position.y - (H * 2))));
}
public function get L4():Point{
return (new Point((Position.x - W), (Position.y - (H * 1))));
}
public function get M2():Point{
return (new Point(Position.x, Position.y));
}
public function setspState(_count:int){
spCount = _count;
spState = true;
}
public function loaddata(){
attackSpeed = (15 + (MyData.getInstance().addv[0] * 5));
canjumpTime = (2 + MyData.getInstance().addv[1]);
wallMaxvy = (9 - (MyData.getInstance().addv[2] * 2));
hitmc = (getChildByName("hit") as MovieClip);
addChild(hitmc);
H = (hitmc.height * 0.25);
W = (hitmc.width * 0.5);
}
public function DGroup(num:int):Point{
var tempArr:Array = new Array(L5, M2, R5);
return (tempArr[num]);
}
public function LGroup(num:int):Point{
var tempArr:Array = new Array(L1, L2, L3, L4, L5);
return (tempArr[num]);
}
public function canmove(mc:DisplayObjectContainer, p:Point):Boolean{
var tempmc:MovieClip;
var tempP:Point;
var i:int;
var tempbool:Boolean = mc.hitTestPoint(p.x, p.y, true);
var tempArr:Array = new Array();
var templen:int = mc.numChildren;
if (tempbool){
i = 0;
while (i < templen) {
tempmc = (mc.getChildAt(i) as MovieClip);
if (tempmc.hitTestPoint(p.x, p.y, true)){
break;
};
i++;
};
if (tempmc.constructor == pierce){
tempP = MyMath.LtoG(basestage.stage, tempmc);
tempP = tempP.add(new Point(0, (-(tempmc.height) * 0.5)));
if (R5.y > tempP.y){
return (tempbool);
};
return (!(tempbool));
};
};
return (!(tempbool));
}
public function get M1():Point{
return (new Point(Position.x, (Position.y - (H * 4))));
}
public function initMc(){
var tempMc:MovieClip;
var len:int = StateArr.length;
var i:int;
while (i < len) {
tempMc = (this.getChildByName(StateArr[i]) as MovieClip);
StateMc.push(tempMc);
if (tempMc.parent){
tempMc.parent.removeChild(tempMc);
};
i++;
};
}
public function initEffect(){
effect = new Effect(basestage.effectsp, this);
}
public function iswall():Boolean{
var b:Boolean;
var i:int;
if (vx >= 0){
i = 0;
while (i < 4) {
if (canmove(basestage.HitMc, RGroup(i).add(new Point(vx, 0)))){
b = true;
};
i++;
};
} else {
i = 0;
while (i < 4) {
if (canmove(basestage.HitMc, LGroup(i).add(new Point(vx, 0)))){
b = true;
};
i++;
};
};
return (b);
}
public function resetjump(){
canattacktime = true;
jumpTime = 0;
cancombo = true;
jumpcount = 0;
}
}
}//package Element
Section 10
//Effect (Element.Effect)
package Element {
import flash.geom.*;
import flash.display.*;
import UserdefinedClass.*;
import flash.filters.*;
public class Effect extends MovieClip {
public var container:DisplayObjectContainer;
public var MaxNum:int;// = 5
public var TimeDistance:Number;// = 0.1
public var objMc:MovieClip;
private var count:Number;// = 0
public var alphaSpeed:Number;// = 0.1
public var FPS:int;// = 60
public var LastPoint:Point;
public function Effect(con:DisplayObjectContainer, obj:MovieClip){
super();
container = con;
objMc = obj;
LastPoint = MyMath.LtoG(container, obj);
}
public function updataEffect(){
var tempMc:Sprite;
count++;
if ((count / FPS) >= TimeDistance){
count = 0;
buildEffect();
};
var len:int = container.numChildren;
if (len){
tempMc = (container.getChildAt(0) as Sprite);
if (tempMc.alpha <= 0){
if (tempMc.parent){
tempMc.parent.removeChild(tempMc);
len--;
};
};
};
var i:int;
while (i < len) {
tempMc = (container.getChildAt(i) as Sprite);
tempMc.alpha = (tempMc.alpha - alphaSpeed);
i++;
};
}
private function buildEffect(){
if (LastPoint.equals(MyMath.LtoG(container, objMc))){
return;
};
if (container.numChildren >= MaxNum){
return;
};
LastPoint = MyMath.LtoG(container, objMc);
var tempMc:MovieClip = (objMc.getChildAt(0) as MovieClip);
var TempBitmapdata:BitmapData = new BitmapData((tempMc.width / tempMc.scaleX), (tempMc.height / tempMc.scaleY), true, 0);
TempBitmapdata.draw(tempMc);
var Tempbitmap:Bitmap = new Bitmap(TempBitmapdata);
var TempMc:Sprite = new Sprite();
TempMc.addChild(Tempbitmap);
Tempbitmap.width = tempMc.width;
Tempbitmap.height = tempMc.height;
Tempbitmap.x = tempMc.x;
Tempbitmap.y = tempMc.y;
container.addChild(TempMc);
TempMc.x = LastPoint.x;
TempMc.y = LastPoint.y;
if (objMc.scaleX < 0){
TempMc.scaleX = (TempMc.scaleX * -1);
};
TempMc.filters = [new BlurFilter(2, 2, 2)];
}
}
}//package Element
Section 11
//Enemy (Element.Enemy)
package Element {
import flash.geom.*;
import flash.display.*;
import Gamestage.*;
public class Enemy extends Actor {
public var walk:MovieClip;
public var land:Boolean;// = false
public var live:Boolean;// = true
public var wait:MovieClip;
public var hit1:MovieClip;
public function Enemy(obj:BaseStage=null){
super();
StateArr = new Array("wait", "walk");
}
override public function updata(key:Boolean=false){
if (!live){
return;
};
if (workair()){
vx = (vx * -1);
scaleX = (scaleX * -1);
};
if (!iswall()){
vx = (vx * -1);
scaleX = (scaleX * -1);
};
x = (x + (vx >> 0));
x = (x >> 0);
}
override public function buildactor(){
}
override public function loaddata(){
attackSpeed = (10 + (MyData.getInstance().addv[0] * 5));
canjumpTime = (2 + MyData.getInstance().addv[1]);
wallMaxvy = (9 - (MyData.getInstance().addv[2] * 3));
hitmc = (getChildByName("hit1") as MovieClip);
addChild(hitmc);
H = (hitmc.height * 0.25);
W = (hitmc.width * 0.5);
}
public function workair(){
var b:Boolean;
var i:int;
while (i < 3) {
if (canmove(basestage.HitMc, DGroup(i).add(new Point(vx, 5)))){
b = true;
};
i++;
};
return (b);
}
public function initEnemy(){
loaddata();
buildactor();
initMc();
addMc(1);
vx = 1;
}
}
}//package Element
Section 12
//MyData (Element.MyData)
package Element {
import Gamestage.*;
public class MyData {
public var succeed:Array;
private var gameLvGroup:Array;
public var mission:Array;
public var stagemission:Array;
public var gameroad:Array;
public var TotalLvNum:int;// = 10
public var addvv:Array;
public var addmax:Array;
public var stageGroup:Array;
public var highscore:Array;
public var addv:Array;
public static var _instance:MyData;
public function MyData(){
gameLvGroup = new Array();
highscore = new Array();
succeed = new Array();
addv = new Array(0, 0, 0);
addvv = new Array([500, 1000, 2000], [1500, 3000, 4500], [500, 1000, 2000]);
addmax = new Array(3, 3, 3);
stagemission = new Array([313, 3], [429, 3], [535, 3], [633, 4], [556, 4], [541, 4], [723, 5], [620, 5], [710, 6], [850, 6]);
mission = new Array();
gameroad = new Array("r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10");
stageGroup = new Array(GameStage1, GameStage2, GameStage3, GameStage4, GameStage5, GameStage6, GameStage7, GameStage8, GameStage9, GameStage10);
super();
var i:int;
while (i < TotalLvNum) {
gameLvGroup.push(new mydata());
i++;
};
resetdata();
}
public function set GameLvGroup(value:Array):void{
gameLvGroup = value;
}
public function initsucceed(num:int){
succeed = new Array();
var i:int;
while (i < num) {
succeed.push(false);
i++;
};
}
public function resetdata(){
addv = new Array(0, 0, 0);
initsucceed(9);
initmission(20);
}
public function get GameLvGroup():Array{
return (gameLvGroup);
}
public function initmission(num:int){
mission = new Array();
var i:int;
while (i < num) {
mission.push(false);
i++;
};
}
public static function getInstance():MyData{
if (_instance == null){
_instance = new (MyData);
};
return (_instance);
}
public static function clear(){
_instance = null;
}
}
}//package Element
class mydata {
private function mydata(){
}
}
Section 13
//BaseStage (Gamestage.BaseStage)
package Gamestage {
import flash.geom.*;
import Element.*;
import flash.display.*;
import flash.events.*;
import UserdefinedClass.*;
import caurina.transitions.*;
import flash.utils.*;
public class BaseStage extends MovieClip {
public var pausebool:Boolean;// = false
public var backsp:Sprite;
public var lv:int;
public var actorsp:Sprite;
public var item:MovieClip;
public var HousemaskMc:MovieClip;
public var camera:Camera;
public var road:MovieClip;
public var attackNum:int;// = 0
public var effectsp:Sprite;
public var ergod:int;// = 0
public var itemsp:Sprite;
public var background:MovieClip;
public var actorXY:Array;
public var hitsp:Sprite;
public var backcsp:Sprite;
public var gametime:MyTime;
public var money:int;// = 0
public var yansp:Sprite;
public var enemyArr:Array;
public var gamesp:Sprite;
public var delaytime:Timer;
public var main:Main;
public var enemysp:Sprite;
public var back:MovieClip;
public var HitMc:MovieClip;
public var cameraPoint:Point;
public var movekey:Boolean;// = true
public var debugsp:Sprite;
public var actor:Actor;
public var roadsp:Sprite;
public function BaseStage(mainobj:Object=null){
cameraPoint = new Point(320, 350);
actorXY = new Array([0, 920], [200, 920], [0, 920], [200, 920], [200, 920], [0, 920], [-100, 920], [-700, 920], [0, 920], [-200, 920]);
enemyArr = new Array();
super();
main = (mainobj as Main);
initgame();
main.stage.focus = this;
}
public function win(){
actor.stopMc();
stopEnemy();
gametime.pausetime();
removeEventListener(Event.ENTER_FRAME, updata);
removeEventListener(Event.ENTER_FRAME, onkeyfun);
worksucceed();
main.showWin(gametime.count, money);
}
public function added(mc:Object){
}
public function initgame(){
initcontainer();
initbackground();
initmc();
initcamera();
initSound();
}
public function buildroad(_x:Number=0, _y:Number=0){
var lu:MovieClip;
var luclass:* = getDefinitionByName(MyData.getInstance().gameroad[(lv - 1)]);
lu = (new (luclass) as MovieClip);
roadsp.addChild(lu);
lu.x = _x;
lu.y = _y;
HitMc = (lu.getChildByName("hit") as MovieClip);
HousemaskMc = (lu.getChildByName("housemask") as MovieClip);
item = (lu.getChildByName("itemmc") as MovieClip);
resetItem(item);
reItemNum();
initenemy(lu);
added(lu);
}
public function restartgame(){
main.repause();
actor.restartMc();
gametime.restart();
restartEnemy();
addEventListener(Event.ENTER_FRAME, updata);
addEventListener(Event.ENTER_FRAME, onkeyfun);
}
public function worksucceed(){
trace(money, MyData.getInstance().stagemission[(lv - 1)][0], attackNum, MyData.getInstance().stagemission[(lv - 1)][1]);
if (!MyData.getInstance().mission[((lv - 1) * 2)]){
if (money >= MyData.getInstance().stagemission[(lv - 1)][0]){
MyData.getInstance().mission[((lv - 1) * 2)] = true;
money = (money + 100);
};
};
if (!MyData.getInstance().mission[(((lv - 1) * 2) + 1)]){
if (attackNum >= MyData.getInstance().stagemission[(lv - 1)][1]){
MyData.getInstance().mission[(((lv - 1) * 2) + 1)] = true;
money = (money + 100);
};
};
main.savemission();
}
public function showgameover(e:TimerEvent=null){
delaytime.stop();
delaytime.removeEventListener(TimerEvent.TIMER, showgameover);
worksucceed();
main.showGameover(gametime.count, money);
}
public function startlistener(){
Input.addinput(stage);
addEventListener(Event.ENTER_FRAME, updata);
addEventListener(Event.ENTER_FRAME, onkeyfun);
main.stage.addEventListener(KeyboardEvent.KEY_UP, onthiskeyup);
gametime = new MyTime(setTime);
gametime.starttime();
actor.restartMc();
}
public function updataEnemy():void{
var len:int = enemyArr.length;
ergodAdd(len);
if (!len){
return;
};
var i:int;
while (i < len) {
(enemyArr[i] as Enemy).updata();
i++;
};
}
public function hititem(){
var tempmc:MovieClip;
var i:int;
var len:int = item.numChildren;
var tempArr:Array = new Array();
if (HitTest.complexHitTestObject(actor, item)){
i = 0;
while (i < len) {
tempmc = (item.getChildAt(i) as MovieClip);
if (tempmc.currentFrame == tempmc.totalFrames){
tempArr.push(tempmc);
};
if (tempmc.currentFrame != 1){
} else {
if (tempmc.hitTestObject(actor)){
if (tempmc.constructor == Reel){
money++;
main.setuiMoney(money);
tempmc.gotoAndPlay(2);
Main.hititem.playsound(1);
ergodAdd((i + 1));
break;
} else {
if (tempmc.constructor == Bigreel){
money = (money + 20);
main.setuiMoney(money);
tempmc.gotoAndPlay(2);
Main.hititem.playsound(1);
ergodAdd((i + 1));
break;
} else {
if (tempmc.constructor == Box){
trace("level complete");
tempmc.gotoAndPlay(2);
Main.hititem.playsound(1);
ergodAdd((i + 1));
win();
break;
};
};
};
};
};
i++;
};
};
len = tempArr.length;
ergodAdd(len);
i = 0;
while (i < len) {
if (tempArr[i].parent){
tempArr[i].parent.removeChild(tempArr[i]);
};
i++;
};
}
public function resetItem(mc:MovieClip){
var tempmc:MovieClip;
var len:int = mc.numChildren;
var i:int;
while (i < len) {
tempmc = (mc.getChildAt(i) as MovieClip);
tempmc.gotoAndStop(1);
i++;
};
}
public function playjumpMusic(){
Main.jumpsd.playsound(1);
}
public function ergodAdd(num:int){
ergod = (ergod + num);
}
public function updatacamera(){
camera.lookAt(actor, cameraPoint, Camera.LOCKWAY_NORMAL);
updatabackground();
}
public function updatabackground(){
backsp.x = ((gamesp.x / 40) - 300);
backsp.y = (gamesp.y - 1000);
}
public function initmc(){
buildroad();
actor = new Actormc();
(actor as Actor).basestage = this;
(actor as Actor).init();
}
public function initbackground(){
background = new BackGround();
backsp.addChild(background);
var tempMc:MovieClip = new BackC();
backcsp.addChild(tempMc);
}
public function gameover(){
Main.diesd.playsound(1);
actor.stopMc();
stopEnemy();
gametime.pausetime();
removeEventListener(Event.ENTER_FRAME, updata);
removeEventListener(Event.ENTER_FRAME, onkeyfun);
main.gamestage = "die";
var p:Point = MyMath.LtoG(debugsp, actor);
actor.alpha = 0;
var tempmc:MovieClip = new Dieflash();
tempmc.x = p.x;
tempmc.y = (p.y - (actor.height * 0.5));
debugsp.addChild(tempmc);
delaytime = new Timer(1000, 1);
delaytime.start();
delaytime.addEventListener(TimerEvent.TIMER, showgameover);
}
public function showyan(angle:Number=0, _y:Number=0){
var p:Point = MyMath.LtoG(yansp, actor);
var tempmc:MovieClip = new Smoke();
yansp.addChild(tempmc);
tempmc.rotation = angle;
tempmc.x = p.x;
tempmc.y = p.y;
tempmc.y = (tempmc.y + _y);
}
public function updata(e:Event):void{
addedupdata();
if (main.gamestage == "die"){
return;
};
updataEnemy();
actor.updata(movekey);
updataMask();
hititem();
enemyhitactor();
ergod = 0;
}
public function initcamera(){
camera = Camera.getInstance(gamesp);
camera.lookAt(actor, cameraPoint, Camera.LOCKWAY_NORMAL);
actor.updata(movekey);
actor.stopMc();
}
public function stopEnemy(){
var len:int = enemyArr.length;
var i:int;
while (i < len) {
enemyArr[i].stopMc();
i++;
};
}
public function addedupdata(){
}
public function hitenemy(way:int, p:Point){
var len:int = enemyArr.length;
if (!len){
return;
};
var tempmc:MovieClip = new fang();
tempmc.width = 44;
tempmc.height = 60;
tempmc.x = p.x;
tempmc.y = p.y;
tempmc.x = (tempmc.x + ((way * actor.W) + (way * tempmc.width)));
tempmc.y = (tempmc.y - (actor.H * 2));
debugsp.addChild(tempmc);
var i:int;
while (i < len) {
if (enemyArr[i].live){
if (tempmc.hitTestObject(enemyArr[i])){
trace("打到一只");
attackNum++;
enemyArr[i].live = false;
enemyArr[i].addMc(0);
Tweener.addTween(enemyArr[i], {time:2, alpha:0});
};
};
i++;
};
debugsp.removeChild(tempmc);
}
public function enemyhitactor(){
var i:int;
var len:int = enemyArr.length;
ergodAdd((i + 1));
if (!len){
return;
};
i = 0;
while (i < len) {
if (enemyArr[i].live){
if (HitTest.complexHitTestObject(actor, enemyArr[i])){
trace("死");
gameover();
break;
};
};
i++;
};
}
public function onthiskeyup(e:KeyboardEvent):void{
if ((((e.keyCode == Input.J)) || ((e.keyCode == Input.C)))){
if (actor.isair()){
actor.jumpTime++;
} else {
actor.resetjump();
};
actor.jumpcount = 0;
actor.jumpbtn = false;
};
if ((((e.keyCode == Input.K)) || ((e.keyCode == Input.X)))){
actor.attackbtn = false;
};
if ((((e.keyCode == Input.A)) || ((e.keyCode == Input.LEFT)))){
actor.leftBtn = false;
};
if ((((e.keyCode == Input.D)) || ((e.keyCode == Input.RIGHT)))){
actor.rightBtn = false;
};
}
public function initSound(){
SoundControl.stopallsound();
Main.bgm.playsound(1000000);
}
public function reItemNum(){
var tempmc:MovieClip;
var len:int = item.numChildren;
var tempreel:int;
var tempBreel:int;
var tempbox:int;
var i:int;
while (i < len) {
tempmc = (item.getChildAt(i) as MovieClip);
if (tempmc.constructor == Reel){
tempreel++;
} else {
if (tempmc.constructor == Bigreel){
tempBreel++;
} else {
if (tempmc.constructor == Box){
tempbox++;
};
};
};
i++;
};
trace("卷轴:", tempreel, "大卷轴:", tempBreel, "宝箱:", tempbox, "卷轴总数:", (tempreel + (tempBreel * 20)));
}
public function restartEnemy(){
var len:int = enemyArr.length;
var i:int;
while (i < len) {
enemyArr[i].restartMc();
i++;
};
}
public function pausegame(){
if (pausebool){
restartgame();
} else {
stopgame();
};
if (pausebool){
pausebool = false;
} else {
pausebool = true;
};
}
public function destroy(){
if (gametime){
gametime.removetime();
};
removeEventListener(Event.ENTER_FRAME, updata);
removeEventListener(Event.ENTER_FRAME, onkeyfun);
main.stage.removeEventListener(KeyboardEvent.KEY_UP, onthiskeyup);
camera.clear();
Clr.removeAllChildren(backcsp);
Clr.removeAllChildren(roadsp);
Clr.removeAllChildren(effectsp);
Clr.removeAllChildren(actorsp);
Clr.removeAllChildren(enemysp);
Clr.removeAllChildren(yansp);
Clr.removeAllChildren(itemsp);
Clr.removeAllChildren(hitsp);
Clr.removeAllChildren(debugsp);
Clr.removeAllChildren(backsp);
Clr.removeAllChildren(gamesp);
Clr.removeAllChildren(this);
Tweener.removeAllTweens();
}
public function initcontainer(){
gamesp = new Sprite();
actorsp = new Sprite();
enemysp = new Sprite();
itemsp = new Sprite();
backsp = new Sprite();
roadsp = new Sprite();
debugsp = new Sprite();
hitsp = new Sprite();
effectsp = new Sprite();
yansp = new Sprite();
backcsp = new Sprite();
addChild(backcsp);
addChild(backsp);
addChild(gamesp);
gamesp.addChild(roadsp);
gamesp.addChild(effectsp);
gamesp.addChild(actorsp);
gamesp.addChild(enemysp);
gamesp.addChild(yansp);
gamesp.addChild(itemsp);
gamesp.addChild(hitsp);
addChild(debugsp);
lv = main.initgamenum;
}
public function updataMask():void{
var tempDPO:DisplayObject;
var HitDPO:DisplayObject;
var len:int = HousemaskMc.numChildren;
ergodAdd(len);
var i:int;
if (!HitTest.complexHitTestObject(actor, HousemaskMc)){
i = 0;
while (i < len) {
tempDPO = (HousemaskMc.getChildAt(i) as DisplayObject);
tempDPO.alpha = 1;
i++;
};
} else {
i = 0;
while (i < len) {
HitDPO = (HousemaskMc.getChildAt(i) as MovieClip).getChildAt(1);
tempDPO = (HousemaskMc.getChildAt(i) as MovieClip);
if (HitTest.complexHitTestObject(actor, HitDPO)){
tempDPO.alpha = 0;
} else {
tempDPO.alpha = 1;
};
i++;
};
};
}
public function addEnemy(){
var len:int = enemyArr.length;
var i:int;
while (i < len) {
(enemyArr[i] as Enemy).initEnemy();
i++;
};
trace("EnemyNum:", len);
}
public function onkeyfun(e:Event):void{
if (actor.hitwall){
if (((((((Input.key[Input.D]) || (Input.key[Input.A]))) || (Input.key[Input.LEFT]))) || (Input.key[Input.RIGHT]))){
if (((Input.key[Input.J]) || (Input.key[Input.C]))){
actor.resetjump();
};
};
};
Input.keydownrunfun(Input.A, actor.moveleft);
Input.keydownrunfun(Input.D, actor.moveright);
Input.keydownrunfun(Input.J, actor.jump);
Input.keydownrunfun(Input.LEFT, actor.moveleft);
Input.keydownrunfun(Input.RIGHT, actor.moveright);
Input.keydownrunfun(Input.C, actor.jump);
Input.keydownrunfun(Input.K, actor.attack);
Input.keydownrunfun(Input.X, actor.attack);
if (((((((!(Input.key[Input.A])) && (!(Input.key[Input.D])))) && (!(Input.key[Input.LEFT])))) && (!(Input.key[Input.RIGHT])))){
movekey = true;
} else {
movekey = false;
};
}
public function stopgame(){
actor.stopMc();
stopEnemy();
gametime.pausetime();
removeEventListener(Event.ENTER_FRAME, updata);
removeEventListener(Event.ENTER_FRAME, onkeyfun);
main.showpause();
}
public function setTime(){
main.setTime(gametime.count);
}
public function initenemy(mc:MovieClip){
var obj:Object;
var len:int = mc.numChildren;
var i:int;
while (i < len) {
obj = mc.getChildAt(i);
if ((((obj.constructor == Enemy1)) || ((obj.constructor == Enemy2)))){
(obj as Enemy).basestage = this;
enemyArr.push(obj);
};
i++;
};
addEnemy();
}
}
}//package Gamestage
Section 14
//GameStage1 (Gamestage.GameStage1)
package Gamestage {
public class GameStage1 extends BaseStage {
public function GameStage1(mainobj:Object){
super(mainobj);
}
}
}//package Gamestage
Section 15
//GameStage10 (Gamestage.GameStage10)
package Gamestage {
import flash.geom.*;
import flash.display.*;
import UserdefinedClass.*;
public class GameStage10 extends BaseStage {
public var redArr:Array;
public var dieMc:MovieClip;
public var redcount:int;// = 0
public function GameStage10(mainobj:Object){
redArr = new Array();
super(mainobj);
}
public function hitbombfun(mc:MovieClip):Boolean{
var p:Point;
var b:Boolean;
p = actor.DGroup(1);
if (mc.hitTestPoint(p.x, p.y, true)){
b = true;
};
return (b);
}
override public function addedupdata(){
hitred();
redcount++;
if (hitbombfun(dieMc)){
gameover();
};
}
public function hitred(){
var len:int = redArr.length;
var i:int;
while (i < len) {
if (redcount == (60 * 3)){
if (((redArr[i] as MovieClip).currentFrame - 1)){
(redArr[i] as MovieClip).gotoAndStop(1);
} else {
(redArr[i] as MovieClip).gotoAndStop(2);
};
};
if ((redArr[i] as MovieClip).currentFrame == 1){
if (HitTest.complexHitTestObject(redArr[i], actor)){
gameover();
break;
};
};
i++;
};
if (redcount == (60 * 3)){
redcount = 0;
};
}
override public function added(mc:Object){
var obj:*;
var len:int = mc.numChildren;
var i:int;
while (i < len) {
obj = (mc as MovieClip).getChildAt(i);
if (obj.constructor == fang){
dieMc = (obj as MovieClip);
};
if (obj.constructor == Red){
redArr.push(obj);
if ((i % 2)){
obj.gotoAndStop(2);
};
};
i++;
};
}
}
}//package Gamestage
Section 16
//GameStage2 (Gamestage.GameStage2)
package Gamestage {
public class GameStage2 extends BaseStage {
public function GameStage2(mainobj:Object){
super(mainobj);
}
}
}//package Gamestage
Section 17
//GameStage3 (Gamestage.GameStage3)
package Gamestage {
import flash.display.*;
public class GameStage3 extends BaseStage {
public var ladderV:Number;// = -2.5
public var addMc:MovieClip;
public function GameStage3(mainobj:Object){
super(mainobj);
}
}
}//package Gamestage
Section 18
//GameStage4 (Gamestage.GameStage4)
package Gamestage {
public class GameStage4 extends BaseStage {
public function GameStage4(mainobj:Object){
super(mainobj);
}
}
}//package Gamestage
Section 19
//GameStage5 (Gamestage.GameStage5)
package Gamestage {
import flash.geom.*;
import flash.display.*;
public class GameStage5 extends BaseStage {
public var bombhit:Array;
public var bomb:Array;
public function GameStage5(mainobj:Object){
bomb = new Array();
bombhit = new Array();
super(mainobj);
}
override public function added(mc:Object){
var obj:Object;
var len:int = mc.numChildren;
var i:int;
while (i < len) {
obj = (mc as MovieClip).getChildAt(i);
if (obj.constructor == Bomb){
bomb.push(obj);
};
if (obj.constructor == fang){
bombhit.push(obj);
};
i++;
};
len = bomb.length;
i = 0;
while (i < len) {
bomb[i].gotoAndStop(1);
i++;
};
}
override public function addedupdata(){
var tempMc:MovieClip;
var len:int = bombhit.length;
var i:int;
while (i < len) {
if (hitbombfun(bombhit[i])){
tempMc = (bomb[i] as MovieClip);
actor.y = (actor.y - 1);
actor.vy = -30;
actor.addMc(4);
actor.resetjump();
tempMc.gotoAndPlay(2);
playjumpMusic();
};
i++;
};
}
public function hitbombfun(mc:MovieClip):Boolean{
var p:Point;
var b:Boolean;
p = actor.DGroup(1);
if (mc.hitTestPoint(p.x, p.y, true)){
b = true;
};
return (b);
}
}
}//package Gamestage
Section 20
//GameStage6 (Gamestage.GameStage6)
package Gamestage {
public class GameStage6 extends BaseStage {
public function GameStage6(mainobj:Object){
super(mainobj);
}
}
}//package Gamestage
Section 21
//GameStage7 (Gamestage.GameStage7)
package Gamestage {
import flash.geom.*;
import flash.display.*;
public class GameStage7 extends BaseStage {
public var dieMc:MovieClip;
public function GameStage7(mainobj:Object){
super(mainobj);
}
override public function added(mc:Object){
var obj:*;
var len:int = mc.numChildren;
var i:int;
while (i < len) {
obj = (mc as MovieClip).getChildAt(i);
if (obj.constructor == fang){
dieMc = (obj as MovieClip);
};
i++;
};
}
public function hitbombfun(mc:MovieClip):Boolean{
var p:Point;
var b:Boolean;
p = actor.DGroup(1);
if (mc.hitTestPoint(p.x, p.y, true)){
b = true;
};
return (b);
}
override public function addedupdata(){
if (hitbombfun(dieMc)){
gameover();
};
}
}
}//package Gamestage
Section 22
//GameStage8 (Gamestage.GameStage8)
package Gamestage {
import flash.geom.*;
import flash.display.*;
public class GameStage8 extends BaseStage {
public var bombhit:Array;
public var bomb:Array;
public function GameStage8(mainobj:Object){
bomb = new Array();
bombhit = new Array();
super(mainobj);
}
override public function added(mc:Object){
var obj:Object;
var len:int = mc.numChildren;
var i:int;
while (i < len) {
obj = (mc as MovieClip).getChildAt(i);
if (obj.constructor == Bomb){
bomb.push(obj);
};
if (obj.constructor == fang){
bombhit.push(obj);
};
i++;
};
len = bomb.length;
i = 0;
while (i < len) {
bomb[i].gotoAndStop(1);
i++;
};
}
override public function addedupdata(){
var tempMc:MovieClip;
var len:int = bombhit.length;
var i:int;
while (i < len) {
if (hitbombfun(bombhit[i])){
tempMc = (bomb[i] as MovieClip);
actor.y = (actor.y - 1);
actor.vy = -30;
actor.addMc(4);
actor.resetjump();
tempMc.gotoAndPlay(2);
playjumpMusic();
};
i++;
};
}
public function hitbombfun(mc:MovieClip):Boolean{
var p:Point;
var b:Boolean;
p = actor.DGroup(1);
if (mc.hitTestPoint(p.x, p.y, true)){
b = true;
};
return (b);
}
}
}//package Gamestage
Section 23
//GameStage9 (Gamestage.GameStage9)
package Gamestage {
import flash.geom.*;
import flash.display.*;
import UserdefinedClass.*;
public class GameStage9 extends BaseStage {
public var redArr:Array;
public var dieMc:MovieClip;
public var redcount:int;// = 0
public function GameStage9(mainobj:Object){
redArr = new Array();
super(mainobj);
}
public function hitbombfun(mc:MovieClip):Boolean{
var p:Point;
var b:Boolean;
p = actor.DGroup(1);
if (mc.hitTestPoint(p.x, p.y, true)){
b = true;
};
return (b);
}
override public function addedupdata(){
hitred();
redcount++;
if (hitbombfun(dieMc)){
gameover();
};
}
public function hitred(){
var len:int = redArr.length;
var i:int;
while (i < len) {
if (redcount == (60 * 3)){
if (((redArr[i] as MovieClip).currentFrame - 1)){
(redArr[i] as MovieClip).gotoAndStop(1);
} else {
(redArr[i] as MovieClip).gotoAndStop(2);
};
};
if ((redArr[i] as MovieClip).currentFrame == 1){
if (HitTest.complexHitTestObject(redArr[i], actor)){
gameover();
break;
};
};
i++;
};
if (redcount == (60 * 3)){
redcount = 0;
};
}
override public function added(mc:Object){
var obj:*;
var len:int = mc.numChildren;
var i:int;
while (i < len) {
obj = (mc as MovieClip).getChildAt(i);
if (obj.constructor == fang){
dieMc = (obj as MovieClip);
};
if (obj.constructor == Red){
redArr.push(obj);
if ((i % 2)){
obj.gotoAndStop(2);
};
};
i++;
};
}
}
}//package Gamestage
Section 24
//0123456789_192 (ninja_fla.0123456789_192)
package ninja_fla {
import flash.display.*;
public dynamic class 0123456789_192 extends MovieClip {
public function 0123456789_192(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package ninja_fla
Section 25
//0123456789_194 (ninja_fla.0123456789_194)
package ninja_fla {
import flash.display.*;
public dynamic class 0123456789_194 extends MovieClip {
public function 0123456789_194(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package ninja_fla
Section 26
//flob_pre010_11 (ninja_fla.flob_pre010_11)
package ninja_fla {
import flash.display.*;
public dynamic class flob_pre010_11 extends MovieClip {
public function flob_pre010_11(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package ninja_fla
Section 27
//flob_pre012_9 (ninja_fla.flob_pre012_9)
package ninja_fla {
import flash.display.*;
public dynamic class flob_pre012_9 extends MovieClip {
public function flob_pre012_9(){
addFrameScript(77, frame78);
}
function frame78(){
stop();
}
}
}//package ninja_fla
Section 28
//flob_pre013_8 (ninja_fla.flob_pre013_8)
package ninja_fla {
import flash.display.*;
public dynamic class flob_pre013_8 extends MovieClip {
public function flob_pre013_8(){
addFrameScript(24, frame25);
}
function frame25(){
stop();
}
}
}//package ninja_fla
Section 29
//MainTimeline (ninja_fla.MainTimeline)
package ninja_fla {
import flash.geom.*;
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.media.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.xml.*;
public dynamic class MainTimeline extends MovieClip {
public const LOADER_STAY_TIME:int = 96;
public const FRAME_RATE_ADJUST:Boolean = true;
public const LOADER_FRAME_RATE:Number = 24;
public var timeCount:int;
public var ms2:MovieClip;
public var apiLoader:URLLoader;
public var bar:MovieClip;
public var movieFrameRate:Number;
public var preLoadSound:preLoadSnd;
public var clickBtnpre:SimpleButton;
public var o:Object;
public var txtBox:TextField;
public function MainTimeline(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
public function outLink1(event:MouseEvent):void{
var localDomainLC:LocalConnection = new LocalConnection();
var flashCurrentDomainName:String = localDomainLC.domain;
var gameTitle:* = "ninja-stealth";
var btnUrl:* = ((("http://www.flobzoo.com/?utm_source=" + flashCurrentDomainName) + "&utm_medium=game&utm_campaign=") + gameTitle);
navigateToURL(new URLRequest(btnUrl), "blank");
}
function frame1(){
timeCount = 0;
if (((FRAME_RATE_ADJUST) && (stage))){
movieFrameRate = stage.frameRate;
stage.frameRate = LOADER_FRAME_RATE;
};
if (Security){
o = Security;
if (o.sandboxType != "localWithFile"){
apiLoader = new URLLoader();
apiLoader.load(new URLRequest("http://www.britetrade.com/api/gameplay.php?key=83e7c7db93b1844d62c19066b000e252&id=192"));
};
};
//unresolved jump
var _slot1 = error;
clickBtnpre.addEventListener(MouseEvent.CLICK, outLink1);
addEventListener(Event.ENTER_FRAME, loading);
stop();
}
function frame2(){
stop();
preLoadSound = new preLoadSnd();
}
function frame3(){
addChild(new Main());
}
public function loading(event:Event){
var bytestotal:* = stage.loaderInfo.bytesTotal;
var bytesloaded:* = stage.loaderInfo.bytesLoaded;
var percentage:* = (bytesloaded / bytestotal);
if (percentage > (timeCount / LOADER_STAY_TIME)){
percentage = (timeCount / LOADER_STAY_TIME);
};
txtBox.text = (int((percentage * 100)) + "");
bar.scaleX = percentage;
if (percentage >= 1){
removeEventListener(Event.ENTER_FRAME, loading);
if (movieFrameRate){
stage.frameRate = movieFrameRate;
movieFrameRate = 0;
};
gotoAndStop("logoAnim");
};
timeCount++;
}
}
}//package ninja_fla
Section 30
//preloader017_158 (ninja_fla.preloader017_158)
package ninja_fla {
import flash.display.*;
public dynamic class preloader017_158 extends MovieClip {
public function preloader017_158(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package ninja_fla
Section 31
//shopupgrade_181 (ninja_fla.shopupgrade_181)
package ninja_fla {
import flash.display.*;
public dynamic class shopupgrade_181 extends MovieClip {
public var a0:MovieClip;
public var a1:MovieClip;
public var a2:MovieClip;
public var a3:MovieClip;
public var l0:MovieClip;
public function shopupgrade_181(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package ninja_fla
Section 32
//Symbol3asfsfsf_6 (ninja_fla.Symbol3asfsfsf_6)
package ninja_fla {
import flash.geom.*;
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.media.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.xml.*;
public dynamic class Symbol3asfsfsf_6 extends MovieClip {
public var preLoadSndChannel:SoundChannel;
public var playBtn:SimpleButton;
public var ms1:MovieClip;
public var ms2:MovieClip;
public var moreGamesBtn:SimpleButton;
public var my_menu:ContextMenu;
public var clickBtn:SimpleButton;
public var my_notice;
public function Symbol3asfsfsf_6(){
addFrameScript(0, frame1, 120, frame121, 236, frame237);
}
public function playStartFn(e:Event):void{
MovieClip(this.parent).gotoAndStop("start");
}
function frame237(){
stop();
playBtn.addEventListener(MouseEvent.MOUSE_DOWN, playStartFn);
moreGamesBtn.addEventListener(MouseEvent.MOUSE_DOWN, moreGamesFn);
}
public function outLink(event:MouseEvent):void{
var localDomainLC:LocalConnection = new LocalConnection();
var flashCurrentDomainName:String = localDomainLC.domain;
var gameTitle:* = "ninja-stealth";
var btnUrl:* = ((("http://www.flobzoo.com/?utm_source=" + flashCurrentDomainName) + "&utm_medium=game&utm_campaign=") + gameTitle);
navigateToURL(new URLRequest(btnUrl), "blank");
}
function frame1(){
preLoadSndChannel = MovieClip(this.parent).preLoadSound.play(0, 1);
clickBtn.addEventListener(MouseEvent.CLICK, outLink);
my_menu = new ContextMenu();
my_menu.hideBuiltInItems();
my_notice = new ContextMenuItem("Created by www.flobzoo.com");
my_menu.customItems.push(my_notice);
contextMenu = my_menu;
}
public function moreGamesFn(e:Event):void{
var e = e;
var localDomainLC:LocalConnection = new LocalConnection();
var flashCurrentDomainName:String = localDomainLC.domain;
var gameTitle:* = "ninja-stealth";
var btnUrl:* = (((("http://www.flobzoo.com/?utm_source=" + flashCurrentDomainName) + "&utm_campaign=") + gameTitle) + "&utm_medium=game");
var request:URLRequest = new URLRequest(btnUrl);
navigateToURL(request, "_blank");
//unresolved jump
var _slot1 = e;
trace("Error occurred!");
}
function frame121(){
ms1.cacheAsBitmap = true;
ms2.cacheAsBitmap = true;
ms2.mask = ms1;
}
}
}//package ninja_fla
Section 33
//Timeline_170 (ninja_fla.Timeline_170)
package ninja_fla {
import flash.display.*;
public dynamic class Timeline_170 extends MovieClip {
public function Timeline_170(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package ninja_fla
Section 34
//Timeline_171 (ninja_fla.Timeline_171)
package ninja_fla {
import flash.display.*;
public dynamic class Timeline_171 extends MovieClip {
public function Timeline_171(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package ninja_fla
Section 35
//Timeline_172 (ninja_fla.Timeline_172)
package ninja_fla {
import flash.display.*;
public dynamic class Timeline_172 extends MovieClip {
public function Timeline_172(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package ninja_fla
Section 36
//Timeline_173 (ninja_fla.Timeline_173)
package ninja_fla {
import flash.display.*;
public dynamic class Timeline_173 extends MovieClip {
public function Timeline_173(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package ninja_fla
Section 37
//Timeline_174 (ninja_fla.Timeline_174)
package ninja_fla {
import flash.display.*;
public dynamic class Timeline_174 extends MovieClip {
public function Timeline_174(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package ninja_fla
Section 38
//Timeline_175 (ninja_fla.Timeline_175)
package ninja_fla {
import flash.display.*;
public dynamic class Timeline_175 extends MovieClip {
public function Timeline_175(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package ninja_fla
Section 39
//Timeline_176 (ninja_fla.Timeline_176)
package ninja_fla {
import flash.display.*;
public dynamic class Timeline_176 extends MovieClip {
public function Timeline_176(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package ninja_fla
Section 40
//Timeline_177 (ninja_fla.Timeline_177)
package ninja_fla {
import flash.display.*;
public dynamic class Timeline_177 extends MovieClip {
public function Timeline_177(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package ninja_fla
Section 41
//Timeline_178 (ninja_fla.Timeline_178)
package ninja_fla {
import flash.display.*;
public dynamic class Timeline_178 extends MovieClip {
public function Timeline_178(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package ninja_fla
Section 42
//Timeline_186 (ninja_fla.Timeline_186)
package ninja_fla {
import flash.display.*;
public dynamic class Timeline_186 extends MovieClip {
public function Timeline_186(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package ninja_fla
Section 43
//Timeline_189 (ninja_fla.Timeline_189)
package ninja_fla {
import flash.display.*;
public dynamic class Timeline_189 extends MovieClip {
public function Timeline_189(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package ninja_fla
Section 44
//Timeline_202 (ninja_fla.Timeline_202)
package ninja_fla {
import flash.display.*;
public dynamic class Timeline_202 extends MovieClip {
public function Timeline_202(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package ninja_fla
Section 45
//Timeline_48 (ninja_fla.Timeline_48)
package ninja_fla {
import flash.display.*;
public dynamic class Timeline_48 extends MovieClip {
public function Timeline_48(){
addFrameScript(19, frame20);
}
function frame20(){
stop();
}
}
}//package ninja_fla
Section 46
//Timeline_56 (ninja_fla.Timeline_56)
package ninja_fla {
import flash.display.*;
public dynamic class Timeline_56 extends MovieClip {
public function Timeline_56(){
addFrameScript(24, frame25);
}
function frame25(){
stop();
}
}
}//package ninja_fla
Section 47
//Timeline_59 (ninja_fla.Timeline_59)
package ninja_fla {
import flash.display.*;
public dynamic class Timeline_59 extends MovieClip {
public function Timeline_59(){
addFrameScript(18, frame19);
}
function frame19(){
stop();
}
}
}//package ninja_fla
Section 48
//Timeline_60 (ninja_fla.Timeline_60)
package ninja_fla {
import flash.display.*;
public dynamic class Timeline_60 extends MovieClip {
public function Timeline_60(){
addFrameScript(23, frame24);
}
function frame24(){
stop();
}
}
}//package ninja_fla
Section 49
//BaseSound (UserdefinedClass.BaseSound)
package UserdefinedClass {
import flash.utils.*;
import flash.media.*;
public class BaseSound {
public var sd:Sound;
public var sdChannel:SoundChannel;
public var sdTransform:SoundTransform;
public function BaseSound(soundclassname:String){
super();
var soundclass:Object = getDefinitionByName(soundclassname);
sd = (new (soundclass) as Sound);
sdChannel = new SoundChannel();
}
public function playsound(loop:int, volume:Number=1){
sdTransform = new SoundTransform();
sdTransform.volume = volume;
sdChannel = sd.play(0, loop, sdTransform);
}
public function setvolume(volume:Number){
sdTransform = new SoundTransform();
sdTransform.volume = volume;
sdChannel.soundTransform = sdTransform;
}
public function stopSound(){
if (sdChannel){
sdChannel.stop();
};
}
}
}//package UserdefinedClass
Section 50
//BaseUI (UserdefinedClass.BaseUI)
package UserdefinedClass {
import flash.display.*;
public class BaseUI {
public static var uisp:Sprite = new Sprite();
public function BaseUI(){
super();
}
public static function setcargo(obj:MovieClip, num:int, str:String){
var temp:Array = MyMath.worknum(num);
(obj[(str + 0)] as MovieClip).gotoAndStop((temp[0] + 1));
(obj[(str + 1)] as MovieClip).gotoAndStop((temp[1] + 1));
}
public static function setWinHighScore(obj:MovieClip, Scorenum:int){
var Temp:Array = new Array(obj.h0, obj.h1, obj.h2, obj.h3, obj.h4);
var tempnum:Array = MyMath.NumtoArray(Scorenum);
var len:int = tempnum.length;
var i:int;
while (i < 5) {
if (i < len){
Temp[i].alpha = 1;
Temp[i].gotoAndStop((tempnum[i] + 1));
} else {
Temp[i].alpha = 0;
};
i++;
};
}
public static function setfloattime(Mc:MovieClip, S:Number){
var tempint:Array = MyMath.worknum(int(S));
var tempdec:Array = MyMath.worknum(int(((S - int(S)) * 100)));
Mc.t2.gotoAndStop((tempint[0] + 1));
Mc.t3.gotoAndStop((tempint[1] + 1));
Mc.t0.gotoAndStop((tempdec[0] + 1));
Mc.t1.gotoAndStop((tempdec[1] + 1));
if (tempint[1] == 0){
Mc.t3.alpha = 0;
} else {
Mc.t3.alpha = 1;
};
if (tempdec[0] == 0){
Mc.t0.alpha = 0;
} else {
Mc.t0.alpha = 1;
};
}
public static function setlv(obj:MovieClip, num:int){
var temp:Array = MyMath.worknum(num);
(obj.lv0 as MovieClip).gotoAndStop((temp[0] + 1));
(obj.lv1 as MovieClip).gotoAndStop((temp[1] + 1));
}
public static function setP(Mc:MovieClip, val:int, max:int, str:String){
var tempP:Array = new Array(Mc[str]["p1"], Mc[str]["p2"], Mc[str]["p3"], Mc[str]["p4"], Mc[str]["p5"], Mc[str]["p6"], Mc[str]["p7"], Mc[str]["p8"], Mc[str]["p9"], Mc[str]["p10"]);
var i:int;
while (i < 10) {
tempP[i].gotoAndStop(3);
if (i < max){
tempP[i].gotoAndStop(2);
};
if (i < val){
tempP[i].gotoAndStop(1);
};
i++;
};
}
public static function settime(Mc:MovieClip, num:int){
var timearr:Array = MyMath.TimeFormat(num);
var timemcname:Array = new Array(Mc.t0, Mc.t1, Mc.t2, Mc.t3);
var i:int;
while (i < 4) {
(timemcname[i] as MovieClip).gotoAndStop((timearr[i] + 1));
i++;
};
}
public static function setMaxscore(Mc:MovieClip, val:int, str:String, Maxval:int){
var tempP:Array = new Array();
var i:int;
while (i < Maxval) {
tempP.push(Mc[(str + i)]);
i++;
};
var tempnum:Array = MyMath.NumtoArray(val);
var len:int = tempnum.length;
if (val == 0){
i = 0;
while (i < Maxval) {
tempP[i].alpha = 0;
i++;
};
tempP[0].alpha = 1;
tempP[0].gotoAndStop(1);
return;
};
i = 0;
while (i < Maxval) {
if (i < len){
tempP[i].alpha = 1;
tempP[i].gotoAndStop((tempnum[i] + 1));
} else {
tempP[i].alpha = 0;
};
i++;
};
}
public static function setcombo(obj:MovieClip, num:int){
var temp:Array = MyMath.worknum(num);
(obj.c0 as MovieClip).alpha = 1;
if (num > 9){
(obj.c1 as MovieClip).alpha = 1;
} else {
(obj.c1 as MovieClip).alpha = 0;
};
(obj.c0 as MovieClip).gotoAndStop((temp[0] + 1));
(obj.c1 as MovieClip).gotoAndStop((temp[1] + 1));
}
public static function showscore(scnum:int, objname, Container:DisplayObjectContainer, x:Number, y:Number, size:Number=1, flushleft:Boolean=true){
var sc:MovieClip;
Clr.removeAllChildren(uisp);
var tempnum:Array = MyMath.NumtoArray(scnum, flushleft);
var len:int = tempnum.length;
var i:int;
while (i < len) {
sc = (new (objname) as MovieClip);
sc.scaleX = (sc.scaleY = size);
sc.x = (sc.width * i);
if (!flushleft){
sc.x = (-(sc.width) * i);
};
sc.gotoAndStop((tempnum[i] + 1));
uisp.addChild(sc);
i++;
};
uisp.x = x;
uisp.y = y;
Container.addChild(uisp);
}
public static function setValue(obj:MovieClip, objname:String, frame:int){
obj[objname].gotoAndStop(frame);
}
public static function setScore(obj:MovieClip, Scorenum:int, str:String){
var Temp:Array = new Array(obj[(str + "0")], obj[(str + "1")], obj[(str + "2")], obj[(str + "3")], obj[(str + "4")], obj[(str + "5")]);
var tempnum:Array = MyMath.NumtoArray(Scorenum);
var len:int = tempnum.length;
var i:int;
while (i < 6) {
if (i < len){
Temp[i].alpha = 1;
Temp[i].gotoAndStop((tempnum[i] + 1));
} else {
Temp[i].alpha = 0;
};
i++;
};
}
public static function setWinScore(obj:MovieClip, Scorenum:int){
var Temp:Array = new Array(obj.s0, obj.s1, obj.s2, obj.s3, obj.s4);
var tempnum:Array = MyMath.NumtoArray(Scorenum);
var len:int = tempnum.length;
var i:int;
while (i < 5) {
if (i < len){
Temp[i].alpha = 1;
Temp[i].gotoAndStop((tempnum[i] + 1));
} else {
Temp[i].alpha = 0;
};
i++;
};
}
public static function setmax(Mc:MovieClip, val:int, max:int, str:String){
if ((max == val)){
Mc[str].gotoAndStop(2);
} else {
Mc[str].gotoAndStop(1);
};
}
public static function setalpha(alpha:Number, Mc:MovieClip, str:String, Max:int){
var tempP:Array = new Array();
var i:int;
while (i < Max) {
tempP.push(Mc[(str + i)]);
i++;
};
i = 0;
while (i < Max) {
tempP[i].alpha = alpha;
i++;
};
}
public static function setnumval(Mc:MovieClip, val:int, str:String){
var tempmc:Array = new Array();
var i = 1;
while (i < 11) {
tempmc.push(Mc[(str + i)]);
i++;
};
i = 0;
while (i < 10) {
if (i < val){
tempmc[i].gotoAndStop(1);
} else {
tempmc[i].gotoAndStop(2);
};
i++;
};
}
public static function setmoney(Mc:MovieClip, val:int, str:String, Maxval:int){
var tempP:Array = new Array();
var i:int;
while (i < Maxval) {
tempP.push(Mc[(str + i)]);
i++;
};
var tempnum:Array = MyMath.NumtoArray(val, false);
var len:int = tempnum.length;
if (val == 0){
i = 0;
while (i < Maxval) {
tempP[i].alpha = 0;
i++;
};
tempP[0].alpha = 1;
tempP[0].gotoAndStop(1);
return;
};
i = 0;
while (i < Maxval) {
if (i < len){
tempP[i].alpha = 1;
tempP[i].gotoAndStop((tempnum[i] + 1));
} else {
tempP[i].alpha = 0;
};
i++;
};
}
}
}//package UserdefinedClass
Section 51
//Camera (UserdefinedClass.Camera)
package UserdefinedClass {
import flash.geom.*;
import flash.display.*;
import flash.events.*;
public class Camera {
public var lockWay:String;
public var count:int;// = 50
public var lockTarget:DisplayObject;
public var lockPoint:Point;
public var easingRate:Number;// = 0.5
private var _isLocked:Boolean;// = false
public var easing:Boolean;// = false
public static var LOCKWAY_NORMAL:String = "lockway_normal";
public static var Scene:DisplayObject;
private static var _instance:Camera;
public static var LOCKWAY_X:String = "lockway_x";
public static var LOCKWAY_Y:String = "lockway_y";
public function Camera(s:SingleEnforcer){
super();
if (s == null){
throw (new Error("using SingletonPattern"));
};
}
public function set y(y:Number):void{
Scene.y = -(y);
}
private function lockWayNormal():void{
if (easing){
this.x = (this.x + (((lockTarget.x - this.x) - lockPoint.x) * easingRate));
this.y = (this.y + (((lockTarget.y - this.y) - lockPoint.y) * easingRate));
if (lockTarget.y < -200){
} else {
this.y = (this.y + (((lockTarget.y - this.y) - lockPoint.y) * easingRate));
};
} else {
this.x = (lockTarget.x - lockPoint.x);
this.y = (lockTarget.y - lockPoint.y);
};
}
public function clear(){
_instance = null;
}
public function reset():void{
Scene.x = 0;
Scene.y = 0;
}
public function get isLocked():Boolean{
return (_isLocked);
}
private function lockWayY():void{
if (easing){
this.y = (this.y + (((lockTarget.y - this.y) - lockPoint.y) * easingRate));
} else {
this.y = (lockTarget.y - lockPoint.y);
};
}
private function lockWayX():void{
if (easing){
this.x = (this.x + (((lockTarget.x - this.x) - lockPoint.x) * easingRate));
} else {
this.x = (lockTarget.x - lockPoint.x);
};
}
public function moveTo(p:Point, t:Point=null):void{
this.x = (t.x - p.x);
this.y = (t.y - p.y);
}
public function set x(x:Number):void{
Scene.x = -(x);
}
public function lookAt(t:DisplayObject, p:Point=null, lw:String="lockway_normal"):void{
if (p == null){
lockPoint = new Point(0, 0);
} else {
lockPoint = p;
};
lockTarget = t;
lockWay = lw;
lockCemeraHandler(null);
}
private function lockCemeraHandler(e:Event):void{
switch (lockWay){
case LOCKWAY_NORMAL:
lockWayNormal();
break;
case LOCKWAY_X:
lockWayX();
break;
case LOCKWAY_Y:
lockWayY();
break;
};
}
public function get y():Number{
return (-(Scene.y));
}
public function get x():Number{
return (-(Scene.x));
}
public static function getInstance(container:Sprite):Camera{
if (_instance == null){
Scene = container;
_instance = new Camera(new SingleEnforcer());
};
return (_instance);
}
}
}//package UserdefinedClass
class SingleEnforcer {
private function SingleEnforcer(){
}
}
Section 52
//Clr (UserdefinedClass.Clr)
package UserdefinedClass {
import flash.display.*;
public class Clr {
public function Clr(){
super();
}
public static function removeAllChildren(container:DisplayObjectContainer):void{
var count:int = container.numChildren;
var i:int;
while (i < count) {
container.removeChildAt(0);
i++;
};
}
}
}//package UserdefinedClass
Section 53
//HitTest (UserdefinedClass.HitTest)
package UserdefinedClass {
import flash.geom.*;
import flash.display.*;
public class HitTest {
public static function getDrawMatrix(target:DisplayObject, hitRectangle:Rectangle, accurracy:Number):Matrix{
var localToGlobal:Point;
var matrix:Matrix;
var rootConcatenatedMatrix:Matrix = target.root.transform.concatenatedMatrix;
localToGlobal = target.localToGlobal(new Point());
matrix = target.transform.concatenatedMatrix;
matrix.tx = (localToGlobal.x - hitRectangle.x);
matrix.ty = (localToGlobal.y - hitRectangle.y);
matrix.a = (matrix.a / rootConcatenatedMatrix.a);
matrix.d = (matrix.d / rootConcatenatedMatrix.d);
if (accurracy != 1){
matrix.scale(accurracy, accurracy);
};
return (matrix);
}
public static function complexHitTestObject(target1:DisplayObject, target2:DisplayObject, accurracy:Number=1):Boolean{
return (!((complexIntersectionRectangle(target1, target2, accurracy).width == 0)));
}
public static function complexIntersectionRectangle(target1:DisplayObject, target2:DisplayObject, accurracy:Number=1):Rectangle{
if (accurracy <= 0){
throw (new Error("ArgumentError: Error 5001: Invalid value for accurracy", 5001));
};
if (!target1.hitTestObject(target2)){
return (new Rectangle());
};
var hitRectangle:Rectangle = intersectionRectangle(target1, target2);
if (((((hitRectangle.width * accurracy) < 1)) || (((hitRectangle.height * accurracy) < 1)))){
return (new Rectangle());
};
var bitmapData:BitmapData = new BitmapData((hitRectangle.width * accurracy), (hitRectangle.height * accurracy), false, 0);
bitmapData.draw(target1, HitTest.getDrawMatrix(target1, hitRectangle, accurracy), new ColorTransform(1, 1, 1, 1, 0xFF, -255, -255, 0xFF));
bitmapData.draw(target2, HitTest.getDrawMatrix(target2, hitRectangle, accurracy), new ColorTransform(1, 1, 1, 1, 0xFF, 0xFF, 0xFF, 0xFF), BlendMode.DIFFERENCE);
var intersection:Rectangle = bitmapData.getColorBoundsRect(4294967295, 4278255615);
bitmapData.dispose();
if (accurracy != 1){
intersection.x = (intersection.x / accurracy);
intersection.y = (intersection.y / accurracy);
intersection.width = (intersection.width / accurracy);
intersection.height = (intersection.height / accurracy);
};
intersection.x = (intersection.x + hitRectangle.x);
intersection.y = (intersection.y + hitRectangle.y);
return (intersection);
}
public static function intersectionRectangle(target1:DisplayObject, target2:DisplayObject):Rectangle{
if (((((!(target1.root)) || (!(target2.root)))) || (!(target1.hitTestObject(target2))))){
return (new Rectangle());
};
var bounds1:Rectangle = target1.getBounds(target1.root);
var bounds2:Rectangle = target2.getBounds(target2.root);
var intersection:Rectangle = new Rectangle();
intersection.x = Math.max(bounds1.x, bounds2.x);
intersection.y = Math.max(bounds1.y, bounds2.y);
intersection.width = Math.min(((bounds1.x + bounds1.width) - intersection.x), ((bounds2.x + bounds2.width) - intersection.x));
intersection.height = Math.min(((bounds1.y + bounds1.height) - intersection.y), ((bounds2.y + bounds2.height) - intersection.y));
return (intersection);
}
}
}//package UserdefinedClass
Section 54
//Input (UserdefinedClass.Input)
package UserdefinedClass {
import flash.display.*;
import flash.events.*;
public class Input {
public static var A:uint = 65;
public static var C:uint = 67;
public static var LEFT:uint = 37;
public static var J:uint = 74;
public static var P:uint = 80;
public static var K:uint = 75;
public static var S:uint = 83;
public static var W:uint = 87;
public static var X:uint = 88;
public static var R:uint = 82;
public static var Z:uint = 90;
public static var UP:uint = 38;
public static var D:uint = 68;
public static var SHIFT:uint = 16;
public static var L:uint = 76;
public static var SPACE:uint = 32;
public static var sta:Stage;
public static var DOWN:uint = 40;
public static var key:Array = new Array();
public static var RIGHT:uint = 39;
public function Input(){
super();
}
public static function addinput(_sta:Stage){
if (sta){
return;
};
sta = _sta;
sta.addEventListener(KeyboardEvent.KEY_UP, onkeyup);
sta.addEventListener(KeyboardEvent.KEY_DOWN, onkeydown);
}
public static function removeinput(){
sta.removeEventListener(KeyboardEvent.KEY_UP, onkeyup);
sta.removeEventListener(KeyboardEvent.KEY_DOWN, onkeydown);
sta = null;
}
private static function onkeydown(e:KeyboardEvent):void{
key[e.keyCode] = true;
}
public static function keydownrunfun(keynum:uint, fun:Function){
var f:Function = fun;
((key[keynum]) && (f()));
}
public static function keyuprunfun(keynum:uint, fun:Function){
var f:Function = fun;
if (key[keynum] == false){
f();
};
}
private static function onkeyup(e:KeyboardEvent):void{
key[e.keyCode] = false;
}
}
}//package UserdefinedClass
Section 55
//Mybutton (UserdefinedClass.Mybutton)
package UserdefinedClass {
import flash.display.*;
import flash.net.*;
public class Mybutton extends SimpleButton {
public var netobj:Object;
public function Mybutton(){
netobj = new Object();
super();
SoundControl.Mybtnground.push(this);
}
public function link(){
var req:URLRequest = (netobj["req"] as URLRequest);
navigateToURL(req);
}
public function setlink(url:String){
netobj["req"] = new URLRequest(url);
}
}
}//package UserdefinedClass
Section 56
//MyColorMatrix (UserdefinedClass.MyColorMatrix)
package UserdefinedClass {
public class MyColorMatrix {
private var IDENTITY_MATRIX:Array;
private var LENGTH:Number;
public var VALUE:Array;
private static var DELTA_INDEX:Array = [0, 0.01, 0.02, 0.04, 0.05, 0.06, 0.07, 0.08, 0.1, 0.11, 0.12, 0.14, 0.15, 0.16, 0.17, 0.18, 0.2, 0.21, 0.22, 0.24, 0.25, 0.27, 0.28, 0.3, 0.32, 0.34, 0.36, 0.38, 0.4, 0.42, 0.44, 0.46, 0.48, 0.5, 0.53, 0.56, 0.59, 0.62, 0.65, 0.68, 0.71, 0.74, 0.77, 0.8, 0.83, 0.86, 0.89, 0.92, 0.95, 0.98, 1, 1.06, 1.12, 1.18, 1.24, 1.3, 1.36, 1.42, 1.48, 1.54, 1.6, 1.66, 1.72, 1.78, 1.84, 1.9, 1.96, 2, 2.12, 2.25, 2.37, 2.5, 2.62, 2.75, 2.87, 3, 3.2, 3.4, 3.6, 3.8, 4, 4.3, 4.7, 4.9, 5, 5.5, 6, 6.5, 6.8, 7, 7.3, 7.5, 7.8, 8, 8.4, 8.7, 9, 9.4, 9.6, 9.8, 10];
public function MyColorMatrix(){
IDENTITY_MATRIX = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1];
LENGTH = IDENTITY_MATRIX.length;
VALUE = new Array();
super();
IDENTITY_MATRIX = fixMatrix(IDENTITY_MATRIX);
copyMatrix(((IDENTITY_MATRIX.length)==LENGTH) ? IDENTITY_MATRIX : IDENTITY_MATRIX);
}
public function adjustBrightness(p_val:Number):void{
p_val = cleanValue(p_val, 100);
if ((((p_val == 0)) || (isNaN(p_val)))){
return;
};
multiplyMatrix([1, 0, 0, 0, p_val, 0, 1, 0, 0, p_val, 0, 0, 1, 0, p_val, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1]);
}
public function adjustSaturation(p_val:Number):void{
p_val = cleanValue(p_val, 100);
if ((((p_val == 0)) || (isNaN(p_val)))){
return;
};
var x:Number = (1 + ((p_val)>0) ? ((3 * p_val) / 100) : (p_val / 100));
var lumR:Number = 0.3086;
var lumG:Number = 0.6094;
var lumB:Number = 0.082;
multiplyMatrix([((lumR * (1 - x)) + x), (lumG * (1 - x)), (lumB * (1 - x)), 0, 0, (lumR * (1 - x)), ((lumG * (1 - x)) + x), (lumB * (1 - x)), 0, 0, (lumR * (1 - x)), (lumG * (1 - x)), ((lumB * (1 - x)) + x), 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1]);
}
public function concat(p_matrix:Array):void{
p_matrix = fixMatrix(p_matrix);
if (p_matrix.length != LENGTH){
return;
};
multiplyMatrix(p_matrix);
}
private function multiplyMatrix(p_matrix:Array):void{
var j:Number;
var l:Number;
var val:Number;
var k:Number;
var col:Array = [];
var i:Number = 0;
while (i < 5) {
j = 0;
while (j < 5) {
col[j] = VALUE[(j + (i * 5))];
j++;
};
l = 0;
while (l < 5) {
val = 0;
k = 0;
while (k < 5) {
val = (val + (p_matrix[(l + (k * 5))] * col[k]));
k++;
};
VALUE[(l + (i * 5))] = val;
l++;
};
i++;
};
}
private function cleanValue(p_val:Number, p_limit:Number):Number{
return (Math.min(p_limit, Math.max(-(p_limit), p_val)));
}
public function adjustBlue(p_val:Number){
p_val = cleanValue(p_val, 0xFF);
if ((((p_val == 0)) || (isNaN(p_val)))){
return;
};
multiplyMatrix([1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, p_val, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1]);
}
public function adjustRed(p_val:Number){
p_val = cleanValue(p_val, 0xFF);
if ((((p_val == 0)) || (isNaN(p_val)))){
return;
};
multiplyMatrix([p_val, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1]);
}
public function adjustHue(p_val:Number):void{
p_val = ((cleanValue(p_val, 180) / 180) * Math.PI);
if ((((p_val == 0)) || (isNaN(p_val)))){
return;
};
var cosVal:Number = Math.cos(p_val);
var sinVal:Number = Math.sin(p_val);
var lumR:Number = 0.213;
var lumG:Number = 0.715;
var lumB:Number = 0.072;
multiplyMatrix([((lumR + (cosVal * (1 - lumR))) + (sinVal * -(lumR))), ((lumG + (cosVal * -(lumG))) + (sinVal * -(lumG))), ((lumB + (cosVal * -(lumB))) + (sinVal * (1 - lumB))), 0, 0, ((lumR + (cosVal * -(lumR))) + (sinVal * 0.143)), ((lumG + (cosVal * (1 - lumG))) + (sinVal * 0.14)), ((lumB + (cosVal * -(lumB))) + (sinVal * -0.283)), 0, 0, ((lumR + (cosVal * -(lumR))) + (sinVal * -((1 - lumR)))), ((lumG + (cosVal * -(lumG))) + (sinVal * lumG)), ((lumB + (cosVal * (1 - lumB))) + (sinVal * lumB)), 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1]);
}
public function adjustColor(p_brightness:Number, p_contrast:Number, p_saturation:Number, p_hue:Number, p_red:Number, p_green:Number, p_blue:Number):void{
adjustHue(p_hue);
adjustContrast(p_contrast);
adjustBrightness(p_brightness);
adjustSaturation(p_saturation);
adjustRed(p_red);
adjustGreen(p_green);
adjustBlue(p_blue);
}
private function copyMatrix(p_matrix:Array):void{
var l:Number = LENGTH;
var i:Number = 0;
while (i < l) {
VALUE[i] = p_matrix[i];
i++;
};
}
public function adjustContrast(p_val:Number):void{
var x:Number;
p_val = cleanValue(p_val, 100);
if ((((p_val == 0)) || (isNaN(p_val)))){
return;
};
if (p_val < 0){
x = (127 + ((p_val / 100) * 127));
} else {
x = (p_val % 1);
if (x == 0){
x = DELTA_INDEX[p_val];
} else {
x = ((DELTA_INDEX[(p_val << 0)] * (1 - x)) + (DELTA_INDEX[((p_val << 0) + 1)] * x));
};
x = ((x * 127) + 127);
};
multiplyMatrix([(x / 127), 0, 0, 0, (0.5 * (127 - x)), 0, (x / 127), 0, 0, (0.5 * (127 - x)), 0, 0, (x / 127), 0, (0.5 * (127 - x)), 0, 0, 0, 1, 0, 0, 0, 0, 0, 1]);
}
public function adjustGreen(p_val:Number){
p_val = cleanValue(p_val, 0xFF);
if ((((p_val == 0)) || (isNaN(p_val)))){
return;
};
multiplyMatrix([1, 0, 0, 0, 0, 0, p_val, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1]);
}
private function fixMatrix(p_matrix:Array):Array{
if ((p_matrix is Array)){
p_matrix = p_matrix.slice(0);
};
if (p_matrix.length < LENGTH){
p_matrix = p_matrix.slice(0, p_matrix.length).concat(IDENTITY_MATRIX.slice(p_matrix.length, LENGTH));
} else {
if (p_matrix.length > LENGTH){
p_matrix = p_matrix.slice(0, LENGTH);
};
};
return (p_matrix);
}
public function toArray():Array{
var _temp:Array = new Array();
return (_temp.slice(0, 20));
}
}
}//package UserdefinedClass
Section 57
//MyMath (UserdefinedClass.MyMath)
package UserdefinedClass {
import flash.geom.*;
public class MyMath {
public function MyMath(){
super();
}
public static function LtoG(contain, child):Point{
var _loc_3:* = undefined;
var _loc_4:* = undefined;
_loc_3 = child.localToGlobal(new Point(0, 0));
_loc_4 = contain.globalToLocal(_loc_3);
return (new Point(_loc_4.x, _loc_4.y));
}
public static function FrandRange(min:Number, max:Number):Number{
var randomNum:Number = (int((Math.random() * ((max - min) + 1))) + min);
return (randomNum);
}
public static function TimeFormat(num:int):Array{
if (num >= 6000){
num = 5999;
};
var minute:int = (num / 60);
var second:int = (num % 60);
var minutearr:Array = worknum(minute);
var secondarr:Array = worknum(second);
return (new Array(secondarr[0], secondarr[1], minutearr[0], minutearr[1]));
}
public static function ranRangeground(min:Number, max:Number, Num:int):Array{
var _random:int;
var temp:Array = new Array();
var len:int = ((max - min) + 1);
var rearr:Array = new Array();
var i:int;
while (i < len) {
temp.push((min + i));
i++;
};
while (Num) {
_random = randRange((len - 1));
rearr.push(temp[_random]);
temp.splice(_random, 1);
len--;
Num--;
};
return (rearr);
}
public static function randRange(max:Number):Number{
var randomNum:Number = int((Math.random() * (max + 1)));
return (randomNum);
}
public static function worknum(num:int):Array{
var ten:int = (num * 0.1);
var one:int = (num % 10);
return (new Array(one, ten));
}
public static function NumtoArray(num:int, flushleft:Boolean=true):Array{
var str:String = String(num);
var len:int = str.length;
var i:int;
var array:Array = new Array();
while (i < len) {
array.push(int(str.charAt(i)));
i++;
};
if (!flushleft){
array.reverse();
};
return (array);
}
}
}//package UserdefinedClass
Section 58
//MySave (UserdefinedClass.MySave)
package UserdefinedClass {
import flash.net.*;
public class MySave {
public static var shareobj:SharedObject;
public function MySave(){
super();
}
public static function init(savename:String){
shareobj = SharedObject.getLocal(savename);
}
public static function save(){
shareobj.flush();
}
public static function exist(varname:String):Boolean{
return (Boolean(((shareobj) && (shareobj.data[varname]))));
}
public static function getdata(varname:String){
return (shareobj.data[varname]);
}
public static function setdata(varname:String, vardata){
shareobj.data[varname] = vardata;
}
public static function clear(){
if (shareobj){
shareobj.clear();
};
}
public static function cleardata(varname:String){
shareobj.data[varname] = null;
delete shareobj.data[varname];
}
}
}//package UserdefinedClass
Section 59
//MyTime (UserdefinedClass.MyTime)
package UserdefinedClass {
import flash.events.*;
import flash.utils.*;
public class MyTime {
private var endFun:Function;
public var time:Timer;
public var count:int;
private var Fun:Function;
public function MyTime(fun:Function){
super();
Fun = fun;
count = 0;
}
public function pausetime(){
if (time){
time.stop();
};
}
public function restart(){
time.start();
}
public function removetime(){
time.stop();
time.removeEventListener(TimerEvent.TIMER, oncountdown);
}
public function oncountdown(e:TimerEvent):void{
count++;
Fun();
}
public function starttime(){
time = new Timer(1000);
time.addEventListener(TimerEvent.TIMER, oncountdown);
time.start();
}
}
}//package UserdefinedClass
Section 60
//SoundControl (UserdefinedClass.SoundControl)
package UserdefinedClass {
import flash.media.*;
public class SoundControl {
public static var Mysdground:Array = new Array();
public static var Mybtnground:Array = new Array();
public static var buttonsound:Number = 1;
public function SoundControl(){
super();
}
public static function destorySdground(){
Mysdground = new Array();
}
public static function stopallsound(){
SoundMixer.stopAll();
}
public static function setsd(volume:Number){
var i:*;
if (!Mysdground.length){
return;
};
var sdtransform:SoundTransform = new SoundTransform(volume);
for (i in Mysdground) {
(Mysdground[i] as BaseSound).sdChannel.soundTransform = sdtransform;
};
}
public static function destory(){
Mybtnground = new Array();
Mysdground = new Array();
}
public static function setbtnsound(volume:Number){
var i:*;
if (!Mybtnground.length){
return;
};
var sdtransform:SoundTransform = new SoundTransform(volume);
for (i in Mybtnground) {
(Mybtnground[i] as Mybutton).soundTransform = sdtransform;
};
}
public static function setallsd(volume:Number){
var sdtransform:SoundTransform = new SoundTransform();
sdtransform.volume = volume;
SoundMixer.soundTransform = sdtransform;
}
}
}//package UserdefinedClass
Section 61
//Actormc (Actormc)
package {
import Element.*;
public dynamic class Actormc extends Actor {
public function Actormc(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 62
//BackC (BackC)
package {
import flash.display.*;
public dynamic class BackC extends MovieClip {
}
}//package
Section 63
//BackGround (BackGround)
package {
import flash.display.*;
public dynamic class BackGround extends MovieClip {
}
}//package
Section 64
//BGM_sd (BGM_sd)
package {
import flash.media.*;
public dynamic class BGM_sd extends Sound {
}
}//package
Section 65
//Bigreel (Bigreel)
package {
import flash.display.*;
public dynamic class Bigreel extends MovieClip {
public function Bigreel(){
addFrameScript(0, frame1, 18, frame19);
}
function frame1(){
stop();
}
function frame19(){
stop();
}
}
}//package
Section 66
//Bomb (Bomb)
package {
import flash.display.*;
public dynamic class Bomb extends MovieClip {
public function Bomb(){
addFrameScript(0, frame1, 37, frame38);
}
function frame38(){
gotoAndStop(1);
}
function frame1(){
stop();
}
}
}//package
Section 67
//Box (Box)
package {
import flash.display.*;
public dynamic class Box extends MovieClip {
public function Box(){
addFrameScript(0, frame1, 18, frame19);
}
function frame1(){
stop();
}
function frame19(){
stop();
}
}
}//package
Section 68
//Cover (Cover)
package {
import flash.display.*;
import flash.events.*;
import flash.net.*;
public dynamic class Cover extends MovieClip {
public var continue_btn:SimpleButton;
public var moregame_btn:SimpleButton;
public var play_btn:SimpleButton;
public var logo:MovieClip;
public function Cover(){
addFrameScript(0, frame1);
}
function frame1(){
moregame_btn.addEventListener(MouseEvent.MOUSE_DOWN, More);
logo.addEventListener(MouseEvent.MOUSE_DOWN, More1);
}
public function More(event:MouseEvent):void{
var localDomainLC:LocalConnection = new LocalConnection();
var flashCurrentDomainName:String = localDomainLC.domain;
var gameTitle:* = "ninja-stealth";
var btnUrl:* = ((("http://www.flobzoo.com/?utm_source=" + flashCurrentDomainName) + "&utm_medium=game&utm_campaign=") + gameTitle);
navigateToURL(new URLRequest(btnUrl), "blank");
}
public function More1(event:MouseEvent):void{
var localDomainLC:LocalConnection = new LocalConnection();
var flashCurrentDomainName:String = localDomainLC.domain;
var gameTitle:* = "ninja-stealth";
var btnUrl:* = ((("http://www.flobzoo.com/?utm_source=" + flashCurrentDomainName) + "&utm_medium=game&utm_campaign=") + gameTitle);
navigateToURL(new URLRequest(btnUrl), "blank");
}
}
}//package
Section 69
//Cover_sd (Cover_sd)
package {
import flash.media.*;
public dynamic class Cover_sd extends Sound {
}
}//package
Section 70
//Die_sd (Die_sd)
package {
import flash.media.*;
public dynamic class Die_sd extends Sound {
}
}//package
Section 71
//Dieflash (Dieflash)
package {
import flash.display.*;
public dynamic class Dieflash extends MovieClip {
public function Dieflash(){
addFrameScript(58, frame59);
}
function frame59(){
stop();
}
}
}//package
Section 72
//Enemy1 (Enemy1)
package {
import Element.*;
public dynamic class Enemy1 extends Enemy {
public function Enemy1(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 73
//Enemy2 (Enemy2)
package {
import Element.*;
public dynamic class Enemy2 extends Enemy {
public function Enemy2(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 74
//fang (fang)
package {
import flash.display.*;
public dynamic class fang extends MovieClip {
}
}//package
Section 75
//Gameover (Gameover)
package {
import flash.display.*;
import flash.events.*;
import flash.net.*;
public dynamic class Gameover extends MovieClip {
public var moregame_btn:SimpleButton;
public var retry_btn:SimpleButton;
public var back_btn:SimpleButton;
public var shop_btn:SimpleButton;
public var fail:MovieClip;
public function Gameover(){
addFrameScript(38, frame39);
}
function frame39(){
moregame_btn.addEventListener(MouseEvent.MOUSE_DOWN, More);
stop();
}
public function More(event:MouseEvent):void{
var localDomainLC:LocalConnection = new LocalConnection();
var flashCurrentDomainName:String = localDomainLC.domain;
var gameTitle:* = "ninja-stealth";
var btnUrl:* = ((("http://www.flobzoo.com/?utm_source=" + flashCurrentDomainName) + "&utm_medium=game&utm_campaign=") + gameTitle);
navigateToURL(new URLRequest(btnUrl), "blank");
}
}
}//package
Section 76
//Gameui (Gameui)
package {
import flash.display.*;
import flash.events.*;
import flash.net.*;
public dynamic class Gameui extends MovieClip {
public var music_btn:MovieClip;
public var t0:MovieClip;
public var t1:MovieClip;
public var t3:MovieClip;
public var pause_btn:MovieClip;
public var m0:MovieClip;
public var m1:MovieClip;
public var m2:MovieClip;
public var m4:MovieClip;
public var m5:MovieClip;
public var logo:MovieClip;
public var m3:MovieClip;
public var moregame_btn:SimpleButton;
public var menu_btn:SimpleButton;
public var res_btn:SimpleButton;
public var t2:MovieClip;
public function Gameui(){
addFrameScript(0, frame1);
}
function frame1(){
moregame_btn.addEventListener(MouseEvent.MOUSE_DOWN, More);
logo.addEventListener(MouseEvent.MOUSE_DOWN, More1);
}
public function More1(event:MouseEvent):void{
var localDomainLC:LocalConnection = new LocalConnection();
var flashCurrentDomainName:String = localDomainLC.domain;
var gameTitle:* = "ninja-stealth";
var btnUrl:* = ((("http://www.flobzoo.com/?utm_source=" + flashCurrentDomainName) + "&utm_medium=game&utm_campaign=") + gameTitle);
navigateToURL(new URLRequest(btnUrl), "blank");
}
public function More(event:MouseEvent):void{
var localDomainLC:LocalConnection = new LocalConnection();
var flashCurrentDomainName:String = localDomainLC.domain;
var gameTitle:* = "ninja-stealth";
var btnUrl:* = ((("http://www.flobzoo.com/?utm_source=" + flashCurrentDomainName) + "&utm_medium=game&utm_campaign=") + gameTitle);
navigateToURL(new URLRequest(btnUrl), "blank");
}
}
}//package
Section 77
//Hititem_sd (Hititem_sd)
package {
import flash.media.*;
public dynamic class Hititem_sd extends Sound {
}
}//package
Section 78
//Howtoplay (Howtoplay)
package {
import flash.display.*;
import flash.events.*;
import flash.net.*;
public dynamic class Howtoplay extends MovieClip {
public var moregame_btn:SimpleButton;
public var next_btn:SimpleButton;
public var logo:MovieClip;
public function Howtoplay(){
addFrameScript(0, frame1);
}
function frame1(){
moregame_btn.addEventListener(MouseEvent.MOUSE_DOWN, More);
logo.addEventListener(MouseEvent.MOUSE_DOWN, More1);
}
public function More(event:MouseEvent):void{
var localDomainLC:LocalConnection = new LocalConnection();
var flashCurrentDomainName:String = localDomainLC.domain;
var gameTitle:* = "ninja-stealth";
var btnUrl:* = ((("http://www.flobzoo.com/?utm_source=" + flashCurrentDomainName) + "&utm_medium=game&utm_campaign=") + gameTitle);
navigateToURL(new URLRequest(btnUrl), "blank");
}
public function More1(event:MouseEvent):void{
var localDomainLC:LocalConnection = new LocalConnection();
var flashCurrentDomainName:String = localDomainLC.domain;
var gameTitle:* = "ninja-stealth";
var btnUrl:* = ((("http://www.flobzoo.com/?utm_source=" + flashCurrentDomainName) + "&utm_medium=game&utm_campaign=") + gameTitle);
navigateToURL(new URLRequest(btnUrl), "blank");
}
}
}//package
Section 79
//Jump_sd (Jump_sd)
package {
import flash.media.*;
public dynamic class Jump_sd extends Sound {
}
}//package
Section 80
//Main (Main)
package {
import Element.*;
import flash.display.*;
import flash.events.*;
import UserdefinedClass.*;
import caurina.transitions.*;
import Gamestage.*;
import flash.utils.*;
import flash.filters.*;
public class Main extends MovieClip {
public var shop:MovieClip;
public var gameui:MovieClip;
public var Game:Sprite;
public var Cue:Sprite;
public var allowplay:int;
public var Loading:Sprite;
public var highscore:int;// = 0
public var Debug:Sprite;
public var delayplay:Timer;
public var loading:MovieClip;
public var initgamenum:int;// = 0
public var gamestage:String;
public var shopmenu:Boolean;// = false
public var mydata:MyData;
public var sucmcarr:Array;
public var winmc:MovieClip;
public var selpoint:int;// = 1
public var howtoplay:MovieClip;
public var URLstr:String;// = ""
public var GameClass:BaseStage;
public var mission:MovieClip;
public var SoundBool:Boolean;// = true
public var Ui:Sprite;
public var cover:MovieClip;
public var money:int;
public var gameover:MovieClip;
public var stagenum:int;
public var delaytime:Timer;
public var selstage:MovieClip;
public var Time:Timer;
public var seltrain:int;// = 1
public var pause:MovieClip;
public var tempgamestage:int;
public static var hititem:BaseSound = new BaseSound("Hititem_sd");
public static var bgm:BaseSound = new BaseSound("BGM_sd");
public static var coverbgm:BaseSound = new BaseSound("Cover_sd");
public static var diesd:BaseSound = new BaseSound("Die_sd");
public static var sowrdsd:BaseSound = new BaseSound("Sword_sd");
public static var jumpsd:BaseSound = new BaseSound("Jump_sd");
public function Main(){
super();
if (stage){
init();
} else {
addEventListener(Event.ADDED_TO_STAGE, init);
};
}
private function destroy(){
Clr.removeAllChildren(Game);
Clr.removeAllChildren(Ui);
Clr.removeAllChildren(Cue);
Clr.removeAllChildren(Loading);
}
private function initgame():void{
gamestage = "init";
addEventListener(MouseEvent.MOUSE_DOWN, onclickbtn);
stage.addEventListener(KeyboardEvent.KEY_UP, onkeyup);
addEventListener(Event.ENTER_FRAME, oncue);
Input.addinput(stage);
showcover();
}
private function worksellv():void{
}
private function initshop(){
worksucceed();
var tempsuc:Array = new Array(shop.s1, shop.s2, shop.s3, shop.s4, shop.s5, shop.s6, shop.s7, shop.s8, shop.s9);
var i:int;
while (i < 9) {
if (mydata.succeed[i]){
tempsuc[i].gotoAndStop(2);
} else {
tempsuc[i].gotoAndStop(1);
};
i++;
};
var tempaddv:Array = new Array(shop.u1, shop.u2, shop.u3);
var tempbtn:Array = new Array(shop.btn1.btn, shop.btn2.btn, shop.btn3.btn);
i = 0;
while (i < 3) {
if (mydata.addv[i] == mydata.addmax[i]){
tempaddv[i].gotoAndStop(2);
tempbtn[i].enabled = false;
BaseUI.setalpha(0, tempaddv[i], "l", 1);
BaseUI.setalpha(0, tempaddv[i], "a", 4);
} else {
tempaddv[i].gotoAndStop(1);
tempbtn[i].enabled = true;
};
if (tempaddv[i].currentFrame == 1){
BaseUI.setmoney(tempaddv[i], mydata.addv[i], "l", 1);
BaseUI.setMaxscore(tempaddv[i], mydata.addvv[i][mydata.addv[i]], "a", 4);
};
i++;
};
BaseUI.setmoney(shop, money, "m", 6);
}
private function init(e:Event=null):void{
removeEventListener(Event.ADDED_TO_STAGE, init);
stage.quality = StageQuality.MEDIUM;
stage.frameRate = 60;
initdata();
initcontainer();
initUImc();
initgame();
}
public function worksucceed(){
if (!resucceed(0)){
if (allowplay >= 2){
setsucceed(0);
savesucceed();
};
};
if (!resucceed(1)){
if (initgamenum > 10){
setsucceed(1);
savesucceed();
};
};
if (!resucceed(2)){
if (money >= 1000){
setsucceed(2);
savesucceed();
};
};
if (!resucceed(3)){
if (money >= 5000){
setsucceed(3);
savesucceed();
};
};
if (!resucceed(4)){
if (((mydata.mission[0]) && (mydata.mission[1]))){
setsucceed(4);
savesucceed();
};
};
if (!resucceed(5)){
if (allmissiontrue()){
setsucceed(5);
savesucceed();
};
};
if (!resucceed(6)){
if (mydata.addv[0] == mydata.addmax[0]){
setsucceed(6);
savesucceed();
};
};
if (!resucceed(7)){
if (mydata.addv[1] == mydata.addmax[1]){
setsucceed(7);
savesucceed();
};
};
if (!resucceed(8)){
if ((((((mydata.addv[2] == mydata.addmax[2])) && (resucceed(7)))) && (resucceed(6)))){
setsucceed(8);
savesucceed();
};
};
}
private function initgameUI(){
gameui.pause_btn.gotoAndStop(1);
Ui.addChild(gameui);
setuiMoney(0);
setTime(0);
}
public function showpause(){
Ui.addChild(pause);
pause.x = (350 - (pause.width * 0.5));
pause.y = (250 - (pause.height * 0.5));
gamestage = "pause";
}
private function showhowtoplay():void{
gamestage = "howtoplay";
Clr.removeAllChildren(Ui);
Ui.addChild(howtoplay);
}
public function savesucceed(){
MySave.setdata("succeed", MyData.getInstance().succeed);
MySave.save();
}
public function setSpeedbar(V:int){
gameui.power.gotoAndStop((V + 1));
}
private function mathhighscore():int{
var HS:int;
var i:int;
while (i < 10) {
HS = (HS + MyData.getInstance().highscore[i]);
i++;
};
return (HS);
}
private function workwin(){
if (hitbtn(winmc.shop_btn)){
GameClass.destroy();
Clr.removeAllChildren(Game);
showshop();
SoundControl.stopallsound();
Main.coverbgm.playsound(1000000);
return;
};
if (hitbtn(winmc.moregame_btn)){
return;
};
if (hitbtn(winmc.next_btn)){
issave();
GameClass.destroy();
Clr.removeAllChildren(Game);
showselect();
SoundControl.stopallsound();
Main.coverbgm.playsound(1000000);
return;
};
}
public function removedata(){
MySave.init("NinjaStealth");
MySave.clear();
}
private function toplay(){
gamestage = "playing";
Clr.removeAllChildren(Ui);
var stageclass:Class = (MyData.getInstance().stageGroup[(stagenum - 1)] as Class);
GameClass = new stageclass(this);
Game.addChild(GameClass);
initgameUI();
Ui.addChild(mission);
mission.x = (350 - (mission.width * 0.5));
mission.y = (250 - (mission.height * 0.5));
mission.alpha = 1;
BaseUI.setMaxscore(mission, mydata.stagemission[(initgamenum - 1)][0], "s", 3);
BaseUI.setMaxscore(mission, mydata.stagemission[(initgamenum - 1)][1], "e", 3);
Tweener.addTween(mission, {delay:3, time:0.5, alpha:0, onComplete:reMissionMc});
}
private function showselect():void{
stagenum = 0;
gamestage = "select";
Clr.removeAllChildren(Ui);
setselectstage();
Ui.addChild(selstage);
}
private function updatashop(){
var tempsuc:Array = new Array(shop.s1, shop.s2, shop.s3, shop.s4, shop.s5, shop.s6, shop.s7, shop.s8, shop.s9);
shop.word.gotoAndStop(10);
var i:int;
while (i < 9) {
if (hitbtn(tempsuc[i])){
shop.word.gotoAndStop((i + 1));
break;
};
i++;
};
}
public function delayrun(time:int, fun:Function){
Tweener.addTween(this, {delay:time, onComplete:fun});
}
private function initUImc():void{
cover = new Cover();
howtoplay = new Howtoplay();
selstage = new Selstage();
shop = new Shop();
gameui = new Gameui();
winmc = new Win();
mission = new Mission();
gameover = new Gameover();
pause = new Pause();
}
private function workcover(){
if (hitbtn(cover.play_btn)){
resetdata();
showhowtoplay();
return;
};
if (hitbtn(cover.continue_btn)){
loaddata();
showhowtoplay();
return;
};
if (hitbtn(cover.moregame_btn)){
return;
};
}
private function showlv(lv:int){
gamestage = "lv";
Clr.removeAllChildren(Ui);
}
public function saveHS(){
MySave.setdata("highscore", MyData.getInstance().highscore);
MySave.save();
}
public function gamepause(){
gameui.pause_btn.gotoAndStop(((gameui.pause_btn.currentFrame % 2) + 1));
GameClass.pausegame();
}
private function workselect():void{
if (hitbtn(selstage.moregame_btn)){
return;
};
if (hitbtn(selstage.shop_btn)){
showshop();
return;
};
if (hitbtn(selstage.back_btn)){
showcover();
return;
};
var tempMc:Array = new Array(selstage.stage1, selstage.stage2, selstage.stage3, selstage.stage4, selstage.stage5, selstage.stage6, selstage.stage7, selstage.stage8, selstage.stage9, selstage.stage10);
var unhit:Boolean;
var i:int;
while (i < 10) {
if (tempMc[i].hitTestPoint(mouseX, mouseY, true)){
if (tempMc[i]["btn"].enabled){
unhit = false;
stagenum = (i + 1);
};
};
i++;
};
if (unhit){
return;
};
initstage(stagenum);
trace("gamestage:", stagenum);
}
private function reMissionMc(){
if (mission.parent){
mission.parent.removeChild(mission);
};
GameClass.startlistener();
}
public function setpowerbar(Num:int){
gameui.power.gotoAndStop(Num);
}
public function setTime(T:int){
BaseUI.settime(gameui, T);
}
public function savemoney(){
MySave.setdata("money", money);
MySave.save();
}
public function savemission(){
MySave.setdata("mission", MyData.getInstance().mission);
MySave.save();
}
private function initcontainer():void{
Game = new Sprite();
Ui = new Sprite();
Loading = new Sprite();
Debug = new Sprite();
Cue = new Sprite();
addChild(Game);
addChild(Ui);
addChild(Cue);
addChild(Loading);
addChild(Debug);
}
private function showshop(){
gamestage = "shop";
Clr.removeAllChildren(Ui);
Ui.addChild(shop);
initshop();
}
public function resetdata(){
mydata = MyData.getInstance();
MySave.setdata("hadbeen", true);
allowplay = 1;
money = 0;
mydata.highscore = new Array();
var j:int;
while (j < 10) {
mydata.highscore.push(0);
j++;
};
mydata.resetdata();
MySave.setdata("mission", mydata.mission);
MySave.setdata("highscore", mydata.highscore);
MySave.setdata("money", money);
MySave.setdata("allowplay", allowplay);
MySave.setdata("succeed", mydata.succeed);
MySave.setdata("addv", mydata.addv);
MySave.save();
}
public function setpoint(num:Number){
var sp:Number = 284.4;
var ep:Number = 582.4;
gameui.p.x = (((ep - sp) * (num / 100)) + sp);
BaseUI.setmoney(gameui.p, int(num), "n", 3);
}
private function workpause(){
if (hitbtn(pause.moregame_btn)){
return;
};
if (hitbtn(pause.continue_btn)){
gamepause();
return;
};
}
private function workshop():void{
if (hitbtn(shop.back_btn)){
saveshop();
showselect();
return;
};
if (hitbtn(shop.moregame_btn)){
return;
};
var tempaddv:Array = new Array(shop.u1, shop.u2, shop.u3);
var tempbtn:Array = new Array(shop.btn1, shop.btn2, shop.btn3);
var tempmoney:int;
var i:int;
while (i < 3) {
if (hitbtn(tempbtn[i])){
if (tempbtn[i]["btn"].enabled){
tempmoney = mydata.addvv[i][mydata.addv[i]];
if (money >= tempmoney){
money = (money - tempmoney);
var _local5 = mydata.addv;
var _local6 = i;
var _local7 = (_local5[_local6] + 1);
_local5[_local6] = _local7;
initshop();
saveshop();
};
};
};
i++;
};
}
private function workhowtoplay():void{
if (hitbtn(howtoplay.next_btn)){
showselect();
return;
};
if (hitbtn(howtoplay.back_btn)){
showcover();
return;
};
if (hitbtn(howtoplay.moregame_btn)){
return;
};
}
private function setcover():void{
if (MySave.exist("hadbeen")){
cover.continue_btn.x = 69.5;
} else {
cover.continue_btn.x = -300;
};
}
private function loaddata():void{
mydata = MyData.getInstance();
if (MySave.exist("hadbeen")){
allowplay = MySave.getdata("allowplay");
money = MySave.getdata("money");
mydata.succeed = MySave.getdata("succeed");
mydata.highscore = MySave.getdata("highscore");
mydata.addv = MySave.getdata("addv");
mydata.mission = MySave.getdata("mission");
} else {
resetdata();
};
}
public function gamereset(){
GameClass.destroy();
Clr.removeAllChildren(Game);
toplay();
}
public function showloading():void{
gamestage = "loading";
SoundControl.stopallsound();
Loading.addChild(loading);
}
public function repause(){
Ui.removeChild(pause);
gamestage = "playing";
}
public function showWin(T:int, M:int){
var T = T;
var M = M;
winmc.x = 19;
winmc.y = 24;
winmc.win.alpha = 0;
winmc.gotoAndPlay(1);
if ((money + M) <= 999999){
money = (money + M);
} else {
money = 999999;
};
MySave.save();
gamestage = "win";
Ui.addChild(winmc);
Tweener.addTween(winmc, {delay:0.8, onComplete:function (){
winmc.win.alpha = 1;
BaseUI.settime(winmc.win, T);
BaseUI.setmoney(winmc.win, M, "m", 4);
}});
}
private function setsucceed(num:int){
mydata.succeed[num] = true;
}
private function savedata():void{
MySave.setdata("allowplay", allowplay);
MySave.save();
}
private function resucceed(num:int):Boolean{
return (mydata.succeed[num]);
}
private function onclickbtn(e:MouseEvent):void{
if (gamestage == "cover"){
workcover();
return;
};
if (gamestage == "shop"){
workshop();
return;
};
if (gamestage == "howtoplay"){
workhowtoplay();
return;
};
if (gamestage == "select"){
workselect();
return;
};
if (gamestage == "success"){
};
if (gamestage == "playing"){
workplaying();
return;
};
if (gamestage == "over"){
workgameover();
return;
};
if (gamestage == "win"){
workwin();
return;
};
if (gamestage == "pause"){
workpause();
return;
};
}
private function savealldata(){
MySave.setdata("highscore", mydata.highscore);
MySave.setdata("money", money);
MySave.setdata("allowplay", allowplay);
MySave.setdata("succeed", mydata.succeed);
MySave.setdata("addv", mydata.addv);
MySave.save();
}
private function issave():void{
initgamenum++;
worksucceed();
if (initgamenum > MySave.getdata("allowplay")){
if (initgamenum < 11){
allowplay = initgamenum;
worksucceed();
MySave.setdata("allowplay", allowplay);
MySave.save();
};
};
initgamenum--;
}
private function initdata():void{
gamestage = new String();
stagenum = 0;
MySave.init("NinjaStealth");
}
private function onkeyup(e:KeyboardEvent):void{
if (gamestage == "playing"){
if (e.keyCode == Input.P){
gamepause();
};
if (e.keyCode == Input.R){
gamereset();
};
};
if (gamestage == "pause"){
if (e.keyCode == Input.P){
gamepause();
};
};
}
public function addmoney(am:int){
if ((money + am) <= 999999){
money = (money + am);
} else {
money = 999999;
};
}
private function ongotogame(e:TimerEvent):void{
delayplay.stop();
delayplay.removeEventListener(TimerEvent.TIMER, ongotogame);
Clr.removeAllChildren(Loading);
gotogame();
}
public function gotogame(){
GameClass.startlistener();
gamestage = "playing";
}
private function workgameover(){
if (hitbtn(gameover.retry_btn)){
gamereset();
return;
};
if (hitbtn(gameover.back_btn)){
GameClass.destroy();
Clr.removeAllChildren(Game);
SoundControl.stopallsound();
showselect();
SoundControl.stopallsound();
Main.coverbgm.playsound(1000000);
return;
};
if (hitbtn(gameover.moregame_btn)){
return;
};
if (hitbtn(gameover.shop_btn)){
GameClass.destroy();
Clr.removeAllChildren(Game);
SoundControl.stopallsound();
showshop();
SoundControl.stopallsound();
Main.coverbgm.playsound(1000000);
return;
};
}
private function loadgame(e:TimerEvent=null){
delayplay.stop();
delayplay.removeEventListener(TimerEvent.TIMER, loadgame);
}
private function allmissiontrue():Boolean{
var tempbool:Boolean;
var i:int;
while (i < 20) {
if (!mydata.mission[i]){
tempbool = false;
break;
};
i++;
};
return (tempbool);
}
private function setselectstage():void{
var tempMc:Array = new Array(selstage.stage1, selstage.stage2, selstage.stage3, selstage.stage4, selstage.stage5, selstage.stage6, selstage.stage7, selstage.stage8, selstage.stage9, selstage.stage10);
var colormatrix:* = new MyColorMatrix();
colormatrix.adjustColor(-50, 0, -60, 0, 0, 0, 0);
var cmf:ColorMatrixFilter = new ColorMatrixFilter(colormatrix.VALUE);
var filters_temp:Array = new Array();
filters_temp.push(cmf);
var i:int;
while (i < 10) {
if (allowplay > i){
tempMc[i].filters = new Array();
tempMc[i]["btn"].enabled = true;
} else {
tempMc[i].filters = filters_temp;
tempMc[i]["btn"].enabled = false;
};
if (mydata.mission[(2 * i)]){
tempMc[i]["s1"].gotoAndStop(2);
} else {
tempMc[i]["s1"].gotoAndStop(1);
};
if (mydata.mission[((2 * i) + 1)]){
tempMc[i]["s2"].gotoAndStop(2);
} else {
tempMc[i]["s2"].gotoAndStop(1);
};
i++;
};
}
private function showcover():void{
SoundControl.stopallsound();
Main.coverbgm.playsound(1000000);
gamestage = "cover";
Clr.removeAllChildren(Ui);
Ui.addChild(cover);
setcover();
}
public function showGameover(T:int, M:int):void{
var T = T;
var M = M;
gameover.x = 19;
gameover.y = 24;
gameover.gotoAndPlay(1);
gameover.fail.alpha = 0;
if ((money + M) <= 999999){
money = (money + M);
} else {
money = 999999;
};
MySave.setdata("money", money);
MySave.save();
gamestage = "over";
Clr.removeAllChildren(Ui);
Ui.addChild(gameover);
Tweener.addTween(gameover, {delay:0.8, onComplete:function (){
gameover.fail.alpha = 1;
BaseUI.settime(gameover.fail, T);
BaseUI.setmoney(gameover.fail, M, "m", 4);
}});
}
private function hitbtn(btn:DisplayObject):Boolean{
if (((btn) && (btn.visible))){
return (btn.hitTestPoint(mouseX, mouseY, true));
};
return (false);
}
public function setuiMoney(Num:int){
BaseUI.setMaxscore(gameui, Num, "m", 6);
}
public function saveshop(){
MySave.setdata("money", money);
MySave.setdata("succeed", mydata.succeed);
MySave.setdata("addv", MyData.getInstance().addv);
MySave.save();
}
private function oncue(e:Event=null){
if (gamestage == "shop"){
updatashop();
};
}
private function initstage(num:int):void{
initgamenum = num;
toplay();
}
private function workplaying(){
if (hitbtn(gameui.pause_btn)){
gamepause();
return;
};
if (hitbtn(gameui.res_btn)){
gamereset();
return;
};
if (hitbtn(gameui.menu_btn)){
GameClass.destroy();
Clr.removeAllChildren(Game);
SoundControl.stopallsound();
showselect();
SoundControl.stopallsound();
Main.coverbgm.playsound(1000000);
return;
};
if (hitbtn(gameui.music_btn)){
gameui.music_btn.gotoAndStop(((gameui.music_btn.currentFrame % 2) + 1));
if (SoundBool){
SoundBool = false;
} else {
SoundBool = true;
};
if (SoundBool){
SoundControl.setallsd(1);
} else {
SoundControl.setallsd(0);
};
return;
};
if (hitbtn(gameui.logo_btn)){
return;
};
}
}
}//package
Section 81
//Mission (Mission)
package {
import flash.display.*;
public dynamic class Mission extends MovieClip {
public var s1:MovieClip;
public var e0:MovieClip;
public var e1:MovieClip;
public var e2:MovieClip;
public var s0:MovieClip;
public var s2:MovieClip;
}
}//package
Section 82
//Pause (Pause)
package {
import flash.display.*;
import flash.events.*;
import flash.net.*;
public dynamic class Pause extends MovieClip {
public var continue_btn:SimpleButton;
public var moregame_btn:SimpleButton;
public function Pause(){
addFrameScript(0, frame1);
}
function frame1(){
moregame_btn.addEventListener(MouseEvent.MOUSE_DOWN, More);
}
public function More(event:MouseEvent):void{
var localDomainLC:LocalConnection = new LocalConnection();
var flashCurrentDomainName:String = localDomainLC.domain;
var gameTitle:* = "ninja-stealth";
var btnUrl:* = ((("http://www.flobzoo.com/?utm_source=" + flashCurrentDomainName) + "&utm_medium=game&utm_campaign=") + gameTitle);
navigateToURL(new URLRequest(btnUrl), "blank");
}
}
}//package
Section 83
//pierce (pierce)
package {
import flash.display.*;
public dynamic class pierce extends MovieClip {
}
}//package
Section 84
//preLoadSnd (preLoadSnd)
package {
import flash.media.*;
public dynamic class preLoadSnd extends Sound {
}
}//package
Section 85
//r1 (r1)
package {
import flash.display.*;
public dynamic class r1 extends MovieClip {
public var hit:MovieClip;
public var itemmc:MovieClip;
public var housemask:MovieClip;
}
}//package
Section 86
//r10 (r10)
package {
import flash.display.*;
public dynamic class r10 extends MovieClip {
public var hit:MovieClip;
public var itemmc:MovieClip;
public var housemask:MovieClip;
}
}//package
Section 87
//r2 (r2)
package {
import flash.display.*;
public dynamic class r2 extends MovieClip {
public var hit:MovieClip;
public var itemmc:MovieClip;
public var housemask:MovieClip;
}
}//package
Section 88
//r3 (r3)
package {
import flash.display.*;
public dynamic class r3 extends MovieClip {
public var hit:MovieClip;
public var itemmc:MovieClip;
public var housemask:MovieClip;
}
}//package
Section 89
//r4 (r4)
package {
import flash.display.*;
public dynamic class r4 extends MovieClip {
public var hit:MovieClip;
public var itemmc:MovieClip;
public var housemask:MovieClip;
}
}//package
Section 90
//r5 (r5)
package {
import flash.display.*;
public dynamic class r5 extends MovieClip {
public var hit:MovieClip;
public var itemmc:MovieClip;
public var housemask:MovieClip;
}
}//package
Section 91
//r6 (r6)
package {
import flash.display.*;
public dynamic class r6 extends MovieClip {
public var hit:MovieClip;
public var itemmc:MovieClip;
public var housemask:MovieClip;
}
}//package
Section 92
//r7 (r7)
package {
import flash.display.*;
public dynamic class r7 extends MovieClip {
public var hit:MovieClip;
public var itemmc:MovieClip;
public var housemask:MovieClip;
}
}//package
Section 93
//r8 (r8)
package {
import flash.display.*;
public dynamic class r8 extends MovieClip {
public var hit:MovieClip;
public var itemmc:MovieClip;
public var housemask:MovieClip;
}
}//package
Section 94
//r9 (r9)
package {
import flash.display.*;
public dynamic class r9 extends MovieClip {
public var hit:MovieClip;
public var itemmc:MovieClip;
public var housemask:MovieClip;
}
}//package
Section 95
//Red (Red)
package {
import flash.display.*;
public dynamic class Red extends MovieClip {
public function Red(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 96
//Reel (Reel)
package {
import flash.display.*;
public dynamic class Reel extends MovieClip {
public function Reel(){
addFrameScript(0, frame1, 18, frame19);
}
function frame1(){
stop();
}
function frame19(){
stop();
}
}
}//package
Section 97
//Selstage (Selstage)
package {
import flash.display.*;
import flash.events.*;
import flash.net.*;
public dynamic class Selstage extends MovieClip {
public var stage9:MovieClip;
public var back_btn:SimpleButton;
public var shop_btn:SimpleButton;
public var stage10:MovieClip;
public var moregame_btn:SimpleButton;
public var logo:MovieClip;
public var stage1:MovieClip;
public var stage2:MovieClip;
public var stage3:MovieClip;
public var stage5:MovieClip;
public var stage6:MovieClip;
public var stage7:MovieClip;
public var stage8:MovieClip;
public var stage4:MovieClip;
public function Selstage(){
addFrameScript(0, frame1);
}
function frame1(){
moregame_btn.addEventListener(MouseEvent.MOUSE_DOWN, More);
logo.addEventListener(MouseEvent.MOUSE_DOWN, More1);
}
public function More1(event:MouseEvent):void{
var localDomainLC:LocalConnection = new LocalConnection();
var flashCurrentDomainName:String = localDomainLC.domain;
var gameTitle:* = "ninja-stealth";
var btnUrl:* = ((("http://www.flobzoo.com/?utm_source=" + flashCurrentDomainName) + "&utm_medium=game&utm_campaign=") + gameTitle);
navigateToURL(new URLRequest(btnUrl), "blank");
}
public function More(event:MouseEvent):void{
var localDomainLC:LocalConnection = new LocalConnection();
var flashCurrentDomainName:String = localDomainLC.domain;
var gameTitle:* = "ninja-stealth";
var btnUrl:* = ((("http://www.flobzoo.com/?utm_source=" + flashCurrentDomainName) + "&utm_medium=game&utm_campaign=") + gameTitle);
navigateToURL(new URLRequest(btnUrl), "blank");
}
}
}//package
Section 98
//Shop (Shop)
package {
import flash.display.*;
import flash.events.*;
import flash.net.*;
public dynamic class Shop extends MovieClip {
public var back_btn:SimpleButton;
public var word:MovieClip;
public var s1:MovieClip;
public var s2:MovieClip;
public var s3:MovieClip;
public var s4:MovieClip;
public var s5:MovieClip;
public var s6:MovieClip;
public var s7:MovieClip;
public var s8:MovieClip;
public var s9:MovieClip;
public var btn1:MovieClip;
public var btn2:MovieClip;
public var u1:MovieClip;
public var u2:MovieClip;
public var btn3:MovieClip;
public var m0:MovieClip;
public var u3:MovieClip;
public var m3:MovieClip;
public var m4:MovieClip;
public var m5:MovieClip;
public var moregame_btn:SimpleButton;
public var m2:MovieClip;
public var m1:MovieClip;
public function Shop(){
addFrameScript(0, frame1);
}
function frame1(){
moregame_btn.addEventListener(MouseEvent.MOUSE_DOWN, More);
}
public function More(event:MouseEvent):void{
var localDomainLC:LocalConnection = new LocalConnection();
var flashCurrentDomainName:String = localDomainLC.domain;
var gameTitle:* = "ninja-stealth";
var btnUrl:* = ((("http://www.flobzoo.com/?utm_source=" + flashCurrentDomainName) + "&utm_medium=game&utm_campaign=") + gameTitle);
navigateToURL(new URLRequest(btnUrl), "blank");
}
}
}//package
Section 99
//Smoke (Smoke)
package {
import flash.display.*;
public dynamic class Smoke extends MovieClip {
public function Smoke(){
addFrameScript(30, frame31);
}
function frame31(){
stop();
}
}
}//package
Section 100
//Sword_sd (Sword_sd)
package {
import flash.media.*;
public dynamic class Sword_sd extends Sound {
}
}//package
Section 101
//Win (Win)
package {
import flash.display.*;
import flash.events.*;
import flash.net.*;
public dynamic class Win extends MovieClip {
public var next_btn:SimpleButton;
public var shop_btn:SimpleButton;
public var moregame_btn:SimpleButton;
public var win:MovieClip;
public function Win(){
addFrameScript(38, frame39);
}
public function More(event:MouseEvent):void{
var localDomainLC:LocalConnection = new LocalConnection();
var flashCurrentDomainName:String = localDomainLC.domain;
var gameTitle:* = "ninja-stealth";
var btnUrl:* = ((("http://www.flobzoo.com/?utm_source=" + flashCurrentDomainName) + "&utm_medium=game&utm_campaign=") + gameTitle);
navigateToURL(new URLRequest(btnUrl), "blank");
}
function frame39(){
moregame_btn.addEventListener(MouseEvent.MOUSE_DOWN, More);
stop();
}
}
}//package