Section 1
//ballon_btn_172 (bestbrain_fla.ballon_btn_172)
package bestbrain_fla {
import flash.display.*;
public dynamic class ballon_btn_172 extends MovieClip {
public function ballon_btn_172(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package bestbrain_fla
Section 2
//ballon_btn_animation_171 (bestbrain_fla.ballon_btn_animation_171)
package bestbrain_fla {
import flash.events.*;
import flash.display.*;
public dynamic class ballon_btn_animation_171 extends MovieClip {
public var button:MovieClip;
public function ballon_btn_animation_171(){
addFrameScript(0, frame1, 29, frame30, 48, frame49);
}
function frame1(){
stop();
}
function frame30(){
stop();
dispatchEvent(new Event("button_in"));
}
function frame49(){
dispatchEvent(new Event("button_out"));
}
}
}//package bestbrain_fla
Section 3
//Balloon_160 (bestbrain_fla.Balloon_160)
package bestbrain_fla {
import flash.events.*;
import flash.display.*;
public dynamic class Balloon_160 extends MovieClip {
public var anim:MovieClip;
public function Balloon_160(){
addFrameScript(0, frame1, 59, frame60);
}
function frame1(){
stop();
}
function frame60(){
dispatchEvent(new Event("explode_complete"));
}
}
}//package bestbrain_fla
Section 4
//BalloonAnimation_161 (bestbrain_fla.BalloonAnimation_161)
package bestbrain_fla {
import flash.display.*;
public dynamic class BalloonAnimation_161 extends MovieClip {
public function BalloonAnimation_161(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package bestbrain_fla
Section 5
//BalloonGuide_156 (bestbrain_fla.BalloonGuide_156)
package bestbrain_fla {
import flash.events.*;
import flash.display.*;
public dynamic class BalloonGuide_156 extends MovieClip {
public function BalloonGuide_156(){
addFrameScript(0, frame1, 19, frame20, 24, frame25);
}
function frame1(){
stop();
}
function frame25(){
dispatchEvent(new Event("guide_out"));
}
function frame20(){
stop();
dispatchEvent(new Event("guide_in"));
}
}
}//package bestbrain_fla
Section 6
//BalloonMarkerAnimation_169 (bestbrain_fla.BalloonMarkerAnimation_169)
package bestbrain_fla {
import flash.display.*;
public dynamic class BalloonMarkerAnimation_169 extends MovieClip {
public function BalloonMarkerAnimation_169(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package bestbrain_fla
Section 7
//ButtonBrainScores_15 (bestbrain_fla.ButtonBrainScores_15)
package bestbrain_fla {
import flash.display.*;
public dynamic class ButtonBrainScores_15 extends MovieClip {
public var buttonScores:ScoresButton;
public function ButtonBrainScores_15(){
addFrameScript(26, frame27);
}
function frame27(){
stop();
}
}
}//package bestbrain_fla
Section 8
//ButtonPlayGame_12 (bestbrain_fla.ButtonPlayGame_12)
package bestbrain_fla {
import flash.display.*;
public dynamic class ButtonPlayGame_12 extends MovieClip {
public var buttonPlay:PlayButton;
public function ButtonPlayGame_12(){
addFrameScript(32, frame33);
}
function frame33(){
stop();
}
}
}//package bestbrain_fla
Section 9
//ButtonSendFriend_17 (bestbrain_fla.ButtonSendFriend_17)
package bestbrain_fla {
import flash.display.*;
public dynamic class ButtonSendFriend_17 extends MovieClip {
public var buttonSend:SendButton;
public function ButtonSendFriend_17(){
addFrameScript(29, frame30);
}
function frame30(){
stop();
}
}
}//package bestbrain_fla
Section 10
//co_146 (bestbrain_fla.co_146)
package bestbrain_fla {
import flash.display.*;
public dynamic class co_146 extends MovieClip {
public function co_146(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package bestbrain_fla
Section 11
//counter_51 (bestbrain_fla.counter_51)
package bestbrain_fla {
import flash.display.*;
public dynamic class counter_51 extends MovieClip {
public var bar:MovieClip;
}
}//package bestbrain_fla
Section 12
//EquationOperator_92 (bestbrain_fla.EquationOperator_92)
package bestbrain_fla {
import flash.display.*;
import flash.text.*;
public dynamic class EquationOperator_92 extends MovieClip {
public var op:TextField;
}
}//package bestbrain_fla
Section 13
//EquationPart_93 (bestbrain_fla.EquationPart_93)
package bestbrain_fla {
import flash.display.*;
import flash.text.*;
public dynamic class EquationPart_93 extends MovieClip {
public var num:TextField;
}
}//package bestbrain_fla
Section 14
//EquationTemplate1_91 (bestbrain_fla.EquationTemplate1_91)
package bestbrain_fla {
import flash.display.*;
public dynamic class EquationTemplate1_91 extends MovieClip {
public var num1:MovieClip;
public var op1:MovieClip;
public var num2:MovieClip;
public var equals:MovieClip;
public var ans:MovieClip;
}
}//package bestbrain_fla
Section 15
//EquationTemplate2_95 (bestbrain_fla.EquationTemplate2_95)
package bestbrain_fla {
import flash.display.*;
public dynamic class EquationTemplate2_95 extends MovieClip {
public var num1:MovieClip;
public var num3:MovieClip;
public var op1:MovieClip;
public var op2:MovieClip;
public var num2:MovieClip;
public var equals:MovieClip;
public var ans:MovieClip;
}
}//package bestbrain_fla
Section 16
//EquationTemplate3_98 (bestbrain_fla.EquationTemplate3_98)
package bestbrain_fla {
import flash.display.*;
public dynamic class EquationTemplate3_98 extends MovieClip {
public var num1:MovieClip;
public var num3:MovieClip;
public var op1:MovieClip;
public var op2:MovieClip;
public var num4:MovieClip;
public var num2:MovieClip;
public var op3:MovieClip;
public var equals:MovieClip;
public var ans:MovieClip;
}
}//package bestbrain_fla
Section 17
//fiabAnim_25 (bestbrain_fla.fiabAnim_25)
package bestbrain_fla {
import flash.display.*;
public dynamic class fiabAnim_25 extends MovieClip {
public function fiabAnim_25(){
addFrameScript(0, frame1, 9, frame10);
}
function frame10(){
stop();
}
function frame1(){
stop();
}
}
}//package bestbrain_fla
Section 18
//fiveAnim_27 (bestbrain_fla.fiveAnim_27)
package bestbrain_fla {
import flash.display.*;
public dynamic class fiveAnim_27 extends MovieClip {
public function fiveAnim_27(){
addFrameScript(0, frame1, 9, frame10);
}
function frame10(){
stop();
}
function frame1(){
stop();
}
}
}//package bestbrain_fla
Section 19
//GameCompletePrompt_68 (bestbrain_fla.GameCompletePrompt_68)
package bestbrain_fla {
import flash.display.*;
public dynamic class GameCompletePrompt_68 extends MovieClip {
public var buttonContinue:ButtonContinue;
}
}//package bestbrain_fla
Section 20
//GameScore_62 (bestbrain_fla.GameScore_62)
package bestbrain_fla {
import flash.display.*;
import flash.text.*;
public dynamic class GameScore_62 extends MovieClip {
public var score:TextField;
}
}//package bestbrain_fla
Section 21
//GameTimer_50 (bestbrain_fla.GameTimer_50)
package bestbrain_fla {
import flash.display.*;
public dynamic class GameTimer_50 extends MovieClip {
public var timer:MovieClip;
public function GameTimer_50(){
addFrameScript(14, frame15);
}
function frame15(){
stop();
}
}
}//package bestbrain_fla
Section 22
//HighscoresTable_141 (bestbrain_fla.HighscoresTable_141)
package bestbrain_fla {
import flash.display.*;
import flash.text.*;
public dynamic class HighscoresTable_141 extends MovieClip {
public var score1:TextField;
public var name0:TextField;
public var name1:TextField;
public var name3:TextField;
public var name4:TextField;
public var name6:TextField;
public var name8:TextField;
public var name2:TextField;
public var score5:TextField;
public var name5:TextField;
public var name7:TextField;
public var score6:TextField;
public var name9:TextField;
public var rank0:TextField;
public var rank3:TextField;
public var rank6:TextField;
public var rank5:TextField;
public var rank2:TextField;
public var rank4:TextField;
public var rank7:TextField;
public var rank1:TextField;
public var rank9:TextField;
public var rank8:TextField;
public var score0:TextField;
public var score2:TextField;
public var score3:TextField;
public var score7:TextField;
public var score8:TextField;
public var score4:TextField;
public var score9:TextField;
}
}//package bestbrain_fla
Section 23
//HighscoresTableFB_182 (bestbrain_fla.HighscoresTableFB_182)
package bestbrain_fla {
import flash.display.*;
import flash.text.*;
public dynamic class HighscoresTableFB_182 extends MovieClip {
public var pic3:MovieClip;
public var pic6:MovieClip;
public var name0:TextField;
public var name1:TextField;
public var name3:TextField;
public var name4:TextField;
public var name6:TextField;
public var pic5:MovieClip;
public var name2:TextField;
public var score5:TextField;
public var name5:TextField;
public var name7:TextField;
public var score6:TextField;
public var pic0:MovieClip;
public var rank0:TextField;
public var rank3:TextField;
public var rank6:TextField;
public var rank5:TextField;
public var rank2:TextField;
public var rank4:TextField;
public var rank7:TextField;
public var rank1:TextField;
public var score0:TextField;
public var score2:TextField;
public var score3:TextField;
public var score7:TextField;
public var score1:TextField;
public var pic2:MovieClip;
public var score4:TextField;
public var pic7:MovieClip;
public var pic1:MovieClip;
public var pic4:MovieClip;
}
}//package bestbrain_fla
Section 24
//InstructionsCalculation_101 (bestbrain_fla.InstructionsCalculation_101)
package bestbrain_fla {
import flash.display.*;
public dynamic class InstructionsCalculation_101 extends MovieClip {
public var buttonContinue:ButtonContinue;
}
}//package bestbrain_fla
Section 25
//InstructionsCoordination_154 (bestbrain_fla.InstructionsCoordination_154)
package bestbrain_fla {
import flash.display.*;
public dynamic class InstructionsCoordination_154 extends MovieClip {
public var buttonContinue:ButtonContinue;
}
}//package bestbrain_fla
Section 26
//InstructionsMain_8 (bestbrain_fla.InstructionsMain_8)
package bestbrain_fla {
import flash.display.*;
import flash.text.*;
public dynamic class InstructionsMain_8 extends MovieClip {
public var intro:TextField;
public var buttonContinue:ButtonContinue;
}
}//package bestbrain_fla
Section 27
//InstructionsMemory_49 (bestbrain_fla.InstructionsMemory_49)
package bestbrain_fla {
import flash.display.*;
public dynamic class InstructionsMemory_49 extends MovieClip {
public var buttonContinue:ButtonContinue;
}
}//package bestbrain_fla
Section 28
//InstructionsRecognition_139 (bestbrain_fla.InstructionsRecognition_139)
package bestbrain_fla {
import flash.display.*;
public dynamic class InstructionsRecognition_139 extends MovieClip {
public var buttonContinue:ButtonContinue;
}
}//package bestbrain_fla
Section 29
//InstructionsRisk_179 (bestbrain_fla.InstructionsRisk_179)
package bestbrain_fla {
import flash.display.*;
public dynamic class InstructionsRisk_179 extends MovieClip {
public var buttonContinue:ButtonContinue;
}
}//package bestbrain_fla
Section 30
//InvalidFieldAnim_112 (bestbrain_fla.InvalidFieldAnim_112)
package bestbrain_fla {
import flash.display.*;
public dynamic class InvalidFieldAnim_112 extends MovieClip {
public function InvalidFieldAnim_112(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package bestbrain_fla
Section 31
//leaderboard_118 (bestbrain_fla.leaderboard_118)
package bestbrain_fla {
import flash.display.*;
public dynamic class leaderboard_118 extends MovieClip {
public var heading:MovieClip;
public var buttonAll:MovieClip;
public var buttonFacebook:buttonFacebookScores;
public var buttonNext:ButtonHighscoresNext;
public var buttonPrev:ButtonHighscoresPrev;
}
}//package bestbrain_fla
Section 32
//LeaderboardAnim_117 (bestbrain_fla.LeaderboardAnim_117)
package bestbrain_fla {
import flash.events.*;
import flash.display.*;
public dynamic class LeaderboardAnim_117 extends MovieClip {
public function LeaderboardAnim_117(){
addFrameScript(59, frame60);
}
function frame60(){
stop();
dispatchEvent(new Event("in_complete"));
}
}
}//package bestbrain_fla
Section 33
//main_cards_animation_42 (bestbrain_fla.main_cards_animation_42)
package bestbrain_fla {
import flash.events.*;
import flash.display.*;
public dynamic class main_cards_animation_42 extends MovieClip {
public var landmark:MovieClip;
public var object:MovieClip;
public function main_cards_animation_42(){
addFrameScript(0, frame1, 130, frame131, 141, frame142, 179, frame180);
}
function frame180(){
dispatchEvent(new Event("next_landmark"));
}
function frame1(){
stop();
}
function frame131(){
dispatchEvent(new Event("pair_shown"));
}
function frame142(){
stop();
dispatchEvent(new Event("landmark_shown"));
}
}
}//package bestbrain_fla
Section 34
//MiscTransition_84 (bestbrain_fla.MiscTransition_84)
package bestbrain_fla {
import flash.events.*;
import flash.display.*;
public dynamic class MiscTransition_84 extends MovieClip {
public var bmpHolder:MovieClip;
public function MiscTransition_84(){
addFrameScript(0, frame1, 22, frame23);
}
function frame1(){
stop();
}
function frame23(){
dispatchEvent(new Event("transition_complete"));
}
}
}//package bestbrain_fla
Section 35
//nintendoLogo_23 (bestbrain_fla.nintendoLogo_23)
package bestbrain_fla {
import flash.display.*;
public dynamic class nintendoLogo_23 extends MovieClip {
public function nintendoLogo_23(){
addFrameScript(0, frame1, 9, frame10);
}
function frame10(){
stop();
}
function frame1(){
stop();
}
}
}//package bestbrain_fla
Section 36
//object_panel_36 (bestbrain_fla.object_panel_36)
package bestbrain_fla {
import flash.events.*;
import flash.display.*;
public dynamic class object_panel_36 extends MovieClip {
public var obj1:ButtonObject;
public var obj2:ButtonObject;
public var obj3:ButtonObject;
public var obj5:ButtonObject;
public var obj9:ButtonObject;
public var obj4:ButtonObject;
public var obj6:ButtonObject;
public var obj8:ButtonObject;
public var obj10:ButtonObject;
public var obj7:ButtonObject;
public function object_panel_36(){
addFrameScript(0, frame1, 53, frame54, 54, frame55, 65, frame66);
}
function frame1(){
stop();
}
function frame54(){
stop();
dispatchEvent(new Event("options_on"));
}
function frame55(){
stop();
}
function frame66(){
dispatchEvent(new Event("options_off"));
}
}
}//package bestbrain_fla
Section 37
//particleAnim_166 (bestbrain_fla.particleAnim_166)
package bestbrain_fla {
import flash.display.*;
public dynamic class particleAnim_166 extends MovieClip {
public function particleAnim_166(){
addFrameScript(14, frame15);
}
function frame15(){
stop();
}
}
}//package bestbrain_fla
Section 38
//particleAnim2_168 (bestbrain_fla.particleAnim2_168)
package bestbrain_fla {
import flash.display.*;
public dynamic class particleAnim2_168 extends MovieClip {
public function particleAnim2_168(){
addFrameScript(12, frame13);
}
function frame13(){
stop();
}
}
}//package bestbrain_fla
Section 39
//particleClip_165 (bestbrain_fla.particleClip_165)
package bestbrain_fla {
import flash.display.*;
public dynamic class particleClip_165 extends MovieClip {
public function particleClip_165(){
addFrameScript(14, frame15);
}
function frame15(){
stop();
}
}
}//package bestbrain_fla
Section 40
//please_48 (bestbrain_fla.please_48)
package bestbrain_fla {
import flash.display.*;
import flash.text.*;
public dynamic class please_48 extends MovieClip {
public var countdown:TextField;
}
}//package bestbrain_fla
Section 41
//pop_102 (bestbrain_fla.pop_102)
package bestbrain_fla {
import flash.events.*;
import flash.display.*;
public dynamic class pop_102 extends MovieClip {
public var popText:MovieClip;
public var box:MovieClip;
public function pop_102(){
addFrameScript(0, frame1, 89, frame90);
}
function frame90(){
dispatchEvent(new Event("popup_complete"));
}
function frame1(){
stop();
}
}
}//package bestbrain_fla
Section 42
//pop_104 (bestbrain_fla.pop_104)
package bestbrain_fla {
import flash.display.*;
import flash.text.*;
public dynamic class pop_104 extends MovieClip {
public var msg:TextField;
}
}//package bestbrain_fla
Section 43
//Preloader_1 (bestbrain_fla.Preloader_1)
package bestbrain_fla {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public dynamic class Preloader_1 extends MovieClip {
public var perc:TextField;
public function Preloader_1(){
addFrameScript(0, frame1, 14, frame15, 28, frame29);
}
function frame15(){
stop();
dispatchEvent(new Event("preloader_start"));
}
function frame1(){
stop();
}
function frame29(){
stop();
dispatchEvent(new Event("preloader_complete"));
}
}
}//package bestbrain_fla
Section 44
//QuestionNumber_99 (bestbrain_fla.QuestionNumber_99)
package bestbrain_fla {
import flash.display.*;
import flash.text.*;
public dynamic class QuestionNumber_99 extends MovieClip {
public var question:TextField;
}
}//package bestbrain_fla
Section 45
//questions_box_89 (bestbrain_fla.questions_box_89)
package bestbrain_fla {
import flash.display.*;
public dynamic class questions_box_89 extends MovieClip {
public var equation2:MovieClip;
public var equation3:MovieClip;
public var equation1:MovieClip;
}
}//package bestbrain_fla
Section 46
//recog_132 (bestbrain_fla.recog_132)
package bestbrain_fla {
import flash.display.*;
public dynamic class recog_132 extends MovieClip {
public var shape1:ShapeButton;
public var shape2:ShapeButton;
public var shape4:ShapeButton;
public var shape6:ShapeButton;
public var shape8:ShapeButton;
public var shape3:ShapeButton;
public var shape5:ShapeButton;
public var shape7:ShapeButton;
public var shape9:ShapeButton;
}
}//package bestbrain_fla
Section 47
//RecognitionOptions_131 (bestbrain_fla.RecognitionOptions_131)
package bestbrain_fla {
import flash.events.*;
import flash.display.*;
public dynamic class RecognitionOptions_131 extends MovieClip {
public var panel:MovieClip;
public function RecognitionOptions_131(){
addFrameScript(0, frame1, 18, frame19, 24, frame25);
}
function frame1(){
stop();
}
function frame19(){
stop();
dispatchEvent(new Event("options_in"));
}
function frame25(){
dispatchEvent(new Event("options_out"));
}
}
}//package bestbrain_fla
Section 48
//results_box_44 (bestbrain_fla.results_box_44)
package bestbrain_fla {
import flash.display.*;
public dynamic class results_box_44 extends MovieClip {
public var correct:MovieClip;
public var incorrect:MovieClip;
public function results_box_44(){
addFrameScript(0, frame1, 34, frame35, 64, frame65);
}
function frame65(){
gotoAndStop("off");
}
function frame1(){
stop();
}
function frame35(){
gotoAndStop("off");
}
}
}//package bestbrain_fla
Section 49
//results_box_calc_100 (bestbrain_fla.results_box_calc_100)
package bestbrain_fla {
import flash.events.*;
import flash.display.*;
public dynamic class results_box_calc_100 extends MovieClip {
public function results_box_calc_100(){
addFrameScript(0, frame1, 34, frame35, 64, frame65);
}
function frame65(){
dispatchEvent(new Event("next_question"));
gotoAndStop("off");
}
function frame1(){
stop();
}
function frame35(){
dispatchEvent(new Event("next_question"));
gotoAndStop("off");
}
}
}//package bestbrain_fla
Section 50
//ResultsScreenAnim_60 (bestbrain_fla.ResultsScreenAnim_60)
package bestbrain_fla {
import flash.events.*;
import flash.display.*;
public dynamic class ResultsScreenAnim_60 extends MovieClip {
public function ResultsScreenAnim_60(){
addFrameScript(0, frame1, 36, frame37, 52, frame53);
}
function frame1(){
stop();
}
function frame37(){
stop();
dispatchEvent(new Event("in_complete"));
}
function frame53(){
dispatchEvent(new Event("out_complete"));
}
}
}//package bestbrain_fla
Section 51
//ResultsTable_61 (bestbrain_fla.ResultsTable_61)
package bestbrain_fla {
import flash.events.*;
import flash.display.*;
public dynamic class ResultsTable_61 extends MovieClip {
public var score5:MovieClip;
public var score2:MovieClip;
public var score3:MovieClip;
public var score1:MovieClip;
public var score4:MovieClip;
public function ResultsTable_61(){
addFrameScript(0, frame1, 29, frame30, 53, frame54, 77, frame78, 101, frame102, 125, frame126);
}
function frame78(){
stop();
dispatchEvent(new Event("score_shown"));
}
function frame102(){
stop();
dispatchEvent(new Event("score_shown"));
}
function frame1(){
stop();
}
function frame30(){
stop();
dispatchEvent(new Event("score_shown"));
}
function frame126(){
stop();
dispatchEvent(new Event("score_shown"));
}
function frame54(){
stop();
dispatchEvent(new Event("score_shown"));
}
}
}//package bestbrain_fla
Section 52
//RiskPercent_178 (bestbrain_fla.RiskPercent_178)
package bestbrain_fla {
import flash.display.*;
import flash.text.*;
public dynamic class RiskPercent_178 extends MovieClip {
public var perc:TextField;
}
}//package bestbrain_fla
Section 53
//ScoreRank_78 (bestbrain_fla.ScoreRank_78)
package bestbrain_fla {
import flash.display.*;
import flash.text.*;
public dynamic class ScoreRank_78 extends MovieClip {
public var rank:TextField;
}
}//package bestbrain_fla
Section 54
//send_to_friend_text_19 (bestbrain_fla.send_to_friend_text_19)
package bestbrain_fla {
import flash.display.*;
import flash.text.*;
public dynamic class send_to_friend_text_19 extends MovieClip {
public var txt:TextField;
}
}//package bestbrain_fla
Section 55
//sendtoafriendform_111 (bestbrain_fla.sendtoafriendform_111)
package bestbrain_fla {
import flash.display.*;
import flash.text.*;
public dynamic class sendtoafriendform_111 extends MovieClip {
public var noName:MovieClip;
public var messageFailed:MovieClip;
public var noEmail1:MovieClip;
public var noEmail2:MovieClip;
public var messageSent:MovieClip;
public var messageSending:MovieClip;
public var inputName:TextField;
public var inputEmail1:TextField;
public var inputEmail2:TextField;
public var buttonSubmit:ButtonSend;
}
}//package bestbrain_fla
Section 56
//shape_138 (bestbrain_fla.shape_138)
package bestbrain_fla {
import flash.display.*;
public dynamic class shape_138 extends MovieClip {
public var shape1:MovieClip;
public var shape2:MovieClip;
public var shape3:MovieClip;
}
}//package bestbrain_fla
Section 57
//shapes_134 (bestbrain_fla.shapes_134)
package bestbrain_fla {
import flash.display.*;
public dynamic class shapes_134 extends MovieClip {
public function shapes_134(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package bestbrain_fla
Section 58
//SubmitcorePopup_70 (bestbrain_fla.SubmitcorePopup_70)
package bestbrain_fla {
import flash.display.*;
import flash.text.*;
public dynamic class SubmitcorePopup_70 extends MovieClip {
public var messageFailed:MovieClip;
public var messageEnterName:MovieClip;
public var messageSent:MovieClip;
public var buttonBack:ButtonBack;
public var buttonChallenge:challenge_button;
public var messageSending:MovieClip;
public var inputName:TextField;
public var score:TextField;
public var buttonViewHighscores:ButtonViewHighscores;
public var inputBox:MovieClip;
public var messageRank:MovieClip;
public var buttonSubmit:ButtonSend;
}
}//package bestbrain_fla
Section 59
//TitleScreenAnim_7 (bestbrain_fla.TitleScreenAnim_7)
package bestbrain_fla {
import flash.events.*;
import flash.display.*;
public dynamic class TitleScreenAnim_7 extends MovieClip {
public function TitleScreenAnim_7(){
addFrameScript(47, frame48, 67, frame68);
}
function frame48(){
stop();
dispatchEvent(new Event("in_complete"));
}
function frame68(){
stop();
dispatchEvent(new Event("out_complete"));
}
}
}//package bestbrain_fla
Section 60
//tvTimes_20 (bestbrain_fla.tvTimes_20)
package bestbrain_fla {
import flash.display.*;
public dynamic class tvTimes_20 extends MovieClip {
public var tvClip:MovieClip;
public function tvTimes_20(){
addFrameScript(0, frame1, 9, frame10);
}
function frame10(){
stop();
}
function frame1(){
stop();
}
}
}//package bestbrain_fla
Section 61
//tvTitle_21 (bestbrain_fla.tvTitle_21)
package bestbrain_fla {
import flash.display.*;
public dynamic class tvTitle_21 extends MovieClip {
public var fiveLogo:MovieClip;
}
}//package bestbrain_fla
Section 62
//MD5 (com.adobe.crypto.MD5)
package com.adobe.crypto {
import flash.utils.*;
import com.adobe.utils.*;
public class MD5 {
public static var digest:ByteArray;
private static function ff(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{
return (transform(f, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7));
}
private static function f(_arg1:int, _arg2:int, _arg3:int):int{
return (((_arg1 & _arg2) | (~(_arg1) & _arg3)));
}
private static function g(_arg1:int, _arg2:int, _arg3:int):int{
return (((_arg1 & _arg3) | (_arg2 & ~(_arg3))));
}
private static function h(_arg1:int, _arg2:int, _arg3:int):int{
return (((_arg1 ^ _arg2) ^ _arg3));
}
private static function i(_arg1:int, _arg2:int, _arg3:int):int{
return ((_arg2 ^ (_arg1 | ~(_arg3))));
}
private static function transform(_arg1:Function, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int, _arg8:int):int{
var _local9:int;
_local9 = (((_arg2 + int(_arg1(_arg3, _arg4, _arg5))) + _arg6) + _arg8);
return ((IntUtil.rol(_local9, _arg7) + _arg3));
}
private static function hh(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{
return (transform(h, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7));
}
public static function hash(_arg1:String):String{
var _local2:ByteArray;
_local2 = new ByteArray();
_local2.writeUTFBytes(_arg1);
return (hashBinary(_local2));
}
private static function createBlocks(_arg1:ByteArray):Array{
var _local2:Array;
var _local3:int;
var _local4:int;
var _local5:int;
_local2 = new Array();
_local3 = (_arg1.length * 8);
_local4 = 0xFF;
_local5 = 0;
while (_local5 < _local3) {
_local2[int((_local5 >> 5))] = (_local2[int((_local5 >> 5))] | ((_arg1[(_local5 / 8)] & _local4) << (_local5 % 32)));
_local5 = (_local5 + 8);
};
_local2[int((_local3 >> 5))] = (_local2[int((_local3 >> 5))] | (128 << (_local3 % 32)));
_local2[int(((((_local3 + 64) >>> 9) << 4) + 14))] = _local3;
return (_local2);
}
public static function hashBinary(_arg1:ByteArray):String{
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
var _local10:Array;
var _local11:int;
var _local12:int;
_local2 = 1732584193;
_local3 = -271733879;
_local4 = -1732584194;
_local5 = 271733878;
_local10 = createBlocks(_arg1);
_local11 = _local10.length;
_local12 = 0;
while (_local12 < _local11) {
_local6 = _local2;
_local7 = _local3;
_local8 = _local4;
_local9 = _local5;
_local2 = ff(_local2, _local3, _local4, _local5, _local10[int((_local12 + 0))], 7, -680876936);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[int((_local12 + 1))], 12, -389564586);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[int((_local12 + 2))], 17, 606105819);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[int((_local12 + 3))], 22, -1044525330);
_local2 = ff(_local2, _local3, _local4, _local5, _local10[int((_local12 + 4))], 7, -176418897);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[int((_local12 + 5))], 12, 1200080426);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[int((_local12 + 6))], 17, -1473231341);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[int((_local12 + 7))], 22, -45705983);
_local2 = ff(_local2, _local3, _local4, _local5, _local10[int((_local12 + 8))], 7, 1770035416);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[int((_local12 + 9))], 12, -1958414417);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[int((_local12 + 10))], 17, -42063);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[int((_local12 + 11))], 22, -1990404162);
_local2 = ff(_local2, _local3, _local4, _local5, _local10[int((_local12 + 12))], 7, 1804603682);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[int((_local12 + 13))], 12, -40341101);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[int((_local12 + 14))], 17, -1502002290);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[int((_local12 + 15))], 22, 1236535329);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[int((_local12 + 1))], 5, -165796510);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[int((_local12 + 6))], 9, -1069501632);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[int((_local12 + 11))], 14, 643717713);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[int((_local12 + 0))], 20, -373897302);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[int((_local12 + 5))], 5, -701558691);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[int((_local12 + 10))], 9, 38016083);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[int((_local12 + 15))], 14, -660478335);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[int((_local12 + 4))], 20, -405537848);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[int((_local12 + 9))], 5, 568446438);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[int((_local12 + 14))], 9, -1019803690);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[int((_local12 + 3))], 14, -187363961);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[int((_local12 + 8))], 20, 1163531501);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[int((_local12 + 13))], 5, -1444681467);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[int((_local12 + 2))], 9, -51403784);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[int((_local12 + 7))], 14, 1735328473);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[int((_local12 + 12))], 20, -1926607734);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[int((_local12 + 5))], 4, -378558);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[int((_local12 + 8))], 11, -2022574463);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[int((_local12 + 11))], 16, 1839030562);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[int((_local12 + 14))], 23, -35309556);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[int((_local12 + 1))], 4, -1530992060);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[int((_local12 + 4))], 11, 1272893353);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[int((_local12 + 7))], 16, -155497632);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[int((_local12 + 10))], 23, -1094730640);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[int((_local12 + 13))], 4, 681279174);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[int((_local12 + 0))], 11, -358537222);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[int((_local12 + 3))], 16, -722521979);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[int((_local12 + 6))], 23, 76029189);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[int((_local12 + 9))], 4, -640364487);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[int((_local12 + 12))], 11, -421815835);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[int((_local12 + 15))], 16, 530742520);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[int((_local12 + 2))], 23, -995338651);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[int((_local12 + 0))], 6, -198630844);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[int((_local12 + 7))], 10, 1126891415);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[int((_local12 + 14))], 15, -1416354905);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[int((_local12 + 5))], 21, -57434055);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[int((_local12 + 12))], 6, 1700485571);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[int((_local12 + 3))], 10, -1894986606);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[int((_local12 + 10))], 15, -1051523);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[int((_local12 + 1))], 21, -2054922799);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[int((_local12 + 8))], 6, 1873313359);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[int((_local12 + 15))], 10, -30611744);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[int((_local12 + 6))], 15, -1560198380);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[int((_local12 + 13))], 21, 1309151649);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[int((_local12 + 4))], 6, -145523070);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[int((_local12 + 11))], 10, -1120210379);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[int((_local12 + 2))], 15, 718787259);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[int((_local12 + 9))], 21, -343485551);
_local2 = (_local2 + _local6);
_local3 = (_local3 + _local7);
_local4 = (_local4 + _local8);
_local5 = (_local5 + _local9);
_local12 = (_local12 + 16);
};
digest = new ByteArray();
digest.writeInt(_local2);
digest.writeInt(_local3);
digest.writeInt(_local4);
digest.writeInt(_local5);
digest.position = 0;
return ((((IntUtil.toHex(_local2) + IntUtil.toHex(_local3)) + IntUtil.toHex(_local4)) + IntUtil.toHex(_local5)));
}
private static function gg(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{
return (transform(g, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7));
}
private static function ii(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{
return (transform(i, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7));
}
public static function hashBytes(_arg1:ByteArray):String{
return (hashBinary(_arg1));
}
}
}//package com.adobe.crypto
Section 63
//BitString (com.adobe.images.BitString)
package com.adobe.images {
public class BitString {
public var val:int;// = 0
public var len:int;// = 0
public function BitString(){
len = 0;
val = 0;
super();
}
}
}//package com.adobe.images
Section 64
//JPGEncoder (com.adobe.images.JPGEncoder)
package com.adobe.images {
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
public class JPGEncoder {
private var fdtbl_UV:Array;
private var std_ac_chrominance_values:Array;
private var std_dc_chrominance_nrcodes:Array;
private var std_dc_chrominance_values:Array;
private var ZigZag:Array;
private var YDC_HT:Array;
private var bytenew:int;// = 0
private var fdtbl_Y:Array;
private var YAC_HT:Array;
private var std_ac_chrominance_nrcodes:Array;
private var DU:Array;
private var std_ac_luminance_values:Array;
private var UVTable:Array;
private var UDU:Array;
private var YDU:Array;
private var byteout:ByteArray;
private var UVAC_HT:Array;
private var UVDC_HT:Array;
private var bytepos:int;// = 7
private var VDU:Array;
private var std_ac_luminance_nrcodes:Array;
private var std_dc_luminance_values:Array;
private var YTable:Array;
private var std_dc_luminance_nrcodes:Array;
private var bitcode:Array;
private var category:Array;
public function JPGEncoder(_arg1:Number=50){
var _local2:int;
ZigZag = [0, 1, 5, 6, 14, 15, 27, 28, 2, 4, 7, 13, 16, 26, 29, 42, 3, 8, 12, 17, 25, 30, 41, 43, 9, 11, 18, 24, 31, 40, 44, 53, 10, 19, 23, 32, 39, 45, 52, 54, 20, 22, 33, 38, 46, 51, 55, 60, 21, 34, 37, 47, 50, 56, 59, 61, 35, 36, 48, 49, 57, 58, 62, 63];
YTable = new Array(64);
UVTable = new Array(64);
fdtbl_Y = new Array(64);
fdtbl_UV = new Array(64);
std_dc_luminance_nrcodes = [0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0];
std_dc_luminance_values = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
std_ac_luminance_nrcodes = [0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 125];
std_ac_luminance_values = [1, 2, 3, 0, 4, 17, 5, 18, 33, 49, 65, 6, 19, 81, 97, 7, 34, 113, 20, 50, 129, 145, 161, 8, 35, 66, 177, 193, 21, 82, 209, 240, 36, 51, 98, 114, 130, 9, 10, 22, 23, 24, 25, 26, 37, 38, 39, 40, 41, 42, 52, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115, 116, 117, 118, 119, 120, 121, 122, 131, 132, 133, 134, 135, 136, 137, 138, 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178, 179, 180, 181, 182, 183, 184, 185, 186, 194, 195, 196, 197, 198, 199, 200, 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250];
std_dc_chrominance_nrcodes = [0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0];
std_dc_chrominance_values = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
std_ac_chrominance_nrcodes = [0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 119];
std_ac_chrominance_values = [0, 1, 2, 3, 17, 4, 5, 33, 49, 6, 18, 65, 81, 7, 97, 113, 19, 34, 50, 129, 8, 20, 66, 145, 161, 177, 193, 9, 35, 51, 82, 240, 21, 98, 114, 209, 10, 22, 36, 52, 225, 37, 241, 23, 24, 25, 26, 38, 39, 40, 41, 42, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115, 116, 117, 118, 119, 120, 121, 122, 130, 131, 132, 133, 134, 135, 136, 137, 138, 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178, 179, 180, 181, 182, 183, 184, 185, 186, 194, 195, 196, 197, 198, 199, 200, 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 226, 227, 228, 229, 230, 231, 232, 233, 234, 242, 243, 244, 245, 246, 247, 248, 249, 250];
bitcode = new Array(0xFFFF);
category = new Array(0xFFFF);
bytenew = 0;
bytepos = 7;
DU = new Array(64);
YDU = new Array(64);
UDU = new Array(64);
VDU = new Array(64);
super();
if (_arg1 <= 0){
_arg1 = 1;
};
if (_arg1 > 100){
_arg1 = 100;
};
_local2 = 0;
if (_arg1 < 50){
_local2 = int((5000 / _arg1));
} else {
_local2 = int((200 - (_arg1 * 2)));
};
initHuffmanTbl();
initCategoryNumber();
initQuantTables(_local2);
}
private function RGB2YUV(_arg1:BitmapData, _arg2:int, _arg3:int):void{
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:uint;
var _local8:Number;
var _local9:Number;
var _local10:Number;
_local4 = 0;
_local5 = 0;
while (_local5 < 8) {
_local6 = 0;
while (_local6 < 8) {
_local7 = _arg1.getPixel32((_arg2 + _local6), (_arg3 + _local5));
_local8 = Number(((_local7 >> 16) & 0xFF));
_local9 = Number(((_local7 >> 8) & 0xFF));
_local10 = Number((_local7 & 0xFF));
YDU[_local4] = ((((0.299 * _local8) + (0.587 * _local9)) + (0.114 * _local10)) - 128);
UDU[_local4] = (((-0.16874 * _local8) + (-0.33126 * _local9)) + (0.5 * _local10));
VDU[_local4] = (((0.5 * _local8) + (-0.41869 * _local9)) + (-0.08131 * _local10));
_local4++;
_local6++;
};
_local5++;
};
}
private function writeWord(_arg1:int):void{
writeByte(((_arg1 >> 8) & 0xFF));
writeByte((_arg1 & 0xFF));
}
private function writeByte(_arg1:int):void{
byteout.writeByte(_arg1);
}
private function writeDHT():void{
var _local1:int;
writeWord(65476);
writeWord(418);
writeByte(0);
_local1 = 0;
while (_local1 < 16) {
writeByte(std_dc_luminance_nrcodes[(_local1 + 1)]);
_local1++;
};
_local1 = 0;
while (_local1 <= 11) {
writeByte(std_dc_luminance_values[_local1]);
_local1++;
};
writeByte(16);
_local1 = 0;
while (_local1 < 16) {
writeByte(std_ac_luminance_nrcodes[(_local1 + 1)]);
_local1++;
};
_local1 = 0;
while (_local1 <= 161) {
writeByte(std_ac_luminance_values[_local1]);
_local1++;
};
writeByte(1);
_local1 = 0;
while (_local1 < 16) {
writeByte(std_dc_chrominance_nrcodes[(_local1 + 1)]);
_local1++;
};
_local1 = 0;
while (_local1 <= 11) {
writeByte(std_dc_chrominance_values[_local1]);
_local1++;
};
writeByte(17);
_local1 = 0;
while (_local1 < 16) {
writeByte(std_ac_chrominance_nrcodes[(_local1 + 1)]);
_local1++;
};
_local1 = 0;
while (_local1 <= 161) {
writeByte(std_ac_chrominance_values[_local1]);
_local1++;
};
}
private function writeBits(_arg1:BitString):void{
var _local2:int;
var _local3:int;
_local2 = _arg1.val;
_local3 = (_arg1.len - 1);
while (_local3 >= 0) {
if ((_local2 & uint((1 << _local3)))){
bytenew = (bytenew | uint((1 << bytepos)));
};
_local3--;
bytepos--;
if (bytepos < 0){
if (bytenew == 0xFF){
writeByte(0xFF);
writeByte(0);
} else {
writeByte(bytenew);
};
bytepos = 7;
bytenew = 0;
};
};
}
private function initHuffmanTbl():void{
YDC_HT = computeHuffmanTbl(std_dc_luminance_nrcodes, std_dc_luminance_values);
UVDC_HT = computeHuffmanTbl(std_dc_chrominance_nrcodes, std_dc_chrominance_values);
YAC_HT = computeHuffmanTbl(std_ac_luminance_nrcodes, std_ac_luminance_values);
UVAC_HT = computeHuffmanTbl(std_ac_chrominance_nrcodes, std_ac_chrominance_values);
}
public function encode(_arg1:BitmapData):ByteArray{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:int;
var _local6:int;
var _local7:BitString;
byteout = new ByteArray();
bytenew = 0;
bytepos = 7;
writeWord(65496);
writeAPP0();
writeDQT();
writeSOF0(_arg1.width, _arg1.height);
writeDHT();
writeSOS();
_local2 = 0;
_local3 = 0;
_local4 = 0;
bytenew = 0;
bytepos = 7;
_local5 = 0;
while (_local5 < _arg1.height) {
_local6 = 0;
while (_local6 < _arg1.width) {
RGB2YUV(_arg1, _local6, _local5);
_local2 = processDU(YDU, fdtbl_Y, _local2, YDC_HT, YAC_HT);
_local3 = processDU(UDU, fdtbl_UV, _local3, UVDC_HT, UVAC_HT);
_local4 = processDU(VDU, fdtbl_UV, _local4, UVDC_HT, UVAC_HT);
_local6 = (_local6 + 8);
};
_local5 = (_local5 + 8);
};
if (bytepos >= 0){
_local7 = new BitString();
_local7.len = (bytepos + 1);
_local7.val = ((1 << (bytepos + 1)) - 1);
writeBits(_local7);
};
writeWord(65497);
return (byteout);
}
private function initCategoryNumber():void{
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:int;
_local1 = 1;
_local2 = 2;
_local4 = 1;
while (_local4 <= 15) {
_local3 = _local1;
while (_local3 < _local2) {
category[(32767 + _local3)] = _local4;
bitcode[(32767 + _local3)] = new BitString();
bitcode[(32767 + _local3)].len = _local4;
bitcode[(32767 + _local3)].val = _local3;
_local3++;
};
_local3 = -((_local2 - 1));
while (_local3 <= -(_local1)) {
category[(32767 + _local3)] = _local4;
bitcode[(32767 + _local3)] = new BitString();
bitcode[(32767 + _local3)].len = _local4;
bitcode[(32767 + _local3)].val = ((_local2 - 1) + _local3);
_local3++;
};
_local1 = (_local1 << 1);
_local2 = (_local2 << 1);
_local4++;
};
}
private function writeDQT():void{
var _local1:int;
writeWord(65499);
writeWord(132);
writeByte(0);
_local1 = 0;
while (_local1 < 64) {
writeByte(YTable[_local1]);
_local1++;
};
writeByte(1);
_local1 = 0;
while (_local1 < 64) {
writeByte(UVTable[_local1]);
_local1++;
};
}
private function writeAPP0():void{
writeWord(65504);
writeWord(16);
writeByte(74);
writeByte(70);
writeByte(73);
writeByte(70);
writeByte(0);
writeByte(1);
writeByte(1);
writeByte(0);
writeWord(1);
writeWord(1);
writeByte(0);
writeByte(0);
}
private function writeSOS():void{
writeWord(65498);
writeWord(12);
writeByte(3);
writeByte(1);
writeByte(0);
writeByte(2);
writeByte(17);
writeByte(3);
writeByte(17);
writeByte(0);
writeByte(63);
writeByte(0);
}
private function processDU(_arg1:Array, _arg2:Array, _arg3:Number, _arg4:Array, _arg5:Array):Number{
var _local6:BitString;
var _local7:BitString;
var _local8:int;
var _local9:Array;
var _local10:int;
var _local11:int;
var _local12:int;
var _local13:int;
var _local14:int;
_local6 = _arg5[0];
_local7 = _arg5[240];
_local9 = fDCTQuant(_arg1, _arg2);
_local8 = 0;
while (_local8 < 64) {
DU[ZigZag[_local8]] = _local9[_local8];
_local8++;
};
_local10 = (DU[0] - _arg3);
_arg3 = DU[0];
if (_local10 == 0){
writeBits(_arg4[0]);
} else {
writeBits(_arg4[category[(32767 + _local10)]]);
writeBits(bitcode[(32767 + _local10)]);
};
_local11 = 63;
while ((((_local11 > 0)) && ((DU[_local11] == 0)))) {
_local11--;
};
if (_local11 == 0){
writeBits(_local6);
return (_arg3);
};
_local8 = 1;
while (_local8 <= _local11) {
_local12 = _local8;
while ((((DU[_local8] == 0)) && ((_local8 <= _local11)))) {
_local8++;
};
_local13 = (_local8 - _local12);
if (_local13 >= 16){
_local14 = 1;
while (_local14 <= (_local13 / 16)) {
writeBits(_local7);
_local14++;
};
_local13 = int((_local13 & 15));
};
writeBits(_arg5[((_local13 * 16) + category[(32767 + DU[_local8])])]);
writeBits(bitcode[(32767 + DU[_local8])]);
_local8++;
};
if (_local11 != 63){
writeBits(_local6);
};
return (_arg3);
}
private function initQuantTables(_arg1:int):void{
var _local2:int;
var _local3:Number;
var _local4:Array;
var _local5:Array;
var _local6:Array;
var _local7:int;
var _local8:int;
_local4 = [16, 11, 10, 16, 24, 40, 51, 61, 12, 12, 14, 19, 26, 58, 60, 55, 14, 13, 16, 24, 40, 57, 69, 56, 14, 17, 22, 29, 51, 87, 80, 62, 18, 22, 37, 56, 68, 109, 103, 77, 24, 35, 55, 64, 81, 104, 113, 92, 49, 64, 78, 87, 103, 121, 120, 101, 72, 92, 95, 98, 112, 100, 103, 99];
_local2 = 0;
while (_local2 < 64) {
_local3 = Math.floor((((_local4[_local2] * _arg1) + 50) / 100));
if (_local3 < 1){
_local3 = 1;
} else {
if (_local3 > 0xFF){
_local3 = 0xFF;
};
};
YTable[ZigZag[_local2]] = _local3;
_local2++;
};
_local5 = [17, 18, 24, 47, 99, 99, 99, 99, 18, 21, 26, 66, 99, 99, 99, 99, 24, 26, 56, 99, 99, 99, 99, 99, 47, 66, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99];
_local2 = 0;
while (_local2 < 64) {
_local3 = Math.floor((((_local5[_local2] * _arg1) + 50) / 100));
if (_local3 < 1){
_local3 = 1;
} else {
if (_local3 > 0xFF){
_local3 = 0xFF;
};
};
UVTable[ZigZag[_local2]] = _local3;
_local2++;
};
_local6 = [1, 1.387039845, 1.306562965, 1.175875602, 1, 0.785694958, 0.5411961, 0.275899379];
_local2 = 0;
_local7 = 0;
while (_local7 < 8) {
_local8 = 0;
while (_local8 < 8) {
fdtbl_Y[_local2] = (1 / (((YTable[ZigZag[_local2]] * _local6[_local7]) * _local6[_local8]) * 8));
fdtbl_UV[_local2] = (1 / (((UVTable[ZigZag[_local2]] * _local6[_local7]) * _local6[_local8]) * 8));
_local2++;
_local8++;
};
_local7++;
};
}
private function writeSOF0(_arg1:int, _arg2:int):void{
writeWord(65472);
writeWord(17);
writeByte(8);
writeWord(_arg2);
writeWord(_arg1);
writeByte(3);
writeByte(1);
writeByte(17);
writeByte(0);
writeByte(2);
writeByte(17);
writeByte(1);
writeByte(3);
writeByte(17);
writeByte(1);
}
private function computeHuffmanTbl(_arg1:Array, _arg2:Array):Array{
var _local3:int;
var _local4:int;
var _local5:Array;
var _local6:int;
var _local7:int;
_local3 = 0;
_local4 = 0;
_local5 = new Array();
_local6 = 1;
while (_local6 <= 16) {
_local7 = 1;
while (_local7 <= _arg1[_local6]) {
_local5[_arg2[_local4]] = new BitString();
_local5[_arg2[_local4]].val = _local3;
_local5[_arg2[_local4]].len = _local6;
_local4++;
_local3++;
_local7++;
};
_local3 = (_local3 * 2);
_local6++;
};
return (_local5);
}
private function fDCTQuant(_arg1:Array, _arg2:Array):Array{
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:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:int;
var _local23:int;
_local23 = 0;
_local22 = 0;
while (_local22 < 8) {
_local3 = (_arg1[(_local23 + 0)] + _arg1[(_local23 + 7)]);
_local10 = (_arg1[(_local23 + 0)] - _arg1[(_local23 + 7)]);
_local4 = (_arg1[(_local23 + 1)] + _arg1[(_local23 + 6)]);
_local9 = (_arg1[(_local23 + 1)] - _arg1[(_local23 + 6)]);
_local5 = (_arg1[(_local23 + 2)] + _arg1[(_local23 + 5)]);
_local8 = (_arg1[(_local23 + 2)] - _arg1[(_local23 + 5)]);
_local6 = (_arg1[(_local23 + 3)] + _arg1[(_local23 + 4)]);
_local7 = (_arg1[(_local23 + 3)] - _arg1[(_local23 + 4)]);
_local11 = (_local3 + _local6);
_local14 = (_local3 - _local6);
_local12 = (_local4 + _local5);
_local13 = (_local4 - _local5);
_arg1[(_local23 + 0)] = (_local11 + _local12);
_arg1[(_local23 + 4)] = (_local11 - _local12);
_local15 = ((_local13 + _local14) * 0.707106781);
_arg1[(_local23 + 2)] = (_local14 + _local15);
_arg1[(_local23 + 6)] = (_local14 - _local15);
_local11 = (_local7 + _local8);
_local12 = (_local8 + _local9);
_local13 = (_local9 + _local10);
_local19 = ((_local11 - _local13) * 0.382683433);
_local16 = ((0.5411961 * _local11) + _local19);
_local18 = ((1.306562965 * _local13) + _local19);
_local17 = (_local12 * 0.707106781);
_local20 = (_local10 + _local17);
_local21 = (_local10 - _local17);
_arg1[(_local23 + 5)] = (_local21 + _local16);
_arg1[(_local23 + 3)] = (_local21 - _local16);
_arg1[(_local23 + 1)] = (_local20 + _local18);
_arg1[(_local23 + 7)] = (_local20 - _local18);
_local23 = (_local23 + 8);
_local22++;
};
_local23 = 0;
_local22 = 0;
while (_local22 < 8) {
_local3 = (_arg1[(_local23 + 0)] + _arg1[(_local23 + 56)]);
_local10 = (_arg1[(_local23 + 0)] - _arg1[(_local23 + 56)]);
_local4 = (_arg1[(_local23 + 8)] + _arg1[(_local23 + 48)]);
_local9 = (_arg1[(_local23 + 8)] - _arg1[(_local23 + 48)]);
_local5 = (_arg1[(_local23 + 16)] + _arg1[(_local23 + 40)]);
_local8 = (_arg1[(_local23 + 16)] - _arg1[(_local23 + 40)]);
_local6 = (_arg1[(_local23 + 24)] + _arg1[(_local23 + 32)]);
_local7 = (_arg1[(_local23 + 24)] - _arg1[(_local23 + 32)]);
_local11 = (_local3 + _local6);
_local14 = (_local3 - _local6);
_local12 = (_local4 + _local5);
_local13 = (_local4 - _local5);
_arg1[(_local23 + 0)] = (_local11 + _local12);
_arg1[(_local23 + 32)] = (_local11 - _local12);
_local15 = ((_local13 + _local14) * 0.707106781);
_arg1[(_local23 + 16)] = (_local14 + _local15);
_arg1[(_local23 + 48)] = (_local14 - _local15);
_local11 = (_local7 + _local8);
_local12 = (_local8 + _local9);
_local13 = (_local9 + _local10);
_local19 = ((_local11 - _local13) * 0.382683433);
_local16 = ((0.5411961 * _local11) + _local19);
_local18 = ((1.306562965 * _local13) + _local19);
_local17 = (_local12 * 0.707106781);
_local20 = (_local10 + _local17);
_local21 = (_local10 - _local17);
_arg1[(_local23 + 40)] = (_local21 + _local16);
_arg1[(_local23 + 24)] = (_local21 - _local16);
_arg1[(_local23 + 8)] = (_local20 + _local18);
_arg1[(_local23 + 56)] = (_local20 - _local18);
_local23++;
_local22++;
};
_local22 = 0;
while (_local22 < 64) {
_arg1[_local22] = Math.round((_arg1[_local22] * _arg2[_local22]));
_local22++;
};
return (_arg1);
}
}
}//package com.adobe.images
Section 65
//PNGEncoder (com.adobe.images.PNGEncoder)
package com.adobe.images {
import flash.display.*;
import flash.utils.*;
public class PNGEncoder {
private static var crcTableComputed:Boolean = false;
private static var crcTable:Array;
private static function writeChunk(_arg1:ByteArray, _arg2:uint, _arg3:ByteArray):void{
var _local4:uint;
var _local5:uint;
var _local6:uint;
var _local7:int;
var _local8:uint;
var _local9:uint;
var _local10:uint;
if (!crcTableComputed){
crcTableComputed = true;
crcTable = [];
_local9 = 0;
while (_local9 < 0x0100) {
_local8 = _local9;
_local10 = 0;
while (_local10 < 8) {
if ((_local8 & 1)){
_local8 = uint((uint(3988292384) ^ uint((_local8 >>> 1))));
} else {
_local8 = uint((_local8 >>> 1));
};
_local10++;
};
crcTable[_local9] = _local8;
_local9++;
};
};
_local4 = 0;
if (_arg3 != null){
_local4 = _arg3.length;
};
_arg1.writeUnsignedInt(_local4);
_local5 = _arg1.position;
_arg1.writeUnsignedInt(_arg2);
if (_arg3 != null){
_arg1.writeBytes(_arg3);
};
_local6 = _arg1.position;
_arg1.position = _local5;
_local8 = 4294967295;
_local7 = 0;
while (_local7 < (_local6 - _local5)) {
_local8 = uint((crcTable[((_local8 ^ _arg1.readUnsignedByte()) & uint(0xFF))] ^ uint((_local8 >>> 8))));
_local7++;
};
_local8 = uint((_local8 ^ uint(4294967295)));
_arg1.position = _local6;
_arg1.writeUnsignedInt(_local8);
}
public static function encode(_arg1:BitmapData):ByteArray{
var _local2:ByteArray;
var _local3:ByteArray;
var _local4:ByteArray;
var _local5:int;
var _local6:uint;
var _local7:int;
_local2 = new ByteArray();
_local2.writeUnsignedInt(2303741511);
_local2.writeUnsignedInt(218765834);
_local3 = new ByteArray();
_local3.writeInt(_arg1.width);
_local3.writeInt(_arg1.height);
_local3.writeUnsignedInt(134610944);
_local3.writeByte(0);
writeChunk(_local2, 1229472850, _local3);
_local4 = new ByteArray();
_local5 = 0;
while (_local5 < _arg1.height) {
_local4.writeByte(0);
if (!_arg1.transparent){
_local7 = 0;
while (_local7 < _arg1.width) {
_local6 = _arg1.getPixel(_local7, _local5);
_local4.writeUnsignedInt(uint((((_local6 & 0xFFFFFF) << 8) | 0xFF)));
_local7++;
};
} else {
_local7 = 0;
while (_local7 < _arg1.width) {
_local6 = _arg1.getPixel32(_local7, _local5);
_local4.writeUnsignedInt(uint((((_local6 & 0xFFFFFF) << 8) | (_local6 >>> 24))));
_local7++;
};
};
_local5++;
};
_local4.compress();
writeChunk(_local2, 1229209940, _local4);
writeChunk(_local2, 1229278788, null);
return (_local2);
}
}
}//package com.adobe.images
Section 66
//JSON (com.adobe.serialization.json.JSON)
package com.adobe.serialization.json {
public class JSON {
public static function decode(_arg1:String){
var _local2:JSONDecoder;
_local2 = new JSONDecoder(_arg1);
return (_local2.getValue());
}
public static function encode(_arg1:Object):String{
var _local2:JSONEncoder;
_local2 = new JSONEncoder(_arg1);
return (_local2.getString());
}
}
}//package com.adobe.serialization.json
Section 67
//JSONDecoder (com.adobe.serialization.json.JSONDecoder)
package com.adobe.serialization.json {
public class JSONDecoder {
private var value;
private var tokenizer:JSONTokenizer;
private var token:JSONToken;
public function JSONDecoder(_arg1:String){
tokenizer = new JSONTokenizer(_arg1);
nextToken();
value = parseValue();
}
private function nextToken():JSONToken{
return ((token = tokenizer.getNextToken()));
}
private function parseObject():Object{
var _local1:Object;
var _local2:String;
_local1 = new Object();
nextToken();
if (token.type == JSONTokenType.RIGHT_BRACE){
return (_local1);
};
while (true) {
if (token.type == JSONTokenType.STRING){
_local2 = String(token.value);
nextToken();
if (token.type == JSONTokenType.COLON){
nextToken();
_local1[_local2] = parseValue();
nextToken();
if (token.type == JSONTokenType.RIGHT_BRACE){
return (_local1);
};
if (token.type == JSONTokenType.COMMA){
nextToken();
} else {
tokenizer.parseError(("Expecting } or , but found " + token.value));
};
} else {
tokenizer.parseError(("Expecting : but found " + token.value));
};
} else {
tokenizer.parseError(("Expecting string but found " + token.value));
};
};
return (null);
}
private function parseArray():Array{
var _local1:Array;
_local1 = new Array();
nextToken();
if (token.type == JSONTokenType.RIGHT_BRACKET){
return (_local1);
};
while (true) {
_local1.push(parseValue());
nextToken();
if (token.type == JSONTokenType.RIGHT_BRACKET){
return (_local1);
};
if (token.type == JSONTokenType.COMMA){
nextToken();
} else {
tokenizer.parseError(("Expecting ] or , but found " + token.value));
};
};
return (null);
}
public function getValue(){
return (value);
}
private function parseValue():Object{
if (token == null){
tokenizer.parseError("Unexpected end of input");
};
switch (token.type){
case JSONTokenType.LEFT_BRACE:
return (parseObject());
case JSONTokenType.LEFT_BRACKET:
return (parseArray());
case JSONTokenType.STRING:
case JSONTokenType.NUMBER:
case JSONTokenType.TRUE:
case JSONTokenType.FALSE:
case JSONTokenType.NULL:
return (token.value);
default:
tokenizer.parseError(("Unexpected " + token.value));
};
return (null);
}
}
}//package com.adobe.serialization.json
Section 68
//JSONEncoder (com.adobe.serialization.json.JSONEncoder)
package com.adobe.serialization.json {
import flash.utils.*;
public class JSONEncoder {
private var jsonString:String;
public function JSONEncoder(_arg1){
jsonString = convertToString(_arg1);
}
private function arrayToString(_arg1:Array):String{
var _local2:String;
var _local3:int;
_local2 = "";
_local3 = 0;
while (_local3 < _arg1.length) {
if (_local2.length > 0){
_local2 = (_local2 + ",");
};
_local2 = (_local2 + convertToString(_arg1[_local3]));
_local3++;
};
return ((("[" + _local2) + "]"));
}
private function convertToString(_arg1):String{
if ((_arg1 is String)){
return (escapeString((_arg1 as String)));
};
if ((_arg1 is Number)){
return ((isFinite((_arg1 as Number))) ? _arg1.toString() : "null");
} else {
if ((_arg1 is Boolean)){
return ((_arg1) ? "true" : "false");
} else {
if ((_arg1 is Array)){
return (arrayToString((_arg1 as Array)));
};
if ((((_arg1 is Object)) && (!((_arg1 == null))))){
return (objectToString(_arg1));
};
};
};
return ("null");
}
private function escapeString(_arg1:String):String{
var _local2:String;
var _local3:String;
var _local4:Number;
var _local5:int;
var _local6:String;
var _local7:String;
_local2 = "";
_local4 = _arg1.length;
_local5 = 0;
while (_local5 < _local4) {
_local3 = _arg1.charAt(_local5);
switch (_local3){
case "\"":
_local2 = (_local2 + "\\\"");
break;
case "\\":
_local2 = (_local2 + "\\\\");
break;
case "\b":
_local2 = (_local2 + "\\b");
break;
case "\f":
_local2 = (_local2 + "\\f");
break;
case "\n":
_local2 = (_local2 + "\\n");
break;
case "\r":
_local2 = (_local2 + "\\r");
break;
case "\t":
_local2 = (_local2 + "\\t");
break;
default:
if (_local3 < " "){
_local6 = _local3.charCodeAt(0).toString(16);
_local7 = ((_local6.length == 2)) ? "00" : "000";
_local2 = (_local2 + (("\\u" + _local7) + _local6));
} else {
_local2 = (_local2 + _local3);
};
};
_local5++;
};
return ((("\"" + _local2) + "\""));
}
private function objectToString(_arg1:Object):String{
var s:String;
var classInfo:XML;
var value:Object;
var key:String;
var v:XML;
var o = _arg1;
s = "";
classInfo = describeType(o);
if (classInfo.@name.toString() == "Object"){
for (key in o) {
value = o[key];
if ((value is Function)){
} else {
if (s.length > 0){
s = (s + ",");
};
s = (s + ((escapeString(key) + ":") + convertToString(value)));
};
};
} else {
for each (v in classInfo..*.(((name() == "variable")) || ((name() == "accessor")))) {
if (s.length > 0){
s = (s + ",");
};
s = (s + ((escapeString(v.@name.toString()) + ":") + convertToString(o[v.@name])));
};
};
return ((("{" + s) + "}"));
}
public function getString():String{
return (jsonString);
}
}
}//package com.adobe.serialization.json
Section 69
//JSONParseError (com.adobe.serialization.json.JSONParseError)
package com.adobe.serialization.json {
public class JSONParseError extends Error {
private var _text:String;
private var _location:int;
public function JSONParseError(_arg1:String="", _arg2:int=0, _arg3:String=""){
super(_arg1);
name = "JSONParseError";
_location = _arg2;
_text = _arg3;
}
public function get text():String{
return (_text);
}
public function get location():int{
return (_location);
}
}
}//package com.adobe.serialization.json
Section 70
//JSONToken (com.adobe.serialization.json.JSONToken)
package com.adobe.serialization.json {
public class JSONToken {
private var _value:Object;
private var _type:int;
public function JSONToken(_arg1:int=-1, _arg2:Object=null){
_type = _arg1;
_value = _arg2;
}
public function set value(_arg1:Object):void{
_value = _arg1;
}
public function get value():Object{
return (_value);
}
public function set type(_arg1:int):void{
_type = _arg1;
}
public function get type():int{
return (_type);
}
}
}//package com.adobe.serialization.json
Section 71
//JSONTokenizer (com.adobe.serialization.json.JSONTokenizer)
package com.adobe.serialization.json {
public class JSONTokenizer {
private var loc:int;
private var ch:String;
private var obj:Object;
private var jsonString:String;
public function JSONTokenizer(_arg1:String){
jsonString = _arg1;
loc = 0;
nextChar();
}
private function skipComments():void{
if (ch == "/"){
nextChar();
switch (ch){
case "/":
do {
nextChar();
} while (((!((ch == "\n"))) && (!((ch == "")))));
nextChar();
break;
case "*":
nextChar();
while (true) {
if (ch == "*"){
nextChar();
if (ch == "/"){
nextChar();
break;
};
} else {
nextChar();
};
if (ch == ""){
parseError("Multi-line comment not closed");
};
};
break;
default:
parseError((("Unexpected " + ch) + " encountered (expecting '/' or '*' )"));
};
};
}
private function isDigit(_arg1:String):Boolean{
return ((((_arg1 >= "0")) && ((_arg1 <= "9"))));
}
private function readNumber():JSONToken{
var _local1:JSONToken;
var _local2:String;
var _local3:Number;
_local1 = new JSONToken();
_local1.type = JSONTokenType.NUMBER;
_local2 = "";
if (ch == "-"){
_local2 = (_local2 + "-");
nextChar();
};
if (!isDigit(ch)){
parseError("Expecting a digit");
};
if (ch == "0"){
_local2 = (_local2 + ch);
nextChar();
if (isDigit(ch)){
parseError("A digit cannot immediately follow 0");
};
} else {
while (isDigit(ch)) {
_local2 = (_local2 + ch);
nextChar();
};
};
if (ch == "."){
_local2 = (_local2 + ".");
nextChar();
if (!isDigit(ch)){
parseError("Expecting a digit");
};
while (isDigit(ch)) {
_local2 = (_local2 + ch);
nextChar();
};
};
if ((((ch == "e")) || ((ch == "E")))){
_local2 = (_local2 + "e");
nextChar();
if ((((ch == "+")) || ((ch == "-")))){
_local2 = (_local2 + ch);
nextChar();
};
if (!isDigit(ch)){
parseError("Scientific notation number needs exponent value");
};
while (isDigit(ch)) {
_local2 = (_local2 + ch);
nextChar();
};
};
_local3 = Number(_local2);
if (((isFinite(_local3)) && (!(isNaN(_local3))))){
_local1.value = _local3;
return (_local1);
};
parseError((("Number " + _local3) + " is not valid!"));
return (null);
}
private function nextChar():String{
return ((ch = jsonString.charAt(loc++)));
}
public function getNextToken():JSONToken{
var _local1:JSONToken;
var _local2:String;
var _local3:String;
var _local4:String;
_local1 = new JSONToken();
skipIgnored();
switch (ch){
case "{":
_local1.type = JSONTokenType.LEFT_BRACE;
_local1.value = "{";
nextChar();
break;
case "}":
_local1.type = JSONTokenType.RIGHT_BRACE;
_local1.value = "}";
nextChar();
break;
case "[":
_local1.type = JSONTokenType.LEFT_BRACKET;
_local1.value = "[";
nextChar();
break;
case "]":
_local1.type = JSONTokenType.RIGHT_BRACKET;
_local1.value = "]";
nextChar();
break;
case ",":
_local1.type = JSONTokenType.COMMA;
_local1.value = ",";
nextChar();
break;
case ":":
_local1.type = JSONTokenType.COLON;
_local1.value = ":";
nextChar();
break;
case "t":
_local2 = ((("t" + nextChar()) + nextChar()) + nextChar());
if (_local2 == "true"){
_local1.type = JSONTokenType.TRUE;
_local1.value = true;
nextChar();
} else {
parseError(("Expecting 'true' but found " + _local2));
};
break;
case "f":
_local3 = (((("f" + nextChar()) + nextChar()) + nextChar()) + nextChar());
if (_local3 == "false"){
_local1.type = JSONTokenType.FALSE;
_local1.value = false;
nextChar();
} else {
parseError(("Expecting 'false' but found " + _local3));
};
break;
case "n":
_local4 = ((("n" + nextChar()) + nextChar()) + nextChar());
if (_local4 == "null"){
_local1.type = JSONTokenType.NULL;
_local1.value = null;
nextChar();
} else {
parseError(("Expecting 'null' but found " + _local4));
};
break;
case "\"":
_local1 = readString();
break;
default:
if (((isDigit(ch)) || ((ch == "-")))){
_local1 = readNumber();
} else {
if (ch == ""){
return (null);
};
parseError((("Unexpected " + ch) + " encountered"));
};
};
return (_local1);
}
private function skipWhite():void{
while (isWhiteSpace(ch)) {
nextChar();
};
}
private function isWhiteSpace(_arg1:String):Boolean{
return ((((((((_arg1 == " ")) || ((_arg1 == "\t")))) || ((_arg1 == "\n")))) || ((_arg1 == "\r"))));
}
public function parseError(_arg1:String):void{
throw (new JSONParseError(_arg1, loc, jsonString));
}
private function skipIgnored():void{
var _local1:int;
do {
_local1 = loc;
skipWhite();
skipComments();
} while (_local1 != loc);
}
private function isHexDigit(_arg1:String):Boolean{
var _local2:String;
_local2 = _arg1.toUpperCase();
return (((isDigit(_arg1)) || ((((_local2 >= "A")) && ((_local2 <= "F"))))));
}
private function readString():JSONToken{
var _local1:JSONToken;
var _local2:String;
var _local3:String;
var _local4:int;
_local1 = new JSONToken();
_local1.type = JSONTokenType.STRING;
_local2 = "";
nextChar();
while (((!((ch == "\""))) && (!((ch == ""))))) {
if (ch == "\\"){
nextChar();
switch (ch){
case "\"":
_local2 = (_local2 + "\"");
break;
case "/":
_local2 = (_local2 + "/");
break;
case "\\":
_local2 = (_local2 + "\\");
break;
case "b":
_local2 = (_local2 + "\b");
break;
case "f":
_local2 = (_local2 + "\f");
break;
case "n":
_local2 = (_local2 + "\n");
break;
case "r":
_local2 = (_local2 + "\r");
break;
case "t":
_local2 = (_local2 + "\t");
break;
case "u":
_local3 = "";
_local4 = 0;
while (_local4 < 4) {
if (!isHexDigit(nextChar())){
parseError((" Excepted a hex digit, but found: " + ch));
};
_local3 = (_local3 + ch);
_local4++;
};
_local2 = (_local2 + String.fromCharCode(parseInt(_local3, 16)));
break;
default:
_local2 = (_local2 + ("\\" + ch));
};
} else {
_local2 = (_local2 + ch);
};
nextChar();
};
if (ch == ""){
parseError("Unterminated string literal");
};
nextChar();
_local1.value = _local2;
return (_local1);
}
}
}//package com.adobe.serialization.json
Section 72
//JSONTokenType (com.adobe.serialization.json.JSONTokenType)
package com.adobe.serialization.json {
public class JSONTokenType {
public static const NUMBER:int = 11;
public static const FALSE:int = 8;
public static const RIGHT_BRACKET:int = 4;
public static const NULL:int = 9;
public static const TRUE:int = 7;
public static const RIGHT_BRACE:int = 2;
public static const UNKNOWN:int = -1;
public static const COMMA:int = 0;
public static const LEFT_BRACKET:int = 3;
public static const STRING:int = 10;
public static const LEFT_BRACE:int = 1;
public static const COLON:int = 6;
}
}//package com.adobe.serialization.json
Section 73
//IntUtil (com.adobe.utils.IntUtil)
package com.adobe.utils {
public class IntUtil {
private static var hexChars:String = "0123456789abcdef";
public static function toHex(_arg1:int, _arg2:Boolean=false):String{
var _local3:String;
var _local4:int;
var _local5:int;
_local3 = "";
if (_arg2){
_local4 = 0;
while (_local4 < 4) {
_local3 = (_local3 + (hexChars.charAt(((_arg1 >> (((3 - _local4) * 8) + 4)) & 15)) + hexChars.charAt(((_arg1 >> ((3 - _local4) * 8)) & 15))));
_local4++;
};
} else {
_local5 = 0;
while (_local5 < 4) {
_local3 = (_local3 + (hexChars.charAt(((_arg1 >> ((_local5 * 8) + 4)) & 15)) + hexChars.charAt(((_arg1 >> (_local5 * 8)) & 15))));
_local5++;
};
};
return (_local3);
}
public static function ror(_arg1:int, _arg2:int):uint{
var _local3:int;
_local3 = (32 - _arg2);
return (((_arg1 << _local3) | (_arg1 >>> (32 - _local3))));
}
public static function rol(_arg1:int, _arg2:int):int{
return (((_arg1 << _arg2) | (_arg1 >>> (32 - _arg2))));
}
}
}//package com.adobe.utils
Section 74
//CreateToken (com.facebook.commands.auth.CreateToken)
package com.facebook.commands.auth {
import com.facebook.net.*;
public class CreateToken extends FacebookCall {
public static const SCHEMA:Array = [];
public static const METHOD_NAME:String = "auth.createToken";
public function CreateToken(){
super(METHOD_NAME);
}
}
}//package com.facebook.commands.auth
Section 75
//ExpireSession (com.facebook.commands.auth.ExpireSession)
package com.facebook.commands.auth {
import com.facebook.net.*;
public class ExpireSession extends FacebookCall {
public static const SCHEMA:Array = [];
public static const METHOD_NAME:String = "auth.expireSession";
public function ExpireSession(){
super(METHOD_NAME);
}
}
}//package com.facebook.commands.auth
Section 76
//GetSession (com.facebook.commands.auth.GetSession)
package com.facebook.commands.auth {
import com.facebook.net.*;
import com.facebook.*;
public class GetSession extends FacebookCall {
public var auth_token:String;
public static const SCHEMA:Array = ["auth_token"];
public static const METHOD_NAME:String = "auth.getSession";
public function GetSession(_arg1:String){
super(METHOD_NAME);
this.auth_token = _arg1;
}
override facebook_internal function initialize():void{
applySchema(SCHEMA, auth_token);
super.initialize();
}
}
}//package com.facebook.commands.auth
Section 77
//GetCookiesData (com.facebook.commands.data.GetCookiesData)
package com.facebook.commands.data {
import com.facebook.data.*;
public class GetCookiesData extends FacebookData {
public var name:String;
public var uid:String;
public var path:String;
public var value:String;
public var expires:Number;
}
}//package com.facebook.commands.data
Section 78
//GetFriends (com.facebook.commands.friends.GetFriends)
package com.facebook.commands.friends {
import com.facebook.net.*;
import com.facebook.*;
public class GetFriends extends FacebookCall {
public var flid:String;
public var uid:String;
public static const SCHEMA:Array = ["flid", "uid"];
public static const METHOD_NAME:String = "friends.get";
public function GetFriends(_arg1:String=null, _arg2:String=null){
super(METHOD_NAME);
this.flid = _arg1;
this.uid = _arg2;
}
override facebook_internal function initialize():void{
applySchema(SCHEMA, flid, uid);
super.initialize();
}
}
}//package com.facebook.commands.friends
Section 79
//UploadPhoto (com.facebook.commands.photos.UploadPhoto)
package com.facebook.commands.photos {
import com.facebook.net.*;
import com.facebook.data.photos.*;
import com.facebook.*;
public class UploadPhoto extends FacebookCall {
public var data:Object;
public var uploadedPhoto:FacebookPhoto;
public var aid:String;
public var uploadQuality:uint;// = 80
public var uid:String;
public var uploadType:String;// = "png"
public var caption:String;
public static const SCHEMA:Array = ["data", "aid", "caption", "uid"];
public static const METHOD_NAME:String = "photos.upload";
public function UploadPhoto(_arg1:Object=null, _arg2:String=null, _arg3:String=null, _arg4:String=null){
uploadType = UploadPhotoTypes.PNG;
uploadQuality = 80;
super(METHOD_NAME);
this.data = _arg1;
this.aid = _arg2;
this.caption = _arg3;
this.uid = _arg4;
}
override facebook_internal function initialize():void{
applySchema(SCHEMA, data, aid, caption, uid);
super.initialize();
}
}
}//package com.facebook.commands.photos
Section 80
//UploadPhotoTypes (com.facebook.commands.photos.UploadPhotoTypes)
package com.facebook.commands.photos {
public class UploadPhotoTypes {
public static const JPEG:String = "jpeg";
public static const PNG:String = "png";
}
}//package com.facebook.commands.photos
Section 81
//GetInfo (com.facebook.commands.users.GetInfo)
package com.facebook.commands.users {
import com.facebook.utils.*;
import com.facebook.net.*;
import com.facebook.*;
public class GetInfo extends FacebookCall {
public var uids:Array;
public var fields:Array;
public static const SCHEMA:Array = ["uids", "fields"];
public static const METHOD_NAME:String = "users.getInfo";
public function GetInfo(_arg1:Array, _arg2:Array){
super(METHOD_NAME);
this.uids = _arg1;
this.fields = _arg2;
}
override facebook_internal function initialize():void{
applySchema(SCHEMA, FacebookDataUtils.toArrayString(uids), FacebookDataUtils.toArrayString(fields));
super.initialize();
}
}
}//package com.facebook.commands.users
Section 82
//GetLoggedInUser (com.facebook.commands.users.GetLoggedInUser)
package com.facebook.commands.users {
import com.facebook.net.*;
public class GetLoggedInUser extends FacebookCall {
public static const SCHEMA:Array = [];
public static const METHOD_NAME:String = "users.getLoggedInUser";
public function GetLoggedInUser(){
super(METHOD_NAME);
}
}
}//package com.facebook.commands.users
Section 83
//GetAllocationData (com.facebook.data.admin.GetAllocationData)
package com.facebook.data.admin {
import com.facebook.data.*;
public class GetAllocationData extends FacebookData {
public var allocationLimit:Number;
}
}//package com.facebook.data.admin
Section 84
//GetAppPropertiesData (com.facebook.data.admin.GetAppPropertiesData)
package com.facebook.data.admin {
import com.facebook.data.*;
public class GetAppPropertiesData extends FacebookData {
public var appProperties:Array;
}
}//package com.facebook.data.admin
Section 85
//GetMetricsData (com.facebook.data.admin.GetMetricsData)
package com.facebook.data.admin {
import com.facebook.data.*;
public class GetMetricsData extends FacebookData {
public var metricsCollection:MetricsDataCollection;
}
}//package com.facebook.data.admin
Section 86
//MetricsData (com.facebook.data.admin.MetricsData)
package com.facebook.data.admin {
public class MetricsData {
public var end_time:Date;
public var canvas_page_views:Number;
public var active_users:Number;
}
}//package com.facebook.data.admin
Section 87
//MetricsDataCollection (com.facebook.data.admin.MetricsDataCollection)
package com.facebook.data.admin {
import com.facebook.utils.*;
public class MetricsDataCollection extends FacebookArrayCollection {
public function MetricsDataCollection(){
super(null, MetricsData);
}
}
}//package com.facebook.data.admin
Section 88
//GetPublicInfoData (com.facebook.data.application.GetPublicInfoData)
package com.facebook.data.application {
import com.facebook.data.*;
public class GetPublicInfoData extends FacebookData {
public var monthly_active_users:Number;
public var canvas_name:String;
public var logo_url:String;
public var company_name:String;
public var display_name:String;
public var icon_url:String;
public var weekly_active_users:Number;
public var developers:String;
public var daily_active_users:Number;
public var app_id:String;
public var api_key:String;
public var description:String;
}
}//package com.facebook.data.application
Section 89
//GetSessionData (com.facebook.data.auth.GetSessionData)
package com.facebook.data.auth {
import com.facebook.data.*;
public class GetSessionData extends FacebookData {
public var uid:String;
public var secret:String;
public var expires:Date;
public var session_key:String;
}
}//package com.facebook.data.auth
Section 90
//BatchResult (com.facebook.data.batch.BatchResult)
package com.facebook.data.batch {
import com.facebook.data.*;
public class BatchResult extends FacebookData {
public var results:Array;
}
}//package com.facebook.data.batch
Section 91
//GetObjectTypeData (com.facebook.data.data.GetObjectTypeData)
package com.facebook.data.data {
import com.facebook.data.*;
public class GetObjectTypeData extends FacebookData {
public var name:String;
public var data_type:Number;
public var index_type:Number;
}
}//package com.facebook.data.data
Section 92
//GetObjectTypesData (com.facebook.data.data.GetObjectTypesData)
package com.facebook.data.data {
import com.facebook.data.*;
public class GetObjectTypesData extends FacebookData {
public var objectTypeCollection:ObjectTypesCollection;
}
}//package com.facebook.data.data
Section 93
//GetUserPreferencesData (com.facebook.data.data.GetUserPreferencesData)
package com.facebook.data.data {
import com.facebook.data.*;
public class GetUserPreferencesData extends FacebookData {
public var perferenceCollection:PreferenceCollection;
}
}//package com.facebook.data.data
Section 94
//ObjectTypesCollection (com.facebook.data.data.ObjectTypesCollection)
package com.facebook.data.data {
import com.facebook.utils.*;
public class ObjectTypesCollection extends FacebookArrayCollection {
public function ObjectTypesCollection(){
super(null, ObjectTypesData);
}
}
}//package com.facebook.data.data
Section 95
//ObjectTypesData (com.facebook.data.data.ObjectTypesData)
package com.facebook.data.data {
public class ObjectTypesData {
public var object_class:String;
public var name:String;
}
}//package com.facebook.data.data
Section 96
//PreferenceCollection (com.facebook.data.data.PreferenceCollection)
package com.facebook.data.data {
import com.facebook.utils.*;
public class PreferenceCollection extends FacebookArrayCollection {
public function PreferenceCollection(){
super(null, PreferenceData);
}
}
}//package com.facebook.data.data
Section 97
//PreferenceData (com.facebook.data.data.PreferenceData)
package com.facebook.data.data {
public class PreferenceData {
public var value:String;
public var pref_id:Number;
}
}//package com.facebook.data.data
Section 98
//EventCollection (com.facebook.data.events.EventCollection)
package com.facebook.data.events {
import com.facebook.utils.*;
public class EventCollection extends FacebookArrayCollection {
public function EventCollection(){
super(null, EventData);
}
}
}//package com.facebook.data.events
Section 99
//EventData (com.facebook.data.events.EventData)
package com.facebook.data.events {
import com.facebook.data.*;
public class EventData {
public var eid:String;
public var update_time:Date;
public var nid:Number;
public var pic:String;
public var name:String;
public var tagline:String;
public var start_time:Date;
public var end_time:Date;
public var event_subtype:String;
public var pic_small:String;
public var pic_big:String;
public var host:String;
public var creator:Number;
public var venue:FacebookLocation;
public var location:String;
public var description:String;
public var event_type:String;
}
}//package com.facebook.data.events
Section 100
//GetEventsData (com.facebook.data.events.GetEventsData)
package com.facebook.data.events {
import com.facebook.data.*;
public class GetEventsData extends FacebookData {
public var eventCollection:EventCollection;
}
}//package com.facebook.data.events
Section 101
//GetMembersData (com.facebook.data.events.GetMembersData)
package com.facebook.data.events {
import com.facebook.data.*;
public class GetMembersData extends FacebookData {
public var attending:Array;
public var not_replied:Array;
public var unsure:Array;
public var declined:Array;
}
}//package com.facebook.data.events
Section 102
//AbstractTagData (com.facebook.data.fbml.AbstractTagData)
package com.facebook.data.fbml {
public class AbstractTagData {
public var description:String;
public var name:String;
public var header_fbml:String;
public var attributes:AttributeCollection;
public var type:String;
public var is_public:String;
public var footer_fbml:String;
public function AbstractTagData(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:String="", _arg6:String="", _arg7:AttributeCollection=null){
this.name = _arg1;
this.type = _arg4;
this.description = _arg5;
this.is_public = _arg6;
this.header_fbml = _arg2;
this.footer_fbml = _arg3;
this.attributes = _arg7;
}
}
}//package com.facebook.data.fbml
Section 103
//AttributeCollection (com.facebook.data.fbml.AttributeCollection)
package com.facebook.data.fbml {
import com.facebook.utils.*;
public class AttributeCollection extends FacebookArrayCollection {
public function AttributeCollection(){
super(null, AttributeData);
}
}
}//package com.facebook.data.fbml
Section 104
//AttributeData (com.facebook.data.fbml.AttributeData)
package com.facebook.data.fbml {
public class AttributeData {
public var default_value:String;
public var name:String;
public var description:String;
}
}//package com.facebook.data.fbml
Section 105
//ContainerTagData (com.facebook.data.fbml.ContainerTagData)
package com.facebook.data.fbml {
public class ContainerTagData extends AbstractTagData {
public var close_tag_fbml:String;
public var open_tag_fbml:String;
public function ContainerTagData(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:String, _arg6:String, _arg7:String="", _arg8:String="", _arg9:AttributeCollection=null){
this.open_tag_fbml = _arg5;
this.close_tag_fbml = _arg6;
super(_arg1, _arg2, _arg3, _arg4, _arg7, _arg8, _arg9);
}
}
}//package com.facebook.data.fbml
Section 106
//GetCustomTagsData (com.facebook.data.fbml.GetCustomTagsData)
package com.facebook.data.fbml {
import com.facebook.data.*;
public class GetCustomTagsData extends FacebookData {
public var tagCollection:TagCollection;
}
}//package com.facebook.data.fbml
Section 107
//LeafTagData (com.facebook.data.fbml.LeafTagData)
package com.facebook.data.fbml {
public class LeafTagData extends AbstractTagData {
public var fbml:String;
public function LeafTagData(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:String, _arg6:String="", _arg7:String="", _arg8:AttributeCollection=null){
this.fbml = _arg2;
super(_arg1, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8);
}
}
}//package com.facebook.data.fbml
Section 108
//TagCollection (com.facebook.data.fbml.TagCollection)
package com.facebook.data.fbml {
import com.facebook.utils.*;
public class TagCollection extends FacebookArrayCollection {
public function TagCollection(){
super(null, AbstractTagData);
}
}
}//package com.facebook.data.fbml
Section 109
//GetRegisteredTemplateBundleByIDData (com.facebook.data.feed.GetRegisteredTemplateBundleByIDData)
package com.facebook.data.feed {
import com.facebook.data.*;
public class GetRegisteredTemplateBundleByIDData extends FacebookData {
public var templateCollection:TemplateCollection;
}
}//package com.facebook.data.feed
Section 110
//GetRegisteredTemplateBundleData (com.facebook.data.feed.GetRegisteredTemplateBundleData)
package com.facebook.data.feed {
import com.facebook.data.*;
public class GetRegisteredTemplateBundleData extends FacebookData {
public var bundleCollection:TemplateCollection;
}
}//package com.facebook.data.feed
Section 111
//TemplateBundleCollection (com.facebook.data.feed.TemplateBundleCollection)
package com.facebook.data.feed {
import com.facebook.utils.*;
public class TemplateBundleCollection extends FacebookArrayCollection {
public function TemplateBundleCollection(){
super(null, TemplateData);
}
}
}//package com.facebook.data.feed
Section 112
//TemplateCollection (com.facebook.data.feed.TemplateCollection)
package com.facebook.data.feed {
import com.facebook.utils.*;
public class TemplateCollection extends FacebookArrayCollection {
public var template_bundle_id:Number;
public var time_created:Date;
public function TemplateCollection(){
super(null, TemplateData);
}
public function addTemplateData(_arg1:TemplateData):void{
this.addItem(_arg1);
}
}
}//package com.facebook.data.feed
Section 113
//TemplateData (com.facebook.data.feed.TemplateData)
package com.facebook.data.feed {
public class TemplateData {
public var template_title:String;
public var template_body:String;
public var type:String;
}
}//package com.facebook.data.feed
Section 114
//AreFriendsData (com.facebook.data.friends.AreFriendsData)
package com.facebook.data.friends {
import com.facebook.data.*;
public class AreFriendsData extends FacebookData {
public var friendsCollection:FriendsCollection;
}
}//package com.facebook.data.friends
Section 115
//FriendsCollection (com.facebook.data.friends.FriendsCollection)
package com.facebook.data.friends {
import com.facebook.utils.*;
public class FriendsCollection extends FacebookArrayCollection {
public function FriendsCollection(){
super(null, FriendsData);
}
}
}//package com.facebook.data.friends
Section 116
//FriendsData (com.facebook.data.friends.FriendsData)
package com.facebook.data.friends {
public class FriendsData {
public var uid1:Number;
public var uid2:Number;
public var are_friends:Boolean;
}
}//package com.facebook.data.friends
Section 117
//GetAppUserData (com.facebook.data.friends.GetAppUserData)
package com.facebook.data.friends {
import com.facebook.data.*;
public class GetAppUserData extends FacebookData {
public var uids:Array;
}
}//package com.facebook.data.friends
Section 118
//GetFriendsData (com.facebook.data.friends.GetFriendsData)
package com.facebook.data.friends {
import com.facebook.data.*;
import com.facebook.data.users.*;
public class GetFriendsData extends FacebookData {
public var friends:FacebookUserCollection;
}
}//package com.facebook.data.friends
Section 119
//GetListsData (com.facebook.data.friends.GetListsData)
package com.facebook.data.friends {
import com.facebook.data.*;
public class GetListsData extends FacebookData {
public var lists:Array;
}
}//package com.facebook.data.friends
Section 120
//ListsData (com.facebook.data.friends.ListsData)
package com.facebook.data.friends {
public class ListsData {
public var flid:Number;
public var name:String;
}
}//package com.facebook.data.friends
Section 121
//GetGroupData (com.facebook.data.groups.GetGroupData)
package com.facebook.data.groups {
import com.facebook.data.*;
public class GetGroupData extends FacebookData {
public var groups:GroupCollection;
}
}//package com.facebook.data.groups
Section 122
//GetMemberData (com.facebook.data.groups.GetMemberData)
package com.facebook.data.groups {
import com.facebook.data.*;
public class GetMemberData extends FacebookData {
public var admins:Array;
public var members:Array;
public var notReplied:Array;
public var officers:Array;
}
}//package com.facebook.data.groups
Section 123
//GroupCollection (com.facebook.data.groups.GroupCollection)
package com.facebook.data.groups {
import com.facebook.utils.*;
public class GroupCollection extends FacebookArrayCollection {
public function GroupCollection(){
super(null, GroupData);
}
public function addGroup(_arg1:GroupData):void{
this.addItem(_arg1);
}
}
}//package com.facebook.data.groups
Section 124
//GroupData (com.facebook.data.groups.GroupData)
package com.facebook.data.groups {
import com.facebook.data.*;
public class GroupData {
public var gid:String;
public var update_time:Date;
public var privacy:String;
public var nid:Number;
public var pic:String;
public var name:String;
public var pic_big:String;
public var website:String;
public var group_type:String;
public var office:String;
public var pic_small:String;
public var creator:String;
public var venue:FacebookLocation;
public var recent_news:String;
public var group_subtype:String;
public var description:String;
}
}//package com.facebook.data.groups
Section 125
//GetNotesData (com.facebook.data.notes.GetNotesData)
package com.facebook.data.notes {
import com.facebook.data.*;
public class GetNotesData extends FacebookData {
public var notesCollection:NotesCollection;
}
}//package com.facebook.data.notes
Section 126
//NoteData (com.facebook.data.notes.NoteData)
package com.facebook.data.notes {
public class NoteData {
public var note_id:String;
public var created_time:Date;
public var updated_time:Date;
public var title:String;
public var content:String;
public var uid:String;
}
}//package com.facebook.data.notes
Section 127
//NotesCollection (com.facebook.data.notes.NotesCollection)
package com.facebook.data.notes {
import com.facebook.utils.*;
public class NotesCollection extends FacebookArrayCollection {
public function NotesCollection(){
super(null, NoteData);
}
}
}//package com.facebook.data.notes
Section 128
//GetNotificationData (com.facebook.data.notifications.GetNotificationData)
package com.facebook.data.notifications {
import com.facebook.data.*;
public class GetNotificationData extends FacebookData {
public var group_invites:Array;
public var notificationCollection:NotificationCollection;
public var friendsRequests:Array;
public var event_invites:Array;
}
}//package com.facebook.data.notifications
Section 129
//NotificationCollection (com.facebook.data.notifications.NotificationCollection)
package com.facebook.data.notifications {
import com.facebook.utils.*;
public class NotificationCollection extends FacebookArrayCollection {
public function NotificationCollection(){
super(null, null);
}
}
}//package com.facebook.data.notifications
Section 130
//NotificationMessageData (com.facebook.data.notifications.NotificationMessageData)
package com.facebook.data.notifications {
public class NotificationMessageData {
public var most_recent:Number;
public var unread:Number;
}
}//package com.facebook.data.notifications
Section 131
//NotificationPokeData (com.facebook.data.notifications.NotificationPokeData)
package com.facebook.data.notifications {
public class NotificationPokeData {
public var most_recent:Number;
public var unread:Number;
}
}//package com.facebook.data.notifications
Section 132
//NotificationShareData (com.facebook.data.notifications.NotificationShareData)
package com.facebook.data.notifications {
public class NotificationShareData {
public var most_recent:Number;
public var unread:Number;
}
}//package com.facebook.data.notifications
Section 133
//GetPageInfoData (com.facebook.data.pages.GetPageInfoData)
package com.facebook.data.pages {
import com.facebook.data.*;
public class GetPageInfoData extends FacebookData {
public var pageInfoCollection:PageInfoCollection;
}
}//package com.facebook.data.pages
Section 134
//PageInfoCollection (com.facebook.data.pages.PageInfoCollection)
package com.facebook.data.pages {
import com.facebook.utils.*;
public class PageInfoCollection extends FacebookArrayCollection {
public function PageInfoCollection(){
super(null, PageInfoData);
}
public function addPageInfo(_arg1:PageInfoData):void{
this.addItem(_arg1);
}
}
}//package com.facebook.data.pages
Section 135
//PageInfoData (com.facebook.data.pages.PageInfoData)
package com.facebook.data.pages {
import flash.events.*;
import com.facebook.data.*;
public class PageInfoData extends EventDispatcher {
public var starring:String;
public var genre:String;
public var season:String;
public var bio:String;
public var name:String;
public var pic_small:String;
public var schedule:String;
public var website:String;
public var influences:String;
public var founded:String;
public var hours:String;
public var record_label:String;
public var band_members:String;
public var location:FacebookLocation;
public var mission:String;
public var directed_by:String;
public var type:String;
public var awards:String;
public var pic_large:String;
public var page_id:Number;
public var network:String;
public var pic_big:String;
public var studio:String;
public var release_date:String;
public var products:String;
public var hometown:String;
public var pic_square:String;
public var produced_by:String;
public var company_overview:String;
public var plot_outline:String;
public var has_added_app:Boolean;
public var written_by:String;
}
}//package com.facebook.data.pages
Section 136
//AlbumCollection (com.facebook.data.photos.AlbumCollection)
package com.facebook.data.photos {
import com.facebook.utils.*;
public class AlbumCollection extends FacebookArrayCollection {
public function AlbumCollection(){
super(null, AlbumData);
}
public function addAlbum(_arg1:AlbumData):void{
this.addItem(_arg1);
}
}
}//package com.facebook.data.photos
Section 137
//AlbumData (com.facebook.data.photos.AlbumData)
package com.facebook.data.photos {
public class AlbumData {
public var cover_pid:String;
public var size:Number;
public var modified:Date;
public var name:String;
public var aid:String;
public var created:Date;
public var visible:String;
public var owner:String;
public var location:String;
public var link:String;
public var description:String;
}
}//package com.facebook.data.photos
Section 138
//FacebookPhoto (com.facebook.data.photos.FacebookPhoto)
package com.facebook.data.photos {
import com.facebook.data.*;
public class FacebookPhoto extends FacebookData {
public var src_small:String;
public var pid:String;
public var tags:Array;
public var src:String;
public var src_big:String;
public var created:Date;
public var caption:String;
public var owner:Number;
public var link:String;
public var aid:String;
public function FacebookPhoto(){
tags = [];
super();
}
}
}//package com.facebook.data.photos
Section 139
//GetAlbumsData (com.facebook.data.photos.GetAlbumsData)
package com.facebook.data.photos {
import com.facebook.data.*;
public class GetAlbumsData extends FacebookData {
public var albumCollection:AlbumCollection;
}
}//package com.facebook.data.photos
Section 140
//GetCreateAlbumData (com.facebook.data.photos.GetCreateAlbumData)
package com.facebook.data.photos {
import com.facebook.data.*;
public class GetCreateAlbumData extends FacebookData {
public var albumData:AlbumData;
}
}//package com.facebook.data.photos
Section 141
//GetPhotosData (com.facebook.data.photos.GetPhotosData)
package com.facebook.data.photos {
import com.facebook.data.*;
public class GetPhotosData extends FacebookData {
public var photoCollection:PhotoCollection;
}
}//package com.facebook.data.photos
Section 142
//GetTagsData (com.facebook.data.photos.GetTagsData)
package com.facebook.data.photos {
import com.facebook.data.*;
public class GetTagsData extends FacebookData {
public var photoTagsCollection:PhotoTagCollection;
}
}//package com.facebook.data.photos
Section 143
//PhotoCollection (com.facebook.data.photos.PhotoCollection)
package com.facebook.data.photos {
import com.facebook.utils.*;
public class PhotoCollection extends FacebookArrayCollection {
public function PhotoCollection(){
super(null, PhotoData);
}
public function addPhoto(_arg1:PhotoData):void{
this.addItem(_arg1);
}
}
}//package com.facebook.data.photos
Section 144
//PhotoData (com.facebook.data.photos.PhotoData)
package com.facebook.data.photos {
public class PhotoData {
public var src:String;
public var src_big:String;
public var pid:String;
public var src_small:String;
public var caption:String;
public var owner:String;
public var created:Date;
public var link:String;
public var aid:String;
}
}//package com.facebook.data.photos
Section 145
//PhotoTagCollection (com.facebook.data.photos.PhotoTagCollection)
package com.facebook.data.photos {
import com.facebook.utils.*;
public class PhotoTagCollection extends FacebookArrayCollection {
public function PhotoTagCollection(_arg1:Array=null){
super(null, TagData);
}
public function addPhotoTag(_arg1:TagData):void{
this.addItem(_arg1);
}
}
}//package com.facebook.data.photos
Section 146
//TagData (com.facebook.data.photos.TagData)
package com.facebook.data.photos {
public class TagData {
public var pid:String;
protected var _actualY:Number;
protected var _actualX:Number;
public var created:Date;
public var tag_uid:String;
public var subject:String;
public var tag_text:String;
public function set y(_arg1:Number):void{
_actualY = _arg1;
}
public function get ycoord():Number{
return (_actualY);
}
public function set x(_arg1:Number):void{
_actualX = _arg1;
}
public function set ycoord(_arg1:Number):void{
_actualY = _arg1;
}
public function get y():Number{
return (_actualY);
}
public function set xcoord(_arg1:Number):void{
_actualX = _arg1;
}
public function get xcoord():Number{
return (_actualX);
}
public function get x():Number{
return (_actualX);
}
}
}//package com.facebook.data.photos
Section 147
//GetStatusData (com.facebook.data.status.GetStatusData)
package com.facebook.data.status {
import com.facebook.data.*;
public class GetStatusData extends FacebookData {
public var status:Array;
}
}//package com.facebook.data.status
Section 148
//Status (com.facebook.data.status.Status)
package com.facebook.data.status {
public class Status {
public var message:String;
public var status_id:String;
public var time:Date;
public var uid:String;
public var source:String;
}
}//package com.facebook.data.status
Section 149
//AttachmentData (com.facebook.data.stream.AttachmentData)
package com.facebook.data.stream {
public class AttachmentData {
public var body:String;
public var href:String;
public var caption:String;
public var name:String;
public var text:String;
public var media:Array;
public var label:String;
public var title:String;
public var icon:String;
public var description:String;
}
}//package com.facebook.data.stream
Section 150
//CommentsData (com.facebook.data.stream.CommentsData)
package com.facebook.data.stream {
public class CommentsData {
public var posts:Array;
public var can_post:Boolean;
public var count:uint;
public var can_remove:Boolean;
}
}//package com.facebook.data.stream
Section 151
//GetCommentsData (com.facebook.data.stream.GetCommentsData)
package com.facebook.data.stream {
import com.facebook.data.*;
public class GetCommentsData extends FacebookData {
public var comments:Array;
}
}//package com.facebook.data.stream
Section 152
//GetFiltersData (com.facebook.data.stream.GetFiltersData)
package com.facebook.data.stream {
import com.facebook.data.*;
public class GetFiltersData extends FacebookData {
public var filters:StreamFilterCollection;
}
}//package com.facebook.data.stream
Section 153
//GetStreamData (com.facebook.data.stream.GetStreamData)
package com.facebook.data.stream {
import com.facebook.data.*;
import com.facebook.data.photos.*;
public class GetStreamData extends FacebookData {
public var profiles:ProfileCollection;
public var albums:AlbumCollection;
public var stories:StreamStoryCollection;
}
}//package com.facebook.data.stream
Section 154
//LikesData (com.facebook.data.stream.LikesData)
package com.facebook.data.stream {
public class LikesData {
public var can_like:Boolean;
public var user_likes:Boolean;
public var href:String;
public var count:uint;
public var friends:Array;
public var sample:Array;
}
}//package com.facebook.data.stream
Section 155
//PhotoMedia (com.facebook.data.stream.PhotoMedia)
package com.facebook.data.stream {
public class PhotoMedia {
public var pid:String;
public var index:uint;
public var owner:String;
public var aid:String;
}
}//package com.facebook.data.stream
Section 156
//PostCommentData (com.facebook.data.stream.PostCommentData)
package com.facebook.data.stream {
public class PostCommentData {
public var fromid:String;
public var text:String;
public var time:Date;
public var id:String;
}
}//package com.facebook.data.stream
Section 157
//ProfileCollection (com.facebook.data.stream.ProfileCollection)
package com.facebook.data.stream {
import com.facebook.utils.*;
public class ProfileCollection extends FacebookArrayCollection {
public function ProfileCollection(){
super(null, ProfileData);
}
}
}//package com.facebook.data.stream
Section 158
//ProfileData (com.facebook.data.stream.ProfileData)
package com.facebook.data.stream {
public class ProfileData {
public var name:String;
public var url:String;
public var pic_square:String;
public var id:String;
}
}//package com.facebook.data.stream
Section 159
//StreamFilterCollection (com.facebook.data.stream.StreamFilterCollection)
package com.facebook.data.stream {
import com.facebook.utils.*;
public class StreamFilterCollection extends FacebookArrayCollection {
public function StreamFilterCollection(){
super(null, StreamFilterData);
}
}
}//package com.facebook.data.stream
Section 160
//StreamFilterData (com.facebook.data.stream.StreamFilterData)
package com.facebook.data.stream {
public class StreamFilterData {
public var icon_url:String;
public var name:String;
public var rank:uint;
public var uid:String;
public var value:String;
public var filter_key:String;
public var type:String;
public var is_visible:Boolean;
}
}//package com.facebook.data.stream
Section 161
//StreamMediaData (com.facebook.data.stream.StreamMediaData)
package com.facebook.data.stream {
public class StreamMediaData {
public var src:String;
public var alt:String;
public var href:String;
public var photo:PhotoMedia;
public var type:String;
public var video:VideoMedia;
public function toString():String{
return ([("type: " + type), ("href: " + href), ("src: " + src), ("alt: " + alt), ("photo: " + photo), ("video: " + video)].join(": "));
}
}
}//package com.facebook.data.stream
Section 162
//StreamStoryCollection (com.facebook.data.stream.StreamStoryCollection)
package com.facebook.data.stream {
import com.facebook.utils.*;
public class StreamStoryCollection extends FacebookArrayCollection {
public function StreamStoryCollection(){
super(null, StreamStoryData);
}
}
}//package com.facebook.data.stream
Section 163
//StreamStoryData (com.facebook.data.stream.StreamStoryData)
package com.facebook.data.stream {
public class StreamStoryData {
public var comments:CommentsData;
public var created_time:Date;
public var target_id:String;
public var sourceXML:XML;
public var message:String;
public var updated_time:Date;
public var source_id:String;
public var filter_key:String;
public var post_id:String;
public var privacy:String;
public var attachment:AttachmentData;
public var actor_id:String;
public var viewer_id:String;
public var metadata:Object;
public var app_id:String;
public var type:uint;
public var likes:LikesData;
public var attribution:String;
}
}//package com.facebook.data.stream
Section 164
//VideoMedia (com.facebook.data.stream.VideoMedia)
package com.facebook.data.stream {
public class VideoMedia {
public var source_url:String;
public var permalink:String;
public var display_url:String;
public var owner:String;
}
}//package com.facebook.data.stream
Section 165
//AffiliationCollection (com.facebook.data.users.AffiliationCollection)
package com.facebook.data.users {
import com.facebook.utils.*;
public class AffiliationCollection extends FacebookArrayCollection {
public function AffiliationCollection(){
super(null, AffiliationData);
}
public function addAffiliation(_arg1:AffiliationData):void{
this.addItem(_arg1);
}
}
}//package com.facebook.data.users
Section 166
//AffiliationData (com.facebook.data.users.AffiliationData)
package com.facebook.data.users {
public class AffiliationData {
public var nid:Number;
public var name:String;
public var status:String;
public var type:String;
public var year:String;
}
}//package com.facebook.data.users
Section 167
//FacebookUser (com.facebook.data.users.FacebookUser)
package com.facebook.data.users {
import com.facebook.data.*;
public class FacebookUser extends FacebookData {
public var isLoggedInUser:Boolean;
public var status:StatusData;
public var education_history:Array;
public var pic_big_with_logo:String;
public var notes_count:int;
public var pic_small:String;
public var has_added_app:Boolean;
public var pic_with_logo:String;
public var music:String;
public var religion:String;
public var significant_other_id:int;
public var email_hashes:Array;
public var hs2_name:String;
public var movies:String;
public var uid:String;
public var hometown_location:FacebookLocation;
public var wall_count:int;
public var proxied_email:String;
public var meeting_sex:Array;
public var sex:String;
public var work_history:Array;
public var hs_info:String;
public var pic_square:String;
public var hs1_id:int;
public var quotes:String;
public var locale:String;
public var birthday:String;
public var tv:String;
public var affiliations:Array;
public var interests:String;
public var pic:String;
public var name:String;// = ""
public var grad_year:String;
public var about_me:String;
public var last_name:String;// = ""
public var pic_small_with_logo:String;
public var is_app_user:Boolean;
public var hs1_name:String;
public var books:String;
public var first_name:String;// = ""
public var current_location:FacebookLocation;
public var meeting_for:Array;
public var pic_big:String;
public var networkAffiliations:Array;
public var birthdayDate:Date;
public var hs2_id:int;
public var relationship_status:String;
public var profile_url:String;
public var profile_update_time:Date;
public var pic_square_with_logo:String;
public var timezone:int;
public var activities:String;
public var political:String;
public function FacebookUser():void{
name = "";
first_name = "";
last_name = "";
super();
}
}
}//package com.facebook.data.users
Section 168
//FacebookUserCollection (com.facebook.data.users.FacebookUserCollection)
package com.facebook.data.users {
import com.facebook.utils.*;
public class FacebookUserCollection extends FacebookArrayCollection {
public function FacebookUserCollection(){
super(null, FacebookUser);
}
public function getUserById(_arg1:int):FacebookUser{
return ((findItemByProperty("uid", _arg1) as FacebookUser));
}
public function addUser(_arg1:FacebookUser):void{
addItem(_arg1);
}
}
}//package com.facebook.data.users
Section 169
//GetInfoData (com.facebook.data.users.GetInfoData)
package com.facebook.data.users {
import com.facebook.data.*;
public class GetInfoData extends FacebookData {
public var userCollection:FacebookUserCollection;
}
}//package com.facebook.data.users
Section 170
//GetStandardInfoData (com.facebook.data.users.GetStandardInfoData)
package com.facebook.data.users {
import com.facebook.data.*;
public class GetStandardInfoData extends FacebookData {
public var userCollection:UserCollection;
}
}//package com.facebook.data.users
Section 171
//StatusData (com.facebook.data.users.StatusData)
package com.facebook.data.users {
public class StatusData {
public var message:String;
public var time:Date;
}
}//package com.facebook.data.users
Section 172
//UserCollection (com.facebook.data.users.UserCollection)
package com.facebook.data.users {
import com.facebook.utils.*;
public class UserCollection extends FacebookArrayCollection {
public function UserCollection(_arg1:Array=null){
super(null, UserData);
}
}
}//package com.facebook.data.users
Section 173
//UserData (com.facebook.data.users.UserData)
package com.facebook.data.users {
public class UserData {
public var affiations:AffiliationCollection;
public var name:String;
public var uid:String;
public var timezone:Number;
public var first_name:String;
public var last_name:String;
public function toString():String{
return ((((((((((((("[ UserData uid: " + uid) + " affiation:") + affiations) + " first_name:") + first_name) + " last_name:") + last_name) + " name:") + name) + " timezone: ") + timezone) + "]"));
}
}
}//package com.facebook.data.users
Section 174
//ArrayResultData (com.facebook.data.ArrayResultData)
package com.facebook.data {
public class ArrayResultData extends FacebookData {
public var arrayResult:Array;
}
}//package com.facebook.data
Section 175
//BooleanResultData (com.facebook.data.BooleanResultData)
package com.facebook.data {
public class BooleanResultData extends FacebookData {
public var value:Boolean;
}
}//package com.facebook.data
Section 176
//FacebookData (com.facebook.data.FacebookData)
package com.facebook.data {
import flash.events.*;
public class FacebookData extends EventDispatcher {
public var rawResult:String;
}
}//package com.facebook.data
Section 177
//FacebookEducationInfo (com.facebook.data.FacebookEducationInfo)
package com.facebook.data {
public class FacebookEducationInfo {
public var concentrations:Array;
public var name:String;
public var degree:String;
public var year:String;
public function FacebookEducationInfo(){
concentrations = [];
}
}
}//package com.facebook.data
Section 178
//FacebookErrorCodes (com.facebook.data.FacebookErrorCodes)
package com.facebook.data {
public class FacebookErrorCodes {
public static const API_EC_VERSION:Number = 12;
public static const API_EC_PERMISSION_DENIED:Number = 10;
public static const API_EC_HOST_UP:Number = 7;
public static const API_EC_SERVICE:Number = 2;
public static const API_EC_RATE:Number = 9;
public static const API_EC_METHOD:Number = 3;
public static const API_EC_HOST_API:Number = 6;
public static const API_EC_SUCCESS:Number = 0;
public static const SERVER_ERROR:Number = -1;
public static const API_EC_UNKNOWN:Number = 1;
public static const API_EC_DEPRECATED:Number = 11;
public static const API_EC_SECURE:Number = 8;
public static const API_EC_TOO_MANY_CALLS:Number = 4;
public static const API_EC_BAD_IP:Number = 5;
}
}//package com.facebook.data
Section 179
//FacebookErrorReason (com.facebook.data.FacebookErrorReason)
package com.facebook.data {
public class FacebookErrorReason {
public static const CONNECT_TIMEOUT:String = "connectTimeout";
public static const LOAD_TIMEOUT:String = "loadTimeout";
}
}//package com.facebook.data
Section 180
//FacebookLocation (com.facebook.data.FacebookLocation)
package com.facebook.data {
public class FacebookLocation extends FacebookData {
public var street:String;
public var country:String;
public var state:String;
public var zip:String;
public var city:String;
}
}//package com.facebook.data
Section 181
//FacebookNetwork (com.facebook.data.FacebookNetwork)
package com.facebook.data {
public class FacebookNetwork {
public var nid:int;
public var name:String;
public var status:String;
public var type:String;
public var year:String;
}
}//package com.facebook.data
Section 182
//FacebookWorkInfo (com.facebook.data.FacebookWorkInfo)
package com.facebook.data {
public class FacebookWorkInfo {
public var position:String;
public var start_date:Date;
public var company_name:String;
public var location:FacebookLocation;
public var end_date:Date;
public var description:String;
}
}//package com.facebook.data
Section 183
//JSONResultData (com.facebook.data.JSONResultData)
package com.facebook.data {
public class JSONResultData extends FacebookData {
public var result:Object;
}
}//package com.facebook.data
Section 184
//NumberResultData (com.facebook.data.NumberResultData)
package com.facebook.data {
public class NumberResultData extends FacebookData {
public var value:Number;
}
}//package com.facebook.data
Section 185
//StringResultData (com.facebook.data.StringResultData)
package com.facebook.data {
public class StringResultData extends FacebookData {
public var value:String;
}
}//package com.facebook.data
Section 186
//XMLDataParser (com.facebook.data.XMLDataParser)
package com.facebook.data {
import flash.events.*;
import com.facebook.utils.*;
import com.adobe.serialization.json.*;
import com.facebook.errors.*;
import com.facebook.data.fbml.*;
import com.facebook.data.photos.*;
import com.facebook.data.users.*;
import com.facebook.data.status.*;
import com.facebook.data.data.*;
import com.facebook.data.notes.*;
import com.facebook.commands.data.*;
import com.facebook.data.application.*;
import com.facebook.data.feed.*;
import com.facebook.data.admin.*;
import com.facebook.data.events.*;
import com.facebook.data.friends.*;
import com.facebook.data.pages.*;
import com.facebook.data.notifications.*;
import com.facebook.data.groups.*;
import com.facebook.data.auth.*;
import com.facebook.data.batch.*;
public class XMLDataParser implements IFacebookResultParser {
protected var fb_namespace:Namespace;
public function XMLDataParser(){
fb_namespace = new Namespace("http://api.facebook.com/1.0/");
}
protected function parseGetPhotos(_arg1:XML):GetPhotosData{
var _local2:GetPhotosData;
var _local3:PhotoCollection;
var _local4:*;
var _local5:PhotoData;
_local2 = new GetPhotosData();
_local3 = new PhotoCollection();
for each (_local4 in _arg1..fb_namespace::photo) {
_local5 = new PhotoData();
_local5.pid = _local4.fb_namespace::pid;
_local5.aid = _local4.fb_namespace::aid;
_local5.owner = _local4.fb_namespace::owner;
_local5.src = _local4.fb_namespace::src;
_local5.src_big = _local4.fb_namespace::src_big;
_local5.src_small = _local4.fb_namespace::src_small;
_local5.caption = _local4.fb_namespace::caption;
_local5.created = FacebookXMLParserUtils.toDate(_local4.fb_namespace::created);
_local3.addPhoto(_local5);
};
_local2.photoCollection = _local3;
return (_local2);
}
protected function parseGetNotifications(_arg1:XML):GetNotificationData{
var _local2:GetNotificationData;
var _local3:NotificationCollection;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:NotificationMessageData;
var _local8:NotificationPokeData;
var _local9:NotificationShareData;
_local2 = new GetNotificationData();
_local3 = new NotificationCollection();
for each (_local4 in _arg1.fb_namespace::messages) {
_local7 = new NotificationMessageData();
_local7.unread = _local4.fb_namespace::unread;
_local7.most_recent = _local4.fb_namespace::most_recent;
_local3.addItem(_local7);
};
for each (_local5 in _arg1.fb_namespace::pokes) {
_local8 = new NotificationPokeData();
_local8.unread = _local5.fb_namespace::unread;
_local8.most_recent = _local5.fb_namespace::most_recent;
_local3.addItem(_local8);
};
for each (_local6 in _arg1.fb_namespace::shares) {
_local9 = new NotificationShareData();
_local9.unread = _local6.fb_namespace::unread;
_local9.most_recent = _local6.fb_namespace::most_recent;
_local3.addItem(_local9);
};
_local2.friendsRequests = FacebookXMLParserUtils.toUIDArray(_arg1.fb_namespace::friend_requests[0]);
_local2.group_invites = FacebookXMLParserUtils.toUIDArray(_arg1.fb_namespace::group_invites[0]);
_local2.event_invites = FacebookXMLParserUtils.toUIDArray(_arg1.fb_namespace::event_invites[0]);
_local2.notificationCollection = _local3;
return (_local2);
}
public function createFacebookError(_arg1:Object, _arg2:String):FacebookError{
var _local3:FacebookError;
_local3 = new FacebookError();
_local3.rawResult = _arg2;
_local3.errorCode = FacebookErrorCodes.SERVER_ERROR;
if ((_arg1 is Error)){
_local3.error = (_arg1 as Error);
} else {
_local3.errorEvent = (_arg1 as ErrorEvent);
};
return (_local3);
}
protected function parseSendEmail(_arg1:XML):ArrayResultData{
var _local2:ArrayResultData;
_local2 = new ArrayResultData();
_local2.arrayResult = FacebookXMLParserUtils.toArray(_arg1);
return (_local2);
}
protected function getAffiliation(_arg1:XML):AffiliationCollection{
var _local2:AffiliationCollection;
var _local3:*;
var _local4:AffiliationData;
_local2 = new AffiliationCollection();
for each (_local3 in _arg1..fb_namespace::afflication) {
_local4 = new AffiliationData();
_local4.nid = _local3.fb_namespace::nid;
_local4.name = _local3.fb_namespace::name;
_local4.type = _local3.fb_namespace::type;
_local4.status = _local3.fb_namespace::status;
_local4.year = _local3.fb_namespace::year;
_local2.addAffiliation(_local4);
};
return (_local2);
}
protected function parseGetUserPreferences(_arg1:XML):GetUserPreferencesData{
var _local2:GetUserPreferencesData;
var _local3:PreferenceCollection;
var _local4:*;
var _local5:PreferenceData;
_local2 = new GetUserPreferencesData();
_local3 = new PreferenceCollection();
for each (_local4 in _arg1..fb_namespace::preference) {
_local5 = new PreferenceData();
_local5.pref_id = _local4.fb_namespace::pref_id;
_local5.value = _local4.fb_namespace::value;
_local3.addItem(_local5);
};
_local2.perferenceCollection = _local3;
return (_local2);
}
protected function parseGetStandardInfo(_arg1:XML):GetStandardInfoData{
var _local2:GetStandardInfoData;
var _local3:UserCollection;
var _local4:*;
var _local5:UserData;
_local2 = new GetStandardInfoData();
_local3 = new UserCollection();
for each (_local4 in _arg1..fb_namespace::user) {
_local5 = new UserData();
_local5.uid = _local4.fb_namespace::uid;
_local5.affiations = getAffiliation(_local4.fb_namespace::affiliations);
_local5.first_name = _local4.fb_namespace::first_name;
_local5.last_name = _local4.fb_namespace::last_name;
_local5.name = _local4.fb_namespace::name;
_local5.timezone = _local4.fb_namespace::timezone;
_local3.addItem(_local5);
};
_local2.userCollection = _local3;
return (_local2);
}
protected function parseGetAppProperties(_arg1:XML):GetAppPropertiesData{
var _local2:GetAppPropertiesData;
_local2 = new GetAppPropertiesData();
_local2.appProperties = JSON.decode(_arg1.toString());
return (_local2);
}
protected function parseGetRegisteredTemplateBundles(_arg1:XML):GetRegisteredTemplateBundleData{
var _local2:GetRegisteredTemplateBundleData;
var _local3:TemplateBundleCollection;
var _local4:TemplateCollection;
var _local5:*;
_local2 = new GetRegisteredTemplateBundleData();
_local3 = new TemplateBundleCollection();
_local4 = new TemplateCollection();
for each (_local5 in _arg1..fb_namespace::template_bundle) {
getTemplate(_local5.fb_namespace::one_line_story_template, _local4);
getTemplate(_local5.fb_namespace::short_story_templates, _local4);
getTemplate(_local5.fb_namespace::full_story_template, _local4);
_local4.template_bundle_id = _local5.fb_namespace::template_bundle_id;
_local4.time_created = FacebookXMLParserUtils.toDate(_local5.fb_namespace::time_created);
};
_local2.bundleCollection = _local4;
return (_local2);
}
protected function parseGetRegisteredTemplateBundleByID(_arg1:XML):GetRegisteredTemplateBundleByIDData{
var _local2:GetRegisteredTemplateBundleByIDData;
var _local3:TemplateCollection;
_local2 = new GetRegisteredTemplateBundleByIDData();
_local3 = new TemplateCollection();
getTemplate(_arg1.fb_namespace::one_line_story_template, _local3);
getTemplate(_arg1.fb_namespace::short_story_templates, _local3);
getTemplate(_arg1.fb_namespace::full_story_template, _local3);
_local3.template_bundle_id = _arg1.fb_namespace::template_bundle_id;
_local3.time_created = FacebookXMLParserUtils.toDate(_arg1.fb_namespace::time_created);
_local2.templateCollection = _local3;
return (_local2);
}
protected function responseNodeNameToMethodName(_arg1:String):String{
var _local2:Array;
_local2 = _arg1.split("_");
_local2.pop();
return (_local2.join("."));
}
protected function parseGetObjectTypes(_arg1:XML):GetObjectTypesData{
var _local2:GetObjectTypesData;
var _local3:ObjectTypesCollection;
var _local4:*;
var _local5:ObjectTypesData;
_local2 = new GetObjectTypesData();
_local3 = new ObjectTypesCollection();
for each (_local4 in _arg1..fb_namespace::object_type_info) {
_local5 = new ObjectTypesData();
_local5.name = _local4.fb_namespace::name;
_local5.object_class = _local4.fb_namespace::object_class;
_local3.addItem(_local5);
};
_local2.objectTypeCollection = _local3;
return (_local2);
}
protected function parseFacebookPhoto(_arg1:XML):FacebookPhoto{
var _local2:FacebookPhoto;
_local2 = new FacebookPhoto();
_local2.pid = FacebookXMLParserUtils.toStringValue(_arg1.fb_namespace::pid[0]);
_local2.aid = FacebookXMLParserUtils.toStringValue(_arg1.fb_namespace::aid[0]);
_local2.owner = FacebookXMLParserUtils.toNumber(_arg1.fb_namespace::owner[0]);
_local2.src = FacebookXMLParserUtils.toStringValue(_arg1.fb_namespace::src[0]);
_local2.src_big = FacebookXMLParserUtils.toStringValue(_arg1.fb_namespace::src_big[0]);
_local2.src_small = FacebookXMLParserUtils.toStringValue(_arg1.fb_namespace::src_small[0]);
_local2.link = FacebookXMLParserUtils.toStringValue(_arg1.fb_namespace::link[0]);
_local2.caption = FacebookXMLParserUtils.toStringValue(_arg1.fb_namespace::caption[0]);
return (_local2);
}
protected function parseGetObjectType(_arg1:XML):GetObjectTypeData{
var _local2:GetObjectTypeData;
_local2 = new GetObjectTypeData();
_local2.name = _arg1.fb_namespace::name;
_local2.data_type = _arg1.fb_namespace::data_type;
_local2.index_type = _arg1.fb_namespace::index_type;
return (_local2);
}
protected function createTagObject(_arg1:XML, _arg2:Array){
var _local3:Number;
var _local4:String;
var _local5:AbstractTagData;
var _local6:Number;
var _local7:Object;
_local3 = _arg1.children().length();
_local4 = _arg1.children()[0].toLowerCase();
if (_local4 == "leaf"){
_local5 = new LeafTagData(null, null, null, null, null);
(_local5 as LeafTagData).fbml = _arg1.children()[9];
} else {
_local5 = new ContainerTagData(null, null, null, null, null, null, null);
(_local5 as ContainerTagData).open_tag_fbml = _arg1.children()[2];
(_local5 as ContainerTagData).close_tag_fbml = _arg1.children()[4];
};
_local6 = 0;
while (_local6 < _local3) {
_local7 = _arg1.children()[_local6];
switch (_arg2[_local6]){
case "name":
case "type":
case "description":
case "is_public":
case "header_fbml":
case "footer_fbml":
_local5[_arg2[_local6]] = _local7.text();
break;
case "attributes":
if ((_local7.children() is XMLList)){
if (_local7.children().length() == 0){
_local5[_arg2[_local6]] = null;
};
};
break;
};
_local6++;
};
return (_local5);
}
protected function parseGetNotes(_arg1:XML):GetNotesData{
var _local2:GetNotesData;
var _local3:NotesCollection;
var _local4:*;
var _local5:NoteData;
_local2 = new GetNotesData();
_local3 = new NotesCollection();
for each (_local4 in _arg1..fb_namespace::note) {
_local5 = new NoteData();
_local5.note_id = _local4.fb_namespace::note_id;
_local5.title = _local4.fb_namespace::title;
_local5.content = _local4.fb_namespace::content;
_local5.created_time = FacebookXMLParserUtils.toDate(_local4.fb_namespace::created_time);
_local5.updated_time = FacebookXMLParserUtils.toDate(_local4.fb_namespace::updated_time);
_local5.uid = _local4.fb_namespace::uid;
_local3.addItem(_local5);
};
_local2.notesCollection = _local3;
return (_local2);
}
protected function parseGetMetrics(_arg1:XML):GetMetricsData{
var _local2:GetMetricsData;
var _local3:MetricsDataCollection;
var _local4:*;
var _local5:MetricsData;
_local2 = new GetMetricsData();
_local3 = new MetricsDataCollection();
for each (_local4 in _arg1..fb_namespace::metrics) {
_local5 = new MetricsData();
_local5.end_time = FacebookXMLParserUtils.toDate(_local4.fb_namespace::end_time);
_local5.active_users = _local4.fb_namespace::active_users;
_local5.canvas_page_views = _local4.fb_namespace::canvas_page_views;
_local3.addItem(_local5);
};
_local2.metricsCollection = _local3;
return (_local2);
}
protected function parsePageGetInfo(_arg1:XML):GetPageInfoData{
var _local2:GetPageInfoData;
var _local3:PageInfoCollection;
var _local4:*;
var _local5:PageInfoData;
_local2 = new GetPageInfoData();
_local3 = new PageInfoCollection();
for each (_local4 in _arg1.fb_namespace::page) {
_local5 = new PageInfoData();
_local5.page_id = _local4.fb_namespace::page_id;
_local5.name = _local4.fb_namespace::name;
_local5.pic_small = _local4.fb_namespace::pic_small;
_local5.pic_big = _local4.fb_namespace::pic_big;
_local5.pic_square = _local4.fb_namespace::pic_square;
_local5.pic_large = _local4.fb_namespace::pic_large;
_local5.type = _local4.fb_namespace::type;
_local5.website = _local4.fb_namespace::website;
_local5.location = FacebookXMLParserUtils.createLocation(_local4.fb_namespace::location[0], fb_namespace);
_local5.hours = _local4.fb_namespace::hours;
_local5.band_members = _local4.fb_namespace::band_members;
_local5.bio = _local4.fb_namespace::bio;
_local5.hometown = _local4.fb_namespace::hometown;
_local5.genre = FacebookXMLParserUtils.toStringValue(_local4.fb_namespace::genre[0]);
_local5.record_label = _local4.fb_namespace::record_label;
_local5.influences = _local4.fb_namespace::influences;
_local5.has_added_app = FacebookXMLParserUtils.toBoolean(_local4.fb_namespace::has_added_app[0]);
_local5.founded = _local4.fb_namespace::founded;
_local5.company_overview = _local4.fb_namespace::company_overview;
_local5.mission = _local4.fb_namespace::mission;
_local5.products = _local4.fb_namespace::products;
_local5.release_date = _local4.fb_namespace::release_date;
_local5.starring = _local4.fb_namespace::starring;
_local5.written_by = _local4.fb_namespace::written_by;
_local5.directed_by = _local4.fb_namespace::directed_by;
_local5.produced_by = _local4.fb_namespace::produced_by;
_local5.studio = _local4.fb_namespace::studio;
_local5.awards = _local4.fb_namespace::awards;
_local5.plot_outline = _local4.fb_namespace::plot_outline;
_local5.network = _local4.fb_namespace::network;
_local5.season = _local4.fb_namespace::season;
_local5.schedule = _local4.fb_namespace::schedule;
_local3.addPageInfo(_local5);
};
_local2.pageInfoCollection = _local3;
return (_local2);
}
protected function parseGetTags(_arg1:XML):GetTagsData{
var _local2:GetTagsData;
var _local3:PhotoTagCollection;
var _local4:*;
var _local5:TagData;
_local2 = new GetTagsData();
_local3 = new PhotoTagCollection();
for each (_local4 in _arg1..fb_namespace::photo_tag) {
_local5 = new TagData();
_local5.pid = _local4.fb_namespace::pid;
_local5.subject = _local4.fb_namespace::subject;
_local5.xcoord = _local4.fb_namespace::xcoord;
_local5.ycoord = _local4.fb_namespace::ycoord;
_local5.created = FacebookXMLParserUtils.toDate(_local4.fb_namespace::created);
_local3.addPhotoTag(_local5);
};
_local2.photoTagsCollection = _local3;
return (_local2);
}
protected function parseGetGroupMembers(_arg1:XML):GetMemberData{
var _local2:GetMemberData;
_local2 = new GetMemberData();
_local2.members = FacebookXMLParserUtils.toUIDArray(_arg1.fb_namespace::members[0]);
_local2.admins = FacebookXMLParserUtils.toUIDArray(_arg1.fb_namespace::admins[0]);
_local2.officers = FacebookXMLParserUtils.toUIDArray(_arg1.fb_namespace::officers[0]);
_local2.notReplied = FacebookXMLParserUtils.toUIDArray(_arg1.fb_namespace::not_replied[0]);
return (_local2);
}
protected function parseGetGroups(_arg1:XML):GetGroupData{
var _local2:GetGroupData;
var _local3:GroupCollection;
var _local4:*;
var _local5:GroupData;
_local2 = new GetGroupData();
_local3 = new GroupCollection();
for each (_local4 in _arg1..fb_namespace::group) {
_local5 = new GroupData();
_local5.gid = _local4.fb_namespace::gid;
_local5.name = _local4.fb_namespace::name;
_local5.nid = _local4.fb_namespace::nid;
_local5.description = _local4.fb_namespace::description;
_local5.group_type = _local4.fb_namespace::group_type;
_local5.group_subtype = _local4.fb_namespace::group_subtype;
_local5.recent_news = _local4.fb_namespace::recent_news;
_local5.pic = _local4.fb_namespace::pic;
_local5.pic_big = _local4.fb_namespace::pic_big;
_local5.pic_small = _local4.fb_namespace::pic_small;
_local5.creator = _local4.fb_namespace::creator;
_local5.update_time = FacebookXMLParserUtils.toDate(_local4.fb_namespace::update_time);
_local5.office = _local4.fb_namespace::office;
_local5.website = _local4.fb_namespace::website;
_local5.venue = FacebookXMLParserUtils.createLocation(_local4.fb_namespace::venue[0], fb_namespace);
_local5.privacy = _local4.fb_namespace::privacy;
_local3.addGroup(_local5);
};
_local2.groups = _local3;
return (_local2);
}
protected function parseCreateAlbum(_arg1:XML):GetCreateAlbumData{
var _local2:GetCreateAlbumData;
var _local3:AlbumData;
_local2 = new GetCreateAlbumData();
_local3 = new AlbumData();
_local3.aid = _arg1.fb_namespace::aid;
_local3.cover_pid = _arg1.fb_namespace::cover_pid;
_local3.owner = _arg1.fb_namespace::owner;
_local3.name = _arg1.fb_namespace::name;
_local3.created = FacebookXMLParserUtils.toDate(_arg1.fb_namespace::created);
_local3.modified = FacebookXMLParserUtils.toDate(_arg1.fb_namespace::modified);
_local3.description = _arg1.fb_namespace::description;
_local3.location = _arg1.fb_namespace::location;
_local3.link = _arg1.fb_namespace::link;
_local3.size = _arg1.fb_namespace::size;
_local3.visible = _arg1.fb_namespace::visible;
_local2.albumData = _local3;
return (_local2);
}
protected function parseGetAllocation(_arg1:XML):GetAllocationData{
var _local2:GetAllocationData;
_local2 = new GetAllocationData();
_local2.allocationLimit = Number(_arg1.toString());
return (_local2);
}
protected function parseGetCookies(_arg1:XML):GetCookiesData{
var _local2:GetCookiesData;
_local2 = new GetCookiesData();
_local2.uid = _arg1.fb_namespace::uid;
_local2.name = _arg1.fb_namespace::name;
_local2.value = _arg1.fb_namespace::value;
_local2.expires = _arg1.fb_namespace::expires;
_local2.path = _arg1.fb_namespace::path;
return (_local2);
}
protected function parseGetCustomTags(_arg1:XML):GetCustomTagsData{
var _local2:Array;
var _local3:GetCustomTagsData;
var _local4:TagCollection;
var _local5:*;
_local2 = ["type", "name", "open_tag_fbml", "description", "close_tag_fbml", "is_public", "attributes", "header_fbml", "footer_fbml", "fbml"];
_local3 = new GetCustomTagsData();
_local4 = new TagCollection();
for each (_local5 in _arg1..fb_namespace::custom_tag) {
_local4.addItem(createTagObject(_local5, _local2));
};
_local3.tagCollection = _local4;
return (_local3);
}
protected function parseGetAlbums(_arg1:XML):GetAlbumsData{
var _local2:GetAlbumsData;
_local2 = new GetAlbumsData();
_local2.albumCollection = FacebookXMLParserUtils.createAlbumCollection(_arg1, fb_namespace);
return (_local2);
}
protected function parseGetInfo(_arg1:XML):GetInfoData{
var _local2:FacebookUserCollection;
var _local3:XMLList;
var _local4:uint;
var _local5:uint;
var _local6:GetInfoData;
var _local7:FacebookUser;
_local2 = new FacebookUserCollection();
_local3 = _arg1..fb_namespace::user;
_local4 = _local3.length();
_local5 = 0;
while (_local5 < _local4) {
_local7 = FacebookUserXMLParser.createFacebookUser(_local3[_local5], fb_namespace);
_local2.addItem(_local7);
_local5++;
};
_local6 = new GetInfoData();
_local6.userCollection = _local2;
return (_local6);
}
protected function parseGetLists(_arg1:XML):GetListsData{
var _local2:GetListsData;
var _local3:Array;
var _local4:*;
var _local5:ListsData;
_local2 = new GetListsData();
_local3 = [];
for each (_local4 in _arg1..fb_namespace::friendlist) {
_local5 = new ListsData();
_local5.flid = _local4.fb_namespace::flid;
_local5.name = _local4.fb_namespace::name;
_local3.push(_local5);
};
_local2.lists = _local3;
return (_local2);
}
public function parse(_arg1:String, _arg2:String):FacebookData{
var _local3:FacebookData;
var _local4:XML;
_local4 = new XML(_arg1);
switch (_arg2){
case "application.getPublicInfo":
_local3 = parseGetPublicInfo(_local4);
break;
case "data.getCookies":
_local3 = parseGetCookies(_local4);
break;
case "admin.getAllocation":
_local3 = parseGetAllocation(_local4);
break;
case "admin.getAppProperties":
_local3 = parseGetAppProperties(_local4);
break;
case "admin.getMetrics":
_local3 = parseGetMetrics(_local4);
break;
case "auth.getSession":
_local3 = new GetSessionData();
(_local3 as GetSessionData).expires = FacebookXMLParserUtils.toDate(_local4.fb_namespace::expires);
(_local3 as GetSessionData).uid = FacebookXMLParserUtils.toStringValue(_local4.fb_namespace::uid[0]);
(_local3 as GetSessionData).session_key = _local4.fb_namespace::session_key.toString();
(_local3 as GetSessionData).secret = String(_local4.fb_namespace::secret);
break;
case "feed.getRegisteredTemplateBundles":
_local3 = parseGetRegisteredTemplateBundles(_local4);
break;
case "friends.areFriends":
_local3 = parseAreFriends(_local4);
break;
case "notes.get":
_local3 = parseGetNotes(_local4);
break;
case "friends.get":
_local3 = parseGetFriends(_local4);
break;
case "friends.getAppUsers":
_local3 = parseGetAppUsersData(_local4);
break;
case "friends.getLists":
_local3 = parseGetLists(_local4);
break;
case "groups.get":
_local3 = parseGetGroups(_local4);
break;
case "data.getAssociationDefinitions":
_local3 = new FacebookData();
break;
case "data.getAssociationDefinition":
_local3 = new FacebookData();
break;
case "data.getObject":
case "data.getObjects":
_local3 = new FacebookData();
break;
case "groups.getMembers":
_local3 = parseGetGroupMembers(_local4);
break;
case "users.getInfo":
_local3 = parseGetInfo(_local4);
break;
case "data.createObject":
case "data.setHashValue":
case "connect.getUnconnectedFriendsCount":
case "feed.registerTemplateBundle":
_local3 = new NumberResultData();
(_local3 as NumberResultData).value = FacebookXMLParserUtils.toNumber(_local4);
break;
case "notifications.get":
_local3 = parseGetNotifications(_local4);
break;
case "feed.getRegisteredTemplateBundleByID":
_local3 = parseGetRegisteredTemplateBundleByID(_local4);
break;
case "users.getStandardInfo":
_local3 = parseGetStandardInfo(_local4);
break;
case "feed.getRegisteredTemplateBundles":
_local3 = parseGetRegisteredTemplateBundles(_local4);
break;
case "data.getUserPreferences":
_local3 = parseGetUserPreferences(_local4);
break;
case "users.isAppUser":
case "users.hasAppPermission":
case "users.setStatus":
case "pages.isFan":
case "pages.isAppAdded":
case "pages.isAdmin":
case "admin.setAppProperties":
case "auth.expireSession":
case "auth.revokeAuthorization":
case "events.cancel":
case "events.edit":
case "events.rsvp":
case "liveMessage.send":
case "data.undefineAssociation":
case "data.defineAssociation":
case "data.removeHashKeys":
case "data.removeHashKey":
case "data.incHashValue":
case "data.updateObject":
case "data.deleteObject":
case "data.deleteObjects":
case "data.renameAssociation":
case "data.setObjectProperty":
case "profile.setInfo":
case "profile.setInfoOptions":
case "feed.deactivateTemplateBundleByID":
case "feed.publishTemplatizedAction":
case "admin.setRestrictionInfo":
case "data.setCookie":
case "data.createObjectType":
case "notes.delete":
case "notes.edit":
case "data.setUserPreference":
case "data.dropObjectType":
case "data.renameObjectType":
case "fbml.registerCustomTags":
case "fbml.deleteCustomTags":
case "fbml.refreshRefUrl":
case "fbml.refreshImgSrc":
case "fbml.setRefHandle":
case "data.setUserPreferences":
case "data.defineObjectProperty":
case "photos.addTag":
case "stream.addLike":
case "stream.removeLike":
case "stream.removeComment":
_local3 = new BooleanResultData();
(_local3 as BooleanResultData).value = FacebookXMLParserUtils.toBoolean(_local4);
break;
case "feed.publishUserAction":
_local3 = new BooleanResultData();
(_local3 as BooleanResultData).value = FacebookXMLParserUtils.toBoolean(_local4.children()[0]);
break;
case "notifications.sendEmail":
_local3 = parseSendEmail(_local4);
break;
case "data.getObjectTypes":
_local3 = parseGetObjectTypes(_local4);
break;
case "users.getStandardInfo":
_local3 = parseGetStandardInfo(_local4);
break;
case "data.getObjectType":
_local3 = parseGetObjectType(_local4);
break;
case "events.get":
_local3 = parseGetEvent(_local4);
break;
case "events.getMembers":
_local3 = parseGetMembers(_local4);
break;
case "fql.query":
_local3 = new FacebookData();
break;
case "photos.createAlbum":
_local3 = parseCreateAlbum(_local4);
break;
case "photos.get":
_local3 = parseGetPhotos(_local4);
break;
case "photos.getTags":
_local3 = parseGetTags(_local4);
break;
case "photos.getAlbums":
_local3 = parseGetAlbums(_local4);
break;
case "photos.upload":
_local3 = parseFacebookPhoto(_local4);
break;
case "pages.getInfo":
_local3 = parsePageGetInfo(_local4);
break;
case "batch.run":
_local3 = parseBatchRun(_local4);
break;
case "fbml.getCustomTags":
_local3 = parseGetCustomTags(_local4);
break;
case "connect.unregisterUsers":
case "connect.registerUsers":
_local3 = new ArrayResultData();
(_local3 as ArrayResultData).arrayResult = FacebookXMLParserUtils.toArray(_local4);
break;
case "status.get":
_local3 = parseGetStatus(_local4);
break;
case "stream.get":
_local3 = FacebookStreamXMLParser.createStream(_local4, fb_namespace);
break;
case "stream.getComments":
_local3 = FacebookStreamXMLParser.createGetCommentsData(_local4, fb_namespace);
break;
case "stream.getFilters":
_local3 = FacebookStreamXMLParser.createStreamFilterCollection(_local4, fb_namespace);
break;
case "auth.createToken":
case "events.create":
case "links.post":
case "auth.promoteSession":
case "admin.getRestrictionInfo":
case "data.getObjectProperty":
case "notifications.send":
case "notes.create":
case "data.getUserPreference":
case "profile.setFBML":
case "users.getLoggedInUser":
case "stream.addComment":
default:
_local3 = new StringResultData();
(_local3 as StringResultData).value = FacebookXMLParserUtils.toStringValue(_local4);
break;
};
_local3.rawResult = _arg1;
return (_local3);
}
protected function parseGetAppUsersData(_arg1:XML):GetAppUserData{
var _local2:Array;
var _local3:GetAppUserData;
_local2 = FacebookXMLParserUtils.toUIDArray(_arg1);
_local3 = new GetAppUserData();
_local3.uids = _local2;
return (_local3);
}
protected function parseGetStatus(_arg1:XML):GetStatusData{
var _local2:GetStatusData;
var _local3:Array;
var _local4:XMLList;
var _local5:uint;
var _local6:uint;
var _local7:XMLList;
var _local8:Status;
_local2 = new GetStatusData();
_local3 = [];
_local4 = _arg1.children();
_local5 = _local4.length();
_local6 = 0;
while (_local6 < _local5) {
_local7 = _local4[_local6].children();
_local8 = new Status();
_local8.uid = FacebookXMLParserUtils.toStringValue(_local7[0]);
_local8.status_id = FacebookXMLParserUtils.toStringValue(_local7[1]);
_local8.time = FacebookXMLParserUtils.toDate(_local7[2]);
_local8.source = FacebookXMLParserUtils.toStringValue(_local7[3]);
_local8.message = FacebookXMLParserUtils.toStringValue(_local7[4]);
_local3.push(_local8);
_local6++;
};
_local2.status = _local3;
return (_local2);
}
protected function parseGetMembers(_arg1:XML):GetMembersData{
var _local2:GetMembersData;
_local2 = new GetMembersData();
_local2.attending = FacebookXMLParserUtils.toUIDArray(_arg1..fb_namespace::attending[0]);
_local2.unsure = FacebookXMLParserUtils.toUIDArray(_arg1..fb_namespace::unsure[0]);
_local2.declined = FacebookXMLParserUtils.toUIDArray(_arg1..fb_namespace::declined[0]);
_local2.not_replied = FacebookXMLParserUtils.toUIDArray(_arg1..fb_namespace::not_replied[0]);
return (_local2);
}
protected function parseGetEvent(_arg1:XML):GetEventsData{
var _local2:GetEventsData;
var _local3:EventCollection;
var _local4:*;
var _local5:EventData;
_local2 = new GetEventsData();
_local3 = new EventCollection();
for each (_local4 in _arg1..fb_namespace::event) {
_local5 = new EventData();
_local5.eid = _local4.fb_namespace::eid;
_local5.name = _local4.fb_namespace::name;
_local5.tagline = _local4.fb_namespace::tagline;
_local5.nid = _local4.fb_namespace::nid;
_local5.pic = _local4.fb_namespace::pic;
_local5.pic_big = _local4.fb_namespace::pic_big;
_local5.pic_small = _local4.fb_namespace::pic_small;
_local5.host = _local4.fb_namespace::host;
_local5.description = _local4.fb_namespace::description;
_local5.event_type = _local4.fb_namespace::event_type;
_local5.event_subtype = _local4.fb_namespace::event_subtype;
_local5.start_time = FacebookXMLParserUtils.toDate(_local4.fb_namespace::start_time);
_local5.end_time = FacebookXMLParserUtils.toDate(_local4.fb_namespace::end_time);
_local5.creator = _local4.fb_namespace::end_time;
_local5.update_time = FacebookXMLParserUtils.toDate(_local4.fb_namespace::update_time);
_local5.location = _local4.fb_namespace::location;
_local5.venue = FacebookXMLParserUtils.createLocation(_local4.fb_namespace::venue[0], fb_namespace);
_local3.addItem(_local5);
};
_local2.eventCollection = _local3;
return (_local2);
}
protected function parseGetFriends(_arg1:XML):GetFriendsData{
var _local2:GetFriendsData;
var _local3:FacebookUserCollection;
var _local4:*;
var _local5:FacebookUser;
_local2 = new GetFriendsData();
_local3 = new FacebookUserCollection();
for each (_local4 in _arg1..fb_namespace::uid) {
_local5 = new FacebookUser();
_local5.uid = _local4;
_local3.addItem(_local5);
};
_local2.friends = _local3;
return (_local2);
}
protected function parseGetPublicInfo(_arg1:XML):GetPublicInfoData{
var _local2:GetPublicInfoData;
_local2 = new GetPublicInfoData();
_local2.app_id = _arg1.fb_namespace::app_id;
_local2.api_key = _arg1.fb_namespace::api_key;
_local2.canvas_name = _arg1.fb_namespace::canvas_name;
_local2.display_name = _arg1.fb_namespace::display_name;
_local2.icon_url = _arg1.fb_namespace::icon_url;
_local2.logo_url = _arg1.fb_namespace::logo_url;
_local2.developers = _arg1.fb_namespace::developers;
_local2.company_name = _arg1.fb_namespace::company_name;
_local2.developers = _arg1.fb_namespace::developers;
_local2.daily_active_users = _arg1.fb_namespace::daily_active_users;
_local2.weekly_active_users = _arg1.fb_namespace::weekly_active_users;
_local2.monthly_active_users = _arg1.fb_namespace::monthly_active_users;
return (_local2);
}
protected function parseAreFriends(_arg1:XML):AreFriendsData{
var _local2:AreFriendsData;
var _local3:FriendsCollection;
var _local4:*;
var _local5:FriendsData;
_local2 = new AreFriendsData();
_local3 = new FriendsCollection();
for each (_local4 in _arg1..fb_namespace::friend_info) {
_local5 = new FriendsData();
_local5.uid1 = _local4.fb_namespace::uid1;
_local5.uid2 = _local4.fb_namespace::uid2;
_local5.are_friends = FacebookXMLParserUtils.toBoolean(_local4.fb_namespace::are_friends);
_local3.addItem(_local5);
};
_local2.friendsCollection = _local3;
return (_local2);
}
public function validateFacebookResponce(_arg1:String):FacebookError{
var error:FacebookError;
var xml:XML;
var xmlError:Error;
var hasXMLError:Boolean;
var result = _arg1;
error = null;
hasXMLError = false;
try {
xml = new XML(result);
} catch(e) {
xmlError = e;
hasXMLError = true;
};
if (hasXMLError == false){
if (xml.localName() == "error_response"){
error = new FacebookError();
error.rawResult = result;
error.errorCode = Number(xml.fb_namespace::error_code);
error.errorMsg = xml.fb_namespace::error_msg;
error.requestArgs = FacebookXMLParserUtils.xmlToUrlVariables(xml..arg);
};
return (error);
};
if (hasXMLError == true){
error = new FacebookError();
error.error = xmlError;
error.errorCode = -1;
};
return (error);
}
protected function parseBatchRun(_arg1:XML):FacebookData{
var _local2:XMLList;
var _local3:uint;
var _local4:Array;
var _local5:uint;
var _local6:BatchResult;
var _local7:String;
var _local8:XML;
var _local9:FacebookError;
var _local10:String;
var _local11:FacebookData;
_local2 = _arg1..fb_namespace::batch_run_response_elt;
_local3 = _local2.length();
_local4 = [];
_local5 = 0;
while (_local5 < _local3) {
_local7 = _local2[_local5].toString();
_local8 = new XML(_local7);
_local9 = validateFacebookResponce(_local7);
if (_local9 === null){
_local10 = responseNodeNameToMethodName(_local8.localName().toString());
_local11 = parse(_local7, _local10);
_local4.push(_local11);
} else {
_local4.push(_local9);
};
_local5++;
};
_local6 = new BatchResult();
_local6.results = _local4;
return (_local6);
}
protected function getTemplate(_arg1:XMLList, _arg2:TemplateCollection):void{
var _local3:*;
var _local4:TemplateData;
for each (_local3 in _arg1) {
_local4 = new TemplateData();
_local4.type = _local3.localName();
_local4.template_body = _local3.fb_namespace::template_body;
_local4.template_title = _local3.fb_namespace::template_title;
_arg2.addTemplateData(_local4);
};
}
}
}//package com.facebook.data
Section 187
//DesktopDelegate (com.facebook.delegates.DesktopDelegate)
package com.facebook.delegates {
import com.facebook.net.*;
import com.facebook.session.*;
public class DesktopDelegate extends WebDelegate {
public function DesktopDelegate(_arg1:FacebookCall, _arg2:DesktopSession){
super(_arg1, _arg2);
}
override protected function addOptionalArguments():void{
}
}
}//package com.facebook.delegates
Section 188
//IFacebookCallDelegate (com.facebook.delegates.IFacebookCallDelegate)
package com.facebook.delegates {
import flash.events.*;
import com.facebook.net.*;
import com.facebook.session.*;
public interface IFacebookCallDelegate extends IEventDispatcher {
function set session(_arg1:IFacebookSession):void;
function get session():IFacebookSession;
function close():void;
function set call(_arg1:FacebookCall):void;
function get call():FacebookCall;
}
}//package com.facebook.delegates
Section 189
//JSDelegate (com.facebook.delegates.JSDelegate)
package com.facebook.delegates {
import flash.events.*;
import com.facebook.utils.*;
import com.adobe.serialization.json.*;
import com.facebook.net.*;
import com.facebook.data.*;
import com.facebook.errors.*;
import com.facebook.session.*;
import com.facebook.*;
import flash.external.*;
public class JSDelegate extends EventDispatcher implements IFacebookCallDelegate {
protected var _session:JSSession;
protected var _call:FacebookCall;
protected static var externalInterfaceCalls:Object = {};
protected static var externalInterfaceCallId:Number = 0;
public function JSDelegate(_arg1:FacebookCall, _arg2:JSSession){
this.call = _arg1;
this.session = _arg2;
execute();
}
public function set session(_arg1:IFacebookSession):void{
this._session = (_arg1 as JSSession);
}
protected function onReceiveStatus(_arg1:StatusEvent):void{
var _local2:FacebookError;
switch ((_arg1.level == "error")){
case "error":
_local2 = new FacebookError();
_local2.rawResult = _arg1.level;
var _local3 = call;
_local3.facebook_internal::handleError(_local2);
break;
case "warning":
case "status":
break;
};
}
protected function buildCall():String{
var _local1:String;
var _local2:Object;
var _local3:String;
var _local4:String;
_local1 = ("bridgeFacebookCall_" + externalInterfaceCallId);
RequestHelper.formatRequest(call);
_local2 = {};
for (_local3 in call.args) {
_local2[_local3] = call.args[_local3];
};
_local4 = (((((((((((((((("function " + _local1) + "() { ") + "FB.Facebook.apiClient.callMethod(\"") + call.method) + "\", ") + JavascriptRequestHelper.formatURLVariables(call.args)) + ", ") + "function(result, exception) {") + "document.") + (_session as JSSession).as_swf_name) + ".bridgeFacebookReply(result, exception, ") + externalInterfaceCallId) + ")") + "}") + ");") + "}");
return (_local4);
}
public function get session():IFacebookSession{
return (_session);
}
protected function onReceiveError(_arg1:ErrorEvent):void{
var _local2:FacebookError;
_local2 = new FacebookError();
_local2.errorEvent = _arg1;
var _local3 = call;
_local3.facebook_internal::handleError(_local2);
}
public function get call():FacebookCall{
return (_call);
}
protected function execute():void{
var _local1:Array;
var _local2:Object;
var _local3:String;
_local1 = [];
for each (_local2 in call.args) {
_local1.push(_local2);
};
var _local4 = ++externalInterfaceCallId;
externalInterfaceCalls[_local4] = call;
_local3 = buildCall();
ExternalInterface.addCallback("bridgeFacebookReply", postBridgeAsyncReply);
ExternalInterface.call(_local3);
}
protected function postBridgeAsyncReply(_arg1:Object, _arg2:Object, _arg3:uint):void{
var _local4:FacebookCall;
var _local5:JSONResultData;
var _local6:FacebookError;
_local4 = externalInterfaceCalls[_arg3];
if (_arg1){
_local5 = new JSONResultData();
_local5.result = _arg1;
var _local7 = _local4;
_local7.facebook_internal::handleResult(_local5);
} else {
_local6 = new FacebookError();
_local6.rawResult = JSON.encode(_arg2);
_local7 = _local4;
_local7.facebook_internal::handleError(_local6);
};
delete externalInterfaceCalls[_arg3];
}
public function set call(_arg1:FacebookCall):void{
this._call = _arg1;
}
public function close():void{
}
}
}//package com.facebook.delegates
Section 190
//RequestHelper (com.facebook.delegates.RequestHelper)
package com.facebook.delegates {
import flash.display.*;
import flash.utils.*;
import flash.net.*;
import com.facebook.net.*;
import com.facebook.session.*;
import com.adobe.crypto.*;
public class RequestHelper {
protected static var callID:int = 0;
public static function formatRequest(_arg1:FacebookCall):void{
var _local2:IFacebookSession;
var _local3:String;
_local2 = _arg1.session;
_arg1.setRequestArgument("v", _local2.api_version);
if (_local2.api_key != null){
_arg1.setRequestArgument("api_key", _local2.api_key);
};
if (((!((_local2.session_key == null))) && (_arg1.useSession))){
_arg1.setRequestArgument("session_key", _local2.session_key);
};
_local3 = (new Date().time.toString() + callID++.toString());
_arg1.setRequestArgument("call_id", _local3);
_arg1.setRequestArgument("method", _arg1.method);
_arg1.setRequestArgument("sig", formatSig(_arg1));
}
public static function formatSig(_arg1:FacebookCall):String{
var _local2:IFacebookSession;
var _local3:Array;
var _local4:String;
var _local5:String;
var _local6:*;
_local2 = _arg1.session;
_local3 = [];
for (_local4 in _arg1.args) {
_local6 = _arg1.args[_local4];
if (((((((((!((_local4 === "sig"))) && (!((_local6 is ByteArray))))) && (!((_local6 is FileReference))))) && (!((_local6 is BitmapData))))) && (!((_local6 is Bitmap))))){
_local3.push(((_local4 + "=") + _local6.toString()));
};
};
_local3.sort();
_local5 = _local3.join("");
if (_local2.secret != null){
_local5 = (_local5 + _local2.secret);
};
return (MD5.hash(_local5));
}
}
}//package com.facebook.delegates
Section 191
//WebDelegate (com.facebook.delegates.WebDelegate)
package com.facebook.delegates {
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import com.facebook.net.*;
import com.facebook.data.*;
import com.facebook.errors.*;
import com.facebook.session.*;
import com.facebook.events.*;
public class WebDelegate extends EventDispatcher implements IFacebookCallDelegate {
protected var connectTimer:Timer;
protected var loadTimer:Timer;
protected var loader:URLLoader;
protected var parser:XMLDataParser;
protected var _call:FacebookCall;
protected var _session:WebSession;
protected var fileRef:FileReference;
public function WebDelegate(_arg1:FacebookCall, _arg2:WebSession){
this.call = _arg1;
this.session = _arg2;
parser = new XMLDataParser();
connectTimer = new Timer(_arg1.connectTimeout, 1);
connectTimer.addEventListener(TimerEvent.TIMER_COMPLETE, onConnectTimeout, false, 0, true);
loadTimer = new Timer(_arg1.loadTimeout, 1);
loadTimer.addEventListener(TimerEvent.TIMER_COMPLETE, onLoadTimeOut, false, 0, true);
execute();
}
protected function onDataComplete(_arg1:Event):void{
handleResult((_arg1.target.data as String));
}
public function get session():IFacebookSession{
return (_session);
}
protected function onLoadTimeOut(_arg1:TimerEvent):void{
var _local2:FacebookError;
connectTimer.stop();
close();
_local2 = new FacebookError();
_local2.errorCode = FacebookErrorCodes.SERVER_ERROR;
_local2.reason = FacebookErrorReason.LOAD_TIMEOUT;
_call.handleError(_local2);
dispatchEvent(new FacebookEvent(FacebookEvent.COMPLETE, false, false, false, null, _local2));
}
protected function post():void{
addOptionalArguments();
RequestHelper.formatRequest(call);
sendRequest();
connectTimer.start();
}
protected function addOptionalArguments():void{
call.setRequestArgument("ss", true);
}
protected function onHTTPStatus(_arg1:HTTPStatusEvent):void{
}
public function set session(_arg1:IFacebookSession):void{
_session = (_arg1 as WebSession);
}
public function set call(_arg1:FacebookCall):void{
_call = _arg1;
}
protected function createURLLoader():void{
loader = new URLLoader();
loader.addEventListener(Event.COMPLETE, onDataComplete);
loader.addEventListener(HTTPStatusEvent.HTTP_STATUS, onHTTPStatus);
loader.addEventListener(IOErrorEvent.IO_ERROR, onError);
loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onError);
loader.addEventListener(Event.OPEN, onOpen);
}
protected function onOpen(_arg1:Event):void{
connectTimer.stop();
loadTimer.start();
}
protected function clean():void{
connectTimer.stop();
loadTimer.stop();
if (loader == null){
return;
};
loader.removeEventListener(Event.COMPLETE, onDataComplete);
loader.removeEventListener(IOErrorEvent.IO_ERROR, onError);
loader.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, onError);
loader.removeEventListener(Event.OPEN, onOpen);
}
protected function onConnectTimeout(_arg1:TimerEvent):void{
var _local2:FacebookError;
_local2 = new FacebookError();
_local2.errorCode = FacebookErrorCodes.SERVER_ERROR;
_local2.reason = FacebookErrorReason.CONNECT_TIMEOUT;
_call.handleError(_local2);
dispatchEvent(new FacebookEvent(FacebookEvent.COMPLETE, false, false, false, null, _local2));
loadTimer.stop();
close();
}
public function get call():FacebookCall{
return (_call);
}
protected function handleResult(_arg1:String):void{
var _local2:FacebookError;
var _local3:FacebookData;
clean();
_local2 = parser.validateFacebookResponce(_arg1);
if (_local2 == null){
_local3 = parser.parse(_arg1, call.method);
call.handleResult(_local3);
} else {
call.handleError(_local2);
};
}
protected function sendRequest():void{
var _local1:URLRequest;
createURLLoader();
_local1 = new URLRequest(_session.rest_url);
_local1.contentType = "application/x-www-form-urlencoded";
_local1.method = URLRequestMethod.POST;
_local1.data = call.args;
loader.dataFormat = URLLoaderDataFormat.TEXT;
loader.load(_local1);
}
protected function onError(_arg1:ErrorEvent):void{
var _local2:FacebookError;
clean();
_local2 = parser.createFacebookError(_arg1, loader.data);
call.handleError(_local2);
dispatchEvent(new FacebookEvent(FacebookEvent.COMPLETE, false, false, false, null, _local2));
}
protected function execute():void{
if (call == null){
throw (new Error("No call defined."));
};
post();
}
public function close():void{
try {
loader.close();
} catch(e) {
};
connectTimer.stop();
loadTimer.stop();
}
}
}//package com.facebook.delegates
Section 192
//WebImageUploadDelegate (com.facebook.delegates.WebImageUploadDelegate)
package com.facebook.delegates {
import flash.events.*;
import flash.display.*;
import com.facebook.utils.*;
import flash.utils.*;
import com.adobe.images.*;
import flash.net.*;
import com.facebook.net.*;
import com.facebook.errors.*;
import com.facebook.session.*;
import com.facebook.commands.photos.*;
public class WebImageUploadDelegate extends WebDelegate {
protected var count:Number;// = 0
protected var ba:ByteArray;
public function WebImageUploadDelegate(_arg1:FacebookCall, _arg2:WebSession){
ba = new ByteArray();
count = 0;
super(_arg1, _arg2);
}
override protected function onDataComplete(_arg1:Event):void{
var _local2:ByteArray;
var _local3:FacebookError;
var _local4:String;
_local2 = (_arg1.target.data as ByteArray);
if (_local2 == null){
_local3 = new FacebookError();
call.handleError(_local3);
clean();
} else {
_local4 = _local2.readUTFBytes(_local2.length);
_local2.length = 0;
_local2 = null;
handleResult(_local4);
};
}
protected function uploadByteArray(_arg1:ByteArray):void{
var _local2:PostRequest;
var _local3:String;
var _local4:String;
var _local5:URLRequest;
_local2 = new PostRequest();
for (_local3 in call.args) {
if (_local3 != "data"){
_local2.writePostData(_local3, call.args[_local3]);
};
};
_local4 = (((call as UploadPhoto).uploadType == UploadPhotoTypes.JPEG)) ? "jpeg" : "png";
_local2.writeFileData(((("fn" + call.args["call_id"]) + ".") + _local4), _arg1);
_local2.close();
_local5 = new URLRequest();
_local5.method = URLRequestMethod.POST;
_local5.contentType = ("multipart/form-data; boundary=" + _local2.boundary);
_local5.data = _local2.getPostData();
_local5.url = _session.rest_url;
createURLLoader();
loader.dataFormat = URLLoaderDataFormat.BINARY;
loader.load(_local5);
connectTimer.start();
}
protected function onImageLoaded(_arg1:Event):void{
fileRef = (call.args.data as FileReference);
uploadByteArray(fileRef["data"]);
}
override protected function sendRequest():void{
var _local1:ByteArray;
var _local2:URLRequest;
var _local3:Object;
var _local4:JPGEncoder;
_local2 = new URLRequest(_session.rest_url);
_local3 = call.args.data;
if ((((PlayerUtils.majorVersion == 9)) && ((_local3 is FileReference)))){
throw (new TypeError("Uploading FileReference with Player 9 is unsupported. Use either an BitmapData or ByteArray."));
};
if ((_local3 is Bitmap)){
_local3 = (_local3 as Bitmap).bitmapData;
};
if ((((PlayerUtils.majorVersion == 10)) && ((_local3 is FileReference)))){
_local1 = (_local3 as FileReference)["load"]();
fileRef = (_local3 as FileReference);
fileRef.addEventListener(Event.COMPLETE, onImageLoaded);
} else {
if ((_local3 is ByteArray)){
uploadByteArray((_local3 as ByteArray));
} else {
if ((_local3 is BitmapData)){
switch ((call as UploadPhoto).uploadType){
case UploadPhotoTypes.JPEG:
_local4 = new JPGEncoder((call as UploadPhoto).uploadQuality);
ba = _local4.encode((_local3 as BitmapData));
break;
case UploadPhotoTypes.PNG:
ba = PNGEncoder.encode((_local3 as BitmapData));
break;
};
uploadByteArray(ba);
} else {
throw (new Error((("Error data type " + call.args.data) + " is not supported. Please use one of the following types: FileReference, ByteArray, BitmapData or Bitmap.")));
};
};
};
}
}
}//package com.facebook.delegates
Section 193
//FacebookError (com.facebook.errors.FacebookError)
package com.facebook.errors {
import flash.events.*;
import flash.net.*;
import com.facebook.data.*;
public class FacebookError extends FacebookData {
public var reason:String;
public var error:Error;
public var requestArgs:URLVariables;
public var errorCode:Number;
public var errorMsg:String;
public var errorEvent:ErrorEvent;
}
}//package com.facebook.errors
Section 194
//FacebookEvent (com.facebook.events.FacebookEvent)
package com.facebook.events {
import flash.events.*;
import com.facebook.data.*;
import com.facebook.errors.*;
public class FacebookEvent extends Event {
public var success:Boolean;
public var permission:String;
public var error:FacebookError;
public var hasPermission:Boolean;
public var data:FacebookData;
public static const PERMISSIONS_LOADED:String = "permissionsLoaded";
public static const LOGOUT:String = "logout";
public static const CONNECT:String = "connect";
public static const VERIFYING_SESSION:String = "verifyingSession";
public static const WAITING_FOR_LOGIN:String = "waitingForLogin";
public static const PERMISSION_CHANGE:String = "permissionChanged";
public static const PERMISSION_STATUS:String = "permissionStatus";
public static const LOGIN_SUCCESS:String = "loginSuccess";
public static const ERROR:String = "facebookEventError";
public static const PERMISSIONS_WINDOW_SHOW:String = "permissionsWindowShow";
public static const LOGIN_FAILURE:String = "loginFailure";
public static const LOGIN_WINDOW_SHOW:String = "loginWindoShow";
public static const COMPLETE:String = "complete";
public function FacebookEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false, _arg4:Boolean=false, _arg5:FacebookData=null, _arg6:FacebookError=null, _arg7:String="", _arg8:Boolean=false){
this.success = _arg4;
this.data = _arg5;
this.error = _arg6;
this.permission = _arg7;
this.hasPermission = _arg8;
super(_arg1, _arg2, _arg3);
}
override public function clone():Event{
return (new FacebookEvent(type, bubbles, cancelable, success, data, error));
}
override public function toString():String{
return (formatToString("FacebookEvent", "type", "success", "data", "error"));
}
}
}//package com.facebook.events
Section 195
//FacebookCall (com.facebook.net.FacebookCall)
package com.facebook.net {
import flash.events.*;
import flash.net.*;
import com.facebook.data.*;
import com.facebook.errors.*;
import com.facebook.delegates.*;
import com.facebook.session.*;
import com.facebook.events.*;
import com.facebook.*;
public class FacebookCall extends EventDispatcher {
public var success:Boolean;// = false
public var delegate:IFacebookCallDelegate;
public var error:FacebookError;
public var session:IFacebookSession;
public var connectTimeout:uint;// = 8000
public var loadTimeout:uint;// = 30000
public var result:FacebookData;
public var method:String;
public var args:URLVariables;
public var useSession:Boolean;// = true
public function FacebookCall(_arg1:String="no_method_required", _arg2:URLVariables=null){
success = false;
connectTimeout = (1000 * 8);
loadTimeout = (1000 * 30);
useSession = true;
super();
this.method = _arg1;
this.args = ((_arg2)!=null) ? _arg2 : new URLVariables();
}
facebook_internal function clearRequestArguments():void{
this.args = new URLVariables();
}
facebook_internal function initialize():void{
}
facebook_internal function handleError(_arg1:FacebookError):void{
this.error = _arg1;
success = false;
dispatchEvent(new FacebookEvent(FacebookEvent.COMPLETE, false, false, false, null, _arg1));
}
facebook_internal function setRequestArgument(_arg1:String, _arg2:Object):void{
if ((((_arg2 is Number)) && (isNaN((_arg2 as Number))))){
return;
};
if (((((_arg1) && (!((_arg2 == null))))) && ((String(_arg2).length > 0)))){
this.args[_arg1] = _arg2;
};
}
protected function applySchema(_arg1:Array, ... _args):void{
var _local3:uint;
var _local4:uint;
_local3 = _arg1.length;
_local4 = 0;
while (_local4 < _local3) {
setRequestArgument(_arg1[_local4], _args[_local4]);
_local4++;
};
}
facebook_internal function handleResult(_arg1:FacebookData):void{
this.result = _arg1;
success = true;
dispatchEvent(new FacebookEvent(FacebookEvent.COMPLETE, false, false, true, _arg1));
}
}
}//package com.facebook.net
Section 196
//DesktopSession (com.facebook.session.DesktopSession)
package com.facebook.session {
import flash.net.*;
import com.facebook.net.*;
import com.facebook.data.*;
import com.facebook.errors.*;
import com.facebook.delegates.*;
import com.facebook.events.*;
import com.facebook.commands.photos.*;
import com.facebook.*;
import com.facebook.commands.users.*;
import com.facebook.commands.auth.*;
import com.facebook.data.auth.*;
public class DesktopSession extends WebSession implements IFacebookSession {
protected var _waiting_for_login:Boolean;// = false
protected var _auth_token:String;
protected var _offline_access:Boolean;// = false
protected var loginRequest:IFacebookCallDelegate;
public function DesktopSession(_arg1:String, _arg2:String=null, _arg3:String=null){
_waiting_for_login = false;
_offline_access = false;
super(_arg1, null);
this._is_connected = false;
this._secret = _arg2;
if (_arg3){
this._session_key = _arg3;
};
}
override public function get waiting_for_login():Boolean{
return (_waiting_for_login);
}
protected function onVerifyLogin(_arg1:FacebookEvent):void{
var _local2:FacebookEvent;
_local2 = new FacebookEvent(FacebookEvent.CONNECT);
_local2.success = _arg1.success;
if (_arg1.success){
facebook_internal::_uid = (_arg1.data as StringResultData).value;
_local2.data = _arg1.data;
_is_connected = true;
} else {
_local2.error = _arg1.error;
_is_connected = false;
};
dispatchEvent(_local2);
}
override public function post(_arg1:FacebookCall):IFacebookCallDelegate{
if (_arg1.method == UploadPhoto.METHOD_NAME){
return (new WebImageUploadDelegate(_arg1, this));
};
return (new DesktopDelegate(_arg1, this));
}
protected function validateSessionReply(_arg1:FacebookEvent):void{
var _local2:GetSessionData;
if (_arg1.success){
_local2 = (_arg1.data as GetSessionData);
facebook_internal::_uid = _local2.uid;
this._session_key = _local2.session_key;
this._expires = _local2.expires;
this._secret = ((((_local2.secret == null)) || ((_local2.secret == "")))) ? this._secret : _local2.secret;
_is_connected = true;
dispatchEvent(new FacebookEvent(FacebookEvent.CONNECT, false, false, true, _local2));
} else {
onConnectionError(_arg1.error);
};
}
protected function tokenCreated():void{
navigateToURL(new URLRequest(login_url));
}
override public function refreshSession():void{
var _local1:GetSession;
_waiting_for_login = false;
_local1 = new GetSession(_auth_token);
_local1.session = this;
var _local2 = _local1;
_local2.facebook_internal::initialize();
_local1.addEventListener(FacebookEvent.COMPLETE, validateSessionReply);
post(_local1);
}
protected function onLogin(_arg1:FacebookEvent):void{
var _local2:URLRequest;
var _local3:String;
_arg1.target.removeEventListener(FacebookEvent.COMPLETE, onLogin);
if (_arg1.success){
_auth_token = (_arg1.data as StringResultData).value;
_local2 = new URLRequest();
_local3 = "?";
if (_offline_access){
_local3 = (_local3 + "ext_perm=offline_access&");
};
_local2.url = (((((((login_url + _local3) + "api_key=") + api_key) + "&v=") + api_version) + "&auth_token=") + _auth_token);
navigateToURL(_local2, "_blank");
_waiting_for_login = true;
dispatchEvent(new FacebookEvent(FacebookEvent.WAITING_FOR_LOGIN));
} else {
onConnectionError(_arg1.error);
};
}
override public function verifySession():void{
var _local1:FacebookCall;
if (_session_key){
_local1 = new GetLoggedInUser();
_local1.session = this;
var _local2 = _local1;
_local2.facebook_internal::initialize();
_local1.addEventListener(FacebookEvent.COMPLETE, onVerifyLogin, false, 0, true);
post(_local1);
dispatchEvent(new FacebookEvent(FacebookEvent.VERIFYING_SESSION));
} else {
_is_connected = false;
dispatchEvent(new FacebookEvent(FacebookEvent.CONNECT));
};
}
override public function login(_arg1:Boolean):void{
var _local2:FacebookCall;
_offline_access = _arg1;
_session_key = null;
_local2 = new CreateToken();
_local2.session = this;
var _local3 = _local2;
_local3.facebook_internal::initialize();
_local2.addEventListener(FacebookEvent.COMPLETE, onLogin);
post(_local2);
}
protected function onConnectionError(_arg1:FacebookError):void{
_is_connected = false;
dispatchEvent(new FacebookEvent(FacebookEvent.CONNECT, false, false, false, null, _arg1));
}
}
}//package com.facebook.session
Section 197
//IFacebookSession (com.facebook.session.IFacebookSession)
package com.facebook.session {
import flash.events.*;
import com.facebook.net.*;
import com.facebook.delegates.*;
public interface IFacebookSession extends IEventDispatcher {
function get rest_url():String;
function get waiting_for_login():Boolean;
function get api_key():String;
function get is_connected():Boolean;
function get uid():String;
function set rest_url(_arg1:String):void;
function verifySession():void;
function set secret(_arg1:String):void;
function post(_arg1:FacebookCall):IFacebookCallDelegate;
function login(_arg1:Boolean):void;
function set session_key(_arg1:String):void;
function get secret():String;
function get expires():Date;
function get session_key():String;
function get api_version():String;
function refreshSession():void;
}
}//package com.facebook.session
Section 198
//JSSession (com.facebook.session.JSSession)
package com.facebook.session {
import flash.events.*;
import com.facebook.net.*;
import com.facebook.delegates.*;
import com.facebook.events.*;
import com.facebook.*;
import com.facebook.commands.users.*;
public class JSSession extends EventDispatcher implements IFacebookSession {
public var _api_key:String;
public var as_swf_name:String;
protected var _session_key:String;
public function JSSession(_arg1:String, _arg2:String){
this._api_key = _arg1;
this.as_swf_name = _arg2;
}
public function get rest_url():String{
return (null);
}
public function set rest_url(_arg1:String):void{
}
public function get waiting_for_login():Boolean{
return (true);
}
protected function onVerifyLogin(_arg1:FacebookEvent):void{
if (_arg1.success){
dispatchEvent(new FacebookEvent(FacebookEvent.CONNECT, false, false, true));
} else {
dispatchEvent(new FacebookEvent(FacebookEvent.CONNECT, false, false, false));
};
}
public function get is_sessionless():Boolean{
return (true);
}
public function post(_arg1:FacebookCall):IFacebookCallDelegate{
return (new JSDelegate(_arg1, this));
}
public function get secret():String{
return (null);
}
public function get api_version():String{
return ("1.0");
}
public function get is_connected():Boolean{
return (true);
}
public function get session_key():String{
return (_session_key);
}
public function get api_key():String{
return (_api_key);
}
public function get expires():Date{
return (null);
}
public function get uid():String{
return (null);
}
public function refreshSession():void{
}
public function verifySession():void{
var _local1:FacebookCall;
_local1 = new GetLoggedInUser();
_local1.addEventListener(FacebookEvent.COMPLETE, onVerifyLogin);
_local1.session = this;
var _local2 = _local1;
_local2.facebook_internal::initialize();
post(_local1);
}
public function set secret(_arg1:String):void{
}
public function set session_key(_arg1:String):void{
_session_key = _arg1;
}
public function login(_arg1:Boolean):void{
}
}
}//package com.facebook.session
Section 199
//WebSession (com.facebook.session.WebSession)
package com.facebook.session {
import flash.events.*;
import com.facebook.net.*;
import com.facebook.delegates.*;
import com.facebook.events.*;
import com.facebook.commands.photos.*;
import com.facebook.*;
public class WebSession extends EventDispatcher implements IFacebookSession {
protected var _api_key:String;
protected var _api_version:String;// = "1.0"
facebook_internal var _uid:String;
protected var _is_connected:Boolean;// = false
public var login_url:String;// = "http://www.facebook.com/login.php"
protected var _secret:String;
protected var _rest_url:String;// = "http://api.facebook.com/restserver.php"
protected var _expires:Date;
protected var _session_key:String;
public function WebSession(_arg1:String, _arg2:String, _arg3:String=null){
_api_version = "1.0";
_is_connected = false;
_rest_url = "http://api.facebook.com/restserver.php";
login_url = "http://www.facebook.com/login.php";
super();
this._api_key = _arg1;
this._session_key = _arg3;
this.secret = _arg2;
}
public function get rest_url():String{
return (_rest_url);
}
public function set rest_url(_arg1:String):void{
_rest_url = _arg1;
}
public function get waiting_for_login():Boolean{
return (false);
}
public function post(_arg1:FacebookCall):IFacebookCallDelegate{
if (_arg1.method == UploadPhoto.METHOD_NAME){
return (new WebImageUploadDelegate(_arg1, this));
};
return (new WebDelegate(_arg1, this));
}
public function get secret():String{
return (_secret);
}
public function get api_version():String{
return (this._api_version);
}
public function get is_connected():Boolean{
return (_is_connected);
}
public function get session_key():String{
return (_session_key);
}
public function get api_key():String{
return (_api_key);
}
public function get expires():Date{
return (_expires);
}
public function get uid():String{
return (facebook_internal::_uid);
}
public function refreshSession():void{
}
public function verifySession():void{
if (_session_key){
_is_connected = true;
dispatchEvent(new FacebookEvent(FacebookEvent.CONNECT, false, false, true));
} else {
_is_connected = false;
dispatchEvent(new FacebookEvent(FacebookEvent.CONNECT, false, false, false));
};
}
public function set secret(_arg1:String):void{
_secret = _arg1;
}
public function set api_version(_arg1:String):void{
this._api_version = _arg1;
}
public function login(_arg1:Boolean):void{
}
public function set session_key(_arg1:String):void{
_session_key = _arg1;
}
}
}//package com.facebook.session
Section 200
//FacebookArrayCollection (com.facebook.utils.FacebookArrayCollection)
package com.facebook.utils {
import flash.events.*;
import flash.utils.*;
public class FacebookArrayCollection extends EventDispatcher {
protected var _source:Array;
protected var hash:Dictionary;
protected var _type:Class;
public function FacebookArrayCollection(_arg1:Array=null, _arg2:Class=null){
reset();
_type = _arg2;
initilizeSource(_arg1);
}
public function indexOf(_arg1:Object):int{
return (_source.indexOf(_arg1));
}
public function reset():void{
hash = new Dictionary(true);
_source = [];
}
public function get source():Array{
return (_source);
}
public function toArray():Array{
var _local1:Array;
var _local2:uint;
var _local3:uint;
_local1 = [];
_local2 = length;
_local3 = 0;
while (_local3 < _local2) {
_local1.push(getItemAt(_local3));
_local3++;
};
return (_local1);
}
public function findItemByProperty(_arg1:String, _arg2:Object, _arg3:Boolean=false):Object{
var _local4:Object;
for (_local4 in hash) {
if (((((_arg3) && ((_arg1 in _local4)))) && ((_local4[_arg1] === _arg2)))){
return (_local4);
};
if (((((!(_arg3)) && ((_arg1 in _local4)))) && ((_local4[_arg1] == _arg2)))){
return (_local4);
};
};
return (null);
}
protected function verifyIndex(_arg1:uint):void{
if (_source.length < _arg1){
throw (new RangeError((("Index: " + _arg1) + ", is out of range.")));
};
}
public function removeItemAt(_arg1:uint):void{
var _local2:Object;
verifyIndex(_arg1);
_local2 = _source[_arg1];
delete hash[_local2];
_source.splice(_arg1, 1);
}
public function addItem(_arg1:Object):void{
addItemAt(_arg1, length);
}
public function get length():int{
return (_source.length);
}
public function addItemAt(_arg1:Object, _arg2:uint):void{
if (hash[_arg1] != null){
throw (new Error("Item already exists."));
};
if (((!((_type === null))) && (!((_arg1 is _type))))){
throw (new TypeError((("This collection requires " + _type) + " as the type.")));
};
hash[_arg1] = true;
_source.splice(_arg2, 0, _arg1);
}
public function getItemAt(_arg1:uint):Object{
verifyIndex(_arg1);
return (_source[_arg1]);
}
override public function toString():String{
return (_source.join(", "));
}
public function contains(_arg1:Object):Boolean{
return ((hash[_arg1] === true));
}
public function get type():Class{
return (_type);
}
protected function initilizeSource(_arg1:Array):void{
var _local2:uint;
var _local3:uint;
_source = [];
if (_arg1 == null){
return;
};
_local2 = _arg1.length;
_local3 = 0;
while (_local3 < _local2) {
addItem(_arg1[_local3]);
_local3++;
};
}
}
}//package com.facebook.utils
Section 201
//FacebookDataUtils (com.facebook.utils.FacebookDataUtils)
package com.facebook.utils {
import com.adobe.serialization.json.*;
public class FacebookDataUtils {
public static function toJSONValuesArray(_arg1:Array):String{
var _local2:Array;
var _local3:Number;
var _local4:Number;
if (_arg1 == null){
return (null);
};
_local2 = [];
_local3 = _arg1.length;
_local4 = 0;
while (_local4 < _local3) {
_local2.push(JSON.encode(_arg1[_local4]));
_local4++;
};
return (_local2.join(","));
}
public static function formatDate(_arg1:String):Date{
var _local2:Date;
var _local3:Array;
var _local4:Array;
var _local5:Array;
if ((((_arg1 == "")) || ((_arg1 == null)))){
return (null);
};
_local2 = new Date();
_local3 = _arg1.split(" ");
if (_local3.length == 2){
_local4 = _local3[0].split("-");
_local5 = _local3[1].split(":");
_local2.setFullYear(_local4[0]);
_local2.setMonth((_local4[1] - 1));
_local2.setDate(_local4[2]);
_local2.setHours(_local5[0]);
_local2.setMinutes(_local5[1]);
_local2.setSeconds(_local5[2]);
} else {
_local2.setTime((parseInt(_arg1) * 1000));
};
return (_local2);
}
public static function facebookCollectionToJSONArray(_arg1:FacebookArrayCollection):String{
if (_arg1 == null){
return (null);
};
return (JSON.encode(_arg1.toArray()));
}
public static function toDateString(_arg1:Date):String{
if (_arg1 == null){
return (null);
};
_arg1.setDate((_arg1.date + 1));
return (((_arg1 == null)) ? null : _arg1.getTime().toString().slice(0, 10));
}
public static function supplantString(_arg1:String, _arg2:Object):String{
var _local3:String;
var _local4:String;
_local3 = _arg1;
for (_local4 in _arg2) {
_local3 = _local3.replace(new RegExp((("\\{" + _local4) + "\\}"), "g"), _arg2[_local4]);
};
return (_local3);
}
public static function toArrayString(_arg1:Array):String{
return (((_arg1 == null)) ? null : _arg1.join(","));
}
}
}//package com.facebook.utils
Section 202
//FacebookSessionUtil (com.facebook.utils.FacebookSessionUtil)
package com.facebook.utils {
import flash.events.*;
import flash.display.*;
import flash.net.*;
import com.facebook.session.*;
import com.facebook.events.*;
import com.facebook.*;
import flash.system.*;
public class FacebookSessionUtil extends EventDispatcher {
public var facebook:Facebook;
protected var loaderInfo:LoaderInfo;
protected var secret:String;
protected var _activeSession:IFacebookSession;
protected var session_key:String;
protected var api_key:String;
public function FacebookSessionUtil(_arg1:String, _arg2:String, _arg3:LoaderInfo){
var _local4:SharedObject;
var _local5:Object;
super();
this.secret = ((_arg2 == null)) ? _arg3.parameters.fb_sig_ss : _arg2;
this.api_key = _arg1;
this.loaderInfo = _arg3;
_local4 = getStoredSession();
if (_local4.data.session_key){
session_key = _local4.data.session_key;
};
_local5 = ((_arg3)!=null) ? _arg3.parameters : {};
if (_local5.fb_sig_session_key != null){
session_key = _local5.fb_sig_session_key;
};
if ((((_arg3.url.slice(0, 5) == "file:")) || ((Capabilities.playerType == "Desktop")))){
_activeSession = new DesktopSession(_arg1, this.secret);
} else {
if (((((_local5.fb_sig_ss) && (_local5.fb_sig_api_key))) && (_local5.fb_sig_session_key))){
_activeSession = new WebSession(_local5.fb_sig_api_key, _local5.fb_sig_ss, _local5.fb_sig_session_key);
(_activeSession as WebSession).facebook_internal::_uid = _local5.fb_sig_user;
} else {
if (_local5.as_app_name){
_activeSession = new JSSession(_arg1, _local5.as_app_name);
} else {
_activeSession = new DesktopSession(_arg1, _arg2);
};
};
};
_activeSession.session_key = session_key;
_activeSession.addEventListener(FacebookEvent.VERIFYING_SESSION, onVerifyingSession);
facebook = new Facebook();
facebook.addEventListener(FacebookEvent.WAITING_FOR_LOGIN, handleWaitingForLogin);
facebook.addEventListener(FacebookEvent.CONNECT, onFacebookReady);
facebook.startSession(_activeSession);
}
protected function handleWaitingForLogin(_arg1:FacebookEvent):void{
dispatchEvent(_arg1);
}
public function onVerifyingSession(_arg1:FacebookEvent):void{
dispatchEvent(_arg1);
}
public function logout():void{
getStoredSession().clear();
getStoredSession().flush();
facebook.logout();
}
public function verifySession():void{
_activeSession.verifySession();
}
protected function onFacebookReady(_arg1:FacebookEvent):void{
var _local2:SharedObject;
if (facebook.session_key){
_local2 = getStoredSession();
_local2.data.session_key = facebook.session_key;
_local2.data.stored_secret = facebook.secret;
_local2.flush(3000);
};
if (_arg1){
dispatchEvent(_arg1);
};
}
public function login(_arg1:Boolean=true):void{
facebook.login(_arg1);
}
protected function onWaitingForLogin(_arg1:FacebookEvent):void{
dispatchEvent(_arg1);
}
public function get activeSession():IFacebookSession{
return (_activeSession);
}
public function validateLogin():void{
facebook.refreshSession();
}
protected function getStoredSession():SharedObject{
return (SharedObject.getLocal((api_key + "_stored_session")));
}
protected function onVerifyLogin(_arg1:FacebookEvent):void{
_activeSession.removeEventListener(FacebookEvent.CONNECT, onVerifyLogin);
if (_arg1.success){
onFacebookReady(null);
dispatchEvent(new FacebookEvent(FacebookEvent.CONNECT, false, false, true));
} else {
dispatchEvent(new FacebookEvent(FacebookEvent.CONNECT, false, false, false));
};
}
}
}//package com.facebook.utils
Section 203
//FacebookStreamXMLParser (com.facebook.utils.FacebookStreamXMLParser)
package com.facebook.utils {
import com.facebook.data.stream.*;
public class FacebookStreamXMLParser {
public static function createCommentsArray(_arg1:XMLList, _arg2:Namespace):Array{
var _local3:Array;
var _local4:uint;
var _local5:uint;
var _local6:XML;
var _local7:PostCommentData;
_local3 = [];
_local4 = _arg1.length();
_local5 = 0;
while (_local5 < _local4) {
_local6 = _arg1[_local5];
_local7 = new PostCommentData();
_local7.fromid = FacebookXMLParserUtils.toStringValue(_local6._arg2::fromid[0]);
_local7.id = FacebookXMLParserUtils.toStringValue(_local6._arg2::id[0]);
_local7.text = FacebookXMLParserUtils.toStringValue(_local6._arg2::text[0]);
_local7.time = FacebookXMLParserUtils.toDate(_local6._arg2::time[0]);
_local3.push(_local7);
_local5++;
};
return (_local3);
}
protected static function createMediaArray(_arg1:XML, _arg2:Namespace):Array{
var _local3:Array;
var _local4:XMLList;
var _local5:uint;
var _local6:uint;
var _local7:XML;
var _local8:StreamMediaData;
if (_arg1 == null){
return (null);
};
_local3 = [];
_local4 = _arg1.children();
_local5 = _local4.length();
_local6 = 0;
while (_local6 < _local5) {
_local7 = _local4[_local6];
_local8 = new StreamMediaData();
_local8.type = FacebookXMLParserUtils.toStringValue(_local7._arg2::type[0]);
_local8.alt = FacebookXMLParserUtils.toStringValue(_local7._arg2::alt[0]);
_local8.href = FacebookXMLParserUtils.toStringValue(_local7._arg2::href[0]);
_local8.src = FacebookXMLParserUtils.toStringValue(_local7._arg2::src[0]);
_local8.video = createVideoMedia(_local7._arg2::video[0], _arg2);
_local8.photo = createPhotoMedia(_local7._arg2::photo[0], _arg2);
_local3.push(_local8);
_local6++;
};
return (_local3);
}
public static function createStreamFilterCollection(_arg1:XML, _arg2:Namespace):GetFiltersData{
var _local3:GetFiltersData;
var _local4:StreamFilterCollection;
var _local5:XMLList;
var _local6:uint;
var _local7:uint;
var _local8:XML;
var _local9:StreamFilterData;
_local3 = new GetFiltersData();
_local4 = new StreamFilterCollection();
_local5 = _arg1.._arg2::stream_filter;
_local6 = _local5.length();
_local7 = 0;
while (_local7 < _local6) {
_local8 = _local5[_local7];
_local9 = new StreamFilterData();
_local9.filter_key = FacebookXMLParserUtils.toStringValue(_local8._arg2::filter_key[0]);
_local9.icon_url = FacebookXMLParserUtils.toStringValue(_local8._arg2::icon_url[0]);
_local9.is_visible = FacebookXMLParserUtils.toBoolean(_local8._arg2::is_visible[0]);
_local9.name = FacebookXMLParserUtils.toStringValue(_local8._arg2::name[0]);
_local9.rank = FacebookXMLParserUtils.toNumber(_local8._arg2::rank[0]);
_local9.type = FacebookXMLParserUtils.toStringValue(_local8._arg2::type[0]);
_local9.uid = FacebookXMLParserUtils.toStringValue(_local8._arg2::uid[0]);
_local9.value = FacebookXMLParserUtils.toStringValue(_local8._arg2::value[0]);
_local4.addItem(_local9);
_local7++;
};
_local3.filters = _local4;
return (_local3);
}
protected static function createVideoMedia(_arg1:XML, _arg2:Namespace):VideoMedia{
var _local3:VideoMedia;
if (_arg1 == null){
return (null);
};
_local3 = new VideoMedia();
_local3.display_url = FacebookXMLParserUtils.toStringValue(_arg1._arg2::display_url[0]);
_local3.owner = FacebookXMLParserUtils.toStringValue(_arg1._arg2::owner[0]);
_local3.permalink = FacebookXMLParserUtils.toStringValue(_arg1._arg2::permalink[0]);
_local3.source_url = FacebookXMLParserUtils.toStringValue(_arg1._arg2::source_url[0]);
return (_local3);
}
protected static function createComments(_arg1:XML, _arg2:Namespace):CommentsData{
var _local3:CommentsData;
var _local4:XMLList;
_local3 = new CommentsData();
_local3.can_remove = FacebookXMLParserUtils.toBoolean(_arg1._arg2::can_remove[0]);
_local3.can_post = FacebookXMLParserUtils.toBoolean(_arg1._arg2::can_post[0]);
_local3.count = FacebookXMLParserUtils.toNumber(_arg1._arg2::count[0]);
_local4 = _arg1._arg2::posts.children();
_local3.posts = createCommentsArray(_local4, _arg2);
return (_local3);
}
public static function createGetCommentsData(_arg1:XML, _arg2:Namespace):GetCommentsData{
var _local3:XMLList;
var _local4:GetCommentsData;
_local3 = _arg1.._arg2::comment;
_local4 = new GetCommentsData();
_local4.comments = createCommentsArray(_local3, _arg2);
return (_local4);
}
public static function createStream(_arg1:XML, _arg2:Namespace):GetStreamData{
var _local3:GetStreamData;
var _local4:StreamStoryCollection;
var _local5:ProfileCollection;
var _local6:uint;
var _local7:uint;
var _local8:XMLList;
var _local9:XMLList;
var _local10:XML;
var _local11:StreamStoryData;
var _local12:XML;
var _local13:AttachmentData;
var _local14:LikesData;
var _local15:XML;
var _local16:XML;
var _local17:ProfileData;
var _local18:XML;
_local3 = new GetStreamData();
_local4 = new StreamStoryCollection();
_local5 = new ProfileCollection();
_local3.stories = _local4;
_local3.profiles = _local5;
_local8 = _arg1._arg2::posts.children();
_local6 = _local8.length();
_local7 = 0;
while (_local7 < _local6) {
_local10 = _local8[_local7];
_local11 = new StreamStoryData();
_local11.sourceXML = _local10;
_local12 = _local10._arg2::attachment[0];
_local13 = new AttachmentData();
_local13.name = FacebookXMLParserUtils.toStringValue(_local12._arg2::name[0]);
_local13.text = FacebookXMLParserUtils.toStringValue(_local12._arg2::text[0]);
_local13.body = FacebookXMLParserUtils.toStringValue(_local12._arg2::body[0]);
_local13.icon = FacebookXMLParserUtils.toStringValue(_local12._arg2::icon[0]);
_local13.label = FacebookXMLParserUtils.toStringValue(_local12._arg2::label[0]);
_local13.media = createMediaArray(_local12._arg2::media[0], _arg2);
_local13.title = FacebookXMLParserUtils.toStringValue(_local12._arg2::title[0]);
_local13.href = FacebookXMLParserUtils.toStringValue(_local12._arg2::href[0]);
_local13.caption = FacebookXMLParserUtils.toStringValue(_local12._arg2::caption[0]);
_local11.attachment = _local13;
_local11.actor_id = FacebookXMLParserUtils.toStringValue(_local10._arg2::actor_id[0]);
_local11.comments = createComments(_local10._arg2::comments[0], _arg2);
_local14 = new LikesData();
_local15 = _local10._arg2::likes[0];
_local14.can_like = FacebookXMLParserUtils.toBoolean(_local15._arg2::can_like[0]);
_local14.user_likes = FacebookXMLParserUtils.toBoolean(_local15._arg2::user_likes[0]);
_local14.count = FacebookXMLParserUtils.toNumber(_local15._arg2::count[0]);
_local14.friends = FacebookXMLParserUtils.toUIDArray(_local15._arg2::friends[0]);
_local14.sample = FacebookXMLParserUtils.toUIDArray(_local15._arg2::sample[0]);
_local14.href = FacebookXMLParserUtils.toStringValue(_local15._arg2::href[0]);
_local11.likes = _local14;
_local11.attribution = FacebookXMLParserUtils.toStringValue(_local10.attribution[0]);
_local11.app_id = FacebookXMLParserUtils.toStringValue(_local10.app_id[0]);
_local11.metadata = FacebookXMLParserUtils.nodeToObject(_local10._arg2::metadata);
_local11.message = FacebookXMLParserUtils.toStringValue(_local10._arg2::message[0]);
_local11.source_id = FacebookXMLParserUtils.toStringValue(_local10._arg2::source_id[0]);
_local11.target_id = FacebookXMLParserUtils.toStringValue(_local10._arg2::target_id[0]);
_local11.post_id = FacebookXMLParserUtils.toStringValue(_local10._arg2::post_id[0]);
_local11.updated_time = FacebookXMLParserUtils.toDate(_local10._arg2::updated_time[0]);
_local11.created_time = FacebookXMLParserUtils.toDate(_local10._arg2::created_time[0]);
_local11.type = FacebookXMLParserUtils.toNumber(_local10._arg2::type[0]);
_local11.viewer_id = FacebookXMLParserUtils.toStringValue(_local10._arg2::viewer_id[0]);
_local16 = _local10._arg2::privacy[0];
_local11.privacy = FacebookXMLParserUtils.toStringValue(_local16._arg2::value[0]);
_local11.filter_key = FacebookXMLParserUtils.toStringValue(_local10._arg2::filter_key[0]);
_local4.addItem(_local11);
_local7++;
};
_local9 = _arg1._arg2::profiles.children();
_local6 = _local9.length();
_local7 = 0;
while (_local7 < _local6) {
_local17 = new ProfileData();
_local18 = _local9[_local7];
_local17.id = FacebookXMLParserUtils.toStringValue(_local18._arg2::id[0]);
_local17.name = FacebookXMLParserUtils.toStringValue(_local18._arg2::name[0]);
_local17.pic_square = FacebookXMLParserUtils.toStringValue(_local18._arg2::pic_square[0]);
_local17.url = FacebookXMLParserUtils.toStringValue(_local18._arg2::url[0]);
_local5.addItem(_local17);
_local7++;
};
_local3.albums = FacebookXMLParserUtils.createAlbumCollection(_arg1._arg2::albums[0], _arg2);
return (_local3);
}
protected static function createPhotoMedia(_arg1:XML, _arg2:Namespace):PhotoMedia{
var _local3:PhotoMedia;
if (_arg1 == null){
return (null);
};
_local3 = new PhotoMedia();
_local3.aid = FacebookXMLParserUtils.toStringValue(_arg1._arg2::aid[0]);
_local3.index = FacebookXMLParserUtils.toNumber(_arg1._arg2::index[0]);
_local3.owner = FacebookXMLParserUtils.toStringValue(_arg1._arg2::owner[0]);
_local3.pid = FacebookXMLParserUtils.toStringValue(_arg1._arg2::pid[0]);
return (_local3);
}
}
}//package com.facebook.utils
Section 204
//FacebookUserXMLParser (com.facebook.utils.FacebookUserXMLParser)
package com.facebook.utils {
import com.facebook.data.*;
import com.facebook.data.users.*;
public class FacebookUserXMLParser {
protected static function parseWorkHistory(_arg1:XML, _arg2:Namespace):Array{
var _local3:Array;
var _local4:Object;
var _local5:FacebookWorkInfo;
_local3 = [];
for each (_local4 in _arg1) {
_local5 = new FacebookWorkInfo();
_local5.location = FacebookXMLParserUtils.createLocation(_local4._arg2::location[0], _arg2);
_local5.company_name = String(_local4._arg2::company_name);
_local5.description = String(_local4._arg2::description);
_local5.position = String(_local4._arg2::position);
_local5.start_date = FacebookDataUtils.formatDate(_local4._arg2::start_date);
_local5.end_date = FacebookDataUtils.formatDate(_local4._arg2::end_date);
_local3.push(_local5);
};
return (_local3);
}
protected static function createStatus(_arg1:XML, _arg2:Namespace):StatusData{
var _local3:StatusData;
_local3 = new StatusData();
_local3.message = String(_arg1._arg2::message);
_local3.time = FacebookDataUtils.formatDate(String(_arg1._arg2::time));
return (_local3);
}
protected static function parseEducationHistory(_arg1:XML, _arg2:Namespace):Array{
var _local3:Array;
var _local4:XMLList;
var _local5:Object;
var _local6:FacebookEducationInfo;
var _local7:XML;
_local3 = [];
_local4 = _arg1.children();
for each (_local5 in _local4) {
_local6 = new FacebookEducationInfo();
_local6.name = String(_local5._arg2::name);
_local6.year = String(_local5._arg2::year);
_local6.degree = String(_local5._arg2::degree);
_local6.concentrations = [];
for each (_local7 in _local5.concentration) {
_local6.concentrations.push(_local7);
};
_local3.push(_local6);
};
return (_local3);
}
public static function createFacebookUser(_arg1:XML, _arg2:Namespace):FacebookUser{
var _local3:FacebookUser;
var _local4:XMLList;
var _local5:uint;
var _local6:XML;
var _local7:String;
var _local8:uint;
_local3 = new FacebookUser();
_local4 = _arg1.children();
_local5 = _local4.length();
_local8 = 0;
while (_local8 < _local5) {
_local6 = _local4[_local8];
_local7 = _local6.localName().toString();
switch (_local7){
case "status":
_local3[_local7] = createStatus(_local6, _arg2);
break;
case "affiliations":
_local3[_local7] = createAffiliations(_local6.children(), _arg2);
break;
case "hometown_location":
case "current_location":
_local3[_local7] = FacebookXMLParserUtils.createLocation(_local6, _arg2);
break;
case "profile_update_time":
_local3[_local7] = FacebookDataUtils.formatDate(_local6.toString());
break;
case "hs_info":
_local3.hs1_id = parseInt(_local6._arg2::hs1_id);
_local3.hs1_name = String(_local6._arg2::hs1_name);
_local3.hs2_id = parseInt(_local6._arg2::hs2_id);
_local3.hs2_name = String(_local6._arg2::hs2_name);
_local3.grad_year = String(_local6._arg2::grad_year);
break;
case "education_history":
_local3[_local7] = parseEducationHistory(_local6, _arg2);
break;
case "work_history":
_local3[_local7] = parseWorkHistory(_local6, _arg2);
break;
case "timezone":
case "notes_count":
case "wall_count":
_local3[_local7] = Number(_local6.toString());
break;
case "has_added_app":
case "is_app_user":
_local3[_local7] = FacebookXMLParserUtils.toBoolean(_local6);
break;
case "meeting_sex":
case "meeting_for":
case "email_hashes":
_local3[_local7] = toArray(_local6, _arg2);
break;
default:
if ((_local7 in _local3)){
_local3[_local7] = String(_local6);
};
};
_local8++;
};
return (_local3);
}
protected static function toArray(_arg1:XML, _arg2:Namespace):Array{
var _local3:Array;
var _local4:XMLList;
var _local5:uint;
var _local6:uint;
_local3 = [];
_local4 = _arg1.children();
_local5 = _local4.length();
_local6 = 0;
while (_local6 < _local5) {
_local3.push(_local4[_local6].toString());
_local6++;
};
return (_local3);
}
protected static function createAffiliations(_arg1:XMLList, _arg2:Namespace):Array{
var _local3:Array;
var _local4:*;
var _local5:FacebookNetwork;
_local3 = [];
for each (_local4 in _arg1) {
_local5 = new FacebookNetwork();
_local5.nid = parseInt(_local4._arg2::nid);
_local5.name = String(_local4._arg2::name);
_local5.type = String(_local4._arg2::type);
_local5.status = String(_local4._arg2::status);
_local5.year = String(_local4._arg2::year);
_local3.push(_local5);
};
return (_local3);
}
}
}//package com.facebook.utils
Section 205
//FacebookXMLParserUtils (com.facebook.utils.FacebookXMLParserUtils)
package com.facebook.utils {
import flash.net.*;
import com.facebook.data.*;
import com.facebook.data.photos.*;
public class FacebookXMLParserUtils {
public static function createLocation(_arg1:XML, _arg2:Namespace):FacebookLocation{
var _local3:FacebookLocation;
_local3 = new FacebookLocation();
if (_arg1 == null){
return (_local3);
};
_local3.city = String(_arg1._arg2::city);
_local3.state = String(_arg1._arg2::state);
_local3.country = String(_arg1._arg2::country);
_local3.zip = String(_arg1._arg2::zip);
return (_local3);
}
public static function toNumber(_arg1:XML):Number{
if (_arg1 == null){
return (NaN);
};
return (Number(_arg1.toString()));
}
public static function toStringValue(_arg1:XML):String{
if (_arg1 == null){
return (null);
};
return (_arg1.toString());
}
public static function createAlbumCollection(_arg1:XML, _arg2:Namespace):AlbumCollection{
var _local3:AlbumCollection;
var _local4:*;
var _local5:AlbumData;
_local3 = new AlbumCollection();
for each (_local4 in _arg1.._arg2::album) {
_local5 = new AlbumData();
_local5.aid = FacebookXMLParserUtils.toStringValue(_local4._arg2::aid[0]);
_local5.cover_pid = FacebookXMLParserUtils.toStringValue(_local4._arg2::cover_pid[0]);
_local5.owner = _local4._arg2::owner;
_local5.name = _local4._arg2::name;
_local5.created = FacebookXMLParserUtils.toDate(_local4._arg2::created);
_local5.modified = FacebookXMLParserUtils.toDate(_local4._arg2::modified);
_local5.description = _local4._arg2::description;
_local5.location = _local4._arg2::location;
_local5.link = _local4._arg2::link;
_local5.size = _local4._arg2::size;
_local5.visible = _local4._arg2::visible;
_local3.addAlbum(_local5);
};
return (_local3);
}
public static function toDate(_arg1:String):Date{
var _local2:String;
var _local3:Date;
if (_arg1 == null){
return (null);
};
_local2 = _arg1;
while (_local2.length < 13) {
_local2 = (_local2 + "0");
};
_local3 = new Date(Number(_local2));
return (_local3);
}
public static function xmlToUrlVariables(_arg1:XMLList):URLVariables{
var _local2:URLVariables;
var _local3:XML;
_local2 = new URLVariables();
for each (_local3 in _arg1) {
_local2[_local3.key.valueOf()] = _local3.value.valueOf();
};
return (_local2);
}
public static function toUIDArray(_arg1:XML):Array{
var _local2:Array;
var _local3:XMLList;
var _local4:uint;
var _local5:uint;
_local2 = [];
if (_arg1 == null){
return (_local2);
};
_local3 = _arg1.children();
_local4 = _local3.length();
_local5 = 0;
while (_local5 < _local4) {
_local2.push(toNumber(_local3[_local5]));
_local5++;
};
return (_local2);
}
public static function nodeToObject(_arg1:XMLList):Object{
var _local2:Object;
var _local3:XML;
_local2 = {};
for each (_local3 in _arg1) {
_local2[_local3.key.valueOf()] = _local3.value.valueOf();
};
return (_local2);
}
public static function toBoolean(_arg1:XML):Boolean{
if (_arg1 == null){
return (false);
};
return ((_arg1.toString() == "1"));
}
public static function toArray(_arg1:XML):Array{
if (_arg1 == null){
return (null);
};
return (_arg1.toString().split(","));
}
}
}//package com.facebook.utils
Section 206
//IFacebookResultParser (com.facebook.utils.IFacebookResultParser)
package com.facebook.utils {
import com.facebook.data.*;
import com.facebook.errors.*;
public interface IFacebookResultParser {
function parse(_arg1:String, _arg2:String):FacebookData;
function validateFacebookResponce(_arg1:String):FacebookError;
}
}//package com.facebook.utils
Section 207
//JavascriptRequestHelper (com.facebook.utils.JavascriptRequestHelper)
package com.facebook.utils {
import flash.utils.*;
import flash.net.*;
public class JavascriptRequestHelper {
public static function objectToString(_arg1:Object):String{
var _local2:Array;
var _local3:String;
_local2 = [];
for (_local3 in _arg1) {
_local2.push((((_local3 + ": ") + quote(_arg1[_local3])) + ""));
};
return ((("{" + _local2.join(", ")) + " }"));
}
public static function quote(_arg1:String):String{
var _local2:RegExp;
_local2 = /[\\"\r\n]/g;
return ((("\"" + _arg1.replace(_local2, _quote)) + "\""));
}
public static function formatParams(_arg1:Array):String{
var _local2:Array;
var _local3:uint;
var _local4:uint;
var _local5:Object;
var _local6:String;
_local2 = [];
_local3 = _arg1.length;
_local4 = 0;
while (_local4 < _local3) {
_local5 = _arg1[_local4];
_local6 = getQualifiedClassName(_local5);
switch (_local6){
case "Array":
_local5 = (("[" + _local5.join(", ")) + "]");
break;
case "Object":
_local5 = objectToString(_local5);
break;
case "String":
default:
_local5 = (("\"" + _local5) + "\"");
break;
};
_local2.push(_local5);
_local4++;
};
return (_local2.join(", "));
}
protected static function _quote(_arg1:String, ... _args):String{
switch (_arg1){
case "\\":
return ("\\\\");
case "\r":
return ("\\r");
case "\n":
return ("\\n");
case "\"":
return ("\\\"");
};
return (null);
}
public static function formatURLVariables(_arg1:URLVariables):String{
var _local2:Object;
var _local3:Boolean;
var _local4:Object;
var _local5:String;
_local2 = {method:true, sig:true, api_key:true, call_id:true};
_local3 = false;
_local4 = {};
for (_local5 in _arg1) {
if (_local2[_local5]){
} else {
_local3 = true;
_local4[_local5] = _arg1[_local5];
};
};
return ((_local3) ? objectToString(_local4) : "null");
}
}
}//package com.facebook.utils
Section 208
//PlayerUtils (com.facebook.utils.PlayerUtils)
package com.facebook.utils {
import flash.system.*;
public class PlayerUtils {
protected static var versionObj:Object;
public static function get internalBuildNumber():Number{
return (parseVersionString().internalBuildNumber);
}
public static function get platform():String{
return (parseVersionString().platform);
}
public static function get buildNumber():Number{
return (parseVersionString().buildNumber);
}
public static function get minorVersion():Number{
return (parseVersionString().minorVersion);
}
public static function parseVersionString():Object{
var _local1:String;
var _local2:Array;
if (versionObj != null){
return (versionObj);
};
_local1 = Capabilities.version;
versionObj = {};
_local2 = _local1.split(" ");
versionObj.platform = _local2[0];
_local2.shift();
_local2 = _local2[0].split(",");
versionObj.majorVersion = Number(_local2[0]);
versionObj.minorVersion = Number(_local2[1]);
versionObj.buildNumber = Number(_local2[2]);
versionObj.internalBuildNumber = Number(_local2[3]);
return (versionObj);
}
public static function get majorVersion():Number{
return (parseVersionString().majorVersion);
}
}
}//package com.facebook.utils
Section 209
//PostRequest (com.facebook.utils.PostRequest)
package com.facebook.utils {
import flash.utils.*;
public class PostRequest {
protected var postData:ByteArray;
protected var _boundary:String;// = "-----"
public function PostRequest(){
_boundary = "-----";
super();
createPostData();
}
public function getPostData():ByteArray{
postData.position = 0;
return (postData);
}
protected function writeDoubleDash():void{
postData.writeShort(0x2D2D);
}
public function writeFileData(_arg1:String, _arg2:ByteArray):void{
var _local3:String;
var _local4:Number;
writeBoundary();
writeLineBreak();
_local3 = "Content-Disposition: form-data; filename=\"";
_local4 = 0;
while (_local4 < _local3.length) {
postData.writeByte(_local3.charCodeAt(_local4));
_local4++;
};
postData.writeUTFBytes(_arg1);
writeQuotationMark();
writeLineBreak();
_local3 = "Content-Type: image/jpg";
_local4 = 0;
while (_local4 < _local3.length) {
postData.writeByte(_local3.charCodeAt(_local4));
_local4++;
};
writeLineBreak();
writeLineBreak();
_arg2.position = 0;
postData.writeBytes(_arg2, 0, _arg2.length);
writeLineBreak();
}
public function createPostData():void{
postData = new ByteArray();
postData.endian = Endian.BIG_ENDIAN;
}
public function writePostData(_arg1:String, _arg2:String):void{
var _local3:String;
var _local4:uint;
var _local5:Number;
writeBoundary();
writeLineBreak();
_local3 = (("Content-Disposition: form-data; name=\"" + _arg1) + "\"");
_local4 = _local3.length;
_local5 = 0;
while (_local5 < _local4) {
postData.writeByte(_local3.charCodeAt(_local5));
_local5++;
};
writeLineBreak();
writeLineBreak();
postData.writeUTFBytes(_arg2);
writeLineBreak();
}
protected function writeBoundary():void{
var _local1:Number;
writeDoubleDash();
_local1 = 0;
while (_local1 < boundary.length) {
postData.writeByte(boundary.charCodeAt(_local1));
_local1++;
};
}
protected function writeLineBreak():void{
postData.writeShort(3338);
}
public function get boundary():String{
return (_boundary);
}
public function close():void{
writeBoundary();
writeDoubleDash();
}
protected function writeQuotationMark():void{
postData.writeByte(34);
}
public function set boundary(_arg1:String):void{
_boundary = _arg1;
}
}
}//package com.facebook.utils
Section 210
//Facebook (com.facebook.Facebook)
package com.facebook {
import flash.events.*;
import flash.net.*;
import com.facebook.net.*;
import com.facebook.delegates.*;
import com.facebook.session.*;
import com.facebook.events.*;
import com.facebook.commands.auth.*;
public class Facebook extends EventDispatcher {
public var waiting_for_login:Boolean;
public var connectionErrorMessage:String;
protected var _currentSession:IFacebookSession;
public function Facebook():void{
}
public function get api_version():String{
return ((_currentSession) ? this._currentSession.api_version : null);
}
public function get expires():Date{
return ((_currentSession) ? this._currentSession.expires : new Date());
}
public function get uid():String{
return ((_currentSession) ? this._currentSession.uid : null);
}
public function grantPermission(_arg1:Boolean):void{
var _local2:String;
_local2 = ((("http://www.facebook.com/login.php?return_session=" + (_arg1) ? 1 : 0) + "&api_key=") + api_key);
navigateToURL(new URLRequest(_local2), "_blank");
}
public function refreshSession():void{
_currentSession.refreshSession();
}
public function logout():void{
var _local1:ExpireSession;
_local1 = new ExpireSession();
_local1.addEventListener(FacebookEvent.COMPLETE, onLoggedOut, false, 0, true);
post(_local1);
}
public function startSession(_arg1:IFacebookSession):void{
_currentSession = _arg1;
if (_currentSession.is_connected){
dispatchEvent(new FacebookEvent(FacebookEvent.CONNECT, false, false, true));
} else {
_currentSession.addEventListener(FacebookEvent.CONNECT, onSessionConnected);
_currentSession.addEventListener(FacebookEvent.WAITING_FOR_LOGIN, onWaitingForLogin);
};
}
protected function onLoggedOut(_arg1:FacebookEvent):void{
if (_arg1.success == true){
_currentSession.session_key = null;
};
dispatchEvent(new FacebookEvent(FacebookEvent.LOGOUT, false, false, _arg1.success, _arg1.data, _arg1.error));
}
public function post(_arg1:FacebookCall):FacebookCall{
var _local2:IFacebookCallDelegate;
if (_currentSession){
_arg1.session = _currentSession;
_arg1.initialize();
_local2 = _currentSession.post(_arg1);
_arg1.delegate = _local2;
} else {
throw (new Error("Cannot post a call; no session has been set."));
};
return (_arg1);
}
protected function onSessionConnected(_arg1:FacebookEvent):void{
var _local2:IFacebookSession;
_local2 = (_arg1.target as IFacebookSession);
dispatchEvent(_arg1);
}
public function grantExtendedPermission(_arg1:String):void{
navigateToURL(new URLRequest(((((("http://www.facebook.com/authorize.php?api_key=" + api_key) + "&v=") + api_version) + "&ext_perm=") + _arg1)), "_blank");
}
public function login(_arg1:Boolean):void{
_currentSession.login(_arg1);
}
protected function onWaitingForLogin(_arg1:FacebookEvent):void{
waiting_for_login = true;
dispatchEvent(new FacebookEvent(FacebookEvent.WAITING_FOR_LOGIN));
}
public function get secret():String{
return ((_currentSession) ? this._currentSession.secret : null);
}
public function get session_key():String{
return ((_currentSession) ? this._currentSession.session_key : null);
}
public function get api_key():String{
return ((_currentSession) ? this._currentSession.api_key : null);
}
public function get is_connected():Boolean{
return ((_currentSession) ? this._currentSession.is_connected : false);
}
}
}//package com.facebook
Section 211
//facebook_internal (com.facebook.facebook_internal)
package com.facebook {
public namespace facebook_internal = "http://api.facebook.com/1.0/";
}//package com.facebook
Section 212
//BasicButton (com.fishinabottle.BasicButton)
package com.fishinabottle {
import flash.events.*;
import flash.display.*;
public class BasicButton extends MovieClip {
public var id:int;// = 0
public function BasicButton():void{
id = 0;
super();
stop();
buttonMode = true;
mouseChildren = false;
addEventListener(MouseEvent.MOUSE_OVER, over);
addEventListener(MouseEvent.MOUSE_OUT, out);
}
private function out(_arg1:MouseEvent):void{
gotoAndStop("out");
}
private function over(_arg1:MouseEvent):void{
gotoAndStop("over");
}
}
}//package com.fishinabottle
Section 213
//Tracker (com.memecounter.Tracker)
package com.memecounter {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
public class Tracker {
public static const ORI_DOM:String = "ori_dom";
public static const LOCALHOST:String = "localhost";
public static const LOCAL:String = "Local";
public static const TRACKER_PATH:String = "/node/tracking/trackerAS3.swf";
private static var ori_dom:String;
private static var lurl:String;
private static var _isReady:Boolean = false;
public static var a:uint = 0;
public static var root:DisplayObject;
public static var c:uint;
public static var d:String = "";
private static var _isInited:Boolean = false;
public static var mcEvent:Function;
public static var fpv:String = "";
private static var l:Loader;
private static var tracker:MovieClip;
public static var da:Array = ["distralytics.com", "distralytics.co.uk"];
private static function loadError(_arg1:Event):void{
a++;
lc();
}
public static function init(_arg1:uint, _arg2:DisplayObject):void{
var _local3:uint;
if (!_isInited){
_isInited = true;
c = _arg1;
root = _arg2;
_local3 = 0;
while (_local3 < da.length) {
Security.allowDomain(("*" + da[_local3]));
Security.allowDomain(da[_local3]);
Security.allowDomain(((c + ".c.") + da[_local3]));
Security.allowDomain(("*." + da[_local3]));
_local3++;
};
ori_dom = (root.loaderInfo.parameters.hasOwnProperty(ORI_DOM)) ? root.loaderInfo.parameters[ORI_DOM] : "";
d = ((ori_dom)!="") ? ori_dom : ((new LocalConnection().domain.indexOf(LOCALHOST))==-1) ? new LocalConnection().domain : LOCAL;
fpv = Capabilities.version.split(" ")[1].split(",")[0];
lurl = (((((((((TRACKER_PATH + "?c=") + c) + "&r=") + Math.floor((Math.random() * 10000000000))) + "&d=") + d) + "&p=") + fpv) + "&as=3");
l = new Loader();
l.contentLoaderInfo.addEventListener(Event.INIT, loadComplete);
l.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError);
lc();
mcEvent = kvEvent;
};
}
public static function kvClick(_arg1:uint):void{
if (_isReady){
tracker.kvClick(_arg1);
};
}
public static function get isReady():Boolean{
return (_isReady);
}
public static function mcClick(_arg1:String, _arg2:String=null):void{
if (_isReady){
tracker.mcClick(_arg1, _arg2);
};
}
public static function kvEvent(_arg1):void{
if (_isReady){
tracker.kvEvent(_arg1);
};
}
public static function kvCountry():String{
if (_isReady){
return (tracker.kvCountry());
};
return ("");
}
private static function lc():void{
var _local1:String;
var _local2:String;
_local2 = da[(a % da.length)];
if (_local2.charAt(0) === "."){
_local1 = (("http://" + _local2.substr(1, (_local2.length - 1))) + lurl);
} else {
_local1 = (((("http://" + c) + ".c.") + _local2) + lurl);
};
Security.allowDomain(_local1);
l.load(new URLRequest(_local1));
}
private static function loadComplete(_arg1:Event):void{
var e = _arg1;
try {
tracker = e.target.content;
tracker.init(getDefinitionByName("com.memecounter.Tracker"), root);
_isReady = true;
} catch(e:Error) {
trace("Memecounter error: unable to access tracker object due to security sandbox.");
};
}
}
}//package com.memecounter
Section 214
//Cubic (gs.easing.Cubic)
package gs.easing {
public class Cubic {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((_arg1 * _arg1) * _arg1) + 1)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return (((((_arg3 * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (((_arg1 * _arg1) * _arg1) + 2)) + _arg2));
}
}
}//package gs.easing
Section 215
//TweenLite (gs.TweenLite)
package gs {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
public class TweenLite {
public var delay:Number;
protected var _hasUpdate:Boolean;
public var started:Boolean;
protected var _subTweens:Array;
public var initted:Boolean;
public var active:Boolean;
public var startTime:Number;
public var target:Object;
public var duration:Number;
protected var _hst:Boolean;
protected var _isDisplayObject:Boolean;
public var gc:Boolean;
public var vars:Object;
public var ease:Function;
public var tweens:Array;
protected var _specialVars:Object;
public var combinedTimeScale:Number;
public var initTime:Number;
private static var _timer:Timer = new Timer(2000);
private static var _classInitted:Boolean;
public static var defaultEase:Function = TweenLite.easeOut;
public static var version:Number = 9.3;
public static var masterList:Dictionary = new Dictionary(false);
public static var currentTime:uint;
public static var overwriteManager:Object;
public static var killDelayedCallsTo:Function = TweenLite.killTweensOf;
public static var timingSprite:Sprite = new Sprite();
public function TweenLite(_arg1:Object, _arg2:Number, _arg3:Object){
var _local4:int;
super();
if (_arg1 == null){
return;
};
if (!_classInitted){
currentTime = getTimer();
timingSprite.addEventListener(Event.ENTER_FRAME, updateAll, false, 0, true);
if (overwriteManager == null){
overwriteManager = {mode:1, enabled:false};
};
_timer.addEventListener("timer", killGarbage, false, 0, true);
_timer.start();
_classInitted = true;
};
this.vars = _arg3;
this.duration = ((_arg2) || (0.001));
this.delay = ((_arg3.delay) || (0));
this.combinedTimeScale = ((_arg3.timeScale) || (1));
this.active = Boolean((((_arg2 == 0)) && ((this.delay == 0))));
this.target = _arg1;
_isDisplayObject = Boolean((((_arg1 is DisplayObject)) || (_arg1.hasOwnProperty("isTweenProxy"))));
if (!(this.vars.ease is Function)){
this.vars.ease = defaultEase;
};
if (this.vars.easeParams != null){
this.vars.proxiedEase = this.vars.ease;
this.vars.ease = easeProxy;
};
this.ease = this.vars.ease;
if (!isNaN(Number(this.vars.autoAlpha))){
this.vars.alpha = Number(this.vars.autoAlpha);
this.vars.visible = Boolean((this.vars.alpha > 0));
};
_specialVars = ((this.vars.isTV)==true) ? this.vars.exposedProps : this.vars;
this.tweens = [];
_subTweens = [];
_hst = (this.initted = false);
this.initTime = currentTime;
this.startTime = (this.initTime + (this.delay * 1000));
_local4 = ((((_arg3.overwrite == undefined)) || (((!(overwriteManager.enabled)) && ((_arg3.overwrite > 1)))))) ? overwriteManager.mode : int(_arg3.overwrite);
if ((((masterList[_arg1] == undefined)) || (((!((_arg1 == null))) && ((_local4 == 1)))))){
masterList[_arg1] = [];
};
masterList[_arg1].push(this);
if ((((((this.vars.runBackwards == true)) && (!((this.vars.renderOnStart == true))))) || (this.active))){
initTweenVals();
if (this.active){
render((this.startTime + 1));
} else {
render(this.startTime);
};
if (((((!((_specialVars.visible == null))) && ((this.vars.runBackwards == true)))) && (_isDisplayObject))){
this.target.visible = _specialVars.visible;
};
};
}
public function set enabled(_arg1:Boolean):void{
var _local2:Array;
var _local3:Boolean;
var _local4:int;
if (_arg1){
if (masterList[this.target] == undefined){
masterList[this.target] = [this];
} else {
_local2 = masterList[this.target];
_local4 = (_local2.length - 1);
while (_local4 > -1) {
if (_local2[_local4] == this){
_local3 = true;
break;
};
_local4--;
};
if (!_local3){
masterList[this.target].push(this);
};
};
};
this.gc = (_arg1) ? false : true;
if (this.gc){
this.active = false;
} else {
this.active = this.started;
};
}
public function render(_arg1:uint):void{
var _local2:Number;
var _local3:Number;
var _local4:Object;
var _local5:int;
_local2 = ((_arg1 - this.startTime) * 0.001);
if (_local2 >= this.duration){
_local2 = this.duration;
_local3 = ((((this.ease == this.vars.ease)) || ((this.duration == 0.001)))) ? 1 : 0;
} else {
_local3 = this.ease(_local2, 0, 1, this.duration);
};
_local5 = (this.tweens.length - 1);
while (_local5 > -1) {
_local4 = this.tweens[_local5];
_local4[0][_local4[1]] = (_local4[2] + (_local3 * _local4[3]));
_local5--;
};
if (_hst){
_local5 = (_subTweens.length - 1);
while (_local5 > -1) {
_subTweens[_local5].proxy(_subTweens[_local5], _local2);
_local5--;
};
};
if (_hasUpdate){
this.vars.onUpdate.apply(null, this.vars.onUpdateParams);
};
if (_local2 == this.duration){
complete(true);
};
}
public function activate():void{
this.started = (this.active = true);
if (!this.initted){
initTweenVals();
};
if (this.vars.onStart != null){
this.vars.onStart.apply(null, this.vars.onStartParams);
};
if (this.duration == 0.001){
this.startTime = (this.startTime - 1);
};
}
public function clear():void{
this.tweens = [];
_subTweens = [];
this.vars = {};
_hst = (_hasUpdate = false);
}
protected function addSubTween(_arg1:String, _arg2:Function, _arg3:Object, _arg4:Object, _arg5:Object=null):void{
var _local6:String;
_subTweens[_subTweens.length] = {name:_arg1, proxy:_arg2, target:_arg3, info:_arg5};
for (_local6 in _arg4) {
if (typeof(_arg4[_local6]) == "number"){
this.tweens[this.tweens.length] = [_arg3, _local6, _arg3[_local6], (_arg4[_local6] - _arg3[_local6]), _arg1];
} else {
this.tweens[this.tweens.length] = [_arg3, _local6, _arg3[_local6], Number(_arg4[_local6]), _arg1];
};
};
_hst = true;
}
public function initTweenVals(_arg1:Boolean=false, _arg2:String=""):void{
var _local3:String;
var _local4:int;
var _local5:Array;
var _local6:ColorTransform;
var _local7:ColorTransform;
var _local8:Object;
if (((!(_arg1)) && (overwriteManager.enabled))){
overwriteManager.manageOverwrites(this, masterList[this.target]);
};
if ((this.target is Array)){
_local5 = ((this.vars.endArray) || ([]));
_local4 = 0;
while (_local4 < _local5.length) {
if (((!((this.target[_local4] == _local5[_local4]))) && (!((this.target[_local4] == undefined))))){
this.tweens[this.tweens.length] = [this.target, _local4.toString(), this.target[_local4], (_local5[_local4] - this.target[_local4]), _local4.toString()];
};
_local4++;
};
} else {
if (((((!((typeof(_specialVars.tint) == "undefined"))) || ((this.vars.removeTint == true)))) && (this.target.hasOwnProperty("transform")))){
_local6 = this.target.transform.colorTransform;
_local7 = new ColorTransform();
if (_specialVars.alpha != undefined){
_local7.alphaMultiplier = _specialVars.alpha;
delete _specialVars.alpha;
} else {
_local7.alphaMultiplier = this.target.alpha;
};
if (((!((this.vars.removeTint == true))) && (((((!((_specialVars.tint == null))) && (!((_specialVars.tint == ""))))) || ((_specialVars.tint == 0)))))){
_local7.color = _specialVars.tint;
};
addSubTween("tint", tintProxy, {progress:0}, {progress:1}, {target:this.target, color:_local6, endColor:_local7});
};
if (((!((_specialVars.frame == null))) && (_isDisplayObject))){
addSubTween("frame", frameProxy, {frame:this.target.currentFrame}, {frame:_specialVars.frame}, {target:this.target});
};
if (((!(isNaN(this.vars.volume))) && (this.target.hasOwnProperty("soundTransform")))){
addSubTween("volume", volumeProxy, this.target.soundTransform, {volume:this.vars.volume}, {target:this.target});
};
if (((!((_specialVars.visible == null))) && (_isDisplayObject))){
addSubTween("visible", visibleProxy, {}, {}, {tween:this});
};
for (_local3 in _specialVars) {
if ((((((((((((((((((((((((((((((((((((_local3 == "ease")) || ((_local3 == "delay")))) || ((_local3 == "overwrite")))) || ((_local3 == "onComplete")))) || ((_local3 == "onCompleteParams")))) || ((_local3 == "runBackwards")))) || ((_local3 == "visible")))) || ((_local3 == "autoOverwrite")))) || ((_local3 == "persist")))) || ((_local3 == "onUpdate")))) || ((_local3 == "onUpdateParams")))) || ((_local3 == "autoAlpha")))) || ((_local3 == "onStart")))) || ((_local3 == "onStartParams")))) || ((_local3 == "renderOnStart")))) || ((_local3 == "proxiedEase")))) || ((_local3 == "easeParams")))) || (((_arg1) && (!((_arg2.indexOf(((" " + _local3) + " ")) == -1))))))){
} else {
if (((!(((_isDisplayObject) && ((((((_local3 == "tint")) || ((_local3 == "removeTint")))) || ((_local3 == "frame"))))))) && (!((((_local3 == "volume")) && (this.target.hasOwnProperty("soundTransform"))))))){
if (typeof(_specialVars[_local3]) == "number"){
this.tweens[this.tweens.length] = [this.target, _local3, this.target[_local3], (_specialVars[_local3] - this.target[_local3]), _local3];
} else {
this.tweens[this.tweens.length] = [this.target, _local3, this.target[_local3], Number(_specialVars[_local3]), _local3];
};
};
};
};
};
if (this.vars.runBackwards == true){
_local4 = (this.tweens.length - 1);
while (_local4 > -1) {
_local8 = this.tweens[_local4];
_local8[2] = (_local8[2] + _local8[3]);
_local8[3] = (_local8[3] * -1);
_local4--;
};
};
if (this.vars.onUpdate != null){
_hasUpdate = true;
};
this.initted = true;
}
protected function easeProxy(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (this.vars.proxiedEase.apply(null, arguments.concat(this.vars.easeParams)));
}
public function killVars(_arg1:Object):void{
if (overwriteManager.enabled){
overwriteManager.killVars(_arg1, this.vars, this.tweens, _subTweens, []);
};
}
public function get enabled():Boolean{
return ((this.gc) ? false : true);
}
public function complete(_arg1:Boolean=false):void{
if (!_arg1){
if (!this.initted){
initTweenVals();
};
this.startTime = (currentTime - ((this.duration * 1000) / this.combinedTimeScale));
render(currentTime);
return;
};
if (this.vars.persist != true){
this.enabled = false;
};
if (this.vars.onComplete != null){
this.vars.onComplete.apply(null, this.vars.onCompleteParams);
};
}
public static function frameProxy(_arg1:Object, _arg2:Number=0):void{
_arg1.info.target.gotoAndStop(Math.round(_arg1.target.frame));
}
public static function removeTween(_arg1:TweenLite, _arg2:Boolean=true):void{
if (_arg1 != null){
if (_arg2){
_arg1.clear();
};
_arg1.enabled = false;
};
}
public static function visibleProxy(_arg1:Object, _arg2:Number):void{
var _local3:TweenLite;
_local3 = _arg1.info.tween;
if (_local3.duration == _arg2){
if (((!((_local3.vars.runBackwards == true))) && ((_local3.ease == _local3.vars.ease)))){
_local3.target.visible = _local3.vars.visible;
};
} else {
if (_local3.target.visible != true){
_local3.target.visible = true;
};
};
}
public static function killTweensOf(_arg1:Object=null, _arg2:Boolean=false):void{
var _local3:Array;
var _local4:int;
var _local5:TweenLite;
if (((!((_arg1 == null))) && (!((masterList[_arg1] == undefined))))){
_local3 = masterList[_arg1];
_local4 = (_local3.length - 1);
while (_local4 > -1) {
_local5 = _local3[_local4];
if (((_arg2) && (!(_local5.gc)))){
_local5.complete(false);
};
_local5.clear();
_local4--;
};
delete masterList[_arg1];
};
}
public static function updateAll(_arg1:Event=null):void{
var _local2:uint;
var _local3:Dictionary;
var _local4:Array;
var _local5:int;
var _local6:TweenLite;
_local2 = (currentTime = getTimer());
_local3 = masterList;
for each (_local4 in _local3) {
_local5 = (_local4.length - 1);
while (_local5 > -1) {
_local6 = _local4[_local5];
if (_local6 == null){
} else {
if (_local6.active){
_local6.render(_local2);
} else {
if (_local6.gc){
_local4.splice(_local5, 1);
} else {
if (_local2 >= _local6.startTime){
_local6.activate();
_local6.render(_local2);
};
};
};
};
_local5--;
};
};
}
public static function delayedCall(_arg1:Number, _arg2:Function, _arg3:Array=null):TweenLite{
return (new TweenLite(_arg2, 0, {delay:_arg1, onComplete:_arg2, onCompleteParams:_arg3, overwrite:0}));
}
public static function from(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{
_arg3.runBackwards = true;
return (new TweenLite(_arg1, _arg2, _arg3));
}
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((-(_arg3) * _arg1) * (_arg1 - 2)) + _arg2));
}
public static function tintProxy(_arg1:Object, _arg2:Number=0):void{
var _local3:Number;
var _local4:Number;
var _local5:Object;
var _local6:Object;
_local3 = _arg1.target.progress;
_local4 = (1 - _local3);
_local5 = _arg1.info.color;
_local6 = _arg1.info.endColor;
_arg1.info.target.transform.colorTransform = new ColorTransform(((_local5.redMultiplier * _local4) + (_local6.redMultiplier * _local3)), ((_local5.greenMultiplier * _local4) + (_local6.greenMultiplier * _local3)), ((_local5.blueMultiplier * _local4) + (_local6.blueMultiplier * _local3)), ((_local5.alphaMultiplier * _local4) + (_local6.alphaMultiplier * _local3)), ((_local5.redOffset * _local4) + (_local6.redOffset * _local3)), ((_local5.greenOffset * _local4) + (_local6.greenOffset * _local3)), ((_local5.blueOffset * _local4) + (_local6.blueOffset * _local3)), ((_local5.alphaOffset * _local4) + (_local6.alphaOffset * _local3)));
}
public static function volumeProxy(_arg1:Object, _arg2:Number=0):void{
_arg1.info.target.soundTransform = _arg1.target;
}
protected static function killGarbage(_arg1:TimerEvent):void{
var _local2:Dictionary;
var _local3:Object;
var _local4:Array;
_local2 = masterList;
for (_local3 in _local2) {
if (_local2[_local3].length == 0){
delete _local2[_local3];
};
};
}
public static function to(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{
return (new TweenLite(_arg1, _arg2, _arg3));
}
}
}//package gs
Section 216
//ButtonBack (ButtonBack)
package {
import com.fishinabottle.*;
public dynamic class ButtonBack extends BasicButton {
}
}//package
Section 217
//ButtonBalloon (ButtonBalloon)
package {
import com.fishinabottle.*;
public dynamic class ButtonBalloon extends BasicButton {
}
}//package
Section 218
//ButtonContinue (ButtonContinue)
package {
import com.fishinabottle.*;
public dynamic class ButtonContinue extends BasicButton {
}
}//package
Section 219
//buttonFacebookScores (buttonFacebookScores)
package {
import com.fishinabottle.*;
public dynamic class buttonFacebookScores extends BasicButton {
}
}//package
Section 220
//ButtonHighscoresNext (ButtonHighscoresNext)
package {
import com.fishinabottle.*;
public dynamic class ButtonHighscoresNext extends BasicButton {
public function ButtonHighscoresNext(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 221
//ButtonHighscoresPrev (ButtonHighscoresPrev)
package {
import com.fishinabottle.*;
public dynamic class ButtonHighscoresPrev extends BasicButton {
public function ButtonHighscoresPrev(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 222
//ButtonObject (ButtonObject)
package {
import com.fishinabottle.*;
public dynamic class ButtonObject extends BasicButton {
}
}//package
Section 223
//ButtonQuit (ButtonQuit)
package {
import com.fishinabottle.*;
public dynamic class ButtonQuit extends BasicButton {
}
}//package
Section 224
//ButtonSend (ButtonSend)
package {
import com.fishinabottle.*;
public dynamic class ButtonSend extends BasicButton {
public function ButtonSend(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 225
//ButtonSoundOff (ButtonSoundOff)
package {
import com.fishinabottle.*;
public dynamic class ButtonSoundOff extends BasicButton {
}
}//package
Section 226
//ButtonSoundOn (ButtonSoundOn)
package {
import com.fishinabottle.*;
public dynamic class ButtonSoundOn extends BasicButton {
}
}//package
Section 227
//ButtonViewHighscores (ButtonViewHighscores)
package {
import com.fishinabottle.*;
public dynamic class ButtonViewHighscores extends BasicButton {
public function ButtonViewHighscores(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 228
//CalculationGame (CalculationGame)
package {
import gs.*;
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import gs.easing.*;
import flash.media.*;
public class CalculationGame extends MovieClip {
private const ANSWER_TIME:uint = 10;
private const ROUND_LENGTH:int = 3;
private const NUM_ROUNDS:int = 3;
private var sfxClick:Sound;
private var distractOn:int;
private var sfxCorrect:Sound;
private var currQuestion:int;
public var option1:MovieClip;
public var option2:MovieClip;
public var option3:MovieClip;
public var resultBox:MovieClip;
public var gameTimer:MovieClip;
private var currRound:int;
public var score:int;
private var sfxIncorrect:Sound;
public var questionNumber:MovieClip;
private var correctAnswer:int;
private var soundChannel:SoundChannel;
private var distractCount:Number;
private var sfxTimeUp:Sound;
private var answerTimerCount:Number;
private var timer:Timer;
private var equation:MovieClip;
private var questions:Array;
private var userAnswer:int;
private var sfxWhoosh:Sound;
public var instructions:MovieClip;
public var roundPopUp:MovieClip;
public var question:MovieClip;
public function CalculationGame():void{
sfxClick = new SFXClick();
sfxCorrect = new SFXCorrect();
sfxIncorrect = new SFXIncorrect();
sfxTimeUp = new SFXTimeUp();
sfxWhoosh = new SFXShortWhoosh();
soundChannel = sfxWhoosh.play();
score = 0;
instructions.visible = false;
instructions.alpha = 0;
instructions.buttonContinue.addEventListener(MouseEvent.MOUSE_UP, closeInstructions);
resultBox.gotoAndStop("off");
resultBox.addEventListener("next_question", nextQuestion);
roundPopUp.gotoAndStop("off");
roundPopUp.addEventListener("popup_complete", startRound);
gameTimer.gotoAndStop("off");
gameTimer.timer.bar.gotoAndStop("calculations");
questions = new Array();
questions[0] = new Array("3+4", "7-2", "2+5", "8-5", "5-3", "7+6", "5+7", "6-3", "9+3", "9-5", "8+6", "3*4", "8/2", "9*2", "8/4", "6/3", "4*5", "6/2", "3*6", "4/2");
questions[1] = new Array("(3+4)-2", "(7-2)+6", "(2+5)*2", "(8-5)*3", "(5-3)/2", "(3*3)-5", "(8/2)*3", "(2*7)+4", "(9/3)+7", "(4*3)-3");
questions[2] = new Array("(3+4)-(5-3)", "(7-2)+(3+2)", "(2+5)*(6-4)", "(8-5)*(3+2)", "(9-3)/(3-1)", "(4-2)*(3*3)", "(6*3)-(9+2)", "(8*4)/(7-5)", "(2*7)+(9-6)", "(3*2)*(4/2)");
shuffle(questions[0]);
shuffle(questions[1]);
shuffle(questions[2]);
question.equation1.visible = false;
question.equation2.visible = false;
question.equation3.visible = false;
question.visible = false;
option1.visible = false;
option2.visible = false;
option3.visible = false;
questionNumber.visible = false;
option1.id = 1;
option1.addEventListener(MouseEvent.MOUSE_UP, answerSelected);
option2.id = 2;
option2.addEventListener(MouseEvent.MOUSE_UP, answerSelected);
option3.id = 3;
option3.addEventListener(MouseEvent.MOUSE_UP, answerSelected);
option1.mouseEnabled = false;
option2.mouseEnabled = false;
option3.mouseEnabled = false;
}
private function showQuestion():void{
var _local1:String;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
var _local10:String;
var _local11:String;
var _local12:String;
var _local13:int;
var _local14:int;
var _local15:int;
var _local16:int;
var _local17:int;
_local1 = questions[currRound][currQuestion];
_local2 = 0;
question.equation1.visible = false;
question.equation2.visible = false;
question.equation3.visible = false;
if (_local1.charAt(0) != "("){
_local6 = int(_local1.charAt(0));
_local7 = int(_local1.charAt(2));
_local10 = _local1.charAt(1);
_local13 = getAnswer(_local6, _local7, _local10);
equation = question.equation1;
_local14 = Math.floor((Math.random() * 3));
if (_local14 == 0){
_local2 = _local6;
} else {
if (_local14 == 1){
_local2 = _local7;
} else {
if (_local14 == 2){
_local2 = _local13;
};
};
};
if (_local14 == 0){
equation.num1.num.text = "?";
} else {
equation.num1.num.text = _local6;
};
if (_local14 == 1){
equation.num2.num.text = "?";
} else {
equation.num2.num.text = _local7;
};
equation.op1.op.text = setOperator(_local10);
if (_local14 == 2){
equation.ans.num.text = "?";
} else {
equation.ans.num.text = _local13;
};
} else {
if (_local1.charAt((_local1.length - 1)) != ")"){
_local6 = int(_local1.charAt(1));
_local7 = int(_local1.charAt(3));
_local8 = int(_local1.charAt(6));
_local10 = _local1.charAt(2);
_local11 = _local1.charAt(5);
_local15 = getAnswer(_local6, _local7, _local10);
_local13 = getAnswer(_local15, _local8, _local11);
equation = question.equation2;
_local14 = Math.floor((Math.random() * 4));
if (_local14 == 0){
_local2 = _local6;
} else {
if (_local14 == 1){
_local2 = _local7;
} else {
if (_local14 == 2){
_local2 = _local8;
} else {
if (_local14 == 3){
_local2 = _local13;
};
};
};
};
if (_local14 == 0){
equation.num1.num.text = "?";
} else {
equation.num1.num.text = _local6;
};
if (_local14 == 1){
equation.num2.num.text = "?";
} else {
equation.num2.num.text = _local7;
};
if (_local14 == 2){
equation.num3.num.text = "?";
} else {
equation.num3.num.text = _local8;
};
equation.op1.op.text = setOperator(_local10);
equation.op2.op.text = setOperator(_local11);
if (_local14 == 3){
equation.ans.num.text = "?";
} else {
equation.ans.num.text = _local13;
};
} else {
_local6 = int(_local1.charAt(1));
_local7 = int(_local1.charAt(3));
_local8 = int(_local1.charAt(7));
_local9 = int(_local1.charAt(9));
_local10 = _local1.charAt(2);
_local11 = _local1.charAt(5);
_local12 = _local1.charAt(8);
_local16 = getAnswer(_local6, _local7, _local10);
_local17 = getAnswer(_local8, _local9, _local12);
_local13 = getAnswer(_local16, _local17, _local11);
equation = question.equation3;
_local14 = Math.floor((Math.random() * 5));
if (_local14 == 0){
_local2 = _local6;
} else {
if (_local14 == 1){
_local2 = _local7;
} else {
if (_local14 == 2){
_local2 = _local8;
} else {
if (_local14 == 3){
_local2 = _local9;
} else {
if (_local14 == 4){
_local2 = _local13;
};
};
};
};
};
if (_local14 == 0){
equation.num1.num.text = "?";
} else {
equation.num1.num.text = _local6;
};
if (_local14 == 1){
equation.num2.num.text = "?";
} else {
equation.num2.num.text = _local7;
};
if (_local14 == 2){
equation.num3.num.text = "?";
} else {
equation.num3.num.text = _local8;
};
if (_local14 == 3){
equation.num4.num.text = "?";
} else {
equation.num4.num.text = _local9;
};
equation.op1.op.text = setOperator(_local10);
equation.op2.op.text = setOperator(_local11);
equation.op3.op.text = setOperator(_local12);
if (_local14 == 4){
equation.ans.num.text = "?";
} else {
equation.ans.num.text = _local13;
};
};
};
equation.visible = true;
_local14 = Math.floor((Math.random() * 3));
correctAnswer = (_local14 + 1);
if (_local14 == 0){
option1.num.text = _local2;
option2.num.text = ((_local2 + Math.floor((Math.random() * 3))) + 1);
option3.num.text = ((_local2 + Math.floor((Math.random() * 3))) + 4);
} else {
if (_local14 == 1){
option1.num.text = ((_local2 - Math.floor((Math.random() * 3))) - 1);
option2.num.text = _local2;
option3.num.text = ((_local2 + Math.floor((Math.random() * 3))) + 1);
} else {
option1.num.text = ((_local2 - Math.floor((Math.random() * 3))) - 1);
option2.num.text = ((_local2 - Math.floor((Math.random() * 3))) - 4);
option3.num.text = _local2;
};
};
question.alpha = 0;
question.scaleX = (question.scaleY = 0.75);
TweenLite.to(question, 0.5, {autoAlpha:1, scaleX:1, scaleY:1, ease:Cubic.easeOut});
option1.alpha = 0;
option1.scaleX = (option1.scaleY = 0.75);
TweenLite.to(option1, 0.5, {autoAlpha:1, scaleX:1, scaleY:1, delay:0.5, ease:Cubic.easeOut});
option2.alpha = 0;
option2.scaleX = (option2.scaleY = 0.75);
TweenLite.to(option2, 0.5, {autoAlpha:1, scaleX:1, scaleY:1, delay:0.75, ease:Cubic.easeOut});
option3.alpha = 0;
option3.scaleX = (option3.scaleY = 0.75);
TweenLite.to(option3, 0.5, {autoAlpha:1, scaleX:1, scaleY:1, delay:1, ease:Cubic.easeOut, onComplete:questionReady});
questionNumber.visible = true;
questionNumber.question.text = (currQuestion + 1);
}
private function flipNumber(_arg1:MovieClip):void{
TweenLite.to(_arg1, 0.5, {scaleY:-1, ease:Cubic.easeOut, onComplete:onFlipComplete, onCompleteParams:[_arg1]});
}
private function onShrinkComplete(_arg1:MovieClip):void{
TweenLite.to(_arg1, 0.5, {scaleX:1, scaleY:1, ease:Cubic.easeIn});
}
private function spinNumber(_arg1:MovieClip):void{
TweenLite.to(_arg1, 1, {rotation:360, ease:Cubic.easeOut, onComplete:onSpinComplete, onCompleteParams:[_arg1]});
}
private function onFlipComplete(_arg1:MovieClip):void{
TweenLite.to(_arg1, 0.5, {scaleY:1, ease:Cubic.easeIn});
}
private function startRound(_arg1:Event):void{
showQuestion();
}
private function nextRound():void{
roundPopUp.popText.msg.text = ("ROUND " + (currRound + 1));
roundPopUp.gotoAndPlay("on");
}
private function answerSelected(_arg1:MouseEvent):void{
soundChannel = sfxClick.play();
userAnswer = _arg1.target.id;
checkAnswer();
}
private function shrinkNumber(_arg1:MovieClip):void{
TweenLite.to(_arg1, 0.5, {scaleX:0.25, scaleY:0.25, ease:Cubic.easeOut, onComplete:onShrinkComplete, onCompleteParams:[_arg1]});
}
private function getAnswer(_arg1:int, _arg2:int, _arg3:String):int{
switch (_arg3){
case "+":
return ((_arg1 + _arg2));
case "-":
return ((_arg1 - _arg2));
case "*":
return ((_arg1 * _arg2));
case "/":
return ((_arg1 / _arg2));
};
return (0);
}
public function cleanUp():void{
resultBox.removeEventListener("next_question", nextQuestion);
roundPopUp.removeEventListener("popup_complete", startRound);
option1.removeEventListener(MouseEvent.MOUSE_UP, answerSelected);
option2.removeEventListener(MouseEvent.MOUSE_UP, answerSelected);
option3.removeEventListener(MouseEvent.MOUSE_UP, answerSelected);
if (timer != null){
timer.removeEventListener(TimerEvent.TIMER, onTimerUpdate);
};
TweenLite.killTweensOf(instructions);
TweenLite.killTweensOf(question);
TweenLite.killTweensOf(option1);
TweenLite.killTweensOf(option2);
TweenLite.killTweensOf(option3);
}
private function checkAnswer():void{
option1.mouseEnabled = false;
option2.mouseEnabled = false;
option3.mouseEnabled = false;
if (userAnswer > -1){
};
if (userAnswer == correctAnswer){
soundChannel = sfxCorrect.play();
score = (score + ((answerTimerCount / ANSWER_TIME) * 33));
resultBox.gotoAndPlay("correct");
} else {
soundChannel = sfxIncorrect.play();
resultBox.gotoAndPlay("incorrect");
};
timer.stop();
timer.reset();
answerTimerCount = ANSWER_TIME;
}
private function shuffle(_arg1:Array, _arg2:int=0):void{
var _local3:Array;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
_local3 = new Array();
_local4 = _arg1.length;
_local5 = 0;
while (_local5 < _local4) {
_local7 = Math.floor((Math.random() * _arg1.length));
_local3.push(_arg1[_local7]);
_arg1.splice(_local7, 1);
_local5++;
};
if (_arg2 == 0){
_arg2 = _local4;
};
_local6 = 0;
while (_local6 < _arg2) {
_arg1[_local6] = _local3[_local6];
_local6++;
};
}
private function startDistraction():void{
var _local1:uint;
var _local2:uint;
var _local3:MovieClip;
if (equation == question.equation1){
_local2 = Math.floor((Math.random() * 3));
} else {
if (equation == question.equation2){
_local2 = Math.floor((Math.random() * 4));
} else {
if (equation == question.equation3){
_local2 = Math.floor((Math.random() * 5));
};
};
};
if (_local2 == 0){
_local3 = equation.ans;
} else {
_local3 = equation[("num" + _local2)];
};
_local1 = Math.floor((Math.random() * 4));
if (_local1 == 0){
spinNumber(_local3);
} else {
if (_local1 == 1){
flipNumber(_local3);
} else {
if (_local1 == 2){
twistNumber(_local3);
} else {
if (_local1 == 3){
shrinkNumber(_local3);
};
};
};
};
}
private function onSpinComplete(_arg1:MovieClip):void{
_arg1.rotation = 0;
}
private function onTimerUpdate(_arg1:TimerEvent):void{
answerTimerCount = (answerTimerCount - 0.01);
if (answerTimerCount < 0){
answerTimeUp();
} else {
gameTimer.timer.bar.scaleX = (answerTimerCount / ANSWER_TIME);
};
distractCount = (distractCount + 0.01);
if (distractCount > distractOn){
startDistraction();
distractCount = 0;
};
}
public function initGame():void{
soundChannel = sfxWhoosh.play();
TweenLite.to(instructions, 0.5, {autoAlpha:1, delay:1, ease:Cubic.easeOut});
}
private function setOperator(_arg1:String):String{
switch (_arg1){
case "+":
return ("+");
case "-":
return ("–");
case "*":
return ("×");
case "/":
return ("÷");
};
return ("");
}
private function twistNumber(_arg1:MovieClip):void{
TweenLite.to(_arg1, 0.5, {scaleX:-1, ease:Cubic.easeOut, onComplete:onTwistComplete, onCompleteParams:[_arg1]});
}
private function gameComplete():void{
timer.removeEventListener(TimerEvent.TIMER, onTimerUpdate);
resultBox.removeEventListener("next_question", nextQuestion);
roundPopUp.removeEventListener("popup_complete", startRound);
dispatchEvent(new Event("game_complete"));
}
private function questionReady():void{
option1.mouseEnabled = true;
option2.mouseEnabled = true;
option3.mouseEnabled = true;
timer.start();
}
private function startGame(_arg1:Event=null):void{
gameTimer.gotoAndPlay("in");
gameTimer.timer.bar.scaleX = 1;
answerTimerCount = ANSWER_TIME;
timer = new Timer(10);
timer.addEventListener(TimerEvent.TIMER, onTimerUpdate);
currRound = 0;
currQuestion = 0;
distractCount = 1;
distractOn = 1;
nextRound();
}
private function answerTimeUp():void{
soundChannel = sfxTimeUp.play();
userAnswer = -1;
checkAnswer();
}
private function closeInstructions(_arg1:Event=null):void{
instructions.buttonContinue.removeEventListener(MouseEvent.MOUSE_UP, closeInstructions);
soundChannel = sfxClick.play();
TweenLite.to(instructions, 0.5, {autoAlpha:0, ease:Cubic.easeOut, onComplete:startGame});
}
private function onTwistComplete(_arg1:MovieClip):void{
TweenLite.to(_arg1, 0.5, {scaleX:1, ease:Cubic.easeIn});
}
private function nextQuestion(_arg1:Event):void{
currQuestion++;
TweenLite.to(option1, 0.5, {autoAlpha:0, scaleX:0.75, scaleY:0.75, delay:0.5, ease:Cubic.easeOut});
TweenLite.to(option2, 0.5, {autoAlpha:0, scaleX:0.75, scaleY:0.75, delay:0.5, ease:Cubic.easeOut});
TweenLite.to(option3, 0.5, {autoAlpha:0, scaleX:0.75, scaleY:0.75, delay:0.5, ease:Cubic.easeOut});
questionNumber.visible = false;
distractCount = 1;
if (currQuestion < ROUND_LENGTH){
TweenLite.to(question, 0.5, {autoAlpha:0, scaleX:0.75, scaleY:0.75, delay:0.5, ease:Cubic.easeOut, onComplete:showQuestion});
} else {
currQuestion = 0;
currRound++;
if (currRound < NUM_ROUNDS){
TweenLite.to(question, 0.5, {autoAlpha:0, scaleX:0.75, scaleY:0.75, delay:0.5, ease:Cubic.easeOut, onComplete:nextRound});
} else {
TweenLite.to(question, 0.5, {autoAlpha:0, scaleX:0.75, scaleY:0.75, delay:0.5, ease:Cubic.easeOut, onComplete:gameComplete});
};
};
}
}
}//package
Section 229
//CalculationGameIntro (CalculationGameIntro)
package {
import flash.events.*;
import flash.display.*;
public dynamic class CalculationGameIntro extends MovieClip {
public function CalculationGameIntro(){
addFrameScript(75, frame76, 91, frame92);
}
function frame76(){
dispatchEvent(new Event("start_game"));
}
function frame92(){
dispatchEvent(new Event("intro_complete"));
}
}
}//package
Section 230
//challenge_button (challenge_button)
package {
import com.fishinabottle.*;
public dynamic class challenge_button extends BasicButton {
}
}//package
Section 231
//CoordinationGame (CoordinationGame)
package {
import gs.*;
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import gs.easing.*;
import flash.media.*;
public class CoordinationGame extends MovieClip {
private const ANSWER_TIME:uint = 10;
private const NUM_ROUNDS:int = 5;
private var sfxClick:Sound;
public var px:Number;
public var py:Number;
private var sfxCorrect:Sound;
private var xRateList:Array;
public var startPoint:MovieClip;
private var xRangeMin:Number;// = 0.1
public var resultBox:MovieClip;
public var gameTimer:MovieClip;
private var currRound:uint;
private var xMinList:Array;
private var yRangeMax:Number;// = 1.5
private var lastY:Number;// = 0
private var lastX:Number;// = 0
public var score:int;
private var sfxIncorrect:Sound;
private var xMaxList:Array;
public var lineHolder:MovieClip;
private var isActive:Boolean;// = false
private var yRate:Number;// = 0.02
private var currScaleX:Number;// = 1
private var soundChannel:SoundChannel;
private var answerTimerCount:Number;
private var currScaleY:Number;// = 1
private var yRateList:Array;
var linePointsY:Array;
private var timer:Timer;
var linePointsX:Array;
private var yMinList:Array;
private var yMaxList:Array;
private var sfxWhoosh:Sound;
private var yRangeMin:Number;// = -1.5
public var endPoint:MovieClip;
private var xRate:Number;// = 0.02
private var xRangeMax:Number;// = 5
public var blocks:MovieClip;
public var instructions:MovieClip;
private var clickX:Number;// = 0
private var clickY:Number;// = 0
public var cursorPoint:MovieClip;
public var roundPopUp:MovieClip;
private var isStarted:Boolean;// = false
public var labels:MovieClip;
public function CoordinationGame():void{
xRangeMin = 0.1;
xRangeMax = 5;
yRangeMin = -1.5;
yRangeMax = 1.5;
xRate = 0.02;
yRate = 0.02;
currScaleX = 1;
currScaleY = 1;
lastX = 0;
lastY = 0;
clickX = 0;
clickY = 0;
isActive = false;
isStarted = false;
linePointsX = new Array();
linePointsY = new Array();
xMinList = new Array(-1, 0, -1, 0, -1);
xMaxList = new Array(1, 1.5, 1, 1.5, 1);
yMinList = new Array(0, -1, 0, -1, 0);
yMaxList = new Array(1.5, 1, 1.5, 1, 1.5);
xRateList = new Array(0.01, 0.02, 0.02, 0.02, 0.01);
yRateList = new Array(0.01, 0.01, 0.01, 0.01, 0.02);
super();
sfxClick = new SFXClick();
sfxCorrect = new SFXCorrect();
sfxIncorrect = new SFXIncorrect();
sfxWhoosh = new SFXShortWhoosh();
soundChannel = sfxWhoosh.play();
score = 0;
instructions.visible = false;
instructions.alpha = 0;
instructions.buttonContinue.addEventListener(MouseEvent.MOUSE_UP, closeInstructions);
roundPopUp.gotoAndStop("off");
roundPopUp.addEventListener("popup_complete", startRound);
gameTimer.gotoAndStop("off");
gameTimer.timer.bar.gotoAndStop("coordination");
startPoint.visible = false;
startPoint.alpha = 0;
endPoint.visible = false;
endPoint.alpha = 0;
labels.visible = false;
labels.alpha = 0;
blocks.visible = false;
blocks.alpha = 0;
cursorPoint.visible = false;
}
private function updateScale():void{
currScaleX = (currScaleX + xRate);
if ((((currScaleX > xRangeMax)) || ((currScaleX < xRangeMin)))){
xRate = (xRate * -1);
};
currScaleY = (currScaleY + yRate);
if ((((currScaleY > yRangeMax)) || ((currScaleY < yRangeMin)))){
yRate = (yRate * -1);
};
}
private function endReached():void{
var _local1:Number;
var _local2:uint;
var _local3:int;
var _local4:Vector3D;
soundChannel = sfxCorrect.play();
_local1 = 0;
_local2 = 1;
while (_local2 < linePointsX.length) {
_local4 = new Vector3D((linePointsX[_local2] - linePointsX[(_local2 - 1)]), (linePointsY[_local2] - linePointsY[(_local2 - 1)]));
_local1 = (_local1 + _local4.magnitude());
_local2++;
};
_local3 = Math.floor((300 - ((_local1 - 535) / 2)));
if (_local3 > 300){
_local3 = 300;
};
if (_local3 < 0){
_local3 = 0;
};
_local3 = (_local3 / NUM_ROUNDS);
trace(_local3);
score = (score + _local3);
removeEventListener(Event.ENTER_FRAME, frameUpdate);
stage.removeEventListener(MouseEvent.MOUSE_DOWN, onMousePress);
stage.removeEventListener(MouseEvent.MOUSE_UP, onMouseRelease);
answerTimerCount = ANSWER_TIME;
endRound();
}
private function failed():void{
soundChannel = sfxIncorrect.play();
removeEventListener(Event.ENTER_FRAME, frameUpdate);
stage.removeEventListener(MouseEvent.MOUSE_DOWN, onMousePress);
stage.removeEventListener(MouseEvent.MOUSE_UP, onMouseRelease);
answerTimerCount = ANSWER_TIME;
endRound();
}
private function timeUp():void{
failed();
}
private function startRound(_arg1:Event=null):void{
xRangeMin = xMinList[currRound];
xRangeMax = xMaxList[currRound];
yRangeMin = yMinList[currRound];
yRangeMax = yMaxList[currRound];
xRate = xRateList[currRound];
yRate = yRateList[currRound];
currScaleX = xRangeMax;
currScaleY = yRangeMax;
blocks.gotoAndStop((currRound + 1));
TweenLite.to(blocks, 0.5, {autoAlpha:1, ease:Cubic.easeOut});
TweenLite.to(startPoint, 0.5, {autoAlpha:1, ease:Cubic.easeOut, delay:0.5});
TweenLite.to(endPoint, 0.5, {autoAlpha:1, ease:Cubic.easeOut, delay:0.5});
TweenLite.to(labels, 0.5, {autoAlpha:1, ease:Cubic.easeOut, delay:0.5, onComplete:begin});
}
private function nextRound():void{
if (currRound >= NUM_ROUNDS){
dispatchEvent(new Event("game_complete"));
} else {
roundPopUp.popText.msg.text = ("ROUND " + (currRound + 1));
roundPopUp.gotoAndPlay("on");
};
}
private function frameUpdate(_arg1:Event):void{
if (!isActive){
return;
};
moveBall();
updateScale();
if (blocks.hitTestPoint(cursorPoint.x, cursorPoint.y, true)){
isActive = false;
isStarted = false;
failed();
};
if (endPoint.hitTestPoint(cursorPoint.x, cursorPoint.y, true)){
isActive = false;
isStarted = false;
endReached();
};
}
private function begin():void{
lineHolder.graphics.lineStyle(5, 1118498, 0.25);
lineHolder.graphics.moveTo(startPoint.x, startPoint.y);
linePointsX.splice(0);
linePointsY.splice(0);
linePointsX.push(startPoint.x);
linePointsY.push(startPoint.y);
addEventListener(Event.ENTER_FRAME, frameUpdate);
stage.addEventListener(MouseEvent.MOUSE_DOWN, onMousePress);
stage.addEventListener(MouseEvent.MOUSE_UP, onMouseRelease);
}
public function cleanUp():void{
roundPopUp.removeEventListener("popup_complete", startRound);
removeEventListener(Event.ENTER_FRAME, frameUpdate);
stage.removeEventListener(MouseEvent.MOUSE_DOWN, onMousePress);
stage.removeEventListener(MouseEvent.MOUSE_UP, onMouseRelease);
TweenLite.killTweensOf(instructions);
TweenLite.killTweensOf(blocks);
TweenLite.killTweensOf(startPoint);
TweenLite.killTweensOf(endPoint);
TweenLite.killTweensOf(labels);
}
private function onTimerUpdate(_arg1:TimerEvent):void{
answerTimerCount = (answerTimerCount - 0.01);
if (answerTimerCount < 0){
timeUp();
} else {
gameTimer.timer.bar.scaleX = (answerTimerCount / ANSWER_TIME);
};
}
public function initGame():void{
soundChannel = sfxWhoosh.play();
TweenLite.to(instructions, 0.5, {autoAlpha:1, delay:1, ease:Cubic.easeOut});
}
private function onMouseRelease(_arg1:MouseEvent):void{
if (!isActive){
return;
};
isActive = false;
}
private function moveBall():void{
var _local1:Number;
var _local2:Number;
_local1 = ((mouseX + clickX) - lastX);
_local2 = ((mouseY + clickY) - lastY);
px = (px + (_local1 * currScaleX));
py = (py + (_local2 * currScaleY));
lastX = (mouseX + clickX);
lastY = (mouseY + clickY);
cursorPoint.x = (cursorPoint.x + ((px - cursorPoint.x) / 8));
cursorPoint.y = (cursorPoint.y + ((py - cursorPoint.y) / 8));
lineHolder.graphics.lineTo(cursorPoint.x, cursorPoint.y);
linePointsX.push(cursorPoint.x);
linePointsY.push(cursorPoint.y);
}
private function endRound():void{
currRound++;
TweenLite.to(blocks, 0.5, {autoAlpha:0, ease:Cubic.easeOut, delay:1.5});
TweenLite.to(startPoint, 0.5, {autoAlpha:0, ease:Cubic.easeOut, delay:1.5});
TweenLite.to(endPoint, 0.5, {autoAlpha:0, ease:Cubic.easeOut, delay:1.5});
TweenLite.to(labels, 0.5, {autoAlpha:0, ease:Cubic.easeOut, delay:1.5, onComplete:nextRound});
lineHolder.graphics.clear();
cursorPoint.visible = false;
}
private function startGame(_arg1:Event=null):void{
answerTimerCount = ANSWER_TIME;
currRound = 0;
nextRound();
}
private function closeInstructions(_arg1:Event=null):void{
instructions.buttonContinue.removeEventListener(MouseEvent.MOUSE_UP, closeInstructions);
soundChannel = sfxClick.play();
TweenLite.to(instructions, 0.5, {autoAlpha:0, ease:Cubic.easeOut, onComplete:startGame});
}
private function onMousePress(_arg1:MouseEvent):void{
if (!isStarted){
if (startPoint.hitTestPoint(mouseX, mouseY, true)){
clickX = 0;
clickY = 0;
lastX = mouseX;
lastY = mouseY;
isStarted = true;
cursorPoint.visible = true;
px = (cursorPoint.x = mouseX);
py = (cursorPoint.y = mouseY);
};
} else {
clickX = (lastX - mouseX);
clickY = (lastY - mouseY);
};
isActive = true;
}
}
}//package
Section 232
//CoordinationGameIntro (CoordinationGameIntro)
package {
import flash.events.*;
import flash.display.*;
public dynamic class CoordinationGameIntro extends MovieClip {
public function CoordinationGameIntro(){
addFrameScript(86, frame87, 102, frame103);
}
function frame87(){
dispatchEvent(new Event("start_game"));
}
function frame103(){
dispatchEvent(new Event("intro_complete"));
}
}
}//package
Section 233
//Encryption (Encryption)
package {
public class Encryption {
public var charList:Array;
public var charStr:String;
public var lookupObj:Object;
public function Encryption(){
var _local1:String;
super();
charStr = "ZyL-NvzI3=CWhQRs2j^BiodE/[M7;r16*cFK8Onu)D]9Jex'0w5!qXU(T%.PgfA &VY#kbS?alm_G$pt,H@4£";
charList = new Array();
charList = charStr.split("");
lookupObj = new Object();
for (_local1 in charList) {
lookupObj[("$" + charList[_local1].charCodeAt(0))] = _local1;
};
}
public function encrypt(_arg1:String, _arg2:String):String{
var _local3:Array;
var _local4:String;
var _local5:Number;
var _local6:Number;
var _local7:*;
var _local8:*;
_local3 = _arg1.split("");
_local4 = "";
_local5 = 0;
_local6 = 0;
while (_local6 < _arg2.length) {
_local7 = _arg2.charAt(_local6);
_local8 = getOffset(_local3[_local5], _local7);
_local4 = (_local4 + charList[_local8]);
++_local5;
if (_local5 >= _local3.length){
_local5 = 0;
};
_local6++;
};
return (_local4);
}
private function getOffset(_arg1, _arg2):Number{
var _local3:*;
var _local4:*;
var _local5:*;
_local3 = lookupObj[("$" + _arg1.charCodeAt(0))];
_local4 = lookupObj[("$" + _arg2.charCodeAt(0))];
_local5 = (_local4 - _local3);
if (_local5 < 0){
_local5 = (charList.length + _local5);
};
return (_local5);
}
public function decrypt(_arg1:String, _arg2:String):String{
var _local3:Array;
var _local4:String;
var _local5:Number;
var _local6:Number;
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:*;
_local3 = _arg1.split("");
_local4 = "";
_local5 = 0;
_local6 = 0;
while (_local6 < _arg2.length) {
_local7 = _arg2.charAt(_local6);
_local8 = lookupObj[("$" + _local7.charCodeAt(0))];
_local9 = lookupObj[("$" + _local3[_local5].charCodeAt(0))];
_local10 = (Number(_local8) + Number(_local9));
_local10 = (_local10 % charList.length);
_local4 = (_local4 + charList[_local10]);
++_local5;
if (_local5 >= _local3.length){
_local5 = 0;
};
_local6++;
};
return (_local4);
}
}
}//package
Section 234
//facebook_button (facebook_button)
package {
import com.fishinabottle.*;
public dynamic class facebook_button extends BasicButton {
}
}//package
Section 235
//Highscores (Highscores)
package {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public class Highscores extends MovieClip {
public var fiab_league_player;
public var sentScorePos:int;
private var scores:Array;
private var isBusy:Boolean;
public var buttonPrevious:MovieClip;
private var attemptCount:int;
public var gameID:int;
public var serviceURL:String;
public var isGetting:Boolean;// = false
private var currTable:String;
public var fiab_league_id;
private var fbScorePage:int;
private var isConfigured:Boolean;
private var playerName:String;
private var leaguesOn:Boolean;
private var scoreID:Number;
public var fbFriends:Array;
public var buttonNext:MovieClip;
private var names:Array;
private var leagueName:String;
private var locations:Array;
public var fiab_league_action;
private var minScore:Number;
private var leagueID:int;
private var maxScore:Number;
private var gameName:String;
private var scoresAsTime:Boolean;
private var globalScores:Boolean;
public var table:MovieClip;
public var isSubmitting:Boolean;// = false
private var scoresPerPage:Number;
public var fbNames:Array;
private var leaguePlayer:int;
public var fbScores:Array;
public function Highscores():void{
isSubmitting = false;
isGetting = false;
super();
stop();
visible = false;
attemptCount = 0;
isConfigured = false;
leagueID = 0;
leaguePlayer = 0;
names = new Array();
scores = new Array();
locations = new Array();
fbNames = new Array();
fbScores = new Array();
fbScorePage = 1;
sentScorePos = 0;
}
private function submitReceived(_arg1:Event):void{
var _local2:URLLoader;
var _local3:String;
isSubmitting = false;
_local2 = URLLoader(_arg1.target);
for (_local3 in _local2.data) {
trace(((_local3 + " > ") + _local2.data[_local3]));
};
sentScorePos = (int(_local2.data["higher"]) + 1);
dispatchEvent(new Event("submit_complete"));
_local2.removeEventListener(Event.COMPLETE, submitReceived);
_local2.removeEventListener(IOErrorEvent.IO_ERROR, onIOError);
}
public function submit(_arg1:String, _arg2:Number, _arg3:int=0):void{
var _local4:URLVariables;
var _local5:Date;
_local4 = new URLVariables();
_local5 = new Date();
scoreID = 0;
_local4.fiab_viral_id = gameID;
_local4.rnd = _local5.getTime();
_local4.fiab_score_action = "SUBMIT";
_local4.scorerName = _arg1;
_local4.score = _arg2;
_local4.score_id = scoreID;
_local4.globalScore = _arg3;
isSubmitting = true;
sendData(serviceURL, _local4, submitReceived);
}
private function getScoresReceived(_arg1:Event):void{
var _local2:URLLoader;
var _local3:int;
var _local4:String;
var _local5:uint;
isGetting = false;
_local2 = URLLoader(_arg1.target);
_local3 = 0;
for (_local4 in _local2.data) {
if (_local4.substr(0, 4) == "name"){
_local3 = int(_local4.charAt(4));
names[_local3] = _local2.data[_local4];
} else {
if (_local4.substr(0, 5) == "score"){
_local3 = int(_local4.charAt(5));
scores[_local3] = _local2.data[_local4];
} else {
if (_local4.substr(0, 8) == "location"){
_local3 = int(_local4.charAt(8));
locations[_local3] = _local2.data[_local4];
};
};
};
};
_local5 = 0;
while (_local5 < scoresPerPage) {
table[("name" + _local5)].text = names[_local5];
table[("score" + _local5)].text = scores[_local5];
table[("rank" + _local5)].text = (Number(_local2.data["first_pos"]) + _local5);
_local5++;
};
dispatchEvent(new Event("get_complete"));
_local2.removeEventListener(Event.COMPLETE, getScoresReceived);
_local2.removeEventListener(IOErrorEvent.IO_ERROR, onIOError);
isBusy = false;
}
private function getFacebookScoresReceived(_arg1:Event):void{
var _local2:URLLoader;
var _local3:int;
var _local4:Array;
var _local5:Array;
var _local6:Boolean;
var _local7:String;
var _local8:uint;
var _local9:uint;
var _local10:Boolean;
var _local11:uint;
_local2 = URLLoader(_arg1.target);
_local3 = 0;
_local4 = new Array();
_local5 = new Array();
isBusy = false;
_local6 = false;
_local2.removeEventListener(Event.COMPLETE, getFacebookScoresReceived);
_local2.removeEventListener(IOErrorEvent.IO_ERROR, onIOError);
for (_local7 in _local2.data) {
if (_local7.substr(0, 4) == "name"){
_local3 = int(_local7.substr(4));
_local4[_local3] = _local2.data[_local7];
} else {
if (_local7.substr(0, 5) == "score"){
_local3 = int(_local7.substr(5));
_local5[_local3] = _local2.data[_local7];
};
};
};
_local8 = 0;
while (_local8 < _local4.length) {
_local9 = 0;
while (_local9 < fbFriends.length) {
if (_local5[_local8] == "NONE"){
break;
};
if (_local4[_local8] == fbFriends[_local9]){
_local10 = false;
if (fbNames.length > 0){
_local11 = 0;
while (_local11 < fbNames.length) {
if (fbNames[_local11] == _local4[_local8]){
_local10 = true;
break;
};
_local11++;
};
};
if (!_local10){
fbNames.push(_local4[_local8]);
fbScores.push(_local5[_local8]);
};
};
if (fbNames.length == 10){
break;
};
_local9++;
};
if ((((fbNames.length == 10)) || ((_local5[_local8] == "NONE")))){
_local6 = true;
break;
};
_local8++;
};
if (_local6){
trace(("pages retrieved: " + fbScorePage));
dispatchEvent(new Event("get_complete"));
} else {
fbScorePage = (fbScorePage + 1);
if (fbScorePage < 10){
trace("next page of scores");
getFacebookScores(fbScorePage);
} else {
dispatchEvent(new Event("get_complete"));
};
};
}
public function configure(_arg1:String, _arg2:int):void{
var _local3:Date;
var _local4:URLVariables;
serviceURL = _arg1;
gameID = _arg2;
_local3 = new Date();
_local4 = new URLVariables();
_local4.fiab_viral_id = gameID;
_local4.rnd = _local3.getTime();
_local4.fiab_score_action = "CONFIGURE";
_local4.league_id = leagueID;
_local4.fiab_league_player = leaguePlayer;
sendData(serviceURL, _local4, configureReceived);
}
private function configureReceived(_arg1:Event):void{
var _local2:URLLoader;
var _local3:String;
_local2 = URLLoader(_arg1.target);
for (_local3 in _local2.data) {
trace((">" + _local2.data[_local3]));
};
attemptCount = 0;
if (_local2.data.fiab_league_player == 0){
leaguePlayer = 0;
};
if (_local2.data.league_id == 0){
leagueID = 0;
};
leagueName = _local2.data.league_name;
if (_local2.data.leaguesOn == "true"){
leaguesOn = true;
} else {
leaguesOn = false;
};
if (_local2.data.global_scores == "true"){
globalScores = true;
} else {
globalScores = false;
};
if (_local2.data.scoresAsTime == "false"){
scoresAsTime = false;
} else {
scoresAsTime = true;
};
maxScore = Number(_local2.data.max_score);
minScore = Number(_local2.data.min_score);
scoresPerPage = Number(_local2.data.scoresPerPage);
gameName = _local2.data.game_name;
if (((((!((leagueID == 0))) && (!((leaguePlayer == 0))))) && ((leaguesOn == true)))){
currTable = "LEAGUE";
if (_local2.data.player_name != undefined){
playerName = _local2.data.player_name;
};
};
isConfigured = true;
dispatchEvent(new Event("configure_complete"));
_local2.removeEventListener(Event.COMPLETE, configureReceived);
_local2.removeEventListener(IOErrorEvent.IO_ERROR, onIOError);
}
public function getScores(_arg1:uint=1, _arg2:Boolean=false):void{
var _local3:URLVariables;
var _local4:Date;
if (isBusy){
return;
};
isBusy = true;
_local3 = new URLVariables();
_local4 = new Date();
_local3.fiab_viral_id = gameID;
_local3.rnd = _local4.getTime();
_local3.fiab_score_action = "GET_SCORE";
_local3.league_id = leagueID;
_local3.start_pos = (((_arg1 * scoresPerPage) + 1) - scoresPerPage);
if (_arg2){
_local3.score_interval = "LEAGUE";
} else {
_local3.score_interval = "ALL";
};
isGetting = true;
sendData(serviceURL, _local3, getScoresReceived);
}
public function setFacebookFriends(_arg1:Array):void{
var _local2:uint;
fbFriends = new Array();
_local2 = 0;
while (_local2 < _arg1.length) {
fbFriends[_local2] = _arg1[_local2];
_local2++;
};
}
public function sendData(_arg1:String, _arg2:URLVariables, _arg3:Function):void{
var _local4:URLRequest;
var _local5:URLLoader;
_local4 = new URLRequest(_arg1);
_local5 = new URLLoader();
_local5.dataFormat = URLLoaderDataFormat.VARIABLES;
_local4.data = _arg2;
_local4.method = URLRequestMethod.GET;
_local5.addEventListener(Event.COMPLETE, _arg3);
_local5.addEventListener(IOErrorEvent.IO_ERROR, onIOError);
_local5.load(_local4);
}
public function getFacebookScores(_arg1:uint=1, _arg2:Boolean=false):void{
var _local3:URLVariables;
var _local4:Date;
if (isBusy){
return;
};
isBusy = true;
_local3 = new URLVariables();
_local4 = new Date();
_local3.fiab_viral_id = gameID;
_local3.rnd = _local4.getTime();
_local3.fiab_score_action = "GET_SCORE";
_local3.league_id = leagueID;
fbScorePage = _arg1;
_local3.start_pos = (((_arg1 * scoresPerPage) + 1) - scoresPerPage);
if (_arg2){
_local3.score_interval = "LEAGUE";
} else {
_local3.score_interval = "ALL";
};
sendData(serviceURL, _local3, getFacebookScoresReceived);
}
public function setLeagueInfo(_arg1:int, _arg2:int):void{
leagueID = _arg1;
leaguePlayer = _arg2;
}
private function onIOError(_arg1:IOErrorEvent):void{
var _local2:URLLoader;
_local2 = URLLoader(_arg1.target);
trace("Error loading URL");
if (isSubmitting){
trace("Failed to submit score");
_local2.removeEventListener(Event.COMPLETE, submitReceived);
dispatchEvent(new Event("submit_failed"));
isSubmitting = false;
} else {
if (isGetting){
trace("Failed to get scores");
_local2.removeEventListener(Event.COMPLETE, getScoresReceived);
dispatchEvent(new Event("get_failed"));
isGetting = false;
};
};
_local2.removeEventListener(IOErrorEvent.IO_ERROR, onIOError);
}
}
}//package
Section 236
//HighscoresFB (HighscoresFB)
package {
public dynamic class HighscoresFB extends Highscores {
}
}//package
Section 237
//HighscoresScreen (HighscoresScreen)
package {
import flash.events.*;
import flash.display.*;
import gs.easing.*;
import flash.media.*;
public class HighscoresScreen extends MovieClip {
private var sfxClick:Sound;
public var anim:MovieClip;
public var loadingMessage:MovieClip;
public var failedMessage:MovieClip;
private var soundChannel:SoundChannel;
public var buttonFacebook:MovieClip;
public var buttonBack:MovieClip;
public var leaderboard:MovieClip;
private var sfxIntro:Sound;
public function HighscoresScreen():void{
sfxIntro = new SFXHighscores();
sfxClick = new SFXClick();
soundChannel = sfxIntro.play();
leaderboard.visible = false;
leaderboard.buttonNext.visible = false;
leaderboard.buttonPrev.visible = false;
loadingMessage.visible = false;
failedMessage.visible = false;
anim.gotoAndPlay("in");
anim.addEventListener("in_complete", showLeaderboard);
buttonBack.visible = false;
buttonBack.addEventListener(MouseEvent.MOUSE_UP, onBackClicked);
buttonFacebook.visible = false;
buttonFacebook.addEventListener(MouseEvent.MOUSE_UP, onFacebookVersionClicked);
leaderboard.buttonNext.addEventListener(MouseEvent.MOUSE_UP, onNextClicked);
leaderboard.buttonPrev.addEventListener(MouseEvent.MOUSE_UP, onPrevClicked);
leaderboard.buttonAll.visible = false;
leaderboard.buttonAll.addEventListener(MouseEvent.MOUSE_UP, onAllClicked);
leaderboard.buttonFacebook.addEventListener(MouseEvent.MOUSE_UP, onFacebookClicked);
}
private function onPrevClicked(_arg1:Event):void{
loadingMessage.visible = true;
leaderboard.buttonNext.visible = false;
leaderboard.buttonPrev.visible = false;
soundChannel = sfxClick.play();
dispatchEvent(new Event("scores_prev"));
}
private function onFacebookVersionClicked(_arg1:Event):void{
dispatchEvent(new Event("goto_facebook_version"));
}
public function showPagingButtons(_arg1:int):void{
if (_arg1 > 1){
leaderboard.buttonPrev.visible = true;
} else {
leaderboard.buttonPrev.visible = false;
};
leaderboard.buttonNext.visible = true;
}
private function onNextClicked(_arg1:Event):void{
loadingMessage.visible = true;
leaderboard.buttonNext.visible = false;
leaderboard.buttonPrev.visible = false;
soundChannel = sfxClick.play();
dispatchEvent(new Event("scores_next"));
}
private function onAllClicked(_arg1:MouseEvent):void{
loadingMessage.visible = true;
leaderboard.buttonAll.visible = false;
soundChannel = sfxClick.play();
dispatchEvent(new Event("show_all_scores"));
}
private function onFacebookClicked(_arg1:MouseEvent):void{
loadingMessage.visible = true;
leaderboard.buttonFacebook.visible = false;
leaderboard.buttonNext.visible = false;
leaderboard.buttonPrev.visible = false;
soundChannel = sfxClick.play();
dispatchEvent(new Event("show_facebook_scores"));
}
private function showLeaderboard(_arg1:Event=null):void{
leaderboard.visible = true;
}
private function onBackClicked(_arg1:Event):void{
soundChannel = sfxClick.play();
dispatchEvent(new Event("close_scores"));
}
}
}//package
Section 238
//HUD (HUD)
package {
import flash.events.*;
import flash.display.*;
import flash.media.*;
public class HUD extends MovieClip {
private var sfxClick:Sound;
private var soundChannel:SoundChannel;
public var buttonSoundOff:MovieClip;
public var buttonQuit:MovieClip;
public var buttonSoundOn:MovieClip;
public function HUD():void{
addFrameScript(9, frame10, 19, frame20, 29, frame30);
sfxClick = new SFXClick();
soundChannel = new SoundChannel();
buttonSoundOn.visible = false;
buttonQuit.visible = false;
buttonSoundOn.addEventListener(MouseEvent.MOUSE_UP, toggleSound);
buttonSoundOff.addEventListener(MouseEvent.MOUSE_UP, toggleSound);
buttonQuit.addEventListener(MouseEvent.MOUSE_UP, quitGame);
}
private function toggleSound(_arg1:MouseEvent):void{
soundChannel = sfxClick.play();
buttonSoundOn.visible = !(buttonSoundOn.visible);
buttonSoundOff.visible = !(buttonSoundOff.visible);
dispatchEvent(new Event("toggle_sound"));
}
function frame10(){
stop();
}
function frame20(){
stop();
}
function frame30(){
stop();
}
private function quitGame(_arg1:MouseEvent):void{
soundChannel = sfxClick.play();
dispatchEvent(new Event("quit_game"));
buttonQuit.visible = false;
}
}
}//package
Section 239
//LoginButton (LoginButton)
package {
import com.fishinabottle.*;
public dynamic class LoginButton extends BasicButton {
}
}//package
Section 240
//LoginWaitMessage (LoginWaitMessage)
package {
import flash.display.*;
public dynamic class LoginWaitMessage extends MovieClip {
public var buttonContinue:ButtonContinue;
}
}//package
Section 241
//Main (Main)
package {
import flash.events.*;
import flash.display.*;
import com.facebook.utils.*;
import flash.utils.*;
import flash.net.*;
import com.facebook.net.*;
import com.facebook.data.users.*;
import com.facebook.data.feed.*;
import com.facebook.data.friends.*;
import com.facebook.events.*;
import com.memecounter.*;
import flash.media.*;
import com.facebook.commands.users.*;
import com.facebook.commands.friends.*;
import flash.system.*;
import com.facebook.commands.feed.*;
public class Main extends MovieClip {
private const HIGHSCORE_URL:String = "http://service.fishinabottle.com/hiscores2/hiscores_general_2.php";
private var fbKey:String;
private var resultsScreen:MovieClip;
private var isFacebook:Boolean;
private var fbLoggingInFromScores:Boolean;// = false
private var cypher:Encryption;
private var userID:String;
private var scorePage:int;
private var highscores:Highscores;
private var userImage:String;
private var fbSession:FacebookSessionUtil;
private var key:String;
private var isMuted:Boolean;// = false
public var shared:SharedObject;
private var sendToFriendScreen:MovieClip;
public var preloader:MovieClip;
private var fbSecret:String;
private var highscoresScreen:MovieClip;
public var loadTest:MovieClip;
public var loadedPerc:Number;
private var fbUser:FacebookUser;
private var gameScores:Array;
private var isChallengeComplete:Boolean;// = false
private var fbConnection:String;
private var friendImages:Array;
private var finalScore:int;
private var challengeUser:String;
private var titleScreen:MovieClip;
private var userName:String;
private var hud:MovieClip;
private var gameScreen:MovieClip;
private var challengeCode:String;
private var fbLoggedIn:Boolean;// = false
private var currGame:uint;
private var friendIDs:Array;
private var friendNames:Array;
private var appMode:String;
private var screens:Sprite;
private var challengeName:String;
private var windowTarget:String;// = "_blank"
private var loginWaitMessage:MovieClip;
private var gameList:Array;
private var totalScore:int;
private var challengeScore:Number;
private var introScreen:MovieClip;
private var fbScores:Highscores;
public function Main():void{
isMuted = false;
fbLoggedIn = false;
fbLoggingInFromScores = false;
isChallengeComplete = false;
windowTarget = "_blank";
stop();
super();
addEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
}
private function getSavedData():void{
shared = SharedObject.getLocal("so");
shared.close();
}
public function mute():Boolean{
var _local1:SoundTransform;
_local1 = new SoundTransform();
_local1.volume = 0;
SoundMixer.soundTransform = _local1;
return (true);
}
private function onApplicationReady():void{
var _local1:*;
var _local2:FacebookCall;
Tracker.init(706, root);
cypher = new Encryption();
key = "applepiecowboytoothpaste";
SoundMixer.stopAll();
getSavedData();
appMode = "game";
scorePage = 1;
challengeCode = "";
fbKey = null;
fbSecret = null;
for (_local1 in stage.loaderInfo.parameters) {
switch (_local1){
case "fb_sig_api_key":
fbKey = stage.loaderInfo.parameters[_local1];
break;
case "fb_sig_ss":
fbSecret = stage.loaderInfo.parameters[_local1];
break;
case "fb_local_connection":
fbConnection = stage.loaderInfo.parameters[_local1];
break;
case "app_mode":
appMode = stage.loaderInfo.parameters[_local1];
break;
case "score_page":
scorePage = Number(stage.loaderInfo.parameters[_local1]);
break;
case "challenge_code":
challengeCode = stage.loaderInfo.parameters[_local1];
break;
case "score_window":
windowTarget = stage.loaderInfo.parameters[_local1];
break;
default:
break;
};
};
screens = new Sprite();
addChild(screens);
if (appMode == "highscores"){
highscores = new Highscores();
addChild(highscores);
highscores.addEventListener("configure_complete", onHighscoresOnlyConfigure);
highscores.addEventListener("get_complete", onHighscoresGet);
highscores.addEventListener("get_failed", onHighscoresGetFailed);
highscores.configure(HIGHSCORE_URL, 12);
fbScores = new Highscores();
addChild(fbScores);
loginWaitMessage = new LoginWaitMessage();
loginWaitMessage.visible = false;
return;
};
titleScreen = new TitleScreen();
screens.addChild(titleScreen);
titleScreen.addEventListener("goto_game", startGame);
titleScreen.addEventListener("goto_send", gotoSendToFriend);
titleScreen.addEventListener("goto_scores", showHighscores);
if (fbKey != null){
isFacebook = true;
fbLoggedIn = true;
titleScreen.fbButton.visible = false;
titleScreen.buttonSend.buttonSend.textClip.txt.text = "INVITE FRIENDS";
fbSession = new FacebookSessionUtil(fbKey, fbSecret, stage.loaderInfo);
_local2 = fbSession.facebook.post(new GetInfo([fbSession.facebook.uid], ["uid", "name", "pic_square"]));
_local2.addEventListener(FacebookEvent.COMPLETE, onGetInfoComplete);
} else {
isFacebook = false;
titleScreen.fbButton.visible = false;
};
hud = new HUD();
addChild(hud);
hud.addEventListener("quit_game", quitGame);
hud.addEventListener("toggle_sound", toggleSound);
gameList = new Array("CalculationGame", "MemoryGame", "RecognitionGame", "CoordinationGame", "RiskGame");
gameScores = new Array();
totalScore = 0;
highscores = new Highscores();
addChild(highscores);
highscores.addEventListener("configure_complete", onHighscoresConfigure);
highscores.addEventListener("submit_complete", onHighscoresSubmit);
highscores.addEventListener("get_complete", onHighscoresGet);
highscores.addEventListener("submit_failed", onHighscoresSubmitFailed);
highscores.addEventListener("get_failed", onHighscoresGetFailed);
highscores.configure(HIGHSCORE_URL, 12);
fbScores = new HighscoresFB();
addChild(fbScores);
loginWaitMessage = new LoginWaitMessage();
addChild(loginWaitMessage);
loginWaitMessage.visible = false;
}
public function onFbScoresSubmit(_arg1:Event=null):void{
resultsScreen.submitBox.buttonChallenge.visible = true;
resultsScreen.submitBox.messageSent.visible = false;
resultsScreen.submitBox.messageSending.visible = false;
resultsScreen.submitBox.buttonBack.visible = true;
resultsScreen.submitBox.buttonViewHighscores.visible = true;
Tracker.kvEvent(7126);
postStory();
}
private function postStory(_arg1:Event=null):void{
var _local2:LocalConnection;
var _local3:String;
var _local4:String;
var _local5:*;
var _local6:*;
if (!isFacebook){
return;
};
_local2 = new LocalConnection();
_local3 = "";
_local4 = "Enter a comment...";
_local5 = {name:"Britain's Best Brain", href:"http://apps.facebook.com/britainsbestbrain/", caption:(("{*actor*} has scored " + finalScore) + " points in the Britain's Best Brain game!"), media:[{type:"image", src:"http://85.118.237.30/~britains/facebook/icon.jpg", href:"http://apps.facebook.com/britainsbestbrain/"}]};
_local6 = _local2.send(fbConnection, "callFBJS", "Facebook.streamPublish", [_local3, _local5, null, null, _local4]);
}
public function onHighscoresOnlyConfigure(_arg1:Event=null):void{
fbScores.addEventListener("configure_complete", onFbScoresOnlyConfigure);
fbScores.addEventListener("get_complete", onFbScoresGet);
fbScores.configure(HIGHSCORE_URL, 13);
}
private function onIntroComplete(_arg1:Event=null):void{
introScreen.removeEventListener("start_game", onGameStart);
introScreen.removeEventListener("intro_complete", onIntroComplete);
screens.removeChild(introScreen);
introScreen = null;
hud.buttonQuit.visible = true;
}
private function loadComplete(_arg1:Event):void{
onApplicationLoaded();
}
private function onAvatarLoaded(_arg1:Event):void{
}
private function toggleSound(_arg1:Event=null):Boolean{
if (isMuted){
unmute();
isMuted = false;
return (false);
};
mute();
isMuted = true;
return (true);
}
public function unmute():Boolean{
var _local1:SoundTransform;
_local1 = new SoundTransform();
_local1.volume = 1;
SoundMixer.soundTransform = _local1;
return (false);
}
private function closeHighscores(_arg1:Event):void{
highscoresScreen.removeEventListener("close_scores", closeHighscores);
highscoresScreen.removeEventListener("goto_facebook_version", gotoFacebookVersion);
highscoresScreen.removeEventListener("scores_next", highscoresNext);
highscoresScreen.removeEventListener("scores_prev", highscoresPrev);
highscoresScreen.removeEventListener("show_facebook_scores", showFacebookScores);
highscoresScreen.removeEventListener("show_all_scores", showAllScores);
screens.removeChild(highscoresScreen);
highscoresScreen = null;
titleScreen.reset();
titleScreen.visible = true;
highscores.visible = false;
fbScores.visible = false;
}
public function onHighscoresSubmit(_arg1:Event=null):void{
var _local2:String;
if (((fbLoggedIn) && (!((userID == null))))){
fbScores.submit(userID, finalScore);
} else {
resultsScreen.submitBox.messageSent.visible = true;
resultsScreen.submitBox.messageSending.visible = false;
resultsScreen.submitBox.buttonBack.visible = true;
resultsScreen.submitBox.buttonViewHighscores.visible = true;
_local2 = ordinalise(_arg1.target.sentScorePos);
resultsScreen.submitBox.messageRank.rank.text = _local2;
resultsScreen.submitBox.messageRank.visible = true;
scorePage = (Math.floor((_arg1.target.sentScorePos / 10)) + 1);
Tracker.kvEvent(7126);
};
}
private function onHighscoresIn(_arg1:Event):void{
highscoresScreen.loadingMessage.visible = true;
highscoresScreen.leaderboard.buttonAll.visible = isFacebook;
highscoresScreen.leaderboard.buttonFacebook.visible = isFacebook;
highscoresScreen.leaderboard.heading.visible = !(isFacebook);
highscoresScreen.anim.removeEventListener("in_complete", onHighscoresIn);
highscores.getScores(scorePage);
}
public function ordinalise(_arg1:int):String{
var _local2:String;
var _local3:String;
_local2 = String(_arg1);
_local3 = "";
if (((((!((_local2.substr(-2, 2) == "13"))) && (!((_local2.substr(-2, 2) == "12"))))) && (!((_local2.substr(-2, 2) == "11"))))){
if (_local2.substr(-1, 1) == "1"){
_local3 = "st";
} else {
if (_local2.substr(-1, 1) == "2"){
_local3 = "nd";
} else {
if (_local2.substr(-1, 1) == "3"){
_local3 = "rd";
};
};
};
};
if (_local3 == ""){
_local3 = "th";
};
return ((_local2 + _local3));
}
private function onGameStart(_arg1:Event=null):void{
resultsScreen.visible = false;
gameScreen.visible = true;
gameScreen.initGame();
}
public function onHighscoresGet(_arg1:Event=null):void{
highscores.visible = true;
fbScores.visible = false;
highscoresScreen.loadingMessage.visible = false;
if (appMode != "highscores"){
highscoresScreen.buttonBack.visible = true;
};
highscoresScreen.leaderboard.buttonFacebook.visible = true;
highscoresScreen.showPagingButtons(scorePage);
}
private function fbAutoSubmit(_arg1:Event=null):void{
if (!isFacebook){
return;
};
resultsScreen.submitBox.inputName.visible = false;
resultsScreen.submitBox.inputBox.visible = false;
resultsScreen.submitBox.buttonSubmit.visible = false;
resultsScreen.submitBox.buttonBack.visible = false;
resultsScreen.submitBox.messageEnterName.visible = false;
resultsScreen.submitBox.messageSending.visible = true;
finalScore = _arg1.target.gameScore;
highscores.submit(userName, finalScore);
}
public function frameReadyCheck(_arg1:Event):void{
if (loadTest != null){
removeEventListener(Event.ENTER_FRAME, frameReadyCheck);
onApplicationReady();
};
}
private function frameUpdate(_arg1:Event):void{
}
private function showAllScores(_arg1:Event):void{
fbScores.visible = false;
highscoresScreen.buttonBack.visible = false;
highscores.getScores();
}
private function onGetInfoComplete(_arg1:FacebookEvent):void{
var _local2:GetInfoData;
_local2 = GetInfoData(_arg1.data);
fbUser = FacebookUser(_local2.userCollection.getItemAt(0));
userName = fbUser.name;
userImage = fbUser.pic_square;
userID = fbUser.uid;
getFriends();
}
private function setSavedData():void{
shared = SharedObject.getLocal("so");
shared.data.help = 0;
shared.flush();
shared.close();
}
public function onFbScoresGet(_arg1:Event=null):void{
var _local2:uint;
var _local3:uint;
if (appMode != "highscores"){
highscoresScreen.buttonBack.visible = true;
};
highscoresScreen.leaderboard.buttonAll.visible = true;
fbScores.visible = true;
highscores.visible = false;
highscoresScreen.loadingMessage.visible = false;
if (_arg1.target.fbNames.length > 0){
_local2 = 0;
while (_local2 < 8) {
fbScores.table[("rank" + _local2)].text = (fbScores.table[("name" + _local2)].text = (fbScores.table[("score" + _local2)].text = ""));
fbScores.table[("pic" + _local2)].visible = false;
_local3 = 0;
while (_local3 < friendIDs.length) {
if (_arg1.target.fbNames[_local2] == friendIDs[_local3]){
fbScores.table[("rank" + _local2)].text = (_local2 + 1);
fbScores.table[("name" + _local2)].text = friendNames[_local3];
fbScores.table[("score" + _local2)].text = _arg1.target.fbScores[_local2];
fbScores.table[("pic" + _local2)].visible = true;
if (((((!((friendImages[_local3] == ""))) && (!((friendImages[_local3] == null))))) && (!((friendImages[_local3] == undefined))))){
loadAvatar(friendImages[_local3], fbScores.table[("pic" + _local2)]);
};
break;
};
_local3++;
};
_local2++;
};
};
}
private function loaderUpdate(_arg1:Event):void{
loadedPerc = (loadedPerc - ((loadedPerc - (this.loaderInfo.bytesLoaded / this.loaderInfo.bytesTotal)) * 0.2));
preloader.perc.text = (Math.floor((loadedPerc * 100)) + "%");
if ((((this.loaderInfo.bytesLoaded == this.loaderInfo.bytesTotal)) && ((loadedPerc > 0.99)))){
removeEventListener(Event.ENTER_FRAME, loaderUpdate);
preloader.perc.text = "";
preloader.gotoAndPlay("off");
};
}
private function closeSendToFriend(_arg1:Event):void{
sendToFriendScreen.removeEventListener("close_send", closeSendToFriend);
screens.removeChild(sendToFriendScreen);
sendToFriendScreen = null;
titleScreen.reset();
titleScreen.visible = true;
}
private function onGameComplete(_arg1:Event=null):void{
var _local2:BitmapData;
var _local3:Bitmap;
_local2 = new BitmapData(640, 360);
_local2.draw(gameScreen);
_local3 = new Bitmap(_local2);
gameScores[currGame] = _arg1.target.score;
totalScore = (totalScore + _arg1.target.score);
gameScreen.removeEventListener("game_complete", onGameComplete);
gameScreen.cleanUp();
screens.removeChild(gameScreen);
gameScreen = null;
resultsScreen.showScore(currGame, gameScores[currGame]);
resultsScreen.addEventListener("next_game", nextGame);
resultsScreen.addEventListener("submit_score", submitScore);
resultsScreen.addEventListener("view_score", showHighscoresAfterSubmit);
resultsScreen.addEventListener("challenge_friends", challengeFriend);
resultsScreen.addEventListener("final_score_shown", fbAutoSubmit);
resultsScreen.startTransition(_local3);
}
private function quitGame(_arg1:Event=null):void{
titleScreen.reset();
titleScreen.visible = true;
if (gameScreen != null){
gameScreen.cleanUp();
screens.removeChild(gameScreen);
gameScreen = null;
};
screens.removeChild(resultsScreen);
resultsScreen = null;
}
private function challengeFriend(_arg1:Event=null):void{
var _local2:String;
var _local3:LocalConnection;
Tracker.kvEvent(7129);
_local2 = ((("u=" + userID) + "&s=") + finalScore);
_local2 = cypher.encrypt(key, _local2);
_local3 = new LocalConnection();
_local3.send(fbConnection, "callFBJS", "document.setLocation", [((("http://apps.facebook.com/britainsbestbrain/challenge.php?fb_force_mode=fbml&score=" + finalScore) + "&c=") + _local2)]);
}
private function showFacebookScores(_arg1:Event):void{
highscores.visible = false;
highscoresScreen.buttonBack.visible = false;
if (fbLoggedIn){
getFacebookScores();
};
}
public function onFbScoresOnlyConfigure(_arg1:Event):void{
highscoresScreen = new HighscoresScreen();
screens.addChild(highscoresScreen);
highscoresScreen.buttonBack.visible = false;
highscoresScreen.addEventListener("scores_next", highscoresNext);
highscoresScreen.addEventListener("scores_prev", highscoresPrev);
highscoresScreen.addEventListener("show_facebook_scores", showFacebookScores);
highscoresScreen.addEventListener("show_all_scores", showAllScores);
highscoresScreen.addEventListener("close_scores", closeHighscores);
highscoresScreen.addEventListener("goto_facebook_version", gotoFacebookVersion);
highscoresScreen.anim.addEventListener("in_complete", onHighscoresIn);
}
private function init():void{
stage.align = StageAlign.TOP_LEFT;
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.quality = StageQuality.HIGH;
stage.showDefaultContextMenu = false;
loadedPerc = 0;
preloader.gotoAndPlay("on");
preloader.addEventListener("preloader_start", loadStart);
preloader.addEventListener("preloader_complete", loadComplete);
}
public function onHighscoresSubmitFailed(_arg1:Event=null):void{
resultsScreen.submitBox.messageSending.visible = false;
resultsScreen.submitBox.messageFailed.visible = true;
resultsScreen.submitBox.buttonBack.visible = true;
resultsScreen.submitBox.buttonViewHighscores.visible = true;
}
private function showHighscores(_arg1:Event=null):void{
var _local2:URLRequest;
if (isFacebook){
scorePage = 1;
titleScreen.visible = false;
highscoresScreen = new HighscoresScreen();
screens.addChild(highscoresScreen);
highscoresScreen.addEventListener("close_scores", closeHighscores);
highscoresScreen.addEventListener("goto_facebook_version", gotoFacebookVersion);
highscoresScreen.anim.addEventListener("in_complete", onHighscoresIn);
highscoresScreen.addEventListener("scores_next", highscoresNext);
highscoresScreen.addEventListener("scores_prev", highscoresPrev);
highscoresScreen.addEventListener("show_facebook_scores", showFacebookScores);
highscoresScreen.addEventListener("show_all_scores", showAllScores);
} else {
Tracker.kvEvent(7130);
_local2 = new URLRequest("http://www.britainsbestbrain.com/brainscore.php");
navigateToURL(_local2, windowTarget);
};
}
private function loadStart(_arg1:Event):void{
addEventListener(Event.ENTER_FRAME, loaderUpdate);
}
private function highscoresPrev(_arg1:Event):void{
scorePage--;
if (scorePage < 1){
scorePage = 1;
};
highscoresScreen.buttonBack.visible = false;
highscores.visible = false;
highscores.getScores(scorePage);
}
private function gotoFacebookVersion(_arg1:Event=null):void{
var _local2:URLRequest;
_local2 = new URLRequest("http://apps.facebook.com/britainsbestbrain/");
navigateToURL(_local2, "_top");
}
private function onApplicationLoaded():void{
gotoAndStop("main");
addEventListener(Event.ENTER_FRAME, frameReadyCheck);
}
private function getFriends():void{
var _local1:FacebookCall;
_local1 = fbSession.facebook.post(new GetFriends());
_local1.addEventListener(FacebookEvent.COMPLETE, gotFriends);
}
private function gotFriends(_arg1:FacebookEvent):void{
var _local2:GetFriendsData;
var _local3:uint;
var _local4:Array;
var _local5:uint;
var _local6:FacebookCall;
_local2 = GetFriendsData(_arg1.data);
_local3 = _local2.friends.length;
_local4 = new Array();
_local5 = 0;
while (_local5 < _local3) {
_local4.push(_local2.friends.getItemAt(_local5).uid);
_local5++;
};
_local6 = fbSession.facebook.post(new GetInfo(_local4, ["uid", "name", "pic_square", "is_app_user"]));
_local6.addEventListener(FacebookEvent.COMPLETE, gotFriendsInfo);
}
private function submitScore(_arg1:Event):void{
finalScore = _arg1.target.gameScore;
highscores.submit(_arg1.target.player, finalScore);
}
public function onFbScoresConfigure(_arg1:Event):void{
}
private function getFacebookScores():void{
scorePage = 1;
fbScores.setFacebookFriends(friendIDs);
fbScores.getFacebookScores();
}
private function startGame(_arg1:Event=null):void{
var _local2:Class;
var _local3:Class;
titleScreen.visible = false;
resultsScreen = new ResultsScreen();
screens.addChild(resultsScreen);
resultsScreen.gotoAndStop("off");
resultsScreen.visible = false;
currGame = 0;
_local2 = (getDefinitionByName(gameList[currGame]) as Class);
gameScreen = new (_local2);
screens.addChild(gameScreen);
gameScreen.visible = false;
gameScreen.addEventListener("game_complete", onGameComplete);
_local3 = (getDefinitionByName((gameList[currGame] + "Intro")) as Class);
introScreen = new (_local3);
screens.addChild(introScreen);
introScreen.addEventListener("start_game", onGameStart);
introScreen.addEventListener("intro_complete", onIntroComplete);
Tracker.kvEvent(7125);
}
public function onHighscoresConfigure(_arg1:Event=null):void{
fbScores.addEventListener("configure_complete", onFbScoresConfigure);
fbScores.addEventListener("submit_complete", onFbScoresSubmit);
fbScores.addEventListener("get_complete", onFbScoresGet);
fbScores.configure(HIGHSCORE_URL, 13);
}
private function nextGame(_arg1:Event=null):void{
var _local2:Class;
var _local3:Class;
currGame = (currGame + 1);
if (currGame >= gameList.length){
resultsScreen.removeEventListener("next_game", nextGame);
resultsScreen.removeEventListener("submit_score", submitScore);
resultsScreen.removeEventListener("view_score", showHighscoresAfterSubmit);
resultsScreen.removeEventListener("challenge_friends", challengeFriend);
resultsScreen.removeEventListener("final_score_shown", fbAutoSubmit);
screens.removeChild(resultsScreen);
resultsScreen = null;
titleScreen.reset();
titleScreen.visible = true;
hud.buttonQuit.visible = false;
return;
};
_local2 = (getDefinitionByName(gameList[currGame]) as Class);
gameScreen = new (_local2);
screens.addChild(gameScreen);
gameScreen.addEventListener("game_complete", onGameComplete);
_local3 = (getDefinitionByName((gameList[currGame] + "Intro")) as Class);
introScreen = new (_local3);
screens.addChild(introScreen);
introScreen.addEventListener("start_game", onGameStart);
introScreen.addEventListener("intro_complete", onIntroComplete);
}
private function onAddedToStage(_arg1:Event):void{
removeEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
init();
}
private function gotoSendToFriend(_arg1:Event=null):void{
var _local2:LocalConnection;
var _local3:BitmapData;
var _local4:Bitmap;
if (isFacebook){
Tracker.kvEvent(7128);
titleScreen.buttonPlay.visible = true;
titleScreen.buttonScores.visible = true;
titleScreen.buttonSend.visible = true;
titleScreen.buttonPlay.mouseEnabled = false;
titleScreen.buttonScores.mouseEnabled = false;
titleScreen.buttonSend.mouseEnabled = false;
_local2 = new LocalConnection();
_local2.send(fbConnection, "callFBJS", "document.setLocation", ["http://apps.facebook.com/britainsbestbrain/invite.php?fb_force_mode=fbml"]);
} else {
Tracker.kvEvent(7127);
_local3 = new BitmapData(640, 360);
_local3.draw(titleScreen);
_local4 = new Bitmap(_local3);
titleScreen.visible = false;
sendToFriendScreen = new SendToFriendScreen();
screens.addChild(sendToFriendScreen);
sendToFriendScreen.addEventListener("close_send", closeSendToFriend);
sendToFriendScreen.startTransition(_local4);
};
}
private function getChallenge(_arg1:String):void{
var _local2:String;
var _local3:Array;
var _local4:Array;
var _local5:Array;
var _local6:Number;
var _local7:Number;
var _local8:Boolean;
var _local9:Boolean;
var _local10:uint;
_local2 = _arg1;
_local2 = unescape(_local2);
_local2 = cypher.decrypt(key, _local2);
_local3 = _local2.split("&");
_local4 = new Array();
_local5 = new Array();
_local6 = 0;
_local7 = 0;
while (_local7 < _local3.length) {
_local6 = _local3[_local7].indexOf("=");
_local4[_local7] = _local3[_local7].substr(0, _local6);
_local5[_local7] = unescape(_local3[_local7].substr((_local6 + 1)));
_local7++;
};
challengeUser = _local5[0];
challengeScore = Number(_local5[1]);
_local8 = false;
_local9 = false;
_local10 = 0;
while (_local10 < friendIDs.length) {
if (challengeUser == friendIDs[_local10]){
challengeName = friendNames[_local10];
_local9 = true;
break;
};
_local10++;
};
if (challengeScore < 1500){
_local8 = true;
} else {
_local8 = false;
};
if (((!(_local8)) || (!(_local9)))){
challengeScore = 0;
challengeUser = "";
challengeName = "";
challengeCode = "";
};
}
private function gotFriendsInfo(_arg1:FacebookEvent):void{
var _local2:GetInfoData;
var _local3:uint;
var _local4:uint;
var _local5:FacebookUser;
friendIDs = new Array();
friendNames = new Array();
friendImages = new Array();
_local2 = GetInfoData(_arg1.data);
_local3 = _local2.userCollection.length;
_local4 = 0;
while (_local4 < _local3) {
_local5 = FacebookUser(_local2.userCollection.getItemAt(_local4));
friendIDs.push(_local5.uid);
friendNames.push(_local5.name);
friendImages.push(_local5.pic_square);
_local4++;
};
friendIDs.push(userID);
friendNames.push(userName);
friendImages.push(userImage);
if (fbLoggingInFromScores){
fbLoggingInFromScores = false;
getFacebookScores();
};
if (challengeCode != ""){
getChallenge(challengeCode);
};
}
public function onHighscoresGetFailed(_arg1:Event=null):void{
highscoresScreen.loadingMessage.visible = false;
highscoresScreen.failedMessage.visible = true;
if (appMode != "highscores"){
highscoresScreen.buttonBack.visible = true;
};
highscoresScreen.leaderboard.buttonAll.visible = true;
}
private function showHighscoresAfterSubmit(_arg1:Event=null):void{
var _local2:URLRequest;
if (isFacebook){
hud.buttonQuit.visible = false;
resultsScreen.removeEventListener("next_game", nextGame);
resultsScreen.removeEventListener("submit_score", submitScore);
resultsScreen.removeEventListener("view_score", showHighscoresAfterSubmit);
screens.removeChild(resultsScreen);
resultsScreen = null;
highscoresScreen = new HighscoresScreen();
screens.addChild(highscoresScreen);
highscoresScreen.addEventListener("close_scores", closeHighscores);
highscoresScreen.addEventListener("goto_facebook_version", gotoFacebookVersion);
highscoresScreen.anim.addEventListener("in_complete", onHighscoresIn);
highscoresScreen.addEventListener("scores_next", highscoresNext);
highscoresScreen.addEventListener("scores_prev", highscoresPrev);
highscoresScreen.addEventListener("show_facebook_scores", showFacebookScores);
highscoresScreen.addEventListener("show_all_scores", showAllScores);
} else {
Tracker.kvEvent(7130);
_local2 = new URLRequest(("http://www.britainsbestbrain.com/brainscore.php?page=" + scorePage));
navigateToURL(_local2, windowTarget);
nextGame();
};
}
private function highscoresNext(_arg1:Event):void{
scorePage++;
highscoresScreen.buttonBack.visible = false;
highscores.visible = false;
highscores.getScores(scorePage);
}
private function loadAvatar(_arg1:String, _arg2:MovieClip):void{
var _local3:LoaderContext;
var _local4:Loader;
_local3 = new LoaderContext();
_local3.checkPolicyFile = true;
_local4 = new Loader();
_local4.contentLoaderInfo.addEventListener(Event.COMPLETE, onAvatarLoaded);
_local4.load(new URLRequest(_arg1), _local3);
_arg2.addChildAt(_local4, 1);
}
}
}//package
Section 242
//MemoryGame (MemoryGame)
package {
import gs.*;
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import gs.easing.*;
import flash.media.*;
public class MemoryGame extends MovieClip {
private const INTERMISSION_TIME:uint = 10;
private const NUM_PAIRS:uint = 10;
private const ANSWER_TIME:uint = 10;
private var sfxClick:Sound;
private var sfxCorrect:Sound;
private var currPair:uint;
private var sfxTimeUp:Sound;
public var intermission:MovieClip;
private var timer:Timer;
private var soundChannel:SoundChannel;
private var userAnswer:int;
public var cards:MovieClip;
private var sfxWhoosh:Sound;
public var resultBox:MovieClip;
public var gameTimer:MovieClip;
public var score:int;
public var instructions:MovieClip;
public var options:MovieClip;
private var sfxIncorrect:Sound;
private var answerTimerCount:Number;
private var intermissionCount:int;
private var pairs:Array;
public function MemoryGame():void{
sfxClick = new SFXClick();
sfxCorrect = new SFXCorrect();
sfxIncorrect = new SFXIncorrect();
sfxTimeUp = new SFXTimeUp();
sfxWhoosh = new SFXShortWhoosh();
soundChannel = sfxWhoosh.play();
score = 0;
instructions.visible = false;
instructions.alpha = 0;
instructions.buttonContinue.addEventListener(MouseEvent.MOUSE_UP, closeInstructions);
cards.gotoAndStop("off");
options.gotoAndStop("off");
resultBox.gotoAndStop("off");
intermission.visible = false;
gameTimer.gotoAndStop("off");
gameTimer.timer.bar.gotoAndStop("memory");
}
private function onOptionsShown(_arg1:Event):void{
options.removeEventListener("options_on", onOptionsShown);
shuffle(pairs);
currPair = 0;
gameTimer.gotoAndPlay("in");
gameTimer.timer.bar.scaleX = 1;
answerTimerCount = ANSWER_TIME;
timer = new Timer(10);
timer.addEventListener(TimerEvent.TIMER, onTimerUpdate);
cards.addEventListener("landmark_shown", onLandmarkShown);
cards.addEventListener("next_landmark", onNextLandmark);
showCard(currPair);
}
private function onLandmarkShown(_arg1:Event):void{
var _local2:uint;
_local2 = 0;
while (_local2 < NUM_PAIRS) {
options[("obj" + (_local2 + 1))].mouseEnabled = true;
_local2++;
};
}
private function onIntermissionSecond(_arg1:TimerEvent):void{
intermissionCount = (intermissionCount - 1);
if (intermissionCount < 0){
TweenLite.to(intermission, 0.5, {autoAlpha:0, ease:Cubic.easeOut, onComplete:startMatching});
timer.removeEventListener(TimerEvent.TIMER, onIntermissionSecond);
timer.stop();
} else {
intermission.countdown.text = intermissionCount;
};
}
private function onTimerUpdate(_arg1:TimerEvent):void{
answerTimerCount = (answerTimerCount - 0.01);
if (answerTimerCount < 0){
answerTimeUp();
} else {
gameTimer.timer.bar.scaleX = (answerTimerCount / ANSWER_TIME);
};
}
public function initGame():void{
soundChannel = sfxWhoosh.play();
TweenLite.to(instructions, 0.5, {autoAlpha:1, delay:1, ease:Cubic.easeOut});
}
private function onPairShown(_arg1:Event):void{
currPair++;
if (currPair < NUM_PAIRS){
showPair(currPair);
} else {
cards.removeEventListener("pair_shown", onPairShown);
cards.gotoAndStop("off");
startIntermission();
};
}
private function startGame(_arg1:Event=null):void{
var _local2:Array;
var _local3:uint;
var _local4:uint;
pairs = new Array();
currPair = 0;
_local2 = new Array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30);
_local3 = 0;
while (_local3 < NUM_PAIRS) {
_local4 = Math.floor((Math.random() * _local2.length));
pairs.push(_local2[_local4]);
_local2.splice(_local4, 1);
_local3++;
};
showPair(currPair);
}
private function startMatching():void{
var _local1:uint;
shuffle(pairs);
_local1 = 0;
while (_local1 < NUM_PAIRS) {
options[("obj" + (_local1 + 1))].object.gotoAndStop(pairs[_local1]);
options[("obj" + (_local1 + 1))].mouseEnabled = false;
options[("obj" + (_local1 + 1))].id = pairs[_local1];
options[("obj" + (_local1 + 1))].addEventListener(MouseEvent.MOUSE_UP, answerSelected);
_local1++;
};
options.gotoAndPlay("in");
options.addEventListener("options_on", onOptionsShown);
}
private function answerSelected(_arg1:MouseEvent):void{
soundChannel = sfxClick.play();
userAnswer = _arg1.target.id;
checkAnswer();
}
private function answerTimeUp():void{
soundChannel = sfxTimeUp.play();
userAnswer = -1;
checkAnswer();
}
private function showPair(_arg1:uint):void{
cards.landmark.gotoAndStop(pairs[currPair]);
cards.object.gotoAndStop(pairs[currPair]);
cards.addEventListener("pair_shown", onPairShown);
cards.gotoAndPlay("show in");
}
private function closeInstructions(_arg1:Event=null):void{
instructions.buttonContinue.removeEventListener(MouseEvent.MOUSE_UP, closeInstructions);
soundChannel = sfxClick.play();
TweenLite.to(instructions, 0.5, {autoAlpha:0, ease:Cubic.easeOut, onComplete:startGame});
}
private function startIntermission():void{
intermission.countdown.text = (intermissionCount = INTERMISSION_TIME);
intermission.visible = true;
intermission.alpha = 0;
TweenLite.to(intermission, 0.5, {autoAlpha:1, ease:Cubic.easeOut});
timer = new Timer(1000);
timer.addEventListener(TimerEvent.TIMER, onIntermissionSecond);
timer.start();
}
private function showCard(_arg1:uint):void{
timer.start();
cards.landmark.gotoAndStop(pairs[currPair]);
cards.object.gotoAndStop(pairs[currPair]);
cards.gotoAndPlay("landmark in");
}
private function onNextLandmark(_arg1:Event):void{
currPair++;
if (currPair < NUM_PAIRS){
showCard(currPair);
} else {
timer.removeEventListener(TimerEvent.TIMER, onTimerUpdate);
cards.removeEventListener("landmark_shown", onLandmarkShown);
cards.removeEventListener("next_landmark", onNextLandmark);
dispatchEvent(new Event("game_complete"));
};
}
public function cleanUp():void{
var _local1:uint;
if (timer != null){
timer.removeEventListener(TimerEvent.TIMER, onIntermissionSecond);
};
if (timer != null){
timer.removeEventListener(TimerEvent.TIMER, onTimerUpdate);
};
options.removeEventListener("options_on", onOptionsShown);
cards.removeEventListener("landmark_shown", onLandmarkShown);
cards.removeEventListener("next_landmark", onNextLandmark);
cards.removeEventListener("pair_shown", onPairShown);
_local1 = 0;
while (_local1 < NUM_PAIRS) {
options[("obj" + (_local1 + 1))].removeEventListener(MouseEvent.MOUSE_UP, answerSelected);
_local1++;
};
TweenLite.killTweensOf(instructions);
TweenLite.killTweensOf(intermission);
}
private function checkAnswer():void{
var _local1:uint;
_local1 = 0;
while (_local1 < NUM_PAIRS) {
options[("obj" + (_local1 + 1))].mouseEnabled = false;
_local1++;
};
if (userAnswer == pairs[currPair]){
soundChannel = sfxCorrect.play();
score = (score + ((answerTimerCount / ANSWER_TIME) * 30));
resultBox.gotoAndPlay("correct");
} else {
soundChannel = sfxIncorrect.play();
resultBox.gotoAndPlay("incorrect");
};
cards.gotoAndPlay("object in");
timer.stop();
timer.reset();
answerTimerCount = ANSWER_TIME;
}
private function shuffle(_arg1:Array, _arg2:int=0):void{
var _local3:Array;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
_local3 = new Array();
_local4 = _arg1.length;
_local5 = 0;
while (_local5 < _local4) {
_local7 = Math.floor((Math.random() * _arg1.length));
_local3.push(_arg1[_local7]);
_arg1.splice(_local7, 1);
_local5++;
};
if (_arg2 == 0){
_arg2 = _local4;
};
_local6 = 0;
while (_local6 < _arg2) {
_arg1[_local6] = _local3[_local6];
_local6++;
};
}
}
}//package
Section 243
//MemoryGameIntro (MemoryGameIntro)
package {
import flash.events.*;
import flash.display.*;
public dynamic class MemoryGameIntro extends MovieClip {
public function MemoryGameIntro(){
addFrameScript(63, frame64, 79, frame80);
}
function frame64(){
dispatchEvent(new Event("start_game"));
}
function frame80(){
dispatchEvent(new Event("intro_complete"));
}
}
}//package
Section 244
//OptionButton (OptionButton)
package {
import com.fishinabottle.*;
public dynamic class OptionButton extends BasicButton {
}
}//package
Section 245
//PlayButton (PlayButton)
package {
import com.fishinabottle.*;
public dynamic class PlayButton extends BasicButton {
}
}//package
Section 246
//RecognitionGame (RecognitionGame)
package {
import gs.*;
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import gs.easing.*;
import flash.media.*;
public class RecognitionGame extends MovieClip {
private const NUM_SHAPES:uint = 20;
private const EASY_MIN:uint = 1;
private const MEDIUM_MIN:uint = 21;
private const NUM_ROUNDS:int = 3;
private const ANSWER_TIME:uint = 10;
private const ROUND_LENGTH:int = 3;
private const HARD_MIN:uint = 41;
public var options:MovieClip;
private var sfxClick:Sound;
private var sfxCorrect:Sound;
private var sfxTimeUp:Sound;
private var currQuestion:int;
private var timer:Timer;
private var soundChannel:SoundChannel;
private var userAnswer:int;
private var sfxWhoosh:Sound;
private var currRound:int;
public var resultBox:MovieClip;
public var score:int;
private var userShapes:Array;
private var sfxIncorrect:Sound;
public var instructions:MovieClip;
public var gameTimer:MovieClip;
private var optionShapes:Array;
private var answerTimerCount:Number;
private var currShapes:Array;
public var roundPopUp:MovieClip;
public var shapes:MovieClip;
public function RecognitionGame():void{
var _local1:uint;
super();
sfxClick = new SFXClick();
sfxCorrect = new SFXCorrect();
sfxIncorrect = new SFXIncorrect();
sfxTimeUp = new SFXTimeUp();
sfxWhoosh = new SFXShortWhoosh();
soundChannel = sfxWhoosh.play();
score = 0;
instructions.visible = false;
instructions.alpha = 0;
instructions.buttonContinue.addEventListener(MouseEvent.MOUSE_UP, closeInstructions);
resultBox.gotoAndStop("off");
resultBox.addEventListener("next_question", nextQuestion);
roundPopUp.gotoAndStop("off");
roundPopUp.addEventListener("popup_complete", startRound);
gameTimer.gotoAndStop("off");
gameTimer.timer.bar.gotoAndStop("recognition");
shapes.visible = false;
_local1 = 0;
while (_local1 < 9) {
options.panel[("shape" + (_local1 + 1))].mouseChildren = false;
options.panel[("shape" + (_local1 + 1))].addEventListener(MouseEvent.MOUSE_UP, answerSelected);
_local1++;
};
}
private function nextQuestion(_arg1:Event=null):void{
currQuestion++;
options.gotoAndPlay("out");
options.addEventListener("options_out", questionOut);
shapes.visible = false;
}
private function shuffle(_arg1:Array, _arg2:int=0):void{
var _local3:Array;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
_local3 = new Array();
_local4 = _arg1.length;
_local5 = 0;
while (_local5 < _local4) {
_local7 = Math.floor((Math.random() * _arg1.length));
_local3.push(_arg1[_local7]);
_arg1.splice(_local7, 1);
_local5++;
};
if (_arg2 == 0){
_arg2 = _local4;
};
_local6 = 0;
while (_local6 < _arg2) {
_arg1[_local6] = _local3[_local6];
_local6++;
};
}
private function showQuestion():void{
var _local1:Array;
var _local2:uint;
var _local3:uint;
var _local4:uint;
var _local5:uint;
var _local6:uint;
optionShapes = new Array();
currShapes = new Array();
userShapes = new Array();
_local1 = new Array();
if (currRound == 0){
_local2 = EASY_MIN;
} else {
if (currRound == 1){
_local2 = MEDIUM_MIN;
} else {
if (currRound == 2){
_local2 = HARD_MIN;
};
};
};
_local3 = _local2;
while (_local3 < (_local2 + NUM_SHAPES)) {
_local1.push(_local3);
_local3++;
};
_local4 = 0;
while (_local4 < 9) {
_local6 = Math.floor((Math.random() * _local1.length));
if (_local4 < 3){
currShapes[_local4] = _local1[_local6];
shapes[("shape" + (_local4 + 1))].gotoAndStop(currShapes[_local4]);
shapes[("shape" + (_local4 + 1))].rotation = (Math.floor((Math.random() * 4)) * 90);
};
optionShapes[_local4] = _local1[_local6];
_local1.splice(_local6, 1);
_local4++;
};
shapes.visible = true;
shuffle(optionShapes);
_local5 = 0;
while (_local5 < optionShapes.length) {
options.panel[("shape" + (_local5 + 1))].id = optionShapes[_local5];
options.panel[("shape" + (_local5 + 1))].shape.gotoAndStop(optionShapes[_local5]);
options.panel[("shape" + (_local5 + 1))].select.visible = false;
options.panel[("shape" + (_local5 + 1))].mouseEnabled = false;
_local5++;
};
options.gotoAndPlay("in");
options.addEventListener("options_in", questionReady);
}
public function initGame():void{
soundChannel = sfxWhoosh.play();
TweenLite.to(instructions, 0.5, {autoAlpha:1, delay:1, ease:Cubic.easeOut});
}
private function onTimerUpdate(_arg1:TimerEvent):void{
answerTimerCount = (answerTimerCount - 0.01);
if (answerTimerCount < 0){
answerTimeUp();
} else {
gameTimer.timer.bar.scaleX = (answerTimerCount / ANSWER_TIME);
};
}
private function startRound(_arg1:Event):void{
showQuestion();
}
private function nextRound():void{
roundPopUp.popText.msg.text = ("ROUND " + (currRound + 1));
roundPopUp.gotoAndPlay("on");
}
private function questionReady(_arg1:Event=null):void{
var _local2:uint;
options.removeEventListener("options_in", questionReady);
_local2 = 0;
while (_local2 < 9) {
options.panel[("shape" + (_local2 + 1))].mouseEnabled = true;
_local2++;
};
timer.start();
}
private function startGame(_arg1:Event=null):void{
gameTimer.gotoAndPlay("in");
gameTimer.timer.bar.scaleX = 1;
answerTimerCount = ANSWER_TIME;
timer = new Timer(10);
timer.addEventListener(TimerEvent.TIMER, onTimerUpdate);
nextRound();
}
private function gameComplete():void{
timer.removeEventListener(TimerEvent.TIMER, onTimerUpdate);
resultBox.removeEventListener("next_question", nextQuestion);
roundPopUp.removeEventListener("popup_complete", startRound);
dispatchEvent(new Event("game_complete"));
}
private function answerSelected(_arg1:MouseEvent):void{
var _local2:uint;
soundChannel = sfxClick.play();
_arg1.target.mouseEnabled = false;
_arg1.target.select.visible = true;
userShapes.push(_arg1.target.id);
if (userShapes.length == 3){
_local2 = 0;
while (_local2 < 9) {
options.panel[("shape" + (_local2 + 1))].mouseEnabled = false;
_local2++;
};
checkAnswer();
};
}
private function answerTimeUp():void{
soundChannel = sfxTimeUp.play();
userAnswer = -1;
checkAnswer();
}
private function questionOut(_arg1:Event=null):void{
options.removeEventListener("options_out", questionOut);
if (currQuestion < ROUND_LENGTH){
showQuestion();
} else {
currQuestion = 0;
currRound++;
if (currRound < NUM_ROUNDS){
nextRound();
} else {
gameComplete();
};
};
}
private function closeInstructions(_arg1:Event=null):void{
instructions.buttonContinue.removeEventListener(MouseEvent.MOUSE_UP, closeInstructions);
soundChannel = sfxClick.play();
TweenLite.to(instructions, 0.5, {autoAlpha:0, ease:Cubic.easeOut, onComplete:startGame});
}
private function checkAnswer():void{
var _local1:uint;
var _local2:uint;
var _local3:uint;
_local1 = 0;
_local2 = 0;
while (_local2 < 3) {
_local3 = 0;
while (_local3 < 3) {
if (userShapes[_local2] == currShapes[_local3]){
_local1 = (_local1 + 1);
};
_local3++;
};
_local2++;
};
if (_local1 == 3){
soundChannel = sfxCorrect.play();
score = (score + ((answerTimerCount / ANSWER_TIME) * 33));
resultBox.gotoAndPlay("correct");
} else {
soundChannel = sfxIncorrect.play();
resultBox.gotoAndPlay("incorrect");
};
timer.stop();
timer.reset();
answerTimerCount = ANSWER_TIME;
}
public function cleanUp():void{
var _local1:uint;
resultBox.removeEventListener("next_question", nextQuestion);
roundPopUp.removeEventListener("popup_complete", startRound);
if (timer != null){
timer.removeEventListener(TimerEvent.TIMER, onTimerUpdate);
};
options.removeEventListener("options_out", questionOut);
options.removeEventListener("options_in", questionReady);
_local1 = 0;
while (_local1 < 9) {
options.panel[("shape" + (_local1 + 1))].removeEventListener(MouseEvent.MOUSE_UP, answerSelected);
_local1++;
};
TweenLite.killTweensOf(instructions);
}
}
}//package
Section 247
//RecognitionGameIntro (RecognitionGameIntro)
package {
import flash.events.*;
import flash.display.*;
public dynamic class RecognitionGameIntro extends MovieClip {
public function RecognitionGameIntro(){
addFrameScript(76, frame77, 92, frame93);
}
function frame77(){
dispatchEvent(new Event("start_game"));
}
function frame93(){
dispatchEvent(new Event("intro_complete"));
}
}
}//package
Section 248
//ResultsScreen (ResultsScreen)
package {
import gs.*;
import flash.events.*;
import flash.display.*;
import gs.easing.*;
import flash.media.*;
public class ResultsScreen extends MovieClip {
private var sfxClick:Sound;
public var anim:MovieClip;
private var soundChannel:SoundChannel;
public var gameComplete:MovieClip;
private var sfxWhoosh:Sound;
public var transition:MovieClip;
public var submitBox:MovieClip;
private var gameID:int;
private var sfxChime:Sound;
public var table:MovieClip;
public var gameScore:int;
public var player:String;
public var buttonContinue:MovieClip;
public function ResultsScreen():void{
sfxClick = new SFXClick();
sfxWhoosh = new SFXShortWhoosh();
sfxChime = new SFXTimeUp();
soundChannel = new SoundChannel();
anim.gotoAndStop(17);
anim.addEventListener("in_complete", onAnimIn);
anim.addEventListener("out_complete", onAnimOut);
transition.visible = false;
transition.stop();
transition.addEventListener("transition_complete", onTransitionComplete);
submitBox.visible = false;
submitBox.alpha = 0;
submitBox.buttonBack.addEventListener(MouseEvent.MOUSE_UP, onBackClicked);
submitBox.buttonSubmit.addEventListener(MouseEvent.MOUSE_UP, onSubmitClicked);
submitBox.buttonViewHighscores.visible = false;
submitBox.buttonViewHighscores.addEventListener(MouseEvent.MOUSE_UP, onViewHighscores);
submitBox.messageSent.visible = false;
submitBox.messageSending.visible = false;
submitBox.messageRank.visible = false;
submitBox.messageFailed.visible = false;
submitBox.buttonChallenge.visible = false;
submitBox.buttonChallenge.addEventListener(MouseEvent.MOUSE_UP, onChallenge);
gameComplete.visible = false;
gameComplete.alpha = 0;
}
private function onBackClicked(_arg1:Event):void{
soundChannel = sfxClick.play();
submitBox.visible = false;
dispatchEvent(new Event("next_game"));
}
private function onChallenge(_arg1:Event):void{
soundChannel = sfxClick.play();
dispatchEvent(new Event("challenge_friends"));
}
private function onSubmitClicked(_arg1:Event):void{
if (submitBox.inputName.text == ""){
return;
};
soundChannel = sfxClick.play();
player = submitBox.inputName.text;
submitBox.inputName.visible = false;
submitBox.inputBox.visible = false;
submitBox.buttonSubmit.visible = false;
submitBox.buttonBack.visible = false;
submitBox.messageEnterName.visible = false;
submitBox.messageSending.visible = true;
dispatchEvent(new Event("submit_score"));
}
public function startTransition(_arg1:Bitmap):void{
soundChannel = sfxWhoosh.play();
transition.bmpHolder.addChild(_arg1);
transition.visible = true;
transition.play();
}
public function showScore(_arg1:int, _arg2:int=0):void{
soundChannel = sfxChime.play();
visible = true;
table.visible = false;
buttonContinue.visible = false;
anim.gotoAndPlay("in");
gameID = _arg1;
gameScore = _arg2;
}
private function showFinalScore(_arg1:Event):void{
var _local2:uint;
gameComplete.buttonContinue.removeEventListener(MouseEvent.MOUSE_UP, showFinalScore);
gameComplete.visible = false;
_local2 = ((((int(table.score1.score.text) + int(table.score2.score.text)) + int(table.score3.score.text)) + int(table.score4.score.text)) + int(table.score5.score.text));
submitBox.score.text = _local2;
gameScore = _local2;
TweenLite.to(submitBox, 0.5, {autoAlpha:1, ease:Cubic.easeOut});
submitBox.inputName.text = "";
submitBox.inputName.stage.focus = submitBox.inputName;
dispatchEvent(new Event("final_score_shown"));
}
private function onViewHighscores(_arg1:Event):void{
soundChannel = sfxClick.play();
submitBox.visible = false;
dispatchEvent(new Event("view_score"));
}
private function onContinue(_arg1:MouseEvent):void{
soundChannel = sfxClick.play();
table.visible = false;
buttonContinue.visible = false;
anim.gotoAndPlay("out");
}
private function onAnimOut(_arg1:Event):void{
if (gameID < 4){
dispatchEvent(new Event("next_game"));
} else {
gameComplete.visible = true;
gameComplete.buttonContinue.addEventListener(MouseEvent.MOUSE_UP, showFinalScore);
TweenLite.to(gameComplete, 0.5, {autoAlpha:1, ease:Cubic.easeOut});
};
}
private function onAnimIn(_arg1:Event):void{
table.visible = true;
table[("score" + (gameID + 1))].score.text = gameScore;
table.gotoAndPlay(("game" + (gameID + 1)));
table.addEventListener("score_shown", onScoreShown);
buttonContinue.visible = false;
buttonContinue.addEventListener(MouseEvent.MOUSE_UP, onContinue);
}
private function onScoreShown(_arg1:Event):void{
buttonContinue.visible = true;
}
private function onTransitionComplete(_arg1:Event):void{
transition.visible = false;
}
}
}//package
Section 249
//RiskGame (RiskGame)
package {
import gs.*;
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import gs.easing.*;
import flash.media.*;
public class RiskGame extends MovieClip {
private var isInflating:Boolean;// = false
public var guide:MovieClip;
private var sfxClick:Sound;
private var sfxCorrect:Sound;
public var balloon:MovieClip;
public var failed:MovieClip;
private var timer:Timer;
private var soundChannel:SoundChannel;
private var released:uint;
private var sfxBang:Sound;
public var buttonAnim:MovieClip;
private var max:uint;
private var answerTimerCount:Number;
public var gameTimer:MovieClip;
private var sfxWhoosh:Sound;
public var score:int;
public var percentage:MovieClip;
public var marker:MovieClip;
public var buttonBalloon:MovieClip;
private var sfxIncorrect:Sound;
public var instructions:MovieClip;
public function RiskGame():void{
isInflating = false;
super();
sfxClick = new SFXClick();
sfxCorrect = new SFXCorrect();
sfxIncorrect = new SFXIncorrect();
sfxBang = new SFXBang();
sfxWhoosh = new SFXShortWhoosh();
soundChannel = sfxWhoosh.play();
score = 0;
instructions.visible = false;
instructions.alpha = 0;
instructions.buttonContinue.addEventListener(MouseEvent.MOUSE_UP, closeInstructions);
gameTimer.gotoAndStop("off");
gameTimer.timer.bar.gotoAndStop("risk");
buttonBalloon.visible = false;
buttonBalloon.mouseChildren = false;
buttonBalloon.addEventListener(MouseEvent.MOUSE_DOWN, startInflate);
buttonBalloon.addEventListener(MouseEvent.MOUSE_UP, stopInflate);
buttonAnim.gotoAndStop("off");
guide.gotoAndStop("off");
marker.gotoAndStop("off");
marker.visible = false;
marker.alpha = 0;
percentage.visible = false;
percentage.alpha = 0;
failed.visible = false;
failed.alpha = 0;
}
public function initGame(_arg1:Event=null):void{
soundChannel = sfxWhoosh.play();
TweenLite.to(instructions, 0.5, {autoAlpha:1, delay:0.25, ease:Cubic.easeOut});
}
private function onButtonReady(_arg1:Event=null):void{
buttonBalloon.visible = true;
}
private function onFrameUpdate(_arg1:Event):void{
percentage.perc.text = (Math.floor(((released / balloon.anim.currentFrame) * 100)) + "%");
if (balloon.anim.currentFrame >= max){
explode();
};
}
private function onExplodeComplete(_arg1:Event):void{
balloon.gotoAndStop("off");
balloon.visible = false;
balloon.removeEventListener("explode_complete", onExplodeComplete);
dispatchEvent(new Event("game_complete"));
}
private function onGuideReady(_arg1:Event=null):void{
guide.removeEventListener("guide_in", onGuideReady);
buttonAnim.addEventListener("button_in", onButtonReady);
buttonAnim.gotoAndPlay("in");
}
private function startGame(_arg1:Event=null):void{
addEventListener(Event.ENTER_FRAME, onFrameUpdate);
max = (150 + Math.floor((Math.random() * 200)));
released = 1;
guide.gotoAndPlay("in");
guide.addEventListener("guide_in", onGuideReady);
}
private function startInflate(_arg1:MouseEvent):void{
isInflating = true;
soundChannel = sfxClick.play();
buttonAnim.button.gotoAndStop("on");
balloon.anim.gotoAndPlay("start");
balloon.addEventListener("explode_complete", onExplodeComplete);
}
private function closeInstructions(_arg1:Event=null):void{
instructions.buttonContinue.removeEventListener(MouseEvent.MOUSE_UP, closeInstructions);
soundChannel = sfxClick.play();
TweenLite.to(instructions, 0.5, {autoAlpha:0, ease:Cubic.easeOut, onComplete:startGame});
}
private function stopInflate(_arg1:MouseEvent):void{
if (!isInflating){
return;
};
soundChannel = sfxCorrect.play();
marker.gotoAndStop(balloon.anim.currentFrame);
TweenLite.to(marker, 0.25, {autoAlpha:1, ease:Cubic.easeOut});
released = balloon.anim.currentFrame;
score = ((released / max) * 300);
TweenLite.to(percentage, 0.25, {autoAlpha:1, ease:Cubic.easeOut});
buttonBalloon.visible = false;
buttonAnim.visible = false;
}
public function cleanUp():void{
buttonBalloon.removeEventListener(MouseEvent.MOUSE_DOWN, startInflate);
buttonBalloon.removeEventListener(MouseEvent.MOUSE_UP, stopInflate);
buttonAnim.removeEventListener("button_in", onButtonReady);
balloon.removeEventListener("explode_complete", onExplodeComplete);
removeEventListener(Event.ENTER_FRAME, onFrameUpdate);
guide.removeEventListener("guide_in", onGuideReady);
TweenLite.killTweensOf(instructions);
TweenLite.killTweensOf(marker);
TweenLite.killTweensOf(percentage);
TweenLite.killTweensOf(failed);
}
private function explode():void{
isInflating = false;
balloon.anim.stop();
balloon.gotoAndPlay("explode");
soundChannel = sfxBang.play();
buttonBalloon.visible = false;
buttonAnim.visible = false;
removeEventListener(Event.ENTER_FRAME, onFrameUpdate);
if (released == 1){
score = 0;
TweenLite.to(failed, 0.25, {autoAlpha:1, delay:1.5, ease:Cubic.easeOut});
soundChannel = sfxIncorrect.play();
};
}
}
}//package
Section 250
//RiskGameIntro (RiskGameIntro)
package {
import flash.events.*;
import flash.display.*;
public dynamic class RiskGameIntro extends MovieClip {
public function RiskGameIntro(){
addFrameScript(54, frame55, 70, frame71);
}
function frame71(){
dispatchEvent(new Event("intro_complete"));
}
function frame55(){
dispatchEvent(new Event("start_game"));
}
}
}//package
Section 251
//ScoresButton (ScoresButton)
package {
import com.fishinabottle.*;
public dynamic class ScoresButton extends BasicButton {
}
}//package
Section 252
//SendButton (SendButton)
package {
import com.fishinabottle.*;
public dynamic class SendButton extends BasicButton {
}
}//package
Section 253
//SendToFriendScreen (SendToFriendScreen)
package {
import flash.events.*;
import flash.display.*;
import flash.net.*;
import gs.easing.*;
import flash.media.*;
public class SendToFriendScreen extends MovieClip {
private const SEND_TO_FRIEND_URL:String = "http://service.fishinabottle.com/challenge/britainsbestbrain/send_mail.php";
private var sfxClick:Sound;
private var soundChannel:SoundChannel;
public var buttonBack:MovieClip;
private var sfxWhoosh:Sound;
public var transition:MovieClip;
public var form:MovieClip;
public function SendToFriendScreen():void{
sfxClick = new SFXClick();
sfxWhoosh = new SFXShortWhoosh();
soundChannel = new SoundChannel();
transition.visible = false;
transition.stop();
transition.addEventListener("transition_complete", onTransitionComplete);
form.messageSending.visible = false;
form.messageSent.visible = false;
form.messageFailed.visible = false;
form.noName.gotoAndStop(1);
form.noEmail1.gotoAndStop(1);
form.noEmail2.gotoAndStop(1);
buttonBack.addEventListener(MouseEvent.MOUSE_UP, onBackClicked);
form.buttonSubmit.addEventListener(MouseEvent.MOUSE_UP, onSubmitClicked);
}
private function onMessageReceived(_arg1:Event):Boolean{
var _local2:URLLoader;
_local2 = URLLoader(_arg1.target);
_local2.removeEventListener(Event.COMPLETE, onMessageReceived);
_local2.removeEventListener(IOErrorEvent.IO_ERROR, onMessageIOError);
if (_local2.data.res == "0"){
trace("Error posting data");
form.messageSending.visible = false;
form.messageFailed.visible = true;
buttonBack.visible = true;
return (false);
};
form.messageSending.visible = false;
form.messageSent.visible = true;
buttonBack.visible = true;
return (true);
}
private function validateEmail(_arg1:String):Boolean{
var _local2:Number;
var _local3:Number;
trace(_arg1);
if (_arg1.length < 9){
return (false);
};
_local2 = _arg1.indexOf("@");
if (_local2 == -1){
return (false);
};
if (_local2 < 2){
return (false);
};
_local3 = _arg1.lastIndexOf(".");
if (_local3 == -1){
return (false);
};
if (((!((_local3 == (_arg1.length - 3)))) && (!((_local3 == (_arg1.length - 4)))))){
return (false);
};
if (Math.abs((_local3 - _local2)) < 2){
return (false);
};
return (true);
}
private function onSubmitClicked(_arg1:MouseEvent):void{
soundChannel = sfxClick.play();
buttonBack.visible = false;
sendMessage();
}
public function startTransition(_arg1:Bitmap):void{
soundChannel = sfxWhoosh.play();
transition.bmpHolder.addChild(_arg1);
transition.visible = true;
transition.play();
}
private function sendMessage():Boolean{
var _local1:URLVariables;
var _local2:URLRequest;
var _local3:URLLoader;
if (form.inputName.text == ""){
form.noName.play();
return (false);
};
if (!validateEmail(form.inputEmail1.text)){
form.noEmail1.play();
return (false);
};
if (!validateEmail(form.inputEmail2.text)){
form.noEmail2.play();
return (false);
};
_local1 = new URLVariables();
_local1.fromName = form.inputName.text;
_local1.fromAddr = form.inputEmail1.text;
_local1.toAddr = form.inputEmail2.text;
_local2 = new URLRequest(SEND_TO_FRIEND_URL);
_local3 = new URLLoader();
_local3.dataFormat = URLLoaderDataFormat.VARIABLES;
_local2.data = _local1;
_local2.method = URLRequestMethod.POST;
_local3.addEventListener(Event.COMPLETE, onMessageReceived);
_local3.addEventListener(IOErrorEvent.IO_ERROR, onMessageIOError);
_local3.load(_local2);
sending();
return (true);
}
private function onMessageIOError(_arg1:IOErrorEvent):void{
var _local2:URLLoader;
_local2 = URLLoader(_arg1.target);
trace("Error contacting server");
form.messageSending.visible = false;
form.messageFailed.visible = true;
buttonBack.visible = true;
_local2.removeEventListener(Event.COMPLETE, onMessageReceived);
_local2.removeEventListener(IOErrorEvent.IO_ERROR, onMessageIOError);
}
private function sending():void{
form.buttonSubmit.mouseEnabled = false;
form.messageSending.visible = true;
}
private function onBackClicked(_arg1:MouseEvent):void{
soundChannel = sfxClick.play();
dispatchEvent(new Event("close_send"));
}
private function onTransitionComplete(_arg1:Event):void{
transition.visible = false;
form.inputName.stage.focus = form.inputName;
}
}
}//package
Section 254
//SFXBang (SFXBang)
package {
import flash.media.*;
public dynamic class SFXBang extends Sound {
}
}//package
Section 255
//SFXClick (SFXClick)
package {
import flash.media.*;
public dynamic class SFXClick extends Sound {
}
}//package
Section 256
//SFXCorrect (SFXCorrect)
package {
import flash.media.*;
public dynamic class SFXCorrect extends Sound {
}
}//package
Section 257
//SFXHighscores (SFXHighscores)
package {
import flash.media.*;
public dynamic class SFXHighscores extends Sound {
}
}//package
Section 258
//SFXIncorrect (SFXIncorrect)
package {
import flash.media.*;
public dynamic class SFXIncorrect extends Sound {
}
}//package
Section 259
//SFXIntro (SFXIntro)
package {
import flash.media.*;
public dynamic class SFXIntro extends Sound {
}
}//package
Section 260
//SFXShortWhoosh (SFXShortWhoosh)
package {
import flash.media.*;
public dynamic class SFXShortWhoosh extends Sound {
}
}//package
Section 261
//SFXTimeUp (SFXTimeUp)
package {
import flash.media.*;
public dynamic class SFXTimeUp extends Sound {
}
}//package
Section 262
//SFXWhoosh (SFXWhoosh)
package {
import flash.media.*;
public dynamic class SFXWhoosh extends Sound {
}
}//package
Section 263
//ShapeButton (ShapeButton)
package {
import com.fishinabottle.*;
public dynamic class ShapeButton extends BasicButton {
public function ShapeButton(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 264
//TitleScreen (TitleScreen)
package {
import gs.*;
import flash.events.*;
import flash.display.*;
import flash.net.*;
import gs.easing.*;
import flash.media.*;
import flash.text.*;
public class TitleScreen extends MovieClip {
public var buttonScores:MovieClip;
public var fbButton:MovieClip;
private var sfxClick:Sound;
public var anim:MovieClip;
private var soundChannel:SoundChannel;
public var fiabLink:MovieClip;
private var nextScreen:uint;
public var txDate:MovieClip;
public var debug:TextField;
public var nintendoLogo:MovieClip;
public var buttonPlay:MovieClip;
public var instructions:MovieClip;
public var fiveLink:MovieClip;
public var buttonSend:MovieClip;
private var sfxIntro:Sound;
public function TitleScreen():void{
var _local1:Date;
super();
sfxIntro = new SFXIntro();
sfxClick = new SFXClick();
soundChannel = new SoundChannel();
soundChannel = sfxIntro.play();
anim.gotoAndPlay("in");
anim.addEventListener("in_complete", showButtons);
anim.addEventListener("out_complete", showInstructions);
buttonPlay.gotoAndStop(1);
buttonScores.gotoAndStop(1);
buttonSend.gotoAndStop(1);
buttonPlay.buttonPlay.addEventListener(MouseEvent.MOUSE_UP, onPlayClicked);
buttonScores.buttonScores.addEventListener(MouseEvent.MOUSE_UP, onScoresClicked);
buttonSend.buttonSend.addEventListener(MouseEvent.MOUSE_UP, onSendClicked);
instructions.visible = false;
instructions.alpha = 0;
_local1 = new Date();
if (_local1.getTime() > 1261958400000){
instructions.intro.text = "This game is based on the popular TV show Britain’s Best Brain.\n\nIn it we’ll challenge the five core areas of your brain which deal with everyday tasks such as calculations, memory, co-ordination, recognition and risk.";
} else {
instructions.intro.text = "This game is based on the popular TV show Britain’s Best Brain (Wednesdays at 8pm on Five).\n\nIn it we’ll challenge the five core areas of your brain which deal with everyday tasks such as calculations, memory, co-ordination, recognition and risk.";
};
instructions.buttonContinue.addEventListener(MouseEvent.MOUSE_UP, closeInstructions);
fbButton.visible = false;
if (_local1.getTime() > 1261958400000){
txDate.visible = false;
} else {
txDate.visible = true;
};
txDate.gotoAndStop(1);
txDate.tvClip.fiveLogo.addEventListener(MouseEvent.MOUSE_UP, gotoFive);
txDate.tvClip.fiveLogo.buttonMode = true;
txDate.tvClip.fiveLogo.useHandCursor = true;
nintendoLogo.gotoAndStop(1);
fiabLink.gotoAndStop(1);
fiabLink.addEventListener(MouseEvent.MOUSE_UP, gotoFiab);
fiabLink.buttonMode = true;
fiabLink.useHandCursor = true;
fiveLink.gotoAndStop(1);
fiveLink.addEventListener(MouseEvent.MOUSE_UP, gotoFive);
fiveLink.buttonMode = true;
fiveLink.useHandCursor = true;
}
private function gotoFiab(_arg1:MouseEvent):void{
var _local2:URLRequest;
_local2 = new URLRequest("http://www.fishinabottle.com/");
navigateToURL(_local2, "_blank");
}
private function onScoresClicked(_arg1:MouseEvent):void{
nextScreen = 2;
gotoNext();
soundChannel.stop();
soundChannel = sfxClick.play();
}
private function onSendClicked(_arg1:MouseEvent):void{
nextScreen = 3;
gotoNext();
buttonPlay.visible = false;
buttonScores.visible = false;
buttonSend.visible = false;
soundChannel.stop();
soundChannel = sfxClick.play();
nintendoLogo.gotoAndPlay("off");
txDate.gotoAndPlay("off");
fiabLink.gotoAndPlay("off");
fiveLink.gotoAndPlay("off");
}
private function onPlayClicked(_arg1:MouseEvent):void{
nextScreen = 1;
anim.gotoAndPlay("out");
buttonPlay.visible = false;
buttonScores.visible = false;
buttonSend.visible = false;
soundChannel.stop();
soundChannel = sfxClick.play();
nintendoLogo.gotoAndPlay("off");
txDate.gotoAndPlay("off");
fiabLink.gotoAndPlay("off");
fiveLink.gotoAndPlay("off");
}
public function reset():void{
soundChannel = sfxIntro.play();
anim.gotoAndPlay("in");
anim.visible = true;
buttonPlay.gotoAndStop(1);
buttonScores.gotoAndStop(1);
buttonSend.gotoAndStop(1);
buttonPlay.visible = true;
buttonScores.visible = true;
buttonSend.visible = true;
nintendoLogo.gotoAndStop(1);
txDate.gotoAndStop(1);
fiabLink.gotoAndStop(1);
fiveLink.gotoAndStop(1);
}
public function showInstructions(_arg1:Event=null):void{
TweenLite.to(instructions, 0.5, {autoAlpha:1, ease:Cubic.easeOut});
anim.visible = false;
}
private function gotoFive(_arg1:MouseEvent):void{
var _local2:URLRequest;
_local2 = new URLRequest("http://www.five.tv/britainsbestbrain/");
navigateToURL(_local2, "_blank");
}
private function closeInstructions(_arg1:Event=null):void{
soundChannel = sfxClick.play();
TweenLite.to(instructions, 0.25, {autoAlpha:0, ease:Cubic.easeOut, onComplete:gotoNext});
}
private function nintendoLink(_arg1:MouseEvent):void{
var _local2:URLRequest;
_local2 = new URLRequest("http://www.nintendo.com/ds");
navigateToURL(_local2, "_blank");
}
private function showButtons(_arg1:Event):void{
buttonPlay.gotoAndPlay(1);
buttonScores.gotoAndPlay(1);
buttonSend.gotoAndPlay(1);
nintendoLogo.gotoAndPlay(2);
txDate.gotoAndPlay(2);
fiabLink.gotoAndPlay(2);
fiveLink.gotoAndPlay(2);
}
private function gotoNext(_arg1:Event=null):void{
switch (nextScreen){
case 1:
dispatchEvent(new Event("goto_game"));
break;
case 2:
dispatchEvent(new Event("goto_scores"));
break;
case 3:
dispatchEvent(new Event("goto_send"));
break;
};
}
}
}//package
Section 265
//Vector3D (Vector3D)
package {
public class Vector3D {
private const PI_OVER_D180:Number;
private const D180_OVER_PI:Number;
public var x:Number;
public var y:Number;
public var z:Number;
public function Vector3D(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0){
D180_OVER_PI = (180 / Math.PI);
PI_OVER_D180 = (Math.PI / 180);
super();
x = _arg1;
y = _arg2;
z = _arg3;
}
public function scale(_arg1:Number):void{
x = (x * _arg1);
y = (y * _arg1);
z = (z * _arg1);
}
public function addVector(_arg1:Vector3D):void{
x = (x + _arg1.x);
y = (y + _arg1.y);
z = (z + _arg1.z);
}
public function vector(_arg1:Number):void{
x = Math.sin((_arg1 * PI_OVER_D180));
z = -(Math.cos((_arg1 * PI_OVER_D180)));
}
public function dot(_arg1:Vector3D):Number{
var _local2:Number;
_local2 = (((x * _arg1.x) + (y * _arg1.y)) + (z * _arg1.z));
return (_local2);
}
public function angle(_arg1:Vector3D):Number{
var _local2:Number;
var _local3:Number;
var _local4:Number;
_local2 = dot(_arg1);
_local3 = magnitude();
_local4 = _arg1.magnitude();
return (0);
}
public function normalize():void{
var _local1:Number;
_local1 = magnitude();
x = (x / _local1);
y = (y / _local1);
z = (z / _local1);
}
public function magnitude():Number{
return (Math.sqrt((((x * x) + (y * y)) + (z * z))));
}
}
}//package