Section 1
//PropTween (com.greensock.core.PropTween)
package com.greensock.core {
public class PropTween {
public var priority:int;
public var start:Number;
public var prevNode:PropTween;
public var change:Number;
public var target:Object;
public var name:String;
public var property:String;
public var nextNode:PropTween;
public var isPlugin:Boolean;
public function PropTween(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Number, _arg5:String, _arg6:Boolean, _arg7:PropTween=null, _arg8:int=0){
this.target = _arg1;
this.property = _arg2;
this.start = _arg3;
this.change = _arg4;
this.name = _arg5;
this.isPlugin = _arg6;
if (_arg7){
_arg7.prevNode = this;
this.nextNode = _arg7;
};
this.priority = _arg8;
}
}
}//package com.greensock.core
Section 2
//SimpleTimeline (com.greensock.core.SimpleTimeline)
package com.greensock.core {
public class SimpleTimeline extends TweenCore {
public var autoRemoveChildren:Boolean;
protected var _lastChild:TweenCore;
protected var _firstChild:TweenCore;
public function SimpleTimeline(_arg1:Object=null){
super(0, _arg1);
}
override public function renderTime(_arg1:Number, _arg2:Boolean=false, _arg3:Boolean=false):void{
var _local5:Number;
var _local6:TweenCore;
var _local4:TweenCore = _firstChild;
this.cachedTotalTime = _arg1;
this.cachedTime = _arg1;
while (_local4) {
_local6 = _local4.nextNode;
if (((_local4.active) || ((((((_arg1 >= _local4.cachedStartTime)) && (!(_local4.cachedPaused)))) && (!(_local4.gc)))))){
if (!_local4.cachedReversed){
_local4.renderTime(((_arg1 - _local4.cachedStartTime) * _local4.cachedTimeScale), _arg2, false);
} else {
_local5 = (_local4.cacheIsDirty) ? _local4.totalDuration : _local4.cachedTotalDuration;
_local4.renderTime((_local5 - ((_arg1 - _local4.cachedStartTime) * _local4.cachedTimeScale)), _arg2, false);
};
};
_local4 = _local6;
};
}
public function addChild(_arg1:TweenCore):void{
if (((!(_arg1.cachedOrphan)) && (_arg1.timeline))){
_arg1.timeline.remove(_arg1, true);
};
_arg1.timeline = this;
if (_arg1.gc){
_arg1.setEnabled(true, true);
};
if (_firstChild){
_firstChild.prevNode = _arg1;
};
_arg1.nextNode = _firstChild;
_firstChild = _arg1;
_arg1.prevNode = null;
_arg1.cachedOrphan = false;
}
public function remove(_arg1:TweenCore, _arg2:Boolean=false):void{
if (_arg1.cachedOrphan){
return;
};
if (!_arg2){
_arg1.setEnabled(false, true);
};
if (_arg1.nextNode){
_arg1.nextNode.prevNode = _arg1.prevNode;
} else {
if (_lastChild == _arg1){
_lastChild = _arg1.prevNode;
};
};
if (_arg1.prevNode){
_arg1.prevNode.nextNode = _arg1.nextNode;
} else {
if (_firstChild == _arg1){
_firstChild = _arg1.nextNode;
};
};
_arg1.cachedOrphan = true;
}
public function get rawTime():Number{
return (this.cachedTotalTime);
}
}
}//package com.greensock.core
Section 3
//TweenCore (com.greensock.core.TweenCore)
package com.greensock.core {
import com.greensock.*;
public class TweenCore {
public var initted:Boolean;
protected var _hasUpdate:Boolean;
public var active:Boolean;
protected var _delay:Number;
public var cachedTime:Number;
public var cachedReversed:Boolean;
public var nextNode:TweenCore;
protected var _rawPrevTime:Number;// = -1
public var vars:Object;
public var cachedTotalTime:Number;
public var data;
public var timeline:SimpleTimeline;
public var cachedOrphan:Boolean;
public var cachedStartTime:Number;
public var prevNode:TweenCore;
public var cachedDuration:Number;
public var gc:Boolean;
protected var _pauseTime:Number;
public var cacheIsDirty:Boolean;
public var cachedPaused:Boolean;
public var cachedTimeScale:Number;
public var cachedTotalDuration:Number;
public static const version:Number = 1.382;
protected static var _classInitted:Boolean;
public function TweenCore(_arg1:Number=0, _arg2:Object=null){
this.vars = ((_arg2)!=null) ? _arg2 : {};
this.cachedDuration = (this.cachedTotalDuration = _arg1);
_delay = (this.vars.delay) ? Number(this.vars.delay) : 0;
this.cachedTimeScale = (this.vars.timeScale) ? Number(this.vars.timeScale) : 1;
this.active = Boolean((((((_arg1 == 0)) && ((_delay == 0)))) && (!((this.vars.immediateRender == false)))));
this.cachedTotalTime = (this.cachedTime = 0);
this.data = this.vars.data;
if (!_classInitted){
if (isNaN(TweenLite.rootFrame)){
TweenLite.initClass();
_classInitted = true;
} else {
return;
};
};
var _local3:SimpleTimeline = ((this.vars.timeline is SimpleTimeline)) ? this.vars.timeline : (this.vars.useFrames) ? TweenLite.rootFramesTimeline : TweenLite.rootTimeline;
this.cachedStartTime = (_local3.cachedTotalTime + _delay);
_local3.addChild(this);
if (this.vars.reversed){
this.cachedReversed = true;
};
if (this.vars.paused){
this.paused = true;
};
}
public function renderTime(_arg1:Number, _arg2:Boolean=false, _arg3:Boolean=false):void{
}
public function get delay():Number{
return (_delay);
}
public function restart(_arg1:Boolean=false, _arg2:Boolean=true):void{
this.reversed = false;
this.paused = false;
this.setTotalTime((_arg1) ? -(_delay) : 0, _arg2);
}
public function get duration():Number{
return (this.cachedDuration);
}
public function set reversed(_arg1:Boolean):void{
if (_arg1 != this.cachedReversed){
this.cachedReversed = _arg1;
setTotalTime(this.cachedTotalTime, true);
};
}
public function set startTime(_arg1:Number):void{
var _local2:Boolean = Boolean(((!((this.timeline == null))) && (((!((_arg1 == this.cachedStartTime))) || (this.gc)))));
this.cachedStartTime = _arg1;
if (_local2){
this.timeline.addChild(this);
};
}
public function set delay(_arg1:Number):void{
this.startTime = (this.startTime + (_arg1 - _delay));
_delay = _arg1;
}
public function resume():void{
this.paused = false;
}
public function get paused():Boolean{
return (this.cachedPaused);
}
public function play():void{
this.reversed = false;
this.paused = false;
}
public function set duration(_arg1:Number):void{
this.cachedDuration = (this.cachedTotalDuration = _arg1);
setDirtyCache(false);
}
public function invalidate():void{
}
public function complete(_arg1:Boolean=false, _arg2:Boolean=false):void{
if (!_arg1){
renderTime(this.totalDuration, _arg2, false);
return;
};
if (this.timeline.autoRemoveChildren){
this.setEnabled(false, false);
} else {
this.active = false;
};
if (!_arg2){
if (((((this.vars.onComplete) && ((this.cachedTotalTime == this.cachedTotalDuration)))) && (!(this.cachedReversed)))){
this.vars.onComplete.apply(null, this.vars.onCompleteParams);
} else {
if (((((this.cachedReversed) && ((this.cachedTotalTime == 0)))) && (this.vars.onReverseComplete))){
this.vars.onReverseComplete.apply(null, this.vars.onReverseCompleteParams);
};
};
};
}
public function get reversed():Boolean{
return (this.cachedReversed);
}
public function get totalTime():Number{
return (this.cachedTotalTime);
}
public function get startTime():Number{
return (this.cachedStartTime);
}
public function set currentTime(_arg1:Number):void{
setTotalTime(_arg1, false);
}
protected function setDirtyCache(_arg1:Boolean=true):void{
var _local2:TweenCore = (_arg1) ? this : this.timeline;
while (_local2) {
_local2.cacheIsDirty = true;
_local2 = _local2.timeline;
};
}
public function reverse(_arg1:Boolean=true):void{
this.reversed = true;
if (_arg1){
this.paused = false;
} else {
if (this.gc){
this.setEnabled(true, false);
};
};
}
public function set paused(_arg1:Boolean):void{
if (((!((_arg1 == this.cachedPaused))) && (this.timeline))){
if (_arg1){
_pauseTime = this.timeline.rawTime;
} else {
this.cachedStartTime = (this.cachedStartTime + (this.timeline.rawTime - _pauseTime));
_pauseTime = NaN;
setDirtyCache(false);
};
this.cachedPaused = _arg1;
this.active = Boolean(((((!(this.cachedPaused)) && ((this.cachedTotalTime > 0)))) && ((this.cachedTotalTime < this.cachedTotalDuration))));
};
if (((!(_arg1)) && (this.gc))){
this.setTotalTime(this.cachedTotalTime, false);
this.setEnabled(true, false);
};
}
public function kill():void{
setEnabled(false, false);
}
public function set totalTime(_arg1:Number):void{
setTotalTime(_arg1, false);
}
public function get currentTime():Number{
return (this.cachedTime);
}
protected function setTotalTime(_arg1:Number, _arg2:Boolean=false):void{
var _local3:Number;
var _local4:Number;
if (this.timeline){
_local3 = (((_pauseTime) || ((_pauseTime == 0)))) ? _pauseTime : this.timeline.cachedTotalTime;
if (this.cachedReversed){
_local4 = (this.cacheIsDirty) ? this.totalDuration : this.cachedTotalDuration;
this.cachedStartTime = (_local3 - ((_local4 - _arg1) / this.cachedTimeScale));
} else {
this.cachedStartTime = (_local3 - (_arg1 / this.cachedTimeScale));
};
if (!this.timeline.cacheIsDirty){
setDirtyCache(false);
};
if (this.cachedTotalTime != _arg1){
renderTime(_arg1, _arg2, false);
};
};
}
public function pause():void{
this.paused = true;
}
public function set totalDuration(_arg1:Number):void{
this.duration = _arg1;
}
public function get totalDuration():Number{
return (this.cachedTotalDuration);
}
public function setEnabled(_arg1:Boolean, _arg2:Boolean=false):Boolean{
this.gc = !(_arg1);
if (_arg1){
this.active = Boolean(((((!(this.cachedPaused)) && ((this.cachedTotalTime > 0)))) && ((this.cachedTotalTime < this.cachedTotalDuration))));
if (((!(_arg2)) && (this.cachedOrphan))){
this.timeline.addChild(this);
};
} else {
this.active = false;
if (((!(_arg2)) && (!(this.cachedOrphan)))){
this.timeline.remove(this, true);
};
};
return (false);
}
}
}//package com.greensock.core
Section 4
//Strong (com.greensock.easing.Strong)
package com.greensock.easing {
public class Strong {
public static const power:uint = 4;
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 1)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return (((((((_arg3 * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 * 0.5));
if (_arg1 < 1){
return ((((((((_arg3 * 0.5) * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 * 0.5) * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 2)) + _arg2));
}
}
}//package com.greensock.easing
Section 5
//TweenLite (com.greensock.TweenLite)
package com.greensock {
import flash.display.*;
import com.greensock.core.*;
import flash.events.*;
import flash.utils.*;
import com.greensock.plugins.*;
public class TweenLite extends TweenCore {
protected var _hasPlugins:Boolean;
public var propTweenLookup:Object;
public var cachedPT1:PropTween;
protected var _overwrite:uint;
protected var _ease:Function;
public var target:Object;
public var ratio:Number;// = 0
protected var _overwrittenProps:Object;
protected var _notifyPluginsOfEnabled:Boolean;
public static const version:Number = 11.36;
public static var rootTimeline:SimpleTimeline;
public static var fastEaseLookup:Dictionary = new Dictionary(false);
public static var onPluginEvent:Function;
public static var rootFramesTimeline:SimpleTimeline;
public static var defaultEase:Function = TweenLite.easeOut;
public static var plugins:Object = {};
public static var masterList:Dictionary = new Dictionary(false);
public static var overwriteManager:Object;
public static var rootFrame:Number;
public static var killDelayedCallsTo:Function = TweenLite.killTweensOf;
private static var _shape:Shape = new Shape();
protected static var _reservedProps:Object = {ease:1, delay:1, overwrite:1, onComplete:1, onCompleteParams:1, useFrames:1, runBackwards:1, startAt:1, onUpdate:1, onUpdateParams:1, roundProps:1, onStart:1, onStartParams:1, onInit:1, onInitParams:1, onReverseComplete:1, onReverseCompleteParams:1, onRepeat:1, onRepeatParams:1, proxiedEase:1, easeParams:1, yoyo:1, onCompleteListener:1, onUpdateListener:1, onStartListener:1, onReverseCompleteListener:1, onRepeatListener:1, orientToBezier:1, timeScale:1, immediateRender:1, repeat:1, repeatDelay:1, timeline:1, data:1, paused:1};
public function TweenLite(_arg1:Object, _arg2:Number, _arg3:Object){
var _local5:TweenLite;
super(_arg2, _arg3);
this.target = _arg1;
if ((((this.target is TweenCore)) && (this.vars.timeScale))){
this.cachedTimeScale = 1;
};
propTweenLookup = {};
_ease = defaultEase;
_overwrite = (((!((Number(_arg3.overwrite) > -1))) || (((!(overwriteManager.enabled)) && ((_arg3.overwrite > 1)))))) ? overwriteManager.mode : int(_arg3.overwrite);
var _local4:Array = masterList[_arg1];
if (!_local4){
masterList[_arg1] = [this];
} else {
if (_overwrite == 1){
for each (_local5 in _local4) {
if (!_local5.gc){
_local5.setEnabled(false, false);
};
};
masterList[_arg1] = [this];
} else {
_local4[_local4.length] = this;
};
};
if (((this.active) || (this.vars.immediateRender))){
renderTime(0, false, true);
};
}
protected function easeProxy(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (this.vars.proxiedEase.apply(null, arguments.concat(this.vars.easeParams)));
}
override public function renderTime(_arg1:Number, _arg2:Boolean=false, _arg3:Boolean=false):void{
var _local4:Boolean;
var _local5:Number = this.cachedTime;
if (_arg1 >= this.cachedDuration){
this.cachedTotalTime = (this.cachedTime = this.cachedDuration);
this.ratio = 1;
_local4 = true;
if (this.cachedDuration == 0){
if ((((((_arg1 == 0)) || ((_rawPrevTime < 0)))) && (!((_rawPrevTime == _arg1))))){
_arg3 = true;
};
_rawPrevTime = _arg1;
};
} else {
if (_arg1 <= 0){
this.cachedTotalTime = (this.cachedTime = (this.ratio = 0));
if (_arg1 < 0){
this.active = false;
if (this.cachedDuration == 0){
if (_rawPrevTime > 0){
_arg3 = true;
_local4 = true;
};
_rawPrevTime = _arg1;
};
};
if (((this.cachedReversed) && (!((_local5 == 0))))){
_local4 = true;
};
} else {
this.cachedTotalTime = (this.cachedTime = _arg1);
this.ratio = _ease(_arg1, 0, 1, this.cachedDuration);
};
};
if ((((this.cachedTime == _local5)) && (!(_arg3)))){
return;
};
if (!this.initted){
init();
if (((!(_local4)) && (this.cachedTime))){
this.ratio = _ease(this.cachedTime, 0, 1, this.cachedDuration);
};
};
if (((!(this.active)) && (!(this.cachedPaused)))){
this.active = true;
};
if ((((((((_local5 == 0)) && (this.vars.onStart))) && (!((this.cachedTime == 0))))) && (!(_arg2)))){
this.vars.onStart.apply(null, this.vars.onStartParams);
};
var _local6:PropTween = this.cachedPT1;
while (_local6) {
_local6.target[_local6.property] = (_local6.start + (this.ratio * _local6.change));
_local6 = _local6.nextNode;
};
if (((_hasUpdate) && (!(_arg2)))){
this.vars.onUpdate.apply(null, this.vars.onUpdateParams);
};
if (_local4){
if (((_hasPlugins) && (this.cachedPT1))){
onPluginEvent("onComplete", this);
};
complete(true, _arg2);
};
}
override public function setEnabled(_arg1:Boolean, _arg2:Boolean=false):Boolean{
var _local3:Array;
if (_arg1){
_local3 = TweenLite.masterList[this.target];
if (!_local3){
TweenLite.masterList[this.target] = [this];
} else {
_local3[_local3.length] = this;
};
};
super.setEnabled(_arg1, _arg2);
if (((_notifyPluginsOfEnabled) && (this.cachedPT1))){
return (onPluginEvent((_arg1) ? "onEnable" : "onDisable", this));
};
return (false);
}
protected function init():void{
var _local1:String;
var _local2:int;
var _local3:*;
var _local4:Boolean;
var _local5:Array;
var _local6:PropTween;
if (this.vars.onInit){
this.vars.onInit.apply(null, this.vars.onInitParams);
};
if (typeof(this.vars.ease) == "function"){
_ease = this.vars.ease;
};
if (this.vars.easeParams){
this.vars.proxiedEase = _ease;
_ease = easeProxy;
};
this.cachedPT1 = null;
this.propTweenLookup = {};
for (_local1 in this.vars) {
if ((((_local1 in _reservedProps)) && (!((((_local1 == "timeScale")) && ((this.target is TweenCore))))))){
} else {
if ((((_local1 in plugins)) && (new ((plugins[_local1] as Class)).onInitTween(this.target, this.vars[_local1], this)))){
this.cachedPT1 = new PropTween(_local3, "changeFactor", 0, 1, ((_local3.overwriteProps.length)==1) ? _local3.overwriteProps[0] : "_MULTIPLE_", true, this.cachedPT1);
if (this.cachedPT1.name == "_MULTIPLE_"){
_local2 = _local3.overwriteProps.length;
while (--_local2 > -1) {
this.propTweenLookup[_local3.overwriteProps[_local2]] = this.cachedPT1;
};
} else {
this.propTweenLookup[this.cachedPT1.name] = this.cachedPT1;
};
if (_local3.priority){
this.cachedPT1.priority = _local3.priority;
_local4 = true;
};
if (((_local3.onDisable) || (_local3.onEnable))){
_notifyPluginsOfEnabled = true;
};
_hasPlugins = true;
} else {
this.cachedPT1 = new PropTween(this.target, _local1, Number(this.target[_local1]), ((typeof(this.vars[_local1]))=="number") ? (Number(this.vars[_local1]) - this.target[_local1]) : Number(this.vars[_local1]), _local1, false, this.cachedPT1);
this.propTweenLookup[_local1] = this.cachedPT1;
};
};
};
if (_local4){
onPluginEvent("onInit", this);
};
if (this.vars.runBackwards){
_local6 = this.cachedPT1;
while (_local6) {
_local6.start = (_local6.start + _local6.change);
_local6.change = -(_local6.change);
_local6 = _local6.nextNode;
};
};
_hasUpdate = Boolean(!((this.vars.onUpdate == null)));
if (_overwrittenProps){
killVars(_overwrittenProps);
if (this.cachedPT1 == null){
this.setEnabled(false, false);
};
};
if ((((((((_overwrite > 1)) && (this.cachedPT1))) && (masterList[this.target]))) && ((_local5.length > 1)))){
if (overwriteManager.manageOverwrites(this, this.propTweenLookup, _local5, _overwrite)){
init();
};
};
this.initted = true;
}
public function killVars(_arg1:Object, _arg2:Boolean=true):Boolean{
var _local3:String;
var _local4:PropTween;
var _local5:Boolean;
if (_overwrittenProps == null){
_overwrittenProps = {};
};
for (_local3 in _arg1) {
if ((_local3 in propTweenLookup)){
_local4 = propTweenLookup[_local3];
if (((_local4.isPlugin) && ((_local4.name == "_MULTIPLE_")))){
_local4.target.killProps(_arg1);
if (_local4.target.overwriteProps.length == 0){
_local4.name = "";
};
};
if (_local4.name != "_MULTIPLE_"){
if (_local4.nextNode){
_local4.nextNode.prevNode = _local4.prevNode;
};
if (_local4.prevNode){
_local4.prevNode.nextNode = _local4.nextNode;
} else {
if (this.cachedPT1 == _local4){
this.cachedPT1 = _local4.nextNode;
};
};
if (((_local4.isPlugin) && (_local4.target.onDisable))){
_local4.target.onDisable();
if (_local4.target.activeDisable){
_local5 = true;
};
};
delete propTweenLookup[_local3];
};
};
if (((_arg2) && (!((_arg1 == _overwrittenProps))))){
_overwrittenProps[_local3] = 1;
};
};
return (_local5);
}
override public function invalidate():void{
if (((_notifyPluginsOfEnabled) && (this.cachedPT1))){
onPluginEvent("onDisable", this);
};
this.cachedPT1 = null;
_overwrittenProps = null;
_hasUpdate = (this.initted = (this.active = (_notifyPluginsOfEnabled = false)));
this.propTweenLookup = {};
}
public static function initClass():void{
rootFrame = 0;
rootTimeline = new SimpleTimeline(null);
rootFramesTimeline = new SimpleTimeline(null);
rootTimeline.cachedStartTime = (getTimer() * 0.001);
rootFramesTimeline.cachedStartTime = rootFrame;
rootTimeline.autoRemoveChildren = true;
rootFramesTimeline.autoRemoveChildren = true;
_shape.addEventListener(Event.ENTER_FRAME, updateAll, false, 0, true);
if (overwriteManager == null){
overwriteManager = {mode:1, enabled:false};
};
}
public static function killTweensOf(_arg1:Object, _arg2:Boolean=false, _arg3:Object=null):void{
var _local4:Array;
var _local5:int;
var _local6:TweenLite;
if ((_arg1 in masterList)){
_local4 = masterList[_arg1];
_local5 = _local4.length;
while (--_local5 > -1) {
_local6 = _local4[_local5];
if (!_local6.gc){
if (_arg2){
_local6.complete(false, false);
};
if (_arg3 != null){
_local6.killVars(_arg3);
};
if ((((_arg3 == null)) || ((((_local6.cachedPT1 == null)) && (_local6.initted))))){
_local6.setEnabled(false, false);
};
};
};
if (_arg3 == null){
delete masterList[_arg1];
};
};
}
public static function from(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{
_arg3.runBackwards = true;
if (!("immediateRender" in _arg3)){
_arg3.immediateRender = true;
};
return (new TweenLite(_arg1, _arg2, _arg3));
}
protected static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (1 - (_arg1 / _arg4));
return ((1 - (_arg1 * _arg1)));
}
public static function delayedCall(_arg1:Number, _arg2:Function, _arg3:Array=null, _arg4:Boolean=false):TweenLite{
return (new TweenLite(_arg2, 0, {delay:_arg1, onComplete:_arg2, onCompleteParams:_arg3, immediateRender:false, useFrames:_arg4, overwrite:0}));
}
protected static function updateAll(_arg1:Event=null):void{
var _local2:Dictionary;
var _local3:Object;
var _local4:Array;
var _local5:int;
rootTimeline.renderTime((((getTimer() * 0.001) - rootTimeline.cachedStartTime) * rootTimeline.cachedTimeScale), false, false);
rootFrame++;
rootFramesTimeline.renderTime(((rootFrame - rootFramesTimeline.cachedStartTime) * rootFramesTimeline.cachedTimeScale), false, false);
if (!(rootFrame % 60)){
_local2 = masterList;
for (_local3 in _local2) {
_local4 = _local2[_local3];
_local5 = _local4.length;
while (--_local5 > -1) {
if (TweenLite(_local4[_local5]).gc){
_local4.splice(_local5, 1);
};
};
if (_local4.length == 0){
delete _local2[_local3];
};
};
};
}
public static function to(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{
return (new TweenLite(_arg1, _arg2, _arg3));
}
}
}//package com.greensock
Section 6
//Regular (fl.transitions.easing.Regular)
package fl.transitions.easing {
public class Regular {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((-(_arg3) * _arg1) * (_arg1 - 2)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((_arg3 * _arg1) * _arg1) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return (((((_arg3 / 2) * _arg1) * _arg1) + _arg2));
};
--_arg1;
return ((((-(_arg3) / 2) * ((_arg1 * (_arg1 - 2)) - 1)) + _arg2));
}
}
}//package fl.transitions.easing
Section 7
//Tween (fl.transitions.Tween)
package fl.transitions {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public class Tween extends EventDispatcher {
private var _position:Number;// = NAN
public var prevTime:Number;// = NAN
public var prevPos:Number;// = NAN
public var isPlaying:Boolean;// = false
private var _fps:Number;// = NAN
private var _time:Number;// = NAN
public var begin:Number;// = NAN
private var _finish:Number;// = NAN
public var change:Number;// = NAN
public var looping:Boolean;// = false
private var _intervalID:uint;// = 0
public var func:Function;
private var _timer:Timer;// = null
private var _startTime:Number;// = NAN
public var prop:String;// = ""
private var _duration:Number;// = NAN
public var obj:Object;// = null
public var useSeconds:Boolean;// = false
protected static var _mc:MovieClip = new MovieClip();
public function Tween(_arg1:Object, _arg2:String, _arg3:Function, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Boolean=false){
this.func = function (_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
};
super();
if (!arguments.length){
return;
};
this.obj = _arg1;
this.prop = _arg2;
this.begin = _arg4;
this.position = _arg4;
this.duration = _arg6;
this.useSeconds = _arg7;
if ((_arg3 is Function)){
this.func = _arg3;
};
this.finish = _arg5;
this._timer = new Timer(100);
this.start();
}
public function continueTo(_arg1:Number, _arg2:Number):void{
this.begin = this.position;
this.finish = _arg1;
if (!isNaN(_arg2)){
this.duration = _arg2;
};
this.start();
}
protected function startEnterFrame():void{
var _local1:Number;
if (isNaN(this._fps)){
_mc.addEventListener(Event.ENTER_FRAME, this.onEnterFrame, false, 0, true);
} else {
_local1 = (1000 / this._fps);
this._timer.delay = _local1;
this._timer.addEventListener(TimerEvent.TIMER, this.timerHandler, false, 0, true);
this._timer.start();
};
this.isPlaying = true;
}
public function stop():void{
this.stopEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_STOP, this._time, this._position));
}
private function fixTime():void{
if (this.useSeconds){
this._startTime = (getTimer() - (this._time * 1000));
};
}
public function set FPS(_arg1:Number):void{
var _local2:Boolean = this.isPlaying;
this.stopEnterFrame();
this._fps = _arg1;
if (_local2){
this.startEnterFrame();
};
}
public function get finish():Number{
return ((this.begin + this.change));
}
public function get duration():Number{
return (this._duration);
}
protected function stopEnterFrame():void{
if (isNaN(this._fps)){
_mc.removeEventListener(Event.ENTER_FRAME, this.onEnterFrame);
} else {
this._timer.stop();
};
this.isPlaying = false;
}
public function set time(_arg1:Number):void{
this.prevTime = this._time;
if (_arg1 > this.duration){
if (this.looping){
this.rewind((_arg1 - this._duration));
this.update();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_LOOP, this._time, this._position));
} else {
if (this.useSeconds){
this._time = this._duration;
this.update();
};
this.stop();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_FINISH, this._time, this._position));
};
} else {
if (_arg1 < 0){
this.rewind();
this.update();
} else {
this._time = _arg1;
this.update();
};
};
}
public function getPosition(_arg1:Number=NaN):Number{
if (isNaN(_arg1)){
_arg1 = this._time;
};
return (this.func(_arg1, this.begin, this.change, this._duration));
}
public function set finish(_arg1:Number):void{
this.change = (_arg1 - this.begin);
}
public function set duration(_arg1:Number):void{
this._duration = ((_arg1)<=0) ? Infinity : _arg1;
}
public function get position():Number{
return (this.getPosition(this._time));
}
public function setPosition(_arg1:Number):void{
this.prevPos = this._position;
if (this.prop.length){
this.obj[this.prop] = (this._position = _arg1);
};
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_CHANGE, this._time, this._position));
}
public function resume():void{
this.fixTime();
this.startEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_RESUME, this._time, this._position));
}
public function fforward():void{
this.time = this._duration;
this.fixTime();
}
protected function onEnterFrame(_arg1:Event):void{
this.nextFrame();
}
public function yoyo():void{
this.continueTo(this.begin, this.time);
}
public function nextFrame():void{
if (this.useSeconds){
this.time = ((getTimer() - this._startTime) / 1000);
} else {
this.time = (this._time + 1);
};
}
protected function timerHandler(_arg1:TimerEvent):void{
this.nextFrame();
_arg1.updateAfterEvent();
}
public function get FPS():Number{
return (this._fps);
}
public function rewind(_arg1:Number=0):void{
this._time = _arg1;
this.fixTime();
this.update();
}
public function set position(_arg1:Number):void{
this.setPosition(_arg1);
}
public function get time():Number{
return (this._time);
}
private function update():void{
this.setPosition(this.getPosition(this._time));
}
public function start():void{
this.rewind();
this.startEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_START, this._time, this._position));
}
public function prevFrame():void{
if (!this.useSeconds){
this.time = (this._time - 1);
};
}
}
}//package fl.transitions
Section 8
//TweenEvent (fl.transitions.TweenEvent)
package fl.transitions {
import flash.events.*;
public class TweenEvent extends Event {
public var position:Number;// = NAN
public var time:Number;// = NAN
public static const MOTION_START:String = "motionStart";
public static const MOTION_STOP:String = "motionStop";
public static const MOTION_LOOP:String = "motionLoop";
public static const MOTION_CHANGE:String = "motionChange";
public static const MOTION_FINISH:String = "motionFinish";
public static const MOTION_RESUME:String = "motionResume";
public function TweenEvent(_arg1:String, _arg2:Number, _arg3:Number, _arg4:Boolean=false, _arg5:Boolean=false){
super(_arg1, _arg4, _arg5);
this.time = _arg2;
this.position = _arg3;
}
override public function clone():Event{
return (new TweenEvent(this.type, this.time, this.position, this.bubbles, this.cancelable));
}
}
}//package fl.transitions
Section 9
//MainTimeline (jungled_fla.MainTimeline)
package jungled_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import fl.transitions.*;
import fl.transitions.easing.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.net.*;
import flash.filters.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class MainTimeline extends MovieClip {
public const fontFace:String = "Matura MT Script Capitals";
public const fontColor:Number = 12781576;
public const fontBold:Boolean = true;
public const fontSize:int = 28;
public var btNewGame:pergamino;
public var escala:Number;
public var nivel:int;
public var textbtContinue:TextField;
public var musicOff:Boolean;
public var newAlphaTweeninicio:Tween;
public var btInstructions:pergamino;
public var sfxSoundChannel:SoundChannel;
public var btContinue:pergamino;
public var pastura:pasto;
public var alphaTweeninstruc:Tween;
public var myGlowFilter;
public var alphaTweeninicio:Tween;
public var inicio:MovieClip;
public var clickSound:click;
public var shared:SharedObject;
public var newAlphaTweeninstruc:Tween;
public var textbtNewGame:TextField;
public var instruc:MovieClip;
public var particleA:Particle;
public var particleB:Particle;
public var piezasGuardadas:Array;
public var textbtInstructions:TextField;
public var textJugar:TextField;
public var tFormat:TextFormat;
public var backgroundMusic:BackgroundMusic;
public var optionSound:option;
public var ayudaAnim_1:ayuda_1;
public var particles:Array;
public var ayudaAnim:ayuda;
public var btJugar:botonJugar;
public var inicioSelect:String;
public var gameScore:int;
public var btSonido:sonido;
public var btMusica:musica;
public var btContinueOn:Boolean;
public var soundOff:Boolean;
public var bgmSoundChannel:SoundChannel;
public var myShadow:DropShadowFilter;
public var lang:Boolean;
public function MainTimeline(){
addFrameScript(0, frame1, 1, frame2);
}
public function clickJugar(_arg1:MouseEvent):void{
bgmSoundChannel.stop();
if (!soundOff){
sfxSoundChannel = clickSound.play();
};
fadeOutayudaAnim();
}
public function mouseOutNewGame(_arg1:MouseEvent):void{
textbtNewGame.filters = undefined;
}
public function randRange(_arg1:Number, _arg2:Number){
return (((Math.random() * (_arg2 - _arg1)) + _arg1));
}
public function mouseOverJugar(_arg1:MouseEvent):void{
if (!soundOff){
sfxSoundChannel = optionSound.play();
};
textJugar.filters = [myGlowFilter];
}
public function clickNewGame(_arg1:MouseEvent):void{
bgmSoundChannel.stop();
if (!soundOff){
sfxSoundChannel = clickSound.play();
};
inicioSelect = "newgame";
fadeOut();
removeEventListener(Event.ENTER_FRAME, frameLoop);
while (particles.length > 1) {
particleA = particles.shift();
particleA.destroy();
particleB = particles.shift();
particleB.destroy();
};
}
public function mouseOutContinue(_arg1:MouseEvent):void{
textbtContinue.filters = undefined;
}
public function instrucFin(_arg1:TweenEvent){
gotoAndStop(3);
}
public function fadeOut():void{
newAlphaTweeninicio = new Tween(inicio, "alpha", Regular.easeOut, inicio.alpha, 0, 1, true);
newAlphaTweeninicio.addEventListener(TweenEvent.MOTION_FINISH, inicioFin);
}
public function onBackgroundMusicFinished(_arg1:Event):void{
bgmSoundChannel = backgroundMusic.play();
bgmSoundChannel.addEventListener(Event.SOUND_COMPLETE, onBackgroundMusicFinished);
}
public function clickInstructions(_arg1:MouseEvent):void{
if (!soundOff){
sfxSoundChannel = clickSound.play();
};
inicioSelect = "instructions";
fadeOut();
removeEventListener(Event.ENTER_FRAME, frameLoop);
while (particles.length > 1) {
particleA = particles.shift();
particleA.destroy();
particleB = particles.shift();
particleB.destroy();
};
}
public function clickContinue(_arg1:MouseEvent):void{
bgmSoundChannel.stop();
if (!soundOff){
sfxSoundChannel = clickSound.play();
};
gameScore = shared.data.gameScore;
nivel = shared.data.nivel;
piezasGuardadas = shared.data.piezasGuardadas;
escala = shared.data.escala;
inicioSelect = "continue";
fadeOut();
removeEventListener(Event.ENTER_FRAME, frameLoop);
while (particles.length > 1) {
particleA = particles.shift();
particleA.destroy();
particleB = particles.shift();
particleB.destroy();
};
}
public function mouseOverMusica(_arg1:MouseEvent):void{
btMusica.filters = [myGlowFilter];
}
public function mouseOverNewGame(_arg1:MouseEvent):void{
if (!soundOff){
sfxSoundChannel = optionSound.play();
};
textbtNewGame.filters = [myGlowFilter];
}
public function mouseOverSonido(_arg1:MouseEvent):void{
btSonido.filters = [myGlowFilter];
}
public function mouseOverInstructions(_arg1:MouseEvent):void{
if (!soundOff){
sfxSoundChannel = optionSound.play();
};
textbtInstructions.filters = [myGlowFilter];
}
function frame1(){
stop();
if (Capabilities.language == "es"){
lang = true;
} else {
lang = false;
};
particles = new Array();
myShadow = new DropShadowFilter(5, 100, 0, 0.5, 8, 8);
myGlowFilter = new GlowFilter(0xFFFFFF, 0.8, 15, 15, 3, 1, false, false);
if (!musicOff){
};
if (!soundOff){
};
gameScore = 0;
piezasGuardadas = new Array();
inicio.alpha = 0;
optionSound = new option();
clickSound = new click();
backgroundMusic = new BackgroundMusic();
if (!musicOff){
bgmSoundChannel = backgroundMusic.play();
};
bgmSoundChannel.addEventListener(Event.SOUND_COMPLETE, onBackgroundMusicFinished);
shared = SharedObject.getLocal("jungledrop");
if (shared.data.gameScore != undefined){
btContinueOn = true;
} else {
btContinueOn = false;
};
btMusica = new musica();
btMusica.x = 10;
btMusica.y = 310;
btMusica.buttonMode = true;
if (!musicOff){
btMusica.gotoAndStop(1);
} else {
btMusica.gotoAndStop(2);
};
btMusica.addEventListener(MouseEvent.CLICK, clickMusica);
btMusica.addEventListener(MouseEvent.MOUSE_OVER, mouseOverMusica);
btMusica.addEventListener(MouseEvent.MOUSE_OUT, mouseOutMusica);
inicio.addChild(btMusica);
btSonido = new sonido();
btSonido.x = 10;
btSonido.y = 355;
btSonido.buttonMode = true;
if (!soundOff){
btSonido.gotoAndStop(1);
} else {
btSonido.gotoAndStop(2);
};
btSonido.addEventListener(MouseEvent.CLICK, clickSonido);
btSonido.addEventListener(MouseEvent.MOUSE_OVER, mouseOverSonido);
btSonido.addEventListener(MouseEvent.MOUSE_OUT, mouseOutSonido);
inicio.addChild(btSonido);
tFormat = new TextFormat();
tFormat.font = fontFace;
tFormat.size = fontSize;
tFormat.bold = fontBold;
tFormat.color = fontColor;
tFormat.align = "center";
if (btContinueOn){
btContinue = new pergamino();
btContinue.x = 150;
btContinue.y = 180;
btContinue.buttonMode = true;
btContinue.mouseChildren = false;
btContinue.filters = [myShadow];
btContinue.addEventListener(MouseEvent.CLICK, clickContinue);
btContinue.addEventListener(MouseEvent.MOUSE_OVER, mouseOverContinue);
btContinue.addEventListener(MouseEvent.MOUSE_OUT, mouseOutContinue);
inicio.addChild(btContinue);
textbtContinue = new TextField();
textbtContinue.defaultTextFormat = tFormat;
textbtContinue.y = 10;
textbtContinue.width = 250;
textbtContinue.height = 40;
if (lang){
textbtContinue.text = "Continuar…";
} else {
textbtContinue.text = "Continue…";
};
textbtContinue.selectable = false;
btContinue.addChild(textbtContinue);
};
btNewGame = new pergamino();
btNewGame.x = 150;
if (btContinueOn){
btNewGame.y = 245;
} else {
btNewGame.y = 210;
};
btNewGame.buttonMode = true;
btNewGame.mouseChildren = false;
btNewGame.filters = [myShadow];
btNewGame.addEventListener(MouseEvent.CLICK, clickNewGame);
btNewGame.addEventListener(MouseEvent.MOUSE_OVER, mouseOverNewGame);
btNewGame.addEventListener(MouseEvent.MOUSE_OUT, mouseOutNewGame);
inicio.addChild(btNewGame);
textbtNewGame = new TextField();
textbtNewGame.defaultTextFormat = tFormat;
textbtNewGame.y = 10;
textbtNewGame.width = 250;
textbtNewGame.height = 40;
if (lang){
textbtNewGame.text = "Nuevo Juego";
} else {
textbtNewGame.text = "New Game";
};
textbtNewGame.selectable = false;
btNewGame.addChild(textbtNewGame);
btInstructions = new pergamino();
btInstructions.x = 150;
if (btContinueOn){
btInstructions.y = 310;
} else {
btInstructions.y = 275;
};
btInstructions.buttonMode = true;
btInstructions.mouseChildren = false;
btInstructions.filters = [myShadow];
btInstructions.addEventListener(MouseEvent.CLICK, clickInstructions);
btInstructions.addEventListener(MouseEvent.MOUSE_OVER, mouseOverInstructions);
btInstructions.addEventListener(MouseEvent.MOUSE_OUT, mouseOutInstructions);
inicio.addChild(btInstructions);
textbtInstructions = new TextField();
textbtInstructions.defaultTextFormat = tFormat;
textbtInstructions.y = 10;
textbtInstructions.width = 250;
textbtInstructions.height = 40;
if (lang){
textbtInstructions.text = "Instrucciones";
} else {
textbtInstructions.text = "Instructions";
};
textbtInstructions.selectable = false;
btInstructions.addChild(textbtInstructions);
alphaTweeninicio = new Tween(inicio, "alpha", Regular.easeOut, inicio.alpha, 1, 1, true);
addEventListener(Event.ENTER_FRAME, frameLoop);
}
public function inicioFin(_arg1:TweenEvent){
newAlphaTweeninicio.removeEventListener(TweenEvent.MOTION_FINISH, inicioFin);
removeChild(inicio);
switch (inicioSelect){
case "continue":
gotoAndStop(3);
break;
case "newgame":
gotoAndStop(3);
break;
case "instructions":
gotoAndStop(2);
break;
};
}
function frame2(){
if (!musicOff){
bgmSoundChannel.stop();
bgmSoundChannel = backgroundMusic.play();
bgmSoundChannel.addEventListener(Event.SOUND_COMPLETE, onBackgroundMusicFinished);
};
instruc.alpha = 0;
pastura = new pasto();
pastura.x = 0;
pastura.y = 360;
instruc.addChild(pastura);
if (lang){
ayudaAnim = new ayuda();
ayudaAnim.x = 160;
ayudaAnim.y = 200;
instruc.addChild(ayudaAnim);
} else {
ayudaAnim_1 = new ayuda_1();
ayudaAnim_1.x = 160;
ayudaAnim_1.y = 200;
instruc.addChild(ayudaAnim_1);
};
instruc.addChild(btMusica);
instruc.addChild(btSonido);
btJugar = new botonJugar();
btJugar.x = 420;
btJugar.y = 330;
btJugar.buttonMode = true;
btJugar.mouseChildren = false;
btJugar.filters = [myShadow];
btJugar.addEventListener(MouseEvent.CLICK, clickJugar);
btJugar.addEventListener(MouseEvent.MOUSE_OVER, mouseOverJugar);
btJugar.addEventListener(MouseEvent.MOUSE_OUT, mouseOutJugar);
instruc.addChild(btJugar);
textJugar = new TextField();
textJugar.defaultTextFormat = tFormat;
textJugar.y = 10;
textJugar.width = 120;
textJugar.height = 40;
if (lang){
textJugar.text = "Jugar";
} else {
textJugar.text = "Play";
};
textJugar.selectable = false;
btJugar.addChild(textJugar);
alphaTweeninstruc = new Tween(instruc, "alpha", Regular.easeOut, instruc.alpha, 1, 1, true);
}
public function clickSonido(_arg1:MouseEvent):void{
if (soundOff){
btSonido.gotoAndStop(1);
soundOff = false;
} else {
btSonido.gotoAndStop(2);
soundOff = true;
};
}
public function clickMusica(_arg1:MouseEvent):void{
if (musicOff){
btMusica.gotoAndStop(1);
musicOff = false;
bgmSoundChannel = backgroundMusic.play();
} else {
btMusica.gotoAndStop(2);
musicOff = true;
bgmSoundChannel.stop();
};
}
public function mouseOutMusica(_arg1:MouseEvent):void{
btMusica.filters = undefined;
}
public function mouseOutSonido(_arg1:MouseEvent):void{
btSonido.filters = undefined;
}
public function mouseOutInstructions(_arg1:MouseEvent):void{
textbtInstructions.filters = undefined;
}
public function frameLoop(_arg1:Event){
var _local2:int;
while (_local2 < particles.length) {
particles[_local2].update();
_local2++;
};
particleA = new Particle(Spark, this, 70, 70);
particleA.xVel = randRange(-1, 1);
particleA.yVel = 0;
particleA.drag = 0.97;
particleA.gravity = -0.2;
particleA.clip.scaleX = (particleA.clip.scaleY = randRange(0.5, 0.8));
particleA.shrink = 1.02;
particleA.fade = 0.01;
particleA.clip.alpha = 0.6;
particles.push(particleA);
particleB = new Particle(Spark, this, 475, 75);
particleB.xVel = randRange(-1, 1);
particleB.yVel = 0;
particleB.drag = 0.97;
particleB.gravity = -0.2;
particleB.clip.scaleX = (particleB.clip.scaleY = randRange(0.5, 0.8));
particleB.shrink = 1.02;
particleB.fade = 0.01;
particleB.clip.alpha = 0.6;
particles.push(particleB);
while (particles.length > 80) {
particleA = particles.shift();
particleA.destroy();
particleB = particles.shift();
particleB.destroy();
};
}
public function fadeOutayudaAnim():void{
newAlphaTweeninstruc = new Tween(instruc, "alpha", Regular.easeOut, instruc.alpha, 0, 1, true);
newAlphaTweeninstruc.addEventListener(TweenEvent.MOTION_FINISH, instrucFin);
}
public function mouseOutJugar(_arg1:MouseEvent):void{
textJugar.filters = undefined;
}
public function mouseOverContinue(_arg1:MouseEvent):void{
if (!soundOff){
sfxSoundChannel = optionSound.play();
};
textbtContinue.filters = [myGlowFilter];
}
}
}//package jungled_fla
Section 10
//advertencia (advertencia)
package {
import flash.display.*;
public dynamic class advertencia extends MovieClip {
}
}//package
Section 11
//advertencia_1 (advertencia_1)
package {
import flash.display.*;
public dynamic class advertencia_1 extends MovieClip {
}
}//package
Section 12
//ayuda (ayuda)
package {
import flash.display.*;
public dynamic class ayuda extends MovieClip {
}
}//package
Section 13
//ayuda_1 (ayuda_1)
package {
import flash.display.*;
public dynamic class ayuda_1 extends MovieClip {
}
}//package
Section 14
//BackgroundMusic (BackgroundMusic)
package {
import flash.media.*;
public dynamic class BackgroundMusic extends Sound {
}
}//package
Section 15
//BackgroundMusic_1 (BackgroundMusic_1)
package {
import flash.media.*;
public dynamic class BackgroundMusic_1 extends Sound {
}
}//package
Section 16
//bamboo (bamboo)
package {
import flash.display.*;
public dynamic class bamboo extends MovieClip {
}
}//package
Section 17
//bien (bien)
package {
import flash.media.*;
public dynamic class bien extends Sound {
}
}//package
Section 18
//botonJugar (botonJugar)
package {
import flash.display.*;
public dynamic class botonJugar extends MovieClip {
}
}//package
Section 19
//botonMenu (botonMenu)
package {
import flash.display.*;
public dynamic class botonMenu extends MovieClip {
}
}//package
Section 20
//click (click)
package {
import flash.media.*;
public dynamic class click extends Sound {
}
}//package
Section 21
//drop (drop)
package {
import flash.media.*;
public dynamic class drop extends Sound {
}
}//package
Section 22
//EmbeddedMatura (EmbeddedMatura)
package {
import flash.text.*;
public dynamic class EmbeddedMatura extends Font {
}
}//package
Section 23
//explosion (explosion)
package {
import flash.media.*;
public dynamic class explosion extends Sound {
}
}//package
Section 24
//fondo_1 (fondo_1)
package {
import flash.display.*;
public dynamic class fondo_1 extends MovieClip {
}
}//package
Section 25
//fondo_2 (fondo_2)
package {
import flash.display.*;
public dynamic class fondo_2 extends MovieClip {
}
}//package
Section 26
//fondo_3 (fondo_3)
package {
import flash.display.*;
public dynamic class fondo_3 extends MovieClip {
}
}//package
Section 27
//fondo_4 (fondo_4)
package {
import flash.display.*;
public dynamic class fondo_4 extends MovieClip {
}
}//package
Section 28
//hit (hit)
package {
import flash.media.*;
public dynamic class hit extends Sound {
}
}//package
Section 29
//jungleDrop (jungleDrop)
package {
import flash.display.*;
import flash.events.*;
import com.greensock.*;
import flash.geom.*;
import fl.transitions.*;
import fl.transitions.easing.*;
import com.greensock.easing.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.net.*;
import flash.filters.*;
public class jungleDrop extends MovieClip {
private var tempPieceRow:uint;
private var escala:Number;
private var piezasTotal:int;
private var fontFace_1:String;
private var textadverSiFin:TextField;
private var opcionNoFin:opciones;
private var isFalling;
private var tikiMask_1:tikiMask;
private var piecesToFind_X:Array;
private var textSalvar:TextField;
private var isMoving:Boolean;
public var sfxSoundChannel:SoundChannel;
private var nivel:int;
private var firstPiece:Piece;
private var startColor:ColorTransform;
private var isDropping;
private var textMenu:TextField;
private var newFrameRate:int;// = 0
private var myGlowFilter;
private var superPiece:int;// = 5
private var photoMask:MovieClip;
private var levelText_1:String;
private var btSalir:pergamino;
private var textLevel:TextField;
private var adver_1:advertencia_1;
private var textSalir:TextField;
private var shared:SharedObject;
public var clickSound:click;
private var localSoundOff:Boolean;
private var tf:TextField;
private var bambooMenu:bamboo;
private var ticks:uint;// = 60
private var piecesToFind:Array;
private var tween:Tween;
private var tFormat_1:TextFormat;
private var tFormat_2:TextFormat;
private var tFormat_3:TextFormat;
private var timeDiff:int;
private var lastTime:int;
private var arrowUp:Sprite;
private var madeMove:Boolean;
private var opcionNo:opciones;
private var multiFindFunction:int;
private var piecesToMove:Array;
private var multiFind:int;
private var last:uint;
private var tiempo:int;// = 0
private var adver:advertencia;
private var opcionOk:opciones;
private var nivelFin:Boolean;
var particles:Array;
private var lineDown:Boolean;
private var textadverNoFin:TextField;
private var contadorPiezas:int;// = 0
private var textReiniciar:TextField;
private var textadverNo:TextField;
private var piecesToDelFin:Array;
private var isSwapping;
private var piecesToFindFin:Array;
private var btSonido:sonido;
private var levelText:String;
private var auxColorType:int;
private var velocity:Number;// = 6
private var counterShine:int;
private var textadverOk:TextField;
public var fps:Number;// = 60
private var reiniciando:Boolean;
private var pauseCharacter_X:Boolean;
public var explosionSound:explosion;
private var auxColor:Boolean;
private var numLines:int;
private var opcionSi:opciones;
private var tick_aux:Number;// = 0
private var gamePause:Boolean;
private var finalJue:Boolean;
private var character:Piece;
private var levelPassVar:Boolean;
private var alphaTweenJuego:Tween;
private var btReiniciar:pergamino;
public var hitSound:hit;
private var grid:Array;
private var endColor:ColorTransform;
private var textadverSi:TextField;
private var piecesToDel:Array;
private var opcionSiFin:opciones;
private var gameSprite:Sprite;
private var adverFin:advertencia;
private var menu:Boolean;
public var dropSound:drop;
private var textScore:TextField;
private var reiniciar:Boolean;
private var btSalvar:pergamino;
private var textContinuar:TextField;
private var scrollVel:Number;
private var localMusicOff:Boolean;
public var backgroundMusic:BackgroundMusic_1;
public var optionSound:option;
private var tempPieceCol:uint;
var maxParticles:int;// = 200
public var bienSound:bien;
private var gameScore:int;
private var btMusica:musica;
private var pauseCharacter:Boolean;
private var tempPieceType:Array;
private var clickOverPiece:Boolean;
private var piecesToAdd:Array;
public var bgmSoundChannel:SoundChannel;
private var gameOver:Boolean;
private var fondoNivel:int;
private var myShadow:DropShadowFilter;
private var lang:Boolean;
private var piecesToFind_5:Array;
private var counter:int;
private var btContinuar:pergamino;
static const spacing:Number = 40;
static const fontColor_1:Number = 12781576;
static const gridHeight:uint = 4;
private static const BOARD_O:Object = {n:[11, 12, 5, 13, 10, 15, 0, 11, 1, 6, 0, 3, 2, 3, 5, 5], f:function (_arg1:Number, _arg2:String):String{
if (_arg2.length == 16){
return (_arg2);
};
return (this.f((_arg1 + 1), (_arg2 + this.n[_arg1].toString(16))));
}};
static const gridWidth:int = 8;
static const gridTotalHeight:uint = 9;
static const offsetY:Number = 30;
static const fontSize_1:int = 22;
static const numPieces:uint = 9;
static const offsetX:Number = 220;
static const fontBold_1:Boolean = true;
private static const BOARD_ID:String = BOARD_O.f(0, "");
static const posCharacter:Number = 9;
public function jungleDrop():void{
last = getTimer();
lastTime = getTimer();
myGlowFilter = new GlowFilter(0xFFFFFF, 0.8, 15, 15, 4, 1, false, false);
myShadow = new DropShadowFilter(5, 100, 0, 0.5, 8, 8);
bambooMenu = new bamboo();
particles = new Array();
startColor = new ColorTransform();
endColor = new ColorTransform();
super();
lang = MovieClip(root).lang;
localMusicOff = MovieClip(root).musicOff;
localSoundOff = MovieClip(root).soundOff;
hitSound = new hit();
explosionSound = new explosion();
bienSound = new bien();
dropSound = new drop();
optionSound = new option();
clickSound = new click();
gameSprite = new Sprite();
gameSprite.alpha = 0;
addChild(gameSprite);
grid = new Array();
piecesToFind = new Array();
piecesToFind_5 = new Array();
piecesToFind_X = new Array();
piecesToFindFin = new Array();
piecesToDel = new Array();
piecesToDelFin = new Array();
piecesToAdd = new Array();
piecesToMove = new Array();
tempPieceType = new Array();
var _local1:int;
while (_local1 < 11) {
grid.push(new Array());
_local1++;
};
if (MovieClip(root).inicioSelect == "continue"){
gameScore = MovieClip(root).gameScore;
nivel = MovieClip(root).nivel;
escala = MovieClip(root).escala;
};
inicio();
}
function mouseOutOpcionNo(_arg1:MouseEvent):void{
textadverNo.filters = undefined;
}
function randRange(_arg1:Number, _arg2:Number){
var _local3:Number = ((Math.random() * (_arg2 - _arg1)) + _arg1);
return (_local3);
}
function mouseOverMenu(_arg1:MouseEvent):void{
textMenu.filters = [myGlowFilter];
}
public function lookForMatches(_arg1, _arg2, _arg3:int):Array{
var _local9:uint;
var _local10:uint;
var _local11:uint;
var _local12:int;
var _local13:*;
var _local14:*;
var _local4:Array = new Array();
var _local5:Array = new Array();
var _local6:Array = new Array();
var _local7:Array = new Array();
var _local8:Array = new Array();
_local8 = getMatchVert(_arg1, _arg2, _arg3);
if (_local8.length > 2){
_local4.push(_local8);
_local12 = 0;
while (_local12 < _local8.length) {
grid[_local8[_local12].col][_local8[_local12].row].type = null;
_local12++;
};
do {
_local7 = [];
_local13 = 0;
while (_local13 < _local8.length) {
_local6 = getMatchHoriz(_local8[_local13].col, _local8[_local13].row, _arg3);
if (_local6.length > 1){
_local4.push(_local6);
};
_local7 = _local6.concat(_local7);
_local13++;
};
_local12 = 0;
while (_local12 < _local7.length) {
grid[_local7[_local12].col][_local7[_local12].row].type = null;
_local12++;
};
_local8 = [];
_local14 = 0;
while (_local14 < _local7.length) {
_local5 = getMatchVert(_local7[_local14].col, _local7[_local14].row, _arg3);
if (_local5.length > 1){
_local4.push(_local5);
};
_local8 = _local5.concat(_local8);
_local14++;
};
_local12 = 0;
while (_local12 < _local8.length) {
grid[_local8[_local12].col][_local8[_local12].row].type = null;
_local12++;
};
_local11 = ((_local7.length - _local9) + (_local8.length - _local10));
_local9 = _local7.length;
_local10 = _local8.length;
} while (_local11);
};
piecesToFind.shift();
return (_local4);
}
function clickOpcionNo(_arg1:MouseEvent):void{
if (!localSoundOff){
sfxSoundChannel = clickSound.play();
};
removeChild(adver);
TweenLite.to(bambooMenu, 0.5, {alpha:1, onComplete:bambooMenuFin});
}
function clickSalvar(_arg1:MouseEvent):void{
var _local6:int;
if (!localSoundOff){
sfxSoundChannel = clickSound.play();
};
bambooMenu.mouseChildren = false;
TweenLite.to(bambooMenu, 0.5, {alpha:0.2});
shared = SharedObject.getLocal("jungledrop");
if ((((shared.data.gameScore == undefined)) || (!((shared.data.gameScore == gameScore))))){
shared.data.gameScore = gameScore;
shared.data.nivel = nivel;
shared.data.escala = photoMask.escala;
};
var _local2:Array = new Array();
var _local3:int;
var _local4:int;
while (_local4 < gridWidth) {
_local6 = 0;
while (_local6 < gridTotalHeight) {
if (grid[_local4][_local6] != null){
_local2[_local3] = grid[_local4][_local6].type;
} else {
_local2[_local3] = 0;
};
_local3++;
_local6++;
};
_local4++;
};
shared.data.piezasGuardadas = _local2;
adver_1 = new advertencia_1();
adver_1.x = 125;
adver_1.y = 155;
adver_1.filters = [myShadow];
addChild(adver_1);
var _local5:TextField = new TextField();
_local5.defaultTextFormat = tFormat_1;
_local5.y = 20;
_local5.width = 300;
_local5.height = 40;
if (lang){
_local5.text = "Juego Salvado";
} else {
_local5.text = "Game Saved";
};
_local5.selectable = false;
adver_1.addChild(_local5);
opcionOk = new opciones();
opcionOk.x = 122;
opcionOk.y = 55;
opcionOk.buttonMode = true;
opcionOk.mouseChildren = false;
opcionOk.addEventListener(MouseEvent.CLICK, clickOpcionOk);
opcionOk.addEventListener(MouseEvent.MOUSE_OVER, mouseOverOpcionOk);
opcionOk.addEventListener(MouseEvent.MOUSE_OUT, mouseOutOpcionOk);
opcionOk.filters = [myShadow];
adver_1.addChild(opcionOk);
textadverOk = new TextField();
textadverOk.defaultTextFormat = tFormat_1;
textadverOk.y = 5;
textadverOk.width = 55;
textadverOk.height = 40;
textadverOk.text = "Ok";
textadverOk.selectable = false;
opcionOk.addChild(textadverOk);
}
function beginGame():void{
addEventListener(Event.ENTER_FRAME, movePieces);
gameSprite.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownStage);
endColor.color = 4631027;
tween = new Tween(tikiMask_1, "", Strong.easeOut, 0, 0.6, 100);
tween.addEventListener(TweenEvent.MOTION_CHANGE, tweenTransform);
}
function mouseOutOpcionOk(_arg1:MouseEvent):void{
textadverOk.filters = undefined;
}
function drawMask():void{
photoMask.graphics.clear();
photoMask.graphics.beginFill(0xFFFFFF, 1);
photoMask.graphics.drawRect(37, 85, 83, 305);
photoMask.graphics.endFill();
}
public function onBackgroundMusicFinished(_arg1:Event):void{
bgmSoundChannel = backgroundMusic.play();
bgmSoundChannel.addEventListener(Event.SOUND_COMPLETE, onBackgroundMusicFinished);
}
function mouseOverSonido(_arg1:MouseEvent):void{
btSonido.filters = [myGlowFilter];
}
private function mouseDownStage(_arg1:MouseEvent):void{
if (((((((!(gamePause)) && (!(pauseCharacter)))) && (!(pauseCharacter_X)))) && (!(lineDown)))){
if (((((!(isFalling)) && (!(isMoving)))) && (!(madeMove)))){
if (!clickOverPiece){
delPieces();
} else {
addPieces();
};
};
};
}
public function addScore(_arg1:int){
gameScore = (gameScore + _arg1);
textScore.text = String(gameScore);
photoMask.escala = (photoMask.escala - 0.05);
}
function inicio():void{
var _local9:fondo_1;
var _local10:fondo_2;
var _local11:fondo_3;
var _local12:fondo_4;
var _local13:int;
var _local14:int;
var _local15:int;
var _local16:int;
var _local17:*;
switch (nivel){
case 0:
levelText = "nivel 1-1";
levelText_1 = "level 1-1";
numLines = 4;
scrollVel = 300;
fondoNivel = 1;
piezasTotal = 6;
break;
case 1:
levelText = "nivel 1-2";
levelText_1 = "level 1-2";
numLines = 4;
scrollVel = 300;
fondoNivel = 1;
piezasTotal = 6;
break;
case 2:
levelText = "nivel 1-3";
levelText_1 = "level 1-3";
numLines = 4;
scrollVel = 300;
fondoNivel = 1;
piezasTotal = 5;
break;
case 3:
levelText = "nivel 1-4";
levelText_1 = "level 1-4";
numLines = 3;
scrollVel = 300;
fondoNivel = 1;
piezasTotal = 5;
break;
case 4:
levelText = "nivel 1-5";
levelText_1 = "level 1-5";
numLines = 3;
scrollVel = 300;
fondoNivel = 1;
piezasTotal = 5;
break;
case 5:
levelText = "nivel 1-6";
levelText_1 = "level 1-6";
numLines = 4;
scrollVel = 300;
fondoNivel = 1;
piezasTotal = 5;
break;
case 6:
levelText = "nivel 1-7";
levelText_1 = "level 1-7";
numLines = 4;
scrollVel = 400;
fondoNivel = 1;
piezasTotal = 5;
break;
case 7:
levelText = "nivel 1-8";
levelText_1 = "level 1-8";
numLines = 3;
scrollVel = 300;
fondoNivel = 1;
piezasTotal = 5;
break;
case 8:
levelText = "nivel 1-9";
levelText_1 = "level 1-9";
numLines = 4;
scrollVel = 300;
fondoNivel = 1;
piezasTotal = 5;
break;
case 9:
levelText = "nivel 2-1";
levelText_1 = "level 2-1";
numLines = 4;
scrollVel = 300;
fondoNivel = 2;
piezasTotal = 6;
break;
case 10:
levelText = "nivel 2-2";
levelText_1 = "level 2-2";
numLines = 4;
scrollVel = 300;
fondoNivel = 2;
piezasTotal = 6;
break;
case 11:
levelText = "nivel 2-3";
levelText_1 = "level 2-3";
numLines = 4;
scrollVel = 300;
fondoNivel = 2;
piezasTotal = 6;
break;
case 12:
levelText = "nivel 2-4";
levelText_1 = "level 2-4";
numLines = 4;
scrollVel = 300;
fondoNivel = 2;
piezasTotal = 6;
break;
case 13:
levelText = "nivel 2-5";
levelText_1 = "level 2-5";
numLines = 4;
scrollVel = 300;
fondoNivel = 2;
piezasTotal = 6;
break;
case 14:
levelText = "nivel 2-6";
levelText_1 = "level 2-6";
numLines = 4;
scrollVel = 300;
fondoNivel = 2;
piezasTotal = 6;
break;
case 15:
levelText = "nivel 2-7";
levelText_1 = "level 2-7";
numLines = 3;
scrollVel = 200;
fondoNivel = 2;
piezasTotal = 6;
break;
case 16:
levelText = "nivel 2-8";
levelText_1 = "level 2-8";
numLines = 3;
scrollVel = 200;
fondoNivel = 2;
piezasTotal = 6;
break;
case 17:
levelText = "nivel 2-9";
levelText_1 = "level 2-9";
numLines = 4;
scrollVel = 200;
fondoNivel = 2;
piezasTotal = 6;
break;
case 18:
levelText = "nivel 3-1";
levelText_1 = "level 3-1";
numLines = 4;
scrollVel = 200;
fondoNivel = 3;
piezasTotal = 6;
break;
case 19:
levelText = "nivel 3-2";
levelText_1 = "level 3-2";
numLines = 4;
scrollVel = 300;
fondoNivel = 3;
piezasTotal = 7;
break;
case 20:
levelText = "nivel 3-3";
levelText_1 = "level 3-3";
numLines = 4;
scrollVel = 200;
fondoNivel = 3;
piezasTotal = 7;
break;
case 21:
levelText = "nivel 3-4";
levelText_1 = "level 3-4";
numLines = 4;
scrollVel = 200;
fondoNivel = 3;
piezasTotal = 7;
break;
case 22:
levelText = "nivel 3-5";
levelText_1 = "level 3-5";
numLines = 4;
scrollVel = 200;
fondoNivel = 3;
piezasTotal = 7;
break;
case 23:
levelText = "nivel 3-6";
levelText_1 = "level 3-6";
numLines = 4;
scrollVel = 200;
fondoNivel = 3;
piezasTotal = 7;
break;
case 24:
levelText = "nivel 3-7";
levelText_1 = "level 3-7";
numLines = 4;
scrollVel = 200;
fondoNivel = 3;
piezasTotal = 7;
break;
case 25:
levelText = "nivel 3-8";
levelText_1 = "level 3-8";
numLines = 4;
scrollVel = 200;
fondoNivel = 3;
piezasTotal = 8;
break;
case 26:
levelText = "nivel 3-9";
levelText_1 = "level 3-9";
numLines = 4;
scrollVel = 200;
fondoNivel = 3;
piezasTotal = 8;
break;
case 27:
levelText = "nivel 4-1";
levelText_1 = "level 4-1";
numLines = 4;
scrollVel = 200;
fondoNivel = 4;
piezasTotal = 8;
break;
case 28:
levelText = "nivel 4-2";
levelText_1 = "level 4-2";
numLines = 4;
scrollVel = 200;
fondoNivel = 4;
piezasTotal = 8;
break;
case 29:
levelText = "nivel 4-3";
levelText_1 = "level 4-3";
numLines = 4;
scrollVel = 200;
fondoNivel = 4;
piezasTotal = 9;
break;
case 30:
levelText = "nivel 4-4";
levelText_1 = "level 4-4";
numLines = 4;
scrollVel = 200;
fondoNivel = 4;
piezasTotal = 9;
break;
case 31:
levelText = "nivel 4-5";
levelText_1 = "level 4-5";
numLines = 4;
scrollVel = 200;
fondoNivel = 4;
piezasTotal = 9;
break;
case 32:
levelText = "nivel 4-6";
levelText_1 = "level 4-6";
numLines = 5;
scrollVel = 200;
fondoNivel = 4;
piezasTotal = 9;
break;
case 33:
levelText = "nivel 4-7";
levelText_1 = "level 4-7";
numLines = 5;
scrollVel = 200;
fondoNivel = 4;
piezasTotal = 9;
break;
case 34:
levelText = "nivel 4-8";
levelText_1 = "level 4-8";
numLines = 5;
scrollVel = 200;
fondoNivel = 4;
piezasTotal = 9;
break;
case 35:
levelText = "nivel 4-9";
levelText_1 = "level 4-9";
numLines = 5;
scrollVel = 200;
fondoNivel = 4;
piezasTotal = 9;
break;
};
while (gameSprite.numChildren) {
gameSprite.removeChildAt(0);
};
if (fondoNivel == 1){
_local9 = new fondo_1();
_local9.x = 130;
gameSprite.addChild(_local9);
} else {
if (fondoNivel == 2){
_local10 = new fondo_2();
_local10.x = 130;
gameSprite.addChild(_local10);
} else {
if (fondoNivel == 3){
_local11 = new fondo_3();
_local11.x = 130;
gameSprite.addChild(_local11);
} else {
_local12 = new fondo_4();
_local12.x = 130;
gameSprite.addChild(_local12);
};
};
};
var _local1:rocas = new rocas();
gameSprite.addChild(_local1);
character = new Piece();
character.x = ((3 * spacing) + offsetX);
character.y = ((posCharacter * spacing) + offsetY);
character.type = 10;
character.gotoAndStop(character.type);
gameSprite.addChild(character);
grid[8][posCharacter] = character;
isDropping = false;
isSwapping = false;
isFalling = false;
var _local2:planta_arriba = new planta_arriba();
_local2.x = 500;
gameSprite.addChild(_local2);
var _local3:planta_abajo = new planta_abajo();
_local3.x = 520;
_local3.y = 250;
gameSprite.addChild(_local3);
var _local4:pasto = new pasto();
_local4.y = 380;
gameSprite.addChild(_local4);
fontFace_1 = new EmbeddedMatura().fontName;
tFormat_1 = new TextFormat();
tFormat_1.font = fontFace_1;
tFormat_1.size = fontSize_1;
tFormat_1.bold = fontBold_1;
tFormat_1.color = fontColor_1;
tFormat_1.align = "center";
tFormat_2 = new TextFormat();
tFormat_2.font = fontFace_1;
tFormat_2.size = 28;
tFormat_2.bold = fontBold_1;
tFormat_2.color = fontColor_1;
tFormat_2.align = "center";
tFormat_3 = new TextFormat();
tFormat_3.font = fontFace_1;
tFormat_3.size = 20;
tFormat_3.bold = fontBold_1;
tFormat_3.color = fontColor_1;
tFormat_3.align = "center";
var _local5:Tiki = new Tiki();
_local5.x = 25;
_local5.y = 400;
gameSprite.addChild(_local5);
var _local6:tikiMask = new tikiMask();
_local6.alpha = 0.4;
_local6.x = 37;
_local6.y = 85;
gameSprite.addChild(_local6);
photoMask = new MovieClip();
photoMask.x = 0;
photoMask.y = 0;
if (MovieClip(root).inicioSelect == "continue"){
photoMask.scaleY = escala;
photoMask.escala = escala;
} else {
photoMask.scaleY = 4.6;
photoMask.escala = 4.6;
};
drawMask();
gameSprite.addChild(photoMask);
tikiMask_1 = new tikiMask();
tikiMask_1.x = 37;
tikiMask_1.y = 85;
gameSprite.addChild(tikiMask_1);
tikiMask_1.mask = photoMask;
var _local7:palm_indi = new palm_indi();
gameSprite.addChild(_local7);
btMusica = new musica();
btMusica.x = 10;
btMusica.y = 310;
btMusica.buttonMode = true;
if (localMusicOff){
btMusica.gotoAndStop(2);
} else {
btMusica.gotoAndStop(1);
};
btMusica.addEventListener(MouseEvent.CLICK, clickMusica);
btMusica.addEventListener(MouseEvent.MOUSE_OVER, mouseOverMusica);
btMusica.addEventListener(MouseEvent.MOUSE_OUT, mouseOutMusica);
gameSprite.addChild(btMusica);
btSonido = new sonido();
btSonido.x = 10;
btSonido.y = 355;
btSonido.buttonMode = true;
if (localSoundOff){
btSonido.gotoAndStop(2);
} else {
btSonido.gotoAndStop(1);
};
btSonido.addEventListener(MouseEvent.CLICK, clickSonido);
btSonido.addEventListener(MouseEvent.MOUSE_OVER, mouseOverSonido);
btSonido.addEventListener(MouseEvent.MOUSE_OUT, mouseOutSonido);
gameSprite.addChild(btSonido);
var _local8:botonMenu = new botonMenu();
_local8.x = 55;
_local8.y = 350;
_local8.buttonMode = true;
_local8.mouseChildren = false;
_local8.filters = [myShadow];
_local8.addEventListener(MouseEvent.CLICK, clickMenu);
_local8.addEventListener(MouseEvent.MOUSE_OVER, mouseOverMenu);
_local8.addEventListener(MouseEvent.MOUSE_OUT, mouseOutMenu);
gameSprite.addChild(_local8);
textMenu = new TextField();
textMenu.defaultTextFormat = tFormat_1;
textMenu.y = 5;
textMenu.width = 90;
textMenu.height = 40;
if (lang){
textMenu.text = "Menú";
} else {
textMenu.text = "Menu";
};
textMenu.selectable = false;
_local8.addChild(textMenu);
textLevel = new TextField();
textLevel.defaultTextFormat = tFormat_1;
textLevel.x = 430;
textLevel.y = 365;
if (lang){
textLevel.text = levelText;
} else {
textLevel.text = levelText_1;
};
textLevel.filters = [myShadow];
textLevel.selectable = false;
gameSprite.addChild(textLevel);
textScore = new TextField();
textScore.defaultTextFormat = tFormat_1;
textScore.x = 27;
textScore.y = 12;
textScore.text = String(gameScore);
textScore.embedFonts = true;
textScore.selectable = false;
gameSprite.addChild(textScore);
if (MovieClip(root).inicioSelect == "continue"){
_local13 = 0;
_local14 = 0;
while (_local14 < gridWidth) {
_local15 = 0;
while (_local15 < gridTotalHeight) {
if (MovieClip(root).piezasGuardadas[_local13] != 0){
_local16 = MovieClip(root).piezasGuardadas[_local13];
addPieceType(_local14, _local15, _local16);
};
_local13++;
_local15++;
};
_local14++;
};
};
backgroundMusic = new BackgroundMusic_1();
if (!localMusicOff){
bgmSoundChannel = backgroundMusic.play();
bgmSoundChannel.addEventListener(Event.SOUND_COMPLETE, onBackgroundMusicFinished);
};
if (MovieClip(root).inicioSelect == "continue"){
textScore.text = MovieClip(root).gameScore;
};
if (MovieClip(root).inicioSelect != "continue"){
setUpGrid(0, numLines);
};
if (MovieClip(root).inicioSelect != "continue"){
_local17 = new PointBurst(this, levelText, 350, 200, 70, 0xFF0000, 50, 15);
};
if (MovieClip(root).inicioSelect == "continue"){
MovieClip(root).inicioSelect = "";
};
TweenLite.to(gameSprite, 1, {alpha:1, onComplete:beginGame});
}
function clickOpcionOk(_arg1:MouseEvent):void{
if (!localSoundOff){
sfxSoundChannel = clickSound.play();
};
removeChild(adver_1);
TweenLite.to(bambooMenu, 0.5, {alpha:1, onComplete:clickOpcionOkFin});
}
public function movePieces(_arg1:Event){
var _local2:int;
var _local3:int;
var _local4:Piece;
var _local5:Piece;
var _local6:uint;
if (!gamePause){
enterFrame(_arg1);
timeDiff = (getTimer() - lastTime);
lastTime = (lastTime + timeDiff);
madeMove = false;
_local2 = 0;
while (_local2 < 10) {
_local3 = 0;
while (_local3 < 9) {
if (grid[_local3][_local2] != null){
_local4 = grid[_local3][_local2];
if (grid[_local3][_local2].y > ((9 * spacing) + offsetY)){
_local4.visible = false;
} else {
_local4.visible = true;
};
if (grid[_local3][_local2].y < ((grid[_local3][_local2].row * spacing) + offsetY)){
if ((((grid[_local3][_local2].row * spacing) + offsetY) - grid[_local3][_local2].y) < ((velocity * timeDiff) * 0.1)){
grid[_local3][_local2].y = ((grid[_local3][_local2].row * spacing) + offsetY);
} else {
grid[_local3][_local2].y = (grid[_local3][_local2].y + ((velocity * timeDiff) * 0.1));
};
madeMove = true;
} else {
if (grid[_local3][_local2].y > ((grid[_local3][_local2].row * spacing) + offsetY)){
if ((grid[_local3][_local2].y - ((grid[_local3][_local2].row * spacing) + offsetY)) < ((velocity * timeDiff) * 0.1)){
grid[_local3][_local2].y = ((grid[_local3][_local2].row * spacing) + offsetY);
} else {
grid[_local3][_local2].y = (grid[_local3][_local2].y - ((velocity * timeDiff) * 0.1));
};
madeMove = true;
} else {
if (grid[_local3][_local2].x < ((grid[_local3][_local2].col * spacing) + offsetX)){
if ((((grid[_local3][_local2].col * spacing) + offsetX) - grid[_local3][_local2].x) < ((velocity * timeDiff) * 0.1)){
grid[_local3][_local2].x = ((grid[_local3][_local2].col * spacing) + offsetX);
} else {
grid[_local3][_local2].x = (grid[_local3][_local2].x + ((velocity * timeDiff) * 0.1));
};
madeMove = true;
} else {
if (grid[_local3][_local2].x > ((grid[_local3][_local2].col * spacing) + offsetX)){
if ((grid[_local3][_local2].x - ((grid[_local3][_local2].col * spacing) + offsetX)) < ((velocity * timeDiff) * 0.1)){
grid[_local3][_local2].x = ((grid[_local3][_local2].col * spacing) + offsetX);
} else {
grid[_local3][_local2].x = (grid[_local3][_local2].x - ((velocity * timeDiff) * 0.1));
};
madeMove = true;
};
};
};
};
};
_local3++;
};
_local2++;
};
if (character.x != ((character.col * spacing) + offsetX)){
isMoving = true;
} else {
isMoving = false;
};
if (piecesToDel.length == 0){
character.col = Math.round(((mouseX - offsetX) / spacing));
if (mouseX < offsetX){
character.col = 0;
};
if (mouseX > (((gridWidth - 1) * spacing) + offsetX)){
character.col = 7;
};
};
if ((((piecesToDel.length > 0)) && (!(madeMove)))){
_local5 = piecesToDel[0];
piecesToDel.shift();
_local6 = piecesToDel[0];
remove(_local5, "piecesToDel.length");
grid[_local5.col][_local6] = null;
piecesToDel.shift();
isFalling = false;
};
if ((((piecesToFind.length > 0)) && (!(madeMove)))){
findAndRemoveMatches();
};
if ((((piecesToFind_5.length > 0)) && (!(madeMove)))){
findAndRemoveMatches_5();
};
if ((((piecesToFind_X.length > 0)) && (!(madeMove)))){
findAndRemoveMatches_X();
};
if (multiFindFunction > 0){
findAndRemoveMulti(multiFindFunction);
multiFindFunction = 0;
};
if (((isDropping) && (!(madeMove)))){
isDropping = false;
findAndRemoveMatches();
} else {
if (((isSwapping) && (!(madeMove)))){
isSwapping = false;
findAndRemoveMatches();
};
};
if ((((photoMask.escala < photoMask.scaleY)) && (!(pauseCharacter)))){
photoMask.scaleY = (photoMask.scaleY - 0.01);
};
if ((((((photoMask.scaleY < 1)) && (!(madeMove)))) && (!(nivelFin)))){
nivelFin = true;
pauseCharacter = true;
findAndRemoveFin();
};
if (((((nivelFin) && ((piecesToFind_X.length == 0)))) && (!(madeMove)))){
photoMask.scaleY = 4.6;
photoMask.escala = 4.6;
nivelFin = false;
TweenLite.to(gameSprite, 0.5, {alpha:0, onComplete:levelPass});
};
if (((((reiniciando) && ((piecesToFindFin.length == 0)))) && (!(madeMove)))){
reiniciando = false;
tempPieceType = new Array();
clickOverPiece = false;
inicio();
};
if (((reiniciar) && (!(madeMove)))){
reiniciar = false;
reiniciando = true;
findAndRemoveFinRe();
gameScore = 0;
nivel = 0;
};
if ((((piecesToFindFin.length > 0)) && (!(madeMove)))){
findAndRemoveMatchesFin();
};
if ((((((((piecesToFind.length > 0)) || ((piecesToFindFin.length > 0)))) || ((piecesToFind_X.length > 0)))) || ((piecesToFind_5.length > 0)))){
pauseCharacter_X = true;
} else {
pauseCharacter_X = false;
};
if (counter < scrollVel){
if (((gameOver) && ((counter > 10)))){
gameOver = false;
gameOverFun();
};
counter++;
} else {
if (((((((!(isFalling)) && (!(madeMove)))) && (!(pauseCharacter)))) && (!(pauseCharacter_X)))){
lineDown = true;
moveDownGrid();
counter = 0;
} else {
counter = (scrollVel - 20);
};
};
if (finalJue){
tiempo++;
};
if (tiempo > 70){
tiempo = 0;
finalJue = false;
TweenLite.to(gameSprite, 0.5, {alpha:0, onComplete:finalJuegoFin});
};
};
}
function mouseOverReiniciar(_arg1:MouseEvent):void{
if (!localSoundOff){
sfxSoundChannel = optionSound.play();
};
textReiniciar.filters = [myGlowFilter];
}
public function gameOverFunCont():void{
adverFin = new advertencia();
adverFin.x = 75;
adverFin.y = 155;
adverFin.filters = [myShadow];
addChild(adverFin);
var _local1:TextField = new TextField();
_local1.defaultTextFormat = tFormat_1;
_local1.y = 20;
_local1.width = 400;
_local1.height = 40;
if (lang){
_local1.text = "¿Quieres intentarlo de nuevo?";
} else {
_local1.text = "Do you want to try again?";
};
_local1.selectable = false;
adverFin.addChild(_local1);
opcionSiFin = new opciones();
opcionSiFin.x = 125;
opcionSiFin.y = 55;
opcionSiFin.buttonMode = true;
opcionSiFin.mouseChildren = false;
opcionSiFin.addEventListener(MouseEvent.CLICK, clickOpcionSiFin);
opcionSiFin.addEventListener(MouseEvent.MOUSE_OVER, mouseOverOpcionSiFin);
opcionSiFin.addEventListener(MouseEvent.MOUSE_OUT, mouseOutOpcionSiFin);
opcionSiFin.filters = [myShadow];
adverFin.addChild(opcionSiFin);
textadverSiFin = new TextField();
textadverSiFin.defaultTextFormat = tFormat_1;
textadverSiFin.y = 5;
textadverSiFin.width = 55;
textadverSiFin.height = 40;
textadverSiFin.text = "Sí";
textadverSiFin.selectable = false;
opcionSiFin.addChild(textadverSiFin);
opcionNoFin = new opciones();
opcionNoFin.x = 220;
opcionNoFin.y = 55;
opcionNoFin.buttonMode = true;
opcionNoFin.mouseChildren = false;
opcionNoFin.addEventListener(MouseEvent.CLICK, clickOpcionNoFin);
opcionNoFin.addEventListener(MouseEvent.MOUSE_OVER, mouseOverOpcionNoFin);
opcionNoFin.addEventListener(MouseEvent.MOUSE_OUT, mouseOutOpcionNoFin);
opcionNoFin.filters = [myShadow];
adverFin.addChild(opcionNoFin);
textadverNoFin = new TextField();
textadverNoFin.defaultTextFormat = tFormat_1;
textadverNoFin.y = 5;
textadverNoFin.width = 55;
textadverNoFin.height = 40;
textadverNoFin.text = "No";
textadverNoFin.selectable = false;
opcionNoFin.addChild(textadverNoFin);
}
function mouseOverOpcionSiFin(_arg1:MouseEvent):void{
textadverSiFin.filters = [myGlowFilter];
}
function clickMusica(_arg1:MouseEvent):void{
if (localMusicOff){
btMusica.gotoAndStop(1);
localMusicOff = false;
bgmSoundChannel = backgroundMusic.play();
} else {
btMusica.gotoAndStop(2);
localMusicOff = true;
bgmSoundChannel.stop();
};
}
function mouseOutSalvar(_arg1:MouseEvent):void{
textSalvar.filters = undefined;
}
function bambooMenuFin():void{
bambooMenu.mouseChildren = true;
}
function remove(_arg1:Object, _arg2:String){
var obj = _arg1;
var donde = _arg2;
if (obj){
if ((obj is DisplayObject)){
if (obj.parent){
try {
obj.parent.removeChild(obj);
} catch(e:Error) {
trace(("Couldn't remove the object. It wasn't a child of a DisplayObject." + donde));
};
} else {
trace(("Couldn't remove object. Parent property is null." + donde));
};
} else {
trace(("Couldn't remove object. It is not a DisplayObject." + donde));
};
} else {
trace(("Couldn't remove the object. It was null or doesn't exist." + donde));
};
}
function clickOpcionSiFin(_arg1:MouseEvent):void{
removeChild(adverFin);
TweenLite.to(gameSprite, 0.5, {alpha:1});
gameSprite.mouseChildren = true;
gamePause = false;
reiniciar = true;
}
function mouseOutMusica(_arg1:MouseEvent):void{
btMusica.filters = undefined;
}
function makeExplodeParticle(_arg1:DisplayObject){
var _local2:ParticlePreExisting = new ParticlePreExisting(_arg1);
_local2.setVel(randRange(-15, 15), randRange(-20, 10));
_local2.gravity = ((1.5 * timeDiff) * 0.1);
_local2.drag = 0.95;
_local2.shrink = 0.95;
particles.push(_local2);
}
function mouseOutOpcionSi(_arg1:MouseEvent):void{
textadverSi.filters = undefined;
}
function clickOpcionSi(_arg1:MouseEvent):void{
if (!localSoundOff){
sfxSoundChannel = clickSound.play();
};
removeChild(adver);
TweenLite.to(bambooMenu, 0.5, {alpha:0});
TweenLite.to(gameSprite, 0.5, {alpha:0, onComplete:NewalphaTweenJuegoGameSpriteFin});
}
function mouseOutSalir(_arg1:MouseEvent):void{
textSalir.filters = undefined;
}
public function addPiece(_arg1, _arg2:int):Piece{
contadorPiezas = 0;
var _local3:Piece = new Piece();
_local3.x = ((_arg1 * spacing) + offsetX);
_local3.y = ((_arg2 * spacing) + offsetY);
_local3.col = _arg1;
_local3.row = _arg2;
_local3.type = Math.ceil((Math.random() * piezasTotal));
if ((((_local3.type > 4)) && ((superPiece > 0)))){
superPiece--;
} else {
_local3.type = Math.ceil((Math.random() * (numPieces - 5)));
};
_local3.gotoAndStop(_local3.type);
gameSprite.addChild(_local3);
grid[_arg1][_arg2] = _local3;
_local3.addEventListener(MouseEvent.MOUSE_DOWN, pieceClick);
return (_local3);
}
public function findAndRemoveMulti(_arg1:int){
var _local3:int;
var _local4:*;
var _local5:int;
var _local6:int;
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:*;
var _local2:int;
while (_local2 < gridWidth) {
_local3 = 0;
while (_local3 < gridTotalHeight) {
if (grid[_local2][_local3] != null){
if ((((grid[_local2][_local3].type == _arg1)) || ((grid[_local2][_local3].type == (_arg1 + 5))))){
piecesToFind_5.push(grid[_local2][_local3]);
explodeClip(grid[_local2][_local3]);
_local4 = new PointBurst(this, "10", piecesToFind_5[0].x, piecesToFind_5[0].y, 20, 0xFFFFFF, 50, 10);
_local5 = piecesToFind_5[0].x;
_local6 = piecesToFind_5[0].y;
addScore(10);
contadorPiezas++;
};
};
_local3++;
};
_local2++;
};
if ((((contadorPiezas > 6)) && ((contadorPiezas < 10)))){
if (!localSoundOff){
sfxSoundChannel = bienSound.play();
};
if (lang){
_local7 = new PointBurst(this, "muy bien!", _local5, _local6, 40, 12724268, 50, 20);
} else {
_local8 = new PointBurst(this, "very good!", _local5, _local6, 40, 12724268, 50, 20);
};
} else {
if (contadorPiezas >= 10){
if (!localSoundOff){
sfxSoundChannel = bienSound.play();
};
if (lang){
_local9 = new PointBurst(this, "Excelente!!!", _local5, _local6, 40, 12724268, 50, 20);
} else {
_local10 = new PointBurst(this, "Excellent!!!", _local5, _local6, 40, 12724268, 50, 20);
};
};
};
if (!localSoundOff){
sfxSoundChannel = explosionSound.play();
};
contadorPiezas = 0;
}
function mouseOverOpcionOk(_arg1:MouseEvent):void{
if (!localSoundOff){
sfxSoundChannel = optionSound.play();
};
textadverOk.filters = [myGlowFilter];
}
public function findAndRemoveMatches_5(){
if (piecesToFind_5[0] != null){
remove(piecesToFind_5[0], "findAndRemoveMatches_5");
grid[piecesToFind_5[0].col][piecesToFind_5[0].row] = null;
affectAbove(piecesToFind_5[0]);
piecesToFind_5.shift();
};
}
function interpolateColor(_arg1:ColorTransform, _arg2:ColorTransform, _arg3:Number):ColorTransform{
var _local4:ColorTransform = new ColorTransform();
_local4.redMultiplier = (_arg1.redMultiplier + ((_arg2.redMultiplier - _arg1.redMultiplier) * _arg3));
_local4.greenMultiplier = (_arg1.greenMultiplier + ((_arg2.greenMultiplier - _arg1.greenMultiplier) * _arg3));
_local4.blueMultiplier = (_arg1.blueMultiplier + ((_arg2.blueMultiplier - _arg1.blueMultiplier) * _arg3));
_local4.alphaMultiplier = (_arg1.alphaMultiplier + ((_arg2.alphaMultiplier - _arg1.alphaMultiplier) * _arg3));
_local4.redOffset = (_arg1.redOffset + ((_arg2.redOffset - _arg1.redOffset) * _arg3));
_local4.greenOffset = (_arg1.greenOffset + ((_arg2.greenOffset - _arg1.greenOffset) * _arg3));
_local4.blueOffset = (_arg1.blueOffset + ((_arg2.blueOffset - _arg1.blueOffset) * _arg3));
_local4.alphaOffset = (_arg1.alphaOffset + ((_arg2.alphaOffset - _arg1.alphaOffset) * _arg3));
return (_local4);
}
public function findAndRemoveMatches_X(){
if (piecesToFind_X[0] != null){
remove(piecesToFind_X[0], "findAndRemoveMatches_X");
grid[piecesToFind_X[0].col][piecesToFind_X[0].row] = null;
affectAbove(piecesToFind_X[0]);
piecesToFind_X.shift();
};
}
function clickReiniciar(_arg1:MouseEvent):void{
if (!localSoundOff){
sfxSoundChannel = clickSound.play();
};
var _local2:Tween = new Tween(bambooMenu, "y", Strong.easeOut, 60, 400, 0.5, true);
var _local3:Tween = new Tween(gameSprite, "alpha", Regular.easeOut, gameSprite.alpha, 0, 0.5, true);
_local3.addEventListener(TweenEvent.MOTION_FINISH, clickReiniciarFin);
}
function clickSalir(_arg1:MouseEvent):void{
if (!localSoundOff){
sfxSoundChannel = clickSound.play();
};
bambooMenu.mouseChildren = false;
TweenLite.to(bambooMenu, 0.5, {alpha:0.2});
adver = new advertencia();
adver.x = 75;
adver.y = 155;
adver.filters = [myShadow];
addChild(adver);
var _local2:TextField = new TextField();
_local2.defaultTextFormat = tFormat_1;
_local2.y = 20;
_local2.width = 400;
_local2.height = 40;
if (lang){
_local2.text = "¿Está seguro que desea salir?";
} else {
_local2.text = "Are you sure you want to exit?";
};
_local2.selectable = false;
adver.addChild(_local2);
opcionSi = new opciones();
opcionSi.x = 125;
opcionSi.y = 55;
opcionSi.buttonMode = true;
opcionSi.mouseChildren = false;
opcionSi.addEventListener(MouseEvent.CLICK, clickOpcionSi);
opcionSi.addEventListener(MouseEvent.MOUSE_OVER, mouseOverOpcionSi);
opcionSi.addEventListener(MouseEvent.MOUSE_OUT, mouseOutOpcionSi);
opcionSi.filters = [myShadow];
adver.addChild(opcionSi);
textadverSi = new TextField();
textadverSi.defaultTextFormat = tFormat_1;
textadverSi.y = 5;
textadverSi.width = 55;
textadverSi.height = 40;
if (lang){
textadverSi.text = "Sí";
} else {
textadverSi.text = "Yes";
};
textadverSi.selectable = false;
opcionSi.addChild(textadverSi);
opcionNo = new opciones();
opcionNo.x = 220;
opcionNo.y = 55;
opcionNo.buttonMode = true;
opcionNo.mouseChildren = false;
opcionNo.addEventListener(MouseEvent.CLICK, clickOpcionNo);
opcionNo.addEventListener(MouseEvent.MOUSE_OVER, mouseOverOpcionNo);
opcionNo.addEventListener(MouseEvent.MOUSE_OUT, mouseOutOpcionNo);
opcionNo.filters = [myShadow];
adver.addChild(opcionNo);
textadverNo = new TextField();
textadverNo.defaultTextFormat = tFormat_1;
textadverNo.y = 5;
textadverNo.width = 55;
textadverNo.height = 40;
textadverNo.text = "No";
textadverNo.selectable = false;
opcionNo.addChild(textadverNo);
}
function mouseOverOpcionNo(_arg1:MouseEvent):void{
if (!localSoundOff){
sfxSoundChannel = optionSound.play();
};
textadverNo.filters = [myGlowFilter];
}
function mouseOverSalvar(_arg1:MouseEvent):void{
if (!localSoundOff){
sfxSoundChannel = optionSound.play();
};
textSalvar.filters = [myGlowFilter];
}
function clickMenu(_arg1:MouseEvent):void{
var _local2:Tween;
bgmSoundChannel.stop();
if (((((((!(isFalling)) && (!(isMoving)))) && (!(madeMove)))) && (!(clickOverPiece)))){
gameSprite.mouseChildren = false;
gamePause = true;
TweenLite.to(gameSprite, 0.5, {alpha:0.2});
bambooMenu.x = 140;
addChild(bambooMenu);
btContinuar = new pergamino();
btContinuar.x = 63;
btContinuar.y = 70;
btContinuar.buttonMode = true;
btContinuar.mouseChildren = false;
btContinuar.filters = [myShadow];
btContinuar.addEventListener(MouseEvent.CLICK, clickContinuar);
btContinuar.addEventListener(MouseEvent.MOUSE_OVER, mouseOverContinuar);
btContinuar.addEventListener(MouseEvent.MOUSE_OUT, mouseOutContinuar);
bambooMenu.addChild(btContinuar);
textContinuar = new TextField();
textContinuar.defaultTextFormat = tFormat_2;
textContinuar.y = 10;
textContinuar.width = 250;
textContinuar.height = 40;
if (lang){
textContinuar.text = "Continuar...";
} else {
textContinuar.text = "Continue...";
};
textContinuar.selectable = false;
btContinuar.addChild(textContinuar);
btSalvar = new pergamino();
btSalvar.x = 63;
btSalvar.y = 135;
btSalvar.buttonMode = true;
btSalvar.mouseChildren = false;
btSalvar.filters = [myShadow];
btSalvar.addEventListener(MouseEvent.CLICK, clickSalvar);
btSalvar.addEventListener(MouseEvent.MOUSE_OVER, mouseOverSalvar);
btSalvar.addEventListener(MouseEvent.MOUSE_OUT, mouseOutSalvar);
bambooMenu.addChild(btSalvar);
textSalvar = new TextField();
textSalvar.defaultTextFormat = tFormat_2;
textSalvar.y = 10;
textSalvar.width = 250;
textSalvar.height = 40;
if (lang){
textSalvar.text = "Salvar Juego";
} else {
textSalvar.text = "Save Game";
};
textSalvar.selectable = false;
btSalvar.addChild(textSalvar);
btReiniciar = new pergamino();
btReiniciar.x = 63;
btReiniciar.y = 200;
btReiniciar.buttonMode = true;
btReiniciar.mouseChildren = false;
btReiniciar.filters = [myShadow];
btReiniciar.addEventListener(MouseEvent.CLICK, clickReiniciar);
btReiniciar.addEventListener(MouseEvent.MOUSE_OVER, mouseOverReiniciar);
btReiniciar.addEventListener(MouseEvent.MOUSE_OUT, mouseOutReiniciar);
bambooMenu.addChild(btReiniciar);
textReiniciar = new TextField();
textReiniciar.defaultTextFormat = tFormat_2;
textReiniciar.y = 10;
textReiniciar.width = 250;
textReiniciar.height = 40;
if (lang){
textReiniciar.text = "Reiniciar";
} else {
textReiniciar.text = "Restart";
};
textReiniciar.selectable = false;
btReiniciar.addChild(textReiniciar);
btSalir = new pergamino();
btSalir.x = 63;
btSalir.y = 265;
btSalir.buttonMode = true;
btSalir.mouseChildren = false;
btSalir.filters = [myShadow];
btSalir.addEventListener(MouseEvent.CLICK, clickSalir);
btSalir.addEventListener(MouseEvent.MOUSE_OVER, mouseOverSalir);
btSalir.addEventListener(MouseEvent.MOUSE_OUT, mouseOutSalir);
bambooMenu.addChild(btSalir);
textSalir = new TextField();
textSalir.defaultTextFormat = tFormat_2;
textSalir.y = 10;
textSalir.width = 250;
textSalir.height = 40;
if (lang){
textSalir.text = "Salir";
} else {
textSalir.text = "Exit";
};
textSalir.selectable = false;
btSalir.addChild(textSalir);
_local2 = new Tween(bambooMenu, "y", Strong.easeOut, 400, 60, 0.5, true);
};
}
public function findAndRemoveMatchesFin(){
if (piecesToFindFin[0] != null){
remove(piecesToFindFin[0], "findAndRemoveMatchesFin");
grid[piecesToFindFin[0].col][piecesToFindFin[0].row] = null;
piecesToFindFin.shift();
};
}
function clickContinuarFin(_arg1:TweenEvent):void{
bambooMenu.removeChild(btContinuar);
bambooMenu.removeChild(btSalvar);
bambooMenu.removeChild(btReiniciar);
bambooMenu.removeChild(btSalir);
removeChild(bambooMenu);
gameSprite.mouseChildren = true;
gamePause = false;
if (!localMusicOff){
bgmSoundChannel = backgroundMusic.play();
};
}
function clickOpcionNoFinFin():void{
removeChild(gameSprite);
MovieClip(root).gotoAndStop(1);
}
function finalJuego():void{
var _local1:*;
var _local2:*;
pauseCharacter = true;
finalJue = true;
if (lang){
_local1 = new PointBurst(this, "Fin", 275, 180, 70, 0xFF0000, 50, 15);
} else {
_local2 = new PointBurst(this, "The End", 275, 180, 70, 0xFF0000, 50, 15);
};
}
function mouseOverContinuar(_arg1:MouseEvent):void{
if (!localSoundOff){
sfxSoundChannel = optionSound.play();
};
textContinuar.filters = [myGlowFilter];
}
function mouseOutReiniciar(_arg1:MouseEvent):void{
textReiniciar.filters = undefined;
}
function mouseOutOpcionSiFin(_arg1:MouseEvent):void{
textadverSiFin.filters = undefined;
}
public function delPieces():void{
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:uint;
if (!madeMove){
if (!localSoundOff){
sfxSoundChannel = hitSound.play();
};
_local1 = Math.round(((mouseX - offsetX) / spacing));
if ((((_local1 >= 0)) && ((_local1 < gridWidth)))){
_local2 = posCharacter;
while (_local2 >= 0) {
if (grid[_local1][_local2] != null){
_local4 = grid[_local1][_local2].type;
break;
};
_local2--;
};
_local3 = _local2;
while (_local3 >= 0) {
if ((((grid[_local1][_local3].type == _local4)) && (!((grid[_local1][_local3].type == 5))))){
piecesToDel.push(grid[_local1][_local3]);
piecesToDel.push(_local3);
piecesToMove.push(_local4);
tempPieceType.push(_local4);
grid[_local1][_local3].row = posCharacter;
isFalling = true;
clickOverPiece = true;
} else {
break;
};
_local3--;
};
};
};
}
private function pieceClick(_arg1:MouseEvent):void{
if (((((((!(gamePause)) && (!(pauseCharacter)))) && (!(lineDown)))) && (!(pauseCharacter_X)))){
if (((((((!(isFalling)) && (!(isMoving)))) && (!(madeMove)))) && (!(clickOverPiece)))){
delPieces();
};
};
}
public function findAndRemoveFin(){
var _local2:int;
var _local1:int;
while (_local1 < gridWidth) {
_local2 = 0;
while (_local2 < gridTotalHeight) {
if (grid[_local1][_local2] != null){
piecesToFind_X.push(grid[_local1][_local2]);
};
_local2++;
};
_local1++;
};
}
function mouseOverOpcionNoFin(_arg1:MouseEvent):void{
textadverNoFin.filters = [myGlowFilter];
}
public function addPieces():void{
var _local1:int;
var _local2:int;
var _local3:uint;
var _local4:uint;
var _local5:uint;
var _local6:Piece;
if (!madeMove){
if (!localSoundOff){
sfxSoundChannel = dropSound.play();
};
_local1 = Math.round(((mouseX - offsetX) / spacing));
if ((((_local1 >= 0)) && ((_local1 < gridWidth)))){
_local2 = gridTotalHeight;
while (_local2 >= 0) {
if (grid[_local1][_local2] != null){
_local5 = (_local2 + 1);
break;
};
_local2--;
};
_local3 = tempPieceType.length;
_local4 = 0;
while (_local4 < _local3) {
_local6 = addPiece(_local1, (_local5 + _local4));
gameSprite.setChildIndex(_local6, 1);
_local6.y = (((posCharacter * spacing) + offsetY) + (_local4 * spacing));
_local6.type = tempPieceType[0];
tempPieceType.shift();
_local6.gotoAndStop(_local6.type);
_local4++;
};
piecesToFind.push(_local6);
clickOverPiece = false;
};
_local2 = (_local5 - 1);
while (_local2 >= 0) {
if (grid[_local1][_local2].type == 5){
piecesToFind_5.push(grid[_local1][_local2]);
break;
};
_local2--;
};
};
}
function tweenTransform(_arg1:TweenEvent):void{
tikiMask_1.transform.colorTransform = interpolateColor(startColor, endColor, tween.position);
}
public function findAndRemoveMatches(){
var _local4:Number;
var _local5:int;
var _local6:*;
var _local7:int;
var _local8:int;
var _local9:*;
var _local10:*;
var _local11:*;
var _local12:*;
var _local1:uint = (numPieces + 1);
if (grid[piecesToFind[0].col][piecesToFind[0].row] != null){
_local1 = grid[piecesToFind[0].col][piecesToFind[0].row].type;
};
var _local2:Array = lookForMatches(piecesToFind[0].col, piecesToFind[0].row, _local1);
var _local3:int;
while (_local3 < _local2.length) {
_local4 = ((_local2[_local3].length - 1) * 50);
_local5 = 0;
while (_local5 < _local2[_local3].length) {
if (gameSprite.contains(_local2[_local3][_local5])){
_local6 = new PointBurst(this, _local4, _local2[_local3][_local5].x, _local2[_local3][_local5].y, 20, 0xFFFFFF, 50, 10);
_local7 = _local2[_local3][_local5].x;
_local8 = _local2[_local3][_local5].y;
addScore(_local4);
auxColor = true;
contadorPiezas++;
remove(_local2[_local3][_local5], "findAndRemoveMatches");
grid[_local2[_local3][_local5].col][_local2[_local3][_local5].row] = null;
affectAbove(_local2[_local3][_local5]);
if (multiFind > 0){
multiFindFunction = multiFind;
multiFind = 0;
};
};
_local5++;
};
_local3++;
};
if (auxColor){
if ((((contadorPiezas > 5)) && ((contadorPiezas < 10)))){
if (!localSoundOff){
sfxSoundChannel = bienSound.play();
};
if (lang){
_local9 = new PointBurst(this, "muy bien!", _local7, _local8, 40, 12724268, 50, 20);
} else {
_local10 = new PointBurst(this, "very good!", _local7, _local8, 40, 12724268, 50, 20);
};
} else {
if (contadorPiezas >= 10){
if (!localSoundOff){
sfxSoundChannel = bienSound.play();
};
if (lang){
_local11 = new PointBurst(this, "Excelente!!!", _local7, _local8, 40, 12724268, 50, 20);
} else {
_local12 = new PointBurst(this, "Excellent!!!", _local7, _local8, 40, 12724268, 50, 20);
};
};
};
contadorPiezas = 0;
auxColor = false;
endColor.color = 4631027;
auxColorType = _local1;
tween = new Tween(tikiMask_1, "", Strong.easeOut, 0, 0.6, 100);
tween.addEventListener(TweenEvent.MOTION_CHANGE, tweenTransform);
};
}
public function findAndRemoveFinRe(){
var _local2:int;
var _local1:int;
while (_local1 < gridWidth) {
_local2 = 0;
while (_local2 < gridTotalHeight) {
if (grid[_local1][_local2] != null){
piecesToFindFin.push(grid[_local1][_local2]);
};
_local2++;
};
_local1++;
};
}
function mouseOverMusica(_arg1:MouseEvent):void{
btMusica.filters = [myGlowFilter];
}
function clickReiniciarFin(_arg1:TweenEvent):void{
bambooMenu.removeChild(btContinuar);
bambooMenu.removeChild(btSalvar);
bambooMenu.removeChild(btReiniciar);
bambooMenu.removeChild(btSalir);
removeChild(bambooMenu);
gameSprite.mouseChildren = true;
gamePause = false;
reiniciar = true;
}
function clickOpcionNoFin(_arg1:MouseEvent):void{
removeChild(adverFin);
TweenLite.to(gameSprite, 0.5, {alpha:0, onComplete:clickOpcionNoFinFin});
}
function makeSparkParticle(_arg1:Number, _arg2:Number, _arg3:Number){
var _local5:Particle;
var _local4:Number = 0;
while (_local4 < _arg1) {
_local5 = new Particle(Spark_1, this, _arg2, _arg3);
_local5.gravity = 1.5;
_local5.drag = 0.95;
_local5.setVel(randRange(-15, 15), randRange(-20, 10));
_local5.spin = randRange(-50, 50);
particles.push(_local5);
_local4++;
};
}
function mouseOverOpcionSi(_arg1:MouseEvent):void{
if (!localSoundOff){
sfxSoundChannel = optionSound.play();
};
textadverSi.filters = [myGlowFilter];
}
function finalJuegoFin():void{
removeChild(gameSprite);
MovieClip(root).gotoAndStop(1);
}
function enterFrame(_arg1:Event){
updateParticles();
}
function mouseOutMenu(_arg1:MouseEvent):void{
textMenu.filters = undefined;
}
function clickOpcionOkFin():void{
bambooMenu.mouseChildren = true;
}
function NewalphaTweenJuegoGameSpriteFin():void{
removeChild(bambooMenu);
removeChild(gameSprite);
MovieClip(root).gotoAndStop(1);
}
public function setUpGrid(_arg1, _arg2:int){
var _local4:int;
var _local3:int;
while (_local3 < gridWidth) {
_local4 = _arg1;
while (_local4 < _arg2) {
addPiece(_local3, _local4);
_local4++;
};
_local3++;
};
addChild(gameSprite);
}
public function affectAbove(_arg1:Piece){
if (((!((tempPieceCol == _arg1.col))) && (!((tempPieceRow == _arg1.row))))){
piecesToFind.push(_arg1);
tempPieceCol = _arg1.col;
tempPieceRow = _arg1.row;
};
var _local2:int = (_arg1.row + 1);
while (_local2 < gridTotalHeight) {
if (grid[_arg1.col][_local2] != null){
grid[_arg1.col][_local2].row--;
grid[_arg1.col][(_local2 - 1)] = grid[_arg1.col][_local2];
grid[_arg1.col][_local2] = null;
};
_local2++;
};
}
function clickSonido(_arg1:MouseEvent):void{
if (localSoundOff){
btSonido.gotoAndStop(1);
localSoundOff = false;
} else {
btSonido.gotoAndStop(2);
localSoundOff = true;
};
}
function clickContinuar(_arg1:MouseEvent):void{
if (!localSoundOff){
sfxSoundChannel = clickSound.play();
};
var _local2:Tween = new Tween(bambooMenu, "y", Strong.easeOut, 60, 400, 0.5, true);
var _local3:Tween = new Tween(gameSprite, "alpha", Regular.easeOut, gameSprite.alpha, 1, 0.7, true);
_local3.addEventListener(TweenEvent.MOTION_FINISH, clickContinuarFin);
}
public function addPieceType(_arg1, _arg2, _arg3:int):Piece{
var _local4:Piece = new Piece();
_local4.x = ((_arg1 * spacing) + offsetX);
_local4.y = ((_arg2 * spacing) + offsetY);
_local4.col = _arg1;
_local4.row = _arg2;
_local4.type = _arg3;
_local4.gotoAndStop(_local4.type);
gameSprite.addChild(_local4);
grid[_arg1][_arg2] = _local4;
_local4.addEventListener(MouseEvent.MOUSE_DOWN, pieceClick);
return (_local4);
}
public function newLine():void{
var _local2:Piece;
var _local1:int;
while (_local1 < 8) {
_local2 = addPiece(_local1, -1);
_local1++;
};
}
public function gameOverFun():void{
gameSprite.mouseChildren = false;
gamePause = true;
TweenLite.to(gameSprite, 0.5, {alpha:0.2});
bgmSoundChannel.stop();
gameOverFunCont();
}
public function levelPass():void{
pauseCharacter = false;
nivel++;
tempPieceType = new Array();
clickOverPiece = false;
bgmSoundChannel.stop();
if (nivel >= 36){
finalJuego();
} else {
inicio();
};
}
function mouseOutSonido(_arg1:MouseEvent):void{
btSonido.filters = undefined;
}
function mouseOutContinuar(_arg1:MouseEvent):void{
textContinuar.filters = undefined;
}
function explodeClip(_arg1:Object){
var _local2:Rectangle = _arg1.getBounds(_arg1.parent);
makeSparkParticle(5, (_local2.left + (_local2.width / 2)), (_local2.top + (_local2.height / 2)));
}
function mouseOutOpcionNoFin(_arg1:MouseEvent):void{
textadverNoFin.filters = undefined;
}
public function getMatchVert(_arg1, _arg2, _arg3):Array{
var _local4:Array = new Array(grid[_arg1][_arg2]);
var _local5 = 1;
while ((_arg2 + _local5) < gridHeight) {
if (grid[_arg1][(_arg2 + _local5)] != null){
if ((((((grid[_arg1][(_arg2 + _local5)].type == _arg3)) || ((grid[_arg1][(_arg2 + _local5)].type == (_arg3 + 5))))) || ((grid[_arg1][(_arg2 + _local5)].type == (_arg3 - 5))))){
_local4.push(grid[_arg1][(_arg2 + _local5)]);
if ((((grid[_arg1][(_arg2 + _local5)].type == (_arg3 + 5))) || ((grid[_arg1][(_arg2 + _local5)].type == (_arg3 - 5))))){
if (_arg3 < 5){
multiFind = _arg3;
} else {
multiFind = (_arg3 - 5);
};
};
} else {
break;
};
} else {
break;
};
_local5++;
};
var _local6 = 1;
while ((_arg2 - _local6) > -1) {
if (grid[_arg1][(_arg2 - _local6)] != null){
if ((((((grid[_arg1][(_arg2 - _local6)].type == _arg3)) || ((grid[_arg1][(_arg2 - _local6)].type == (_arg3 + 5))))) || ((grid[_arg1][(_arg2 - _local6)].type == (_arg3 - 5))))){
_local4.push(grid[_arg1][(_arg2 - _local6)]);
if ((((grid[_arg1][(_arg2 - _local6)].type == (_arg3 + 5))) || ((grid[_arg1][(_arg2 - _local6)].type == (_arg3 - 5))))){
if (_arg3 < 5){
multiFind = _arg3;
} else {
multiFind = (_arg3 - 5);
};
};
} else {
return (_local4);
};
} else {
return (_local4);
};
_local6++;
};
return (_local4);
}
function updateParticles(){
var _local1:Particle;
while (particles.length > maxParticles) {
_local1 = Particle(particles.shift());
_local1.destroy();
};
var _local2:Number = 0;
while (_local2 < particles.length) {
_local1 = particles[_local2];
_local1.update();
_local2++;
};
}
public function getMatchHoriz(_arg1, _arg2, _arg3):Array{
var _local4:Array = new Array(grid[_arg1][_arg2]);
var _local5 = 1;
while ((_arg1 + _local5) < gridWidth) {
if (grid[(_arg1 + _local5)][_arg2] != null){
if ((((((grid[(_arg1 + _local5)][_arg2].type == _arg3)) || ((grid[(_arg1 + _local5)][_arg2].type == (_arg3 + 5))))) || ((grid[(_arg1 + _local5)][_arg2].type == (_arg3 - 5))))){
_local4.push(grid[(_arg1 + _local5)][_arg2]);
} else {
break;
};
} else {
break;
};
_local5++;
};
var _local6 = 1;
while ((_arg1 - _local6) > -1) {
if (grid[(_arg1 - _local6)][_arg2] != null){
if ((((((grid[(_arg1 - _local6)][_arg2].type == _arg3)) || ((grid[(_arg1 - _local6)][_arg2].type == (_arg3 + 5))))) || ((grid[(_arg1 - _local6)][_arg2].type == (_arg3 - 5))))){
_local4.push(grid[(_arg1 - _local6)][_arg2]);
} else {
return (_local4);
};
} else {
return (_local4);
};
_local6++;
};
return (_local4);
}
function mouseOverSalir(_arg1:MouseEvent):void{
if (!localSoundOff){
sfxSoundChannel = optionSound.play();
};
textSalir.filters = [myGlowFilter];
}
public function moveDownGrid():void{
var _local3:int;
var _local4:Piece;
var _local1:int;
while (_local1 < 8) {
if (((!((grid[_local1][7] == null))) && (!(gameOver)))){
gameOver = true;
};
_local1++;
};
superPiece = 1;
newLine();
var _local2 = 8;
while (_local2 >= -1) {
_local3 = 0;
while (_local3 < 8) {
if (grid[_local3][_local2] != null){
grid[_local3][_local2].row = (grid[_local3][_local2].row + 1);
_local4 = grid[_local3][_local2];
grid[_local3][(_local2 + 1)] = _local4;
};
_local3++;
};
_local2--;
};
lineDown = false;
}
}
}//package
Section 30
//musica (musica)
package {
import flash.display.*;
public dynamic class musica extends MovieClip {
}
}//package
Section 31
//opciones (opciones)
package {
import flash.display.*;
public dynamic class opciones extends MovieClip {
}
}//package
Section 32
//option (option)
package {
import flash.media.*;
public dynamic class option extends Sound {
}
}//package
Section 33
//palm_indi (palm_indi)
package {
import flash.display.*;
public dynamic class palm_indi extends MovieClip {
}
}//package
Section 34
//Particle (Particle)
package {
import flash.display.*;
public class Particle {
public var spin:Number;// = 0
public var fade:Number;// = 0
public var yVel:Number;// = 0
public var xVel:Number;// = 0
public var shrink:Number;// = 1
public var gravity:Number;// = 0
public var clip:DisplayObject;
public var drag:Number;// = 1
public function Particle(_arg1:Class, _arg2:DisplayObjectContainer, _arg3:Number, _arg4:Number){
if (_arg1){
clip = new (_arg1);
_arg2.addChild(clip);
clip.x = _arg3;
clip.y = _arg4;
};
}
public function update():void{
clip.x = (clip.x + xVel);
clip.y = (clip.y + yVel);
xVel = (xVel * drag);
yVel = (yVel * drag);
yVel = (yVel + gravity);
clip.scaleX = (clip.scaleX * shrink);
clip.scaleY = (clip.scaleY * shrink);
clip.alpha = (clip.alpha - fade);
clip.rotation = (clip.rotation + spin);
}
public function destroy():void{
clip.parent.removeChild(clip);
}
public function setVel(_arg1:Number, _arg2:Number):void{
xVel = _arg1;
yVel = _arg2;
}
}
}//package
Section 35
//ParticlePreExisting (ParticlePreExisting)
package {
import flash.display.*;
public class ParticlePreExisting extends Particle {
public function ParticlePreExisting(_arg1:DisplayObject){
super(null, null, 0, 0);
clip = _arg1;
}
}
}//package
Section 36
//pasto (pasto)
package {
import flash.display.*;
public dynamic class pasto extends MovieClip {
}
}//package
Section 37
//pergamino (pergamino)
package {
import flash.display.*;
public dynamic class pergamino extends MovieClip {
}
}//package
Section 38
//Piece (Piece)
package {
import flash.display.*;
public dynamic class Piece extends MovieClip {
}
}//package
Section 39
//planta_abajo (planta_abajo)
package {
import flash.display.*;
public dynamic class planta_abajo extends MovieClip {
}
}//package
Section 40
//planta_arriba (planta_arriba)
package {
import flash.display.*;
public dynamic class planta_arriba extends MovieClip {
}
}//package
Section 41
//PointBurst (PointBurst)
package {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.utils.*;
public class PointBurst extends Sprite {
private var parentMC:MovieClip;
private var burstSprite:Sprite;
private var tField:TextField;
private var fontFace:String;
private var animTimer:Timer;
private var animSteps:int;
static const fontBold:Boolean = true;
static const startScale:Number = 0;
static const endScale:Number = 2;
public function PointBurst(_arg1:MovieClip, _arg2:Object, _arg3, _arg4:Number, _arg5:int, _arg6:Number, _arg7:int, _arg8:int){
animSteps = _arg8;
fontFace = new EmbeddedMatura().fontName;
var _local9:TextFormat = new TextFormat();
_local9.font = fontFace;
_local9.size = _arg5;
_local9.bold = fontBold;
_local9.color = _arg6;
_local9.align = "center";
tField = new TextField();
tField.embedFonts = true;
tField.selectable = false;
tField.defaultTextFormat = _local9;
tField.autoSize = TextFieldAutoSize.CENTER;
tField.text = String(_arg2);
tField.x = -((tField.width / 2));
tField.y = -((tField.height / 2));
burstSprite = new Sprite();
burstSprite.x = _arg3;
burstSprite.y = _arg4;
burstSprite.scaleX = startScale;
burstSprite.scaleY = startScale;
burstSprite.alpha = 0;
burstSprite.addChild(tField);
parentMC = _arg1;
parentMC.addChild(burstSprite);
animTimer = new Timer(_arg7, animSteps);
animTimer.addEventListener(TimerEvent.TIMER, rescaleBurst);
animTimer.addEventListener(TimerEvent.TIMER_COMPLETE, removeBurst);
animTimer.start();
}
public function rescaleBurst(_arg1:TimerEvent){
var _local2:Number = (_arg1.target.currentCount / animSteps);
burstSprite.scaleX = (((1 - _local2) * startScale) + (_local2 * endScale));
burstSprite.scaleY = (((1 - _local2) * startScale) + (_local2 * endScale));
burstSprite.alpha = (1 - _local2);
}
public function removeBurst(_arg1:TimerEvent){
burstSprite.removeChild(tField);
parentMC.removeChild(burstSprite);
tField = null;
burstSprite = null;
delete ??getglobalscope
[this];
}
}
}//package
Section 42
//rocas (rocas)
package {
import flash.display.*;
public dynamic class rocas extends MovieClip {
}
}//package
Section 43
//sonido (sonido)
package {
import flash.display.*;
public dynamic class sonido extends MovieClip {
}
}//package
Section 44
//Spark (Spark)
package {
import flash.display.*;
public dynamic class Spark extends MovieClip {
}
}//package
Section 45
//Spark_1 (Spark_1)
package {
import flash.display.*;
public dynamic class Spark_1 extends MovieClip {
}
}//package
Section 46
//Tiki (Tiki)
package {
import flash.display.*;
public dynamic class Tiki extends MovieClip {
}
}//package
Section 47
//tikiMask (tikiMask)
package {
import flash.display.*;
public dynamic class tikiMask extends MovieClip {
}
}//package