Section 1
//mc_bomb_attack_2_131 (_02_Ongs_tipiSave_IBRAVO_fla.mc_bomb_attack_2_131)
package _02_Ongs_tipiSave_IBRAVO_fla {
import flash.display.*;
public dynamic class mc_bomb_attack_2_131 extends MovieClip {
}
}//package _02_Ongs_tipiSave_IBRAVO_fla
Section 2
//button147_17 (_fla.button147_17)
package _fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.net.*;
import flash.text.*;
import flash.system.*;
import flash.geom.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class button147_17 extends MovieClip {
public function button147_17(){
addFrameScript(29, frame30);
}
function frame30(){
stop();
}
}
}//package _fla
Section 3
//button151_25 (_fla.button151_25)
package _fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.net.*;
import flash.text.*;
import flash.system.*;
import flash.geom.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class button151_25 extends MovieClip {
public function button151_25(){
addFrameScript(39, frame40);
}
function frame40(){
stop();
}
}
}//package _fla
Section 4
//cnfreeadcom_1_1_6277_1 (_fla.cnfreeadcom_1_1_6277_1)
package _fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.net.*;
import flash.text.*;
import flash.system.*;
import flash.geom.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class cnfreeadcom_1_1_6277_1 extends MovieClip {
public var btn:SimpleButton;
public function cnfreeadcom_1_1_6277_1(){
addFrameScript(0, frame1);
}
public function onClick(_arg1:MouseEvent):void{
var _local2:URLRequest = new URLRequest(" http://www.playcow.com");
navigateToURL(_local2);
}
function frame1(){
btn.addEventListener(MouseEvent.CLICK, onClick);
}
}
}//package _fla
Section 5
//cnfreeadcom_1_8_71076_27 (_fla.cnfreeadcom_1_8_71076_27)
package _fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.net.*;
import flash.text.*;
import flash.system.*;
import flash.geom.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class cnfreeadcom_1_8_71076_27 extends MovieClip {
public function cnfreeadcom_1_8_71076_27(){
addFrameScript(19, frame20);
}
function frame20(){
stop();
}
}
}//package _fla
Section 6
//F_btn_23 (_fla.F_btn_23)
package _fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.net.*;
import flash.text.*;
import flash.system.*;
import flash.geom.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class F_btn_23 extends MovieClip {
public var btn:SimpleButton;
public function F_btn_23(){
addFrameScript(0, frame1);
}
public function onClick(_arg1:MouseEvent):void{
var _local2:URLRequest = new URLRequest("http://www.facebook.com/pages/PlayCow/126005204300");
navigateToURL(_local2);
}
function frame1(){
btn.addEventListener(MouseEvent.CLICK, onClick);
}
}
}//package _fla
Section 7
//Timeline_12 (_fla.Timeline_12)
package _fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.net.*;
import flash.text.*;
import flash.system.*;
import flash.geom.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class Timeline_12 extends MovieClip {
public function Timeline_12(){
addFrameScript(14, frame15);
}
function frame15(){
stop();
}
}
}//package _fla
Section 8
//Timeline_126 (_fla.Timeline_126)
package _fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.net.*;
import flash.text.*;
import flash.system.*;
import flash.geom.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class Timeline_126 extends MovieClip {
public var btn:SimpleButton;
public function Timeline_126(){
addFrameScript(0, frame1);
}
public function onClick(_arg1:MouseEvent):void{
var _local2:URLRequest = new URLRequest("http://www.playcow.com/?utm_source=game&utm_medium=s&utm_campaign=SuperMarioFruits");
navigateToURL(_local2);
}
function frame1(){
btn.addEventListener(MouseEvent.CLICK, onClick);
}
}
}//package _fla
Section 9
//Timeline_19 (_fla.Timeline_19)
package _fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.net.*;
import flash.text.*;
import flash.system.*;
import flash.geom.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class Timeline_19 extends MovieClip {
public var btn:SimpleButton;
public function Timeline_19(){
addFrameScript(25, frame26);
}
public function onClick(_arg1:MouseEvent):void{
var _local2:URLRequest = new URLRequest(" http://www.playcow.com");
navigateToURL(_local2);
}
function frame26(){
stop();
btn.addEventListener(MouseEvent.CLICK, onClick);
}
}
}//package _fla
Section 10
//Timeline_246 (_fla.Timeline_246)
package _fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.net.*;
import flash.text.*;
import flash.system.*;
import flash.geom.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class Timeline_246 extends MovieClip {
public var btn:SimpleButton;
public function Timeline_246(){
addFrameScript(0, frame1);
}
public function onClick(_arg1:MouseEvent):void{
var _local2:URLRequest = new URLRequest("http://www.playcow.com/?utm_source=game&utm_medium=s&utm_campaign=SuperMarioFruits");
navigateToURL(_local2);
}
function frame1(){
btn.addEventListener(MouseEvent.CLICK, onClick);
}
}
}//package _fla
Section 11
//Timeline_96 (_fla.Timeline_96)
package _fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.net.*;
import flash.text.*;
import flash.system.*;
import flash.geom.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class Timeline_96 extends MovieClip {
public var btn:SimpleButton;
public function Timeline_96(){
addFrameScript(0, frame1);
}
public function onClick(_arg1:MouseEvent):void{
var _local2:URLRequest = new URLRequest("http://www.playcow.com/?utm_source=game&utm_medium=s&utm_campaign=SuperMarioFruits");
navigateToURL(_local2);
}
function frame1(){
btn.addEventListener(MouseEvent.CLICK, onClick);
}
}
}//package _fla
Section 12
//MochiCoins (mochi.as3.MochiCoins)
package mochi.as3 {
public class MochiCoins {
public static const STORE_SHOW:String = "StoreShow";
public static const STORE_HIDE:String = "StoreHide";
public static const ITEM_OWNED:String = "ItemOwned";
public static const ITEM_NEW:String = "ItemNew";
public static const STORE_ITEMS:String = "StoreItems";
public static const ERROR:String = "Error";
public static const IO_ERROR:String = "IOError";
public static const NO_USER:String = "NoUser";
public static var _inventory:MochiInventory;
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public static function get inventory():MochiInventory{
return (_inventory);
}
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function showStore(_arg1:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("coins_showStore", {options:_arg1}, null, null);
}
public static function showItem(_arg1:Object=null):void{
if (((!(_arg1)) || (!((typeof(_arg1.item) == "string"))))){
trace("ERROR: showItem call must pass an Object with an item key");
return;
};
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("coins_showItem", {options:_arg1}, null, null);
}
public static function showVideo(_arg1:Object=null):void{
if (((!(_arg1)) || (!((typeof(_arg1.item) == "string"))))){
trace("ERROR: showVideo call must pass an Object with an item key");
return;
};
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("coins_showVideo", {options:_arg1}, null, null);
}
public static function getStoreItems():void{
MochiServices.send("coins_getStoreItems");
}
public static function requestFunding(_arg1:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("social_requestFunding", _arg1);
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
addEventListener(MochiSocial.LOGGED_IN, function (_arg1:Object):void{
_inventory = new MochiInventory();
});
addEventListener(MochiSocial.LOGGED_OUT, function (_arg1:Object):void{
_inventory = null;
});
}
}//package mochi.as3
Section 13
//MochiDigits (mochi.as3.MochiDigits)
package mochi.as3 {
public final class MochiDigits {
private var Fragment:Number;
private var Sibling:MochiDigits;
private var Encoder:Number;
public function MochiDigits(_arg1:Number=0, _arg2:uint=0):void{
Encoder = 0;
setValue(_arg1, _arg2);
}
public function get value():Number{
return (Number(this.toString()));
}
public function set value(_arg1:Number):void{
setValue(_arg1);
}
public function addValue(_arg1:Number):void{
value = (value + _arg1);
}
public function setValue(_arg1:Number=0, _arg2:uint=0):void{
var _local3:String = _arg1.toString();
var _temp1 = _arg2;
_arg2 = (_arg2 + 1);
Fragment = (_local3.charCodeAt(_temp1) ^ Encoder);
if (_arg2 < _local3.length){
Sibling = new MochiDigits(_arg1, _arg2);
} else {
Sibling = null;
};
reencode();
}
public function reencode():void{
var _local1:uint = int((2147483647 * Math.random()));
Fragment = (Fragment ^ (_local1 ^ Encoder));
Encoder = _local1;
}
public function toString():String{
var _local1:String = String.fromCharCode((Fragment ^ Encoder));
if (Sibling != null){
_local1 = (_local1 + Sibling.toString());
};
return (_local1);
}
}
}//package mochi.as3
Section 14
//MochiEventDispatcher (mochi.as3.MochiEventDispatcher)
package mochi.as3 {
public class MochiEventDispatcher {
private var eventTable:Object;
public function MochiEventDispatcher():void{
eventTable = {};
}
public function addEventListener(_arg1:String, _arg2:Function):void{
removeEventListener(_arg1, _arg2);
eventTable[_arg1].push(_arg2);
}
public function removeEventListener(_arg1:String, _arg2:Function):void{
var _local3:Object;
if (eventTable[_arg1] == undefined){
eventTable[_arg1] = [];
return;
};
for (_local3 in eventTable[_arg1]) {
if (eventTable[_arg1][_local3] != _arg2){
} else {
eventTable[_arg1].splice(Number(_local3), 1);
};
};
}
public function triggerEvent(_arg1:String, _arg2:Object):void{
var _local3:Object;
if (eventTable[_arg1] == undefined){
return;
};
for (_local3 in eventTable[_arg1]) {
var _local6 = eventTable[_arg1];
_local6[_local3](_arg2);
};
}
}
}//package mochi.as3
Section 15
//MochiEvents (mochi.as3.MochiEvents)
package mochi.as3 {
public class MochiEvents {
public static const ACHIEVEMENTS_OWNED:String = "AchievementOwned";
public static const ACHIEVEMENT_NEW:String = "AchievementReceived";
public static const GAME_ACHIEVEMENTS:String = "GameAchievements";
public static const ERROR:String = "Error";
public static const IO_ERROR:String = "IOError";
public static const IO_PENDING:String = "IOPending";
public static const ALIGN_TOP_LEFT:String = "ALIGN_TL";
public static const ALIGN_TOP:String = "ALIGN_T";
public static const ALIGN_TOP_RIGHT:String = "ALIGN_TR";
public static const ALIGN_LEFT:String = "ALIGN_L";
public static const ALIGN_CENTER:String = "ALIGN_C";
public static const ALIGN_RIGHT:String = "ALIGN_R";
public static const ALIGN_BOTTOM_LEFT:String = "ALIGN_BL";
public static const ALIGN_BOTTOM:String = "ALIGN_B";
public static const ALIGN_BOTTOM_RIGHT:String = "ALIGN_BR";
public static const FORMAT_SHORT:String = "ShortForm";
public static const FORMAT_LONG:String = "LongForm";
public static const FORMAT_NONE:String = "NoForm";
private static var gameStart:Number;
private static var levelStart:Number;
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function getAchievements(_arg1:Object=null):void{
MochiServices.send("events_getAchievements", _arg1);
}
public static function unlockAchievement(_arg1:Object):void{
MochiServices.send("events_unlockAchievement", _arg1);
}
public static function startSession(_arg1:String):void{
MochiServices.send("events_beginSession", {achievementID:_arg1}, null, null);
}
public static function showAwards(_arg1:Object=null):void{
MochiServices.setContainer();
MochiServices.stayOnTop();
MochiServices.send("events_showAwards", _arg1);
}
public static function setNotifications(_arg1:Object):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("events_setNotifications", _arg1, null, null);
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
public static function startPlay(_arg1:String="gameplay"):void{
MochiServices.send("events_setRoundID", {tag:String(_arg1)}, null, null);
}
public static function endPlay():void{
MochiServices.send("events_clearRoundID", null, null, null);
}
public static function trackEvent(_arg1:String, _arg2=null):void{
MochiServices.send("events_trackEvent", {tag:_arg1, value:_arg2}, null, null);
}
}
}//package mochi.as3
Section 16
//MochiInventory (mochi.as3.MochiInventory)
package mochi.as3 {
import flash.events.*;
import flash.utils.*;
public dynamic class MochiInventory extends Proxy {
private var _timer:Timer;
private var _consumableProperties:Object;
private var _syncPending:Boolean;
private var _outstandingID:Number;
private var _syncID:Number;
private var _names:Array;
private var _storeSync:Object;
private static const CONSUMER_KEY:String = "MochiConsumables";
private static const KEY_SALT:String = " syncMaint";
public static const READY:String = "InvReady";
public static const WRITTEN:String = "InvWritten";
public static const ERROR:String = "Error";
public static const IO_ERROR:String = "IoError";
public static const VALUE_ERROR:String = "InvValueError";
public static const NOT_READY:String = "InvNotReady";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public function MochiInventory():void{
MochiCoins.addEventListener(MochiCoins.ITEM_OWNED, itemOwned);
MochiCoins.addEventListener(MochiCoins.ITEM_NEW, newItems);
MochiSocial.addEventListener(MochiSocial.LOGGED_IN, loggedIn);
MochiSocial.addEventListener(MochiSocial.LOGGED_OUT, loggedOut);
_storeSync = new Object();
_syncPending = false;
_outstandingID = 0;
_syncID = 0;
_timer = new Timer(1000);
_timer.addEventListener(TimerEvent.TIMER, sync);
_timer.start();
if (MochiSocial.loggedIn){
loggedIn();
} else {
loggedOut();
};
}
public function release():void{
MochiCoins.removeEventListener(MochiCoins.ITEM_NEW, newItems);
MochiSocial.removeEventListener(MochiSocial.LOGGED_IN, loggedIn);
MochiSocial.removeEventListener(MochiSocial.LOGGED_OUT, loggedOut);
}
private function loggedOut(_arg1:Object=null):void{
_consumableProperties = null;
}
private function loggedIn(_arg1:Object=null):void{
MochiUserData.get(CONSUMER_KEY, getConsumableBag);
}
private function newItems(_arg1:Object):void{
if (!this[(_arg1.id + KEY_SALT)]){
this[(_arg1.id + KEY_SALT)] = 0;
};
if (!this[_arg1.id]){
this[_arg1.id] = 0;
};
this[(_arg1.id + KEY_SALT)] = (this[(_arg1.id + KEY_SALT)] + _arg1.count);
this[_arg1.id] = (this[_arg1.id] + _arg1.count);
if (((_arg1.privateProperties) && (_arg1.privateProperties.consumable))){
if (!this[_arg1.privateProperties.tag]){
this[_arg1.privateProperties.tag] = 0;
};
this[_arg1.privateProperties.tag] = (this[_arg1.privateProperties.tag] + (_arg1.privateProperties.inc * _arg1.count));
};
}
private function itemOwned(_arg1:Object):void{
_storeSync[_arg1.id] = {properties:_arg1.properties, count:_arg1.count};
}
private function getConsumableBag(_arg1:MochiUserData):void{
var _local2:String;
var _local3:Number;
if (_arg1.error){
triggerEvent(ERROR, {type:IO_ERROR, error:_arg1.error});
return;
};
_consumableProperties = {};
_names = new Array();
if (_arg1.data){
for (_local2 in _arg1.data) {
_names.push(_local2);
_consumableProperties[_local2] = new MochiDigits(_arg1.data[_local2]);
};
};
for (_local2 in _storeSync) {
_local3 = _storeSync[_local2].count;
if (_consumableProperties[(_local2 + KEY_SALT)]){
_local3 = (_local3 - _consumableProperties[(_local2 + KEY_SALT)].value);
};
if (_local3 == 0){
} else {
newItems({id:_local2, count:_local3, properties:_storeSync[_local2].properties});
};
};
triggerEvent(READY, {});
}
private function putConsumableBag(_arg1:MochiUserData):void{
_syncPending = false;
if (_arg1.error){
triggerEvent(ERROR, {type:IO_ERROR, error:_arg1.error});
_outstandingID = -1;
};
triggerEvent(WRITTEN, {});
}
private function sync(_arg1:Event=null):void{
var _local3:String;
if (((_syncPending) || ((_syncID == _outstandingID)))){
return;
};
_outstandingID = _syncID;
var _local2:Object = {};
for (_local3 in _consumableProperties) {
_local2[_local3] = MochiDigits(_consumableProperties[_local3]).value;
};
MochiUserData.put(CONSUMER_KEY, _local2, putConsumableBag);
_syncPending = true;
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function getProperty(_arg1){
if (_consumableProperties == null){
triggerEvent(ERROR, {type:NOT_READY});
return (-1);
};
if (_consumableProperties[_arg1]){
return (MochiDigits(_consumableProperties[_arg1]).value);
};
return (undefined);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function deleteProperty(_arg1):Boolean{
if (!_consumableProperties[_arg1]){
return (false);
};
_names.splice(_names.indexOf(_arg1), 1);
delete _consumableProperties[_arg1];
return (true);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function hasProperty(_arg1):Boolean{
if (_consumableProperties == null){
triggerEvent(ERROR, {type:NOT_READY});
return (false);
};
if (_consumableProperties[_arg1] == undefined){
return (false);
};
return (true);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function setProperty(_arg1, _arg2):void{
var _local3:MochiDigits;
if (_consumableProperties == null){
triggerEvent(ERROR, {type:NOT_READY});
return;
};
if (!(_arg2 is Number)){
triggerEvent(ERROR, {type:VALUE_ERROR, error:"Invalid type", arg:_arg2});
return;
};
if (_consumableProperties[_arg1]){
_local3 = MochiDigits(_consumableProperties[_arg1]);
if (_local3.value == _arg2){
return;
};
_local3.value = _arg2;
} else {
_names.push(_arg1);
_consumableProperties[_arg1] = new MochiDigits(_arg2);
};
_syncID++;
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function nextNameIndex(_arg1:int):int{
return (((_arg1)>=_names.length) ? 0 : (_arg1 + 1));
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function nextName(_arg1:int):String{
return (_names[(_arg1 - 1)]);
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
}
}//package mochi.as3
Section 17
//MochiScores (mochi.as3.MochiScores)
package mochi.as3 {
import flash.display.*;
import flash.text.*;
public class MochiScores {
public static var onCloseHandler:Object;
public static var onErrorHandler:Object;
private static var boardID:String;
public static function onClose(_arg1:Object=null):void{
if (((((_arg1) && ((_arg1.error == true)))) && (onErrorHandler))){
if (_arg1.errorCode == null){
_arg1.errorCode = "IOError";
};
onErrorHandler(_arg1.errorCode);
MochiServices.doClose();
return;
};
onCloseHandler();
MochiServices.doClose();
}
public static function setBoardID(_arg1:String):void{
MochiServices.warnID(_arg1, true);
MochiScores.boardID = _arg1;
MochiServices.send("scores_setBoardID", {boardID:_arg1});
}
public static function showLeaderboard(_arg1:Object=null):void{
var n:Number;
var options = _arg1;
if (options != null){
delete options.clip;
MochiServices.setContainer();
MochiServices.bringToTop();
if (options.name != null){
if ((options.name is TextField)){
if (options.name.text.length > 0){
options.name = options.name.text;
};
};
};
if (options.score != null){
if ((options.score is TextField)){
if (options.score.text.length > 0){
options.score = options.score.text;
};
} else {
if ((options.score is MochiDigits)){
options.score = options.score.value;
};
};
n = Number(options.score);
if (isNaN(n)){
trace((("ERROR: Submitted score '" + options.score) + "' will be rejected, score is 'Not a Number'"));
} else {
if ((((n == Number.NEGATIVE_INFINITY)) || ((n == Number.POSITIVE_INFINITY)))){
trace((("ERROR: Submitted score '" + options.score) + "' will be rejected, score is an infinite"));
} else {
if (Math.floor(n) != n){
trace((("WARNING: Submitted score '" + options.score) + "' will be truncated"));
};
options.score = n;
};
};
};
if (options.onDisplay != null){
options.onDisplay();
} else {
if (MochiServices.clip != null){
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.stop();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onDisplay.");
};
};
};
} else {
options = {};
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.stop();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onDisplay.");
};
};
if (options.onClose != null){
onCloseHandler = options.onClose;
} else {
onCloseHandler = function ():void{
if ((MochiServices.clip is MovieClip)){
} else {
trace("Warning: Container is not a MovieClip, cannot call default onClose.");
};
};
};
if (options.onError != null){
onErrorHandler = options.onError;
} else {
onErrorHandler = null;
};
if (options.boardID == null){
if (MochiScores.boardID != null){
options.boardID = MochiScores.boardID;
};
};
MochiServices.warnID(options.boardID, true);
trace("[MochiScores] NOTE: Security Sandbox Violation errors below are normal");
MochiServices.send("scores_showLeaderboard", {options:options}, null, onClose);
}
public static function closeLeaderboard():void{
MochiServices.send("scores_closeLeaderboard");
}
public static function getPlayerInfo(_arg1:Object, _arg2:Object=null):void{
MochiServices.send("scores_getPlayerInfo", null, _arg1, _arg2);
}
public static function submit(_arg1:Number, _arg2:String, _arg3:Object=null, _arg4:Object=null):void{
_arg1 = Number(_arg1);
if (isNaN(_arg1)){
trace((("ERROR: Submitted score '" + String(_arg1)) + "' will be rejected, score is 'Not a Number'"));
} else {
if ((((_arg1 == Number.NEGATIVE_INFINITY)) || ((_arg1 == Number.POSITIVE_INFINITY)))){
trace((("ERROR: Submitted score '" + String(_arg1)) + "' will be rejected, score is an infinite"));
} else {
if (Math.floor(_arg1) != _arg1){
trace((("WARNING: Submitted score '" + String(_arg1)) + "' will be truncated"));
};
_arg1 = Number(_arg1);
};
};
MochiServices.send("scores_submit", {score:_arg1, name:_arg2}, _arg3, _arg4);
}
public static function requestList(_arg1:Object, _arg2:Object=null):void{
MochiServices.send("scores_requestList", null, _arg1, _arg2);
}
public static function scoresArrayToObjects(_arg1:Object):Object{
var _local3:Number;
var _local4:Number;
var _local5:Object;
var _local6:Object;
var _local7:String;
var _local8:String;
var _local2:Object = {};
for (_local7 in _arg1) {
if (typeof(_arg1[_local7]) == "object"){
if (((!((_arg1[_local7].cols == null))) && (!((_arg1[_local7].rows == null))))){
_local2[_local7] = [];
_local5 = _arg1[_local7];
_local4 = 0;
while (_local4 < _local5.rows.length) {
_local6 = {};
_local3 = 0;
while (_local3 < _local5.cols.length) {
_local6[_local5.cols[_local3]] = _local5.rows[_local4][_local3];
_local3++;
};
_local2[_local7].push(_local6);
_local4++;
};
} else {
_local2[_local7] = {};
for (_local8 in _arg1[_local7]) {
_local2[_local7][_local8] = _arg1[_local7][_local8];
};
};
} else {
_local2[_local7] = _arg1[_local7];
};
};
return (_local2);
}
}
}//package mochi.as3
Section 18
//MochiServices (mochi.as3.MochiServices)
package mochi.as3 {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
import flash.geom.*;
public class MochiServices {
public static const CONNECTED:String = "onConnected";
private static var _id:String;
private static var _container:Object;
private static var _clip:MovieClip;
private static var _loader:Loader;
private static var _timer:Timer;
private static var _preserved:Object;
private static var _servURL:String = "http://www.mochiads.com/static/lib/services/";
private static var _services:String = "services.swf";
private static var _mochiLC:String = "MochiLC.swf";
private static var _swfVersion:String;
private static var _listenChannelName:String = "__ms_";
private static var _sendChannel:LocalConnection;
private static var _sendChannelName:String;
private static var _connecting:Boolean = false;
private static var _connected:Boolean = false;
public static var netup:Boolean = true;
public static var netupAttempted:Boolean = false;
public static var onError:Object;
public static var widget:Boolean = false;
private static var _mochiLocalConnection:MovieClip;
private static var _queue:Array;
private static var _nextCallbackID:Number;
private static var _callbacks:Object;
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public static function get id():String{
return (_id);
}
public static function get clip():Object{
return (_container);
}
public static function get childClip():Object{
return (_clip);
}
public static function getVersion():String{
return ("3.9.3 as3");
}
public static function allowDomains(_arg1:String):String{
var _local2:String;
if (Security.sandboxType != "application"){
Security.allowDomain("*");
Security.allowInsecureDomain("*");
};
if (_arg1.indexOf("http://") != -1){
_local2 = _arg1.split("/")[2].split(":")[0];
if (Security.sandboxType != "application"){
Security.allowDomain(_local2);
Security.allowInsecureDomain(_local2);
};
};
return (_local2);
}
public static function isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function set comChannelName(_arg1:String):void{
if (_arg1 != null){
if (_arg1.length > 3){
_sendChannelName = (_arg1 + "_fromgame");
initComChannels();
};
};
}
public static function get connected():Boolean{
return (_connected);
}
public static function warnID(_arg1:String, _arg2:Boolean):void{
_arg1 = _arg1.toLowerCase();
if (_arg1.length != 16){
trace((("WARNING: " + (_arg2) ? "board" : "game") + " ID is not the appropriate length"));
return;
} else {
if (_arg1 == "1e113c7239048b3f"){
if (_arg2){
trace("WARNING: Using testing board ID");
} else {
trace("WARNING: Using testing board ID as game ID");
};
return;
} else {
if (_arg1 == "84993a1de4031cd8"){
if (_arg2){
trace("WARNING: Using testing game ID as board ID");
} else {
trace("WARNING: Using testing game ID");
};
return;
};
};
};
var _local3:Number = 0;
while (_local3 < _arg1.length) {
switch (_arg1.charAt(_local3)){
case "0":
case "1":
case "2":
case "3":
case "4":
case "5":
case "6":
case "7":
case "8":
case "9":
case "a":
case "b":
case "c":
case "d":
case "e":
case "f":
break;
default:
trace(("WARNING: Board ID contains illegal characters: " + _arg1));
return;
};
_local3++;
};
}
public static function connect(_arg1:String, _arg2:Object, _arg3:Object=null):void{
var id = _arg1;
var clip = _arg2;
var onError = _arg3;
warnID(id, false);
if ((clip is DisplayObject)){
if (clip.stage == null){
trace("MochiServices connect requires the containing clip be attached to the stage");
};
if (((!(_connected)) && ((_clip == null)))){
trace("MochiServices Connecting...");
_connecting = true;
init(id, clip);
};
} else {
trace("Error, MochiServices requires a Sprite, Movieclip or instance of the stage.");
};
if (onError != null){
MochiServices.onError = onError;
} else {
if (MochiServices.onError == null){
MochiServices.onError = function (_arg1:String):void{
trace(_arg1);
};
};
};
}
public static function disconnect():void{
if (((_connected) || (_connecting))){
if (_clip != null){
if (_clip.parent != null){
if ((_clip.parent is Sprite)){
Sprite(_clip.parent).removeChild(_clip);
_clip = null;
};
};
};
_connecting = (_connected = false);
flush(true);
try {
_mochiLocalConnection.close();
} catch(error:Error) {
};
};
if (_timer != null){
try {
_timer.stop();
_timer.removeEventListener(TimerEvent.TIMER, connectWait);
_timer = null;
} catch(error:Error) {
};
};
}
public static function stayOnTop():void{
_container.addEventListener(Event.ENTER_FRAME, MochiServices.bringToTop, false, 0, true);
if (_clip != null){
_clip.visible = true;
};
}
public static function doClose():void{
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
}
public static function bringToTop(_arg1:Event=null):void{
var e = _arg1;
if (((!((MochiServices.clip == null))) && (!((MochiServices.childClip == null))))){
try {
if (MochiServices.clip.numChildren > 1){
MochiServices.clip.setChildIndex(MochiServices.childClip, (MochiServices.clip.numChildren - 1));
};
} catch(errorObject:Error) {
trace("Warning: Depth sort error.");
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
};
};
}
private static function init(_arg1:String, _arg2:Object):void{
_id = _arg1;
if (_arg2 != null){
_container = _arg2;
loadCommunicator(_arg1, _container);
};
}
public static function setContainer(_arg1:Object=null, _arg2:Boolean=true):void{
if (_clip.parent){
_clip.parent.removeChild(_clip);
};
if (_arg1 != null){
if ((_arg1 is DisplayObjectContainer)){
_container = _arg1;
};
};
if (_arg2){
if ((_container is DisplayObjectContainer)){
DisplayObjectContainer(_container).addChild(_clip);
};
};
}
private static function loadCommunicator(_arg1:String, _arg2:Object):MovieClip{
if (_clip != null){
return (_clip);
};
if (!MochiServices.isNetworkAvailable()){
return (null);
};
if (urlOptions(_arg2).servURL){
_servURL = urlOptions(_arg2).servURL;
};
var _local3:String = (_servURL + _services);
if (urlOptions(_arg2).servicesURL){
_local3 = urlOptions(_arg2).servicesURL;
};
_listenChannelName = (_listenChannelName + ((Math.floor(new Date().time) + "_") + Math.floor((Math.random() * 99999))));
MochiServices.allowDomains(_local3);
_clip = new MovieClip();
loadLCBridge(_clip);
_loader = new Loader();
_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, detach);
_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, detach);
_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError);
var _local4:URLRequest = new URLRequest(_local3);
var _local5:URLVariables = new URLVariables();
_local5.listenLC = _listenChannelName;
_local5.mochiad_options = _arg2.loaderInfo.parameters.mochiad_options;
_local5.api_version = getVersion();
if (widget){
_local5.widget = true;
};
_local4.data = _local5;
_loader.load(_local4);
_clip.addChild(_loader);
_sendChannel = new LocalConnection();
_queue = [];
_nextCallbackID = 0;
_callbacks = {};
_timer = new Timer(10000, 1);
_timer.addEventListener(TimerEvent.TIMER, connectWait);
_timer.start();
return (_clip);
}
private static function detach(_arg1:Event):void{
var _local2:LoaderInfo = LoaderInfo(_arg1.target);
_local2.removeEventListener(Event.COMPLETE, detach);
_local2.removeEventListener(IOErrorEvent.IO_ERROR, detach);
_local2.removeEventListener(Event.COMPLETE, loadLCBridgeComplete);
_local2.removeEventListener(IOErrorEvent.IO_ERROR, loadError);
}
private static function loadLCBridge(_arg1:Object):void{
var _local2:Loader = new Loader();
var _local3:String = (_servURL + _mochiLC);
var _local4:URLRequest = new URLRequest(_local3);
_local2.contentLoaderInfo.addEventListener(Event.COMPLETE, detach);
_local2.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, detach);
_local2.contentLoaderInfo.addEventListener(Event.COMPLETE, loadLCBridgeComplete);
_local2.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError);
_local2.load(_local4);
_arg1.addChild(_local2);
}
private static function loadLCBridgeComplete(_arg1:Event):void{
var _local2:Loader = LoaderInfo(_arg1.target).loader;
_mochiLocalConnection = MovieClip(_local2.content);
listen();
}
private static function loadError(_arg1:Object):void{
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load.");
MochiServices.disconnect();
MochiServices.onError("IOError");
}
public static function connectWait(_arg1:TimerEvent):void{
if (!_connected){
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load. (timeout)");
MochiServices.disconnect();
MochiServices.onError("IOError");
} else {
_timer.stop();
_timer.removeEventListener(TimerEvent.TIMER, connectWait);
_timer = null;
};
}
private static function listen():void{
_mochiLocalConnection.connect(_listenChannelName);
_clip.handshake = function (_arg1:Object):void{
MochiServices.comChannelName = _arg1.newChannel;
};
trace("Waiting for MochiAds services to connect...");
}
private static function initComChannels():void{
if (!_connected){
trace("[SERVICES_API] connected!");
_connecting = false;
_connected = true;
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:"registerGame", preserved:_preserved, id:_id, version:getVersion(), parentURL:_container.loaderInfo.loaderURL});
_clip.onReceive = onReceive;
_clip.onEvent = onEvent;
_clip.onError = function ():void{
MochiServices.onError("IOError");
};
while (_queue.length > 0) {
_mochiLocalConnection.send(_sendChannelName, "onReceive", _queue.shift());
};
};
}
private static function onReceive(_arg1:Object):void{
var methodName:String;
var pkg = _arg1;
var cb:String = pkg.callbackID;
var cblst:Object = _callbacks[cb];
if (!cblst){
return;
};
var method:* = cblst.callbackMethod;
methodName = "";
var obj:Object = cblst.callbackObject;
if (((obj) && ((typeof(method) == "string")))){
methodName = method;
if (obj[method] != null){
method = obj[method];
} else {
trace((("Error: Method " + method) + " does not exist."));
};
};
if (method != undefined){
try {
method.apply(obj, pkg.args);
} catch(error:Error) {
trace(((("Error invoking callback method '" + methodName) + "': ") + error.toString()));
};
} else {
if (obj != null){
try {
obj(pkg.args);
} catch(error:Error) {
trace(("Error invoking method on object: " + error.toString()));
};
};
};
delete _callbacks[cb];
}
private static function onEvent(_arg1:Object):void{
var _local2:String = _arg1.target;
var _local3:String = _arg1.event;
switch (_local2){
case "services":
MochiServices.triggerEvent(_arg1.event, _arg1.args);
break;
case "events":
MochiEvents.triggerEvent(_arg1.event, _arg1.args);
break;
case "coins":
MochiCoins.triggerEvent(_arg1.event, _arg1.args);
break;
case "social":
MochiSocial.triggerEvent(_arg1.event, _arg1.args);
break;
};
}
private static function flush(_arg1:Boolean):void{
var _local2:Object;
var _local3:Object;
if (((_clip) && (_queue))){
while (_queue.length > 0) {
_local2 = _queue.shift();
_local3 = null;
if (_local2 != null){
if (_local2.callbackID != null){
_local3 = _callbacks[_local2.callbackID];
};
delete _callbacks[_local2.callbackID];
if (((_arg1) && (!((_local3 == null))))){
handleError(_local2.args, _local3.callbackObject, _local3.callbackMethod);
};
};
};
};
}
private static function handleError(_arg1:Object, _arg2:Object, _arg3:Object):void{
if (_arg1 != null){
if (_arg1.onError != null){
_arg1.onError.apply(null, ["NotConnected"]);
};
if (((!((_arg1.options == null))) && (!((_arg1.options.onError == null))))){
_arg1.options.onError.apply(null, ["NotConnected"]);
};
};
if (_arg3 != null){
_arg1 = {};
_arg1.error = true;
_arg1.errorCode = "NotConnected";
if (((!((_arg2 == null))) && ((_arg3 is String)))){
try {
var _local4 = _arg2;
_local4[_arg3](_arg1);
} catch(error:Error) {
};
} else {
if (_arg3 != null){
try {
_arg3.apply(_arg1);
} catch(error:Error) {
};
};
};
};
}
public static function send(_arg1:String, _arg2:Object=null, _arg3:Object=null, _arg4:Object=null):void{
if (_connected){
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:_arg1, args:_arg2, callbackID:_nextCallbackID});
} else {
if ((((_clip == null)) || (!(_connecting)))){
trace(("Error: MochiServices not connected. Please call MochiServices.connect(). Function: " + _arg1));
handleError(_arg2, _arg3, _arg4);
flush(true);
return;
};
_queue.push({methodName:_arg1, args:_arg2, callbackID:_nextCallbackID});
};
if (_clip != null){
if (_callbacks != null){
_callbacks[_nextCallbackID] = {callbackObject:_arg3, callbackMethod:_arg4};
_nextCallbackID++;
};
};
}
private static function urlOptions(_arg1:Object):Object{
var _local3:String;
var _local4:Array;
var _local5:Number;
var _local6:Array;
var _local2:Object = {};
if (_arg1.stage){
_local3 = _arg1.stage.loaderInfo.parameters.mochiad_options;
} else {
_local3 = _arg1.loaderInfo.parameters.mochiad_options;
};
if (_local3){
_local4 = _local3.split("&");
_local5 = 0;
while (_local5 < _local4.length) {
_local6 = _local4[_local5].split("=");
_local2[unescape(_local6[0])] = unescape(_local6[1]);
_local5++;
};
};
return (_local2);
}
public static function addLinkEvent(_arg1:String, _arg2:String, _arg3:DisplayObjectContainer, _arg4:Function=null):void{
var avm1Click:DisplayObject;
var x:String;
var req:URLRequest;
var loader:Loader;
var setURL:Function;
var err:Function;
var complete:Function;
var url = _arg1;
var burl = _arg2;
var btn = _arg3;
var onClick = _arg4;
var vars:Object = new Object();
vars["mav"] = getVersion();
vars["swfv"] = "9";
vars["swfurl"] = btn.loaderInfo.loaderURL;
vars["fv"] = Capabilities.version;
vars["os"] = Capabilities.os;
vars["lang"] = Capabilities.language;
vars["scres"] = ((Capabilities.screenResolutionX + "x") + Capabilities.screenResolutionY);
var s = "?";
var i:Number = 0;
for (x in vars) {
if (i != 0){
s = (s + "&");
};
i = (i + 1);
s = (((s + x) + "=") + escape(vars[x]));
};
req = new URLRequest("http://link.mochiads.com/linkping.swf");
loader = new Loader();
setURL = function (_arg1:String):void{
if (avm1Click){
btn.removeChild(avm1Click);
};
avm1Click = clickMovie(_arg1, onClick);
var _local2:Rectangle = btn.getBounds(btn);
btn.addChild(avm1Click);
avm1Click.x = _local2.x;
avm1Click.y = _local2.y;
avm1Click.scaleX = (0.01 * _local2.width);
avm1Click.scaleY = (0.01 * _local2.height);
};
err = function (_arg1:Object):void{
netup = false;
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
setURL(burl);
};
complete = function (_arg1:Object):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
};
if (netup){
setURL((url + s));
} else {
setURL(burl);
};
if (!((netupAttempted) || (_connected))){
netupAttempted = true;
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, err);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, complete);
loader.load(req);
};
}
private static function clickMovie(_arg1:String, _arg2:Function):MovieClip{
var _local4:int;
var _local14:Loader;
var _local3:Array = [150, 21, 0, 7, 1, 0, 0, 0, 0, 98, 116, 110, 0, 7, 2, 0, 0, 0, 0, 116, 104, 105, 115, 0, 28, 150, 22, 0, 0, 99, 114, 101, 97, 116, 101, 69, 109, 112, 116, 121, 77, 111, 118, 105, 101, 67, 108, 105, 112, 0, 82, 135, 1, 0, 0, 23, 150, 13, 0, 4, 0, 0, 111, 110, 82, 101, 108, 101, 97, 115, 101, 0, 142, 8, 0, 0, 0, 0, 2, 42, 0, 114, 0, 150, 17, 0, 0, 32, 0, 7, 1, 0, 0, 0, 8, 0, 0, 115, 112, 108, 105, 116, 0, 82, 135, 1, 0, 1, 23, 150, 7, 0, 4, 1, 7, 0, 0, 0, 0, 78, 150, 8, 0, 0, 95, 98, 108, 97, 110, 107, 0, 154, 1, 0, 0, 150, 7, 0, 0, 99, 108, 105, 99, 107, 0, 150, 7, 0, 4, 1, 7, 1, 0, 0, 0, 78, 150, 27, 0, 7, 2, 0, 0, 0, 7, 0, 0, 0, 0, 0, 76, 111, 99, 97, 108, 67, 111, 110, 110, 101, 99, 116, 105, 111, 110, 0, 64, 150, 6, 0, 0, 115, 101, 110, 100, 0, 82, 79, 150, 15, 0, 4, 0, 0, 95, 97, 108, 112, 104, 97, 0, 7, 0, 0, 0, 0, 79, 150, 23, 0, 7, 0xFF, 0, 0xFF, 0, 7, 1, 0, 0, 0, 4, 0, 0, 98, 101, 103, 105, 110, 70, 105, 108, 108, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 109, 111, 118, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 16, 0, 7, 0, 0, 0, 0, 4, 0, 0, 101, 110, 100, 70, 105, 108, 108, 0, 82, 23];
var _local5:Array = [104, 0, 31, 64, 0, 7, 208, 0, 0, 12, 1, 0, 67, 2, 0xFF, 0xFF, 0xFF, 63, 3];
var _local6:Array = [0, 64, 0, 0, 0];
var _local7:MovieClip = new MovieClip();
var _local8:LocalConnection = new LocalConnection();
var _local9:String = ((("_click_" + Math.floor((Math.random() * 999999))) + "_") + Math.floor(new Date().time));
_local8 = new LocalConnection();
_local7.lc = _local8;
_local7.click = _arg2;
_local8.client = _local7;
_local8.connect(_local9);
var _local10:ByteArray = new ByteArray();
var _local11:ByteArray = new ByteArray();
_local11.endian = Endian.LITTLE_ENDIAN;
_local11.writeShort(1);
_local11.writeUTFBytes(((_arg1 + " ") + _local9));
_local11.writeByte(0);
var _local12:uint = ((_local3.length + _local11.length) + 4);
var _local13:uint = (_local12 + 35);
_local10.endian = Endian.LITTLE_ENDIAN;
_local10.writeUTFBytes("FWS");
_local10.writeByte(8);
_local10.writeUnsignedInt(_local13);
for each (_local4 in _local5) {
_local10.writeByte(_local4);
};
_local10.writeUnsignedInt(_local12);
_local10.writeByte(136);
_local10.writeShort(_local11.length);
_local10.writeBytes(_local11);
for each (_local4 in _local3) {
_local10.writeByte(_local4);
};
for each (_local4 in _local6) {
_local10.writeByte(_local4);
};
_local14 = new Loader();
_local14.loadBytes(_local10);
_local7.addChild(_local14);
return (_local7);
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
}
}//package mochi.as3
Section 19
//MochiSocial (mochi.as3.MochiSocial)
package mochi.as3 {
public class MochiSocial {
public static const LOGGED_IN:String = "LoggedIn";
public static const LOGGED_OUT:String = "LoggedOut";
public static const LOGIN_SHOW:String = "LoginShow";
public static const LOGIN_HIDE:String = "LoginHide";
public static const LOGIN_SHOWN:String = "LoginShown";
public static const PROFILE_SHOW:String = "ProfileShow";
public static const PROFILE_HIDE:String = "ProfileHide";
public static const PROPERTIES_SAVED:String = "PropertySaved";
public static const WIDGET_LOADED:String = "WidgetLoaded";
public static const FRIEND_LIST:String = "FriendsList";
public static const PROFILE_DATA:String = "ProfileData";
public static const GAMEPLAY_DATA:String = "GameplayData";
public static const ACTION_CANCELED:String = "onCancel";
public static const ACTION_COMPLETE:String = "onComplete";
public static const USER_INFO:String = "UserInfo";
public static const ERROR:String = "Error";
public static const IO_ERROR:String = "IOError";
public static const NO_USER:String = "NoUser";
public static const PROPERTIES_SIZE:String = "PropertiesSize";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public static var _user_info:Object = null;
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function getAPIURL():String{
if (!_user_info){
return (null);
};
return (_user_info.api_url);
}
public static function getAPIToken():String{
if (!_user_info){
return (null);
};
return (_user_info.api_token);
}
public static function showLoginWidget(_arg1:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("social_showLoginWidget", {options:_arg1});
}
public static function hideLoginWidget():void{
MochiServices.send("social_hideLoginWidget");
}
public static function requestLogin(_arg1:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("social_requestLogin", _arg1);
}
public static function showProfile(_arg1:Object=null):void{
MochiServices.setContainer();
MochiServices.stayOnTop();
MochiServices.send("social_showProfile", _arg1);
}
public static function saveUserProperties(_arg1:Object):void{
MochiServices.send("social_saveUserProperties", _arg1);
}
public static function getFriendsList(_arg1:Object=null):void{
MochiServices.send("social_getFriendsList", _arg1);
}
public static function postToStream(_arg1:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("social_postToStream", _arg1);
}
public static function inviteFriends(_arg1:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("social_inviteFriends", _arg1);
}
public static function requestFan(_arg1:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("social_requestFan", _arg1);
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
public static function get loggedIn():Boolean{
return (!((_user_info == null)));
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
MochiSocial.addEventListener(MochiSocial.LOGGED_IN, function (_arg1:Object):void{
_user_info = _arg1;
});
MochiSocial.addEventListener(MochiSocial.LOGGED_OUT, function (_arg1:Object):void{
_user_info = null;
});
}
}//package mochi.as3
Section 20
//MochiUserData (mochi.as3.MochiUserData)
package mochi.as3 {
import flash.events.*;
import flash.utils.*;
import flash.net.*;
public class MochiUserData extends EventDispatcher {
public var _loader:URLLoader;
public var key:String;// = null
public var data;// = null
public var error:Event;// = null
public var operation:String;// = null
public var callback:Function;// = null
public function MochiUserData(_arg1:String="", _arg2:Function=null){
this.key = _arg1;
this.callback = _arg2;
}
public function serialize(_arg1):ByteArray{
var _local2:ByteArray = new ByteArray();
_local2.objectEncoding = ObjectEncoding.AMF3;
_local2.writeObject(_arg1);
_local2.compress();
return (_local2);
}
public function deserialize(_arg1:ByteArray){
_arg1.objectEncoding = ObjectEncoding.AMF3;
_arg1.uncompress();
return (_arg1.readObject());
}
public function request(_arg1:String, _arg2:ByteArray):void{
var _operation = _arg1;
var _data = _arg2;
operation = _operation;
var api_url:String = MochiSocial.getAPIURL();
var api_token:String = MochiSocial.getAPIToken();
if ((((api_url == null)) || ((api_token == null)))){
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, "not logged in"));
return;
};
_loader = new URLLoader();
var args:URLVariables = new URLVariables();
args.op = _operation;
args.key = key;
var req:URLRequest = new URLRequest((((MochiSocial.getAPIURL() + "/") + "MochiUserData?") + args.toString()));
req.method = URLRequestMethod.POST;
req.contentType = "application/x-mochi-userdata";
req.requestHeaders = [new URLRequestHeader("x-mochi-services-version", MochiServices.getVersion()), new URLRequestHeader("x-mochi-api-token", api_token)];
req.data = _data;
_loader.dataFormat = URLLoaderDataFormat.BINARY;
_loader.addEventListener(Event.COMPLETE, completeHandler);
_loader.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
_loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
try {
_loader.load(req);
} catch(e:SecurityError) {
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("security error: " + e.toString())));
};
}
public function completeHandler(_arg1:Event):void{
var event = _arg1;
try {
if (_loader.data.length){
data = deserialize(_loader.data);
} else {
data = null;
};
} catch(e:Error) {
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("deserialize error: " + e.toString())));
return;
};
if (callback != null){
performCallback();
} else {
dispatchEvent(event);
};
close();
}
public function errorHandler(_arg1:IOErrorEvent):void{
data = null;
error = _arg1;
if (callback != null){
performCallback();
} else {
dispatchEvent(_arg1);
};
close();
}
public function securityErrorHandler(_arg1:SecurityErrorEvent):void{
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("security error: " + _arg1.toString())));
}
public function performCallback():void{
try {
callback(this);
} catch(e:Error) {
trace(("[MochiUserData] exception during callback: " + e));
};
}
public function close():void{
if (_loader){
_loader.removeEventListener(Event.COMPLETE, completeHandler);
_loader.removeEventListener(IOErrorEvent.IO_ERROR, errorHandler);
_loader.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
_loader.close();
_loader = null;
};
error = null;
callback = null;
}
public function getEvent():void{
request("get", serialize(null));
}
public function putEvent(_arg1):void{
request("put", serialize(_arg1));
}
override public function toString():String{
return ((((((((("[MochiUserData operation=" + operation) + " key=\"") + key) + "\" data=") + data) + " error=\"") + error) + "\"]"));
}
public static function get(_arg1:String, _arg2:Function):void{
var _local3:MochiUserData = new MochiUserData(_arg1, _arg2);
_local3.getEvent();
}
public static function put(_arg1:String, _arg2, _arg3:Function):void{
var _local4:MochiUserData = new MochiUserData(_arg1, _arg3);
_local4.putEvent(_arg2);
}
}
}//package mochi.as3
Section 21
//MainTimeline (ongsCandyTree_ibravo_fla.MainTimeline)
package ongsCandyTree_ibravo_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import mochi.as3.*;
import flash.utils.*;
import flash.net.*;
import flash.text.*;
import flash.system.*;
import flash.geom.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class MainTimeline extends MovieClip {
public var IS_COMM:Boolean;
public var sound:NeoSound;
public var RANK:String;
public var isTest:Boolean;
public var mc_text:MovieClip;
public var USER_ID:String;
public var btn_help:MovieClip;
public var pow:NeoSound;
public var container:MovieClip;
public var GAME_ID:String;
public var mc_main:MovieClip;
public var btn_start:MovieClip;
public var bgm:NeoSound;
public var mc_controller:MovieClip;
public function MainTimeline(){
MochiServices.connect("325a92356e437190", root);
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
public function trim(_arg1:String):String{
var _local2:Array;
_local2 = _arg1.split("");
while (((_local2.length) && ((((((_local2[0] == " ")) || ((_local2[0] == "\n")))) || ((_local2[0] == "\r")))))) {
_local2.shift();
};
_local2.reverse();
while (((_local2.length) && ((((((_local2[0] == " ")) || ((_local2[0] == "\n")))) || ((_local2[0] == "\r")))))) {
_local2.shift();
};
_local2.reverse();
return (_local2.join(""));
}
public function restart(_arg1:MouseEvent=null):void{
gotoAndStop(2);
}
public function moveScene(_arg1:String):void{
gotoAndStop(_arg1);
}
public function onBtn_help(_arg1:MouseEvent):void{
showHelp();
}
public function showTitle(_arg1:MouseEvent=null):void{
gotoAndStop("타이틀");
}
public function makeScrambleValue(_arg1:String, _arg2:MovieClip, _arg3:Number):Object{
var _arg1 = _arg1;
var _arg2 = _arg2;
var _arg3 = _arg3;
var name:* = _arg1;
var mc:* = _arg2;
var iv:* = _arg3;
if (mc == null){
trace("ERROR: makeScrambleValue - 목표 무비가 존재하지 않음.");
return (null);
};
if (mc[name] != null){
trace((((("WARNING: makeScrambleValue - 무비(" + mc) + ")에 ") + name) + " 변수가 이미 존재함."));
} else {
mc[name] = new Object();
mc[name].text = "";
};
mc[name].setVar = function (_arg1:Number):Number{
this.seed = (getTimer() * Math.floor((Math.random() * 1000000)));
this.val = (this.seed + _arg1);
this.text = this.toString();
return (this.getVar());
};
mc[name].getVar = function ():Number{
return ((this.val - this.seed));
};
mc[name].addVar = function (_arg1:Number):Number{
var _local2:*;
_local2 = this.getVar();
this.seed = (getTimer() * Math.floor((Math.random() * 1000000)));
this.val = ((this.seed + _local2) + _arg1);
this.text = this.toString();
return (this.getVar());
};
mc[name].toString = function ():String{
return (Number(this.getVar()).toString());
};
mc[name].setVar(iv);
return (mc[name]);
}
public function alert(_arg1:String):void{
var _local2:* = null;
var _local3:* = _arg1;
_local2 = new URLRequest((("javascript:alert('" + _local3) + "');"));
try {
navigateToURL(_local2, "_self");
} catch(e:Error) {
};
}
public function parseArray(_arg1:Event, _arg2:String="&"):Array{
var _arg1 = _arg1;
var _arg2 = _arg2;
var loader:* = null;
var texts:* = null;
var filter:* = null;
var e:* = _arg1;
var needle:String = _arg2;
loader = (e.target as URLLoader);
texts = String(loader.data).split(needle);
filter = function (_arg1, _arg2:int, _arg3:Array):Boolean{
return (((((String(_arg1).length) && (!((String(_arg1) == "\r"))))) && (!((String(_arg1) == "\n")))));
};
return (texts.filter(filter));
}
function frame1(){
stop();
System.useCodePage = true;
stage.showDefaultContextMenu = false;
stage.align = StageAlign.TOP_LEFT;
bgm = new NeoSound();
bgm.bgm(new soundBgm());
bgm.pause();
pow = new NeoSound();
pow.bgm(new soundpow());
pow.pause();
sound = new NeoSound();
isTest = true;
IS_COMM = false;
RANK = "***";
}
function frame3(){
mc_text.gotoAndStop(1);
pageView();
btn_start.addEventListener(MouseEvent.MOUSE_DOWN, onBtn_start);
mc_text.btn_prev.addEventListener(MouseEvent.CLICK, handle_buttonClick);
mc_text.btn_next.addEventListener(MouseEvent.CLICK, handle_buttonClick);
}
public function onSound(_arg1:MouseEvent=null):void{
var _local2:MovieClip;
_local2 = (_arg1.currentTarget as MovieClip);
switch (_local2.currentFrame){
case 1:
sound.volume = 0;
bgm.volume = 0;
pow.volume = 0;
_local2.gotoAndStop(2);
break;
case 2:
sound.volume = 1;
bgm.volume = 1;
pow.volume = 1;
_local2.gotoAndStop(1);
break;
};
}
public function playGame(_arg1:MouseEvent=null):void{
gotoAndStop("게임");
}
function frame2(){
stop();
btn_start.addEventListener(MouseEvent.MOUSE_DOWN, onBtn_start);
btn_help.addEventListener(MouseEvent.MOUSE_DOWN, onBtn_help);
}
public function onBtn_start(_arg1:MouseEvent):void{
playGame();
}
public function pageView():void{
switch (mc_text.currentFrame){
case 1:
mc_text.btn_prev.visible = false;
mc_text.btn_next.visible = true;
break;
case mc_text.totalFrames:
mc_text.btn_prev.visible = true;
mc_text.btn_next.visible = false;
break;
};
}
public function showHelp(_arg1:MouseEvent=null):void{
gotoAndStop("게임방법");
}
public function stopSounds():void{
SoundMixer.stopAll();
}
public function handle_buttonClick(_arg1:MouseEvent):void{
var _local2:String;
_local2 = _arg1.target.name.split("_")[1];
if (_local2 == "prev"){
mc_text.prevFrame();
} else {
if (_local2 == "next"){
mc_text.nextFrame();
};
};
pageView();
}
}
}//package ongsCandyTree_ibravo_fla
Section 22
//mc_3dollbox_80 (ongsCandyTree_ibravo_fla.mc_3dollbox_80)
package ongsCandyTree_ibravo_fla {
import flash.display.*;
public dynamic class mc_3dollbox_80 extends MovieClip {
public function mc_3dollbox_80(){
addFrameScript(12, frame13, 18, frame19, 23, frame24, 33, frame34, 43, frame44);
}
function frame19(){
stop();
}
function frame13(){
stop();
}
function frame24(){
stop();
}
function frame34(){
stop();
}
function frame44(){
stop();
}
}
}//package ongsCandyTree_ibravo_fla
Section 23
//mc_bg_14 (ongsCandyTree_ibravo_fla.mc_bg_14)
package ongsCandyTree_ibravo_fla {
import flash.display.*;
public dynamic class mc_bg_14 extends MovieClip {
public var mc_backB:MovieClip;
}
}//package ongsCandyTree_ibravo_fla
Section 24
//mc_cookie_6_44 (ongsCandyTree_ibravo_fla.mc_cookie_6_44)
package ongsCandyTree_ibravo_fla {
import flash.display.*;
public dynamic class mc_cookie_6_44 extends MovieClip {
public function mc_cookie_6_44(){
addFrameScript(16, frame17, 17, frame18);
}
function frame18(){
stop();
}
function frame17(){
stop();
}
}
}//package ongsCandyTree_ibravo_fla
Section 25
//mc_cookie_6_eff1_45 (ongsCandyTree_ibravo_fla.mc_cookie_6_eff1_45)
package ongsCandyTree_ibravo_fla {
import flash.display.*;
public dynamic class mc_cookie_6_eff1_45 extends MovieClip {
public function mc_cookie_6_eff1_45(){
addFrameScript(13, frame14);
}
function frame14(){
stop();
MovieClip(parent).gotoAndStop("crash");
}
}
}//package ongsCandyTree_ibravo_fla
Section 26
//mc_cookie_item1_49 (ongsCandyTree_ibravo_fla.mc_cookie_item1_49)
package ongsCandyTree_ibravo_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.net.*;
import flash.text.*;
import flash.system.*;
import flash.geom.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class mc_cookie_item1_49 extends MovieClip {
public function mc_cookie_item1_49(){
addFrameScript(13, frame14);
}
function frame14(){
stop();
MovieClip(parent).mc.gotoAndStop("normal");
}
}
}//package ongsCandyTree_ibravo_fla
Section 27
//mc_cookie_item1_out_50 (ongsCandyTree_ibravo_fla.mc_cookie_item1_out_50)
package ongsCandyTree_ibravo_fla {
import flash.display.*;
public dynamic class mc_cookie_item1_out_50 extends MovieClip {
public function mc_cookie_item1_out_50(){
addFrameScript(9, frame10);
}
function frame10(){
stop();
}
}
}//package ongsCandyTree_ibravo_fla
Section 28
//mc_cookie_item2_boom_55 (ongsCandyTree_ibravo_fla.mc_cookie_item2_boom_55)
package ongsCandyTree_ibravo_fla {
import flash.display.*;
public dynamic class mc_cookie_item2_boom_55 extends MovieClip {
public function mc_cookie_item2_boom_55(){
addFrameScript(17, frame18);
}
function frame18(){
stop();
}
}
}//package ongsCandyTree_ibravo_fla
Section 29
//mc_cookie_item3_eff_58 (ongsCandyTree_ibravo_fla.mc_cookie_item3_eff_58)
package ongsCandyTree_ibravo_fla {
import flash.display.*;
public dynamic class mc_cookie_item3_eff_58 extends MovieClip {
public function mc_cookie_item3_eff_58(){
addFrameScript(12, frame13);
}
function frame13(){
stop();
}
}
}//package ongsCandyTree_ibravo_fla
Section 30
//mc_gameclear_24 (ongsCandyTree_ibravo_fla.mc_gameclear_24)
package ongsCandyTree_ibravo_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.net.*;
import flash.text.*;
import flash.system.*;
import flash.geom.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class mc_gameclear_24 extends MovieClip {
public function mc_gameclear_24(){
addFrameScript(29, frame30, 30, frame31);
}
function frame30(){
stop();
MovieClip(parent).gameClear(true);
}
function frame31(){
stop();
}
}
}//package ongsCandyTree_ibravo_fla
Section 31
//mc_gameover_18 (ongsCandyTree_ibravo_fla.mc_gameover_18)
package ongsCandyTree_ibravo_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.net.*;
import flash.text.*;
import flash.system.*;
import flash.geom.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class mc_gameover_18 extends MovieClip {
public function mc_gameover_18(){
addFrameScript(29, frame30, 30, frame31);
}
function frame30(){
}
function frame31(){
stop();
MovieClip(parent).gameOver(true);
}
}
}//package ongsCandyTree_ibravo_fla
Section 32
//mc_gauge_bar_68 (ongsCandyTree_ibravo_fla.mc_gauge_bar_68)
package ongsCandyTree_ibravo_fla {
import flash.display.*;
public dynamic class mc_gauge_bar_68 extends MovieClip {
public var mc_mask:MovieClip;
public var mc_arrow:MovieClip;
public var powbar:MovieClip;
}
}//package ongsCandyTree_ibravo_fla
Section 33
//mc_main_13 (ongsCandyTree_ibravo_fla.mc_main_13)
package ongsCandyTree_ibravo_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.net.*;
import flash.text.*;
import flash.system.*;
import flash.geom.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class mc_main_13 extends MovieClip {
public var mc_gameClear:MovieClip;
public var powNum:Number;
public var prevScore:uint;
public var bgmToggle:Boolean;
public var mc_stageClear:MovieClip;
public var mc_result_test:MovieClip;
public var pow:Number;
public var maxPow:Number;
public var mc_middle:MovieClip;
public var mc_gameover:MovieClip;
public var mc_stageStart:MovieClip;
public var mc_basket:MovieClip;
public var isThree:Boolean;
public var score:Object;
public var mapItem:mc_snack;
public var mc_score:MovieClip;
public var current_mission:MovieClip;
public var mc_actionText:mc_eff;
public var angle:Number;
public var ballArry:Array;
public var stage_02:Array;
public var stage_03:Array;
public var stage_04:Array;
public var mc_result:MovieClip;
public var stage_06:Array;
public var stage_07:Array;
public var stage_08:Array;
public var stage_09:Array;
public var stage_05:Array;
public var stage_01:Array;
public var stage_10:Array;
public var stage_11:Array;
public var stage_12:Array;
public var mc_hero:MovieClip;
public var stage_14:Array;
public var stage_15:Array;
public var mapItemLen:Number;
public var mc_ballMovie:MovieClip;
public var basketCount:Number;
public var ballNum:uint;
public var stage_13:Array;
public var mc_power:MovieClip;
public var prevPow:Number;
public var stageH:Number;
public var num_ball:MovieClip;
public var stageW:Number;
public var hitCheck:Number;
public var checkMap:mc_snack;
public var mc_angleArrow:MovieClip;
public var isGameOver:Boolean;
public var isItem:Boolean;
public var mc_timer:MovieClip;
public var totalBall:uint;
public var mapItemArry:Array;
public var btn_sound:MovieClip;
public var isRestart:Boolean;
public var isBasket:Boolean;
public var total_mission:MovieClip;
public var mc_consol:MovieClip;
public var mc_level:MovieClip;
public var stageNum:Object;
public var effect:Effect;
public var mc_ongsun:MovieClip;
public var totalMission:uint;
public var mapItemSpace:Number;
public var bg_mc:MovieClip;
public var currentMission:uint;
public var isThrow:Boolean;
public var ball:mc_ball;
public function mc_main_13(){
addFrameScript(0, frame1);
}
public function onPow_Handler_Up(_arg1:MouseEvent):void{
if (!isThrow){
mc_hero.gotoAndStop("공던짐");
mc_power.visible = false;
mc_angleArrow.visible = false;
MovieClip(parent).pow.pause();
soundThrow();
mc_power.removeEventListener(Event.ENTER_FRAME, onPower_handler_enter);
this.removeEventListener(MouseEvent.MOUSE_DOWN, onPow_Handler_Down);
this.removeEventListener(MouseEvent.MOUSE_UP, onPow_Handler_Up);
};
}
public function restart(_arg1:MouseEvent):void{
var _local2:int;
score.setVar(prevScore);
ballNum = totalBall;
stageNum.setVar(1);
score.setVar(0);
totalBall = 20;
isRestart = true;
init();
MovieClip(parent).sound.stop();
mc_stageStart.gotoAndPlay(1);
mc_result_test.visible = false;
mc_result.visible = false;
_local2 = 0;
while (_local2 < mapItemArry.length) {
if (this.contains(mapItemArry[_local2]) == true){
removeChild(mapItemArry[_local2]);
};
_local2++;
};
mapItemArry = [];
ballSet(ballNum);
}
public function missionClear():void{
var _local1:Number;
if (currentMission == 0){
stageNum.addVar(1);
numberic(stageNum.getVar(), 2, mc_stageStart.mc_stagenum);
if (stageNum.getVar() < 16){
soundStageClear();
mc_stageClear.visible = true;
mc_stageClear.gotoAndPlay(1);
} else {
sndclear();
MovieClip(parent).bgm.pause();
mc_gameClear.visible = true;
mc_gameClear.gotoAndPlay(1);
};
} else {
if (ballNum != 0){
if (!isThree){
mc_ongsun.gotoAndStop("공줄때");
} else {
mc_ongsun.gotoAndStop("삼돌이공줄때");
};
_local1 = (((-13 / totalBall) * ballNum) + 15);
if (ballNum != 1){
if (ballNum < 4){
mc_ballMovie.gotoAndStop((14 - (ballNum - 1)));
} else {
mc_ballMovie.gotoAndStop(Math.floor(_local1));
};
} else {
mc_ballMovie.gotoAndStop(14);
};
} else {
if (!isGameOver){
mc_gameover.visible = true;
mc_gameover.gotoAndPlay(1);
soundOver();
MovieClip(parent).bgm.pause();
isGameOver = true;
};
};
};
}
public function numberic(_arg1:int, _arg2:int, _arg3:Object):void{
var _local4:String;
var _local5:Number;
_local4 = digitNumber(_arg1, _arg2);
_local5 = 0;
while (_local5 < _local4.length) {
_arg3[("num_" + _local5)].gotoAndStop((Number(_local4.charAt(_local5)) + 1));
_local5++;
};
}
public function getAt(_arg1:Array, _arg2:MovieClip):Number{
var _local3:*;
if (_arg1 == null){
return (-1);
};
_local3 = 0;
while (_local3 < _arg1.length) {
if (_arg1[_local3] == _arg2){
return (_local3);
};
_local3++;
};
return (-1);
}
public function showTestResult():void{
mc_result_test.y = -120;
mc_result_test.visible = true;
this.addChild(mc_result_test);
trace(("score" + score.getVar()));
mc_result_test.playerscore = score.getVar();
mc_result_test.mc_score.text = mc_result_test.playerscore.toString();
mc_result_test.btn_title.addEventListener(MouseEvent.MOUSE_DOWN, titleMove);
mc_result_test.btn_init.addEventListener(MouseEvent.MOUSE_DOWN, restart);
}
public function gamePlay():void{
hitCheck = 0;
if (ballNum != -1){
isThrow = false;
mc_angleArrow.visible = true;
scoreSet(score.getVar());
missionSet(currentMission, totalMission);
ballSet(ballNum);
this.addEventListener(MouseEvent.MOUSE_DOWN, onPow_Handler_Down);
this.addEventListener(Event.ENTER_FRAME, onArrow_handler);
};
}
public function titleMove(_arg1:MouseEvent):void{
MovieClip(parent).sound.stop();
MovieClip(parent).gotoAndStop(1, "타이틀");
}
public function itemCrash():void{
MovieClip(root).sound.play(new soundenemy());
}
function frame1(){
stage_01 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 2, 2, 0, 0, 0, 2, 2, 0, 0], [0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0], [0, 0, 0, 2, 2, 1, 1, 1, 2, 2, 0, 0], [0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0], [0, 0, 0, 2, 2, 0, 0, 0, 2, 2, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
stage_02 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 3, 3, 0, 3, 3, 0, 3, 3, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 4, 4, 4, 4, 0, 0, 0], [0, 0, 0, 0, 0, 4, 4, 4, 4, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 3, 3, 0, 3, 3, 0, 3, 3, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
stage_03 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0], [0, 0, 8, 4, 8, 4, 8, 4, 8, 4, 8, 0], [0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0], [0, 0, 8, 4, 8, 4, 8, 4, 8, 4, 8, 0], [0, 0, 4, 0, 0, 0, 4, 0, 0, 0, 4, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
stage_04 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 6, 6, 0, 0, 0, 0], [0, 0, 0, 5, 5, 5, 6, 6, 5, 5, 5, 0], [0, 0, 0, 5, 5, 8, 6, 6, 8, 5, 5, 0], [0, 0, 0, 5, 5, 5, 6, 6, 5, 5, 5, 0], [0, 0, 0, 0, 0, 0, 6, 6, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
stage_05 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0], [0, 0, 0, 0, 1, 8, 1, 1, 8, 1, 0, 0], [0, 0, 0, 0, 6, 1, 6, 6, 1, 1, 0, 0], [0, 0, 0, 0, 0, 0, 7, 6, 1, 1, 0, 0], [0, 0, 0, 0, 0, 0, 0, 1, 8, 1, 0, 0], [0, 0, 0, 0, 0, 0, 0, 6, 1, 1, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
stage_06 = [[0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 2, 2, 2, 0, 0, 0], [0, 0, 0, 0, 0, 2, 8, 2, 8, 2, 0, 0], [0, 0, 0, 0, 2, 2, 2, 7, 2, 2, 2, 0], [0, 0, 0, 0, 2, 2, 8, 7, 8, 2, 2, 0], [0, 0, 0, 0, 0, 0, 2, 2, 2, 0, 0, 0], [0, 0, 0, 0, 0, 0, 8, 2, 8, 0, 0, 0], [0, 0, 0, 0, 0, 0, 2, 2, 2, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
stage_07 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0], [0, 0, 0, 6, 1, 1, 6, 1, 1, 6, 1, 0], [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
stage_08 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 6, 6, 6, 9, 9, 6, 6, 6, 0], [0, 0, 0, 0, 0, 3, 6, 6, 3, 0, 0, 0], [0, 0, 0, 0, 0, 3, 3, 3, 3, 0, 0, 0], [0, 0, 0, 6, 6, 6, 6, 6, 6, 6, 6, 0], [0, 0, 0, 0, 0, 3, 3, 3, 3, 0, 0, 0], [0, 0, 0, 0, 0, 3, 6, 6, 3, 0, 0, 0], [0, 0, 0, 6, 6, 6, 9, 9, 6, 6, 6, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
stage_09 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 0], [0, 0, 0, 4, 4, 9, 4, 4, 4, 4, 7, 0], [0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 7, 0], [0, 0, 0, 4, 4, 6, 6, 6, 6, 4, 7, 0], [0, 0, 0, 4, 4, 6, 6, 6, 6, 4, 7, 0], [0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 7, 0], [0, 0, 0, 4, 4, 9, 4, 4, 4, 4, 7, 0], [0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
stage_10 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0], [0, 0, 0, 7, 3, 0, 6, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 3, 0, 6, 3, 0, 0], [0, 0, 0, 0, 6, 0, 9, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 6, 7, 3, 0, 0, 0], [0, 0, 0, 0, 7, 3, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
stage_11 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 6, 6, 0, 0, 0, 6, 6, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 6, 0, 4, 4, 0, 7, 0, 4, 4, 0, 6], [0, 6, 0, 4, 4, 0, 7, 0, 4, 4, 0, 6], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 6, 6, 0, 0, 0, 6, 6, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
stage_12 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0], [0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0], [0, 0, 7, 0, 2, 0, 7, 0, 2, 0, 7, 0], [0, 0, 7, 0, 0, 0, 7, 0, 0, 0, 7, 0], [0, 0, 7, 0, 2, 0, 7, 0, 2, 0, 0, 0], [0, 0, 7, 0, 2, 0, 0, 0, 2, 0, 0, 0], [0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
stage_13 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 6, 0, 6, 7, 0, 0, 0], [0, 0, 0, 0, 0, 7, 0, 0, 6, 0, 0, 0], [0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 7, 0, 1, 0, 1, 0, 0], [0, 0, 0, 0, 0, 7, 0, 1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
stage_14 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 6, 9, 6, 0, 0, 0, 0], [0, 0, 0, 0, 6, 0, 5, 0, 6, 0, 0, 0], [0, 0, 0, 6, 0, 5, 6, 5, 0, 6, 0, 0], [0, 0, 6, 0, 5, 0, 7, 0, 5, 0, 6, 0], [0, 0, 0, 5, 0, 7, 0, 7, 0, 5, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
stage_15 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0], [0, 0, 0, 0, 7, 0, 1, 1, 1, 0, 7, 0], [0, 0, 0, 0, 7, 0, 1, 1, 0, 0, 0, 0], [0, 0, 0, 0, 7, 0, 1, 0, 0, 0, 0, 0], [0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
stageNum = MovieClip(root).makeScrambleValue("_stegeNum", this, 1);
score = MovieClip(root).makeScrambleValue("_score", this, 0);
prevScore = 0;
currentMission = 0;
totalMission = 0;
totalBall = 20;
ballNum = totalBall;
isGameOver = false;
isRestart = false;
isItem = false;
basketCount = 0;
isBasket = false;
pow = 0;
prevPow = 0;
isThrow = false;
maxPow = 30;
powNum = 1;
mapItemArry = [];
mapItemLen = 36;
mapItemSpace = 6;
stageW = 640;
stageH = 480;
ballArry = [];
isThree = false;
bg_mc.cacheAsBitmap = true;
mc_consol.cacheAsBitmap = true;
mc_basket.cacheAsBitmap = true;
mc_middle.cacheAsBitmap = true;
mc_result.cacheAsBitmap = true;
bgmToggle = true;
btn_sound.buttonMode = true;
btn_sound.gotoAndStop(((MovieClip(parent).sound.volume)>0) ? 1 : 2);
btn_sound.addEventListener(MouseEvent.CLICK, MovieClip(parent).onSound);
btn_sound.addEventListener(MouseEvent.MOUSE_OVER, onBtn_Over);
btn_sound.addEventListener(MouseEvent.MOUSE_OUT, onBtn_Over);
init();
mc_result_test.visible = false;
mc_result.visible = false;
}
public function soundStageClear():void{
MovieClip(root).sound.play(new soundGoal());
}
public function ball_action_08(_arg1:int, _arg2:int):void{
var _local3:Array;
var _local4:Array;
var _local5:int;
var _local6:int;
_local3 = [];
_local4 = [];
_local5 = 0;
while (_local5 < mapItemArry.length) {
if (mapItemArry[_local5] != null){
if ((((((mapItemArry[_local5].yNum == (_arg2 - 1))) || ((mapItemArry[_local5].yNum == _arg2)))) || ((mapItemArry[_local5].yNum == (_arg2 + 1))))){
if (mapItemArry[_local5].xNum == (_arg1 - 1)){
_local3.push(mapItemArry[_local5]);
_local4.push(_local5);
};
if (mapItemArry[_local5].cell != 8){
if (mapItemArry[_local5].xNum == _arg1){
_local3.push(mapItemArry[_local5]);
_local4.push(_local5);
};
};
if (mapItemArry[_local5].xNum == (_arg1 + 1)){
_local3.push(mapItemArry[_local5]);
_local4.push(_local5);
};
};
};
_local5++;
};
_local6 = 0;
while (_local6 < _local3.length) {
ball_action_basice(_local3[_local6], _local4[_local6]);
_local6++;
};
}
public function ball_action_06(_arg1:Event):void{
ball = (_arg1.currentTarget as mc_ball);
ball.alpha = (ball.alpha + (0.2 * (0 - ball.alpha)));
if (Math.abs((ball.alpha - 0)) < 0.1){
deleteOne(ballArry, ball);
hitMovie();
if (this.contains(ball) == true){
ball.removeEventListener(Event.ENTER_FRAME, ball_action_06);
this.removeChild(ball);
};
};
}
public function scoreSet(_arg1:int=0):void{
var _local2:String;
var _local3:Number;
_local2 = digitNumber(_arg1, 7);
_local3 = 0;
while (_local3 < _local2.length) {
mc_score[("num_" + _local3)].gotoAndStop((Number(_local2.charAt(_local3)) + 1));
_local3++;
};
}
public function onEffectEnter(_arg1:Event):void{
effect = (_arg1.currentTarget as Effect);
if (effect.currentFrame == effect.totalFrames){
effect.removeEventListener(Event.ENTER_FRAME, onEffectEnter);
this.removeChild(effect);
};
}
public function soundOver():void{
MovieClip(root).sound.play(new soundGameover(), 0.5);
}
public function stageSet(_arg1:Number=0):void{
var _local2:String;
var _local3:Number;
var _local4:Array;
var _local5:Number;
var _local6:Number;
var _local7:int;
var _local8:int;
_local2 = digitNumber(_arg1, 2);
_local3 = 0;
currentMission = 0;
totalMission = 0;
while (_local3 < _local2.length) {
mc_level[("num_" + _local3)].gotoAndStop((Number(_local2.charAt(_local3)) + 1));
_local3++;
};
if (_arg1 != 0){
_local4 = this[("stage_" + _local2)];
_local5 = 12;
_local6 = 10;
if (mapItemArry.length != 0){
_local7 = 0;
while (_local7 < mapItemArry.length) {
this.removeChild(mapItemArry[_local7]);
_local7++;
};
mapItemArry = [];
};
_local7 = 0;
while (_local7 < _local6) {
_local8 = 0;
while (_local8 < _local5) {
if (_local4[_local7][_local8] != 0){
mapItem = new mc_snack();
mapItem.gotoAndStop(_local4[_local7][_local8]);
mapItem.x = ((((-169 + stageW) - ((mapItemLen + mapItemSpace) * _local5)) + ((mapItemLen + mapItemSpace) * _local8)) + (mapItemLen / 2));
mapItem.y = ((-241 + ((mapItemLen + mapItemSpace) * _local7)) + (mapItemLen / 2));
if (_local4[_local7][_local8] < 7){
if (_local4[_local7][_local8] != 6){
currentMission++;
totalMission++;
};
};
if (_local4[_local7][_local8] > 5){
mapItem.addEventListener(EMovieClip.FRAME_COMPLETE, frameCompleteHandler);
};
if (_local4[_local7][_local8] == 7){
if (_local4[_local7][(_local8 - 1)] == 7){
mapItem.isLeft = true;
} else {
mapItem.isLeft = false;
};
if (_local4[_local7][(_local8 + 1)] == 7){
mapItem.isRight = true;
} else {
mapItem.isRight = false;
};
if (_local4[(_local7 - 1)][_local8] == 7){
mapItem.isTop = true;
} else {
mapItem.isTop = false;
};
if (_local4[(_local7 + 1)][_local8] == 7){
mapItem.isBottom = true;
} else {
mapItem.isBottom = false;
};
};
mapItem.remove = 0;
mapItem.cell = _local4[_local7][_local8];
mapItem.vx = 0;
mapItem.vy = 0;
mapItem.xNum = _local8;
mapItem.yNum = _local7;
this.addChildAt(mapItem, 1);
mapItemArry.push(mapItem);
};
_local8++;
};
_local7++;
};
missionSet(currentMission, totalMission);
};
}
public function frameCompleteHandler(_arg1:Event):void{
mapItem = (_arg1.currentTarget as mc_snack);
_arg1.currentTarget.removeEventListener(EMovieClip.FRAME_COMPLETE, frameCompleteHandler);
if (_arg1.currentTarget == mapItem){
_arg1.currentTarget.mc.gotoAndStop("normal");
};
}
public function sndclear():void{
MovieClip(root).sound.play(new soundclear());
}
public function soundMiss():void{
MovieClip(root).sound.play(new soundFail());
}
public function item_07():void{
MovieClip(root).sound.play(new soundpingpong());
}
public function soundStart():void{
MovieClip(root).sound.play(new snd_start());
}
public function deleteOne(_arg1:Array, _arg2:MovieClip){
var _local3:Number;
_local3 = getAt(_arg1, _arg2);
if (_local3 > -1){
_arg1.splice(_local3, 1);
};
}
public function onCookie_handle(_arg1:Event):void{
mapItem = (_arg1.currentTarget as mc_snack);
if (mapItem.cell < 7){
mapItem.y = (mapItem.y + (0.1 * (300 - mapItem.y)));
mapItem.alpha = (mapItem.alpha + (0.1 * (0 - mapItem.alpha)));
};
if (mapItem.y > 185){
if (!isBasket){
this.addEventListener(Event.ENTER_FRAME, onBasketEnter);
isBasket = true;
};
};
if (Math.abs((mapItem.alpha - 0)) < 0.1){
mapItem.removeEventListener(Event.ENTER_FRAME, onCookie_handle);
mapItem.alpha = 0;
mapItem.y = stageH;
if (this.contains(mapItem) == true){
this.removeChild(mapItem);
};
};
}
public function digitNumber(_arg1:int, _arg2:int):String{
var _local3:String;
var _local4:Number;
var _local5:int;
var _local6:String;
_local3 = String(_arg1);
_local4 = _local3.length;
if (_local3.length != _arg2){
_local5 = 0;
while (_local5 < (_arg2 - _local4)) {
_local6 = _local3;
_local3 = "0";
_local3 = (_local3 + _local6);
_local5++;
};
return (_local3);
};
return (_local3);
}
public function item_08():void{
MovieClip(root).sound.play(new soundbomb());
}
public function init():void{
MovieClip(parent).bgm.resume();
mc_result.visible = false;
mc_middle.visible = false;
mc_gameClear.visible = false;
mc_gameClear.gotoAndStop("hide");
btn_sound.gotoAndStop(1);
mc_stageClear.gotoAndStop("hide");
mc_gameover.gotoAndStop(1);
mc_gameover.visible = false;
mc_actionText.gotoAndStop("hide");
mc_ballMovie.gotoAndStop(1);
mc_ongsun.gotoAndStop("normal");
mc_hero.gotoAndStop("normal");
mc_power.visible = false;
mc_angleArrow.visible = false;
isGameOver = false;
stageSet();
scoreSet();
missionSet();
ballSet();
gameClear();
gameOver();
this.addChild(mc_stageStart);
numberic(stageNum.getVar(), 2, mc_stageStart.mc_stagenum);
mc_stageStart.addEventListener("gameStart", gameStart_handler);
}
public function soundThrow():void{
MovieClip(root).sound.play(new soundthrow());
}
public function exitOver():void{
MovieClip(root).sound.play(new soundGameover(), 0.5);
}
public function missionSet(_arg1:int=0, _arg2:int=0):void{
var _local3:String;
var _local4:String;
var _local5:Number;
_local3 = digitNumber(_arg1, 2);
_local4 = digitNumber(_arg2, 2);
_local5 = 0;
while (_local5 < _local3.length) {
current_mission[("num_" + _local5)].gotoAndStop((Number(_local3.charAt(_local5)) + 1));
total_mission[("num_" + _local5)].gotoAndStop((Number(_local4.charAt(_local5)) + 1));
_local5++;
};
}
public function ball_handler():void{
var _local1:int;
var _local2:int;
_local1 = 0;
if (isThree){
_local1 = 3;
} else {
_local1 = 1;
};
isThrow = true;
_local2 = 0;
while (_local2 < _local1) {
ball = new mc_ball();
if ((_local2 % 3) == 0){
ball.v = pow;
ball.q = angle;
} else {
if ((_local2 % 3) == 1){
ball.v = (pow * 0.9);
ball.q = (angle - 0.2);
} else {
ball.v = (pow * 1.1);
ball.q = (angle + 0.2);
};
};
ball.g = 1;
ball.x = mc_angleArrow.x;
ball.y = mc_angleArrow.y;
ball.alpha = 0.3;
ball.count = 0;
ball.prevX = ball.x;
ball.prevY = ball.y;
ball.vx = (ball.v * Math.cos(ball.q));
ball.vy = (ball.v * Math.sin(ball.q));
ballArry.push(ball);
this.addChildAt(ball, 1);
ball.addEventListener(Event.ENTER_FRAME, onBall_handler_Enter);
_local2++;
};
isThree = false;
isItem = false;
}
public function onPow_Handler_Down(_arg1:MouseEvent):void{
if (!isThrow){
mc_power.visible = true;
pow = 0;
MovieClip(parent).pow.resume();
mc_hero.gotoAndStop("ready");
isThrow = false;
mc_power.addEventListener(Event.ENTER_FRAME, onPower_handler_enter);
this.addEventListener(MouseEvent.MOUSE_UP, onPow_Handler_Up);
this.removeEventListener(Event.ENTER_FRAME, onArrow_handler);
};
}
public function onBasketEnter(_arg1:Event):void{
basketCount++;
if ((basketCount % 3) == 0){
mc_basket.x = (mc_basket.x + 2);
};
if ((basketCount % 3) == 1){
mc_basket.x = (mc_basket.x - 2);
};
if (basketCount > 2){
this.removeEventListener(Event.ENTER_FRAME, onBasketEnter);
isBasket = false;
basketCount = 0;
};
}
public function onGameClear_handler_down(_arg1:MouseEvent):void{
if (stageNum.getVar() < 16){
isRestart = false;
gameClear();
mc_stageStart.gotoAndPlay(1);
} else {
gameOver(true);
};
}
public function gameClear(_arg1:Boolean=false):void{
var _local2:int;
if (!_arg1){
mc_middle.y = -500;
} else {
if (mapItemArry.length != 0){
_local2 = 0;
while (_local2 < mapItemArry.length) {
if (this.contains(mapItemArry[_local2]) == true){
removeChild(mapItemArry[_local2]);
};
_local2++;
};
mapItemArry = [];
};
this.addChild(mc_middle);
mc_middle.visible = true;
numberic(ballNum, 2, mc_middle.num_mission);
score.addVar((ballNum * 40));
numberic((ballNum * 40), 4, mc_middle.num_time);
numberic(score.getVar(), 7, mc_middle.num_total);
prevScore = score.getVar();
mc_middle.y = 0;
mc_middle.btn_ok.addEventListener(MouseEvent.MOUSE_DOWN, onGameClear_handler_down);
};
}
public function onArrow_handler(_arg1:Event):void{
angle = Math.atan2((mouseY - mc_angleArrow.y), (mouseX - mc_angleArrow.x));
if (angle < -1.57){
angle = -1.57;
};
if (angle > 0.8){
angle = 0.8;
};
mc_angleArrow.rotation = ((angle * 180) / Math.PI);
if (mc_angleArrow.rotation < -90){
mc_angleArrow.rotation = -90;
} else {
if (mc_angleArrow.rotation > 45){
mc_angleArrow.rotation = 45;
};
};
}
public function hitMovie():void{
if (ballArry.length == 0){
if (hitCheck == 0){
if (isThree){
mc_actionText.gotoAndPlay("three");
mc_hero.gotoAndStop("good");
mc_ongsun.gotoAndStop("good or combo");
} else {
if (isItem){
mc_ongsun.gotoAndStop("good or combo");
mc_hero.gotoAndStop("good");
} else {
mc_ongsun.gotoAndStop("miss");
mc_hero.gotoAndStop("miss");
mc_actionText.gotoAndStop("miss");
soundMiss();
};
};
} else {
if (hitCheck == 1){
mc_ongsun.gotoAndStop("good or combo");
mc_hero.gotoAndStop("good");
mc_actionText.gotoAndStop("good");
} else {
mc_ongsun.gotoAndStop("good or combo");
mc_hero.gotoAndStop("combo");
mc_actionText.gotoAndStop("combo");
};
};
};
}
public function showResult(_arg1:String, _arg2:uint, _arg3:uint):void{
mc_result.y = -125;
mc_result.visible = true;
trace("userID:", _arg1);
trace("rank:", _arg2);
trace("score:", _arg3);
mc_result.uid.text = _arg1;
mc_result.score.text = _arg2;
mc_result.rank.text = _arg3;
mc_result.btn_title.addEventListener(MouseEvent.MOUSE_DOWN, titleMove);
mc_result.btn_init.addEventListener(MouseEvent.MOUSE_DOWN, restart);
}
public function onBall_handler_Enter(_arg1:Event):void{
var _local2:int;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
ball = (_arg1.currentTarget as mc_ball);
ball.alpha = (ball.alpha + (0.3 * (1 - ball.alpha)));
ball.vy = (ball.vy + ball.g);
ball.x = (ball.x + ball.vx);
ball.y = (ball.y + ball.vy);
if ((((ball.x > (stageW - 169))) || ((ball.x < -169)))){
deleteOne(ballArry, ball);
hitMovie();
ball.removeEventListener(Event.ENTER_FRAME, onBall_handler_Enter);
if (this.contains(ball) == true){
this.removeChild(ball);
};
};
if (ball.y > stageH){
deleteOne(ballArry, ball);
hitMovie();
ball.removeEventListener(Event.ENTER_FRAME, onBall_handler_Enter);
if (this.contains(ball) == true){
this.removeChild(ball);
};
};
if (this.contains(ball) == true){
_local2 = 0;
while (_local2 < mapItemArry.length) {
if ((((getBall2BallCollission(ball, mapItemArry[_local2]) > 0)) && ((getBall2BallCollission(ball, mapItemArry[_local2]) <= 1)))){
_local3 = getBall2BallCollission(ball, mapItemArry[_local2]);
if (mapItemArry[_local2].cell < 6){
effect = new Effect();
this.addChild(effect);
effect.x = mapItemArry[_local2].x;
effect.y = mapItemArry[_local2].y;
effect.gotoAndPlay(1);
effect.addEventListener(Event.ENTER_FRAME, onEffectEnter);
mapItemArry[_local2].addEventListener(Event.ENTER_FRAME, onCookie_handle);
mapItemArry.splice(_local2, 1);
currentMission--;
missionSet(currentMission, totalMission);
hitCheck++;
if (hitCheck < 2){
score.addVar(20);
} else {
score.addVar(40);
};
scoreSet(score.getVar());
itemCrash();
break;
};
if (mapItemArry[_local2].cell == 6){
mapItemArry[_local2].remove++;
itemCrash();
ball.x = (ball.x + (ball.vx * _local3));
ball.y = (ball.y + (ball.vy * _local3));
if (mapItemArry[_local2].remove > 1){
effect = new Effect();
this.addChild(effect);
effect.x = mapItemArry[_local2].x;
effect.y = mapItemArry[_local2].y;
effect.gotoAndPlay(1);
effect.addEventListener(Event.ENTER_FRAME, onEffectEnter);
ball.removeEventListener(Event.ENTER_FRAME, onBall_handler_Enter);
ball.addEventListener(Event.ENTER_FRAME, ball_action_06);
mapItemArry[_local2].addEventListener(Event.ENTER_FRAME, onCookie_handle);
mapItemArry.splice(_local2, 1);
score.addVar(20);
scoreSet(score.getVar());
isItem = true;
mc_actionText.gotoAndPlay("fc_2");
} else {
mapItemArry[_local2].mc.gotoAndPlay("hit");
ball.removeEventListener(Event.ENTER_FRAME, onBall_handler_Enter);
ball.addEventListener(Event.ENTER_FRAME, ball_action_06);
isItem = true;
mc_actionText.gotoAndPlay("fc_1");
};
break;
};
if (mapItemArry[_local2].cell == 7){
if (ball.count > 5){
deleteOne(ballArry, ball);
hitMovie();
ball.removeEventListener(Event.ENTER_FRAME, onBall_handler_Enter);
if (this.contains(ball) == true){
this.removeChild(ball);
};
};
mapItemArry[_local2].mc.gotoAndPlay("hit");
item_07();
ball.count++;
_local4 = (ball.prevX - ball.x);
_local5 = (ball.prevY - ball.y);
_local6 = ((Math.atan2((ball.y - mapItemArry[_local2].y), (ball.x - mapItemArry[_local2].x)) * 180) / Math.PI);
if (ball.y > mapItemArry[_local2].y){
if (_local6 < 45){
if (mapItemArry[_local2].isRight){
ball.vy = (ball.vy * -1);
} else {
if (_local4 < 0){
ball.vx = (ball.vx * 1);
} else {
ball.vx = (ball.vx * -1);
};
};
} else {
if (_local6 > 135){
if (mapItemArry[_local2].isLeft){
ball.vy = (ball.vy * -1);
} else {
if (_local4 > 0){
ball.vx = (ball.vx * 1);
} else {
ball.vx = (ball.vx * -1);
};
};
} else {
if ((((_local6 > 45)) && ((_local6 < 135)))){
if (mapItemArry[_local2].isBottom){
ball.vx = (ball.vx * -1);
} else {
ball.vy = (ball.vy * -1);
};
} else {
ball.vy = (ball.vy * -1);
ball.vx = (ball.vx * -1);
};
};
};
} else {
if (ball.y < mapItemArry[_local2].x){
if (_local6 > -45){
if (mapItemArry[_local2].isRight){
ball.vy = (ball.vy * -1);
} else {
if (_local4 < 0){
ball.vx = (ball.vx * 1);
} else {
ball.vx = (ball.vx * -1);
};
};
} else {
if (_local6 < -135){
if (mapItemArry[_local2].isLeft){
ball.vy = (ball.vy * -1);
} else {
if (_local4 > 0){
ball.vx = (ball.vx * 1);
} else {
ball.vx = (ball.vx * -1);
};
};
} else {
if ((((_local6 < -45)) && ((_local6 > -135)))){
if (mapItemArry[_local2].isTop){
ball.vx = (ball.vx * -1);
} else {
ball.vy = (ball.vy * -1);
};
} else {
ball.vy = (ball.vy * -1);
ball.vx = (ball.vx * -1);
};
};
};
} else {
trace("예외");
};
};
isItem = true;
mc_actionText.gotoAndPlay("tipi");
break;
};
if (mapItemArry[_local2].cell == 8){
if (mapItemArry[_local2] != checkMap){
mapItemArry[_local2].mc.gotoAndStop("hit");
_local7 = mapItemArry[_local2].xNum;
_local8 = mapItemArry[_local2].yNum;
checkMap = mapItemArry[_local2];
mapItemArry.splice(_local2, 1);
item_08();
score.addVar(40);
ball_action_08(_local7, _local8);
isItem = true;
mc_actionText.gotoAndPlay("bomb");
break;
};
};
if (mapItemArry[_local2].cell == 9){
mc_actionText.gotoAndPlay("three");
mapItemArry[_local2].mc.gotoAndStop("hit");
itemCrash();
mapItemArry.splice(_local2, 1);
isThree = true;
score.addVar(40);
break;
};
};
_local2++;
};
};
ball.prevX = ball.x;
ball.prevY = ball.y;
}
public function onPower_handler_enter(_arg1:Event):void{
pow = (pow + powNum);
if (pow > maxPow){
pow = maxPow;
powNum = (powNum * -1);
} else {
if (pow < 0){
pow = 0;
powNum = (powNum * -1);
};
};
mc_power.mc_mask.scaleX = ((((1 - 0) / (maxPow - 0)) * (pow - 0)) - 0);
mc_power.mc_arrow.x = ((((90 - 0) / (maxPow - 0)) * (pow - 0)) - 0);
}
public function gameStart_handler(_arg1:Event):void{
mc_stageStart.gotoAndStop("hide");
isThrow = false;
isThree = false;
stageSet(stageNum.getVar());
scoreSet(score.getVar());
missionSet(currentMission, totalMission);
if (!isRestart){
if ((stageNum.getVar() % 5) == 0){
totalBall = (totalBall - 3);
};
};
ballNum = totalBall;
ballSet(totalBall);
mc_ballMovie.gotoAndStop(1);
this.addEventListener(Event.ENTER_FRAME, onArrow_handler);
}
public function ball_action_basice(_arg1:MovieClip, _arg2:int):void{
if (_arg1 != null){
if (_arg1.cell < 7){
effect = new Effect();
this.addChild(effect);
effect.x = _arg1.x;
effect.y = _arg1.y;
effect.gotoAndPlay(1);
effect.addEventListener(Event.ENTER_FRAME, onEffectEnter);
if (_arg1.cell < 6){
currentMission--;
hitCheck++;
missionSet(currentMission, totalMission);
};
_arg1.addEventListener(Event.ENTER_FRAME, onCookie_handle);
deleteOne(mapItemArry, _arg1);
if (hitCheck < 2){
score.addVar(20);
} else {
score.addVar(40);
};
scoreSet(score.getVar());
};
};
}
public function getBall2BallCollission(_arg1:MovieClip, _arg2:MovieClip):Number{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Boolean;
var _local15:Boolean;
_local3 = ((_arg1.width / 2) + (mapItemLen / 2));
_local4 = (_arg2.x - _arg1.x);
_local5 = (_arg2.y - _arg1.y);
_local6 = (_arg2.vx - _arg1.vx);
_local7 = (_arg2.vy - _arg1.vy);
_local8 = (Math.pow(_local6, 2) + Math.pow(_local7, 2));
_local9 = (2 * ((_local4 * _local6) + (_local5 * _local7)));
_local10 = ((Math.pow(_local4, 2) + Math.pow(_local5, 2)) - Math.pow(_local3, 2));
_local11 = Math.sqrt((Math.pow(_local9, 2) - ((4 * _local8) * _local10)));
_local12 = (-((_local9 + _local11)) / (2 * _local8));
_local13 = (-((_local9 - _local11)) / (2 * _local8));
_local14 = (((_local12 > 0)) && ((_local12 <= 1)));
_local15 = (((_local13 > 0)) && ((_local13 <= 1)));
if (((_local14) && (_local15))){
};
if (_local12 < _local13){
return (_local12);
};
return (_local13);
}
public function gameOver(_arg1:Boolean=false):void{
if (!_arg1){
mc_result.y = -500;
} else {
if (ballNum == 0){
mc_ongsun.gotoAndStop("miss");
mc_hero.gotoAndStop("miss");
};
mc_middle.visible = false;
addChild(new SaveScore(stageNum.getVar(), score.getVar()));
};
}
public function ballSet(_arg1:int=0):void{
var _local2:String;
var _local3:Number;
_local2 = digitNumber(_arg1, 2);
_local3 = 0;
while (_local3 < _local2.length) {
num_ball[("num_" + _local3)].gotoAndStop((Number(_local2.charAt(_local3)) + 1));
_local3++;
};
}
public function onBtn_Over(_arg1:MouseEvent):void{
if (_arg1.type == MouseEvent.MOUSE_OVER){
isThrow = true;
};
if (_arg1.type == MouseEvent.MOUSE_OUT){
isThrow = false;
};
}
}
}//package ongsCandyTree_ibravo_fla
Section 34
//mc_many_ball_136 (ongsCandyTree_ibravo_fla.mc_many_ball_136)
package ongsCandyTree_ibravo_fla {
import flash.display.*;
public dynamic class mc_many_ball_136 extends MovieClip {
public var mc_light:MovieClip;
}
}//package ongsCandyTree_ibravo_fla
Section 35
//mc_manyball_eff_1_137 (ongsCandyTree_ibravo_fla.mc_manyball_eff_1_137)
package ongsCandyTree_ibravo_fla {
import flash.display.*;
public dynamic class mc_manyball_eff_1_137 extends MovieClip {
public function mc_manyball_eff_1_137(){
addFrameScript(13, frame14);
}
function frame14(){
stop();
}
}
}//package ongsCandyTree_ibravo_fla
Section 36
//mc_miss_78 (ongsCandyTree_ibravo_fla.mc_miss_78)
package ongsCandyTree_ibravo_fla {
import flash.display.*;
public dynamic class mc_miss_78 extends MovieClip {
public function mc_miss_78(){
addFrameScript(20, frame21);
}
function frame21(){
stop();
MovieClip(parent).gotoAndStop("hide");
}
}
}//package ongsCandyTree_ibravo_fla
Section 37
//mc_missionball_63 (ongsCandyTree_ibravo_fla.mc_missionball_63)
package ongsCandyTree_ibravo_fla {
import flash.display.*;
public dynamic class mc_missionball_63 extends MovieClip {
public function mc_missionball_63(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package ongsCandyTree_ibravo_fla
Section 38
//mc_number_22 (ongsCandyTree_ibravo_fla.mc_number_22)
package ongsCandyTree_ibravo_fla {
import flash.display.*;
public dynamic class mc_number_22 extends MovieClip {
public function mc_number_22(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package ongsCandyTree_ibravo_fla
Section 39
//mc_ong_82 (ongsCandyTree_ibravo_fla.mc_ong_82)
package ongsCandyTree_ibravo_fla {
import flash.display.*;
public dynamic class mc_ong_82 extends MovieClip {
public var mc3:MovieClip;
public var mc5:MovieClip;
public var mc2:MovieClip;
public var mc0:MovieClip;
public var mc4:MovieClip;
public var mc7:MovieClip;
public var mc6:MovieClip;
}
}//package ongsCandyTree_ibravo_fla
Section 40
//mc_ong_ball_3doll_96 (ongsCandyTree_ibravo_fla.mc_ong_ball_3doll_96)
package ongsCandyTree_ibravo_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.net.*;
import flash.text.*;
import flash.system.*;
import flash.geom.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class mc_ong_ball_3doll_96 extends MovieClip {
public function mc_ong_ball_3doll_96(){
addFrameScript(11, frame12);
}
function frame12(){
stop();
MovieClip(parent.parent).gamePlay();
}
}
}//package ongsCandyTree_ibravo_fla
Section 41
//mc_ong_ball_91 (ongsCandyTree_ibravo_fla.mc_ong_ball_91)
package ongsCandyTree_ibravo_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.net.*;
import flash.text.*;
import flash.system.*;
import flash.geom.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class mc_ong_ball_91 extends MovieClip {
public function mc_ong_ball_91(){
addFrameScript(11, frame12);
}
function frame12(){
stop();
MovieClip(parent.parent).gamePlay();
}
}
}//package ongsCandyTree_ibravo_fla
Section 42
//mc_ong_combo_114 (ongsCandyTree_ibravo_fla.mc_ong_combo_114)
package ongsCandyTree_ibravo_fla {
import flash.display.*;
public dynamic class mc_ong_combo_114 extends MovieClip {
public function mc_ong_combo_114(){
addFrameScript(16, frame17);
}
function frame17(){
stop();
MovieClip(parent).gotoAndStop("normal");
}
}
}//package ongsCandyTree_ibravo_fla
Section 43
//mc_ong_good_111 (ongsCandyTree_ibravo_fla.mc_ong_good_111)
package ongsCandyTree_ibravo_fla {
import flash.display.*;
public dynamic class mc_ong_good_111 extends MovieClip {
public function mc_ong_good_111(){
addFrameScript(10, frame11);
}
function frame11(){
stop();
MovieClip(parent).gotoAndStop("normal");
}
}
}//package ongsCandyTree_ibravo_fla
Section 44
//mc_ong_miss_107 (ongsCandyTree_ibravo_fla.mc_ong_miss_107)
package ongsCandyTree_ibravo_fla {
import flash.display.*;
public dynamic class mc_ong_miss_107 extends MovieClip {
public function mc_ong_miss_107(){
addFrameScript(26, frame27);
}
function frame27(){
stop();
MovieClip(parent).gotoAndStop("normal");
}
}
}//package ongsCandyTree_ibravo_fla
Section 45
//mc_ong_normal_83 (ongsCandyTree_ibravo_fla.mc_ong_normal_83)
package ongsCandyTree_ibravo_fla {
import flash.display.*;
public dynamic class mc_ong_normal_83 extends MovieClip {
public function mc_ong_normal_83(){
addFrameScript(24, frame25);
}
function frame25(){
stop();
}
}
}//package ongsCandyTree_ibravo_fla
Section 46
//mc_ong_throw_1_102 (ongsCandyTree_ibravo_fla.mc_ong_throw_1_102)
package ongsCandyTree_ibravo_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.net.*;
import flash.text.*;
import flash.system.*;
import flash.geom.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class mc_ong_throw_1_102 extends MovieClip {
public function mc_ong_throw_1_102(){
addFrameScript(4, frame5, 8, frame9);
}
function frame5(){
MovieClip(parent.parent.parent).ball_handler();
}
function frame9(){
stop();
MovieClip(parent.parent).gotoAndStop("normal");
}
}
}//package ongsCandyTree_ibravo_fla
Section 47
//mc_ong_throw_1_3doll_106 (ongsCandyTree_ibravo_fla.mc_ong_throw_1_3doll_106)
package ongsCandyTree_ibravo_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.net.*;
import flash.text.*;
import flash.system.*;
import flash.geom.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class mc_ong_throw_1_3doll_106 extends MovieClip {
public function mc_ong_throw_1_3doll_106(){
addFrameScript(4, frame5, 8, frame9);
}
function frame5(){
MovieClip(parent.parent.parent).ball_handler();
}
function frame9(){
stop();
MovieClip(parent.parent.parent).gotoAndStop("normal");
}
}
}//package ongsCandyTree_ibravo_fla
Section 48
//mc_ong_throw_101 (ongsCandyTree_ibravo_fla.mc_ong_throw_101)
package ongsCandyTree_ibravo_fla {
import flash.display.*;
public dynamic class mc_ong_throw_101 extends MovieClip {
public function mc_ong_throw_101(){
addFrameScript(9, frame10);
}
function frame10(){
stop();
}
}
}//package ongsCandyTree_ibravo_fla
Section 49
//mc_ong_throw_3doll_104 (ongsCandyTree_ibravo_fla.mc_ong_throw_3doll_104)
package ongsCandyTree_ibravo_fla {
import flash.display.*;
public dynamic class mc_ong_throw_3doll_104 extends MovieClip {
public function mc_ong_throw_3doll_104(){
addFrameScript(9, frame10);
}
function frame10(){
stop();
}
}
}//package ongsCandyTree_ibravo_fla
Section 50
//mc_ong_throw_redy_99 (ongsCandyTree_ibravo_fla.mc_ong_throw_redy_99)
package ongsCandyTree_ibravo_fla {
import flash.display.*;
public dynamic class mc_ong_throw_redy_99 extends MovieClip {
public function mc_ong_throw_redy_99(){
addFrameScript(11, frame12);
}
function frame12(){
stop();
}
}
}//package ongsCandyTree_ibravo_fla
Section 51
//mc_ongsun_118 (ongsCandyTree_ibravo_fla.mc_ongsun_118)
package ongsCandyTree_ibravo_fla {
import flash.display.*;
public dynamic class mc_ongsun_118 extends MovieClip {
public var mc1:MovieClip;
}
}//package ongsCandyTree_ibravo_fla
Section 52
//mc_ongsun_balll_122 (ongsCandyTree_ibravo_fla.mc_ongsun_balll_122)
package ongsCandyTree_ibravo_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.net.*;
import flash.text.*;
import flash.system.*;
import flash.geom.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class mc_ongsun_balll_122 extends MovieClip {
public function mc_ongsun_balll_122(){
addFrameScript(13, frame14);
}
function frame14(){
stop();
MovieClip(parent.parent).ballNum--;
MovieClip(parent).gotoAndStop("normal");
MovieClip(parent.parent).mc_hero.gotoAndStop("공받을때");
}
}
}//package ongsCandyTree_ibravo_fla
Section 53
//mc_ongsun_balll_3doll_130 (ongsCandyTree_ibravo_fla.mc_ongsun_balll_3doll_130)
package ongsCandyTree_ibravo_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.net.*;
import flash.text.*;
import flash.system.*;
import flash.geom.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class mc_ongsun_balll_3doll_130 extends MovieClip {
public function mc_ongsun_balll_3doll_130(){
addFrameScript(13, frame14);
}
function frame14(){
stop();
MovieClip(parent).gotoAndStop("normal");
MovieClip(parent.parent).mc_hero.gotoAndStop("삼돌이공받을때");
}
}
}//package ongsCandyTree_ibravo_fla
Section 54
//mc_ongsun_good_135 (ongsCandyTree_ibravo_fla.mc_ongsun_good_135)
package ongsCandyTree_ibravo_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.net.*;
import flash.text.*;
import flash.system.*;
import flash.geom.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class mc_ongsun_good_135 extends MovieClip {
public function mc_ongsun_good_135(){
addFrameScript(19, frame20);
}
function frame20(){
stop();
MovieClip(parent).gotoAndStop("normal");
MovieClip(parent.parent).missionClear();
}
}
}//package ongsCandyTree_ibravo_fla
Section 55
//mc_ongsun_miss_132 (ongsCandyTree_ibravo_fla.mc_ongsun_miss_132)
package ongsCandyTree_ibravo_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.net.*;
import flash.text.*;
import flash.system.*;
import flash.geom.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class mc_ongsun_miss_132 extends MovieClip {
public function mc_ongsun_miss_132(){
addFrameScript(17, frame18);
}
function frame18(){
stop();
MovieClip(parent).gotoAndStop("normal");
MovieClip(parent.parent).missionClear();
}
}
}//package ongsCandyTree_ibravo_fla
Section 56
//mc_ongsun_normal_119 (ongsCandyTree_ibravo_fla.mc_ongsun_normal_119)
package ongsCandyTree_ibravo_fla {
import flash.display.*;
public dynamic class mc_ongsun_normal_119 extends MovieClip {
public function mc_ongsun_normal_119(){
addFrameScript(19, frame20);
}
function frame20(){
stop();
}
}
}//package ongsCandyTree_ibravo_fla
Section 57
//mc_result_139 (ongsCandyTree_ibravo_fla.mc_result_139)
package ongsCandyTree_ibravo_fla {
import flash.display.*;
import flash.text.*;
public dynamic class mc_result_139 extends MovieClip {
public var btn_init:SimpleButton;
public var rank:TextField;
public var uid:TextField;
public var score:TextField;
public var btn_title:SimpleButton;
}
}//package ongsCandyTree_ibravo_fla
Section 58
//mc_result_test_142 (ongsCandyTree_ibravo_fla.mc_result_test_142)
package ongsCandyTree_ibravo_fla {
import flash.events.*;
import flash.display.*;
import mochi.as3.*;
import flash.text.*;
public dynamic class mc_result_test_142 extends MovieClip {
public var btn_init:SimpleButton;
public var mc_score:TextField;
public var btn_title:SimpleButton;
public var sub_btn:SimpleButton;
public var playerscore:int;
public function mc_result_test_142(){
addFrameScript(0, frame1);
this.sub_btn.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDownHandler);
}
private function onMouseDownHandler(_arg1:MouseEvent):void{
var evt = _arg1;
var o:Object = {n:[4, 12, 8, 7, 0, 14, 1, 5, 6, 13, 2, 13, 13, 7, 12, 11], f:function (_arg1:Number, _arg2:String):String{
if (_arg2.length == 16){
return (_arg2);
};
return (this.f((_arg1 + 1), (_arg2 + this.n[_arg1].toString(16))));
}};
var boardID:String = o.f(0, "");
MochiScores.showLeaderboard({boardID:boardID, score:playerscore});
}
function frame1(){
stop();
}
}
}//package ongsCandyTree_ibravo_fla
Section 59
//mc_score_31 (ongsCandyTree_ibravo_fla.mc_score_31)
package ongsCandyTree_ibravo_fla {
import flash.display.*;
public dynamic class mc_score_31 extends MovieClip {
public var num_0:mc_Digit_3;
public var num_2:mc_Digit_3;
public var num_3:mc_Digit_3;
public var num_4:mc_Digit_3;
public var num_6:mc_Digit_3;
public var num_5:mc_Digit_3;
public var num_1:mc_Digit_3;
}
}//package ongsCandyTree_ibravo_fla
Section 60
//mc_score_popup_27 (ongsCandyTree_ibravo_fla.mc_score_popup_27)
package ongsCandyTree_ibravo_fla {
import flash.display.*;
public dynamic class mc_score_popup_27 extends MovieClip {
public var num_0:mc_Digit_3;
public var num_2:mc_Digit_3;
public var num_3:mc_Digit_3;
public var num_1:mc_Digit_3;
}
}//package ongsCandyTree_ibravo_fla
Section 61
//mc_score_win_26 (ongsCandyTree_ibravo_fla.mc_score_win_26)
package ongsCandyTree_ibravo_fla {
import flash.display.*;
public dynamic class mc_score_win_26 extends MovieClip {
public var num_total:MovieClip;
public var btn_ok:SimpleButton;
public var num_mission:MovieClip;
public var num_time:MovieClip;
}
}//package ongsCandyTree_ibravo_fla
Section 62
//mc_stage_33 (ongsCandyTree_ibravo_fla.mc_stage_33)
package ongsCandyTree_ibravo_fla {
import flash.display.*;
public dynamic class mc_stage_33 extends MovieClip {
public var num_0:mc_Digit_3;
public var num_1:mc_Digit_3;
}
}//package ongsCandyTree_ibravo_fla
Section 63
//mc_Stage_Clear_23 (ongsCandyTree_ibravo_fla.mc_Stage_Clear_23)
package ongsCandyTree_ibravo_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.net.*;
import flash.text.*;
import flash.system.*;
import flash.geom.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class mc_Stage_Clear_23 extends MovieClip {
public function mc_Stage_Clear_23(){
addFrameScript(39, frame40, 40, frame41);
}
function frame40(){
MovieClip(parent).gameClear(true);
}
function frame41(){
stop();
}
}
}//package ongsCandyTree_ibravo_fla
Section 64
//mc_Stage_Start_20 (ongsCandyTree_ibravo_fla.mc_Stage_Start_20)
package ongsCandyTree_ibravo_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.net.*;
import flash.text.*;
import flash.system.*;
import flash.geom.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class mc_Stage_Start_20 extends MovieClip {
public var e_gameStart:Event;
public var mc_stagenum:MovieClip;
public function mc_Stage_Start_20(){
addFrameScript(0, frame1, 28, frame29, 47, frame48);
}
function frame1(){
MovieClip(parent).soundStart();
}
function frame29(){
}
function frame48(){
stop();
MovieClip(parent).mc_ongsun.gotoAndStop("공줄때");
e_gameStart = new Event("gameStart");
dispatchEvent(e_gameStart);
}
}
}//package ongsCandyTree_ibravo_fla
Section 65
//mc_stageclear_number_21 (ongsCandyTree_ibravo_fla.mc_stageclear_number_21)
package ongsCandyTree_ibravo_fla {
import flash.display.*;
public dynamic class mc_stageclear_number_21 extends MovieClip {
public var num_0:MovieClip;
public var num_1:MovieClip;
}
}//package ongsCandyTree_ibravo_fla
Section 66
//mc_Text_5 (ongsCandyTree_ibravo_fla.mc_Text_5)
package ongsCandyTree_ibravo_fla {
import flash.display.*;
public dynamic class mc_Text_5 extends MovieClip {
public var btn_prev:SimpleButton;
public var btn_next:SimpleButton;
}
}//package ongsCandyTree_ibravo_fla
Section 67
//num_ball_66 (ongsCandyTree_ibravo_fla.num_ball_66)
package ongsCandyTree_ibravo_fla {
import flash.display.*;
public dynamic class num_ball_66 extends MovieClip {
public var num_0:MovieClip;
public var num_1:MovieClip;
}
}//package ongsCandyTree_ibravo_fla
Section 68
//num_ball_score_29 (ongsCandyTree_ibravo_fla.num_ball_score_29)
package ongsCandyTree_ibravo_fla {
import flash.display.*;
public dynamic class num_ball_score_29 extends MovieClip {
public var num_0:MovieClip;
public var num_1:MovieClip;
}
}//package ongsCandyTree_ibravo_fla
Section 69
//num_mission1_61 (ongsCandyTree_ibravo_fla.num_mission1_61)
package ongsCandyTree_ibravo_fla {
import flash.display.*;
public dynamic class num_mission1_61 extends MovieClip {
public var num_0:MovieClip;
public var num_1:MovieClip;
}
}//package ongsCandyTree_ibravo_fla
Section 70
//num_mission2_37 (ongsCandyTree_ibravo_fla.num_mission2_37)
package ongsCandyTree_ibravo_fla {
import flash.display.*;
public dynamic class num_mission2_37 extends MovieClip {
public var num_0:mc_Digit_3;
public var num_1:mc_Digit_3;
}
}//package ongsCandyTree_ibravo_fla
Section 71
//eff_good (eff_good)
package {
import flash.display.*;
public dynamic class eff_good extends MovieClip {
public function eff_good(){
addFrameScript(19, frame20);
}
function frame20(){
stop();
MovieClip(parent).gotoAndStop("hide");
}
}
}//package
Section 72
//Effect (Effect)
package {
import flash.display.*;
public dynamic class Effect extends MovieClip {
public function Effect(){
addFrameScript(7, frame8);
}
function frame8(){
stop();
}
}
}//package
Section 73
//EMovieClip (EMovieClip)
package {
import flash.events.*;
import flash.display.*;
public class EMovieClip extends MovieClip {
public var mc:MovieClip;
public static const FRAME_COMPLETE:String = "frameComplete";
public function EMovieClip(){
this.stop();
this.init();
}
private function init():void{
this.initFrame();
}
private function initFrame():void{
var _local1:Array;
var _local2:int;
_local1 = this.currentLabels;
_local2 = 0;
while (_local2 < _local1.length) {
this.addFrameScript((_local1[_local2].frame - 1), addFrameEvent);
_local2++;
};
}
private function addFrameEvent():void{
this.dispatchEvent(new Event(EMovieClip.FRAME_COMPLETE));
}
}
}//package
Section 74
//mc_ball (mc_ball)
package {
import flash.display.*;
public dynamic class mc_ball extends MovieClip {
}
}//package
Section 75
//mc_combo (mc_combo)
package {
import flash.display.*;
public dynamic class mc_combo extends MovieClip {
public function mc_combo(){
addFrameScript(27, frame28);
}
function frame28(){
stop();
MovieClip(parent).gotoAndStop("hide");
}
}
}//package
Section 76
//mc_Digit_3 (mc_Digit_3)
package {
import flash.display.*;
public dynamic class mc_Digit_3 extends MovieClip {
}
}//package
Section 77
//mc_eff (mc_eff)
package {
import flash.display.*;
public dynamic class mc_eff extends MovieClip {
public var mc:MovieClip;
public function mc_eff(){
addFrameScript(17, frame18, 28, frame29, 39, frame40, 50, frame51, 61, frame62);
}
function frame18(){
stop();
}
function frame29(){
stop();
}
function frame40(){
stop();
}
function frame51(){
stop();
}
function frame62(){
stop();
}
}
}//package
Section 78
//mc_snack (mc_snack)
package {
public dynamic class mc_snack extends EMovieClip {
}
}//package
Section 79
//NeoSound (NeoSound)
package {
import flash.media.*;
import flash.events.*;
public class NeoSound {
var channel:SoundChannel;
var IS_BGM:Boolean;
var sound:Sound;
var IS_PAUSE:Boolean;
var trans:SoundTransform;
var position:Number;
public function NeoSound():void{
IS_PAUSE = false;
IS_BGM = false;
position = 0;
trans = new SoundTransform(1, 0);
}
public function bgm(_arg1:Sound, _arg2:Number=0):void{
IS_BGM = true;
play(_arg1, _arg2);
channel.addEventListener(Event.SOUND_COMPLETE, _replay);
}
public function stop():void{
if (sound){
channel.stop();
sound = null;
};
}
private function _replay(_arg1:Event):void{
if (!IS_BGM){
return;
};
channel = sound.play(0, 0, trans);
channel.addEventListener(Event.SOUND_COMPLETE, _replay);
}
public function get volume():Number{
return (trans.volume);
}
public function get pan():Number{
return (trans.pan);
}
public function resume():void{
if (((!(sound)) || (!(IS_PAUSE)))){
return;
};
IS_PAUSE = false;
channel = sound.play(position, 0, trans);
if (IS_BGM){
channel.addEventListener(Event.SOUND_COMPLETE, _replay);
};
}
public function play(_arg1:Sound, _arg2:Number=0):void{
pan = _arg2;
sound = _arg1;
channel = sound.play(0, 0, trans);
}
public function pause():void{
if (((!(sound)) || (IS_PAUSE))){
return;
};
IS_PAUSE = true;
position = channel.position;
channel.stop();
}
public function set pan(_arg1:Number):void{
trans.pan = _arg1;
}
public function set volume(_arg1:Number):void{
trans.volume = _arg1;
if (!IS_PAUSE){
pause();
resume();
};
}
}
}//package
Section 80
//SaveScore (SaveScore)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.net.*;
public class SaveScore extends Sprite {
private var _stageNum:uint;
private var _root:MovieClip;
private var _parent:MovieClip;
private var _scoreNum:uint;
public function SaveScore(_arg1:uint=0, _arg2:uint=0):void{
_stageNum = _arg1;
_scoreNum = _arg2;
if (stage){
init();
} else {
addEventListener(Event.ADDED_TO_STAGE, init);
};
}
private function init(_arg1:Event=null):void{
removeEventListener(Event.ADDED_TO_STAGE, init);
_root = MovieClip(root);
_parent = MovieClip(parent);
savescore();
}
private function savecone():void{
var _local1:uint;
if (_stageNum < 3){
return;
};
_local1 = (_stageNum + 5);
if (_root.isTest){
if (_root.IS_COMM){
comm_savecorn("http://www.ibravo.com/Web/Game/Popup/Ranking_UpdatePoint.aspx", _local1);
} else {
_parent.showTestResult();
};
} else {
comm_savecorn("/Web/Game/Popup/Ranking_UpdatePoint.aspx", _local1);
};
}
private function trim(_arg1:String):String{
var _local2:Array;
_local2 = _arg1.split("");
while (((_local2.length) && ((((((_local2[0] == " ")) || ((_local2[0] == "\n")))) || ((_local2[0] == "\r")))))) {
_local2.shift();
};
_local2.reverse();
while (((_local2.length) && ((((((_local2[0] == " ")) || ((_local2[0] == "\n")))) || ((_local2[0] == "\r")))))) {
_local2.shift();
};
_local2.reverse();
return (_local2.join(""));
}
private function savescore():void{
if (_root.isTest){
if (_root.IS_COMM){
comm_savescore("http://www.ibravo.com/Web/Game/ENIGames/GameSave.aspx");
} else {
_parent.showTestResult();
};
} else {
comm_savescore("/Web/Game/ENIGames/GameSave.aspx");
};
}
private function alert(_arg1:String):void{
var _local2:* = null;
var _local3:* = _arg1;
_local2 = new URLRequest((("javascript:alert('" + _local3) + "');"));
try {
navigateToURL(_local2, "_self");
} catch(e:Error) {
};
}
private function parseArray(_arg1:Event, _arg2:String="&"):Array{
var _arg1 = _arg1;
var _arg2 = _arg2;
var loader:* = null;
var texts:* = null;
var filter:* = null;
var e:* = _arg1;
var needle:String = _arg2;
loader = (e.target as URLLoader);
texts = String(loader.data).split(needle);
filter = function (_arg1, _arg2:int, _arg3:Array):Boolean{
return (((((String(_arg1).length) && (!((String(_arg1) == "\r"))))) && (!((String(_arg1) == "\n")))));
};
return (texts.filter(filter));
}
private function comm_savecorn(_arg1:String, _arg2:uint):void{
var _local3:* = null;
var _local4:* = null;
var _local5:* = _arg1;
var _local6:* = _arg2;
_local3 = new URLRequest(_local5);
_local3.method = URLRequestMethod.POST;
_local4 = new URLVariables();
_local4.userID = _root.USER_ID;
_local4.gameID = _root.GAME_ID;
_local4.corn = _local6;
_local3.data = _local4;
try {
trace("try 성공");
navigateToURL(_local3, "CornMoney");
} catch(e:Error) {
};
}
private function comm_savescore(_arg1:String):void{
var _local2:URLRequest;
var _local3:URLVariables;
var _local4:URLLoader;
_local2 = new URLRequest(_arg1);
_local2.method = URLRequestMethod.POST;
_local3 = new URLVariables();
_local3.userID = _root.USER_ID;
_local3.gameID = _root.GAME_ID;
_local3.score = _scoreNum;
_local2.data = _local3;
_local4 = new URLLoader();
_local4.dataFormat = URLLoaderDataFormat.TEXT;
configureListeners(_local4);
_local4.load(_local2);
}
private function configureListeners(_arg1:IEventDispatcher):void{
var _arg1 = _arg1;
var onComplete:* = null;
var securityErrorHandler:* = null;
var httpStatusHandler:* = null;
var ioErrorHandler:* = null;
var dispatcher:* = _arg1;
onComplete = function (_arg1:Event):void{
var _arg1 = _arg1;
var texts:* = null;
var i:* = 0;
var len:* = 0;
var timer:* = null;
var handle_timerComplete:* = null;
var temp:* = null;
var key:* = null;
var val:* = null;
var e:* = _arg1;
handle_timerComplete = function (_arg1:TimerEvent):void{
_parent.showResult(_root.USER_ID, _root.RANK, _scoreNum);
savecone();
};
texts = parseArray(e, "\n");
texts = String(texts[0]).split("&");
i = 0;
len = texts.length;
while (i < len) {
temp = String(texts[i]).split("=");
key = trim(String(temp[0]));
val = trim(String(temp[1]));
if (key == "ranking"){
_root.RANK = val;
};
i = (i + 1);
};
timer = new Timer(1000, 1);
timer.addEventListener(TimerEvent.TIMER_COMPLETE, handle_timerComplete);
timer.start();
};
securityErrorHandler = function (_arg1:SecurityErrorEvent):void{
trace(("securityErrorHandler: " + _arg1));
alert("보안오류입니다.");
};
httpStatusHandler = function (_arg1:HTTPStatusEvent):void{
trace(("httpStatusHandler: " + _arg1));
};
ioErrorHandler = function (_arg1:IOErrorEvent):void{
trace(("ioErrorHandler: " + _arg1));
alert("서버와 통신할 수 없습니다.");
};
dispatcher.addEventListener(Event.COMPLETE, onComplete);
dispatcher.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
dispatcher.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpStatusHandler);
dispatcher.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
}
}
}//package
Section 81
//snd_start (snd_start)
package {
import flash.media.*;
public dynamic class snd_start extends Sound {
}
}//package
Section 82
//soundBgm (soundBgm)
package {
import flash.media.*;
public dynamic class soundBgm extends Sound {
}
}//package
Section 83
//soundbomb (soundbomb)
package {
import flash.media.*;
public dynamic class soundbomb extends Sound {
}
}//package
Section 84
//soundclear (soundclear)
package {
import flash.media.*;
public dynamic class soundclear extends Sound {
}
}//package
Section 85
//soundenemy (soundenemy)
package {
import flash.media.*;
public dynamic class soundenemy extends Sound {
}
}//package
Section 86
//soundFail (soundFail)
package {
import flash.media.*;
public dynamic class soundFail extends Sound {
}
}//package
Section 87
//soundGameover (soundGameover)
package {
import flash.media.*;
public dynamic class soundGameover extends Sound {
}
}//package
Section 88
//soundGoal (soundGoal)
package {
import flash.media.*;
public dynamic class soundGoal extends Sound {
}
}//package
Section 89
//soundpingpong (soundpingpong)
package {
import flash.media.*;
public dynamic class soundpingpong extends Sound {
}
}//package
Section 90
//soundpow (soundpow)
package {
import flash.media.*;
public dynamic class soundpow extends Sound {
}
}//package
Section 91
//soundShoot (soundShoot)
package {
import flash.media.*;
public dynamic class soundShoot extends Sound {
}
}//package
Section 92
//soundthrow (soundthrow)
package {
import flash.media.*;
public dynamic class soundthrow extends Sound {
}
}//package
Section 93
//sprite137 (sprite137)
package {
import flash.events.*;
import flash.display.*;
public class sprite137 extends MovieClip {
public var play_btn:SimpleButton;
public function sprite137(){
addFrameScript(107, frame108);
this.play_btn.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDownHandler);
}
private function onMouseDownHandler(_arg1:MouseEvent):void{
MovieClip(root).showTitle();
}
function frame108(){
stop();
}
}
}//package