Section 1
//bt_mc_fscreen_43 (LowCarbon_Mochi_fla.bt_mc_fscreen_43)
package LowCarbon_Mochi_fla {
import flash.display.*;
public dynamic class bt_mc_fscreen_43 extends MovieClip {
public function bt_mc_fscreen_43(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package LowCarbon_Mochi_fla
Section 2
//live_95 (LowCarbon_Mochi_fla.live_95)
package LowCarbon_Mochi_fla {
import flash.display.*;
public dynamic class live_95 extends MovieClip {
public function live_95(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package LowCarbon_Mochi_fla
Section 3
//MainTimeline (LowCarbon_Mochi_fla.MainTimeline)
package LowCarbon_Mochi_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.media.*;
import flash.text.*;
import flash.utils.*;
import flash.system.*;
import flash.external.*;
import flash.ui.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.xml.*;
public dynamic class MainTimeline extends MovieClip {
public var d_RePlay:SimpleButton;
public var d_Submit:SimpleButton;
public var loadingMC:MovieClip;
public var d_Twitter:SimpleButton;
public var d_HelpPlay:SimpleButton;
public var d_Score:TextField;
public var d_Facebook:SimpleButton;
public var d_Fscreen:MovieClip;
public var __setTabDict:Dictionary;
public var _mochiads_game_id:String;
public var ss;
public var isfull:String;
public var ss2;
public var gamename;
public var furl;
public function MainTimeline(){
__setTabDict = new Dictionary(true);
super();
addFrameScript(0, frame1, 2, frame3, 3, frame4, 5, frame6);
}
public function onShare(_arg1){
var _local3:String;
var _local2:String = ExternalInterface.call("eval", "window.location.href");
if (_local2 == null){
_local2 = "http://www.gamesonly.net";
};
if (_arg1.currentTarget == d_Facebook){
_local3 = (("http://www.facebook.com/share.php?u=" + _local2) + "&t= Playing LowCarbon");
} else {
_local3 = ("http://twitter.com/home?status=Currently Playing LowCarbon " + _local2);
};
navigateToURL(new URLRequest(_local3), "_blank");
}
public function onFscreen(_arg1:MouseEvent):void{
var event = _arg1;
try {
switch (stage.displayState){
case "normal":
stage.displayState = "fullScreen";
d_Fscreen.gotoAndStop(2);
break;
case "fullScreen":
default:
stage.displayState = "normal";
d_Fscreen.gotoAndStop(1);
break;
};
} catch(e:SecurityError) {
trace("<param name=\"allowFullScreen\" value=\"true\" />");
};
}
public function onHelpPlay(_arg1){
gotoAndStop("game");
}
public function onClick(_arg1){
gotoAndStop("start");
}
public function onSubmit(_arg1){
var _local2:* = MD5.hash((((furl + gamename) + d_Score.text) + "zygomaticgames"));
navigateToURL(new URLRequest((((((("http://www.gamesonly.net/highscore.php?game=" + gamename) + "&score=") + d_Score.text) + "&otherparam=") + _local2) + "")), "_blank");
}
function __setTab_loadingMC_Scene1_Layer4_0(){
if ((((__setTabDict[loadingMC] == undefined)) || (!((int(__setTabDict[loadingMC]) == 1))))){
__setTabDict[loadingMC] = 1;
loadingMC.tabIndex = 0;
};
}
function frame1(){
__setTab_loadingMC_Scene1_Layer4_0();
_mochiads_game_id = "632aefea6786546e";
stop();
}
function frame3(){
stop();
SoundMixer.stopAll();
Input.init(this.stage);
Config.soundChannel = null;
if (Config.SSound){
ss = new SStart();
ss.play(0, 10000000);
};
d_Twitter.addEventListener(MouseEvent.CLICK, onShare);
d_Facebook.addEventListener(MouseEvent.CLICK, onShare);
d_Fscreen.addEventListener(MouseEvent.CLICK, onFscreen);
d_Fscreen.buttonMode = true;
try {
isfull = String(EmbedObject.getParamViaExternal("allowFullScreen"));
isfull = isfull.toLowerCase();
if (isfull != "true"){
d_Fscreen.visible = false;
};
} catch(e) {
};
}
function frame4(){
stop();
d_HelpPlay.addEventListener(MouseEvent.CLICK, onHelpPlay);
}
function frame6(){
stop();
SoundMixer.stopAll();
Config.soundChannel = null;
if (Config.SSound){
ss2 = new SOver();
ss2.play();
};
d_Score.text = String(Game.AllScore);
d_RePlay.addEventListener(MouseEvent.CLICK, onClick);
d_Submit.addEventListener(MouseEvent.CLICK, onSubmit);
gamename = "LowCarbon";
furl = "www.gamesonly.net";
}
}
}//package LowCarbon_Mochi_fla
Section 4
//music_85 (LowCarbon_Mochi_fla.music_85)
package LowCarbon_Mochi_fla {
import flash.display.*;
public dynamic class music_85 extends MovieClip {
public function music_85(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
if (!Config.SSound){
gotoAndStop(2);
};
}
}
}//package LowCarbon_Mochi_fla
Section 5
//score_101 (LowCarbon_Mochi_fla.score_101)
package LowCarbon_Mochi_fla {
import flash.display.*;
public dynamic class score_101 extends MovieClip {
public function score_101(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package LowCarbon_Mochi_fla
Section 6
//scoremove_100 (LowCarbon_Mochi_fla.scoremove_100)
package LowCarbon_Mochi_fla {
import flash.display.*;
public dynamic class scoremove_100 extends MovieClip {
public var mc:MovieClip;
public function scoremove_100(){
addFrameScript(0, frame1, 12, frame13);
}
function frame1(){
stop();
}
function frame13(){
stop();
}
}
}//package LowCarbon_Mochi_fla
Section 7
//sheep_93 (LowCarbon_Mochi_fla.sheep_93)
package LowCarbon_Mochi_fla {
import flash.display.*;
public dynamic class sheep_93 extends MovieClip {
public function sheep_93(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package LowCarbon_Mochi_fla
Section 8
//sheep_94 (LowCarbon_Mochi_fla.sheep_94)
package LowCarbon_Mochi_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.media.*;
import flash.text.*;
import flash.utils.*;
import flash.system.*;
import flash.external.*;
import flash.ui.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.xml.*;
public dynamic class sheep_94 extends MovieClip {
public var p;
public function sheep_94(){
addFrameScript(12, frame13);
}
function frame13(){
stop();
p = MovieClip(parent);
if (p != null){
p.gotoAndStop("walk");
};
}
}
}//package LowCarbon_Mochi_fla
Section 9
//sound_86 (LowCarbon_Mochi_fla.sound_86)
package LowCarbon_Mochi_fla {
import flash.display.*;
public dynamic class sound_86 extends MovieClip {
public function sound_86(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
if (!Config.SMusic){
gotoAndStop(2);
};
}
}
}//package LowCarbon_Mochi_fla
Section 10
//Timeline_1 (LowCarbon_Mochi_fla.Timeline_1)
package LowCarbon_Mochi_fla {
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
public dynamic class Timeline_1 extends MovieClip {
public var skip_btn:SimpleButton;
public var d_Load:TextField;
public function Timeline_1(){
addFrameScript(1, frame2, 150, frame151, 151, frame152);
}
public function skipEvent(_arg1:MouseEvent){
this.gotoAndStop(152);
}
public function onProgress(_arg1:ProgressEvent){
var _local2:* = Math.floor(((_arg1.bytesLoaded / _arg1.bytesTotal) * 100));
d_Load.text = (("Loading....." + _local2) + "%");
}
public function onInit(_arg1){
skip_btn.visible = true;
d_Load.visible = false;
if (this.currentFrame == 151){
gotoAndStop(152);
};
}
function frame2(){
skip_btn.visible = false;
skip_btn.addEventListener(MouseEvent.CLICK, skipEvent);
this.root.loaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgress);
this.root.loaderInfo.addEventListener(Event.COMPLETE, onInit);
if (this.root.loaderInfo.bytesLoaded == this.root.loaderInfo.bytesTotal){
onInit(null);
};
}
function frame151(){
stop();
if (this.root.loaderInfo.bytesLoaded == this.root.loaderInfo.bytesTotal){
gotoAndStop(152);
};
}
function frame152(){
stop();
SoundMixer.stopAll();
MovieClip(this.parent).gotoAndStop("start");
}
}
}//package LowCarbon_Mochi_fla
Section 11
//Timeline_27 (LowCarbon_Mochi_fla.Timeline_27)
package LowCarbon_Mochi_fla {
import flash.display.*;
public dynamic class Timeline_27 extends MovieClip {
public function Timeline_27(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package LowCarbon_Mochi_fla
Section 12
//Timeline_5 (LowCarbon_Mochi_fla.Timeline_5)
package LowCarbon_Mochi_fla {
import flash.display.*;
public dynamic class Timeline_5 extends MovieClip {
public function Timeline_5(){
addFrameScript(79, frame80);
}
function frame80(){
stop();
}
}
}//package LowCarbon_Mochi_fla
Section 13
//Timeline_7 (LowCarbon_Mochi_fla.Timeline_7)
package LowCarbon_Mochi_fla {
import flash.display.*;
public dynamic class Timeline_7 extends MovieClip {
public function Timeline_7(){
addFrameScript(106, frame107);
}
function frame107(){
stop();
}
}
}//package LowCarbon_Mochi_fla
Section 14
//title_29 (LowCarbon_Mochi_fla.title_29)
package LowCarbon_Mochi_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.media.*;
import flash.text.*;
import flash.utils.*;
import flash.system.*;
import flash.external.*;
import flash.ui.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.xml.*;
public dynamic class title_29 extends MovieClip {
public var d_Play:SimpleButton;
public var d_High:SimpleButton;
public var d_Help:SimpleButton;
public var d_More:SimpleButton;
public function title_29(){
addFrameScript(0, frame1, 61, frame62);
}
public function onGotoOver(_arg1){
gotoAndStop(62);
}
public function onClick(_arg1){
switch (_arg1.currentTarget.name){
case "d_Play":
MovieClip(parent).gotoAndStop("game");
break;
case "d_Help":
MovieClip(parent).gotoAndStop("help");
break;
case "d_More":
navigateToURL(new URLRequest("http://www.gamesonly.net/"), "_blank");
break;
};
}
public function onHighScore(_arg1){
navigateToURL(new URLRequest("http://www.gamesonly.net/highscore.php?game=LowCarbon"), "_blank");
}
function frame1(){
this.stage.addEventListener(MouseEvent.CLICK, onGotoOver);
}
function frame62(){
stop();
this.stage.removeEventListener(MouseEvent.CLICK, onGotoOver);
d_Play.addEventListener(MouseEvent.CLICK, onClick);
d_Help.addEventListener(MouseEvent.CLICK, onClick);
d_More.addEventListener(MouseEvent.CLICK, onClick);
d_High.addEventListener(MouseEvent.CLICK, onHighScore);
}
}
}//package LowCarbon_Mochi_fla
Section 15
//Car (Car)
package {
import flash.display.*;
public class Car extends MovieClip {
public var speed:uint;
}
}//package
Section 16
//Config (Config)
package {
public class Config {
public static var SSound:Boolean = true;
public static var SMusic:Boolean = true;
public static var soundChannel;
}
}//package
Section 17
//EmbedObject (EmbedObject)
package {
import flash.system.*;
import flash.external.*;
public class EmbedObject {
private var embedObjectProps:Object;
private var attemptedPropsRetrieval:Boolean;// = false
private static var _singleton:EmbedObject;
private static var SET_CALLBACK_NAME:String = "asorg_setEmbedObjectProps";
public function EmbedObject(){
initialize();
}
private function initialize(){
ExternalInterface.addCallback(SET_CALLBACK_NAME, external_SetEmbedObjectProps);
}
public function _getEmbedObjectProps():Object{
if (!attemptedPropsRetrieval){
retrieveEmbedObjectProps();
attemptedPropsRetrieval = true;
};
return (embedObjectProps);
}
public function retrieveEmbedObjectProps(){
retrieveEmbedObjectPropsForTagname("embed");
if (!embedObjectProps){
retrieveEmbedObjectPropsForTagname("object");
};
}
public function retrieveEmbedObjectPropsForTagname(_arg1:String){
var _local2:String;
if ((((Capabilities.playerType == "PlugIn")) || ((Capabilities.playerType == "ActiveX")))){
_local2 = (((((("var elts = document.getElementsByTagName('" + _arg1) + "'); for (var i=0;i<elts.length;i++) {if(typeof elts[i].") + SET_CALLBACK_NAME) + " != 'undefined') { if (!elts[i].getAttribute('id')) {elts[i].setAttribute('id','asorgid_'+Math.floor(Math.random()*100000));} var props = {}; props.id = elts[i].getAttribute('id'); for (var x=0; x < elts[i].attributes.length; x++) { props[elts[i].attributes[x].nodeName] = elts[i].attributes[x].nodeValue;} elts[i].") + SET_CALLBACK_NAME) + "(props); }}");
singleton.executeJS(_local2);
} else {
singleton.external_SetEmbedObjectProps({});
};
}
public function executeJS(_arg1:String):Object{
return (ExternalInterface.call((("function() {" + _arg1) + "}")));
}
public function external_SetEmbedObjectProps(_arg1:Object){
this.embedObjectProps = _arg1;
}
private static function testFunc(){
}
public static function getSingleton():EmbedObject{
if (_singleton == null){
_singleton = new (EmbedObject);
};
return (_singleton);
}
public static function get singleton():EmbedObject{
return (getSingleton());
}
public static function getId():String{
return (getEnumerableParam("id"));
}
public static function getEnumerableParam(_arg1:String):String{
return (String(getEnumerableParams()[_arg1]));
}
public static function getEnumerableParams():Object{
if (!singleton.embedObjectProps){
singleton._getEmbedObjectProps();
};
return (singleton.embedObjectProps);
}
public static function getParamViaExternal(_arg1:String):Object{
return (Object(singleton.executeJS((((("return document.getElementById('" + getEnumerableParam("id")) + "').getAttribute('") + _arg1) + "');"))));
}
}
}//package
Section 18
//FHitTest (FHitTest)
package {
import flash.display.*;
import flash.geom.*;
public class FHitTest {
public static function complexHitTestObject(_arg1:DisplayObject, _arg2:DisplayObject, _arg3:Number=1):Boolean{
return (!((complexIntersectionRectangle(_arg1, _arg2, _arg3).width == 0)));
}
public static function intersectionRectangle(_arg1:DisplayObject, _arg2:DisplayObject):Rectangle{
if (((((!(_arg1.root)) || (!(_arg2.root)))) || (!(_arg1.hitTestObject(_arg2))))){
return (new Rectangle());
};
var _local3:Rectangle = _arg1.getBounds(_arg1.root);
var _local4:Rectangle = _arg2.getBounds(_arg2.root);
var _local5:Rectangle = new Rectangle();
_local5.x = Math.max(_local3.x, _local4.x);
_local5.y = Math.max(_local3.y, _local4.y);
_local5.width = Math.min(((_local3.x + _local3.width) - _local5.x), ((_local4.x + _local4.width) - _local5.x));
_local5.height = Math.min(((_local3.y + _local3.height) - _local5.y), ((_local4.y + _local4.height) - _local5.y));
return (_local5);
}
public static function complexIntersectionRectangle(_arg1:DisplayObject, _arg2:DisplayObject, _arg3:Number=1):Rectangle{
if (_arg3 <= 0){
throw (new Error("ArgumentError: Error #5001: Invalid value for accurracy", 5001));
};
if (!_arg1.hitTestObject(_arg2)){
return (new Rectangle());
};
var _local4:Rectangle = intersectionRectangle(_arg1, _arg2);
if (((((_local4.width * _arg3) < 1)) || (((_local4.height * _arg3) < 1)))){
return (new Rectangle());
};
var _local5:BitmapData = new BitmapData((_local4.width * _arg3), (_local4.height * _arg3), false, 0);
_local5.draw(_arg1, FHitTest.getDrawMatrix(_arg1, _local4, _arg3), new ColorTransform(1, 1, 1, 1, 0xFF, -255, -255, 0xFF));
_local5.draw(_arg2, FHitTest.getDrawMatrix(_arg2, _local4, _arg3), new ColorTransform(1, 1, 1, 1, 0xFF, 0xFF, 0xFF, 0xFF), BlendMode.DIFFERENCE);
var _local6:Rectangle = _local5.getColorBoundsRect(4294967295, 4278255615);
_local5.dispose();
if (_arg3 != 1){
_local6.x = (_local6.x / _arg3);
_local6.y = (_local6.y / _arg3);
_local6.width = (_local6.width / _arg3);
_local6.height = (_local6.height / _arg3);
};
_local6.x = (_local6.x + _local4.x);
_local6.y = (_local6.y + _local4.y);
return (_local6);
}
protected static function getDrawMatrix(_arg1:DisplayObject, _arg2:Rectangle, _arg3:Number):Matrix{
var _local4:Point;
var _local5:Matrix;
var _local6:Matrix = _arg1.root.transform.concatenatedMatrix;
_local4 = _arg1.localToGlobal(new Point());
_local5 = _arg1.transform.concatenatedMatrix;
_local5.tx = (_local4.x - _arg2.x);
_local5.ty = (_local4.y - _arg2.y);
_local5.a = (_local5.a / _local6.a);
_local5.d = (_local5.d / _local6.d);
if (_arg3 != 1){
_local5.scale(_arg3, _arg3);
};
return (_local5);
}
}
}//package
Section 19
//Game (Game)
package {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.media.*;
import flash.text.*;
import flash.ui.*;
public class Game extends MovieClip {
public var d_LevelUp:MovieClip;
public var d_ItemTips:MovieClip;
public var d_Music:MovieClip;
public var d_MoveContainer:MovieClip;
public var d_Menu:SimpleButton;
public var d_Pause:SimpleButton;
public var d_Time:TextField;
public var d_Player:Player;
public var d_PauseWindow:MovieClip;
public var d_ItemContainer:MovieClip;
public var d_Earth:MovieClip;
public var d_Score:TextField;
public var d_BuildingContainer:MovieClip;
public var d_Sound:MovieClip;
private var pause:Boolean;// = false
private var _life:int;
private var _time:int;
private var scoreTime:uint;
private var back:Boolean;
private var addMoveTime:uint;
private var modifySpeedTime:uint;
private var jumpTime:uint;
public static var AllScore:int = 0;
public function Game(){
this.stage.tabChildren = false;
this.stage.focus = this;
d_PauseWindow.visible = false;
d_PauseWindow.d_Pause.addEventListener(MouseEvent.CLICK, onPause);
d_Pause.addEventListener(MouseEvent.CLICK, onPause);
d_Menu.addEventListener(MouseEvent.CLICK, onExit);
d_Sound.addEventListener(MouseEvent.CLICK, onSound);
d_Sound.buttonMode = true;
d_Music.addEventListener(MouseEvent.CLICK, onMusic);
d_Music.buttonMode = true;
d_LevelUp.visible = false;
this.stage.addEventListener(MouseEvent.CLICK, onJump);
Score = 0;
Life = 20;
Time = 0;
scoreTime = 0;
SoundMixer.stopAll();
this.addEventListener(Event.ENTER_FRAME, onTick);
onPlay();
}
public function set Life(_arg1){
_life = _arg1;
d_Player.d_Hp.gotoAndStop((20 - _life));
}
public function get Life(){
return (_life);
}
public function set Score(_arg1){
Game.AllScore = _arg1;
d_Score.text = String(_arg1);
}
public function get Score(){
return (Game.AllScore);
}
public function set Time(_arg1){
_time = _arg1;
d_Time.text = String(Math.floor((_time / 20)));
}
public function get Time(){
return (_time);
}
private function onPause(_arg1){
pause = !(pause);
d_PauseWindow.visible = pause;
}
function onExit(_arg1){
this.clear();
Config.soundChannel = null;
MovieClip(parent).gotoAndPlay("start");
}
function onSound(_arg1){
var _local2:*;
if (d_Sound.currentFrame == 1){
d_Sound.gotoAndStop(2);
Config.SSound = false;
if (Config.soundChannel == null){
return;
};
Config.soundChannel.soundTransform = new SoundTransform(0);
} else {
d_Sound.gotoAndStop(1);
Config.SSound = true;
if (Config.soundChannel == null){
_local2 = new SBack();
Config.soundChannel = _local2.play(0, 100000);
};
Config.soundChannel.soundTransform = new SoundTransform(1);
};
}
function onMusic(_arg1){
if (d_Music.currentFrame == 1){
d_Music.gotoAndStop(2);
Config.SMusic = false;
} else {
d_Music.gotoAndStop(1);
Config.SMusic = true;
};
}
function levelUp(){
d_LevelUp.visible = true;
if (Config.SMusic){
if (Config.soundChannel != null){
Config.soundChannel.stop();
Config.soundChannel = null;
};
};
}
function gameOver(){
this.clear();
MovieClip(parent).gotoAndPlay("over");
Config.soundChannel = null;
}
function onPlay(_arg1=null){
var _local3:*;
var _local4:*;
if (((Config.SSound) && ((Config.soundChannel == null)))){
_local3 = new SBack();
Config.soundChannel = _local3.play(0, 100000);
};
d_LevelUp.visible = false;
while (d_MoveContainer.numChildren) {
d_MoveContainer.removeChildAt(0);
};
var _local2:* = 0;
while (_local2 < d_ItemContainer.numChildren) {
_local4 = d_ItemContainer.getChildAt(_local2);
_local4.hide();
_local2++;
};
d_MoveContainer.rotation = 0;
d_ItemContainer.rotation = 0;
d_BuildingContainer.rotation = 0;
addMoveTime = 180;
modifySpeedTime = 0;
d_ItemTips.visible = false;
back = false;
}
private function onTick(_arg1){
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:Boolean;
var _local11:*;
var _local12:*;
var _local13:*;
if (pause){
return;
};
if (((Input.isDown(Keyboard.SPACE)) || (Input.isDown(Keyboard.UP)))){
if (jumpTime < 30){
jumpTime++;
d_Player.jump();
};
} else {
jumpTime = 0;
};
Time++;
scoreTime++;
if (scoreTime >= 20){
Score++;
scoreTime = 0;
};
var _local2:Number = -1.3;
if (back){
d_Player.scaleX = -1;
_local2 = (_local2 * -1);
} else {
d_Player.scaleX = 1;
};
if (Input.isDown(Keyboard.LEFT)){
if (modifySpeedTime < 40){
modifySpeedTime++;
if (back){
_local2 = (_local2 * 1.8);
} else {
_local2 = (_local2 * 0.5);
};
};
} else {
if (Input.isDown(Keyboard.RIGHT)){
if (modifySpeedTime < 40){
modifySpeedTime++;
if (back){
_local2 = (_local2 * 0.5);
} else {
_local2 = (_local2 * 1.8);
};
};
} else {
modifySpeedTime = 0;
};
};
d_BuildingContainer.rotation = (d_BuildingContainer.rotation + _local2);
d_Earth.rotation = (d_Earth.rotation + _local2);
d_ItemContainer.rotation = (d_ItemContainer.rotation + _local2);
var _local3:* = 0;
while (_local3 < d_ItemContainer.numChildren) {
_local6 = d_ItemContainer.getChildAt(_local3);
_local6.onTick();
_local3++;
};
if (d_MoveContainer.numChildren < 3){
addMoveTime++;
if (addMoveTime > 600){
if (d_MoveContainer.numChildren == 0){
_local7 = new Car();
_local7.speed = 3;
} else {
if (d_MoveContainer.numChildren == 1){
_local7 = new Robot();
_local7.speed = 3.5;
} else {
if (d_MoveContainer.numChildren == 2){
_local7 = new Car();
_local7.speed = 4;
};
};
};
d_MoveContainer.addChild(_local7);
_local7.rotation = 180;
addMoveTime = 0;
};
};
_local3 = 0;
while (_local3 < d_MoveContainer.numChildren) {
_local8 = d_MoveContainer.getChildAt(_local3);
if (back){
_local8.rotation = (_local8.rotation + _local8.speed);
_local8.scaleX = 1;
} else {
_local8.rotation = (_local8.rotation - _local8.speed);
_local8.scaleX = -1;
};
_local3++;
};
var _local4:Boolean = FHitTest.complexHitTestObject(d_Player.d_Hit, d_MoveContainer);
var _local5:Boolean = FHitTest.complexHitTestObject(d_Player.d_Hit, d_BuildingContainer);
if (((_local4) || (_local5))){
if (((!(d_Player.isHit)) && (!(d_Player.isGlow)))){
if (Life == 1){
gameOver();
return;
};
Life--;
d_Player.hit();
if (Config.SMusic){
if (_local4){
_local10 = false;
_local3 = 0;
while (_local3 < d_MoveContainer.numChildren) {
_local11 = d_MoveContainer.getChildAt(_local3);
if (d_Player.d_Hit.hitTestObject(_local11)){
if ((_local11 is Robot)){
_local10 = true;
break;
};
};
_local3++;
};
if (_local10){
_local9 = new SRobot();
} else {
_local9 = new SCar();
};
} else {
_local9 = new SHit();
};
_local9.play();
};
};
};
_local3 = 0;
while (_local3 < d_ItemContainer.numChildren) {
_local12 = d_ItemContainer.getChildAt(_local3);
if (((!(_local12.isHide)) && (d_Player.d_Hit.hitTestObject(_local12)))){
_local12.hide();
if (_local12.currentFrame == 1){
Score = (Score + 100);
_local13 = new SItemScore();
} else {
if (_local12.currentFrame == 2){
d_Player.setGlow();
_local13 = new SItem_Invincible();
} else {
if (_local12.currentFrame == 3){
Score = (Score - 50);
_local13 = new SItem_Oil();
} else {
if (_local12.currentFrame == 4){
back = !(back);
_local13 = new SItem_TurnBack();
};
};
};
};
if (Config.SMusic){
_local13.play();
};
d_ItemTips.visible = true;
d_ItemTips.mc.gotoAndStop(_local12.currentFrame);
d_ItemTips.gotoAndPlay(2);
};
_local3++;
};
}
private function onJump(_arg1){
if (_arg1.stageY > 40){
d_Player.jump();
};
}
private function clear(){
this.removeEventListener(Event.ENTER_FRAME, onTick);
this.stage.removeEventListener(MouseEvent.CLICK, onJump);
}
private function getClass(_arg1:String):Class{
return ((this.root.loaderInfo.applicationDomain.getDefinition(_arg1) as Class));
}
public function disorder(_arg1:Array):Array{
var _local3:*;
var _local4:uint;
var _local2:uint = _arg1.length;
var _local5:uint;
while (_local5 < _local2) {
_local4 = int((Math.random() * _local2));
_local3 = _arg1[_local5];
_arg1[_local5] = _arg1[_local4];
_arg1[_local4] = _local3;
_local5++;
};
while (--_local5 >= 0) {
_local4 = int((Math.random() * _local2));
_local3 = _arg1[_local5];
_arg1[_local5] = _arg1[_local4];
_arg1[_local4] = _local3;
};
return (_arg1);
}
}
}//package
Section 20
//Input (Input)
package {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.text.*;
import flash.system.*;
public class Input {
public static var stage:Stage;
public static var mousePos:Point;
private static var _keysDown:Object;
public static function init(_arg1:Stage){
mousePos = new Point();
_arg1.addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler);
_keysDown = new Object();
_arg1.addEventListener(KeyboardEvent.KEY_DOWN, keyPressedHandler);
_arg1.addEventListener(KeyboardEvent.KEY_UP, keyReleasedHandler);
_arg1.addEventListener(FocusEvent.FOCUS_OUT, focusOutHandler);
}
public static function isDown(_arg1:uint):Boolean{
return (Boolean(_keysDown[_arg1]));
}
private static function mouseMoveHandler(_arg1:MouseEvent):void{
mousePos.x = _arg1.stageX;
mousePos.y = _arg1.stageY;
}
private static function focusOutHandler(_arg1:FocusEvent):void{
_keysDown = new Object();
}
private static function keyPressedHandler(_arg1:KeyboardEvent):void{
_keysDown[_arg1.keyCode] = true;
}
private static function keyReleasedHandler(_arg1:KeyboardEvent):void{
delete _keysDown[_arg1.keyCode];
}
public static function destroy():void{
if (stage == null){
return;
};
_keysDown = new Object();
stage.removeEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler);
stage.removeEventListener(KeyboardEvent.KEY_DOWN, keyPressedHandler);
stage.removeEventListener(KeyboardEvent.KEY_UP, keyReleasedHandler);
stage.removeEventListener(FocusEvent.FOCUS_OUT, focusOutHandler);
stage = null;
}
}
}//package
Section 21
//IntUtil (IntUtil)
package {
public class IntUtil {
private static var hexChars:String = "0123456789abcdef";
public static function rol(_arg1:int, _arg2:int):int{
return (((_arg1 << _arg2) | (_arg1 >>> (32 - _arg2))));
}
public static function ror(_arg1:int, _arg2:int):uint{
var _local3:int = (32 - _arg2);
return (((_arg1 << _local3) | (_arg1 >>> (32 - _local3))));
}
public static function toHex(_arg1:int, _arg2:Boolean=false):String{
var _local4:int;
var _local5:int;
var _local3 = "";
if (_arg2){
_local4 = 0;
while (_local4 < 4) {
_local3 = (_local3 + (hexChars.charAt(((_arg1 >> (((3 - _local4) * 8) + 4)) & 15)) + hexChars.charAt(((_arg1 >> ((3 - _local4) * 8)) & 15))));
_local4++;
};
} else {
_local5 = 0;
while (_local5 < 4) {
_local3 = (_local3 + (hexChars.charAt(((_arg1 >> ((_local5 * 8) + 4)) & 15)) + hexChars.charAt(((_arg1 >> (_local5 * 8)) & 15))));
_local5++;
};
};
return (_local3);
}
}
}//package
Section 22
//Item (Item)
package {
import flash.display.*;
public class Item extends MovieClip {
public var isHide:Boolean;
private var showTime:int;
public function Item(){
addFrameScript(0, frame1);
}
public function hide(){
this.visible = false;
isHide = true;
}
public function onTick(){
var _local1:*;
if (isHide){
if (Math.random() < 0.004){
showTime = 120;
this.visible = true;
isHide = false;
this.alpha = 1;
_local1 = Math.floor((Math.random() * 100));
if (_local1 > 35){
this.gotoAndStop(1);
} else {
if (_local1 > 20){
this.gotoAndStop(2);
} else {
if (_local1 > 10){
this.gotoAndStop(3);
} else {
this.gotoAndStop(4);
};
};
};
};
} else {
showTime--;
if ((((showTime < 10)) && ((showTime > 7)))){
this.alpha = 0;
} else {
if ((((showTime < 7)) && ((showTime > 3)))){
this.alpha = 1;
} else {
if (showTime < 3){
this.alpha = 0;
};
};
};
if (showTime <= 0){
hide();
};
};
}
function frame1(){
stop();
}
}
}//package
Section 23
//MD5 (MD5)
package {
public class MD5 {
public static function hash(_arg1:String):String{
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
var _local2 = 1732584193;
var _local3 = -271733879;
var _local4 = -1732584194;
var _local5 = 271733878;
var _local10:Array = createBlocks(_arg1);
var _local11:int = _local10.length;
var _local12:int;
while (_local12 < _local11) {
_local6 = _local2;
_local7 = _local3;
_local8 = _local4;
_local9 = _local5;
_local2 = ff(_local2, _local3, _local4, _local5, _local10[(_local12 + 0)], 7, -680876936);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[(_local12 + 1)], 12, -389564586);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[(_local12 + 2)], 17, 606105819);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[(_local12 + 3)], 22, -1044525330);
_local2 = ff(_local2, _local3, _local4, _local5, _local10[(_local12 + 4)], 7, -176418897);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[(_local12 + 5)], 12, 1200080426);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[(_local12 + 6)], 17, -1473231341);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[(_local12 + 7)], 22, -45705983);
_local2 = ff(_local2, _local3, _local4, _local5, _local10[(_local12 + 8)], 7, 1770035416);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[(_local12 + 9)], 12, -1958414417);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[(_local12 + 10)], 17, -42063);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[(_local12 + 11)], 22, -1990404162);
_local2 = ff(_local2, _local3, _local4, _local5, _local10[(_local12 + 12)], 7, 1804603682);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[(_local12 + 13)], 12, -40341101);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[(_local12 + 14)], 17, -1502002290);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[(_local12 + 15)], 22, 1236535329);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[(_local12 + 1)], 5, -165796510);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[(_local12 + 6)], 9, -1069501632);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[(_local12 + 11)], 14, 643717713);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[(_local12 + 0)], 20, -373897302);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[(_local12 + 5)], 5, -701558691);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[(_local12 + 10)], 9, 38016083);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[(_local12 + 15)], 14, -660478335);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[(_local12 + 4)], 20, -405537848);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[(_local12 + 9)], 5, 568446438);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[(_local12 + 14)], 9, -1019803690);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[(_local12 + 3)], 14, -187363961);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[(_local12 + 8)], 20, 1163531501);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[(_local12 + 13)], 5, -1444681467);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[(_local12 + 2)], 9, -51403784);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[(_local12 + 7)], 14, 1735328473);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[(_local12 + 12)], 20, -1926607734);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[(_local12 + 5)], 4, -378558);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[(_local12 + 8)], 11, -2022574463);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[(_local12 + 11)], 16, 1839030562);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[(_local12 + 14)], 23, -35309556);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[(_local12 + 1)], 4, -1530992060);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[(_local12 + 4)], 11, 1272893353);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[(_local12 + 7)], 16, -155497632);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[(_local12 + 10)], 23, -1094730640);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[(_local12 + 13)], 4, 681279174);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[(_local12 + 0)], 11, -358537222);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[(_local12 + 3)], 16, -722521979);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[(_local12 + 6)], 23, 76029189);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[(_local12 + 9)], 4, -640364487);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[(_local12 + 12)], 11, -421815835);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[(_local12 + 15)], 16, 530742520);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[(_local12 + 2)], 23, -995338651);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[(_local12 + 0)], 6, -198630844);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[(_local12 + 7)], 10, 1126891415);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[(_local12 + 14)], 15, -1416354905);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[(_local12 + 5)], 21, -57434055);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[(_local12 + 12)], 6, 1700485571);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[(_local12 + 3)], 10, -1894986606);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[(_local12 + 10)], 15, -1051523);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[(_local12 + 1)], 21, -2054922799);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[(_local12 + 8)], 6, 1873313359);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[(_local12 + 15)], 10, -30611744);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[(_local12 + 6)], 15, -1560198380);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[(_local12 + 13)], 21, 1309151649);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[(_local12 + 4)], 6, -145523070);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[(_local12 + 11)], 10, -1120210379);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[(_local12 + 2)], 15, 718787259);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[(_local12 + 9)], 21, -343485551);
_local2 = (_local2 + _local6);
_local3 = (_local3 + _local7);
_local4 = (_local4 + _local8);
_local5 = (_local5 + _local9);
_local12 = (_local12 + 16);
};
return ((((IntUtil.toHex(_local2) + IntUtil.toHex(_local3)) + IntUtil.toHex(_local4)) + IntUtil.toHex(_local5)));
}
private static function f(_arg1:int, _arg2:int, _arg3:int):int{
return (((_arg1 & _arg2) | (~(_arg1) & _arg3)));
}
private static function g(_arg1:int, _arg2:int, _arg3:int):int{
return (((_arg1 & _arg3) | (_arg2 & ~(_arg3))));
}
private static function h(_arg1:int, _arg2:int, _arg3:int):int{
return (((_arg1 ^ _arg2) ^ _arg3));
}
private static function i(_arg1:int, _arg2:int, _arg3:int):int{
return ((_arg2 ^ (_arg1 | ~(_arg3))));
}
private static function transform(_arg1:Function, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int, _arg8:int):int{
var _local9:int = (((_arg2 + int(_arg1(_arg3, _arg4, _arg5))) + _arg6) + _arg8);
return ((IntUtil.rol(_local9, _arg7) + _arg3));
}
private static function ff(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{
return (transform(f, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7));
}
private static function gg(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{
return (transform(g, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7));
}
private static function hh(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{
return (transform(h, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7));
}
private static function ii(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{
return (transform(i, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7));
}
private static function createBlocks(_arg1:String):Array{
var _local2:Array = new Array();
var _local3:int = (_arg1.length * 8);
var _local4 = 0xFF;
var _local5:int;
while (_local5 < _local3) {
_local2[(_local5 >> 5)] = (_local2[(_local5 >> 5)] | ((_arg1.charCodeAt((_local5 / 8)) & _local4) << (_local5 % 32)));
_local5 = (_local5 + 8);
};
_local2[(_local3 >> 5)] = (_local2[(_local3 >> 5)] | (128 << (_local3 % 32)));
_local2[((((_local3 + 64) >>> 9) << 4) + 14)] = _local3;
return (_local2);
}
}
}//package
Section 24
//Player (Player)
package {
import flash.display.*;
import flash.events.*;
public class Player extends MovieClip {
public var d_Hp:MovieClip;
public var d_Hit:MovieClip;
public var d_Glow:MovieClip;
public var d_Sheep:MovieClip;
public var isJump:Boolean;
private var _speed:Number;
private var _gravity:Number;// = 2.5
public var isGlow:Boolean;
private var _glowTime:int;
private var baseY:int;
public function Player(){
d_Glow.visible = false;
isJump = false;
isGlow = false;
this.buttonMode = true;
d_Hit.alpha = 0;
baseY = this.y;
}
public function get isHit(){
return ((d_Sheep.currentLabel == "hit"));
}
public function setGlow(){
_glowTime = 200;
this.addEventListener(Event.ENTER_FRAME, onGlowTime);
isGlow = true;
d_Glow.visible = true;
}
private function onGlowTime(_arg1){
_glowTime--;
if (_glowTime <= 0){
isGlow = false;
d_Glow.visible = false;
this.removeEventListener(Event.ENTER_FRAME, onGlowTime);
};
}
public function jump(){
var _local1:* = (baseY - this.y);
if ((((_local1 > 2)) && ((_local1 < 30)))){
isJump = false;
this.removeEventListener(Event.ENTER_FRAME, onJumpTime);
};
if (isJump){
return;
};
isJump = true;
_speed = -18;
d_Sheep.gotoAndStop("jump");
this.addEventListener(Event.ENTER_FRAME, onJumpTime);
}
private function onJumpTime(_arg1){
this.y = (this.y + _speed);
_speed = (_speed + _gravity);
if (this.y > baseY){
if (!isHit){
d_Sheep.gotoAndStop("walk");
};
isJump = false;
this.y = baseY;
this.removeEventListener(Event.ENTER_FRAME, onJumpTime);
};
}
public function hit(){
d_Sheep.gotoAndStop("hit");
}
}
}//package
Section 25
//Robot (Robot)
package {
import flash.display.*;
public class Robot extends MovieClip {
public var speed:uint;
}
}//package
Section 26
//SBack (SBack)
package {
import flash.media.*;
public dynamic class SBack extends Sound {
}
}//package
Section 27
//SCar (SCar)
package {
import flash.media.*;
public dynamic class SCar extends Sound {
}
}//package
Section 28
//SHit (SHit)
package {
import flash.media.*;
public dynamic class SHit extends Sound {
}
}//package
Section 29
//SItem_Invincible (SItem_Invincible)
package {
import flash.media.*;
public dynamic class SItem_Invincible extends Sound {
}
}//package
Section 30
//SItem_Oil (SItem_Oil)
package {
import flash.media.*;
public dynamic class SItem_Oil extends Sound {
}
}//package
Section 31
//SItem_TurnBack (SItem_TurnBack)
package {
import flash.media.*;
public dynamic class SItem_TurnBack extends Sound {
}
}//package
Section 32
//SItemScore (SItemScore)
package {
import flash.media.*;
public dynamic class SItemScore extends Sound {
}
}//package
Section 33
//SOver (SOver)
package {
import flash.media.*;
public dynamic class SOver extends Sound {
}
}//package
Section 34
//SRobot (SRobot)
package {
import flash.media.*;
public dynamic class SRobot extends Sound {
}
}//package
Section 35
//SStart (SStart)
package {
import flash.media.*;
public dynamic class SStart extends Sound {
}
}//package