Section 1
//Action_20 (andagel_fla.Action_20)
package andagel_fla {
import flash.events.*;
import flash.filters.*;
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
import flash.text.*;
import flash.media.*;
import flash.ui.*;
import flash.net.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class Action_20 extends MovieClip {
public function Action_20(){
addFrameScript(0, frame1);
}
public function onComplete(_arg1:Event):void{
MovieClip(parent).gotoAndPlay("loaded");
}
public function progressHandler(_arg1:ProgressEvent):void{
var _local2:int;
_local2 = Math.round(((_arg1.target.bytesLoaded / _arg1.target.bytesTotal) * 100));
MovieClip(parent).gotoAndStop(_local2);
}
function frame1(){
MovieClip(root).stop();
if (root.loaderInfo.bytesLoaded == root.loaderInfo.bytesTotal){
MovieClip(parent).gotoAndPlay("loaded");
};
root.loaderInfo.addEventListener(ProgressEvent.PROGRESS, progressHandler);
root.loaderInfo.addEventListener(Event.COMPLETE, onComplete);
}
}
}//package andagel_fla
Section 2
//animations_161 (andagel_fla.animations_161)
package andagel_fla {
import flash.display.*;
public dynamic class animations_161 extends MovieClip {
public function animations_161(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package andagel_fla
Section 3
//avatarhealth_29 (andagel_fla.avatarhealth_29)
package andagel_fla {
import flash.display.*;
public dynamic class avatarhealth_29 extends MovieClip {
public var healthmask:MovieClip;
}
}//package andagel_fla
Section 4
//credit_75 (andagel_fla.credit_75)
package andagel_fla {
import flash.events.*;
import caurina.transitions.*;
import flash.display.*;
import flash.net.*;
public dynamic class credit_75 extends MovieClip {
public var credit4:MovieClip;
public var credit6:MovieClip;
public var credit1:MovieClip;
public var credit5:MovieClip;
public var credit8:MovieClip;
public var credit3:MovieClip;
public var anda:MovieClip;
public var credit7:MovieClip;
public var blk:MovieClip;
public var credit2:MovieClip;
public var gopo:SimpleButton;
public function credit_75(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 8, frame9, 9, frame10);
}
function frame10(){
stop();
gopo.addEventListener(MouseEvent.CLICK, goPro);
}
function frame1(){
stop();
Tweener.addTween(anda, {alpha:0, time:1, delay:5, transition:"easeOut"});
Tweener.addTween(blk, {alpha:0, time:1, delay:4, transition:"easeOut"});
}
function frame3(){
Tweener.addTween(credit2, {alpha:1, time:1, transition:"easeOut"});
}
function frame4(){
Tweener.addTween(credit3, {alpha:1, time:1, transition:"easeOut"});
}
function frame5(){
Tweener.addTween(credit4, {alpha:1, time:1, transition:"easeOut"});
}
function frame9(){
Tweener.addTween(credit8, {alpha:1, time:1, transition:"easeOut"});
}
function frame8(){
Tweener.addTween(credit7, {alpha:1, time:1, transition:"easeOut"});
}
function frame2(){
Tweener.addTween(credit1, {alpha:1, time:1, transition:"easeOut"});
}
function frame7(){
Tweener.addTween(credit6, {alpha:1, time:1, transition:"easeOut"});
}
public function goPro(_arg1:MouseEvent):void{
var _local2:String;
var _local3:URLRequest;
_local2 = "http://www.protopop.com/";
_local3 = new URLRequest(_local2);
navigateToURL(_local3, "_blank");
}
function frame6(){
Tweener.addTween(credit5, {alpha:1, time:1, transition:"easeOut"});
}
}
}//package andagel_fla
Section 5
//gun_143 (andagel_fla.gun_143)
package andagel_fla {
import flash.display.*;
public dynamic class gun_143 extends MovieClip {
public var aarm:MovieClip;
public var ahead:MovieClip;
public function gun_143(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package andagel_fla
Section 6
//HANDANIM_35 (andagel_fla.HANDANIM_35)
package andagel_fla {
import flash.display.*;
public dynamic class HANDANIM_35 extends MovieClip {
public function HANDANIM_35(){
addFrameScript(0, frame1, 154, frame155);
}
function frame155(){
stop();
}
function frame1(){
stop();
}
}
}//package andagel_fla
Section 7
//help1_106 (andagel_fla.help1_106)
package andagel_fla {
import flash.display.*;
public dynamic class help1_106 extends MovieClip {
public var msSens:MovieClip;
public var btFaster:SimpleButton;
public var btSlower:SimpleButton;
public var btGuide:SimpleButton;
public function help1_106(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package andagel_fla
Section 8
//HUD_27 (andagel_fla.HUD_27)
package andagel_fla {
import caurina.transitions.*;
import flash.display.*;
public dynamic class HUD_27 extends MovieClip {
public var optTit:MovieClip;
public var hudhealth:MovieClip;
public var titChem:MovieClip;
public var loadGame:SimpleButton;
public var rava:MovieClip;
public var titAndagel:MovieClip;
public var optPanel:MovieClip;
public var barBottom:MovieClip;
public var optYes:MovieClip;
public var healthbar:MovieClip;
public var optLoad:MovieClip;
public var mcInstructions:MovieClip;
public var optBg:MovieClip;
public var reticule:MovieClip;
public var mcAward:MovieClip;
public var quote:MovieClip;
public var hand:MovieClip;
public var optionsBt:SimpleButton;
public var crosshairs:MovieClip;
public var gunFlash:MovieClip;
public var optionsBt1:SimpleButton;
public var optionsBt2:SimpleButton;
public var blok:MovieClip;
public var btHelp:SimpleButton;
public var barTop:MovieClip;
public var legal:MovieClip;
public var optionsNo:SimpleButton;
public function HUD_27(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 7, frame8, 8, frame9, 9, frame10);
}
function frame6(){
Tweener.addTween(blok, {alpha:0, time:12, delay:2, transition:"easeIn"});
Tweener.addTween(titChem, {alpha:1, time:3, delay:1, transition:"easeIn"});
Tweener.addTween(titChem, {alpha:0, time:3, delay:6, transition:"easeIn"});
Tweener.addTween(quote, {alpha:0, time:3, delay:0, transition:"easeOutBack"});
Tweener.addTween(barTop, {x:320, y:40, time:2, transition:"easeOutExpo"});
}
function frame3(){
Tweener.addTween(optionsBt, {y:-60, alpha:0, time:1, delay:0, transition:"easeOutBack"});
Tweener.addTween(loadGame, {y:-100, alpha:0, time:1, delay:0.2, transition:"easeOutBack"});
Tweener.addTween(optionsBt2, {y:190, alpha:1, time:1, delay:0.1, transition:"easeOutBack"});
Tweener.addTween(optTit, {alpha:0, time:1, transition:"easeOutBack"});
Tweener.addTween(optionsNo, {y:260, alpha:1, time:1, delay:0.3, transition:"easeOutBack"});
Tweener.addTween(titAndagel, {alpha:0, time:1, transition:"easeOutBack"});
Tweener.addTween(optYes, {y:300, alpha:1, time:1, delay:0.5, transition:"easeIn"});
}
function frame4(){
Tweener.addTween(optionsBt, {y:-60, alpha:0, time:1, delay:0, transition:"easeOutBack"});
Tweener.addTween(loadGame, {y:-100, alpha:0, time:1, delay:0.2, transition:"easeOutBack"});
Tweener.addTween(optionsBt2, {y:440, alpha:1, time:1, delay:0.1, transition:"easeOutBack"});
Tweener.addTween(optTit, {alpha:0, time:1, transition:"easeOutBack"});
Tweener.addTween(titAndagel, {alpha:0, time:1, transition:"easeOutBack"});
Tweener.addTween(optLoad, {y:300, alpha:1, time:1, delay:0.5, transition:"easeIn"});
}
function frame8(){
Tweener.addTween(barTop, {x:320, y:40, time:2, transition:"easeOutExpo"});
Tweener.addTween(barBottom, {x:320, y:440, time:2, transition:"easeOutExpo"});
}
function frame9(){
}
function frame1(){
stop();
optTit.mouseEnabled = false;
optYes.mouseEnabled = false;
titAndagel.mouseEnabled = false;
legal.mouseEnabled = false;
mcInstructions.mouseEnabled = false;
optLoad.mouseEnabled = false;
optionsBt.mouseEnabled = false;
Tweener.addTween(optionsBt1, {alpha:1, time:1, delay:3, transition:"linear"});
}
function frame10(){
Tweener.addTween(optBg, {x:320, y:230, time:1, transition:"easeOutExpo"});
Tweener.addTween(rava, {x:126, y:240, time:1, transition:"easeOutBack"});
}
function frame5(){
optionsBt.x = 492;
optionsBt.y = 500;
Tweener.addTween(optionsBt, {y:444, scaleX:0.52, scaleY:0.52, time:1, delay:0, transition:"easeOut"});
Tweener.addTween(blok, {alpha:1, time:2, transition:"linear"});
Tweener.addTween(quote, {alpha:1, time:4, delay:3, transition:"easeOutBack"});
Tweener.addTween(titAndagel, {scaleX:0.5, scaleY:0.5, alpha:0, time:3, delay:1, transition:"easeIn"});
Tweener.addTween(loadGame, {y:600, alpha:0.36, time:1, delay:0.4, transition:"easeIn"});
Tweener.addTween(optionsBt2, {y:660, alpha:0.36, time:1, delay:0.2, transition:"easeIn"});
}
function frame2(){
optionsBt.mouseEnabled = true;
Tweener.addTween(titAndagel, {y:100, alpha:1, time:1, transition:"easeOutBack"});
Tweener.addTween(barTop, {x:320, y:40, time:2, transition:"easeOutExpo"});
Tweener.addTween(barBottom, {x:320, y:440, time:2, transition:"easeOutExpo"});
Tweener.addTween(optionsBt, {y:190, alpha:1, time:1, delay:0, transition:"easeOutBack"});
Tweener.addTween(loadGame, {y:260, alpha:1, time:1, delay:0.2, transition:"easeOutBack"});
Tweener.addTween(optionsBt2, {y:330, alpha:1, time:1, delay:0.4, transition:"easeOutBack"});
Tweener.addTween(optTit, {alpha:1, time:1, delay:0.6, transition:"easeOutBack"});
Tweener.addTween(optionsNo, {y:-200, alpha:0, time:1, delay:0.4, transition:"easeOutBack"});
Tweener.addTween(optYes, {y:640, alpha:0, time:1, transition:"easeOut"});
Tweener.addTween(optLoad, {y:640, alpha:0, time:1, transition:"easeOut"});
Tweener.addTween(optionsBt1, {y:640, alpha:0, time:1, delay:0, transition:"easeOutBack"});
}
}
}//package andagel_fla
Section 9
//hudAward_103 (andagel_fla.hudAward_103)
package andagel_fla {
import flash.display.*;
import flash.text.*;
public dynamic class hudAward_103 extends MovieClip {
public var awardType:TextField;
public var awardMessage:TextField;
public function hudAward_103(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package andagel_fla
Section 10
//instructions_69 (andagel_fla.instructions_69)
package andagel_fla {
import flash.display.*;
public dynamic class instructions_69 extends MovieClip {
public var credit:MovieClip;
public function instructions_69(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
public function showlogo(){
credit.gotoAndStop("lg");
}
}
}//package andagel_fla
Section 11
//legal_50 (andagel_fla.legal_50)
package andagel_fla {
import flash.display.*;
public dynamic class legal_50 extends MovieClip {
public function legal_50(){
addFrameScript(119, frame120);
}
function frame120(){
stop();
}
}
}//package andagel_fla
Section 12
//levelPhoto_68 (andagel_fla.levelPhoto_68)
package andagel_fla {
import flash.display.*;
public dynamic class levelPhoto_68 extends MovieClip {
public function levelPhoto_68(){
addFrameScript(0, frame1, 12, frame13);
}
function frame1(){
stop();
}
function frame13(){
stop();
}
}
}//package andagel_fla
Section 13
//loadED_21 (andagel_fla.loadED_21)
package andagel_fla {
import flash.display.*;
public dynamic class loadED_21 extends MovieClip {
public function loadED_21(){
addFrameScript(39, frame40);
}
function frame40(){
stop();
}
}
}//package andagel_fla
Section 14
//MainTimeline (andagel_fla.MainTimeline)
package andagel_fla {
import flash.events.*;
import flash.display.*;
import flash.ui.*;
import flash.net.*;
public dynamic class MainTimeline extends MovieClip {
public var hud:MovieClip;
public var nglo:MovieClip;
public var myMenu:ContextMenu;
public var menuItem1:ContextMenuItem;
public var menuItem3:ContextMenuItem;
public var generate:MovieClip;
public var sitego:Boolean;
public var copyrightNotice:ContextMenuItem;
public var btSkipButton:SimpleButton;
public var enemy:Man;
public var menuItem2:ContextMenuItem;
public var allowed_site:String;
public var container2:Game3D;
public var domain:String;
public var newgroundsMc:MovieClip;
public function MainTimeline(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
public function gotoProtopop(_arg1:ContextMenuEvent):void{
var _local2:String;
var _local3:URLRequest;
_local2 = "http://www.protopop.com/";
_local3 = new URLRequest(_local2);
navigateToURL(_local3, "_blank");
}
function frame3(){
stage.quality = "Low";
if (sitego == true){
container2 = new Game3D(this);
addChild(container2);
addChild(hud);
};
stop();
}
function frame1(){
MochiBot.track(this, "f9722c32");
allowed_site = "newgrounds.com";
sitego = false;
NewgroundsAPI.linkAPI(this);
NewgroundsAPI.connectMovie(3668);
domain = this.root.loaderInfo.url.split("/")[2];
if (domain.indexOf(allowed_site) == (domain.length - allowed_site.length)){
sitego = true;
};
stop();
myMenu = new ContextMenu();
myMenu.hideBuiltInItems();
menuItem1 = new ContextMenuItem("Protopop Home Page");
menuItem3 = new ContextMenuItem("Junx City Home Page");
menuItem2 = new ContextMenuItem("Andagel Gameguide");
copyrightNotice = new ContextMenuItem("© 2008 Robert Kabwe");
menuItem1.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, gotoProtopop);
menuItem3.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, gotoJunxcity);
menuItem2.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, gotoGuide);
myMenu.customItems.push(menuItem1);
myMenu.customItems.push(menuItem3);
myMenu.customItems.push(menuItem2);
myMenu.customItems.push(copyrightNotice);
copyrightNotice.separatorBefore = true;
this.contextMenu = myMenu;
}
public function gotoGuide(_arg1:ContextMenuEvent):void{
var _local2:String;
var _local3:URLRequest;
_local2 = "http://www.protopop.com/games/andagel/gameguide/";
_local3 = new URLRequest(_local2);
navigateToURL(_local3, "_blank");
}
function frame2(){
gotoAndStop(3);
}
public function addAnilogo():void{
var _local1:Anilogo;
nglo.visible = false;
stage.quality = "Medium";
_local1 = new Anilogo(this);
addChildAt(_local1, 0);
}
public function gotoJunxcity(_arg1:ContextMenuEvent):void{
var _local2:String;
var _local3:URLRequest;
_local2 = "http://www.junxcity.com/";
_local3 = new URLRequest(_local2);
navigateToURL(_local3, "_blank");
}
public function showAnilogo():void{
newgroundsMc.visible = false;
sitego = true;
nglo.visible = true;
nglo.play();
}
}
}//package andagel_fla
Section 15
//motirava_99 (andagel_fla.motirava_99)
package andagel_fla {
import flash.display.*;
public dynamic class motirava_99 extends MovieClip {
public function motirava_99(){
addFrameScript(334, frame335);
}
function frame335(){
stop();
}
}
}//package andagel_fla
Section 16
//NG_AD_OBJECT_WITH_PRELOADER_17 (andagel_fla.NG_AD_OBJECT_WITH_PRELOADER_17)
package andagel_fla {
import flash.events.*;
import flash.filters.*;
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
import flash.text.*;
import flash.media.*;
import flash.ui.*;
import flash.net.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class NG_AD_OBJECT_WITH_PRELOADER_17 extends MovieClip {
public var ng_ad:MovieClip;
public var NG_Button:SimpleButton;
public function NG_AD_OBJECT_WITH_PRELOADER_17(){
addFrameScript(0, frame1);
}
public function loadNGSite(_arg1:Event){
NewgroundsAPI.loadNewgrounds();
}
public function startAd(_arg1){
var _local2:URLLoader;
_local2 = new URLLoader(new URLRequest(_arg1));
_local2.addEventListener(Event.COMPLETE, ad_Loaded);
}
function frame1(){
Security.allowDomain("70.87.128.99");
Security.allowInsecureDomain("70.87.128.99");
Security.allowDomain("ads.shizmoo.com");
Security.allowInsecureDomain("ads.shizmoo.com");
Security.allowDomain("www.cpmstar.com");
Security.allowInsecureDomain("www.cpmstar.com");
Security.allowDomain("server.cpmstar.com");
Security.allowInsecureDomain("server.cpmstar.com");
if (NewgroundsAPI.getAdURL()){
startAd(NewgroundsAPI.getAdURL());
};
NewgroundsAPI.addEventListener(NewgroundsAPI.ADS_APPROVED, startAd);
NG_Button.addEventListener(MouseEvent.CLICK, loadNGSite);
stop();
}
public function ad_Loaded(_arg1:Event){
var _local2:*;
var _local3:Loader;
_local2 = String(_arg1.target.data);
_local3 = new Loader();
_local3.load(new URLRequest(_local2));
ng_ad.addChild(_local3);
}
}
}//package andagel_fla
Section 17
//NG_TANK_25 (andagel_fla.NG_TANK_25)
package andagel_fla {
import flash.events.*;
import flash.display.*;
public dynamic class NG_TANK_25 extends MovieClip {
public var NG_Logo:SimpleButton;
public function NG_TANK_25(){
addFrameScript(0, frame1);
}
public function loadNGSite(_arg1:Event){
NewgroundsAPI.loadNewgrounds();
}
function frame1(){
NG_Logo.addEventListener(MouseEvent.CLICK, loadNGSite);
}
}
}//package andagel_fla
Section 18
//NGI_INTRO_3 (andagel_fla.NGI_INTRO_3)
package andagel_fla {
import flash.events.*;
import flash.filters.*;
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
import flash.text.*;
import flash.media.*;
import flash.ui.*;
import flash.net.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class NGI_INTRO_3 extends MovieClip {
public var btFin:SimpleButton;
public function NGI_INTRO_3(){
addFrameScript(0, frame1, 1, frame2, 264, frame265);
}
function frame265(){
MovieClip(root).addAnilogo();
}
function frame1(){
stop();
}
function frame2(){
btFin.addEventListener(MouseEvent.CLICK, finito);
}
public function finito(_arg1:Event){
gotoAndStop(265);
}
}
}//package andagel_fla
Section 19
//NGI_MASK_CUBE_9 (andagel_fla.NGI_MASK_CUBE_9)
package andagel_fla {
import flash.display.*;
public dynamic class NGI_MASK_CUBE_9 extends MovieClip {
public function NGI_MASK_CUBE_9(){
addFrameScript(19, frame20);
}
function frame20(){
stop();
}
}
}//package andagel_fla
Section 20
//NGI_MASK_IN_8 (andagel_fla.NGI_MASK_IN_8)
package andagel_fla {
import flash.display.*;
public dynamic class NGI_MASK_IN_8 extends MovieClip {
public function NGI_MASK_IN_8(){
addFrameScript(24, frame25);
}
function frame25(){
stop();
}
}
}//package andagel_fla
Section 21
//optionspanel_104 (andagel_fla.optionspanel_104)
package andagel_fla {
import flash.display.*;
public dynamic class optionspanel_104 extends MovieClip {
public var btHelpNext:SimpleButton;
public var helppan:MovieClip;
public var btHelpLast:SimpleButton;
}
}//package andagel_fla
Section 22
//quote_110 (andagel_fla.quote_110)
package andagel_fla {
import flash.display.*;
import flash.media.*;
public dynamic class quote_110 extends MovieClip {
public function quote_110(){
addFrameScript(61, frame62, 105, frame106, 891, frame892, 3216, frame3217);
}
function frame106(){
stop();
}
function frame3217(){
stop();
}
function frame892(){
SoundMixer.stopAll();
}
function frame62(){
SoundMixer.stopAll();
}
}
}//package andagel_fla
Section 23
//ravaBeauty_58 (andagel_fla.ravaBeauty_58)
package andagel_fla {
import flash.display.*;
public dynamic class ravaBeauty_58 extends MovieClip {
public function ravaBeauty_58(){
addFrameScript(644, frame645);
}
function frame645(){
stop();
}
}
}//package andagel_fla
Section 24
//reticule_31 (andagel_fla.reticule_31)
package andagel_fla {
import flash.display.*;
public dynamic class reticule_31 extends MovieClip {
public var retMask:MovieClip;
public var threatBar:MovieClip;
public function reticule_31(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package andagel_fla
Section 25
//Symbol19_53 (andagel_fla.Symbol19_53)
package andagel_fla {
import flash.display.*;
public dynamic class Symbol19_53 extends MovieClip {
public function Symbol19_53(){
addFrameScript(4, frame5);
}
function frame5(){
stop();
}
}
}//package andagel_fla
Section 26
//Symbol21_55 (andagel_fla.Symbol21_55)
package andagel_fla {
import flash.display.*;
public dynamic class Symbol21_55 extends MovieClip {
public function Symbol21_55(){
addFrameScript(4, frame5);
}
function frame5(){
stop();
}
}
}//package andagel_fla
Section 27
//Symbol23_66 (andagel_fla.Symbol23_66)
package andagel_fla {
import flash.display.*;
public dynamic class Symbol23_66 extends MovieClip {
public function Symbol23_66(){
addFrameScript(4, frame5);
}
function frame5(){
stop();
}
}
}//package andagel_fla
Section 28
//Symbol24_64 (andagel_fla.Symbol24_64)
package andagel_fla {
import flash.display.*;
public dynamic class Symbol24_64 extends MovieClip {
public function Symbol24_64(){
addFrameScript(4, frame5);
}
function frame5(){
stop();
}
}
}//package andagel_fla
Section 29
//Symbol34_36 (andagel_fla.Symbol34_36)
package andagel_fla {
import flash.display.*;
public dynamic class Symbol34_36 extends MovieClip {
public function Symbol34_36(){
addFrameScript(402, frame403);
}
function frame403(){
stop();
}
}
}//package andagel_fla
Section 30
//titleAndagelAnim_48 (andagel_fla.titleAndagelAnim_48)
package andagel_fla {
import flash.display.*;
public dynamic class titleAndagelAnim_48 extends MovieClip {
public function titleAndagelAnim_48(){
addFrameScript(220, frame221);
}
function frame221(){
gotoAndPlay("tit");
}
}
}//package andagel_fla
Section 31
//X_LOAD_18 (andagel_fla.X_LOAD_18)
package andagel_fla {
import flash.events.*;
import flash.filters.*;
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
import flash.text.*;
import flash.media.*;
import flash.ui.*;
import flash.net.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class X_LOAD_18 extends MovieClip {
public var NGButton:SimpleButton;
public function X_LOAD_18(){
addFrameScript(100, frame101, 150, frame151, 164, frame165);
}
function frame151(){
NGButton.addEventListener(MouseEvent.CLICK, PlayMovie);
}
function frame165(){
stop();
}
public function PlayMovie(_arg1:Event){
gotoAndStop("end");
MovieClip(root).showAnilogo();
}
function frame101(){
play();
}
}
}//package andagel_fla
Section 32
//yesnocopy_62 (andagel_fla.yesnocopy_62)
package andagel_fla {
import flash.display.*;
import flash.text.*;
public dynamic class yesnocopy_62 extends MovieClip {
public var bt14:SimpleButton;
public var bt16:SimpleButton;
public var bt12:SimpleButton;
public var btForward:SimpleButton;
public var mcPic:MovieClip;
public var bt4:SimpleButton;
public var bt5:SimpleButton;
public var bt1:SimpleButton;
public var bt3:SimpleButton;
public var bt2:SimpleButton;
public var bt13:SimpleButton;
public var btBack:SimpleButton;
public var btAction:SimpleButton;
public var txtChapter:TextField;
public var bt15:SimpleButton;
}
}//package andagel_fla
Section 33
//AuxFunctions (caurina.transitions.AuxFunctions)
package caurina.transitions {
public class AuxFunctions {
public static function concatObjects(... _args):Object{
var _local2:Object;
var _local3:Object;
var _local4:int;
var _local5:String;
_local2 = {};
_local4 = 0;
while (_local4 < _args.length) {
_local3 = _args[_local4];
for (_local5 in _local3) {
if (_local3[_local5] == null){
delete _local2[_local5];
} else {
_local2[_local5] = _local3[_local5];
};
};
_local4++;
};
return (_local2);
}
public static function numberToG(_arg1:Number):Number{
return (((_arg1 & 0xFF00) >> 8));
}
public static function numberToR(_arg1:Number):Number{
return (((_arg1 & 0xFF0000) >> 16));
}
public static function isInArray(_arg1:String, _arg2:Array):Boolean{
var _local3:uint;
var _local4:uint;
_local3 = _arg2.length;
_local4 = 0;
while (_local4 < _local3) {
if (_arg2[_local4] == _arg1){
return (true);
};
_local4++;
};
return (false);
}
public static function getObjectLength(_arg1:Object):uint{
var _local2:uint;
var _local3:String;
_local2 = 0;
for (_local3 in _arg1) {
_local2++;
};
return (_local2);
}
public static function numberToB(_arg1:Number):Number{
return ((_arg1 & 0xFF));
}
}
}//package caurina.transitions
Section 34
//Equations (caurina.transitions.Equations)
package caurina.transitions {
public class Equations {
public static function easeOutBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
if (_arg1 < (1 / 2.75)){
return (((_arg3 * ((7.5625 * _arg1) * _arg1)) + _arg2));
};
if (_arg1 < (2 / 2.75)){
_arg1 = (_arg1 - (1.5 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.75)) + _arg2));
};
if (_arg1 < (2.5 / 2.75)){
_arg1 = (_arg1 - (2.25 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.9375)) + _arg2));
};
_arg1 = (_arg1 - (2.625 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.984375)) + _arg2));
}
public static function easeInOutElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=NaN, _arg6:Number=NaN):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 == 2){
return ((_arg2 + _arg3));
};
if (!_arg6){
_arg6 = (_arg4 * (0.3 * 1.5));
};
if (((!(_arg5)) || ((_arg5 < Math.abs(_arg3))))){
_arg5 = _arg3;
_local7 = (_arg6 / 4);
} else {
_local7 = ((_arg6 / (2 * Math.PI)) * Math.asin((_arg3 / _arg5)));
};
if (_arg1 < 1){
--_arg1;
return (((-0.5 * ((_arg5 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _arg6)))) + _arg2));
};
--_arg1;
return ((((((_arg5 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _arg6))) * 0.5) + _arg3) + _arg2));
}
public static function easeInOutQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return (((((_arg3 / 2) * _arg1) * _arg1) + _arg2));
};
--_arg1;
return ((((-(_arg3) / 2) * ((_arg1 * (_arg1 - 2)) - 1)) + _arg2));
}
public static function easeInOutBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (_arg1 < (_arg4 / 2)){
return (((easeInBounce((_arg1 * 2), 0, _arg3, _arg4) * 0.5) + _arg2));
};
return ((((easeOutBounce(((_arg1 * 2) - _arg4), 0, _arg3, _arg4) * 0.5) + (_arg3 * 0.5)) + _arg2));
}
public static function easeInOutBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=NaN):Number{
if (!_arg5){
_arg5 = 1.70158;
};
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
_arg5 = (_arg5 * 1.525);
return ((((_arg3 / 2) * ((_arg1 * _arg1) * (((_arg5 + 1) * _arg1) - _arg5))) + _arg2));
};
_arg1 = (_arg1 - 2);
_arg5 = (_arg5 * 1.525);
return ((((_arg3 / 2) * (((_arg1 * _arg1) * (((_arg5 + 1) * _arg1) + _arg5)) + 2)) + _arg2));
}
public static function easeOutInCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutCubic((_arg1 * 2), _arg2, (_arg3 / 2), _arg4));
};
return (easeInCubic(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4));
}
public static function easeNone(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeOutBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=NaN):Number{
if (!_arg5){
_arg5 = 1.70158;
};
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((_arg1 * _arg1) * (((_arg5 + 1) * _arg1) + _arg5)) + 1)) + _arg2));
}
public static function easeInOutSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((-(_arg3) / 2) * (Math.cos(((Math.PI * _arg1) / _arg4)) - 1)) + _arg2));
}
public static function easeInBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=NaN):Number{
if (!_arg5){
_arg5 = 1.70158;
};
_arg1 = (_arg1 / _arg4);
return (((((_arg3 * _arg1) * _arg1) * (((_arg5 + 1) * _arg1) - _arg5)) + _arg2));
}
public static function easeInQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((((_arg3 * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeOutInQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutQuint((_arg1 * 2), _arg2, (_arg3 / 2), _arg4));
};
return (easeInQuint(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4));
}
public static function easeOutInBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutBounce((_arg1 * 2), _arg2, (_arg3 / 2), _arg4));
};
return (easeInBounce(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4));
}
public static function init():void{
Tweener.registerTransition("easenone", easeNone);
Tweener.registerTransition("linear", easeNone);
Tweener.registerTransition("easeinquad", easeInQuad);
Tweener.registerTransition("easeoutquad", easeOutQuad);
Tweener.registerTransition("easeinoutquad", easeInOutQuad);
Tweener.registerTransition("easeoutinquad", easeOutInQuad);
Tweener.registerTransition("easeincubic", easeInCubic);
Tweener.registerTransition("easeoutcubic", easeOutCubic);
Tweener.registerTransition("easeinoutcubic", easeInOutCubic);
Tweener.registerTransition("easeoutincubic", easeOutInCubic);
Tweener.registerTransition("easeinquart", easeInQuart);
Tweener.registerTransition("easeoutquart", easeOutQuart);
Tweener.registerTransition("easeinoutquart", easeInOutQuart);
Tweener.registerTransition("easeoutinquart", easeOutInQuart);
Tweener.registerTransition("easeinquint", easeInQuint);
Tweener.registerTransition("easeoutquint", easeOutQuint);
Tweener.registerTransition("easeinoutquint", easeInOutQuint);
Tweener.registerTransition("easeoutinquint", easeOutInQuint);
Tweener.registerTransition("easeinsine", easeInSine);
Tweener.registerTransition("easeoutsine", easeOutSine);
Tweener.registerTransition("easeinoutsine", easeInOutSine);
Tweener.registerTransition("easeoutinsine", easeOutInSine);
Tweener.registerTransition("easeincirc", easeInCirc);
Tweener.registerTransition("easeoutcirc", easeOutCirc);
Tweener.registerTransition("easeinoutcirc", easeInOutCirc);
Tweener.registerTransition("easeoutincirc", easeOutInCirc);
Tweener.registerTransition("easeinexpo", easeInExpo);
Tweener.registerTransition("easeoutexpo", easeOutExpo);
Tweener.registerTransition("easeinoutexpo", easeInOutExpo);
Tweener.registerTransition("easeoutinexpo", easeOutInExpo);
Tweener.registerTransition("easeinelastic", easeInElastic);
Tweener.registerTransition("easeoutelastic", easeOutElastic);
Tweener.registerTransition("easeinoutelastic", easeInOutElastic);
Tweener.registerTransition("easeoutinelastic", easeOutInElastic);
Tweener.registerTransition("easeinback", easeInBack);
Tweener.registerTransition("easeoutback", easeOutBack);
Tweener.registerTransition("easeinoutback", easeInOutBack);
Tweener.registerTransition("easeoutinback", easeOutInBack);
Tweener.registerTransition("easeinbounce", easeInBounce);
Tweener.registerTransition("easeoutbounce", easeOutBounce);
Tweener.registerTransition("easeinoutbounce", easeInOutBounce);
Tweener.registerTransition("easeoutinbounce", easeOutInBounce);
}
public static function easeOutExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (((_arg1)==_arg4) ? (_arg2 + _arg3) : (((_arg3 * 1.001) * (-(Math.pow(2, ((-10 * _arg1) / _arg4))) + 1)) + _arg2));
}
public static function easeOutInBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=NaN):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutBack((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInBack(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeInExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (((_arg1)==0) ? _arg2 : (((_arg3 * Math.pow(2, (10 * ((_arg1 / _arg4) - 1)))) + _arg2) - (_arg3 * 0.001)));
}
public static function easeInCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return (((((_arg3 * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeInQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return (((((((_arg3 * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeInOutCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((-(_arg3) / 2) * (Math.sqrt((1 - (_arg1 * _arg1))) - 1)) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (Math.sqrt((1 - (_arg1 * _arg1))) + 1)) + _arg2));
}
public static function easeInQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((_arg3 * _arg1) * _arg1) + _arg2));
}
public static function easeInBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (((_arg3 - easeOutBounce((_arg4 - _arg1), 0, _arg3, _arg4)) + _arg2));
}
public static function easeOutInExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutExpo((_arg1 * 2), _arg2, (_arg3 / 2), _arg4));
};
return (easeInExpo(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4));
}
public static function easeOutQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((-(_arg3) * ((((_arg1 * _arg1) * _arg1) * _arg1) - 1)) + _arg2));
}
public static function easeInSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((-(_arg3) * Math.cos(((_arg1 / _arg4) * (Math.PI / 2)))) + _arg3) + _arg2));
}
public static function easeInOutQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return (((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((-(_arg3) / 2) * ((((_arg1 * _arg1) * _arg1) * _arg1) - 2)) + _arg2));
}
public static function easeOutQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((-(_arg3) * _arg1) * (_arg1 - 2)) + _arg2));
}
public static function easeOutInElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=NaN, _arg6:Number=NaN):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutElastic((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5, _arg6));
};
return (easeInElastic(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5, _arg6));
}
public static function easeInElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=NaN, _arg6:Number=NaN):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / _arg4);
if (_arg1 == 1){
return ((_arg2 + _arg3));
};
if (!_arg6){
_arg6 = (_arg4 * 0.3);
};
if (((!(_arg5)) || ((_arg5 < Math.abs(_arg3))))){
_arg5 = _arg3;
_local7 = (_arg6 / 4);
} else {
_local7 = ((_arg6 / (2 * Math.PI)) * Math.asin((_arg3 / _arg5)));
};
--_arg1;
return ((-(((_arg5 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _arg6)))) + _arg2));
}
public static function easeOutCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((_arg1 * _arg1) * _arg1) + 1)) + _arg2));
}
public static function easeOutQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 1)) + _arg2));
}
public static function easeOutInQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutQuad((_arg1 * 2), _arg2, (_arg3 / 2), _arg4));
};
return (easeInQuad(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4));
}
public static function easeOutSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (((_arg3 * Math.sin(((_arg1 / _arg4) * (Math.PI / 2)))) + _arg2));
}
public static function easeInOutCubic(_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));
}
public static function easeInOutQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 2)) + _arg2));
}
public static function easeInCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return (((-(_arg3) * (Math.sqrt((1 - (_arg1 * _arg1))) - 1)) + _arg2));
}
public static function easeOutInSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutSine((_arg1 * 2), _arg2, (_arg3 / 2), _arg4));
};
return (easeInSine(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4));
}
public static function easeInOutExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (_arg1 == 0){
return (_arg2);
};
if (_arg1 == _arg4){
return ((_arg2 + _arg3));
};
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return (((((_arg3 / 2) * Math.pow(2, (10 * (_arg1 - 1)))) + _arg2) - (_arg3 * 0.0005)));
};
--_arg1;
return (((((_arg3 / 2) * 1.0005) * (-(Math.pow(2, (-10 * _arg1))) + 2)) + _arg2));
}
public static function easeOutElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=NaN, _arg6:Number=NaN):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / _arg4);
if (_arg1 == 1){
return ((_arg2 + _arg3));
};
if (!_arg6){
_arg6 = (_arg4 * 0.3);
};
if (((!(_arg5)) || ((_arg5 < Math.abs(_arg3))))){
_arg5 = _arg3;
_local7 = (_arg6 / 4);
} else {
_local7 = ((_arg6 / (2 * Math.PI)) * Math.asin((_arg3 / _arg5)));
};
return (((((_arg5 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _arg6))) + _arg3) + _arg2));
}
public static function easeOutCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * Math.sqrt((1 - (_arg1 * _arg1)))) + _arg2));
}
public static function easeOutInQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutQuart((_arg1 * 2), _arg2, (_arg3 / 2), _arg4));
};
return (easeInQuart(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4));
}
public static function easeOutInCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutCirc((_arg1 * 2), _arg2, (_arg3 / 2), _arg4));
};
return (easeInCirc(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4));
}
}
}//package caurina.transitions
Section 35
//PropertyInfoObj (caurina.transitions.PropertyInfoObj)
package caurina.transitions {
public class PropertyInfoObj {
public var modifierParameters:Array;
public var valueComplete:Number;
public var modifierFunction:Function;
public var hasModifier:Boolean;
public var valueStart:Number;
public function PropertyInfoObj(_arg1:Number, _arg2:Number, _arg3:Function, _arg4:Array){
valueStart = _arg1;
valueComplete = _arg2;
hasModifier = Boolean(_arg3);
modifierFunction = _arg3;
modifierParameters = _arg4;
}
public function toString():String{
var _local1:String;
_local1 = "\n[PropertyInfoObj ";
_local1 = (_local1 + ("valueStart:" + String(valueStart)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("valueComplete:" + String(valueComplete)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("modifierFunction:" + String(modifierFunction)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("modifierParameters:" + String(modifierParameters)));
_local1 = (_local1 + "]\n");
return (_local1);
}
public function clone():PropertyInfoObj{
var _local1:PropertyInfoObj;
_local1 = new PropertyInfoObj(valueStart, valueComplete, modifierFunction, modifierParameters);
return (_local1);
}
}
}//package caurina.transitions
Section 36
//SpecialPropertiesDefault (caurina.transitions.SpecialPropertiesDefault)
package caurina.transitions {
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
public class SpecialPropertiesDefault {
public static function _sound_volume_get(_arg1:Object):Number{
return (_arg1.soundTransform.volume);
}
public static function _color_splitter(_arg1, _arg2:Array):Array{
var _local3:Array;
_local3 = new Array();
if (_arg1 == null){
_local3.push({name:"_color_ra", value:1});
_local3.push({name:"_color_rb", value:0});
_local3.push({name:"_color_ga", value:1});
_local3.push({name:"_color_gb", value:0});
_local3.push({name:"_color_ba", value:1});
_local3.push({name:"_color_bb", value:0});
} else {
_local3.push({name:"_color_ra", value:0});
_local3.push({name:"_color_rb", value:AuxFunctions.numberToR(_arg1)});
_local3.push({name:"_color_ga", value:0});
_local3.push({name:"_color_gb", value:AuxFunctions.numberToG(_arg1)});
_local3.push({name:"_color_ba", value:0});
_local3.push({name:"_color_bb", value:AuxFunctions.numberToB(_arg1)});
};
return (_local3);
}
public static function frame_get(_arg1:Object):Number{
return (_arg1.currentFrame);
}
public static function _sound_pan_get(_arg1:Object):Number{
return (_arg1.soundTransform.pan);
}
public static function _color_property_get(_arg1:Object, _arg2:Array):Number{
return (_arg1.transform.colorTransform[_arg2[0]]);
}
public static function _sound_volume_set(_arg1:Object, _arg2:Number):void{
var _local3:SoundTransform;
_local3 = _arg1.soundTransform;
_local3.volume = _arg2;
_arg1.soundTransform = _local3;
}
public static function _autoAlpha_get(_arg1:Object):Number{
return (_arg1.alpha);
}
public static function _filter_splitter(_arg1:BitmapFilter, _arg2:Array):Array{
var _local3:Array;
_local3 = new Array();
if ((_arg1 is BlurFilter)){
_local3.push({name:"_blur_blurX", value:BlurFilter(_arg1).blurX});
_local3.push({name:"_blur_blurY", value:BlurFilter(_arg1).blurY});
_local3.push({name:"_blur_quality", value:BlurFilter(_arg1).quality});
//unresolved jump
};
return (_local3);
}
public static function init():void{
Tweener.registerSpecialProperty("_frame", frame_get, frame_set);
Tweener.registerSpecialProperty("_sound_volume", _sound_volume_get, _sound_volume_set);
Tweener.registerSpecialProperty("_sound_pan", _sound_pan_get, _sound_pan_set);
Tweener.registerSpecialProperty("_color_ra", _color_property_get, _color_property_set, ["redMultiplier"]);
Tweener.registerSpecialProperty("_color_rb", _color_property_get, _color_property_set, ["redOffset"]);
Tweener.registerSpecialProperty("_color_ga", _color_property_get, _color_property_set, ["greenMultiplier"]);
Tweener.registerSpecialProperty("_color_gb", _color_property_get, _color_property_set, ["greenOffset"]);
Tweener.registerSpecialProperty("_color_ba", _color_property_get, _color_property_set, ["blueMultiplier"]);
Tweener.registerSpecialProperty("_color_bb", _color_property_get, _color_property_set, ["blueOffset"]);
Tweener.registerSpecialProperty("_color_aa", _color_property_get, _color_property_set, ["alphaMultiplier"]);
Tweener.registerSpecialProperty("_color_ab", _color_property_get, _color_property_set, ["alphaOffset"]);
Tweener.registerSpecialProperty("_autoAlpha", _autoAlpha_get, _autoAlpha_set);
Tweener.registerSpecialPropertySplitter("_color", _color_splitter);
Tweener.registerSpecialPropertySplitter("_colorTransform", _colorTransform_splitter);
Tweener.registerSpecialPropertySplitter("_scale", _scale_splitter);
Tweener.registerSpecialProperty("_blur_blurX", _filter_property_get, _filter_property_set, [BlurFilter, "blurX"]);
Tweener.registerSpecialProperty("_blur_blurY", _filter_property_get, _filter_property_set, [BlurFilter, "blurY"]);
Tweener.registerSpecialProperty("_blur_quality", _filter_property_get, _filter_property_set, [BlurFilter, "quality"]);
Tweener.registerSpecialPropertySplitter("_filter", _filter_splitter);
Tweener.registerSpecialPropertyModifier("_bezier", _bezier_modifier, _bezier_get);
}
public static function _sound_pan_set(_arg1:Object, _arg2:Number):void{
var _local3:SoundTransform;
_local3 = _arg1.soundTransform;
_local3.pan = _arg2;
_arg1.soundTransform = _local3;
}
public static function _color_property_set(_arg1:Object, _arg2:Number, _arg3:Array):void{
var _local4:ColorTransform;
_local4 = _arg1.transform.colorTransform;
_local4[_arg3[0]] = _arg2;
_arg1.transform.colorTransform = _local4;
}
public static function _filter_property_get(_arg1:Object, _arg2:Array):Number{
var _local3:Array;
var _local4:uint;
var _local5:Object;
var _local6:String;
var _local7:Object;
_local3 = _arg1.filters;
_local5 = _arg2[0];
_local6 = _arg2[1];
_local4 = 0;
while (_local4 < _local3.length) {
if ((((_local3[_local4] is BlurFilter)) && ((_local5 == BlurFilter)))){
return (_local3[_local4][_local6]);
};
_local4++;
};
switch (_local5){
case BlurFilter:
_local7 = {blurX:0, blurY:0, quality:NaN};
break;
};
return (_local7[_local6]);
}
public static function _bezier_get(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Array):Number{
var _local5:uint;
var _local6:Number;
var _local7:Number;
var _local8:Number;
if (_arg4.length == 1){
return ((_arg1 + (_arg3 * (((2 * (1 - _arg3)) * (_arg4[0] - _arg1)) + (_arg3 * (_arg2 - _arg1))))));
};
_local5 = Math.floor((_arg3 * _arg4.length));
_local6 = ((_arg3 - (_local5 * (1 / _arg4.length))) * _arg4.length);
if (_local5 == 0){
_local7 = _arg1;
_local8 = ((_arg4[0] + _arg4[1]) / 2);
} else {
if (_local5 == (_arg4.length - 1)){
_local7 = ((_arg4[(_local5 - 1)] + _arg4[_local5]) / 2);
_local8 = _arg2;
} else {
_local7 = ((_arg4[(_local5 - 1)] + _arg4[_local5]) / 2);
_local8 = ((_arg4[_local5] + _arg4[(_local5 + 1)]) / 2);
};
};
return ((_local7 + (_local6 * (((2 * (1 - _local6)) * (_arg4[_local5] - _local7)) + (_local6 * (_local8 - _local7))))));
}
public static function frame_set(_arg1:Object, _arg2:Number):void{
_arg1.gotoAndStop(Math.round(_arg2));
}
public static function _filter_property_set(_arg1:Object, _arg2:Number, _arg3:Array):void{
var _local4:Array;
var _local5:uint;
var _local6:Object;
var _local7:String;
var _local8:BitmapFilter;
_local4 = _arg1.filters;
_local6 = _arg3[0];
_local7 = _arg3[1];
_local5 = 0;
while (_local5 < _local4.length) {
if ((((_local4[_local5] is BlurFilter)) && ((_local6 == BlurFilter)))){
_local4[_local5][_local7] = _arg2;
_arg1.filters = _local4;
return;
};
_local5++;
};
if (_local4 == null){
_local4 = new Array();
};
switch (_local6){
case BlurFilter:
_local8 = new BlurFilter(0, 0);
break;
};
_local8[_local7] = _arg2;
_local4.push(_local8);
_arg1.filters = _local4;
}
public static function _autoAlpha_set(_arg1:Object, _arg2:Number):void{
_arg1.alpha = _arg2;
_arg1.visible = (_arg2 > 0);
}
public static function _scale_splitter(_arg1:Number, _arg2:Array):Array{
var _local3:Array;
_local3 = new Array();
_local3.push({name:"scaleX", value:_arg1});
_local3.push({name:"scaleY", value:_arg1});
return (_local3);
}
public static function _colorTransform_splitter(_arg1, _arg2:Array):Array{
var _local3:Array;
_local3 = new Array();
if (_arg1 == null){
_local3.push({name:"_color_ra", value:1});
_local3.push({name:"_color_rb", value:0});
_local3.push({name:"_color_ga", value:1});
_local3.push({name:"_color_gb", value:0});
_local3.push({name:"_color_ba", value:1});
_local3.push({name:"_color_bb", value:0});
} else {
if (_arg1.ra != undefined){
_local3.push({name:"_color_ra", value:_arg1.ra});
};
if (_arg1.rb != undefined){
_local3.push({name:"_color_rb", value:_arg1.rb});
};
if (_arg1.ga != undefined){
_local3.push({name:"_color_ba", value:_arg1.ba});
};
if (_arg1.gb != undefined){
_local3.push({name:"_color_bb", value:_arg1.bb});
};
if (_arg1.ba != undefined){
_local3.push({name:"_color_ga", value:_arg1.ga});
};
if (_arg1.bb != undefined){
_local3.push({name:"_color_gb", value:_arg1.gb});
};
if (_arg1.aa != undefined){
_local3.push({name:"_color_aa", value:_arg1.aa});
};
if (_arg1.ab != undefined){
_local3.push({name:"_color_ab", value:_arg1.ab});
};
};
return (_local3);
}
public static function _bezier_modifier(_arg1):Array{
var _local2:Array;
var _local3:Array;
var _local4:uint;
var _local5:String;
var _local6:Object;
_local2 = [];
if ((_arg1 is Array)){
_local3 = _arg1;
} else {
_local3 = [_arg1];
};
_local6 = {};
_local4 = 0;
while (_local4 < _local3.length) {
for (_local5 in _local3[_local4]) {
if (_local6[_local5] == undefined){
_local6[_local5] = [];
};
_local6[_local5].push(_local3[_local4][_local5]);
};
_local4++;
};
for (_local5 in _local6) {
_local2.push({name:_local5, parameters:_local6[_local5]});
};
return (_local2);
}
}
}//package caurina.transitions
Section 37
//SpecialProperty (caurina.transitions.SpecialProperty)
package caurina.transitions {
public class SpecialProperty {
public var parameters:Array;
public var getValue:Function;
public var setValue:Function;
public function SpecialProperty(_arg1:Function, _arg2:Function, _arg3:Array=null){
getValue = _arg1;
setValue = _arg2;
parameters = _arg3;
}
public function toString():String{
var _local1:String;
_local1 = "";
_local1 = (_local1 + "[SpecialProperty ");
_local1 = (_local1 + ("getValue:" + String(getValue)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("setValue:" + String(setValue)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("parameters:" + String(parameters)));
_local1 = (_local1 + "]");
return (_local1);
}
}
}//package caurina.transitions
Section 38
//SpecialPropertyModifier (caurina.transitions.SpecialPropertyModifier)
package caurina.transitions {
public class SpecialPropertyModifier {
public var getValue:Function;
public var modifyValues:Function;
public function SpecialPropertyModifier(_arg1:Function, _arg2:Function){
modifyValues = _arg1;
getValue = _arg2;
}
public function toString():String{
var _local1:String;
_local1 = "";
_local1 = (_local1 + "[SpecialPropertyModifier ");
_local1 = (_local1 + ("modifyValues:" + String(modifyValues)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("getValue:" + String(getValue)));
_local1 = (_local1 + "]");
return (_local1);
}
}
}//package caurina.transitions
Section 39
//SpecialPropertySplitter (caurina.transitions.SpecialPropertySplitter)
package caurina.transitions {
public class SpecialPropertySplitter {
public var parameters:Array;
public var splitValues:Function;
public function SpecialPropertySplitter(_arg1:Function, _arg2:Array){
splitValues = _arg1;
}
public function toString():String{
var _local1:String;
_local1 = "";
_local1 = (_local1 + "[SpecialPropertySplitter ");
_local1 = (_local1 + ("splitValues:" + String(splitValues)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("parameters:" + String(parameters)));
_local1 = (_local1 + "]");
return (_local1);
}
}
}//package caurina.transitions
Section 40
//Tweener (caurina.transitions.Tweener)
package caurina.transitions {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class Tweener {
private static var _timeScale:Number = 1;
private static var _specialPropertySplitterList:Object;
private static var _engineExists:Boolean = false;
private static var _specialPropertyModifierList:Object;
private static var _currentTime:Number;
private static var _tweenList:Array;
private static var _specialPropertyList:Object;
private static var _transitionList:Object;
private static var _inited:Boolean = false;
private static var __tweener_controller__:MovieClip;
public static function registerSpecialPropertyModifier(_arg1:String, _arg2:Function, _arg3:Function):void{
var _local4:SpecialPropertyModifier;
if (!_inited){
init();
};
_local4 = new SpecialPropertyModifier(_arg2, _arg3);
_specialPropertyModifierList[_arg1] = _local4;
}
public static function registerSpecialProperty(_arg1:String, _arg2:Function, _arg3:Function, _arg4:Array=null):void{
var _local5:SpecialProperty;
if (!_inited){
init();
};
_local5 = new SpecialProperty(_arg2, _arg3, _arg4);
_specialPropertyList[_arg1] = _local5;
}
public static function addCaller(_arg1:Object=null, _arg2:Object=null):Boolean{
var _local4:Array;
var _local5:Number;
var _local6:Number;
var _local7:Object;
var _local8:Number;
var _local9:Number;
var _local10:Function;
var _local11:TweenListObj;
var _local12:Number;
var _local13:String;
if ((((arguments.length < 2)) || ((arguments[0] == undefined)))){
return (false);
};
_local4 = new Array();
if ((arguments[0] is Array)){
_local5 = 0;
while (_local5 < arguments[0].length) {
_local4.push(arguments[0][_local5]);
_local5++;
};
} else {
_local5 = 0;
while (_local5 < (arguments.length - 1)) {
_local4.push(arguments[_local5]);
_local5++;
};
};
_local7 = arguments[(arguments.length - 1)];
if (!_inited){
init();
};
if (((!(_engineExists)) || (!(Boolean(__tweener_controller__))))){
startEngine();
};
_local8 = (isNaN(_local7.time)) ? 0 : _local7.time;
_local9 = (isNaN(_local7.delay)) ? 0 : _local7.delay;
if (typeof(_local7.transition) == "string"){
_local13 = _local7.transition.toLowerCase();
_local10 = _transitionList[_local13];
} else {
_local10 = _local7.transition;
};
if (!Boolean(_local10)){
_local10 = _transitionList["easeoutexpo"];
};
_local5 = 0;
while (_local5 < _local4.length) {
_local11 = new TweenListObj(_local4[_local5], (_currentTime + ((_local9 * 1000) / _timeScale)), (_currentTime + (((_local9 * 1000) + (_local8 * 1000)) / _timeScale)), (_local7.useFrames == true), _local10);
_local11.properties = null;
_local11.onStart = _local7.onStart;
_local11.onUpdate = _local7.onUpdate;
_local11.onComplete = _local7.onComplete;
_local11.onOverwrite = _local7.onOverwrite;
_local11.onStartParams = _local7.onStartParams;
_local11.onUpdateParams = _local7.onUpdateParams;
_local11.onCompleteParams = _local7.onCompleteParams;
_local11.onOverwriteParams = _local7.onOverwriteParams;
_local11.isCaller = true;
_local11.count = _local7.count;
_local11.waitFrames = _local7.waitFrames;
_tweenList.push(_local11);
if ((((_local8 == 0)) && ((_local9 == 0)))){
_local12 = (_tweenList.length - 1);
updateTweenByIndex(_local12);
removeTweenByIndex(_local12);
};
_local5++;
};
return (true);
}
public static function init(_arg1=null):void{
_inited = true;
_transitionList = new Object();
Equations.init();
_specialPropertyList = new Object();
_specialPropertyModifierList = new Object();
_specialPropertySplitterList = new Object();
SpecialPropertiesDefault.init();
}
private static function updateTweens():Boolean{
var _local1:int;
if (_tweenList.length == 0){
return (false);
};
_local1 = 0;
while (_local1 < _tweenList.length) {
if ((((_tweenList[_local1] == undefined)) || (!(_tweenList[_local1].isPaused)))){
if (!updateTweenByIndex(_local1)){
removeTweenByIndex(_local1);
};
if (_tweenList[_local1] == null){
removeTweenByIndex(_local1, true);
_local1--;
};
};
_local1++;
};
return (true);
}
public static function removeTweens(_arg1:Object, ... _args):Boolean{
var _local3:Array;
var _local4:uint;
_local3 = new Array();
_local4 = 0;
while (_local4 < _args.length) {
if ((((typeof(_args[_local4]) == "string")) && (!(AuxFunctions.isInArray(_args[_local4], _local3))))){
_local3.push(_args[_local4]);
};
_local4++;
};
return (affectTweens(removeTweenByIndex, _arg1, _local3));
}
public static function pauseAllTweens():Boolean{
var _local1:Boolean;
var _local2:uint;
if (!Boolean(_tweenList)){
return (false);
};
_local1 = false;
_local2 = 0;
while (_local2 < _tweenList.length) {
pauseTweenByIndex(_local2);
_local1 = true;
_local2++;
};
return (_local1);
}
public static function splitTweens(_arg1:Number, _arg2:Array):uint{
var _local3:TweenListObj;
var _local4:TweenListObj;
var _local5:uint;
var _local6:String;
var _local7:Boolean;
_local3 = _tweenList[_arg1];
_local4 = _local3.clone(false);
_local5 = 0;
while (_local5 < _arg2.length) {
_local6 = _arg2[_local5];
if (Boolean(_local3.properties[_local6])){
_local3.properties[_local6] = undefined;
delete _local3.properties[_local6];
};
_local5++;
};
for (_local6 in _local4.properties) {
_local7 = false;
_local5 = 0;
while (_local5 < _arg2.length) {
if (_arg2[_local5] == _local6){
_local7 = true;
break;
};
_local5++;
};
if (!_local7){
_local4.properties[_local6] = undefined;
delete _local4.properties[_local6];
};
};
_tweenList.push(_local4);
return ((_tweenList.length - 1));
}
public static function resumeTweenByIndex(_arg1:Number):Boolean{
var _local2:TweenListObj;
_local2 = _tweenList[_arg1];
if ((((_local2 == null)) || (!(_local2.isPaused)))){
return (false);
};
_local2.timeStart = (_local2.timeStart + (_currentTime - _local2.timePaused));
_local2.timeComplete = (_local2.timeComplete + (_currentTime - _local2.timePaused));
_local2.timePaused = undefined;
_local2.isPaused = false;
return (true);
}
public static function debug_getList():String{
var _local1:String;
var _local2:uint;
var _local3:uint;
_local1 = "";
_local2 = 0;
while (_local2 < _tweenList.length) {
_local1 = (_local1 + (("[" + _local2) + "] ::\n"));
_local3 = 0;
while (_local3 < _tweenList[_local2].properties.length) {
_local1 = (_local1 + ((((" " + _tweenList[_local2].properties[_local3].name) + " -> ") + _tweenList[_local2].properties[_local3].valueComplete) + "\n"));
_local3++;
};
_local2++;
};
return (_local1);
}
public static function getVersion():String{
return ("AS3 1.26.62");
}
public static function onEnterFrame(_arg1:Event):void{
var _local2:Boolean;
updateTime();
_local2 = false;
_local2 = updateTweens();
if (!_local2){
stopEngine();
};
}
public static function updateTime():void{
_currentTime = getTimer();
}
private static function updateTweenByIndex(_arg1:Number):Boolean{
var tTweening:TweenListObj;
var isOver:Boolean;
var mustUpdate:Boolean;
var nv:Number;
var t:Number;
var b:Number;
var c:Number;
var d:Number;
var pName:String;
var tScope:Object;
var tProperty:Object;
var pv:Number;
var i = _arg1;
tTweening = _tweenList[i];
if ((((tTweening == null)) || (!(Boolean(tTweening.scope))))){
return (false);
};
isOver = false;
if (_currentTime >= tTweening.timeStart){
tScope = tTweening.scope;
if (tTweening.isCaller){
do {
t = (((tTweening.timeComplete - tTweening.timeStart) / tTweening.count) * (tTweening.timesCalled + 1));
b = tTweening.timeStart;
c = (tTweening.timeComplete - tTweening.timeStart);
d = (tTweening.timeComplete - tTweening.timeStart);
nv = tTweening.transition(t, b, c, d);
} while (!(_currentTime >= nv));
} else {
mustUpdate = (((((tTweening.skipUpdates < 1)) || (!(tTweening.skipUpdates)))) || ((tTweening.updatesSkipped >= tTweening.skipUpdates)));
if (_currentTime >= tTweening.timeComplete){
isOver = true;
mustUpdate = true;
};
if (!tTweening.hasStarted){
if (Boolean(tTweening.onStart)){
try {
tTweening.onStart.apply(tScope, tTweening.onStartParams);
} catch(e:Error) {
handleError(tTweening, e, "onStart");
};
};
for (pName in tTweening.properties) {
pv = getPropertyValue(tScope, pName);
tTweening.properties[pName].valueStart = (isNaN(pv)) ? tTweening.properties[pName].valueComplete : pv;
};
mustUpdate = true;
tTweening.hasStarted = true;
};
if (mustUpdate){
for (pName in tTweening.properties) {
tProperty = tTweening.properties[pName];
if (isOver){
nv = tProperty.valueComplete;
} else {
if (tProperty.hasModifier){
t = (_currentTime - tTweening.timeStart);
d = (tTweening.timeComplete - tTweening.timeStart);
nv = tTweening.transition(t, 0, 1, d);
nv = tProperty.modifierFunction(tProperty.valueStart, tProperty.valueComplete, nv, tProperty.modifierParameters);
} else {
t = (_currentTime - tTweening.timeStart);
b = tProperty.valueStart;
c = (tProperty.valueComplete - tProperty.valueStart);
d = (tTweening.timeComplete - tTweening.timeStart);
nv = tTweening.transition(t, b, c, d);
};
};
if (tTweening.rounded){
nv = Math.round(nv);
};
setPropertyValue(tScope, pName, nv);
};
tTweening.updatesSkipped = 0;
if (Boolean(tTweening.onUpdate)){
try {
tTweening.onUpdate.apply(tScope, tTweening.onUpdateParams);
} catch(e:Error) {
handleError(tTweening, e, "onUpdate");
};
};
} else {
tTweening.updatesSkipped++;
};
};
if (((isOver) && (Boolean(tTweening.onComplete)))){
try {
tTweening.onComplete.apply(tScope, tTweening.onCompleteParams);
} catch(e:Error) {
handleError(tTweening, e, "onComplete");
};
};
return (!(isOver));
};
return (true);
}
public static function setTimeScale(_arg1:Number):void{
var _local2:Number;
if (isNaN(_arg1)){
_arg1 = 1;
};
if (_arg1 < 1E-5){
_arg1 = 1E-5;
};
if (_arg1 != _timeScale){
if (_tweenList != null){
_local2 = 0;
while (_local2 < _tweenList.length) {
_tweenList[_local2].timeStart = (_currentTime - (((_currentTime - _tweenList[_local2].timeStart) * _timeScale) / _arg1));
_tweenList[_local2].timeComplete = (_currentTime - (((_currentTime - _tweenList[_local2].timeComplete) * _timeScale) / _arg1));
if (_tweenList[_local2].timePaused != undefined){
_tweenList[_local2].timePaused = (_currentTime - (((_currentTime - _tweenList[_local2].timePaused) * _timeScale) / _arg1));
};
_local2++;
};
};
_timeScale = _arg1;
};
}
public static function resumeAllTweens():Boolean{
var _local1:Boolean;
var _local2:uint;
if (!Boolean(_tweenList)){
return (false);
};
_local1 = false;
_local2 = 0;
while (_local2 < _tweenList.length) {
resumeTweenByIndex(_local2);
_local1 = true;
_local2++;
};
return (_local1);
}
private static function handleError(_arg1:TweenListObj, _arg2:Error, _arg3:String):void{
var pTweening = _arg1;
var pError = _arg2;
var pCallBackName = _arg3;
if (((Boolean(pTweening.onError)) && ((pTweening.onError is Function)))){
try {
pTweening.onError.apply(pTweening.scope, [pTweening.scope, pError]);
} catch(metaError:Error) {
};
} else {
if (!Boolean(pTweening.onError)){
};
};
}
private static function startEngine():void{
_engineExists = true;
_tweenList = new Array();
__tweener_controller__ = new MovieClip();
__tweener_controller__.addEventListener(Event.ENTER_FRAME, Tweener.onEnterFrame);
updateTime();
}
public static function removeAllTweens():Boolean{
var _local1:Boolean;
var _local2:uint;
if (!Boolean(_tweenList)){
return (false);
};
_local1 = false;
_local2 = 0;
while (_local2 < _tweenList.length) {
removeTweenByIndex(_local2);
_local1 = true;
_local2++;
};
return (_local1);
}
public static function addTween(_arg1:Object=null, _arg2:Object=null):Boolean{
var _local4:Array;
var _local5:Number;
var _local6:Number;
var _local7:String;
var _local8:String;
var _local9:Object;
var _local10:Number;
var _local11:Number;
var _local12:Array;
var _local13:Object;
var _local14:Object;
var _local15:Function;
var _local16:Object;
var _local17:TweenListObj;
var _local18:Number;
var _local19:Array;
var _local20:Array;
var _local21:String;
if ((((arguments.length < 2)) || ((arguments[0] == undefined)))){
return (false);
};
_local4 = new Array();
if ((arguments[0] is Array)){
_local5 = 0;
while (_local5 < arguments[0].length) {
_local4.push(arguments[0][_local5]);
_local5++;
};
} else {
_local5 = 0;
while (_local5 < (arguments.length - 1)) {
_local4.push(arguments[_local5]);
_local5++;
};
};
_local9 = TweenListObj.makePropertiesChain(arguments[(arguments.length - 1)]);
if (!_inited){
init();
};
if (((!(_engineExists)) || (!(Boolean(__tweener_controller__))))){
startEngine();
};
_local10 = (isNaN(_local9.time)) ? 0 : _local9.time;
_local11 = (isNaN(_local9.delay)) ? 0 : _local9.delay;
_local12 = new Array();
_local13 = {time:true, delay:true, useFrames:true, skipUpdates:true, transition:true, onStart:true, onUpdate:true, onComplete:true, onOverwrite:true, rounded:true, onStartParams:true, onUpdateParams:true, onCompleteParams:true, onOverwriteParams:true};
_local14 = new Object();
for (_local7 in _local9) {
if (!_local13[_local7]){
if (_specialPropertySplitterList[_local7]){
_local19 = _specialPropertySplitterList[_local7].splitValues(_local9[_local7], _specialPropertySplitterList[_local7].parameters);
_local5 = 0;
while (_local5 < _local19.length) {
_local12[_local19[_local5].name] = {valueStart:undefined, valueComplete:_local19[_local5].value};
_local5++;
};
} else {
if (_specialPropertyModifierList[_local7] != undefined){
_local20 = _specialPropertyModifierList[_local7].modifyValues(_local9[_local7]);
_local5 = 0;
while (_local5 < _local20.length) {
_local14[_local20[_local5].name] = {modifierParameters:_local20[_local5].parameters, modifierFunction:_specialPropertyModifierList[_local7].getValue};
_local5++;
};
} else {
_local12[_local7] = {valueStart:undefined, valueComplete:_local9[_local7]};
};
};
};
};
for (_local7 in _local14) {
if (_local12[_local7] != undefined){
_local12[_local7].modifierParameters = _local14[_local7].modifierParameters;
_local12[_local7].modifierFunction = _local14[_local7].modifierFunction;
};
};
if (typeof(_local9.transition) == "string"){
_local21 = _local9.transition.toLowerCase();
_local15 = _transitionList[_local21];
} else {
_local15 = _local9.transition;
};
if (!Boolean(_local15)){
_local15 = _transitionList["easeoutexpo"];
};
_local5 = 0;
while (_local5 < _local4.length) {
_local16 = new Object();
for (_local7 in _local12) {
_local16[_local7] = new PropertyInfoObj(_local12[_local7].valueStart, _local12[_local7].valueComplete, _local12[_local7].modifierFunction, _local12[_local7].modifierParameters);
};
_local17 = new TweenListObj(_local4[_local5], (_currentTime + ((_local11 * 1000) / _timeScale)), (_currentTime + (((_local11 * 1000) + (_local10 * 1000)) / _timeScale)), (_local9.useFrames == true), _local15);
_local17.properties = _local16;
_local17.onStart = _local9.onStart;
_local17.onUpdate = _local9.onUpdate;
_local17.onComplete = _local9.onComplete;
_local17.onOverwrite = _local9.onOverwrite;
_local17.onError = _local9.onError;
_local17.onStartParams = _local9.onStartParams;
_local17.onUpdateParams = _local9.onUpdateParams;
_local17.onCompleteParams = _local9.onCompleteParams;
_local17.onOverwriteParams = _local9.onOverwriteParams;
_local17.rounded = _local9.rounded;
_local17.skipUpdates = _local9.skipUpdates;
removeTweensByTime(_local17.scope, _local17.properties, _local17.timeStart, _local17.timeComplete);
_tweenList.push(_local17);
if ((((_local10 == 0)) && ((_local11 == 0)))){
_local18 = (_tweenList.length - 1);
updateTweenByIndex(_local18);
removeTweenByIndex(_local18);
};
_local5++;
};
return (true);
}
public static function registerTransition(_arg1:String, _arg2:Function):void{
if (!_inited){
init();
};
_transitionList[_arg1] = _arg2;
}
private static function affectTweens(_arg1:Function, _arg2:Object, _arg3:Array):Boolean{
var _local4:Boolean;
var _local5:uint;
var _local6:Array;
var _local7:uint;
var _local8:uint;
var _local9:uint;
_local4 = false;
if (!Boolean(_tweenList)){
return (false);
};
_local5 = 0;
while (_local5 < _tweenList.length) {
if (((_tweenList[_local5]) && ((_tweenList[_local5].scope == _arg2)))){
if (_arg3.length == 0){
_arg1(_local5);
_local4 = true;
} else {
_local6 = new Array();
_local7 = 0;
while (_local7 < _arg3.length) {
if (Boolean(_tweenList[_local5].properties[_arg3[_local7]])){
_local6.push(_arg3[_local7]);
};
_local7++;
};
if (_local6.length > 0){
_local8 = AuxFunctions.getObjectLength(_tweenList[_local5].properties);
if (_local8 == _local6.length){
_arg1(_local5);
_local4 = true;
} else {
_local9 = splitTweens(_local5, _local6);
_arg1(_local9);
_local4 = true;
};
};
};
};
_local5++;
};
return (_local4);
}
public static function getTweens(_arg1:Object):Array{
var _local2:uint;
var _local3:String;
var _local4:Array;
if (!Boolean(_tweenList)){
return ([]);
};
_local4 = new Array();
_local2 = 0;
while (_local2 < _tweenList.length) {
if (_tweenList[_local2].scope == _arg1){
for (_local3 in _tweenList[_local2].properties) {
_local4.push(_local3);
};
};
_local2++;
};
return (_local4);
}
private static function setPropertyValue(_arg1:Object, _arg2:String, _arg3:Number):void{
if (_specialPropertyList[_arg2] != undefined){
if (Boolean(_specialPropertyList[_arg2].parameters)){
_specialPropertyList[_arg2].setValue(_arg1, _arg3, _specialPropertyList[_arg2].parameters);
} else {
_specialPropertyList[_arg2].setValue(_arg1, _arg3);
};
} else {
_arg1[_arg2] = _arg3;
};
}
private static function getPropertyValue(_arg1:Object, _arg2:String):Number{
if (_specialPropertyList[_arg2] != undefined){
if (Boolean(_specialPropertyList[_arg2].parameters)){
return (_specialPropertyList[_arg2].getValue(_arg1, _specialPropertyList[_arg2].parameters));
};
return (_specialPropertyList[_arg2].getValue(_arg1));
} else {
};
return (!NULL!);
}
public static function isTweening(_arg1:Object):Boolean{
var _local2:uint;
if (!Boolean(_tweenList)){
return (false);
};
_local2 = 0;
while (_local2 < _tweenList.length) {
if (_tweenList[_local2].scope == _arg1){
return (true);
};
_local2++;
};
return (false);
}
public static function getTweenCount(_arg1:Object):Number{
var _local2:uint;
var _local3:Number;
if (!Boolean(_tweenList)){
return (0);
};
_local3 = 0;
_local2 = 0;
while (_local2 < _tweenList.length) {
if (_tweenList[_local2].scope == _arg1){
_local3 = (_local3 + AuxFunctions.getObjectLength(_tweenList[_local2].properties));
};
_local2++;
};
return (_local3);
}
private static function stopEngine():void{
_engineExists = false;
_tweenList = null;
_currentTime = 0;
__tweener_controller__.removeEventListener(Event.ENTER_FRAME, Tweener.onEnterFrame);
__tweener_controller__ = null;
}
public static function pauseTweenByIndex(_arg1:Number):Boolean{
var _local2:TweenListObj;
_local2 = _tweenList[_arg1];
if ((((_local2 == null)) || (_local2.isPaused))){
return (false);
};
_local2.timePaused = _currentTime;
_local2.isPaused = true;
return (true);
}
public static function removeTweensByTime(_arg1:Object, _arg2:Object, _arg3:Number, _arg4:Number):Boolean{
var removed:Boolean;
var removedLocally:Boolean;
var i:uint;
var tl:uint;
var pName:String;
var p_scope = _arg1;
var p_properties = _arg2;
var p_timeStart = _arg3;
var p_timeComplete = _arg4;
removed = false;
tl = _tweenList.length;
i = 0;
while (i < tl) {
if (((Boolean(_tweenList[i])) && ((p_scope == _tweenList[i].scope)))){
if ((((p_timeComplete > _tweenList[i].timeStart)) && ((p_timeStart < _tweenList[i].timeComplete)))){
removedLocally = false;
for (pName in _tweenList[i].properties) {
if (Boolean(p_properties[pName])){
if (Boolean(_tweenList[i].onOverwrite)){
try {
_tweenList[i].onOverwrite.apply(_tweenList[i].scope, _tweenList[i].onOverwriteParams);
} catch(e:Error) {
handleError(_tweenList[i], e, "onOverwrite");
};
};
_tweenList[i].properties[pName] = undefined;
delete _tweenList[i].properties[pName];
removedLocally = true;
removed = true;
};
};
if (removedLocally){
if (AuxFunctions.getObjectLength(_tweenList[i].properties) == 0){
removeTweenByIndex(i);
};
};
};
};
i = (i + 1);
};
return (removed);
}
public static function registerSpecialPropertySplitter(_arg1:String, _arg2:Function, _arg3:Array=null):void{
var _local4:SpecialPropertySplitter;
if (!_inited){
init();
};
_local4 = new SpecialPropertySplitter(_arg2, _arg3);
_specialPropertySplitterList[_arg1] = _local4;
}
public static function removeTweenByIndex(_arg1:Number, _arg2:Boolean=false):Boolean{
_tweenList[_arg1] = null;
if (_arg2){
_tweenList.splice(_arg1, 1);
};
return (true);
}
public static function resumeTweens(_arg1:Object, ... _args):Boolean{
var _local3:Array;
var _local4:uint;
_local3 = new Array();
_local4 = 0;
while (_local4 < _args.length) {
if ((((typeof(_args[_local4]) == "string")) && (!(AuxFunctions.isInArray(_args[_local4], _local3))))){
_local3.push(_args[_local4]);
};
_local4++;
};
return (affectTweens(resumeTweenByIndex, _arg1, _local3));
}
public static function pauseTweens(_arg1:Object, ... _args):Boolean{
var _local3:Array;
var _local4:uint;
_local3 = new Array();
_local4 = 0;
while (_local4 < _args.length) {
if ((((typeof(_args[_local4]) == "string")) && (!(AuxFunctions.isInArray(_args[_local4], _local3))))){
_local3.push(_args[_local4]);
};
_local4++;
};
return (affectTweens(pauseTweenByIndex, _arg1, _local3));
}
}
}//package caurina.transitions
Section 41
//TweenListObj (caurina.transitions.TweenListObj)
package caurina.transitions {
public class TweenListObj {
public var onUpdate:Function;
public var useFrames:Boolean;
public var hasStarted:Boolean;
public var onOverwriteParams:Array;
public var timeStart:Number;
public var count:Number;
public var auxProperties:Object;
public var timeComplete:Number;
public var onStartParams:Array;
public var rounded:Boolean;
public var properties:Object;
public var onUpdateParams:Array;
public var onComplete:Function;
public var updatesSkipped:Number;
public var onStart:Function;
public var skipUpdates:Number;
public var scope:Object;
public var isCaller:Boolean;
public var timePaused:Number;
public var transition:Function;
public var onCompleteParams:Array;
public var onError:Function;
public var timesCalled:Number;
public var onOverwrite:Function;
public var isPaused:Boolean;
public var waitFrames:Boolean;
public function TweenListObj(_arg1:Object, _arg2:Number, _arg3:Number, _arg4:Boolean, _arg5:Function){
scope = _arg1;
timeStart = _arg2;
timeComplete = _arg3;
useFrames = _arg4;
transition = _arg5;
auxProperties = new Object();
properties = new Object();
isPaused = false;
timePaused = undefined;
isCaller = false;
updatesSkipped = 0;
timesCalled = 0;
skipUpdates = 0;
hasStarted = false;
}
public function clone(_arg1:Boolean):TweenListObj{
var _local2:TweenListObj;
var _local3:String;
_local2 = new TweenListObj(scope, timeStart, timeComplete, useFrames, transition);
_local2.properties = new Array();
for (_local3 in properties) {
_local2.properties[_local3] = properties[_local3].clone();
};
_local2.skipUpdates = skipUpdates;
_local2.updatesSkipped = updatesSkipped;
if (!_arg1){
_local2.onStart = onStart;
_local2.onUpdate = onUpdate;
_local2.onComplete = onComplete;
_local2.onOverwrite = onOverwrite;
_local2.onError = onError;
_local2.onStartParams = onStartParams;
_local2.onUpdateParams = onUpdateParams;
_local2.onCompleteParams = onCompleteParams;
_local2.onOverwriteParams = onOverwriteParams;
};
_local2.rounded = rounded;
_local2.isPaused = isPaused;
_local2.timePaused = timePaused;
_local2.isCaller = isCaller;
_local2.count = count;
_local2.timesCalled = timesCalled;
_local2.waitFrames = waitFrames;
_local2.hasStarted = hasStarted;
return (_local2);
}
public function toString():String{
var _local1:String;
var _local2:uint;
_local1 = "\n[TweenListObj ";
_local1 = (_local1 + ("scope:" + String(scope)));
_local1 = (_local1 + ", properties:");
_local2 = 0;
while (_local2 < properties.length) {
if (_local2 > 0){
_local1 = (_local1 + ",");
};
_local1 = (_local1 + ("[name:" + properties[_local2].name));
_local1 = (_local1 + (",valueStart:" + properties[_local2].valueStart));
_local1 = (_local1 + (",valueComplete:" + properties[_local2].valueComplete));
_local1 = (_local1 + "]");
_local2++;
};
_local1 = (_local1 + (", timeStart:" + String(timeStart)));
_local1 = (_local1 + (", timeComplete:" + String(timeComplete)));
_local1 = (_local1 + (", useFrames:" + String(useFrames)));
_local1 = (_local1 + (", transition:" + String(transition)));
if (skipUpdates){
_local1 = (_local1 + (", skipUpdates:" + String(skipUpdates)));
};
if (updatesSkipped){
_local1 = (_local1 + (", updatesSkipped:" + String(updatesSkipped)));
};
if (Boolean(onStart)){
_local1 = (_local1 + (", onStart:" + String(onStart)));
};
if (Boolean(onUpdate)){
_local1 = (_local1 + (", onUpdate:" + String(onUpdate)));
};
if (Boolean(onComplete)){
_local1 = (_local1 + (", onComplete:" + String(onComplete)));
};
if (Boolean(onOverwrite)){
_local1 = (_local1 + (", onOverwrite:" + String(onOverwrite)));
};
if (Boolean(onError)){
_local1 = (_local1 + (", onError:" + String(onError)));
};
if (onStartParams){
_local1 = (_local1 + (", onStartParams:" + String(onStartParams)));
};
if (onUpdateParams){
_local1 = (_local1 + (", onUpdateParams:" + String(onUpdateParams)));
};
if (onCompleteParams){
_local1 = (_local1 + (", onCompleteParams:" + String(onCompleteParams)));
};
if (onOverwriteParams){
_local1 = (_local1 + (", onOverwriteParams:" + String(onOverwriteParams)));
};
if (rounded){
_local1 = (_local1 + (", rounded:" + String(rounded)));
};
if (isPaused){
_local1 = (_local1 + (", isPaused:" + String(isPaused)));
};
if (timePaused){
_local1 = (_local1 + (", timePaused:" + String(timePaused)));
};
if (isCaller){
_local1 = (_local1 + (", isCaller:" + String(isCaller)));
};
if (count){
_local1 = (_local1 + (", count:" + String(count)));
};
if (timesCalled){
_local1 = (_local1 + (", timesCalled:" + String(timesCalled)));
};
if (waitFrames){
_local1 = (_local1 + (", waitFrames:" + String(waitFrames)));
};
if (hasStarted){
_local1 = (_local1 + (", hasStarted:" + String(hasStarted)));
};
_local1 = (_local1 + "]\n");
return (_local1);
}
public static function makePropertiesChain(_arg1:Object):Object{
var _local2:Object;
var _local3:Object;
var _local4:Object;
var _local5:Object;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local2 = _arg1.base;
if (_local2){
_local3 = {};
if ((_local2 is Array)){
_local4 = [];
_local8 = 0;
while (_local8 < _local2.length) {
_local4.push(_local2[_local8]);
_local8++;
};
} else {
_local4 = [_local2];
};
_local4.push(_arg1);
_local6 = _local4.length;
_local7 = 0;
while (_local7 < _local6) {
if (_local4[_local7]["base"]){
_local5 = AuxFunctions.concatObjects(makePropertiesChain(_local4[_local7]["base"]), _local4[_local7]);
} else {
_local5 = _local4[_local7];
};
_local3 = AuxFunctions.concatObjects(_local3, _local5);
_local7++;
};
if (_local3["base"]){
delete _local3["base"];
};
return (_local3);
//unresolved jump
};
return (_arg1);
}
}
}//package caurina.transitions
Section 42
//BBox (sandy.bounds.BBox)
package sandy.bounds {
import sandy.core.data.*;
public class BBox {
public var aTCorners:Array;
public var max:Vector;
public var tmax:Vector;
public var min:Vector;
public var uptodate:Boolean;// = false
public var aCorners:Array;
public var tmin:Vector;
public function BBox(_arg1:Vector=null, _arg2:Vector=null){
uptodate = false;
super();
min = ((_arg1)!=null) ? _arg1 : new Vector(-0.5, -0.5, -0.5);
max = ((_arg2)!=null) ? _arg2 : new Vector(0.5, 0.5, 0.5);
tmin = new Vector();
tmax = new Vector();
aCorners = new Array(8);
aTCorners = new Array(8);
__computeCorners(false);
}
public function transform(_arg1:Matrix4):void{
var _local2:Vector;
var _local3:uint;
aTCorners[0].copy(aCorners[0]);
_arg1.vectorMult(aTCorners[0]);
tmin.copy(aTCorners[0]);
tmax.copy(tmin);
_local3 = 1;
while (_local3 < 8) {
aTCorners[_local3].copy(aCorners[_local3]);
_arg1.vectorMult(aTCorners[_local3]);
_local2 = aTCorners[_local3];
if (_local2.x < tmin.x){
tmin.x = _local2.x;
} else {
if (_local2.x > tmax.x){
tmax.x = _local2.x;
};
};
if (_local2.y < tmin.y){
tmin.y = _local2.y;
} else {
if (_local2.y > tmax.y){
tmax.y = _local2.y;
};
};
if (_local2.z < tmin.z){
tmin.z = _local2.z;
} else {
if (_local2.z > tmax.z){
tmax.z = _local2.z;
};
};
_local3++;
};
uptodate = true;
}
public function getCenter():Vector{
return (new Vector(((max.x + min.x) / 2), ((max.y + min.y) / 2), ((max.z + min.z) / 2)));
}
private function __computeCorners(_arg1:Boolean=false):Array{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
if (_arg1 == true){
_local2 = tmin.x;
_local3 = tmin.y;
_local4 = tmin.z;
_local5 = tmax.x;
_local6 = tmax.y;
_local7 = tmax.z;
} else {
_local2 = min.x;
_local3 = min.y;
_local4 = min.z;
_local5 = max.x;
_local6 = max.y;
_local7 = max.z;
};
aTCorners[0] = new Vector();
aCorners[0] = new Vector(_local2, _local6, _local7);
aTCorners[1] = new Vector();
aCorners[1] = new Vector(_local5, _local6, _local7);
aTCorners[2] = new Vector();
aCorners[2] = new Vector(_local5, _local3, _local7);
aTCorners[3] = new Vector();
aCorners[3] = new Vector(_local2, _local3, _local7);
aTCorners[4] = new Vector();
aCorners[4] = new Vector(_local2, _local6, _local4);
aTCorners[5] = new Vector();
aCorners[5] = new Vector(_local5, _local6, _local4);
aTCorners[6] = new Vector();
aCorners[6] = new Vector(_local5, _local3, _local4);
aTCorners[7] = new Vector();
aCorners[7] = new Vector(_local2, _local3, _local4);
return (aCorners);
}
public function clone():BBox{
var _local1:BBox;
_local1 = new BBox();
_local1.max = max.clone();
_local1.min = min.clone();
_local1.tmax = tmax.clone();
_local1.tmin = tmin.clone();
return (_local1);
}
public function getSize():Vector{
return (new Vector(Math.abs((max.x - min.x)), Math.abs((max.y - min.y)), Math.abs((max.z - min.z))));
}
public function toString():String{
return ("sandy.bounds.BBox");
}
public static function create(_arg1:Array):BBox{
var _local2:Number;
var _local3:Vector;
var _local4:Vector;
var _local5:Array;
if (_arg1.length == 0){
return (null);
};
_local2 = _arg1.length;
_local3 = new Vector();
_local4 = new Vector();
_local5 = _arg1.sortOn(["x"], [(Array.NUMERIC | Array.RETURNINDEXEDARRAY)]);
_local3.x = _arg1[_local5[0]].x;
_local4.x = _arg1[_local5[(_local5.length - 1)]].x;
_local5 = _arg1.sortOn(["y"], [(Array.NUMERIC | Array.RETURNINDEXEDARRAY)]);
_local3.y = _arg1[_local5[0]].y;
_local4.y = _arg1[_local5[(_local5.length - 1)]].y;
_local5 = _arg1.sortOn(["z"], [(Array.NUMERIC | Array.RETURNINDEXEDARRAY)]);
_local3.z = _arg1[_local5[0]].z;
_local4.z = _arg1[_local5[(_local5.length - 1)]].z;
return (new BBox(_local3, _local4));
}
}
}//package sandy.bounds
Section 43
//BSphere (sandy.bounds.BSphere)
package sandy.bounds {
import sandy.core.data.*;
public final class BSphere {
public var uptodate:Boolean;// = false
public var position:Vector;
public var radius:Number;// = 1
public var center:Vector;
public function BSphere(){
uptodate = false;
center = new Vector();
radius = 1;
position = new Vector();
super();
}
public function transform(_arg1:Matrix4):void{
position.copy(center);
_arg1.vectorMult(position);
uptodate = true;
}
private function computeRadius(_arg1:Array):Number{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:int;
var _local8:int;
_local6 = 0;
_local8 = _arg1.length;
while (_local7 < _local8) {
_local2 = (_arg1[int(_local7)].x - center.x);
_local3 = (_arg1[int(_local7)].x - center.x);
_local4 = (_arg1[int(_local7)].x - center.x);
_local5 = (((_local2 * _local2) + (_local3 * _local3)) + (_local4 * _local4));
if (_local5 > _local6){
_local6 = _local5;
};
_local7++;
};
return (Math.sqrt(_local6));
}
private function pointsOutofSphere(_arg1:Array):Array{
var _local2:Array;
var _local3:int;
var _local4:int;
_local2 = new Array();
_local4 = _arg1.length;
while (_local3 < _local4) {
if (distance(_arg1[int(_local3)]) > 0){
_local2.push(_arg1[int(_local3)]);
};
_local3++;
};
return (_local2);
}
public function compute(_arg1:Array):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:Vertex;
var _local10:Vertex;
var _local11:Number;
var _local12:Vertex;
var _local13:Vertex;
if (_arg1.length == 0){
return;
};
_local6 = 0;
_local7 = 0;
_local8 = _arg1.length;
_local9 = _arg1[0].clone();
_local10 = _arg1[0].clone();
_local11 = 0;
while (_local6 < _local8) {
_local7 = (_local6 + 1);
while (_local7 < _local8) {
_local12 = _arg1[int(_local6)];
_local13 = _arg1[int(_local7)];
_local2 = (_local13.x - _local12.x);
_local3 = (_local13.y - _local12.y);
_local4 = (_local13.z - _local12.z);
_local5 = (((_local2 * _local2) + (_local3 * _local3)) + (_local4 * _local4));
if (_local5 > _local11){
_local11 = _local5;
_local9.copy(_local12);
_local10.copy(_local13);
};
_local7 = (_local7 + 1);
};
_local6 = (_local6 + 1);
};
center = new Vector(((_local9.x + _local10.x) / 2), ((_local9.y + _local10.y) / 2), ((_local9.z + _local10.z) / 2));
radius = (Math.sqrt(_local11) / 2);
}
public function toString():String{
return ((((("sandy.bounds.BSphere (center : " + center) + ", radius : ") + radius) + ")"));
}
public function distance(_arg1:Vector):Number{
var _local2:Number;
var _local3:Number;
var _local4:Number;
_local2 = (_arg1.x - center.x);
_local3 = (_arg1.y - center.y);
_local4 = (_arg1.z - center.z);
return ((Math.sqrt((((_local2 * _local2) + (_local3 * _local3)) + (_local4 * _local4))) - radius));
}
public static function create(_arg1:Array):BSphere{
var _local2:BSphere;
_local2 = new (BSphere);
_local2.compute(_arg1);
return (_local2);
}
}
}//package sandy.bounds
Section 44
//Command (sandy.commands.Command)
package sandy.commands {
import flash.events.*;
public interface Command {
function execute(_arg1:Event=null):void;
}
}//package sandy.commands
Section 45
//Delegate (sandy.commands.Delegate)
package sandy.commands {
import flash.events.*;
public class Delegate implements Command {
private var _a:Array;
private var _f:Function;
public function Delegate(_arg1:Function, ... _args){
_f = _arg1;
_a = _args;
}
public function getArguments():Array{
return (_a);
}
public function setArgumentsArray(_arg1:Array):void{
if (_arg1.length > 0){
_a = _arg1;
};
}
public function addArgumentsArray(_arg1:Array):void{
if (_arg1.length > 0){
_a = _a.concat(_arg1);
};
}
public function toString():String{
return ("sandy.commands.Delegate");
}
public function handleEvent(_arg1:Event):void{
this.execute(_arg1);
}
public function setArguments(... _args):void{
if (_args.length > 0){
_a = _args;
};
}
public function addArguments(... _args):void{
if (_args.length > 0){
_a = _a.concat(_args);
};
}
public function callFunction(){
return (_f.apply(null, _a));
}
public function execute(_arg1:Event=null):void{
var _local2:Array;
_local2 = new Array();
if (_arg1 != null){
_local2.push(_arg1);
};
_f.apply(null, ((_a.length)>0) ? _local2.concat(_a) : ((_local2.length)>0) ? _local2 : null);
}
public static function create(_arg1:Function, ... _args):Function{
var method = _arg1;
var args = _args;
return (function (... _args){
return (method.apply(null, ((_args.length > 0)) ? ((args.length > 0)) ? _args.concat(args) : _args : ((args.length > 0)) ? args : null));
});
}
public static function createAppend(_arg1:Function, ... _args):Function{
var method = _arg1;
var args = _args;
return (function (... _args){
return (method.apply(null, ((_args.length > 0)) ? ((args.length > 0)) ? args.concat(_args) : _args : ((args.length > 0)) ? args : null));
});
}
}
}//package sandy.commands
Section 46
//Edge3D (sandy.core.data.Edge3D)
package sandy.core.data {
public final class Edge3D {
public var vertex1:Vertex;
public var vertex2:Vertex;
public var vertexId1:uint;
public var vertexId2:uint;
public function Edge3D(_arg1:uint, _arg2:uint){
vertexId1 = _arg1;
vertexId2 = _arg2;
}
public function clone():Edge3D{
var _local1:Edge3D;
_local1 = new Edge3D(vertexId1, vertexId2);
return (_local1);
}
}
}//package sandy.core.data
Section 47
//Matrix4 (sandy.core.data.Matrix4)
package sandy.core.data {
import sandy.math.*;
import sandy.util.*;
public final class Matrix4 {
private const _fastMathInitialized:Boolean;
public var n11:Number;
public var n12:Number;
public var n13:Number;
public var n14:Number;
public var n21:Number;
public var n22:Number;
public var n23:Number;
public var n24:Number;
public var n31:Number;
public var n32:Number;
public var n33:Number;
public var n34:Number;
public var n41:Number;
public var n42:Number;
public var n43:Number;
public var n44:Number;
public static const USE_FAST_MATH:Boolean = false;
public function Matrix4(_arg1:Number=1, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0, _arg5:Number=0, _arg6:Number=1, _arg7:Number=0, _arg8:Number=0, _arg9:Number=0, _arg10:Number=0, _arg11:Number=1, _arg12:Number=0, _arg13:Number=0, _arg14:Number=0, _arg15:Number=0, _arg16:Number=1){
_fastMathInitialized = FastMath.initialized;
super();
n11 = _arg1;
n12 = _arg2;
n13 = _arg3;
n14 = _arg4;
n21 = _arg5;
n22 = _arg6;
n23 = _arg7;
n24 = _arg8;
n31 = _arg9;
n32 = _arg10;
n33 = _arg11;
n34 = _arg12;
n41 = _arg13;
n42 = _arg14;
n43 = _arg15;
n44 = _arg16;
}
final public function multiply3x3(_arg1:Matrix4):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
_local2 = n11;
_local3 = _arg1.n11;
_local4 = n21;
_local5 = _arg1.n21;
_local6 = n31;
_local7 = _arg1.n31;
_local8 = n12;
_local9 = _arg1.n12;
_local10 = n22;
_local11 = _arg1.n22;
_local12 = n32;
_local13 = _arg1.n32;
_local14 = n13;
_local15 = _arg1.n13;
_local16 = n23;
_local17 = _arg1.n23;
_local18 = n33;
_local19 = _arg1.n33;
n11 = (((_local2 * _local3) + (_local8 * _local5)) + (_local14 * _local7));
n12 = (((_local2 * _local9) + (_local8 * _local11)) + (_local14 * _local13));
n13 = (((_local2 * _local15) + (_local8 * _local17)) + (_local14 * _local19));
n21 = (((_local4 * _local3) + (_local10 * _local5)) + (_local16 * _local7));
n22 = (((_local4 * _local9) + (_local10 * _local11)) + (_local16 * _local13));
n23 = (((_local4 * _local15) + (_local10 * _local17)) + (_local16 * _local19));
n31 = (((_local6 * _local3) + (_local12 * _local5)) + (_local18 * _local7));
n32 = (((_local6 * _local9) + (_local12 * _local11)) + (_local18 * _local13));
n33 = (((_local6 * _local15) + (_local12 * _local17)) + (_local18 * _local19));
n14 = (n24 = (n34 = (n41 = (n42 = (n43 = 0)))));
n44 = 1;
}
final public function vectorMult(_arg1:Vector):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
_local2 = _arg1.x;
_local3 = _arg1.y;
_local4 = _arg1.z;
_arg1.x = ((((_local2 * n11) + (_local3 * n12)) + (_local4 * n13)) + n14);
_arg1.y = ((((_local2 * n21) + (_local3 * n22)) + (_local4 * n23)) + n24);
_arg1.z = ((((_local2 * n31) + (_local3 * n32)) + (_local4 * n33)) + n34);
}
final public function rotationY(_arg1:Number):void{
var _local2:Number;
var _local3:Number;
identity();
_arg1 = NumberUtil.toRadian(_arg1);
_local2 = ((USE_FAST_MATH)==false) ? Math.cos(_arg1) : FastMath.cos(_arg1);
_local3 = ((USE_FAST_MATH)==false) ? Math.sin(_arg1) : FastMath.sin(_arg1);
n11 = _local2;
n13 = -(_local3);
n31 = _local3;
n33 = _local2;
}
final public function rotationZ(_arg1:Number):void{
var _local2:Number;
var _local3:Number;
identity();
_arg1 = NumberUtil.toRadian(_arg1);
_local2 = ((USE_FAST_MATH)==false) ? Math.cos(_arg1) : FastMath.cos(_arg1);
_local3 = ((USE_FAST_MATH)==false) ? Math.sin(_arg1) : FastMath.sin(_arg1);
n11 = _local2;
n12 = -(_local3);
n21 = _local3;
n22 = _local2;
}
final public function eulerRotation(_arg1:Number, _arg2:Number, _arg3:Number):void{
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
identity();
_arg1 = -(NumberUtil.toRadian(_arg1));
_arg2 = NumberUtil.toRadian(_arg2);
_arg3 = -(NumberUtil.toRadian(_arg3));
_local4 = ((USE_FAST_MATH)==false) ? Math.cos(_arg1) : FastMath.cos(_arg1);
_local5 = ((USE_FAST_MATH)==false) ? Math.sin(_arg1) : FastMath.sin(_arg1);
_local6 = ((USE_FAST_MATH)==false) ? Math.cos(_arg2) : FastMath.cos(_arg2);
_local7 = ((USE_FAST_MATH)==false) ? Math.sin(_arg2) : FastMath.sin(_arg2);
_local8 = ((USE_FAST_MATH)==false) ? Math.cos(_arg3) : FastMath.cos(_arg3);
_local9 = ((USE_FAST_MATH)==false) ? Math.sin(_arg3) : FastMath.sin(_arg3);
_local10 = (_local4 * _local7);
_local11 = (_local5 * _local7);
n11 = (_local6 * _local8);
n12 = (_local6 * _local9);
n13 = -(_local7);
n21 = ((_local11 * _local8) - (_local4 * _local9));
n22 = ((_local11 * _local9) + (_local4 * _local8));
n23 = (_local5 * _local6);
n31 = ((_local10 * _local8) + (_local5 * _local9));
n32 = ((_local10 * _local9) - (_local5 * _local8));
n33 = (_local4 * _local6);
}
final public function rotationX(_arg1:Number):void{
var _local2:Number;
var _local3:Number;
identity();
_arg1 = NumberUtil.toRadian(_arg1);
_local2 = ((USE_FAST_MATH)==false) ? Math.cos(_arg1) : FastMath.cos(_arg1);
_local3 = ((USE_FAST_MATH)==false) ? Math.sin(_arg1) : FastMath.sin(_arg1);
n22 = _local2;
n23 = -(_local3);
n32 = _local3;
n33 = _local2;
}
final public function multiply(_arg1:Matrix4):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
var _local27:Number;
var _local28:Number;
var _local29:Number;
var _local30:Number;
var _local31:Number;
var _local32:Number;
var _local33:Number;
_local2 = n11;
_local3 = n21;
_local4 = n31;
_local5 = n41;
_local6 = n12;
_local7 = n22;
_local8 = n32;
_local9 = n42;
_local10 = n13;
_local11 = n23;
_local12 = n33;
_local13 = n43;
_local14 = n14;
_local15 = n24;
_local16 = n34;
_local17 = n44;
_local18 = _arg1.n11;
_local19 = _arg1.n21;
_local20 = _arg1.n31;
_local21 = _arg1.n41;
_local22 = _arg1.n12;
_local23 = _arg1.n22;
_local24 = _arg1.n32;
_local25 = _arg1.n42;
_local26 = _arg1.n13;
_local27 = _arg1.n23;
_local28 = _arg1.n33;
_local29 = _arg1.n43;
_local30 = _arg1.n14;
_local31 = _arg1.n24;
_local32 = _arg1.n34;
_local33 = _arg1.n44;
n11 = ((((_local2 * _local18) + (_local6 * _local19)) + (_local10 * _local20)) + (_local14 * _local21));
n12 = ((((_local2 * _local22) + (_local6 * _local23)) + (_local10 * _local24)) + (_local14 * _local25));
n13 = ((((_local2 * _local26) + (_local6 * _local27)) + (_local10 * _local28)) + (_local14 * _local29));
n14 = ((((_local2 * _local30) + (_local6 * _local31)) + (_local10 * _local32)) + (_local14 * _local33));
n21 = ((((_local3 * _local18) + (_local7 * _local19)) + (_local11 * _local20)) + (_local15 * _local21));
n22 = ((((_local3 * _local22) + (_local7 * _local23)) + (_local11 * _local24)) + (_local15 * _local25));
n23 = ((((_local3 * _local26) + (_local7 * _local27)) + (_local11 * _local28)) + (_local15 * _local29));
n24 = ((((_local3 * _local30) + (_local7 * _local31)) + (_local11 * _local32)) + (_local15 * _local33));
n31 = ((((_local4 * _local18) + (_local8 * _local19)) + (_local12 * _local20)) + (_local16 * _local21));
n32 = ((((_local4 * _local22) + (_local8 * _local23)) + (_local12 * _local24)) + (_local16 * _local25));
n33 = ((((_local4 * _local26) + (_local8 * _local27)) + (_local12 * _local28)) + (_local16 * _local29));
n34 = ((((_local4 * _local30) + (_local8 * _local31)) + (_local12 * _local32)) + (_local16 * _local33));
n41 = ((((_local5 * _local18) + (_local9 * _local19)) + (_local13 * _local20)) + (_local17 * _local21));
n42 = ((((_local5 * _local22) + (_local9 * _local23)) + (_local13 * _local24)) + (_local17 * _local25));
n43 = ((((_local5 * _local26) + (_local9 * _local27)) + (_local13 * _local28)) + (_local17 * _local29));
n44 = ((((_local5 * _local30) + (_local9 * _local31)) + (_local13 * _local32)) + (_local17 * _local33));
}
final public function axisRotationWithReference(_arg1:Vector, _arg2:Vector, _arg3:Number):void{
var _local4:Matrix4;
var _local5:Number;
_local4 = new Matrix4();
_local5 = ((_arg3 + 360) % 360);
translation(_arg2.x, _arg2.y, _arg2.z);
_local4.axisRotation(_arg1.x, _arg1.y, _arg1.z, _local5);
multiply(_local4);
_local4.translation(-(_arg2.x), -(_arg2.y), -(_arg2.z));
multiply(_local4);
_local4 = null;
}
final public function getTrace():Number{
return ((((n11 + n22) + n33) + n44));
}
final public function zero():void{
n11 = 0;
n12 = 0;
n13 = 0;
n14 = 0;
n21 = 0;
n22 = 0;
n23 = 0;
n24 = 0;
n31 = 0;
n32 = 0;
n33 = 0;
n34 = 0;
n41 = 0;
n42 = 0;
n43 = 0;
n44 = 0;
}
final public function translation(_arg1:Number, _arg2:Number, _arg3:Number):void{
identity();
n14 = _arg1;
n24 = _arg2;
n34 = _arg3;
}
final public function scaleVector(_arg1:Vector):void{
identity();
n11 = _arg1.x;
n22 = _arg1.y;
n33 = _arg1.z;
}
final public function det():Number{
return (((((((((n11 * n22) - (n21 * n12)) * ((n33 * n44) - (n43 * n34))) - (((n11 * n32) - (n31 * n12)) * ((n23 * n44) - (n43 * n24)))) + (((n11 * n42) - (n41 * n12)) * ((n23 * n34) - (n33 * n24)))) + (((n21 * n32) - (n31 * n22)) * ((n13 * n44) - (n43 * n14)))) - (((n21 * n42) - (n41 * n22)) * ((n13 * n34) - (n33 * n14)))) + (((n31 * n42) - (n41 * n32)) * ((n13 * n24) - (n23 * n14)))));
}
final public function inverse():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
_local1 = det();
if (Math.abs(_local1) < 0.001){
throw (new Error("cannot invert a matrix with a null determinant"));
};
_local1 = (1 / _local1);
_local2 = n11;
_local3 = n21;
_local4 = n31;
_local5 = n41;
_local6 = n12;
_local7 = n22;
_local8 = n32;
_local9 = n42;
_local10 = n13;
_local11 = n23;
_local12 = n33;
_local13 = n43;
_local14 = n14;
_local15 = n24;
_local16 = n34;
_local17 = n44;
n11 = (_local1 * (((_local7 * ((_local12 * _local17) - (_local13 * _local16))) - (_local8 * ((_local11 * _local17) - (_local13 * _local15)))) + (_local9 * ((_local11 * _local16) - (_local12 * _local15)))));
n12 = (-(_local1) * (((_local6 * ((_local12 * _local17) - (_local13 * _local16))) - (_local8 * ((_local10 * _local17) - (_local13 * _local14)))) + (_local9 * ((_local10 * _local16) - (_local12 * _local14)))));
n13 = (_local1 * (((_local6 * ((_local11 * _local17) - (_local13 * _local15))) - (_local7 * ((_local10 * _local17) - (_local13 * _local14)))) + (_local9 * ((_local10 * _local15) - (_local11 * _local14)))));
n14 = (-(_local1) * (((_local6 * ((_local11 * _local16) - (_local12 * _local15))) - (_local7 * ((_local10 * _local16) - (_local12 * _local14)))) + (_local8 * ((_local10 * _local15) - (_local11 * _local14)))));
n21 = (-(_local1) * (((_local3 * ((_local12 * _local17) - (_local13 * _local16))) - (_local4 * ((_local11 * _local17) - (_local13 * _local15)))) + (_local5 * ((_local11 * _local16) - (_local12 * _local15)))));
n22 = (_local1 * (((_local2 * ((_local12 * _local17) - (_local13 * _local16))) - (_local4 * ((_local10 * _local17) - (_local13 * _local14)))) + (_local5 * ((_local10 * _local16) - (_local12 * _local14)))));
n23 = (-(_local1) * (((_local2 * ((_local11 * _local17) - (_local13 * _local15))) - (_local3 * ((_local10 * _local17) - (_local13 * _local14)))) + (_local5 * ((_local10 * _local15) - (_local11 * _local14)))));
n24 = (_local1 * (((_local2 * ((_local11 * _local16) - (_local12 * _local15))) - (_local3 * ((_local10 * _local16) - (_local12 * _local14)))) + (_local4 * ((_local10 * _local15) - (_local11 * _local14)))));
n31 = (_local1 * (((_local3 * ((_local8 * _local17) - (_local9 * _local16))) - (_local4 * ((_local7 * _local17) - (_local9 * _local15)))) + (_local5 * ((_local7 * _local16) - (_local8 * _local15)))));
n32 = (-(_local1) * (((_local2 * ((_local8 * _local17) - (_local9 * _local16))) - (_local4 * ((_local6 * _local17) - (_local9 * _local14)))) + (_local5 * ((_local6 * _local16) - (_local8 * _local14)))));
n33 = (_local1 * (((_local2 * ((_local7 * _local17) - (_local9 * _local15))) - (_local3 * ((_local6 * _local17) - (_local9 * _local14)))) + (_local5 * ((_local6 * _local15) - (_local7 * _local14)))));
n34 = (-(_local1) * (((_local2 * ((_local7 * _local16) - (_local8 * _local15))) - (_local3 * ((_local6 * _local16) - (_local8 * _local14)))) + (_local4 * ((_local6 * _local15) - (_local7 * _local14)))));
n41 = (-(_local1) * (((_local3 * ((_local8 * _local13) - (_local9 * _local12))) - (_local4 * ((_local7 * _local13) - (_local9 * _local11)))) + (_local5 * ((_local7 * _local12) - (_local8 * _local11)))));
n42 = (_local1 * (((_local2 * ((_local8 * _local13) - (_local9 * _local12))) - (_local4 * ((_local6 * _local13) - (_local9 * _local10)))) + (_local5 * ((_local6 * _local12) - (_local8 * _local10)))));
n43 = (-(_local1) * (((_local2 * ((_local7 * _local13) - (_local9 * _local11))) - (_local3 * ((_local6 * _local13) - (_local9 * _local10)))) + (_local5 * ((_local6 * _local11) - (_local7 * _local10)))));
n44 = (_local1 * (((_local2 * ((_local7 * _local12) - (_local8 * _local11))) - (_local3 * ((_local6 * _local12) - (_local8 * _local10)))) + (_local4 * ((_local6 * _local11) - (_local7 * _local10)))));
}
final public function vectorMult3x3(_arg1:Vector):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
_local2 = _arg1.x;
_local3 = _arg1.y;
_local4 = _arg1.z;
_arg1.x = (((_local2 * n11) + (_local3 * n12)) + (_local4 * n13));
_arg1.y = (((_local2 * n21) + (_local3 * n22)) + (_local4 * n23));
_arg1.z = (((_local2 * n31) + (_local3 * n32)) + (_local4 * n33));
}
final public function identity():void{
n11 = 1;
n12 = 0;
n13 = 0;
n14 = 0;
n21 = 0;
n22 = 1;
n23 = 0;
n24 = 0;
n31 = 0;
n32 = 0;
n33 = 1;
n34 = 0;
n41 = 0;
n42 = 0;
n43 = 0;
n44 = 1;
}
final public function axisRotation(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):void{
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;
identity();
_arg4 = NumberUtil.toRadian(_arg4);
_local5 = ((USE_FAST_MATH)==false) ? Math.cos(_arg4) : FastMath.cos(_arg4);
_local6 = ((USE_FAST_MATH)==false) ? Math.sin(_arg4) : FastMath.sin(_arg4);
_local7 = (1 - _local5);
_local8 = ((_arg1 * _arg2) * _local7);
_local9 = ((_arg2 * _arg3) * _local7);
_local10 = ((_arg1 * _arg3) * _local7);
_local11 = (_local6 * _arg3);
_local12 = (_local6 * _arg2);
_local13 = (_local6 * _arg1);
n11 = (_local5 + ((_arg1 * _arg1) * _local7));
n12 = (-(_local11) + _local8);
n13 = (_local12 + _local10);
n21 = (_local11 + _local8);
n22 = (_local5 + ((_arg2 * _arg2) * _local7));
n23 = (-(_local13) + _local9);
n31 = (-(_local12) + _local10);
n32 = (_local13 + _local9);
n33 = (_local5 + ((_arg3 * _arg3) * _local7));
}
final public function getEulerAngles():Vector{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
_local1 = 57.295779513;
_local2 = (Math.asin(-(this.n13)) * _local1);
if (!NumberUtil.isZero((Math.abs(this.n13) - 1))){
_local3 = (-(Math.atan2(this.n23, this.n33)) * _local1);
_local4 = (-(Math.atan2(this.n12, this.n11)) * _local1);
} else {
_local3 = 0;
_local4 = Math.atan2(-(this.n21), this.n22);
};
if (_local3 < 0){
_local3 = (_local3 + 360);
};
if (_local2 < 0){
_local2 = (_local2 + 360);
};
if (_local4 < 0){
_local4 = (_local4 + 360);
};
return (new Vector(_local3, _local2, _local4));
}
final public function addMatrix(_arg1:Matrix4):void{
n11 = (n11 + _arg1.n11);
n12 = (n12 + _arg1.n12);
n13 = (n13 + _arg1.n13);
n14 = (n14 + _arg1.n14);
n21 = (n21 + _arg1.n21);
n22 = (n22 + _arg1.n22);
n23 = (n23 + _arg1.n23);
n24 = (n24 + _arg1.n24);
n31 = (n31 + _arg1.n31);
n32 = (n32 + _arg1.n32);
n33 = (n33 + _arg1.n33);
n34 = (n34 + _arg1.n34);
n41 = (n41 + _arg1.n41);
n42 = (n42 + _arg1.n42);
n43 = (n43 + _arg1.n43);
n44 = (n44 + _arg1.n44);
}
final public function scale(_arg1:Number, _arg2:Number, _arg3:Number):void{
identity();
n11 = _arg1;
n22 = _arg2;
n33 = _arg3;
}
final public function multiply4x3(_arg1:Matrix4):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
_local2 = n11;
_local3 = _arg1.n11;
_local4 = n21;
_local5 = _arg1.n21;
_local6 = n31;
_local7 = _arg1.n31;
_local8 = n12;
_local9 = _arg1.n12;
_local10 = n22;
_local11 = _arg1.n22;
_local12 = n32;
_local13 = _arg1.n32;
_local14 = n13;
_local15 = _arg1.n13;
_local16 = n23;
_local17 = _arg1.n23;
_local18 = n33;
_local19 = _arg1.n33;
_local20 = _arg1.n14;
_local21 = _arg1.n24;
_local22 = _arg1.n34;
n11 = (((_local2 * _local3) + (_local8 * _local5)) + (_local14 * _local7));
n12 = (((_local2 * _local9) + (_local8 * _local11)) + (_local14 * _local13));
n13 = (((_local2 * _local15) + (_local8 * _local17)) + (_local14 * _local19));
n14 = ((((_local20 * _local2) + (_local21 * _local8)) + (_local22 * _local14)) + n14);
n21 = (((_local4 * _local3) + (_local10 * _local5)) + (_local16 * _local7));
n22 = (((_local4 * _local9) + (_local10 * _local11)) + (_local16 * _local13));
n23 = (((_local4 * _local15) + (_local10 * _local17)) + (_local16 * _local19));
n24 = ((((_local20 * _local4) + (_local21 * _local10)) + (_local22 * _local16)) + n24);
n31 = (((_local6 * _local3) + (_local12 * _local5)) + (_local18 * _local7));
n32 = (((_local6 * _local9) + (_local12 * _local11)) + (_local18 * _local13));
n33 = (((_local6 * _local15) + (_local12 * _local17)) + (_local18 * _local19));
n34 = ((((_local20 * _local6) + (_local21 * _local12)) + (_local22 * _local18)) + n34);
n41 = (n42 = (n43 = 0));
n44 = 1;
}
final public function det3x3():Number{
return ((((n11 * ((n22 * n33) - (n23 * n32))) + (n21 * ((n32 * n13) - (n12 * n33)))) + (n31 * ((n12 * n23) - (n22 * n13)))));
}
final public function translationVector(_arg1:Vector):void{
identity();
n14 = _arg1.x;
n24 = _arg1.y;
n34 = _arg1.z;
}
final public function clone():Matrix4{
return (new Matrix4(n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44));
}
public function serialize(_arg1:Number=1E-6):String{
var _local2:Function;
var _local3:String;
_local2 = NumberUtil.roundTo;
_local3 = new String("");
_local3 = (_local3 + (((((((_local2(n11, _arg1) + ",") + _local2(n12, _arg1)) + ",") + _local2(n13, _arg1)) + ",") + _local2(n14, _arg1)) + ","));
_local3 = (_local3 + (((((((_local2(n21, _arg1) + ",") + _local2(n22, _arg1)) + ",") + _local2(n23, _arg1)) + ",") + _local2(n24, _arg1)) + ","));
_local3 = (_local3 + (((((((_local2(n31, _arg1) + ",") + _local2(n32, _arg1)) + ",") + _local2(n33, _arg1)) + ",") + _local2(n34, _arg1)) + ","));
_local3 = (_local3 + ((((((_local2(n41, _arg1) + ",") + _local2(n42, _arg1)) + ",") + _local2(n43, _arg1)) + ",") + _local2(n44, _arg1)));
return (_local3);
}
final public function axisRotationVector(_arg1:Vector, _arg2:Number):void{
axisRotation(_arg1.x, _arg1.y, _arg1.z, _arg2);
}
final public function toString():String{
var _local1:String;
_local1 = ("sandy.core.data.Matrix4" + "\n (");
_local1 = (_local1 + (((((((n11 + "\t") + n12) + "\t") + n13) + "\t") + n14) + "\n"));
_local1 = (_local1 + (((((((n21 + "\t") + n22) + "\t") + n23) + "\t") + n24) + "\n"));
_local1 = (_local1 + (((((((n31 + "\t") + n32) + "\t") + n33) + "\t") + n34) + "\n"));
_local1 = (_local1 + (((((((n41 + "\t") + n42) + "\t") + n43) + "\t") + n44) + "\n)"));
return (_local1);
}
final public function copy(_arg1:Matrix4):void{
n11 = _arg1.n11;
n12 = _arg1.n12;
n13 = _arg1.n13;
n14 = _arg1.n14;
n21 = _arg1.n21;
n22 = _arg1.n22;
n23 = _arg1.n23;
n24 = _arg1.n24;
n31 = _arg1.n31;
n32 = _arg1.n32;
n33 = _arg1.n33;
n34 = _arg1.n34;
n41 = _arg1.n41;
n42 = _arg1.n42;
n43 = _arg1.n43;
n44 = _arg1.n44;
}
final public function getTranslation():Vector{
return (new Vector(n14, n24, n34));
}
public static function deserialize(_arg1:String):Matrix4{
var _local2:Array;
var _local3:Number;
var _local4:Matrix4;
_local2 = _arg1.split(",");
if (_local2.length != 16){
};
_local3 = 0;
while (_local3 < _local2.length) {
_local2[_local3] = Number(_local2[_local3]);
_local3++;
};
_local4 = new Matrix4(_local2[0], _local2[1], _local2[2], _local2[3], _local2[4], _local2[5], _local2[6], _local2[7], _local2[8], _local2[9], _local2[10], _local2[11], _local2[12], _local2[13], _local2[14], _local2[15]);
return (_local4);
}
}
}//package sandy.core.data
Section 48
//Plane (sandy.core.data.Plane)
package sandy.core.data {
public final class Plane {
public var a:Number;
public var c:Number;
public var b:Number;
public var d:Number;
public function Plane(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0){
this.a = _arg1;
this.b = _arg2;
this.c = _arg3;
this.d = _arg4;
}
public function toString():String{
return (((((((((("sandy.core.data.Plane" + "(a:") + a) + ", b:") + b) + ", c:") + c) + ", d:") + d) + ")"));
}
}
}//package sandy.core.data
Section 49
//Polygon (sandy.core.data.Polygon)
package sandy.core.data {
import flash.events.*;
import sandy.materials.*;
import sandy.core.scenegraph.*;
import sandy.core.*;
import flash.display.*;
import sandy.events.*;
import sandy.view.*;
import flash.geom.*;
import flash.utils.*;
import sandy.core.interaction.*;
import sandy.core.sorters.*;
import sandy.math.*;
public final class Polygon implements IDisplayable {
public const id:uint;
public var vertices:Array;
protected var m_oEB:BubbleEventBroadcaster;
public var scene:Scene3D;
protected var m_oContainer:Sprite;
private var m_nDepth:Number;
private var m_nNormalId:uint;
public var shape:Shape3D;
private var mouseEvents:Boolean;// = false
public var vertexNormals:Array;
public var aNeighboors:Array;
public var isClipped:Boolean;// = false
public var caUVCoord:Array;
public var hasAppearanceChanged:Boolean;// = false
private var m_oGeometry:Geometry3D;
public var uvBounds:Rectangle;
public var minZ:Number;
public var aUVCoord:Array;
private var mouseInteractivity:Boolean;// = false
public var cvertices:Array;
public var a:Vertex;
public var c:Vertex;
private var m_oAppearance:Appearance;
public var b:Vertex;
public var depthSorter:IDepthSorter;
public var visible:Boolean;
public var aEdges:Array;
private static var _ID_:uint = 0;
public static var POLYGON_MAP:Dictionary = new Dictionary(true);
public function Polygon(_arg1:Shape3D, _arg2:Geometry3D, _arg3:Array, _arg4:Array=null, _arg5:Number=0, _arg6:uint=0){
id = _ID_++;
isClipped = false;
aNeighboors = new Array();
hasAppearanceChanged = false;
m_oEB = new BubbleEventBroadcaster();
mouseEvents = false;
mouseInteractivity = false;
super();
shape = _arg1;
m_oGeometry = _arg2;
__update(_arg3, _arg4, _arg5, _arg6);
m_oContainer = new Sprite();
depthSorter = new MeanDepthSorter();
POLYGON_MAP[id] = this;
}
public function createNormal():Vector{
var _local1:Vector;
var _local2:Vector;
var _local3:Vertex;
var _local4:Vertex;
var _local5:Vertex;
var _local6:Vector;
if (vertices.length > 2){
_local3 = vertices[0];
_local4 = vertices[1];
_local5 = vertices[2];
_local1 = new Vector((_local4.x - _local3.x), (_local4.y - _local3.y), (_local4.z - _local3.z));
_local2 = new Vector((_local4.x - _local5.x), (_local4.y - _local5.y), (_local4.z - _local5.z));
_local6 = VectorMath.cross(_local1, _local2);
VectorMath.normalize(_local6);
return (_local6);
};
return (new Vector());
}
public function toString():String{
return ((((("sandy.core.data.Polygon::id=" + id) + " [Points: ") + vertices.length) + "]"));
}
public function set depth(_arg1:Number):void{
m_nDepth = _arg1;
}
public function createTransformedNormal():Vector{
var _local1:Vector;
var _local2:Vector;
var _local3:Vertex;
var _local4:Vertex;
var _local5:Vertex;
var _local6:Vector;
if (vertices.length > 2){
_local3 = vertices[0];
_local4 = vertices[1];
_local5 = vertices[2];
_local1 = new Vector((_local4.wx - _local3.wx), (_local4.wy - _local3.wy), (_local4.wz - _local3.wz));
_local2 = new Vector((_local4.wx - _local5.wx), (_local4.wy - _local5.wy), (_local4.wz - _local5.wz));
_local6 = VectorMath.cross(_local1, _local2);
VectorMath.normalize(_local6);
return (_local6);
};
return (new Vector());
}
public function get appearance():Appearance{
return (m_oAppearance);
}
protected function _onTextureInteraction(_arg1:Event=null):void{
var _local2:Point;
var _local3:UVCoord;
if ((((_arg1 == null)) || (!((_arg1 is MouseEvent))))){
_arg1 = new MouseEvent(MouseEvent.MOUSE_MOVE, true, false, 0, 0, null, false, false, false, false, 0);
};
_local2 = new Point(scene.container.mouseX, scene.container.mouseY);
_local3 = getUVFrom2D(_local2);
VirtualMouse.getInstance().interactWithTexture(this, _local3, (_arg1 as MouseEvent));
_onInteraction(_arg1);
}
public function updateNormal():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
_local1 = (((b.y - a.y) * (c.z - a.z)) - ((b.z - a.z) * (c.y - a.y)));
_local2 = (((b.z - a.z) * (c.x - a.x)) - ((b.x - a.x) * (c.z - a.z)));
_local3 = (((b.x - a.x) * (c.y - a.y)) - ((b.y - a.y) * (c.x - a.x)));
m_oGeometry.aFacesNormals[m_nNormalId].reset(_local1, _local2, _local3);
}
public function get container():Sprite{
return (m_oContainer);
}
public function swapCulling():void{
normal.negate();
}
public function get3DFrom2D(_arg1:Point):Vector{
var _local2:Matrix;
var _local3:Number;
var _local4:Number;
var _local5:Vector;
_local2 = new Matrix((vertices[1].sx - vertices[0].sx), (vertices[2].sx - vertices[0].sx), (vertices[1].sy - vertices[0].sy), (vertices[2].sy - vertices[0].sy), 0, 0);
_local2.invert();
_local3 = ((_local2.a * (_arg1.x - vertices[0].sx)) + (_local2.b * (_arg1.y - vertices[0].sy)));
_local4 = ((_local2.c * (_arg1.x - vertices[0].sx)) + (_local2.d * (_arg1.y - vertices[0].sy)));
_local5 = new Vector(((vertices[0].x + (_local3 * (vertices[1].x - vertices[0].x))) + (_local4 * (vertices[2].x - vertices[0].x))), ((vertices[0].y + (_local3 * (vertices[1].y - vertices[0].y))) + (_local4 * (vertices[2].y - vertices[0].y))), ((vertices[0].z + (_local3 * (vertices[1].z - vertices[0].z))) + (_local4 * (vertices[2].z - vertices[0].z))));
this.shape.matrix.vectorMult(_local5);
return (_local5);
}
private function __update(_arg1:Array, _arg2:Array, _arg3:uint, _arg4:uint):void{
var _local5:int;
var _local6:*;
var _local7:uint;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:*;
var _local13:UVCoord;
var _local14:Vector;
var _local15:Edge3D;
_local5 = 0;
vertexNormals = new Array();
vertices = new Array();
for each (_local6 in _arg1) {
vertices[_local5] = Vertex(m_oGeometry.aVertex[_arg1[_local5]]);
vertexNormals[_local5] = m_oGeometry.aVertexNormals[_arg1[_local5]];
_local5++;
};
a = vertices[0];
b = vertices[1];
c = vertices[2];
if (_arg2){
_local8 = Number.POSITIVE_INFINITY;
_local9 = Number.POSITIVE_INFINITY;
_local10 = Number.NEGATIVE_INFINITY;
_local11 = Number.NEGATIVE_INFINITY;
aUVCoord = new Array();
_local5 = 0;
if (_arg2){
for each (_local12 in _arg2) {
_local13 = (m_oGeometry.aUVCoords[_arg2[_local5]] as UVCoord);
if (_local13 == null){
_local13 = new UVCoord(0, 0);
};
aUVCoord[_local5] = _local13;
if (_local13.u < _local8){
_local8 = _local13.u;
} else {
if (_local13.u > _local10){
_local10 = _local13.u;
};
};
if (_local13.v < _local9){
_local9 = _local13.v;
} else {
if (_local13.v > _local11){
_local11 = _local13.v;
};
};
_local5++;
};
uvBounds = new Rectangle(_local8, _local9, (_local10 - _local8), (_local11 - _local9));
} else {
aUVCoord = [new UVCoord(), new UVCoord(), new UVCoord()];
uvBounds = new Rectangle(0, 0, 0, 0);
};
};
m_nNormalId = _arg3;
normal = Vertex(m_oGeometry.aFacesNormals[_arg3]);
if (normal == null){
_local14 = createNormal();
m_nNormalId = m_oGeometry.setFaceNormal(m_oGeometry.getNextFaceNormalID(), _local14.x, _local14.y, _local14.z);
};
aEdges = new Array();
for each (_local7 in m_oGeometry.aFaceEdges[_arg4]) {
_local15 = m_oGeometry.aEdges[_local7];
_local15.vertex1 = m_oGeometry.aVertex[_local15.vertexId1];
_local15.vertex2 = m_oGeometry.aVertex[_local15.vertexId2];
aEdges.push(_local15);
};
}
public function clipFrontPlane(_arg1:Frustum):Array{
cvertices = null;
cvertices = vertices.slice();
if (vertices.length < 3){
isClipped = _arg1.clipLineFrontPlane(cvertices);
} else {
caUVCoord = null;
caUVCoord = aUVCoord.slice();
isClipped = _arg1.clipFrontPlane(cvertices, caUVCoord);
};
return (cvertices);
}
public function get broadcaster():BubbleEventBroadcaster{
return (m_oEB);
}
public function get enableInteractivity():Boolean{
return (mouseInteractivity);
}
protected function _startMouseInteraction(_arg1:MouseEvent=null):void{
container.addEventListener(MouseEvent.CLICK, _onTextureInteraction);
container.addEventListener(MouseEvent.MOUSE_UP, _onTextureInteraction);
container.addEventListener(MouseEvent.MOUSE_DOWN, _onTextureInteraction);
container.addEventListener(MouseEvent.DOUBLE_CLICK, _onTextureInteraction);
container.addEventListener(MouseEvent.MOUSE_MOVE, _onTextureInteraction);
container.addEventListener(MouseEvent.MOUSE_OVER, _onTextureInteraction);
container.addEventListener(MouseEvent.MOUSE_OUT, _onTextureInteraction);
container.addEventListener(MouseEvent.MOUSE_WHEEL, _onTextureInteraction);
container.addEventListener(KeyboardEvent.KEY_DOWN, _onTextureInteraction);
container.addEventListener(KeyboardEvent.KEY_UP, _onTextureInteraction);
m_oContainer.addEventListener(Event.ENTER_FRAME, _onTextureInteraction);
}
public function precompute():void{
isClipped = false;
minZ = a.wz;
if (b.wz < minZ){
minZ = b.wz;
};
if (c != null){
if (c.wz < minZ){
minZ = c.wz;
};
};
m_nDepth = depthSorter.getDepth(this);
}
protected function _onInteraction(_arg1:Event):void{
var _local2:Point;
var _local3:UVCoord;
var _local4:Vector;
_local2 = new Point(m_oContainer.mouseX, m_oContainer.mouseY);
_local3 = getUVFrom2D(_local2);
_local4 = get3DFrom2D(_local2);
m_oEB.broadcastEvent(new Shape3DEvent(_arg1.type, shape, this, _local3, _local4, _arg1));
}
public function get depth():Number{
return (m_nDepth);
}
public function addEventListener(_arg1:String, _arg2):void{
m_oEB.addEventListener.apply(m_oEB, arguments);
}
public function set normal(_arg1:Vertex):void{
if (_arg1 != null){
m_oGeometry.aFacesNormals[m_nNormalId].copy(_arg1);
};
}
public function set appearance(_arg1:Appearance):void{
if (scene){
if (scene.materialManager.isRegistered(m_oAppearance.frontMaterial)){
scene.materialManager.unregister(m_oAppearance.frontMaterial);
};
if (scene.materialManager.isRegistered(m_oAppearance.backMaterial)){
scene.materialManager.unregister(m_oAppearance.backMaterial);
};
};
if (m_oAppearance){
m_oAppearance.frontMaterial.unlink(this);
if (m_oAppearance.backMaterial != m_oAppearance.frontMaterial){
m_oAppearance.backMaterial.unlink(this);
};
};
if (_arg1 != null){
m_oAppearance = _arg1;
m_oAppearance.frontMaterial.init(this);
if (m_oAppearance.backMaterial != m_oAppearance.frontMaterial){
m_oAppearance.backMaterial.init(this);
};
hasAppearanceChanged = true;
};
}
public function removeEventListener(_arg1:String, _arg2):void{
m_oEB.removeEventListener(_arg1, _arg2);
}
public function clear():void{
if (m_oContainer != null){
m_oContainer.graphics.clear();
};
}
public function clip(_arg1:Frustum):Array{
if (vertices.length < 3){
clipFrontPlane(_arg1);
} else {
cvertices = null;
caUVCoord = null;
cvertices = vertices.slice();
caUVCoord = aUVCoord.slice();
isClipped = _arg1.clipFrustum(cvertices, caUVCoord);
};
return (cvertices);
}
public function getUVFrom2D(_arg1:Point):UVCoord{
var _local2:Point;
var _local3:Point;
var _local4:Point;
var _local5:UVCoord;
var _local6:UVCoord;
var _local7:UVCoord;
var _local8:Point;
var _local9:Point;
var _local10:Point;
var _local11:Point;
var _local12:Point;
var _local13:Point;
var _local14:Point;
var _local15:Point;
var _local16:Number;
var _local17:Number;
_local2 = new Point(vertices[0].sx, vertices[0].sy);
_local3 = new Point(vertices[1].sx, vertices[1].sy);
_local4 = new Point(vertices[2].sx, vertices[2].sy);
_local5 = aUVCoord[0];
_local6 = aUVCoord[1];
_local7 = aUVCoord[2];
_local8 = new Point((_local3.x - _local2.x), (_local3.y - _local2.y));
_local9 = _local8.clone();
_local9.normalize(1);
_local10 = new Point((_local4.x - _local2.x), (_local4.y - _local2.y));
_local11 = _local10.clone();
_local11.normalize(1);
_local12 = new Point((_arg1.x - _local8.x), (_arg1.y - _local8.y));
_local13 = IntersectionMath.intersectionLine2D(_local2, _local4, _arg1, _local12);
_local14 = new Point((_local13.x - _local2.x), (_local13.y - _local2.y));
_local15 = new Point((_arg1.x - _local13.x), (_arg1.y - _local13.y));
_local16 = (_local15.length / _local8.length);
_local17 = (_local14.length / _local10.length);
return (new UVCoord(((_local5.u + (_local16 * (_local6.u - _local5.u))) + (_local17 * (_local7.u - _local5.u))), ((_local5.v + (_local16 * (_local6.v - _local5.v))) + (_local17 * (_local7.v - _local5.v)))));
}
protected function _stopMouseInteraction(_arg1:MouseEvent=null):void{
container.removeEventListener(MouseEvent.CLICK, _onTextureInteraction);
container.removeEventListener(MouseEvent.MOUSE_UP, _onTextureInteraction);
container.removeEventListener(MouseEvent.MOUSE_DOWN, _onTextureInteraction);
container.removeEventListener(MouseEvent.DOUBLE_CLICK, _onTextureInteraction);
container.removeEventListener(MouseEvent.MOUSE_MOVE, _onTextureInteraction);
container.removeEventListener(MouseEvent.MOUSE_OVER, _onTextureInteraction);
container.removeEventListener(MouseEvent.MOUSE_OUT, _onTextureInteraction);
container.removeEventListener(MouseEvent.MOUSE_WHEEL, _onTextureInteraction);
m_oContainer.removeEventListener(Event.ENTER_FRAME, _onTextureInteraction);
container.removeEventListener(KeyboardEvent.KEY_DOWN, _onTextureInteraction);
container.removeEventListener(KeyboardEvent.KEY_UP, _onTextureInteraction);
}
public function set enableInteractivity(_arg1:Boolean):void{
if (_arg1 != mouseInteractivity){
if (_arg1){
container.addEventListener(MouseEvent.ROLL_OVER, _startMouseInteraction, false);
container.addEventListener(MouseEvent.ROLL_OUT, _stopMouseInteraction, false);
} else {
_stopMouseInteraction();
};
mouseInteractivity = _arg1;
};
}
public function get normal():Vertex{
return (m_oGeometry.aFacesNormals[m_nNormalId]);
}
public function display(_arg1:Scene3D, _arg2:Sprite=null):void{
var _local3:Sprite;
scene = _arg1;
_local3 = (_arg2) ? _arg2 : m_oContainer;
if (visible){
m_oAppearance.frontMaterial.renderPolygon(_arg1, this, _local3);
} else {
m_oAppearance.backMaterial.renderPolygon(_arg1, this, _local3);
};
}
public function set enableEvents(_arg1:Boolean):void{
if (((_arg1) && (!(mouseEvents)))){
container.addEventListener(MouseEvent.CLICK, _onInteraction);
container.addEventListener(MouseEvent.MOUSE_UP, _onInteraction);
container.addEventListener(MouseEvent.MOUSE_DOWN, _onInteraction);
container.addEventListener(MouseEvent.ROLL_OVER, _onInteraction);
container.addEventListener(MouseEvent.ROLL_OUT, _onInteraction);
container.addEventListener(MouseEvent.DOUBLE_CLICK, _onInteraction);
container.addEventListener(MouseEvent.MOUSE_MOVE, _onInteraction);
container.addEventListener(MouseEvent.MOUSE_OVER, _onInteraction);
container.addEventListener(MouseEvent.MOUSE_OUT, _onInteraction);
container.addEventListener(MouseEvent.MOUSE_WHEEL, _onInteraction);
} else {
if (((!(_arg1)) && (mouseEvents))){
container.removeEventListener(MouseEvent.CLICK, _onInteraction);
container.removeEventListener(MouseEvent.MOUSE_UP, _onInteraction);
container.removeEventListener(MouseEvent.MOUSE_DOWN, _onInteraction);
container.removeEventListener(MouseEvent.ROLL_OVER, _onInteraction);
container.removeEventListener(MouseEvent.ROLL_OUT, _onInteraction);
container.removeEventListener(MouseEvent.DOUBLE_CLICK, _onInteraction);
container.removeEventListener(MouseEvent.MOUSE_MOVE, _onInteraction);
container.removeEventListener(MouseEvent.MOUSE_OVER, _onInteraction);
container.removeEventListener(MouseEvent.MOUSE_OUT, _onInteraction);
container.removeEventListener(MouseEvent.MOUSE_WHEEL, _onInteraction);
};
};
mouseEvents = _arg1;
}
public function destroy():void{
clear();
enableEvents = false;
enableInteractivity = false;
if (appearance.backMaterial){
appearance.backMaterial.unlink(this);
};
if (appearance.frontMaterial){
appearance.frontMaterial.unlink(this);
};
appearance = null;
if (m_oContainer.parent){
m_oContainer.parent.removeChild(m_oContainer);
};
if (m_oContainer){
m_oContainer = null;
};
cvertices = null;
vertices = null;
m_oEB = null;
m_oGeometry = null;
shape = null;
delete POLYGON_MAP[id];
}
public function get enableEvents():Boolean{
return (mouseEvents);
}
}
}//package sandy.core.data
Section 50
//PrimitiveFace (sandy.core.data.PrimitiveFace)
package sandy.core.data {
import sandy.materials.*;
import sandy.core.scenegraph.*;
public final class PrimitiveFace {
private var m_oAppearance:Appearance;
private var m_iPrimitive:Shape3D;
public var aPolygons:Array;
public function PrimitiveFace(_arg1:Shape3D){
aPolygons = new Array();
super();
m_iPrimitive = _arg1;
}
public function get appearance():Appearance{
return (m_oAppearance);
}
public function get primitive():Shape3D{
return (m_iPrimitive);
}
public function set appearance(_arg1:Appearance):void{
var _local2:Polygon;
m_oAppearance = _arg1;
if (m_iPrimitive.geometry){
for each (_local2 in aPolygons) {
_local2.appearance = m_oAppearance;
};
};
}
public function addPolygon(_arg1:uint):void{
aPolygons.push(m_iPrimitive.aPolygons[_arg1]);
}
}
}//package sandy.core.data
Section 51
//UVCoord (sandy.core.data.UVCoord)
package sandy.core.data {
public final class UVCoord {
public var u:Number;
public var v:Number;
public function UVCoord(_arg1:Number=0, _arg2:Number=0){
u = _arg1;
v = _arg2;
}
public function sub(_arg1:UVCoord):void{
u = (u - _arg1.u);
v = (v - _arg1.v);
}
public function length():Number{
return (Math.sqrt(((u * u) + (v * v))));
}
public function add(_arg1:UVCoord):void{
u = (u + _arg1.u);
v = (v + _arg1.v);
}
public function normalize():void{
var _local1:Number;
_local1 = length();
u = (u / _local1);
v = (v / _local1);
}
public function scale(_arg1:Number):void{
u = (u * _arg1);
v = (v * _arg1);
}
public function toString():String{
return (((((("sandy.core.data.UVCoord" + "(u:") + u) + ", v:") + v) + ")"));
}
public function copy(_arg1:UVCoord):void{
u = _arg1.u;
v = _arg1.v;
}
public function clone():UVCoord{
return (new UVCoord(u, v));
}
}
}//package sandy.core.data
Section 52
//Vector (sandy.core.data.Vector)
package sandy.core.data {
import sandy.util.*;
public final class Vector {
public var y:Number;
public var x:Number;
public var z:Number;
public function Vector(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0){
x = _arg1;
y = _arg2;
z = _arg3;
}
final public function sub(_arg1:Vector):void{
x = (x - _arg1.x);
y = (y - _arg1.y);
z = (z - _arg1.z);
}
final public function negate():Vector{
return (new Vector(-(x), -(y), -(z)));
}
final public function dot(_arg1:Vector):Number{
return ((((x * _arg1.x) + (y * _arg1.y)) + (z * _arg1.z)));
}
final public function scale(_arg1:Number):void{
x = (x * _arg1);
y = (y * _arg1);
z = (z * _arg1);
}
public function resetToPositiveInfinity():void{
x = (y = (z = Number.POSITIVE_INFINITY));
}
final public function normalize():void{
var _local1:Number;
_local1 = getNorm();
if ((((_local1 == 0)) || ((_local1 == 1)))){
return;
};
x = (x / _local1);
y = (y / _local1);
z = (z / _local1);
}
public function resetToNegativeInfinity():void{
x = (y = (z = Number.NEGATIVE_INFINITY));
}
final public function cross(_arg1:Vector):Vector{
return (new Vector(((y * _arg1.z) - (z * _arg1.y)), ((z * _arg1.x) - (x * _arg1.z)), ((x * _arg1.y) - (y * _arg1.x))));
}
final public function getMinComponent():Number{
return (Math.min(x, Math.min(y, z)));
}
public function reset(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0):void{
x = _arg1;
y = _arg2;
z = _arg3;
}
final public function pow(_arg1:Number):void{
x = Math.pow(x, _arg1);
y = Math.pow(y, _arg1);
z = Math.pow(z, _arg1);
}
final public function clone():Vector{
var _local1:Vector;
_local1 = new Vector(x, y, z);
return (_local1);
}
public function serialize(_arg1:Number=0.1):String{
return (((((NumberUtil.roundTo(x, _arg1) + ",") + NumberUtil.roundTo(y, _arg1)) + ",") + NumberUtil.roundTo(z, _arg1)));
}
final public function add(_arg1:Vector):void{
x = (x + _arg1.x);
y = (y + _arg1.y);
z = (z + _arg1.z);
}
final public function getAngle(_arg1:Vector):Number{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
_local2 = getNorm();
_local3 = _arg1.getNorm();
_local4 = (_local2 * _local3);
if (_local4 == 0){
return (0);
};
_local5 = (dot(_arg1) / _local4);
_local6 = (1 - (_local5 * _local5));
if (_local6 < 0){
_local6 = 0;
};
return (Math.atan2(Math.sqrt(_local6), _local5));
}
final public function crossWith(_arg1:Vector):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
_local2 = ((y * _arg1.z) - (z * _arg1.y));
_local3 = ((z * _arg1.x) - (x * _arg1.z));
_local4 = ((x * _arg1.y) - (y * _arg1.x));
x = _local2;
y = _local3;
z = _local4;
}
final public function toString(_arg1:Number=0):String{
return ((("{" + serialize(_arg1)) + "}"));
}
final public function getMaxComponent():Number{
return (Math.max(x, Math.max(y, z)));
}
final public function getNorm():Number{
return (Math.sqrt((((x * x) + (y * y)) + (z * z))));
}
final public function copy(_arg1:Vector):void{
x = _arg1.x;
y = _arg1.y;
z = _arg1.z;
}
final public function equals(_arg1:Vector):Boolean{
return ((((((_arg1.x == x)) && ((_arg1.y == y)))) && ((_arg1.z == z))));
}
public static function deserialize(_arg1:String):Vector{
var _local2:Array;
var _local3:Number;
_local2 = _arg1.split(",");
if (_local2.length != 3){
};
_local3 = 0;
while (_local3 < _local2.length) {
_local2[_local3] = Number(_local2[_local3]);
_local3++;
};
return (new Vector(_local2[0], _local2[1], _local2[2]));
}
}
}//package sandy.core.data
Section 53
//Vertex (sandy.core.data.Vertex)
package sandy.core.data {
import sandy.util.*;
public final class Vertex {
public const id:uint;
private const m_oWorld:Vector;
private const m_oLocal:Vector;
public var aFaces:Array;
public var wx:Number;
public var wy:Number;
public var wz:Number;
public var sx:Number;
public var sy:Number;
public var nbFaces:uint;// = 0
public var x:Number;
public var y:Number;
public var z:Number;
private static var ID:uint = 0;
public function Vertex(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0, ... _args){
id = ID++;
nbFaces = 0;
aFaces = new Array();
m_oWorld = new Vector();
m_oLocal = new Vector();
super();
x = _arg1;
y = _arg2;
z = _arg3;
wx = (_args[0]) ? _args[0] : x;
wy = (_args[1]) ? _args[1] : y;
wz = (_args[2]) ? _args[2] : z;
sy = (sx = 0);
}
final public function getVector():Vector{
m_oLocal.x = x;
m_oLocal.y = y;
m_oLocal.z = z;
return (m_oLocal);
}
final public function deserialize(_arg1:String):void{
var _local2:Array;
_local2 = _arg1.split(",");
if (_local2.length != 9){
};
x = _local2[0];
y = _local2[1];
z = _local2[2];
wx = _local2[3];
wy = _local2[4];
wz = _local2[5];
sx = _local2[6];
sy = _local2[7];
}
final public function negate():void{
x = -(x);
y = -(y);
z = -(z);
wx = -(wx);
wy = -(wy);
wz = -(wz);
}
final public function normalize():void{
var _local1:Number;
_local1 = getNorm();
if ((((_local1 == 0)) || ((_local1 == 1)))){
return;
};
x = (x / _local1);
y = (y / _local1);
z = (z / _local1);
wx = (wx / _local1);
wy = (wy / _local1);
wz = (wz / _local1);
}
public function getScreenPoint():Vector{
return (new Vector(sx, sy, wz));
}
final public function dot(_arg1:Vertex):Number{
return ((((x * _arg1.x) + (y * _arg1.y)) + (z * _arg1.z)));
}
final public function scale(_arg1:Number):void{
x = (x * _arg1);
y = (y * _arg1);
z = (z * _arg1);
wx = (wx * _arg1);
wy = (wy * _arg1);
wz = (wz * _arg1);
}
final public function getNorm():Number{
return (Math.sqrt((((x * x) + (y * y)) + (z * z))));
}
public function reset(_arg1:Number, _arg2:Number, _arg3:Number):void{
x = _arg1;
y = _arg2;
z = _arg3;
wx = x;
wy = y;
wz = z;
}
final public function equals(_arg1:Vertex):Boolean{
return (Boolean((((((((((((((((_arg1.x == x)) && ((_arg1.y == y)))) && ((_arg1.z == z)))) && ((_arg1.wx == wx)))) && ((_arg1.wy == wy)))) && ((_arg1.wz == wz)))) && ((_arg1.sx == wx)))) && ((_arg1.sy == sy)))));
}
public function sub(_arg1:Vertex):void{
x = (x - _arg1.x);
y = (y - _arg1.y);
z = (z - _arg1.z);
wx = (wx - _arg1.wx);
wy = (wy - _arg1.wy);
wz = (wz - _arg1.wz);
}
final public function clone():Vertex{
var _local1:Vertex;
_local1 = new Vertex(x, y, z);
_local1.wx = wx;
_local1.sx = sx;
_local1.wy = wy;
_local1.sy = sy;
_local1.wz = wz;
_local1.nbFaces = nbFaces;
_local1.aFaces = aFaces.concat();
return (_local1);
}
final public function pow(_arg1:Number):void{
x = Math.pow(x, _arg1);
y = Math.pow(y, _arg1);
z = Math.pow(z, _arg1);
wx = Math.pow(wx, _arg1);
wy = Math.pow(wy, _arg1);
wz = Math.pow(wz, _arg1);
}
final public function serialize(_arg1:Number=0):String{
if (_arg1 == 0){
_arg1 = 0.01;
};
return (((((((((((((((NumberUtil.roundTo(x, _arg1) + ",") + NumberUtil.roundTo(y, _arg1)) + ",") + NumberUtil.roundTo(z, _arg1)) + ",") + NumberUtil.roundTo(wx, _arg1)) + ",") + NumberUtil.roundTo(wy, _arg1)) + ",") + NumberUtil.roundTo(wz, _arg1)) + ",") + NumberUtil.roundTo(sx, _arg1)) + ",") + NumberUtil.roundTo(sy, _arg1)));
}
final public function getAngle(_arg1:Vertex):Number{
var _local2:Number;
var _local3:Number;
_local2 = (dot(_arg1) / (getNorm() * _arg1.getNorm()));
_local3 = (1 - (_local2 * _local2));
if (_local3 < 0){
_local3 = 0;
};
return (Math.atan2(Math.sqrt(_local3), _local2));
}
final public function add(_arg1:Vertex):void{
x = (x + _arg1.x);
y = (y + _arg1.y);
z = (z + _arg1.z);
wx = (wx + _arg1.wx);
wy = (wy + _arg1.wy);
wz = (wz + _arg1.wz);
}
final public function toString(_arg1:Number=0):String{
if (_arg1 == 0){
_arg1 = 0.01;
};
return ((((((((((((((((("{" + NumberUtil.roundTo(x, _arg1)) + ", ") + NumberUtil.roundTo(y, _arg1)) + ", ") + NumberUtil.roundTo(z, _arg1)) + ", ") + NumberUtil.roundTo(wx, _arg1)) + ", ") + NumberUtil.roundTo(wy, _arg1)) + ", ") + NumberUtil.roundTo(wz, _arg1)) + ", ") + NumberUtil.roundTo(sx, _arg1)) + ", ") + NumberUtil.roundTo(sy, _arg1)) + "}"));
}
final public function cross(_arg1:Vertex):Vertex{
return (new Vertex(((y * _arg1.z) - (z * _arg1.y)), ((z * _arg1.x) - (x * _arg1.z)), ((x * _arg1.y) - (y * _arg1.x))));
}
final public function clone2():Vertex{
return (new Vertex(wx, wy, wz));
}
final public function copy(_arg1:Vertex):void{
x = _arg1.x;
y = _arg1.y;
z = _arg1.z;
wx = _arg1.wx;
wy = _arg1.wy;
wz = _arg1.wz;
sx = _arg1.sx;
sy = _arg1.sy;
}
final public function getWorldVector():Vector{
m_oWorld.x = wx;
m_oWorld.y = wy;
m_oWorld.z = wz;
return (m_oWorld);
}
public static function createFromVector(_arg1:Vector):Vertex{
return (new Vertex(_arg1.x, _arg1.y, _arg1.z));
}
}
}//package sandy.core.data
Section 54
//TextLink (sandy.core.interaction.TextLink)
package sandy.core.interaction {
import flash.geom.*;
import flash.utils.*;
import flash.text.*;
public class TextLink {
private var __sTarget:String;
private var __sHRef:String;
public var width:Number;
private var __tfOwner:TextField;
private var __iOpenIndex:int;
private var __iCloseIndex:int;
private var __rBounds:Rectangle;
public var height:Number;
public var x:Number;
public var y:Number;
public static var textLinks:Dictionary;
public function TextLink(){
x = 0;
y = 0;
height = 0;
width = 0;
}
public function get href():String{
return (__sHRef);
}
public function get closeIndex():int{
return (__iCloseIndex);
}
public function get target():String{
return (__sTarget);
}
public function set href(_arg1:String):void{
__sHRef = _arg1;
}
public function set openIndex(_arg1:int):void{
__iOpenIndex = _arg1;
}
public function set target(_arg1:String):void{
__sTarget = _arg1;
}
public function set owner(_arg1:TextField):void{
__tfOwner = _arg1;
}
public function get openIndex():int{
return (__iOpenIndex);
}
public function getBounds():Rectangle{
return (__rBounds);
}
protected function _init():void{
var _local1:Number;
var _local2:Rectangle;
_local1 = 0;
while (_local1 < (__iCloseIndex - __iOpenIndex)) {
_local2 = __tfOwner.getCharBoundaries((openIndex + _local1));
if (_local1 == 0){
x = _local2.x;
y = _local2.y;
};
width = (width + _local2.width);
height = ((height < _local2.height)) ? _local2.height : height;
_local1++;
};
__rBounds = new Rectangle();
__rBounds.x = x;
__rBounds.y = y;
__rBounds.height = height;
__rBounds.width = width;
}
public function set closeIndex(_arg1:int):void{
__iCloseIndex = _arg1;
}
public function get owner():TextField{
return (__tfOwner);
}
public static function getTextLinks(_arg1:TextField, _arg2:Boolean=false):Array{
var _local3:String;
var _local4:RegExp;
var _local5:RegExp;
var _local6:RegExp;
var _local7:RegExp;
var _local8:RegExp;
var _local9:RegExp;
var _local10:Object;
var _local11:TextLink;
var _local12:String;
var _local13:String;
if (!_arg1.htmlText){
return (null);
};
if (!textLinks){
textLinks = new Dictionary();
};
if (((textLinks[_arg1]) && (!(_arg2)))){
return (textLinks[_arg1]);
};
textLinks[_arg1] = new Array();
_local3 = _arg1.htmlText;
_local4 = /href=['"].*?['"]/i;
_local5 = /target=['"].*?['"]/i;
_local6 = /<A.*?A>/i;
_local7 = /<A.*?\>/i;
_local8 = /<\/A>/i;
_local9 = /<[^A][^\/A].*?>/gi;
_local3 = _local3.replace(_local9, "");
_local10 = _local6.exec(_local3);
while (_local10 != null) {
_local11 = new (TextLink);
_local11.owner = _arg1;
textLinks[_arg1].push(_local11);
_local12 = _local10[0].match(_local4);
_local11.href = _local12.substring(6, (_local12.length - 1));
_local13 = _local10[0].match(_local5);
_local11.target = _local13.substring(8, (_local13.length - 1));
_local11.openIndex = _local3.search(_local7);
_local3 = _local3.replace(_local7, "");
_local11.closeIndex = _local3.search(_local8);
_local3 = _local3.replace(_local8, "");
_local11._init();
_local10 = _local6.exec(_local3);
};
return (textLinks[_arg1]);
}
}
}//package sandy.core.interaction
Section 55
//VirtualMouse (sandy.core.interaction.VirtualMouse)
package sandy.core.interaction {
import flash.events.*;
import sandy.materials.*;
import sandy.core.data.*;
import flash.display.*;
import flash.geom.*;
import flash.text.*;
public class VirtualMouse extends EventDispatcher {
private var lastDownTarget:InteractiveObject;
private var m_ioOldTarget:Sprite;
private var lastWithinStage:Boolean;// = true
private var _lastEvent:Event;
private var m_ioTarget:Sprite;
private var lastLocation:Point;
private var location:Point;
private static var _oI:VirtualMouse;
public function VirtualMouse(_arg1:PrivateConstructorAccess){
lastWithinStage = true;
super();
location = new Point(0, 0);
lastLocation = location.clone();
}
public function interactWithTexture(_arg1:Polygon, _arg2:UVCoord, _arg3:MouseEvent):void{
var _local4:MovieMaterial;
var _local5:Array;
var _local6:Sprite;
var _local7:DisplayObject;
var _local8:int;
var _local9:Point;
var _local10:Point;
var _local11:Boolean;
_local4 = ((_arg1.visible) ? _arg1.appearance.frontMaterial : _arg1.appearance.backMaterial as MovieMaterial);
if (_local4 == null){
return;
};
m_ioTarget = _local4.movie;
location = new Point((_arg2.u * _local4.texture.width), (_arg2.v * _local4.texture.height));
_local5 = m_ioTarget.getObjectsUnderPoint(m_ioTarget.localToGlobal(location));
_local8 = _local5.length;
while (--_local8 > -1) {
_local7 = _local5[_local8];
while (_local7) {
if (((_local6) && ((_local7 is SimpleButton)))){
_local6 = null;
} else {
if (((((_local6) && ((_local7 is DisplayObjectContainer)))) && (!(DisplayObjectContainer(_local7).mouseChildren)))){
_local6 = null;
};
};
if (((((!(_local6)) && ((_local7 is DisplayObjectContainer)))) && (DisplayObjectContainer(_local7).mouseEnabled))){
_local6 = (_local7 as Sprite);
};
_local7 = _local7.parent;
};
};
if (!_local6){
_local6 = m_ioTarget;
};
if (!m_ioOldTarget){
_local6.stage;
};
_local9 = _arg1.container.globalToLocal(location);
_local10 = _local6.globalToLocal(location);
if (((!((lastLocation.x == location.x))) || (!((lastLocation.y == location.y))))){
_local11 = Boolean((((((((location.x >= 0)) && ((location.y >= 0)))) && ((location.x <= _arg1.container.stage.stageWidth)))) && ((location.y <= _arg1.container.stage.stageHeight))));
if (((!(_local11)) && (lastWithinStage))){
_lastEvent = new MouseEvent(Event.MOUSE_LEAVE, false, false);
_arg1.container.stage.dispatchEvent(_lastEvent);
dispatchEvent(_lastEvent);
};
if (_local11){
_lastEvent = new MouseEvent(Event.MOUSE_LEAVE, false, false);
_local6.dispatchEvent(_lastEvent);
dispatchEvent(_lastEvent);
};
lastWithinStage = _local11;
};
if (_local6 != m_ioOldTarget){
_lastEvent = new MouseEvent(MouseEvent.MOUSE_OUT, true, false, _local9.x, _local9.y, _local6, _arg3.ctrlKey, _arg3.altKey, _arg3.shiftKey, _arg3.buttonDown, _arg3.delta);
m_ioTarget.dispatchEvent(_lastEvent);
dispatchEvent(_lastEvent);
_lastEvent = new MouseEvent(MouseEvent.ROLL_OUT, false, false, _local9.x, _local9.y, _local6, _arg3.ctrlKey, _arg3.altKey, _arg3.shiftKey, _arg3.buttonDown, _arg3.delta);
m_ioTarget.dispatchEvent(_lastEvent);
dispatchEvent(_lastEvent);
_lastEvent = new MouseEvent(MouseEvent.MOUSE_OVER, true, false, _local10.x, _local10.y, m_ioOldTarget, _arg3.ctrlKey, _arg3.altKey, _arg3.shiftKey, _arg3.buttonDown, _arg3.delta);
_local6.dispatchEvent(_lastEvent);
dispatchEvent(_lastEvent);
_lastEvent = new MouseEvent(MouseEvent.ROLL_OVER, false, false, _local10.x, _local10.y, m_ioOldTarget, _arg3.ctrlKey, _arg3.altKey, _arg3.shiftKey, _arg3.buttonDown, _arg3.delta);
_local6.dispatchEvent(_lastEvent);
dispatchEvent(_lastEvent);
};
if (_arg3.type == MouseEvent.MOUSE_DOWN){
_lastEvent = new MouseEvent(MouseEvent.MOUSE_DOWN, true, false, _local10.x, _local10.y, _local6, _arg3.ctrlKey, _arg3.altKey, _arg3.shiftKey, _arg3.buttonDown, _arg3.delta);
_local6.dispatchEvent(_lastEvent);
dispatchEvent(_lastEvent);
lastDownTarget = _local6;
} else {
if (_arg3.type == MouseEvent.MOUSE_UP){
_lastEvent = new MouseEvent(MouseEvent.MOUSE_UP, true, false, _local10.x, _local10.y, _local6, _arg3.ctrlKey, _arg3.altKey, _arg3.shiftKey, _arg3.buttonDown, _arg3.delta);
_local6.dispatchEvent(_lastEvent);
dispatchEvent(_lastEvent);
} else {
if (_arg3.type == MouseEvent.CLICK){
_lastEvent = new MouseEvent(MouseEvent.CLICK, true, false, _local10.x, _local10.y, _local6, _arg3.ctrlKey, _arg3.altKey, _arg3.shiftKey, _arg3.buttonDown, _arg3.delta);
_local6.dispatchEvent(_lastEvent);
dispatchEvent(_lastEvent);
lastDownTarget = null;
} else {
if ((((_arg3.type == MouseEvent.DOUBLE_CLICK)) && (_local6.doubleClickEnabled))){
_lastEvent = new MouseEvent(MouseEvent.DOUBLE_CLICK, true, false, _local10.x, _local10.y, _local6, _arg3.ctrlKey, _arg3.altKey, _arg3.shiftKey, _arg3.buttonDown, _arg3.delta);
_local6.dispatchEvent(_lastEvent);
dispatchEvent(_lastEvent);
};
};
};
};
lastLocation = location.clone();
m_ioOldTarget = _local6;
}
private function _checkLinks(_arg1:TextField):void{
var _local2:Point;
var _local3:Array;
var _local4:Number;
var _local5:Number;
_local2 = _arg1.globalToLocal(location);
_local3 = TextLink.getTextLinks(_arg1);
_local4 = _local3.length;
_local5 = 0;
while (_local5 < _local4) {
if (((_local3[_local5] as TextLink).getBounds() as Rectangle).containsPoint(_local2)){
};
_local5++;
};
}
public static function getInstance():VirtualMouse{
if (!_oI){
_oI = new VirtualMouse(new PrivateConstructorAccess());
};
return (_oI);
}
}
}//package sandy.core.interaction
class PrivateConstructorAccess {
private function PrivateConstructorAccess(){
}
}
Section 56
//Light3D (sandy.core.light.Light3D)
package sandy.core.light {
import flash.events.*;
import sandy.core.data.*;
import sandy.events.*;
import sandy.util.*;
public class Light3D extends EventDispatcher {
private var _dir:Vector;
private var _color:uint;
private var _nPower:Number;
private var _power:Number;
public static const MAX_POWER:Number = 150;
public function Light3D(_arg1:Vector, _arg2:Number){
_dir = _arg1;
_dir.normalize();
setPower(_arg2);
}
public function setPower(_arg1:Number):void{
_power = NumberUtil.constrain(_arg1, 0, Light3D.MAX_POWER);
_nPower = (_power / Light3D.MAX_POWER);
dispatchEvent(new SandyEvent(SandyEvent.LIGHT_UPDATED));
}
public function destroy():void{
}
public function getPower():Number{
return (_power);
}
public function getNormalizedPower():Number{
return (_nPower);
}
public function set color(_arg1:uint):void{
_color = _arg1;
dispatchEvent(new SandyEvent(SandyEvent.LIGHT_COLOR_CHANGED));
}
public function setDirectionVector(_arg1:Vector):void{
_dir = _arg1;
_dir.normalize();
dispatchEvent(new SandyEvent(SandyEvent.LIGHT_UPDATED));
}
public function get color():uint{
return (_color);
}
public function calculate(_arg1:Vector):Number{
var _local2:Number;
_local2 = _dir.dot(_arg1);
_local2 = -(_local2);
if (_local2 < 0){
_local2 = 0;
};
return ((_nPower * _local2));
}
public function getDirectionVector():Vector{
return (_dir);
}
public function setDirection(_arg1:Number, _arg2:Number, _arg3:Number):void{
_dir.x = _arg1;
_dir.y = _arg2;
_dir.z = _arg3;
_dir.normalize();
dispatchEvent(new SandyEvent(SandyEvent.LIGHT_UPDATED));
}
}
}//package sandy.core.light
Section 57
//ATransformable (sandy.core.scenegraph.ATransformable)
package sandy.core.scenegraph {
import sandy.core.data.*;
import sandy.core.*;
public class ATransformable extends Node {
private var _nYaw:Number;
private var _vLookAt:Vector;
private var _nRoll:Number;
private var _vLookatDown:Vector;
private var m_oMatrix:Matrix4;
protected var _oScale:Vector;
private var _nTilt:Number;
protected var m_oPreviousOffsetRotation:Vector;
private var _vRotation:Vector;
protected var m_tmpMt:Matrix4;
protected var _vOut:Vector;
public var disable:Boolean;// = false
protected var _vSide:Vector;
protected var _p:Vector;
protected var _vUp:Vector;
public function ATransformable(_arg1:String=""){
disable = false;
m_oPreviousOffsetRotation = new Vector();
super(_arg1);
resetCoords();
}
public function set roll(_arg1:Number):void{
var _local2:Number;
_local2 = (_arg1 - _nRoll);
if (_local2 == 0){
return;
};
changed = true;
m_tmpMt.axisRotation(_vOut.x, _vOut.y, _vOut.z, _local2);
m_tmpMt.vectorMult3x3(_vSide);
m_tmpMt.vectorMult3x3(_vUp);
_nRoll = _arg1;
}
public function getLookAt():Vector{
return (_vLookAt);
}
public function moveSideways(_arg1:Number):void{
changed = true;
_p.x = (_p.x + (_vSide.x * _arg1));
_p.y = (_p.y + (_vSide.y * _arg1));
_p.z = (_p.z + (_vSide.z * _arg1));
}
public function moveHorizontally(_arg1:Number):void{
changed = true;
_p.x = (_p.x + (_vOut.x * _arg1));
_p.z = (_p.z + (_vOut.z * _arg1));
}
public function lookAt(_arg1:Number, _arg2:Number, _arg3:Number):void{
changed = true;
_vLookAt = new Vector(_arg1, _arg2, _arg3);
_vOut.x = _arg1;
_vOut.y = _arg2;
_vOut.z = _arg3;
_vOut.sub(_p);
_vOut.normalize();
_vSide = null;
_vSide = _vOut.cross(_vLookatDown);
_vSide.normalize();
_vUp = null;
_vUp = _vOut.cross(_vSide);
_vUp.normalize();
}
public function moveVertically(_arg1:Number):void{
changed = true;
_p.y = (_p.y + _arg1);
}
public function set target(_arg1:Vector):void{
lookAt(_arg1.x, _arg1.y, _arg1.z);
}
public function initFrame():void{
_vSide = new Vector(1, 0, 0);
_vUp = new Vector(0, 1, 0);
_vOut = new Vector(0, 0, 1);
_vRotation = new Vector(0, 0, 0);
}
public function set pan(_arg1:Number):void{
var _local2:Number;
_local2 = (_arg1 - _nYaw);
if (_local2 == 0){
return;
};
changed = true;
m_tmpMt.axisRotation(_vUp.x, _vUp.y, _vUp.z, _local2);
m_tmpMt.vectorMult3x3(_vOut);
m_tmpMt.vectorMult3x3(_vSide);
_nYaw = _arg1;
}
public function get out():Vector{
return (_vOut);
}
public function get scaleY():Number{
return (_oScale.y);
}
public function get scaleX():Number{
return (_oScale.x);
}
public function get side():Vector{
return (_vSide);
}
public function resetCoords():void{
initFrame();
_p = new Vector();
_oScale = new Vector(1, 1, 1);
_vRotation = new Vector(0, 0, 0);
_vLookatDown = new Vector(1E-11, -1, 0);
_nRoll = 0;
_nTilt = 0;
_nYaw = 0;
m_tmpMt = new Matrix4();
m_oMatrix = new Matrix4();
}
public function translate(_arg1:Number, _arg2:Number, _arg3:Number):void{
changed = true;
_p.x = (_p.x + _arg1);
_p.y = (_p.y + _arg2);
_p.z = (_p.z + _arg3);
}
public function get rotateY():Number{
return (_vRotation.y);
}
public function get scaleZ():Number{
return (_oScale.z);
}
public function get rotateX():Number{
return (_vRotation.x);
}
public function get rotateZ():Number{
return (_vRotation.z);
}
override public function toString():String{
return ("sandy.core.scenegraph.ATransformable");
}
public function get x():Number{
return (_p.x);
}
public function get y():Number{
return (_p.y);
}
public function get z():Number{
return (_p.z);
}
public function get roll():Number{
return (_nRoll);
}
public function set matrix(_arg1:Matrix4):void{
m_oMatrix = _arg1;
m_oMatrix.vectorMult3x3(_vSide);
m_oMatrix.vectorMult3x3(_vUp);
m_oMatrix.vectorMult3x3(_vOut);
_vSide.normalize();
_vUp.normalize();
_vOut.normalize();
_p.x = _arg1.n14;
_p.y = _arg1.n24;
_p.z = _arg1.n34;
}
public function set tilt(_arg1:Number):void{
var _local2:Number;
_local2 = (_arg1 - _nTilt);
if (_local2 == 0){
return;
};
changed = true;
m_tmpMt.axisRotation(_vSide.x, _vSide.y, _vSide.z, _local2);
m_tmpMt.vectorMult3x3(_vOut);
m_tmpMt.vectorMult3x3(_vUp);
_nTilt = _arg1;
}
public function get up():Vector{
return (_vUp);
}
public function set scaleX(_arg1:Number):void{
_oScale.x = _arg1;
changed = true;
}
public function get pan():Number{
return (_nYaw);
}
public function set scaleY(_arg1:Number):void{
_oScale.y = _arg1;
changed = true;
}
public function getPosition(_arg1:String="local"):Vector{
var _local2:Vector;
switch (_arg1){
case "local":
_local2 = new Vector(_p.x, _p.y, _p.z);
break;
case "camera":
_local2 = new Vector(viewMatrix.n14, viewMatrix.n24, viewMatrix.n34);
break;
case "absolute":
_local2 = new Vector(modelMatrix.n14, modelMatrix.n24, modelMatrix.n34);
break;
default:
_local2 = new Vector(_p.x, _p.y, _p.z);
break;
};
return (_local2);
}
public function set scaleZ(_arg1:Number):void{
_oScale.z = _arg1;
changed = true;
}
public function moveLateraly(_arg1:Number):void{
changed = true;
_p.x = (_p.x + _arg1);
}
public function rotateAxis(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):void{
var _local5:Number;
changed = true;
_arg4 = ((_arg4 + 360) % 360);
_local5 = Math.sqrt((((_arg1 * _arg1) + (_arg2 * _arg2)) + (_arg3 * _arg3)));
m_tmpMt.axisRotation((_arg1 / _local5), (_arg2 / _local5), (_arg3 / _local5), _arg4);
m_tmpMt.vectorMult3x3(_vSide);
m_tmpMt.vectorMult3x3(_vUp);
m_tmpMt.vectorMult3x3(_vOut);
}
public function moveUpwards(_arg1:Number):void{
changed = true;
_p.x = (_p.x + (_vUp.x * _arg1));
_p.y = (_p.y + (_vUp.y * _arg1));
_p.z = (_p.z + (_vUp.z * _arg1));
}
public function updateTransform():void{
if (changed){
m_oMatrix.n11 = (_vSide.x * _oScale.x);
m_oMatrix.n12 = (_vUp.x * _oScale.y);
m_oMatrix.n13 = (_vOut.x * _oScale.z);
m_oMatrix.n14 = _p.x;
m_oMatrix.n21 = (_vSide.y * _oScale.x);
m_oMatrix.n22 = (_vUp.y * _oScale.y);
m_oMatrix.n23 = (_vOut.y * _oScale.z);
m_oMatrix.n24 = _p.y;
m_oMatrix.n31 = (_vSide.z * _oScale.x);
m_oMatrix.n32 = (_vUp.z * _oScale.y);
m_oMatrix.n33 = (_vOut.z * _oScale.z);
m_oMatrix.n34 = _p.z;
_vOut.normalize();
_vSide.normalize();
_vUp.normalize();
};
}
public function setPosition(_arg1:Number, _arg2:Number, _arg3:Number):void{
changed = true;
_p.x = _arg1;
_p.y = _arg2;
_p.z = _arg3;
}
public function moveForward(_arg1:Number):void{
changed = true;
_p.x = (_p.x + (_vOut.x * _arg1));
_p.y = (_p.y + (_vOut.y * _arg1));
_p.z = (_p.z + (_vOut.z * _arg1));
}
public function set rotateY(_arg1:Number):void{
var _local2:Number;
_local2 = (_arg1 - _vRotation.y);
if (_local2 == 0){
return;
};
changed = true;
m_tmpMt.rotationY(_local2);
m_tmpMt.vectorMult3x3(_vSide);
m_tmpMt.vectorMult3x3(_vUp);
m_tmpMt.vectorMult3x3(_vOut);
_vRotation.y = _arg1;
}
public function get tilt():Number{
return (_nTilt);
}
public function set rotateZ(_arg1:Number):void{
var _local2:Number;
_local2 = (_arg1 - _vRotation.z);
if (_local2 == 0){
return;
};
changed = true;
m_tmpMt.rotationZ(_local2);
m_tmpMt.vectorMult3x3(_vSide);
m_tmpMt.vectorMult3x3(_vUp);
m_tmpMt.vectorMult3x3(_vOut);
_vRotation.z = _arg1;
}
public function get matrix():Matrix4{
return (m_oMatrix);
}
override public function update(_arg1:Scene3D, _arg2:Matrix4, _arg3:Boolean):void{
updateTransform();
if (((_arg3) || (changed))){
if (((_arg2) && (!(disable)))){
modelMatrix.copy(_arg2);
modelMatrix.multiply4x3(m_oMatrix);
} else {
modelMatrix.copy(m_oMatrix);
};
};
super.update(_arg1, modelMatrix, _arg3);
}
public function set rotateX(_arg1:Number):void{
var _local2:Number;
_local2 = (_arg1 - _vRotation.x);
if (_local2 == 0){
return;
};
changed = true;
m_tmpMt.rotationX(_local2);
m_tmpMt.vectorMult3x3(_vSide);
m_tmpMt.vectorMult3x3(_vUp);
m_tmpMt.vectorMult3x3(_vOut);
_vRotation.x = _arg1;
}
public function set x(_arg1:Number):void{
_p.x = _arg1;
changed = true;
}
public function set y(_arg1:Number):void{
_p.y = _arg1;
changed = true;
}
public function set z(_arg1:Number):void{
_p.z = _arg1;
changed = true;
}
}
}//package sandy.core.scenegraph
Section 58
//Camera3D (sandy.core.scenegraph.Camera3D)
package sandy.core.scenegraph {
import sandy.core.data.*;
import sandy.core.*;
import flash.display.*;
import sandy.view.*;
import flash.geom.*;
import flash.utils.*;
import sandy.util.*;
public class Camera3D extends ATransformable {
public var frustrum:Frustum;
private var mp11:Number;
private var mp12:Number;
private var mp13:Number;
private var m_aDisplayList:Array;
private var mp14:Number;
private var mp22:Number;
private var mp24:Number;
private var m_nOffy:int;
private var mp23:Number;
private var _mp:Matrix4;
private var mp33:Number;
private var m_nOffx:int;
private var mp31:Number;
private var mp32:Number;
private var mp34:Number;
private var _mpInv:Matrix4;
private var mp41:Number;
private var mp43:Number;
private var mp44:Number;
private var _nFov:Number;
private var mp42:Number;
private var mp21:Number;
private var _perspectiveChanged:Boolean;// = false
public var invModelMatrix:Matrix4;
public var viewport:ViewPort;
private var _nFar:Number;
private var _nNear:Number;
private var m_oCache:Dictionary;
private var m_aDisplayedList:Array;
public function Camera3D(_arg1:Number=550, _arg2:Number=400, _arg3:Number=45, _arg4:Number=50, _arg5:Number=10000){
invModelMatrix = new Matrix4();
viewport = new ViewPort(640, 480);
frustrum = new Frustum();
_perspectiveChanged = false;
_mp = new Matrix4();
_mpInv = new Matrix4();
m_aDisplayList = new Array();
super(null);
viewport.width = _arg1;
viewport.height = _arg2;
_nFov = _arg3;
_nFar = _arg5;
_nNear = _arg4;
setPerspectiveProjection(_nFov, viewport.ratio, _nNear, _nFar);
m_nOffx = viewport.width2;
m_nOffy = viewport.height2;
visible = false;
z = -300;
lookAt(0, 0, 0);
}
override public function destroy():void{
var _local1:IDisplayable;
for each (_local1 in m_aDisplayedList) {
if (_local1){
_local1.clear();
};
};
for each (_local1 in m_aDisplayList) {
if (_local1){
_local1.clear();
};
};
m_aDisplayedList = null;
m_aDisplayList = null;
viewport = null;
super.destroy();
}
public function get invProjectionMatrix():Matrix4{
return (_mpInv);
}
public function clearDisplayList():void{
m_aDisplayedList.splice(0);
m_aDisplayList.splice(0);
}
public function renderDisplayList(_arg1:Scene3D):void{
var _local2:IDisplayable;
var _local3:Sprite;
for each (_local2 in m_aDisplayedList) {
_local2.clear();
};
if (m_aDisplayList){
_local3 = _arg1.container;
m_aDisplayList.sortOn("depth", (Array.NUMERIC | Array.DESCENDING));
for each (_local2 in m_aDisplayList) {
_local2.display(_arg1);
_local3.addChild(_local2.container);
};
m_aDisplayedList = m_aDisplayList.splice(0);
};
}
public function get far():Number{
return (_nFar);
}
public function get near():Number{
return (_nNear);
}
public function set far(_arg1:Number):void{
_nFar = _arg1;
_perspectiveChanged = true;
}
public function projectVertex(_arg1:Vertex):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
_local2 = (viewport.offset.x + m_nOffx);
_local3 = (viewport.offset.y + m_nOffy);
_local4 = (1 / ((((_arg1.wx * mp41) + (_arg1.wy * mp42)) + (_arg1.wz * mp43)) + mp44));
_arg1.sx = (((_local4 * ((((_arg1.wx * mp11) + (_arg1.wy * mp12)) + (_arg1.wz * mp13)) + mp14)) * m_nOffx) + _local2);
_arg1.sy = (((-(_local4) * ((((_arg1.wx * mp21) + (_arg1.wy * mp22)) + (_arg1.wz * mp23)) + mp24)) * m_nOffy) + _local3);
}
public function removeFromDisplayList(_arg1:IDisplayable):void{
var _local2:Number;
if (_arg1 != null){
_local2 = m_aDisplayList.indexOf(_arg1);
if (_local2 >= 0){
m_aDisplayList.splice(_local2, 1);
//unresolved jump
};
};
}
protected function setPerspectiveProjection(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):void{
var _local5:Number;
var _local6:Number;
frustrum.computePlanes(_arg2, _arg3, _arg4, _arg1);
_arg1 = NumberUtil.toRadian(_arg1);
_local5 = (1 / Math.tan((_arg1 / 2)));
_local6 = (_arg4 / (_arg4 - _arg3));
_mp.zero();
_mp.n11 = (_local5 / _arg2);
_mp.n22 = _local5;
_mp.n33 = _local6;
_mp.n34 = (-(_local6) * _arg3);
_mp.n43 = 1;
mp11 = _mp.n11;
mp21 = _mp.n21;
mp31 = _mp.n31;
mp41 = _mp.n41;
mp12 = _mp.n12;
mp22 = _mp.n22;
mp32 = _mp.n32;
mp42 = _mp.n42;
mp13 = _mp.n13;
mp23 = _mp.n23;
mp33 = _mp.n33;
mp43 = _mp.n43;
mp14 = _mp.n14;
mp24 = _mp.n24;
mp34 = _mp.n34;
mp44 = _mp.n44;
_mpInv.copy(_mp);
_mpInv.inverse();
changed = true;
}
public function projectDico(_arg1:Dictionary):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Vertex;
_local2 = (viewport.offset.x + m_nOffx);
_local3 = (viewport.offset.y + m_nOffy);
for each (_local5 in _arg1) {
if (m_oCache[_local5] != null){
} else {
_local4 = (1 / ((((_local5.wx * mp41) + (_local5.wy * mp42)) + (_local5.wz * mp43)) + mp44));
_local5.sx = (((_local4 * ((((_local5.wx * mp11) + (_local5.wy * mp12)) + (_local5.wz * mp13)) + mp14)) * m_nOffx) + _local2);
_local5.sy = (((-(_local4) * ((((_local5.wx * mp21) + (_local5.wy * mp22)) + (_local5.wz * mp23)) + mp24)) * m_nOffy) + _local3);
m_oCache[_local5] = _local5;
};
};
}
override public function toString():String{
return ("sandy.core.scenegraph.Camera3D");
}
override public function cull(_arg1:Scene3D, _arg2:Frustum, _arg3:Matrix4, _arg4:Boolean):void{
}
override public function render(_arg1:Scene3D, _arg2:Camera3D):void{
}
public function set fov(_arg1:Number):void{
_nFov = _arg1;
_perspectiveChanged = true;
}
public function set near(_arg1:Number):void{
_nNear = _arg1;
_perspectiveChanged = true;
}
public function addArrayToDisplayList(_arg1:Array):void{
m_aDisplayList = m_aDisplayList.concat(_arg1);
}
protected function updatePerspective():void{
setPerspectiveProjection(_nFov, viewport.ratio, _nNear, _nFar);
_perspectiveChanged = false;
}
public function projectArray(_arg1:Array):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Vertex;
_local2 = (viewport.offset.x + m_nOffx);
_local3 = (viewport.offset.y + m_nOffy);
for each (_local5 in _arg1) {
if (m_oCache[_local5] != null){
} else {
_local4 = (1 / ((((_local5.wx * mp41) + (_local5.wy * mp42)) + (_local5.wz * mp43)) + mp44));
_local5.sx = (((_local4 * ((((_local5.wx * mp11) + (_local5.wy * mp12)) + (_local5.wz * mp13)) + mp14)) * m_nOffx) + _local2);
_local5.sy = (((-(_local4) * ((((_local5.wx * mp21) + (_local5.wy * mp22)) + (_local5.wz * mp23)) + mp24)) * m_nOffy) + _local3);
m_oCache[_local5] = _local5;
};
};
}
override public function update(_arg1:Scene3D, _arg2:Matrix4, _arg3:Boolean):void{
if (viewport.hasChanged){
_perspectiveChanged = true;
m_nOffx = viewport.width2;
m_nOffy = viewport.height2;
if (_arg1.rectClipping){
_arg1.container.scrollRect = new Rectangle(0, 0, viewport.width, viewport.height);
};
viewport.hasChanged = false;
};
if (_perspectiveChanged){
updatePerspective();
};
super.update(_arg1, _arg2, _arg3);
invModelMatrix.n11 = modelMatrix.n11;
invModelMatrix.n12 = modelMatrix.n21;
invModelMatrix.n13 = modelMatrix.n31;
invModelMatrix.n21 = modelMatrix.n12;
invModelMatrix.n22 = modelMatrix.n22;
invModelMatrix.n23 = modelMatrix.n32;
invModelMatrix.n31 = modelMatrix.n13;
invModelMatrix.n32 = modelMatrix.n23;
invModelMatrix.n33 = modelMatrix.n33;
invModelMatrix.n14 = -((((modelMatrix.n11 * modelMatrix.n14) + (modelMatrix.n21 * modelMatrix.n24)) + (modelMatrix.n31 * modelMatrix.n34)));
invModelMatrix.n24 = -((((modelMatrix.n12 * modelMatrix.n14) + (modelMatrix.n22 * modelMatrix.n24)) + (modelMatrix.n32 * modelMatrix.n34)));
invModelMatrix.n34 = -((((modelMatrix.n13 * modelMatrix.n14) + (modelMatrix.n23 * modelMatrix.n24)) + (modelMatrix.n33 * modelMatrix.n34)));
if (m_oCache){
m_oCache = null;
};
m_oCache = new Dictionary(false);
}
public function get fov():Number{
return (_nFov);
}
public function get projectionMatrix():Matrix4{
return (_mp);
}
public function addToDisplayList(_arg1:IDisplayable):void{
if (_arg1 != null){
m_aDisplayList[m_aDisplayList.length] = _arg1;
};
}
}
}//package sandy.core.scenegraph
Section 59
//Geometry3D (sandy.core.scenegraph.Geometry3D)
package sandy.core.scenegraph {
import sandy.core.data.*;
import flash.utils.*;
public final class Geometry3D {
public var aUVCoords:Array;
public var aFacesUVCoordsID:Array;
public var aFaceEdges:Array;
private var EDGES_DICO:Dictionary;
private var m_nLastVertexNormalId:int;// = 0
public var aFacesVertexID:Array;
public var aVertexNormals:Array;
private var m_nLastVertexId:int;// = 0
private var m_nLastNormalId:int;// = 0
public var aFacesNormals:Array;
private var m_nLastFaceId:int;// = 0
private var m_aVertexFaces:Array;
public var aVertex:Array;
private var m_nLastFaceUVId:int;// = 0
private var m_nLastUVId:int;// = 0
public var aEdges:Array;
public function Geometry3D(_arg1:Array=null){
EDGES_DICO = new Dictionary(true);
aVertex = new Array();
aFacesVertexID = new Array();
aFacesUVCoordsID = new Array();
aFacesNormals = new Array();
aVertexNormals = new Array();
aEdges = new Array();
aFaceEdges = new Array();
aUVCoords = new Array();
m_nLastVertexId = 0;
m_nLastNormalId = 0;
m_nLastFaceId = 0;
m_nLastFaceUVId = 0;
m_nLastUVId = 0;
m_nLastVertexNormalId = 0;
m_aVertexFaces = new Array();
super();
init();
}
public function setUVCoords(_arg1:Number, _arg2:Number, _arg3:Number):Number{
if (aUVCoords[_arg1]){
return (-1);
};
aUVCoords[_arg1] = new UVCoord(_arg2, _arg3);
return ((++m_nLastUVId - 1));
}
public function init():void{
}
public function getNextFaceID():Number{
return (m_nLastFaceId);
}
public function generateFaceNormals():void{
var _local1:Array;
var _local2:Vertex;
var _local3:Vertex;
var _local4:Vertex;
var _local5:Vector;
var _local6:Vector;
var _local7:Vector;
if (aFacesNormals.length > 0){
return;
};
for each (_local1 in aFacesVertexID) {
if (_local1.length < 3){
} else {
_local2 = aVertex[_local1[0]];
_local3 = aVertex[_local1[1]];
_local4 = aVertex[_local1[2]];
_local5 = new Vector((_local3.wx - _local2.wx), (_local3.wy - _local2.wy), (_local3.wz - _local2.wz));
_local6 = new Vector((_local3.wx - _local4.wx), (_local3.wy - _local4.wy), (_local3.wz - _local4.wz));
_local7 = _local5.cross(_local6);
_local7.normalize();
setFaceNormal(getNextFaceNormalID(), _local7.x, _local7.y, _local7.z);
};
};
}
public function setVertex(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (aVertex[_arg1]){
return (-1);
};
aVertex[_arg1] = new Vertex(_arg2, _arg3, _arg4);
return ((++m_nLastVertexId - 1));
}
public function setFaceNormal(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (aFacesNormals[_arg1]){
return (-1);
};
aFacesNormals[_arg1] = new Vertex(_arg2, _arg3, _arg4);
return ((++m_nLastNormalId - 1));
}
public function getNextUVCoordID():Number{
return (m_nLastUVId);
}
public function generateVertexNormals():void{
var _local1:uint;
var _local2:Array;
var _local3:Vertex;
var _local4:Vertex;
if (aVertexNormals.length > 0){
return;
};
_local1 = 0;
_local1 = 0;
while (_local1 < aFacesVertexID.length) {
_local2 = aFacesVertexID[_local1];
_local3 = aFacesNormals[_local1];
if (_local3 == null){
} else {
if (null == aVertexNormals[_local2[0]]){
m_nLastVertexNormalId++;
aVertexNormals[_local2[0]] = new Vertex();
};
Vertex(aVertexNormals[_local2[0]]).add(_local3);
if (null == aVertexNormals[_local2[1]]){
m_nLastVertexNormalId++;
aVertexNormals[_local2[1]] = new Vertex();
};
Vertex(aVertexNormals[_local2[1]]).add(_local3);
if (null == aVertexNormals[_local2[2]]){
m_nLastVertexNormalId++;
aVertexNormals[_local2[2]] = new Vertex();
};
Vertex(aVertexNormals[_local2[2]]).add(_local3);
if ((aVertex[_local2[0]] as Vertex).aFaces.indexOf(_local1) == 0){
(aVertex[_local2[0]] as Vertex).aFaces.push(_local1);
};
if ((aVertex[_local2[1]] as Vertex).aFaces.indexOf(_local1) == 0){
(aVertex[_local2[1]] as Vertex).aFaces.push(_local1);
};
if ((aVertex[_local2[2]] as Vertex).aFaces.indexOf(_local1) == 0){
(aVertex[_local2[2]] as Vertex).aFaces.push(_local1);
};
aVertex[_local2[0]].nbFaces++;
aVertex[_local2[1]].nbFaces++;
aVertex[_local2[2]].nbFaces++;
};
_local1++;
};
_local1 = 0;
while (_local1 < aVertexNormals.length) {
_local4 = aVertex[_local1];
if (_local4.nbFaces){
Vertex(aVertexNormals[_local1]).scale((1 / _local4.nbFaces));
};
_local1++;
};
}
public function setVertexNormal(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (aVertexNormals[_arg1]){
return (-1);
};
aVertexNormals[_arg1] = new Vertex(_arg2, _arg3, _arg4);
return ((++m_nLastVertexNormalId - 1));
}
private function isEdgeExist(_arg1:uint, _arg2:uint):Boolean{
var _local3:String;
if (_arg1 < _arg2){
_local3 = ((_arg1 + "_") + _arg2);
} else {
_local3 = ((_arg2 + "_") + _arg1);
};
if (EDGES_DICO[_local3] == null){
return (false);
};
return (true);
}
public function dispose():void{
var _local1:Array;
var _local2:Vertex;
var _local3:Array;
var _local4:UVCoord;
for each (_local2 in aVertex) {
_local2 = null;
};
aVertex = null;
for each (_local1 in aFacesVertexID) {
_local1 = null;
};
aFacesVertexID = null;
for each (_local2 in aFacesNormals) {
_local2 = null;
};
aFacesNormals = null;
for each (_local2 in aVertexNormals) {
_local2 = null;
};
aVertexNormals = null;
for each (_local3 in aFacesUVCoordsID) {
_local3 = null;
};
aFacesUVCoordsID = null;
for each (_local4 in aUVCoords) {
_local4 = null;
};
aUVCoords = null;
}
public function getNextVertexID():Number{
return (m_nLastVertexId);
}
public function getNextFaceUVCoordID():Number{
return (m_nLastFaceUVId);
}
public function getNextFaceNormalID():Number{
return (m_nLastNormalId);
}
public function getVertexId(_arg1:Vertex):Number{
var _local2:Number;
_local2 = 0;
_local2 = 0;
while ((((_local2 < aVertex.length)) && (!((aVertex[_local2] == _arg1))))) {
_local2++;
};
return (((_local2 == aVertex.length)) ? -1 : _local2);
}
public function setFaceUVCoordsIds(_arg1:Number, ... _args):Number{
var _local3:Array;
if (aFacesUVCoordsID[_arg1]){
return (-1);
};
_local3 = ((_args[0] is Array)) ? _args[0] : _args.splice(0);
aFacesUVCoordsID[_arg1] = _local3;
return ((++m_nLastFaceUVId - 1));
}
public function clone():Geometry3D{
var _local1:Geometry3D;
var _local2:uint;
var _local3:Vertex;
var _local4:Array;
var _local5:Array;
var _local6:UVCoord;
var _local7:Edge3D;
var _local8:Array;
_local1 = new Geometry3D();
_local2 = 0;
for each (_local3 in aVertex) {
_local1.aVertex[_local2] = _local3.clone();
_local2++;
};
_local2 = 0;
for each (_local4 in aFacesVertexID) {
_local1.aFacesVertexID[_local2] = _local4.concat();
_local2++;
};
_local2 = 0;
for each (_local3 in aFacesNormals) {
_local1.aFacesNormals[_local2] = _local3.clone();
_local2++;
};
_local2 = 0;
for each (_local3 in aVertexNormals) {
_local1.aVertexNormals[_local2] = _local3.clone();
_local2++;
};
_local2 = 0;
for each (_local5 in aFacesUVCoordsID) {
_local1.aFacesUVCoordsID[_local2] = _local5.concat();
_local2++;
};
_local2 = 0;
for each (_local6 in aUVCoords) {
_local1.aUVCoords[_local2] = _local6.clone();
_local2++;
};
_local2 = 0;
for each (_local7 in aEdges) {
_local1.aEdges[_local2] = _local7.clone();
_local2++;
};
_local2 = 0;
for each (_local8 in aFaceEdges) {
_local1.aFaceEdges[_local2] = _local8.concat();
_local2++;
};
return (_local1);
}
public function getNextVertexNormalID():Number{
return (m_nLastVertexNormalId);
}
public function setFaceVertexIds(_arg1:Number, ... _args):Number{
var _local3:Array;
var _local4:uint;
var _local5:uint;
var _local6:uint;
var _local7:uint;
var _local8:String;
if (aFacesVertexID[_arg1]){
return (-1);
};
_local3 = ((_args[0] is Array)) ? _args[0] : _args.splice(0);
aFacesVertexID[_arg1] = _local3;
_local4 = 0;
while (_local4 < _local3.length) {
_local5 = _local3[_local4];
_local6 = _local3[((_local4 + 1) % _local3.length)];
if (isEdgeExist(_local5, _local6) == false){
_local7 = (aEdges.push(new Edge3D(_local5, _local6)) - 1);
if (_local5 < _local6){
_local8 = ((_local5 + "_") + _local6);
} else {
_local8 = ((_local6 + "_") + _local5);
};
EDGES_DICO[_local8] = _local7;
} else {
if (_local5 < _local6){
_local8 = ((_local5 + "_") + _local6);
} else {
_local8 = ((_local6 + "_") + _local5);
};
_local7 = EDGES_DICO[_local8];
};
if (null == aFaceEdges[_arg1]){
aFaceEdges[_arg1] = new Array();
};
(aFaceEdges[_arg1] as Array).push(_local7);
_local4++;
};
return ((++m_nLastFaceId - 1));
}
public function toString():String{
return ((((((((("[Geometry: " + aFacesVertexID.length) + " faces, ") + aVertex.length) + " points, ") + aFacesNormals.length) + " normals, ") + aUVCoords.length) + " uv coords]"));
}
}
}//package sandy.core.scenegraph
Section 60
//Group (sandy.core.scenegraph.Group)
package sandy.core.scenegraph {
import sandy.core.data.*;
import sandy.core.*;
import sandy.view.*;
public class Group extends Node {
public function Group(_arg1:String=""){
super(_arg1);
}
override public function render(_arg1:Scene3D, _arg2:Camera3D):void{
var _local3:Node;
for each (_local3 in children) {
if (_local3.culled != CullingState.OUTSIDE){
_local3.render(_arg1, _arg2);
};
_local3.changed = false;
_local3.culled = CullingState.INSIDE;
};
}
public function clone(_arg1:String):Group{
var _local2:Group;
var _local3:*;
_local2 = new Group(_arg1);
for each (_local3 in children) {
if ((((((_local3 is Shape3D)) || ((_local3 is Group)))) || ((_local3 is TransformGroup)))){
_local2.addChild(_local3.clone(((_arg1 + "_") + _local3.name)));
};
};
return (_local2);
}
override public function toString():String{
return ((("sandy.core.scenegraph.Group :[" + name) + "]"));
}
override public function cull(_arg1:Scene3D, _arg2:Frustum, _arg3:Matrix4, _arg4:Boolean):void{
var _local5:Boolean;
var _local6:Node;
if (visible == false){
culled = CullingState.OUTSIDE;
} else {
_local5 = ((_arg4) || (changed));
for each (_local6 in children) {
_local6.cull(_arg1, _arg2, _arg3, _local5);
};
};
}
}
}//package sandy.core.scenegraph
Section 61
//IDisplayable (sandy.core.scenegraph.IDisplayable)
package sandy.core.scenegraph {
import sandy.core.*;
import flash.display.*;
public interface IDisplayable {
function get container():Sprite;
function display(_arg1:Scene3D, _arg2:Sprite=null):void;
function get depth():Number;
function clear():void;
}
}//package sandy.core.scenegraph
Section 62
//INodeOperation (sandy.core.scenegraph.INodeOperation)
package sandy.core.scenegraph {
public interface INodeOperation {
function performOnEntry(_arg1:Node):void;
function performOnExit(_arg1:Node):void;
}
}//package sandy.core.scenegraph
Section 63
//Node (sandy.core.scenegraph.Node)
package sandy.core.scenegraph {
import sandy.materials.*;
import sandy.core.data.*;
import sandy.core.*;
import sandy.events.*;
import sandy.view.*;
import sandy.bounds.*;
public class Node {
public const id:uint;
public const viewMatrix:Matrix4;
public const modelMatrix:Matrix4;
public const children:Array;
public var name:String;
public var boundingBox:BBox;
public var culled:CullingState;
public var scene:Scene3D;// = null
public var boundingSphere:BSphere;
public var changed:Boolean;// = false
private var _parent:Node;
public var visible:Boolean;// = true
protected var m_oEB:BubbleEventBroadcaster;
private static var _ID_:uint = 0;
public function Node(_arg1:String=""){
culled = CullingState.OUTSIDE;
children = new Array();
modelMatrix = new Matrix4();
viewMatrix = new Matrix4();
id = _ID_++;
visible = true;
scene = null;
m_oEB = new BubbleEventBroadcaster();
changed = false;
super();
parent = null;
if (((_arg1) && (!((_arg1 == ""))))){
name = _arg1;
} else {
name = id.toString();
};
changed = true;
m_oEB = new BubbleEventBroadcaster();
culled = CullingState.INSIDE;
}
public function addChild(_arg1:Node):void{
if (_arg1.hasParent()){
_arg1.parent.removeChildByName(_arg1.name);
};
_arg1.parent = this;
changed = true;
children.push(_arg1);
if (_arg1.broadcaster){
m_oEB.addChild(_arg1.broadcaster);
};
}
public function remove():void{
var _local1:Array;
var _local2:Node;
parent.removeChildByName(name);
_local1 = children.concat();
for each (_local2 in _local1) {
parent.addChild(_local2);
};
children.splice(0);
m_oEB = null;
changed = true;
}
public function getChildByName(_arg1:String, _arg2:Boolean=false):Node{
var _local3:Node;
var _local4:Node;
for each (_local3 in children) {
if (_local3.name == _arg1){
return (_local3);
};
};
if (_arg2){
_local4 = null;
for each (_local3 in children) {
_local4 = _local3.getChildByName(_arg1, _arg2);
if (_local4 != null){
return (_local4);
};
};
};
return (null);
}
public function destroy():void{
var _local1:Array;
var _local2:Node;
if (hasParent() == true){
parent.removeChildByName(name);
};
_local1 = children.concat();
for each (_local2 in _local1) {
_local2.destroy();
};
children.splice(0);
m_oEB = null;
}
public function removeChildByName(_arg1:String):Boolean{
var _local2:Boolean;
var _local3:int;
var _local4:int;
_local2 = false;
_local4 = children.length;
while ((((_local3 < _local4)) && (!(_local2)))) {
if (children[int(_local3)].name == _arg1){
broadcaster.removeChild(children[int(_local3)].broadcaster);
children.splice(_local3, 1);
changed = true;
_local2 = true;
};
_local3++;
};
return (_local2);
}
public function swapParent(_arg1:Node):void{
if (parent.removeChildByName(this.name)){
};
_arg1.addChild(this);
}
public function set useSingleContainer(_arg1:Boolean):void{
var _local2:Node;
for each (_local2 in children) {
_local2.useSingleContainer = _arg1;
};
}
public function render(_arg1:Scene3D, _arg2:Camera3D):void{
}
public function get parent():Node{
return (_parent);
}
public function get broadcaster():BubbleEventBroadcaster{
return (m_oEB);
}
public function set appearance(_arg1:Appearance):void{
var _local2:Node;
for each (_local2 in children) {
_local2.appearance = _arg1;
};
}
public function addEventListener(_arg1:String, _arg2):Boolean{
return (m_oEB.addEventListener.apply(_arg1, arguments));
}
public function update(_arg1:Scene3D, _arg2:Matrix4, _arg3:Boolean):void{
var _local4:Node;
scene = _arg1;
if (boundingBox){
boundingBox.uptodate = false;
};
if (boundingSphere){
boundingSphere.uptodate = false;
};
changed = ((changed) || (_arg3));
for each (_local4 in children) {
_local4.update(_arg1, _arg2, changed);
};
}
public function removeEventListener(_arg1:String, _arg2):void{
m_oEB.removeEventListener(_arg1, _arg2);
}
public function set enableBackFaceCulling(_arg1:Boolean):void{
var _local2:Node;
for each (_local2 in children) {
_local2.enableBackFaceCulling = _arg1;
};
}
public function set parent(_arg1:Node):void{
if (_arg1){
_parent = _arg1;
changed = true;
};
}
public function set enableInteractivity(_arg1:Boolean):void{
var _local2:Node;
for each (_local2 in children) {
_local2.enableInteractivity = _arg1;
};
}
public function perform(_arg1:INodeOperation):void{
var _local2:Node;
_arg1.performOnEntry(this);
for each (_local2 in children) {
_local2.perform(_arg1);
};
_arg1.performOnExit(this);
}
public function hasParent():Boolean{
return (!((_parent == null)));
}
public function toString():String{
return ("sandy.core.scenegraph.Node");
}
public function set enableEvents(_arg1:Boolean):void{
var _local2:Node;
for each (_local2 in children) {
_local2.enableEvents = _arg1;
};
}
public function cull(_arg1:Scene3D, _arg2:Frustum, _arg3:Matrix4, _arg4:Boolean):void{
if (visible == false){
culled = CullingState.OUTSIDE;
} else {
if (((_arg4) || (changed))){
viewMatrix.copy(_arg3);
viewMatrix.multiply4x3(modelMatrix);
};
};
}
public function isParent(_arg1:Node):Boolean{
return ((((_parent == _arg1)) && (!((_arg1 == null)))));
}
}
}//package sandy.core.scenegraph
Section 64
//Shape3D (sandy.core.scenegraph.Shape3D)
package sandy.core.scenegraph {
import flash.events.*;
import sandy.materials.*;
import sandy.core.data.*;
import sandy.core.*;
import flash.display.*;
import sandy.events.*;
import sandy.view.*;
import sandy.bounds.*;
import flash.geom.*;
import flash.utils.*;
import sandy.core.sorters.*;
import sandy.math.*;
public class Shape3D extends ATransformable implements IDisplayable {
protected var m_oContainer:Sprite;
protected var m_bUseSingleContainer:Boolean;// = true
public var aPolygons:Array;
protected var m_nDepth:Number;// = 0
public var enableNearClipping:Boolean;// = false
public var enableClipping:Boolean;// = false
public var forcedDepth:Number;// = 0
private var m_oAppearance:Appearance;
private var m_bMouseInteractivity:Boolean;// = false
private var m_bBackFaceCulling:Boolean;// = true
private var m_bClipped:Boolean;// = false
public var invModelMatrix:Matrix4;
private var m_oCamPos:Vector;
private var m_oGeometry:Geometry3D;
private var m_nVisiblePoly:int;
protected var m_oGeomCenter:Vector;
protected var m_oCache:Dictionary;
public var animated:Boolean;// = false
private var m_aVisiblePoly:Array;
private var m_bForcedSingleContainer:Boolean;// = false
private var m_bEv:Boolean;// = false
public var enableForcedDepth:Boolean;// = false
public static var DEFAULT_APPEARANCE:Appearance = new Appearance(DEFAULT_MATERIAL);
public static var DEFAULT_MATERIAL:Material = new WireFrameMaterial();
public function Shape3D(_arg1:String="", _arg2:Geometry3D=null, _arg3:Appearance=null, _arg4:Boolean=true){
aPolygons = new Array();
invModelMatrix = new Matrix4();
enableNearClipping = false;
enableClipping = false;
enableForcedDepth = false;
forcedDepth = 0;
animated = false;
m_bEv = false;
m_oGeomCenter = new Vector();
m_bBackFaceCulling = true;
m_bClipped = false;
m_bUseSingleContainer = true;
m_nDepth = 0;
m_oCamPos = new Vector();
m_aVisiblePoly = new Array();
m_bMouseInteractivity = false;
m_bForcedSingleContainer = false;
super(_arg1);
m_oContainer = new Sprite();
geometry = _arg2;
m_bUseSingleContainer = !(_arg4);
useSingleContainer = _arg4;
appearance = (_arg3) ? _arg3 : Shape3D.DEFAULT_APPEARANCE;
updateBoundingVolumes();
}
override public function destroy():void{
m_oGeometry.dispose();
clear();
if (m_oContainer.parent){
m_oContainer.parent.removeChild(m_oContainer);
};
if (m_oContainer){
m_oContainer = null;
};
__destroyPolygons();
super.destroy();
}
override public function set useSingleContainer(_arg1:Boolean):void{
var _local2:Polygon;
if (_arg1 == m_bUseSingleContainer){
return;
};
if (_arg1){
for each (_local2 in aPolygons) {
if (_local2.container.parent){
_local2.container.graphics.clear();
_local2.container.parent.removeChild(_local2.container);
this.broadcaster.removeChild(_local2.broadcaster);
};
};
} else {
if (m_oContainer.parent){
m_oContainer.graphics.clear();
m_oContainer.parent.removeChild(m_oContainer);
};
for each (_local2 in aPolygons) {
this.broadcaster.addChild(_local2.broadcaster);
_local2.container.graphics.clear();
};
};
m_bUseSingleContainer = _arg1;
}
public function get enableInteractivity():Boolean{
return (m_bMouseInteractivity);
}
public function swapCulling():void{
var _local1:Polygon;
for each (_local1 in aPolygons) {
_local1.swapCulling();
};
changed = true;
}
public function updateBoundingVolumes():void{
if (m_oGeometry){
boundingSphere = BSphere.create(m_oGeometry.aVertex);
boundingBox = BBox.create(m_oGeometry.aVertex);
};
}
override public function set enableInteractivity(_arg1:Boolean):void{
var _local2:Polygon;
if (_arg1 != m_bMouseInteractivity){
if (_arg1){
if (m_bUseSingleContainer == true){
m_bUseSingleContainer = false;
m_bForcedSingleContainer = true;
};
} else {
if (m_bForcedSingleContainer == true){
useSingleContainer = true;
m_bForcedSingleContainer = false;
};
};
for each (_local2 in aPolygons) {
_local2.enableInteractivity = _arg1;
};
m_bMouseInteractivity = _arg1;
};
}
override public function set enableBackFaceCulling(_arg1:Boolean):void{
if (_arg1 != m_bBackFaceCulling){
m_bBackFaceCulling = _arg1;
changed = true;
};
}
public function clear():void{
if (m_oContainer){
m_oContainer.graphics.clear();
};
}
public function get geometryCenter():Vector{
return (m_oGeomCenter);
}
public function get appearance():Appearance{
return (m_oAppearance);
}
override public function toString():String{
return ((("sandy.core.scenegraph.Shape3D" + " ") + m_oGeometry.toString()));
}
override public function cull(_arg1:Scene3D, _arg2:Frustum, _arg3:Matrix4, _arg4:Boolean):void{
super.cull(_arg1, _arg2, _arg3, _arg4);
if (culled == Frustum.OUTSIDE){
return;
};
if (!boundingSphere.uptodate){
boundingSphere.transform(viewMatrix);
};
culled = _arg2.sphereInFrustum(boundingSphere);
if ((((culled == Frustum.INTERSECT)) && (boundingBox))){
if (!boundingBox.uptodate){
boundingBox.transform(viewMatrix);
};
culled = _arg2.boxInFrustum(boundingBox);
};
m_bClipped = (((culled == CullingState.INTERSECT)) && (((enableClipping) || (enableNearClipping))));
}
public function clone(_arg1:String="", _arg2:Boolean=false):Shape3D{
var _local3:Shape3D;
_local3 = new Shape3D(_arg1, geometry.clone(), appearance, m_bUseSingleContainer);
if (_arg2 == true){
_local3.matrix = this.matrix;
};
return (_local3);
}
public function get geometry():Geometry3D{
return (m_oGeometry);
}
public function get container():Sprite{
return (m_oContainer);
}
override public function render(_arg1:Scene3D, _arg2:Camera3D):void{
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:Matrix4;
var _local20:Frustum;
var _local21:Vertex;
var _local22:Polygon;
var _local23:Number;
var _local24:int;
var _local25:uint;
var _local26:Polygon;
if (m_oAppearance == null){
return;
};
_local18 = _arg2.near;
_local19 = viewMatrix;
_local20 = _arg2.frustrum;
invModelMatrix.n11 = modelMatrix.n11;
invModelMatrix.n12 = modelMatrix.n21;
invModelMatrix.n13 = modelMatrix.n31;
invModelMatrix.n21 = modelMatrix.n12;
invModelMatrix.n22 = modelMatrix.n22;
invModelMatrix.n23 = modelMatrix.n32;
invModelMatrix.n31 = modelMatrix.n13;
invModelMatrix.n32 = modelMatrix.n23;
invModelMatrix.n33 = modelMatrix.n33;
invModelMatrix.n14 = -((((modelMatrix.n11 * modelMatrix.n14) + (modelMatrix.n21 * modelMatrix.n24)) + (modelMatrix.n31 * modelMatrix.n34)));
invModelMatrix.n24 = -((((modelMatrix.n12 * modelMatrix.n14) + (modelMatrix.n22 * modelMatrix.n24)) + (modelMatrix.n32 * modelMatrix.n34)));
invModelMatrix.n34 = -((((modelMatrix.n13 * modelMatrix.n14) + (modelMatrix.n23 * modelMatrix.n24)) + (modelMatrix.n33 * modelMatrix.n34)));
m_oCamPos.reset(_arg2.modelMatrix.n14, _arg2.modelMatrix.n24, _arg2.modelMatrix.n34);
invModelMatrix.vectorMult(m_oCamPos);
_local19 = viewMatrix;
_local3 = _local19.n11;
_local4 = _local19.n21;
_local5 = _local19.n31;
_local6 = _local19.n12;
_local7 = _local19.n22;
_local8 = _local19.n32;
_local9 = _local19.n13;
_local10 = _local19.n23;
_local11 = _local19.n33;
_local12 = _local19.n14;
_local13 = _local19.n24;
_local14 = _local19.n34;
m_aVisiblePoly = [];
m_nVisiblePoly = 0;
m_nDepth = 0;
_local24 = appearance.flags;
m_oCache = new Dictionary(false);
_local25 = 0;
for each (_local22 in aPolygons) {
if (animated){
_local22.updateNormal();
};
_local21 = _local22.normal;
_local22.visible = ((((_local21.x * (m_oCamPos.x - _local22.a.x)) + (_local21.y * (m_oCamPos.y - _local22.a.y))) + (_local21.z * (m_oCamPos.z - _local22.a.z))) > 0);
if (m_bBackFaceCulling){
//unresolved if
} else {
if (m_oCache[_local22.a] == null){
_local21 = _local22.a;
_local15 = _local21.x;
_local16 = _local21.y;
_local17 = _local21.z;
_local22.a.wx = ((((_local15 * _local3) + (_local16 * _local6)) + (_local17 * _local9)) + _local12);
_local21.wy = ((((_local15 * _local4) + (_local16 * _local7)) + (_local17 * _local10)) + _local13);
_local21.wz = ((((_local15 * _local5) + (_local16 * _local8)) + (_local17 * _local11)) + _local14);
m_oCache[_local21] = _local21;
};
if (m_oCache[_local22.b] == null){
_local21 = _local22.b;
_local15 = _local21.x;
_local16 = _local21.y;
_local17 = _local21.z;
_local22.b.wx = ((((_local15 * _local3) + (_local16 * _local6)) + (_local17 * _local9)) + _local12);
_local21.wy = ((((_local15 * _local4) + (_local16 * _local7)) + (_local17 * _local10)) + _local13);
_local21.wz = ((((_local15 * _local5) + (_local16 * _local8)) + (_local17 * _local11)) + _local14);
m_oCache[_local21] = _local21;
};
if (_local22.c){
if (m_oCache[_local22.c] == null){
_local21 = _local22.c;
_local15 = _local21.x;
_local16 = _local21.y;
_local17 = _local21.z;
_local22.c.wx = ((((_local15 * _local3) + (_local16 * _local6)) + (_local17 * _local9)) + _local12);
_local21.wy = ((((_local15 * _local4) + (_local16 * _local7)) + (_local17 * _local10)) + _local13);
_local21.wz = ((((_local15 * _local5) + (_local16 * _local8)) + (_local17 * _local11)) + _local14);
m_oCache[_local21] = _local21;
};
};
_local22.precompute();
_local23 = _local22.minZ;
if (((m_bClipped) && (enableClipping))){
_local22.clip(_local20);
if ((((_local22.isClipped == true)) && ((_local22.cvertices.length > 2)))){
_arg2.projectArray(_local22.cvertices);
if (!enableForcedDepth){
m_nDepth = (m_nDepth + _local22.depth);
} else {
_local22.depth = forcedDepth;
};
};
if (_local22.cvertices.length > 2){
m_aVisiblePoly[int(m_nVisiblePoly++)] = _local22;
};
} else {
if (((enableNearClipping) && ((_local23 < _local18)))){
_local22.clipFrontPlane(_local20);
if ((((_local22.isClipped == true)) && ((_local22.cvertices.length > 2)))){
_arg2.projectArray(_local22.cvertices);
if (!enableForcedDepth){
m_nDepth = (m_nDepth + _local22.depth);
} else {
_local22.depth = forcedDepth;
};
};
if (_local22.cvertices.length > 2){
m_aVisiblePoly[int(m_nVisiblePoly++)] = _local22;
};
} else {
if (_local23 >= _local18){
if (!enableForcedDepth){
m_nDepth = (m_nDepth + _local22.depth);
} else {
_local22.depth = forcedDepth;
};
m_aVisiblePoly[int(m_nVisiblePoly++)] = _local22;
} else {
continue;
};
};
};
if (_local22.hasAppearanceChanged){
if (_arg1.materialManager.isRegistered(_local22.appearance.frontMaterial) == false){
_arg1.materialManager.register(_local22.appearance.frontMaterial);
};
if (_local22.appearance.frontMaterial != _local22.appearance.backMaterial){
if (_arg1.materialManager.isRegistered(_local22.appearance.backMaterial) == false){
_arg1.materialManager.register(_local22.appearance.backMaterial);
};
};
_local22.hasAppearanceChanged = false;
_local25 = (_local25 | _local24);
};
};
};
_arg2.projectDico(m_oCache);
if (m_bUseSingleContainer){
if (enableForcedDepth){
m_nDepth = forcedDepth;
} else {
m_nDepth = (m_nDepth / m_aVisiblePoly.length);
};
_arg2.addToDisplayList(this);
} else {
_arg2.addArrayToDisplayList(m_aVisiblePoly);
};
if ((((_local24 == 0)) && ((_local25 == 0)))){
return;
};
if (((_local24 | _local25) & SandyFlags.POLYGON_NORMAL_WORLD)){
_local19 = modelMatrix;
_local3 = _local19.n11;
_local4 = _local19.n21;
_local5 = _local19.n31;
_local6 = _local19.n12;
_local7 = _local19.n22;
_local8 = _local19.n32;
_local9 = _local19.n13;
_local10 = _local19.n23;
_local11 = _local19.n33;
for each (_local26 in m_aVisiblePoly) {
_local21 = _local26.normal;
_local15 = _local21.x;
_local16 = _local21.y;
_local17 = _local21.z;
_local26.normal.wx = (((_local15 * _local3) + (_local16 * _local6)) + (_local17 * _local9));
_local21.wy = (((_local15 * _local4) + (_local16 * _local7)) + (_local17 * _local10));
_local21.wz = (((_local15 * _local5) + (_local16 * _local8)) + (_local17 * _local11));
};
};
if (((_local24 | _local25) & SandyFlags.VERTEX_NORMAL_WORLD)){
_local19 = modelMatrix;
_local3 = _local19.n11;
_local4 = _local19.n21;
_local5 = _local19.n31;
_local6 = _local19.n12;
_local7 = _local19.n22;
_local8 = _local19.n32;
_local9 = _local19.n13;
_local10 = _local19.n23;
_local11 = _local19.n33;
for each (_local21 in m_oGeometry.aVertexNormals) {
_local15 = _local21.x;
_local16 = _local21.y;
_local17 = _local21.z;
_local21.wx = (((_local15 * _local3) + (_local16 * _local6)) + (_local17 * _local9));
_local21.wy = (((_local15 * _local4) + (_local16 * _local7)) + (_local17 * _local10));
_local21.wz = (((_local15 * _local5) + (_local16 * _local8)) + (_local17 * _local11));
};
};
}
public function get useSingleContainer():Boolean{
return (m_bUseSingleContainer);
}
public function get enableBackFaceCulling():Boolean{
return (m_bBackFaceCulling);
}
private function __destroyPolygons():void{
var _local1:int;
var _local2:int;
if (((!((aPolygons == null))) && ((aPolygons.length > 0)))){
_local2 = aPolygons.length;
while (_local1 < _local2) {
if (broadcaster != null){
broadcaster.removeChild(aPolygons[_local1].broadcaster);
};
if (aPolygons[_local1]){
Polygon(aPolygons[int(_local1)]).destroy();
};
aPolygons[int(_local1)] = null;
_local1++;
};
};
aPolygons.splice(0);
aPolygons = null;
}
public function display(_arg1:Scene3D, _arg2:Sprite=null):void{
var _local3:Polygon;
m_aVisiblePoly.sortOn("depth", (Array.NUMERIC | Array.DESCENDING));
for each (_local3 in m_aVisiblePoly) {
_local3.display(_arg1, m_oContainer);
};
}
public function get depth():Number{
return (m_nDepth);
}
public function get visiblePolygonsCount():uint{
return (m_nVisiblePoly);
}
override public function set appearance(_arg1:Appearance):void{
var _local2:Polygon;
m_oAppearance = _arg1;
if (m_oGeometry){
for each (_local2 in aPolygons) {
_local2.appearance = m_oAppearance;
};
};
}
public function set geometryCenter(_arg1:Vector):void{
var _local2:Vector;
var _local3:Vertex;
_local2 = _arg1.clone();
_local2.sub(m_oGeomCenter);
if (m_oGeometry){
for each (_local3 in m_oGeometry.aVertex) {
_local3.x = (_local3.x + _local2.x);
_local3.y = (_local3.y + _local2.y);
_local3.z = (_local3.z + _local2.z);
};
};
m_oGeomCenter.copy(_arg1);
updateBoundingVolumes();
}
protected function _onInteraction(_arg1:Event):void{
var _local2:Point;
var _local3:Point;
var _local4:Point;
var _local5:Point;
var _local6:Polygon;
var _local7:Array;
var _local8:int;
var _local9:int;
var _local10:int;
var _local11:int;
var _local12:int;
var _local13:UVCoord;
var _local14:Vector;
_local2 = new Point(m_oContainer.mouseX, m_oContainer.mouseY);
_local3 = new Point();
_local4 = new Point();
_local5 = new Point();
_local7 = aPolygons.sortOn("depth", (Array.NUMERIC | Array.RETURNINDEXEDARRAY));
_local8 = aPolygons.length;
_local9 = 0;
while (_local9 < _local8) {
_local6 = aPolygons[_local7[int(_local9)]];
if (((!(_local6.visible)) && (m_bBackFaceCulling))){
} else {
_local10 = _local6.vertices.length;
_local11 = (_local10 - 2);
_local12 = 0;
while (_local12 < _local11) {
_local3.x = _local6.vertices[_local12].sx;
_local3.y = _local6.vertices[_local12].sy;
_local4.x = _local6.vertices[(_local12 + 1)].sx;
_local4.y = _local6.vertices[(_local12 + 1)].sy;
_local5.x = _local6.vertices[((_local12 + 2) % _local10)].sx;
_local5.y = _local6.vertices[((_local12 + 2) % _local10)].sy;
if (IntersectionMath.isPointInTriangle2D(_local2, _local3, _local4, _local5)){
_local13 = _local6.getUVFrom2D(_local2);
_local14 = _local6.get3DFrom2D(_local2);
m_oEB.broadcastEvent(new Shape3DEvent(_arg1.type, this, _local6, _local13, _local14, _arg1));
return;
};
_local12++;
};
};
_local9 = (_local9 + 1);
};
}
public function set depthSorter(_arg1:IDepthSorter):void{
var _local2:Polygon;
for each (_local2 in aPolygons) {
_local2.depthSorter = _arg1;
};
}
private function __generatePolygons(_arg1:Geometry3D):void{
var _local2:int;
var _local3:int;
_local2 = 0;
_local3 = _arg1.aFacesVertexID.length;
aPolygons = new Array(_local3);
_local2 = 0;
while (_local2 < _local3) {
aPolygons[_local2] = new Polygon(this, _arg1, _arg1.aFacesVertexID[_local2], _arg1.aFacesUVCoordsID[_local2], _local2, _local2);
if (m_oAppearance){
aPolygons[int(_local2)].appearance = m_oAppearance;
};
this.broadcaster.addChild(aPolygons[int(_local2)].broadcaster);
_local2 = (_local2 + 1);
};
}
override public function set enableEvents(_arg1:Boolean):void{
var _local2:Polygon;
_local2 = null;
if (_arg1){
if (!m_bEv){
if (m_bUseSingleContainer == false){
for each (_local2 in aPolygons) {
_local2.enableEvents = true;
};
} else {
m_oContainer.addEventListener(MouseEvent.CLICK, _onInteraction);
m_oContainer.addEventListener(MouseEvent.MOUSE_UP, _onInteraction);
m_oContainer.addEventListener(MouseEvent.MOUSE_DOWN, _onInteraction);
m_oContainer.addEventListener(MouseEvent.ROLL_OVER, _onInteraction);
m_oContainer.addEventListener(MouseEvent.ROLL_OUT, _onInteraction);
m_oContainer.addEventListener(MouseEvent.DOUBLE_CLICK, _onInteraction);
m_oContainer.addEventListener(MouseEvent.MOUSE_MOVE, _onInteraction);
m_oContainer.addEventListener(MouseEvent.MOUSE_OVER, _onInteraction);
m_oContainer.addEventListener(MouseEvent.MOUSE_OUT, _onInteraction);
m_oContainer.addEventListener(MouseEvent.MOUSE_WHEEL, _onInteraction);
};
};
} else {
if (((!(_arg1)) && (m_bEv))){
if (m_bUseSingleContainer == false){
for each (_local2 in aPolygons) {
_local2.enableEvents = false;
};
} else {
m_oContainer.removeEventListener(MouseEvent.CLICK, _onInteraction);
m_oContainer.removeEventListener(MouseEvent.MOUSE_UP, _onInteraction);
m_oContainer.removeEventListener(MouseEvent.MOUSE_DOWN, _onInteraction);
m_oContainer.removeEventListener(MouseEvent.ROLL_OVER, _onInteraction);
m_oContainer.removeEventListener(MouseEvent.ROLL_OUT, _onInteraction);
m_oContainer.removeEventListener(MouseEvent.DOUBLE_CLICK, _onInteraction);
m_oContainer.removeEventListener(MouseEvent.MOUSE_MOVE, _onInteraction);
m_oContainer.removeEventListener(MouseEvent.MOUSE_OVER, _onInteraction);
m_oContainer.removeEventListener(MouseEvent.MOUSE_OUT, _onInteraction);
m_oContainer.removeEventListener(MouseEvent.MOUSE_WHEEL, _onInteraction);
};
};
};
m_bEv = _arg1;
}
public function set geometry(_arg1:Geometry3D):void{
if (_arg1 == null){
return;
};
m_oGeometry = _arg1;
updateBoundingVolumes();
m_oGeometry.generateFaceNormals();
m_oGeometry.generateVertexNormals();
__destroyPolygons();
__generatePolygons(m_oGeometry);
}
}
}//package sandy.core.scenegraph
Section 65
//Sprite2D (sandy.core.scenegraph.Sprite2D)
package sandy.core.scenegraph {
import flash.events.*;
import sandy.materials.*;
import sandy.core.data.*;
import sandy.core.*;
import flash.display.*;
import sandy.events.*;
import sandy.view.*;
import sandy.bounds.*;
public class Sprite2D extends ATransformable implements IDisplayable {
protected var m_nRotation:Number;// = 0
private var m_nH2:Number;// = 0
private var m_oContainer:Sprite;
protected var m_nDepth:Number;
protected var _vy:Vertex;
public var forcedDepth:Number;// = 0
protected var m_oMaterial:Material;
protected var m_nPerspScaleY:Number;// = 0
protected var m_nPerspScaleX:Number;// = 0
protected var _vx:Vertex;
public var floorCenter:Boolean;// = false
protected var _nScale:Number;
private var m_bLightingEnabled:Boolean;// = false
public var fixedAngle:Boolean;// = false
protected var m_oContent:DisplayObject;
private var m_nW2:Number;// = 0
private var m_bEv:Boolean;// = false
public var enableForcedDepth:Boolean;// = false
protected var _v:Vertex;
public var autoCenter:Boolean;// = true
public function Sprite2D(_arg1:String="", _arg2:DisplayObject=null, _arg3:Number=1){
fixedAngle = false;
autoCenter = true;
floorCenter = false;
enableForcedDepth = false;
forcedDepth = 0;
m_bEv = false;
m_nW2 = 0;
m_nH2 = 0;
m_bLightingEnabled = false;
m_nPerspScaleX = 0;
m_nPerspScaleY = 0;
m_nRotation = 0;
super(_arg1);
m_oContainer = new Sprite();
_v = new Vertex();
_vx = new Vertex();
_vy = new Vertex();
boundingSphere = new BSphere();
boundingBox = null;
_nScale = _arg3;
if (_arg2){
content = _arg2;
};
setBoundingSphereRadius(Math.max(30, (Math.abs(_nScale) * Math.max(content.width, content.height))));
}
override public function destroy():void{
remove();
super.destroy();
}
public function setBoundingSphereRadius(_arg1:Number):void{
boundingSphere.radius = _arg1;
}
public function set content(_arg1:DisplayObject):void{
_arg1.transform.matrix.identity();
if (m_oContent){
m_oContainer.removeChild(m_oContent);
};
m_oContent = _arg1;
m_oContainer.addChildAt(m_oContent, 0);
m_oContent.x = 0;
m_oContent.y = 0;
m_nW2 = (m_oContainer.width / 2);
m_nH2 = (m_oContainer.height / 2);
}
public function get material():Material{
return (m_oMaterial);
}
public function get scale():Number{
return (_nScale);
}
public function clear():void{
}
override public function toString():String{
return (("sandy.core.scenegraph.Sprite2D, container:" + m_oContainer));
}
public function set material(_arg1:Material):void{
m_oMaterial = _arg1;
}
override public function cull(_arg1:Scene3D, _arg2:Frustum, _arg3:Matrix4, _arg4:Boolean):void{
super.cull(_arg1, _arg2, _arg3, _arg4);
if (visible == false){
container.visible = visible;
return;
};
if (viewMatrix){
boundingSphere.transform(viewMatrix);
culled = _arg2.sphereInFrustum(boundingSphere);
};
if (culled == CullingState.OUTSIDE){
container.visible = false;
} else {
if (culled == CullingState.INTERSECT){
if (boundingSphere.position.z <= _arg1.camera.near){
container.visible = false;
} else {
container.visible = true;
};
} else {
container.visible = true;
};
};
}
public function get enableEvents():Boolean{
return (m_bEv);
}
override public function remove():void{
if (m_oContainer.parent){
m_oContainer.parent.removeChild(m_oContainer);
};
m_oContainer.graphics.clear();
enableEvents = false;
if (((!((m_oMaterial == null))) && (!(scene.materialManager.isRegistered(m_oMaterial))))){
scene.materialManager.unregister(m_oMaterial);
};
super.remove();
}
override public function render(_arg1:Scene3D, _arg2:Camera3D):void{
if (((!((m_oMaterial == null))) && (!(_arg1.materialManager.isRegistered(m_oMaterial))))){
_arg1.materialManager.register(m_oMaterial);
};
_v.wx = ((((_v.x * viewMatrix.n11) + (_v.y * viewMatrix.n12)) + (_v.z * viewMatrix.n13)) + viewMatrix.n14);
_v.wy = ((((_v.x * viewMatrix.n21) + (_v.y * viewMatrix.n22)) + (_v.z * viewMatrix.n23)) + viewMatrix.n24);
_v.wz = ((((_v.x * viewMatrix.n31) + (_v.y * viewMatrix.n32)) + (_v.z * viewMatrix.n33)) + viewMatrix.n34);
m_nDepth = (enableForcedDepth) ? forcedDepth : _v.wz;
_arg2.projectVertex(_v);
_arg2.addToDisplayList(this);
_vx.copy(_v);
_vx.wx++;
_arg2.projectVertex(_vx);
_vy.copy(_v);
_vy.wy++;
_arg2.projectVertex(_vy);
m_nPerspScaleX = ((_nScale)==0) ? 1 : (_nScale * (_vx.sx - _v.sx));
m_nPerspScaleY = ((_nScale)==0) ? 1 : (_nScale * (_v.sy - _vy.sy));
m_nRotation = Math.atan2(viewMatrix.n12, viewMatrix.n22);
}
public function get container():Sprite{
return (m_oContainer);
}
public function get content():DisplayObject{
return (m_oContent);
}
public function set scale(_arg1:Number):void{
if (_arg1){
_nScale = _arg1;
};
}
public function display(_arg1:Scene3D, _arg2:Sprite=null):void{
m_oContainer.scaleX = m_nPerspScaleX;
m_oContainer.scaleY = m_nPerspScaleY;
m_oContainer.x = (_v.sx - (autoCenter) ? (m_oContainer.width / 2) : 0);
m_oContainer.y = (_v.sy - (autoCenter) ? (m_oContainer.height / 2) : (floorCenter) ? m_oContainer.height : 0);
if (fixedAngle){
m_oContainer.rotation = ((m_nRotation * 180) / Math.PI);
};
if (m_oMaterial){
m_oMaterial.renderSprite(this, m_oMaterial, _arg1);
};
}
public function get depth():Number{
return (m_nDepth);
}
protected function _onInteraction(_arg1:Event):void{
m_oEB.broadcastEvent(new BubbleEvent(_arg1.type, this));
}
override public function set enableEvents(_arg1:Boolean):void{
if (((_arg1) && (!(m_bEv)))){
m_oContainer.addEventListener(MouseEvent.CLICK, _onInteraction);
m_oContainer.addEventListener(MouseEvent.MOUSE_UP, _onInteraction);
m_oContainer.addEventListener(MouseEvent.MOUSE_DOWN, _onInteraction);
m_oContainer.addEventListener(MouseEvent.ROLL_OVER, _onInteraction);
m_oContainer.addEventListener(MouseEvent.ROLL_OUT, _onInteraction);
m_oContainer.addEventListener(MouseEvent.DOUBLE_CLICK, _onInteraction);
m_oContainer.addEventListener(MouseEvent.MOUSE_MOVE, _onInteraction);
m_oContainer.addEventListener(MouseEvent.MOUSE_OVER, _onInteraction);
m_oContainer.addEventListener(MouseEvent.MOUSE_OUT, _onInteraction);
m_oContainer.addEventListener(MouseEvent.MOUSE_WHEEL, _onInteraction);
} else {
if (((!(_arg1)) && (m_bEv))){
m_oContainer.removeEventListener(MouseEvent.CLICK, _onInteraction);
m_oContainer.removeEventListener(MouseEvent.MOUSE_UP, _onInteraction);
m_oContainer.removeEventListener(MouseEvent.MOUSE_DOWN, _onInteraction);
m_oContainer.removeEventListener(MouseEvent.ROLL_OVER, _onInteraction);
m_oContainer.removeEventListener(MouseEvent.ROLL_OUT, _onInteraction);
m_oContainer.removeEventListener(MouseEvent.DOUBLE_CLICK, _onInteraction);
m_oContainer.removeEventListener(MouseEvent.MOUSE_MOVE, _onInteraction);
m_oContainer.removeEventListener(MouseEvent.MOUSE_OVER, _onInteraction);
m_oContainer.removeEventListener(MouseEvent.MOUSE_OUT, _onInteraction);
m_oContainer.removeEventListener(MouseEvent.MOUSE_WHEEL, _onInteraction);
};
};
}
}
}//package sandy.core.scenegraph
Section 66
//TransformGroup (sandy.core.scenegraph.TransformGroup)
package sandy.core.scenegraph {
import sandy.core.data.*;
import sandy.core.*;
import sandy.view.*;
public class TransformGroup extends ATransformable {
public function TransformGroup(_arg1:String=""){
super(_arg1);
}
override public function toString():String{
return ((("sandy.core.scenegraph.TransformGroup :[" + name) + "]"));
}
override public function cull(_arg1:Scene3D, _arg2:Frustum, _arg3:Matrix4, _arg4:Boolean):void{
var _local5:Boolean;
var _local6:Node;
if (visible == false){
culled = CullingState.OUTSIDE;
} else {
_local5 = ((_arg4) || (changed));
for each (_local6 in children) {
_local6.cull(_arg1, _arg2, _arg3, _local5);
};
};
}
public function clone(_arg1:String):TransformGroup{
var _local2:TransformGroup;
var _local3:*;
_local2 = new TransformGroup(_arg1);
for each (_local3 in children) {
if ((((((_local3 is Shape3D)) || ((_local3 is Group)))) || ((_local3 is TransformGroup)))){
_local2.addChild(_local3.clone(((_arg1 + "_") + _local3.name)));
};
};
return (_local2);
}
override public function render(_arg1:Scene3D, _arg2:Camera3D):void{
var _local3:Node;
for each (_local3 in children) {
if (_local3.culled != CullingState.OUTSIDE){
_local3.render(_arg1, _arg2);
};
_local3.changed = false;
_local3.culled = CullingState.INSIDE;
};
}
}
}//package sandy.core.scenegraph
Section 67
//IDepthSorter (sandy.core.sorters.IDepthSorter)
package sandy.core.sorters {
import sandy.core.data.*;
public interface IDepthSorter {
function getDepth(_arg1:Polygon):Number;
}
}//package sandy.core.sorters
Section 68
//MeanDepthSorter (sandy.core.sorters.MeanDepthSorter)
package sandy.core.sorters {
import sandy.core.data.*;
public class MeanDepthSorter implements IDepthSorter {
public function getDepth(_arg1:Polygon):Number{
if (_arg1.c != null){
return ((0.333 * ((_arg1.a.wz + _arg1.b.wz) + _arg1.c.wz)));
};
return ((0.5 * (_arg1.a.wz + _arg1.b.wz)));
}
}
}//package sandy.core.sorters
Section 69
//SandyFlags (sandy.core.SandyFlags)
package sandy.core {
public final class SandyFlags {
public static const VERTEX_NORMAL_WORLD:uint = 2;
public static const POLYGON_NORMAL_WORLD:uint = 1;
}
}//package sandy.core
Section 70
//Scene3D (sandy.core.Scene3D)
package sandy.core {
import flash.events.*;
import sandy.materials.*;
import sandy.core.data.*;
import sandy.core.scenegraph.*;
import flash.display.*;
import sandy.events.*;
import sandy.core.light.*;
public class Scene3D extends EventDispatcher {
public var container:Sprite;
private var m_bRectClipped:Boolean;// = true
private var _light:Light3D;
protected var m_sName:String;
public var materialManager:MaterialManager;
public var root:Group;
public var camera:Camera3D;
private static var _version:String = "3.0.3";
public function Scene3D(_arg1:String, _arg2:Sprite, _arg3:Camera3D=null, _arg4:Group=null){
materialManager = new MaterialManager();
m_bRectClipped = true;
super();
if (_arg1 != null){
if (SceneLocator.getInstance().registerScene(_arg1, this)){
container = _arg2;
camera = _arg3;
root = _arg4;
if (((!((root == null))) && (!((camera == null))))){
if (!camera.hasParent()){
root.addChild(camera);
};
};
};
m_sName = _arg1;
};
_light = new Light3D(new Vector(0, 0, 1), 100);
}
public function get name():String{
return (m_sName);
}
public function set rectClipping(_arg1:Boolean):void{
m_bRectClipped = _arg1;
if (camera){
camera.viewport.hasChanged = true;
};
}
public function render(_arg1:SandyEvent=null):void{
if (((((root) && (camera))) && (container))){
dispatchEvent(new SandyEvent(SandyEvent.SCENE_UPDATE));
root.update(this, null, false);
dispatchEvent(new SandyEvent(SandyEvent.SCENE_CULL));
root.cull(this, camera.frustrum, camera.invModelMatrix, camera.changed);
dispatchEvent(new SandyEvent(SandyEvent.SCENE_RENDER));
root.render(this, camera);
dispatchEvent(new SandyEvent(SandyEvent.SCENE_RENDER_DISPLAYLIST));
materialManager.begin(this);
camera.renderDisplayList(this);
materialManager.finish(this);
};
}
public function get light():Light3D{
return (_light);
}
public function dispose():Boolean{
SceneLocator.getInstance().unregisterScene(m_sName);
root.destroy();
if (root){
root = null;
};
if (camera){
camera = null;
};
if (_light){
_light = null;
};
return (true);
}
public function get rectClipping():Boolean{
return (m_bRectClipped);
}
public function set light(_arg1:Light3D):void{
if (_light){
_light.destroy();
};
_light = _arg1;
dispatchEvent(new SandyEvent(SandyEvent.LIGHT_ADDED));
}
public static function getVersion():String{
return (_version);
}
}
}//package sandy.core
Section 71
//SceneLocator (sandy.core.SceneLocator)
package sandy.core {
import flash.utils.*;
public class SceneLocator {
private var _m:Dictionary;
private static var _oI:SceneLocator;
public function SceneLocator(_arg1:PrivateConstructorAccess){
_m = new Dictionary(true);
}
public function unregisterScene(_arg1:String):void{
_m[_arg1] = null;
}
public function getScene(_arg1:String):Scene3D{
if (!isRegistered(_arg1)){
};
return ((_m[_arg1] as Scene3D));
}
public function registerScene(_arg1:String, _arg2:Scene3D):Boolean{
if (isRegistered(_arg1)){
return (false);
};
_m[_arg1] = _arg2;
return (true);
}
public function isRegistered(_arg1:String):Boolean{
return (!((_m[_arg1] == null)));
}
public static function getInstance():SceneLocator{
if (!_oI){
_oI = new SceneLocator(new PrivateConstructorAccess());
};
return (_oI);
}
}
}//package sandy.core
final class PrivateConstructorAccess {
private function PrivateConstructorAccess(){
}
}
Section 72
//World3D (sandy.core.World3D)
package sandy.core {
import sandy.core.light.*;
import sandy.errors.*;
public class World3D extends Scene3D {
private var _light:Light3D;
private static var create:Boolean;
private static var instance:World3D;
public function World3D(){
if (create){
super(null, null, null, null);
container = null;
} else {
throw (new SingletonError());
};
}
override public function toString():String{
return ("sandy.core.World3D");
}
public static function getInstance():World3D{
if (instance == null){
create = true;
instance = new (World3D);
create = false;
};
return (instance);
}
}
}//package sandy.core
Section 73
//SingletonError (sandy.errors.SingletonError)
package sandy.errors {
public class SingletonError extends Error {
public function SingletonError(){
super("Class cannot be instantiated");
}
}
}//package sandy.errors
Section 74
//BubbleEvent (sandy.events.BubbleEvent)
package sandy.events {
import flash.events.*;
public class BubbleEvent extends Event {
private var m_oTarget:Object;
public function BubbleEvent(_arg1:String, _arg2:Object){
super(_arg1, true, true);
m_oTarget = _arg2;
}
override public function toString():String{
return ("BubbleEvent");
}
override public function get target():Object{
return (m_oTarget);
}
}
}//package sandy.events
Section 75
//BubbleEventBroadcaster (sandy.events.BubbleEventBroadcaster)
package sandy.events {
import flash.events.*;
public final class BubbleEventBroadcaster extends EventBroadcaster {
private var m_oParent:BubbleEventBroadcaster;// = null
public function BubbleEventBroadcaster(){
m_oParent = null;
super();
}
public function get parent():BubbleEventBroadcaster{
return (m_oParent);
}
public function set parent(_arg1:BubbleEventBroadcaster):void{
m_oParent = _arg1;
}
public function removeChild(_arg1:BubbleEventBroadcaster):void{
}
override public function broadcastEvent(_arg1:Event):void{
if ((_arg1 is BubbleEvent)){
super.broadcastEvent(_arg1);
if (parent){
parent.broadcastEvent(_arg1);
};
} else {
parent.broadcastEvent(_arg1);
};
}
public function addChild(_arg1:BubbleEventBroadcaster):void{
_arg1.parent = this;
}
}
}//package sandy.events
Section 76
//EventBroadcaster (sandy.events.EventBroadcaster)
package sandy.events {
import flash.events.*;
import flash.utils.*;
import sandy.commands.*;
public class EventBroadcaster {
private var m_oAll:Dictionary;
private var m_oEventListener:Dictionary;
private var m_oDelegateDico:Dictionary;
private var m_oType:Dictionary;
private var listeners:Array;
public function EventBroadcaster(){
m_oAll = new Dictionary(true);
m_oType = new Dictionary(true);
m_oEventListener = new Dictionary(true);
m_oDelegateDico = new Dictionary(true);
super();
}
public function getListenerCollection(_arg1:String=null):Dictionary{
return (((_arg1)!=null) ? m_oType[_arg1] : m_oAll);
}
private function _storeRef(_arg1:String, _arg2:Object):void{
if (!m_oEventListener[_arg2]){
m_oEventListener[_arg2] = new Dictionary(true);
};
m_oEventListener[_arg2][_arg1] = _arg2;
}
public function removeEventListener(_arg1:String, _arg2:Object):Boolean{
var _local3:Dictionary;
if (hasListenerCollection(_arg1)){
_local3 = getListenerCollection(_arg1);
if ((_arg2 is Function)){
_arg2 = m_oDelegateDico[_arg2];
};
if (_local3[_arg2]){
_removeRef(_arg1, _arg2);
if (isDicoEmpty(_local3)){
removeListenerCollection(_arg1);
};
delete _local3[_arg2];
return (true);
} else {
return (false);
};
//unresolved jump
};
return (false);
}
public function isRegistered(_arg1:Object, _arg2:String=null):Boolean{
var _local3:*;
if (_arg2 == null){
return (m_oAll[_arg1]);
};
if (m_oType[_arg2]){
for each (_local3 in m_oType[_arg2]) {
if (_local3 == _arg1){
return (true);
};
};
return (false);
//unresolved jump
};
return (false);
}
public function addEventListener(_arg1:String, _arg2:Object, ... _args):Boolean{
var _local4:Delegate;
var _local5:Dictionary;
if ((_arg2 is Function)){
_local4 = new Delegate((_arg2 as Function));
if (_args){
_local4.setArgumentsArray(_args);
};
m_oDelegateDico[_arg2] = _local4;
_arg2 = _local4;
} else {
if (((_arg2.hasOwnProperty(_arg1)) && ((_arg2[_arg1] is Function)))){
} else {
if (((_arg2.hasOwnProperty("handleEvent")) && ((_arg2.handleEvent is Function)))){
} else {
return (false);
};
};
};
if (!isRegistered(_arg2)){
if (!m_oType[_arg1]){
m_oType[_arg1] = new Dictionary(true);
};
_local5 = getListenerCollection(_arg1);
if (!_local5[_arg2]){
_local5[_arg2] = _arg2;
_storeRef(_arg1, _arg2);
return (true);
};
};
return (false);
}
private function _removeRef(_arg1:String, _arg2:Object):void{
var _local3:Dictionary;
_local3 = m_oEventListener[_arg2];
delete _local3[_arg1];
if (isDicoEmpty(_local3)){
delete m_oEventListener[_arg2];
};
}
private function isDicoEmpty(_arg1:Dictionary):Boolean{
var _local2:uint;
var _local3:*;
_local2 = 0;
for each (_local3 in _arg1) {
_local2++;
};
return ((_local2 == 0));
}
public function removeListenerCollection(_arg1:String):void{
delete m_oType[_arg1];
}
private function _broadcastEvent(_arg1:Dictionary, _arg2:Event):void{
var _local3:String;
var _local4:Object;
_local3 = _arg2.type;
for each (_local4 in _arg1) {
if (((_local4.hasOwnProperty(_local3)) && ((_local4[_local3] is Function)))){
var _local7 = _local4;
_local7[_local3](_arg2);
} else {
if (((_local4.hasOwnProperty("handleEvent")) && ((_local4.handleEvent is Function)))){
_local4.handleEvent(_arg2);
};
};
};
}
public function broadcastEvent(_arg1:Event):void{
if (hasListenerCollection(_arg1.type)){
_broadcastEvent(getListenerCollection(_arg1.type), _arg1);
};
if (!isDicoEmpty(m_oAll)){
_broadcastEvent(m_oAll, _arg1);
};
}
public function hasListenerCollection(_arg1:String):Boolean{
return (!((m_oType[_arg1] == null)));
}
}
}//package sandy.events
Section 77
//SandyEvent (sandy.events.SandyEvent)
package sandy.events {
import flash.events.*;
public class SandyEvent extends Event {
public static const QUEUE_LOADER_ERROR:String = "queueLoaderError";
public static const SCENE_CULL:String = "scene_cull";
public static const QUEUE_COMPLETE:String = "queueComplete";
public static const SCENE_RENDER:String = "scene_render";
public static const CONTAINER_CREATED:String = "containerCreated";
public static const LIGHT_COLOR_CHANGED:String = "lightColorChanged";
public static const SCENE_RENDER_DISPLAYLIST:String = "scene_render_display_list";
public static const LIGHT_ADDED:String = "lightAdded";
public static const LIGHT_UPDATED:String = "lightUpdated";
public static const SCENE_UPDATE:String = "scene_update";
public function SandyEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
}
override public function clone():Event{
return (new SandyEvent(type, bubbles, cancelable));
}
}
}//package sandy.events
Section 78
//Shape3DEvent (sandy.events.Shape3DEvent)
package sandy.events {
import flash.events.*;
import sandy.core.data.*;
import sandy.core.scenegraph.*;
public class Shape3DEvent extends BubbleEvent {
public var point:Vector;
public var shape:Shape3D;
public var uv:UVCoord;
public var event:Event;
public var polygon:Polygon;
public function Shape3DEvent(_arg1:String, _arg2:Shape3D, _arg3:Polygon, _arg4:UVCoord, _arg5:Vector, _arg6:Event){
super(_arg1, _arg2);
shape = _arg2;
polygon = _arg3;
uv = _arg4;
point = _arg5;
event = _arg6;
}
}
}//package sandy.events
Section 79
//AAttributes (sandy.materials.attributes.AAttributes)
package sandy.materials.attributes {
import sandy.materials.*;
import sandy.core.data.*;
import sandy.core.scenegraph.*;
import sandy.core.*;
import flash.display.*;
public class AAttributes implements IAttributes {
protected var m_nFlags:uint;// = 0
public function AAttributes(){
m_nFlags = 0;
super();
}
public function unlink(_arg1:Polygon):void{
}
public function draw(_arg1:Graphics, _arg2:Polygon, _arg3:Material, _arg4:Scene3D):void{
}
public function get flags():uint{
return (m_nFlags);
}
public function drawOnSprite(_arg1:Sprite2D, _arg2:Material, _arg3:Scene3D):void{
}
public function init(_arg1:Polygon):void{
}
public function finish(_arg1:Scene3D):void{
}
public function begin(_arg1:Scene3D):void{
}
}
}//package sandy.materials.attributes
Section 80
//IAttributes (sandy.materials.attributes.IAttributes)
package sandy.materials.attributes {
import sandy.materials.*;
import sandy.core.data.*;
import sandy.core.scenegraph.*;
import sandy.core.*;
import flash.display.*;
public interface IAttributes {
function init(_arg1:Polygon):void;
function unlink(_arg1:Polygon):void;
function draw(_arg1:Graphics, _arg2:Polygon, _arg3:Material, _arg4:Scene3D):void;
function drawOnSprite(_arg1:Sprite2D, _arg2:Material, _arg3:Scene3D):void;
function begin(_arg1:Scene3D):void;
function finish(_arg1:Scene3D):void;
function get flags():uint;
}
}//package sandy.materials.attributes
Section 81
//LineAttributes (sandy.materials.attributes.LineAttributes)
package sandy.materials.attributes {
import sandy.materials.*;
import sandy.core.data.*;
import sandy.core.*;
import flash.display.*;
public class LineAttributes extends AAttributes {
public var modified:Boolean;
private var m_nAlpha:Number;
private var m_nColor:Number;
private var m_nThickness:Number;
public function LineAttributes(_arg1:uint=1, _arg2:uint=0, _arg3:Number=1){
m_nThickness = _arg1;
m_nAlpha = _arg3;
m_nColor = _arg2;
modified = true;
}
public function set color(_arg1:Number):void{
m_nColor = _arg1;
modified = true;
}
override public function draw(_arg1:Graphics, _arg2:Polygon, _arg3:Material, _arg4:Scene3D):void{
var _local5:Array;
var _local6:Vertex;
var _local7:int;
_local5 = (_arg2.isClipped) ? _arg2.cvertices : _arg2.vertices;
_arg1.lineStyle(m_nThickness, m_nColor, m_nAlpha);
_arg1.moveTo(_local5[0].sx, _local5[0].sy);
_local7 = _local5.length;
while ((_local6 = _local5[--_local7])) {
_arg1.lineTo(_local6.sx, _local6.sy);
};
}
public function get alpha():Number{
return (m_nAlpha);
}
public function get color():Number{
return (m_nColor);
}
public function get thickness():Number{
return (m_nThickness);
}
public function set thickness(_arg1:Number):void{
m_nThickness = _arg1;
modified = true;
}
public function set alpha(_arg1:Number):void{
m_nAlpha = _arg1;
modified = true;
}
}
}//package sandy.materials.attributes
Section 82
//MaterialAttributes (sandy.materials.attributes.MaterialAttributes)
package sandy.materials.attributes {
import sandy.materials.*;
import sandy.core.data.*;
import sandy.core.scenegraph.*;
import sandy.core.*;
import flash.display.*;
public class MaterialAttributes {
public var attributes:Array;
public function MaterialAttributes(... _args){
var _local2:int;
attributes = new Array();
super();
_local2 = 0;
while (_local2 < _args.length) {
if ((_args[_local2] is IAttributes)){
attributes.push(_args[_local2]);
};
_local2++;
};
}
public function unlink(_arg1:Polygon):void{
var _local2:IAttributes;
for each (_local2 in attributes) {
_local2.unlink(_arg1);
};
}
public function draw(_arg1:Graphics, _arg2:Polygon, _arg3:Material, _arg4:Scene3D):void{
var _local5:IAttributes;
for each (_local5 in attributes) {
_local5.draw(_arg1, _arg2, _arg3, _arg4);
};
}
public function drawOnSprite(_arg1:Sprite2D, _arg2:Material, _arg3:Scene3D):void{
var _local4:IAttributes;
for each (_local4 in attributes) {
_local4.drawOnSprite(_arg1, _arg2, _arg3);
};
}
public function begin(_arg1:Scene3D):void{
var _local2:IAttributes;
for each (_local2 in attributes) {
_local2.begin(_arg1);
};
}
public function init(_arg1:Polygon):void{
var _local2:IAttributes;
for each (_local2 in attributes) {
_local2.init(_arg1);
};
}
public function finish(_arg1:Scene3D):void{
var _local2:IAttributes;
for each (_local2 in attributes) {
_local2.finish(_arg1);
};
}
public function get flags():uint{
var _local1:uint;
var _local2:IAttributes;
_local1 = 0;
for each (_local2 in attributes) {
_local1 = (_local1 | _local2.flags);
};
return (_local1);
}
}
}//package sandy.materials.attributes
Section 83
//Appearance (sandy.materials.Appearance)
package sandy.materials {
public class Appearance {
private var m_oBackMaterial:Material;
private var m_oFrontMaterial:Material;
public function Appearance(_arg1:Material=null, _arg2:Material=null){
m_oFrontMaterial = ((_arg1)!=null) ? _arg1 : new ColorMaterial();
m_oBackMaterial = ((_arg2)!=null) ? _arg2 : m_oFrontMaterial;
}
public function set frontMaterial(_arg1:Material):void{
m_oFrontMaterial = _arg1;
if (m_oBackMaterial == null){
m_oBackMaterial = _arg1;
};
}
public function get flags():uint{
var _local1:uint;
_local1 = m_oFrontMaterial.flags;
if (m_oFrontMaterial != m_oBackMaterial){
_local1 = (_local1 | m_oBackMaterial.flags);
};
return (_local1);
}
public function toString():String{
return ("sandy.materials.Appearance");
}
public function get frontMaterial():Material{
return (m_oFrontMaterial);
}
public function get useVertexNormal():Boolean{
return (Boolean(((m_oBackMaterial.useVertexNormal) && (m_oFrontMaterial.useVertexNormal))));
}
public function get backMaterial():Material{
return (m_oBackMaterial);
}
public function set backMaterial(_arg1:Material):void{
m_oBackMaterial = _arg1;
if (m_oFrontMaterial == null){
m_oFrontMaterial = _arg1;
};
}
}
}//package sandy.materials
Section 84
//BitmapMaterial (sandy.materials.BitmapMaterial)
package sandy.materials {
import flash.filters.*;
import sandy.core.data.*;
import sandy.materials.attributes.*;
import sandy.core.*;
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
import sandy.util.*;
public class BitmapMaterial extends Material implements IAlphaMaterial {
protected const m_oOffset:Point;
protected const m_oTiling:Point;
protected var m_oPolygonMatrixMap:Dictionary;
private var m_nWidth:Number;
var graphics:Graphics;
private var m_nInvWidth:Number;
private var m_nRecLevel:int;// = 0
public var forceUpdate:Boolean;// = false
public var smooth:Boolean;// = false
protected var m_orgTexture:BitmapData;
var polygon:Polygon;
protected var m_oTexture:BitmapData;
private var m_nAlpha:Number;// = 1
protected var matrix:Matrix;
private var m_nInvHeight:Number;
protected var m_oCmf:ColorMatrixFilter;
public var maxRecurssionDepth:uint;// = 5
private var m_nHeight:Number;
var map:Matrix;
protected var m_oPoint:Point;
public var precision:uint;// = 0
public function BitmapMaterial(_arg1:BitmapData=null, _arg2:MaterialAttributes=null, _arg3:uint=0){
var _local4:BitmapData;
smooth = false;
precision = 0;
maxRecurssionDepth = 5;
map = new Matrix();
m_nAlpha = 1;
m_nRecLevel = 0;
m_oPoint = new Point();
matrix = new Matrix();
m_oTiling = new Point(1, 1);
m_oOffset = new Point(0, 0);
forceUpdate = false;
super(_arg2);
m_oType = MaterialType.BITMAP;
_local4 = new BitmapData(_arg1.width, _arg1.height, true, 0);
_local4.draw(_arg1);
texture = _local4;
m_oCmf = new ColorMatrixFilter();
m_oPolygonMatrixMap = new Dictionary(true);
precision = _arg3;
}
override public function init(_arg1:Polygon):void{
var _local2:Matrix;
var _local3:Array;
if (_arg1.vertices.length >= 3){
_local2 = null;
if ((((m_nWidth > 0)) && ((m_nHeight > 0)))){
_local3 = _arg1.aUVCoord;
if (_local3){
_local2 = _createTextureMatrix(_local3);
};
};
m_oPolygonMatrixMap[_arg1.id] = _local2;
};
super.init(_arg1);
}
override public function unlink(_arg1:Polygon):void{
if (m_oPolygonMatrixMap[_arg1.id]){
delete m_oPolygonMatrixMap[_arg1.id];
};
super.unlink(_arg1);
}
protected function _tesselatePolygon(_arg1:Array, _arg2:Array):void{
var _local3:Array;
var _local4:Array;
var _local5:Vertex;
var _local6:Vertex;
var _local7:Vertex;
_local3 = _arg1.slice();
_local4 = _arg2.slice();
if (_local3.length > 3){
_local3 = _local3.slice(0, 3);
_local4 = _local4.slice(0, 3);
_arg1.splice(1, 1);
_arg2.splice(1, 1);
_tesselatePolygon(_arg1, _arg2);
};
map = _createTextureMatrix(_local4);
_local5 = _local3[0];
_local6 = _local3[1];
_local7 = _local3[2];
if (precision == 0){
renderTriangle(map.a, map.b, map.c, map.d, map.tx, map.ty, _local5.sx, _local5.sy, _local6.sx, _local6.sy, _local7.sx, _local7.sy);
} else {
renderRec(map.a, map.b, map.c, map.d, map.tx, map.ty, _local5.sx, _local5.sy, _local5.wz, _local6.sx, _local6.sy, _local6.wz, _local7.sx, _local7.sy, _local7.wz);
};
_local3 = null;
_local4 = null;
}
protected function renderRec(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number, _arg9:Number, _arg10:Number, _arg11:Number, _arg12:Number, _arg13:Number, _arg14:Number, _arg15:Number):void{
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
var _local27:Number;
var _local28:Number;
var _local29:Number;
var _local30:Number;
var _local31:Number;
var _local32:Number;
var _local33:Number;
var _local34:Number;
var _local35:Number;
var _local36:Number;
var _local37:Number;
var _local38:Number;
var _local39:Number;
var _local40:Number;
var _local41:Number;
var _local42:Number;
var _local43:Number;
var _local44:Number;
var _local45:Number;
var _local46:Number;
var _local47:Number;
var _local48:Number;
var _local49:Number;
m_nRecLevel++;
_local16 = (_arg1 + _arg1);
_local17 = (_arg2 + _arg2);
_local18 = (_arg3 + _arg3);
_local19 = (_arg4 + _arg4);
_local20 = (_arg5 + _arg5);
_local21 = (_arg6 + _arg6);
_local22 = (2 / (_arg9 + _arg12));
_local23 = (2 / (_arg12 + _arg15));
_local24 = (2 / (_arg15 + _arg9));
_local25 = (((_arg7 * _arg9) + (_arg10 * _arg12)) * _local22);
_local26 = (((_arg8 * _arg9) + (_arg11 * _arg12)) * _local22);
_local27 = (((_arg10 * _arg12) + (_arg13 * _arg15)) * _local23);
_local28 = (((_arg11 * _arg12) + (_arg14 * _arg15)) * _local23);
_local29 = (((_arg13 * _arg15) + (_arg7 * _arg9)) * _local24);
_local30 = (((_arg14 * _arg15) + (_arg8 * _arg9)) * _local24);
_local31 = ((_arg7 + _arg10) - _local25);
_local32 = ((_arg8 + _arg11) - _local26);
_local33 = ((_arg10 + _arg13) - _local27);
_local34 = ((_arg11 + _arg14) - _local28);
_local35 = ((_arg13 + _arg7) - _local29);
_local36 = ((_arg14 + _arg8) - _local30);
_local37 = ((_local31 * _local31) + (_local32 * _local32));
_local38 = ((_local33 * _local33) + (_local34 * _local34));
_local39 = ((_local35 * _local35) + (_local36 * _local36));
_local40 = (_local25 * 0.5);
_local41 = (_local26 * 0.5);
_local42 = ((_arg9 + _arg12) * 0.5);
_local43 = (_local29 * 0.5);
_local44 = (_local30 * 0.5);
_local45 = ((_arg15 + _arg9) * 0.5);
_local46 = (_local27 * 0.5);
_local47 = (_local28 * 0.5);
_local48 = ((_arg12 + _arg15) * 0.5);
if ((((m_nRecLevel > maxRecurssionDepth)) || ((((((_local37 <= precision)) && ((_local39 <= precision)))) && ((_local38 <= precision)))))){
renderTriangle(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg10, _arg11, _arg13, _arg14);
m_nRecLevel--;
return;
};
if ((((((_local37 > precision)) && ((_local39 > precision)))) && ((_local38 > precision)))){
renderRec(_local16, _local17, _local18, _local19, _local20, _local21, _arg7, _arg8, _arg9, _local40, _local41, _local42, _local43, _local44, _local45);
renderRec(_local16, _local17, _local18, _local19, (_local20 - 1), _local21, _local40, _local41, _local42, _arg10, _arg11, _arg12, _local46, _local47, _local48);
renderRec(_local16, _local17, _local18, _local19, _local20, (_local21 - 1), _local43, _local44, _local45, _local46, _local47, _local48, _arg13, _arg14, _arg15);
renderRec(-(_local16), -(_local17), -(_local18), -(_local19), (-(_local20) + 1), (-(_local21) + 1), _local46, _local47, _local48, _local43, _local44, _local45, _local40, _local41, _local42);
m_nRecLevel--;
return;
};
_local49 = Math.max(_local37, Math.max(_local39, _local38));
if (_local37 == _local49){
renderRec(_local16, _arg2, _local18, _arg4, _local20, _arg6, _arg7, _arg8, _arg9, _local40, _local41, _local42, _arg13, _arg14, _arg15);
renderRec((_local16 + _arg2), _arg2, (_local18 + _arg4), _arg4, ((_local20 + _arg6) - 1), _arg6, _local40, _local41, _local42, _arg10, _arg11, _arg12, _arg13, _arg14, _arg15);
m_nRecLevel--;
return;
};
if (_local39 == _local49){
renderRec(_arg1, _local17, _arg3, _local19, _arg5, _local21, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _local43, _local44, _local45);
renderRec(_arg1, (_local17 + _arg1), _arg3, (_local19 + _arg3), _arg5, ((_local21 + _arg5) - 1), _local43, _local44, _local45, _arg10, _arg11, _arg12, _arg13, _arg14, _arg15);
m_nRecLevel--;
return;
};
renderRec((_arg1 - _arg2), _local17, (_arg3 - _arg4), _local19, (_arg5 - _arg6), _local21, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _local46, _local47, _local48);
renderRec(_local16, (_arg2 - _arg1), _local18, (_arg4 - _arg3), _local20, (_arg6 - _arg5), _arg7, _arg8, _arg9, _local46, _local47, _local48, _arg13, _arg14, _arg15);
m_nRecLevel--;
}
public function get texture():BitmapData{
return (m_oTexture);
}
public function set texture(_arg1:BitmapData):void{
var _local2:Boolean;
var _local3:String;
var _local4:Polygon;
if (_arg1 == m_oTexture){
return;
};
if (m_oTexture){
m_oTexture.dispose();
};
if (m_orgTexture){
m_orgTexture.dispose();
};
_local2 = false;
if (m_nHeight != _arg1.height){
_local2 = true;
} else {
if (m_nWidth != _arg1.width){
_local2 = true;
};
};
m_oTexture = _arg1;
m_orgTexture = _arg1.clone();
m_nHeight = m_oTexture.height;
m_nWidth = m_oTexture.width;
m_nInvHeight = (1 / m_nHeight);
m_nInvWidth = (1 / m_nWidth);
if (_local2){
for (_local3 in m_oPolygonMatrixMap) {
_local4 = Polygon.POLYGON_MAP[_local3];
init(_local4);
};
};
}
public function set alpha(_arg1:Number):void{
setTransparency(_arg1);
m_nAlpha = _arg1;
m_bModified = true;
}
protected function renderTriangle(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number, _arg9:Number, _arg10:Number, _arg11:Number, _arg12:Number):void{
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
_local13 = (_arg9 - _arg7);
_local14 = (_arg10 - _arg8);
_local15 = (_arg11 - _arg7);
_local16 = (_arg12 - _arg8);
matrix.a = ((_arg1 * _local13) + (_arg2 * _local15));
matrix.b = ((_arg1 * _local14) + (_arg2 * _local16));
matrix.c = ((_arg3 * _local13) + (_arg4 * _local15));
matrix.d = ((_arg3 * _local14) + (_arg4 * _local16));
matrix.tx = (((_arg5 * _local13) + (_arg6 * _local15)) + _arg7);
matrix.ty = (((_arg5 * _local14) + (_arg6 * _local16)) + _arg8);
graphics.lineStyle();
graphics.beginBitmapFill(m_oTexture, matrix, repeat, smooth);
graphics.moveTo(_arg7, _arg8);
graphics.lineTo(_arg9, _arg10);
graphics.lineTo(_arg11, _arg12);
graphics.endFill();
}
override public function renderPolygon(_arg1:Scene3D, _arg2:Polygon, _arg3:Sprite):void{
var _local4:Array;
var _local5:Array;
var _local6:Vertex;
var _local7:Vertex;
var _local8:Vertex;
if (m_oTexture == null){
return;
};
polygon = _arg2;
graphics = _arg3.graphics;
m_nRecLevel = 0;
if (polygon.isClipped){
_local4 = _arg2.cvertices.slice();
_local5 = _arg2.caUVCoord.slice();
_tesselatePolygon(_local4, _local5);
} else {
if (polygon.vertices.length > 3){
_local4 = _arg2.vertices.slice();
_local5 = _arg2.aUVCoord.slice();
_tesselatePolygon(_local4, _local5);
} else {
_local4 = _arg2.vertices;
_local5 = _arg2.aUVCoord;
map = (m_oPolygonMatrixMap[polygon.id] as Matrix);
_local6 = _local4[0];
_local7 = _local4[1];
_local8 = _local4[2];
if (precision == 0){
renderTriangle(map.a, map.b, map.c, map.d, map.tx, map.ty, _local6.sx, _local6.sy, _local7.sx, _local7.sy, _local8.sx, _local8.sy);
} else {
renderRec(map.a, map.b, map.c, map.d, map.tx, map.ty, _local6.sx, _local6.sy, _local6.wz, _local7.sx, _local7.sy, _local7.wz, _local8.sx, _local8.sy, _local8.wz);
};
};
};
if (attributes){
attributes.draw(graphics, polygon, this, _arg1);
};
_local4 = null;
_local5 = null;
}
public function setTransparency(_arg1:Number):void{
var _local2:Array;
_arg1 = NumberUtil.constrain(_arg1, 0, 1);
if (m_oCmf){
m_oCmf = null;
};
_local2 = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, _arg1, 0];
m_oCmf = new ColorMatrixFilter(_local2);
texture.applyFilter(m_orgTexture, texture.rect, m_oPoint, m_oCmf);
}
protected function _createTextureMatrix(_arg1:Array):Matrix{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Matrix;
_local2 = (((_arg1[0].u * m_oTiling.x) + m_oOffset.x) * m_nWidth);
_local3 = (((_arg1[0].v * m_oTiling.y) + m_oOffset.y) * m_nHeight);
_local4 = (((_arg1[1].u * m_oTiling.x) + m_oOffset.x) * m_nWidth);
_local5 = (((_arg1[1].v * m_oTiling.y) + m_oOffset.y) * m_nHeight);
_local6 = (((_arg1[2].u * m_oTiling.x) + m_oOffset.x) * m_nWidth);
_local7 = (((_arg1[2].v * m_oTiling.y) + m_oOffset.y) * m_nHeight);
if ((((((_local2 == _local4)) && ((_local3 == _local5)))) || ((((_local2 == _local6)) && ((_local3 == _local7)))))){
_local2 = (_local2 - ((_local2)>0.05) ? 0.05 : -0.05);
_local3 = (_local3 - ((_local3)>0.07) ? 0.07 : -0.07);
};
if ((((_local6 == _local4)) && ((_local7 == _local5)))){
_local6 = (_local6 - ((_local6)>0.05) ? 0.04 : -0.04);
_local7 = (_local7 - ((_local7)>0.06) ? 0.06 : -0.06);
};
_local8 = new Matrix((_local4 - _local2), (_local5 - _local3), (_local6 - _local2), (_local7 - _local3), _local2, _local3);
_local8.invert();
return (_local8);
}
public function toString():String{
return ("sandy.materials.BitmapMaterial");
}
public function get alpha():Number{
return (m_nAlpha);
}
public function setTiling(_arg1:Number, _arg2:Number, _arg3:Number=0, _arg4:Number=0):void{
var _local5:String;
var _local6:Polygon;
m_oTiling.x = _arg1;
m_oTiling.y = _arg2;
m_oOffset.x = (_arg3 - Math.floor(_arg3));
m_oOffset.y = (_arg4 - Math.floor(_arg4));
for (_local5 in m_oPolygonMatrixMap) {
_local6 = Polygon.POLYGON_MAP[_local5];
init(_local6);
};
}
}
}//package sandy.materials
Section 85
//ColorMaterial (sandy.materials.ColorMaterial)
package sandy.materials {
import sandy.core.data.*;
import sandy.materials.attributes.*;
import sandy.core.*;
import flash.display.*;
public final class ColorMaterial extends Material implements IAlphaMaterial {
private var m_nColor:Number;
private var m_nAlpha:Number;
public function ColorMaterial(_arg1:uint=0, _arg2:Number=1, _arg3:MaterialAttributes=null){
super(_arg3);
m_oType = MaterialType.COLOR;
m_nColor = _arg1;
m_nAlpha = _arg2;
}
override public function renderPolygon(_arg1:Scene3D, _arg2:Polygon, _arg3:Sprite):void{
var _local4:Array;
var _local5:Vertex;
var _local6:int;
var _local7:Graphics;
_local4 = (_arg2.isClipped) ? _arg2.cvertices : _arg2.vertices;
if (!_local4.length){
return;
};
_local6 = _local4.length;
_local7 = _arg3.graphics;
_local7.lineStyle();
_local7.beginFill(m_nColor, m_nAlpha);
_local7.moveTo(_local4[0].sx, _local4[0].sy);
while ((_local5 = _local4[--_local6])) {
_local7.lineTo(_local5.sx, _local5.sy);
};
_local7.endFill();
if (attributes){
attributes.draw(_local7, _arg2, this, _arg1);
};
}
public function set color(_arg1:Number):void{
m_nColor = _arg1;
m_bModified = true;
}
public function get color():Number{
return (m_nColor);
}
public function get alpha():Number{
return (m_nAlpha);
}
public function set alpha(_arg1:Number):void{
m_nAlpha = _arg1;
m_bModified = true;
}
}
}//package sandy.materials
Section 86
//IAlphaMaterial (sandy.materials.IAlphaMaterial)
package sandy.materials {
public interface IAlphaMaterial {
function set alpha(_arg1:Number):void;
function get alpha():Number;
}
}//package sandy.materials
Section 87
//Material (sandy.materials.Material)
package sandy.materials {
import sandy.core.data.*;
import sandy.core.scenegraph.*;
import sandy.materials.attributes.*;
import sandy.core.*;
import flash.display.*;
public class Material {
protected var m_nFlags:uint;// = 0
public var useVertexNormal:Boolean;// = false
public var attributes:MaterialAttributes;
public var repeat:Boolean;// = true
private var _id:Number;
public var lightingEnable:Boolean;// = false
protected var _useLight:Boolean;// = false
protected var m_oType:MaterialType;
protected var m_bModified:Boolean;
private var _filters:Array;
private static var create:Boolean;
private static var _ID_:Number = 0;
public function Material(_arg1:MaterialAttributes=null){
useVertexNormal = false;
lightingEnable = false;
repeat = true;
m_nFlags = 0;
_useLight = false;
super();
_filters = [];
_useLight = false;
_id = _ID_++;
attributes = ((_arg1)==null) ? new MaterialAttributes() : _arg1;
m_bModified = true;
m_oType = MaterialType.NONE;
}
public function get filters():Array{
return (_filters);
}
public function renderPolygon(_arg1:Scene3D, _arg2:Polygon, _arg3:Sprite):void{
if (attributes){
attributes.draw(_arg3.graphics, _arg2, this, _arg1);
};
}
public function get modified():Boolean{
return (m_bModified);
}
public function get flags():uint{
var _local1:uint;
_local1 = m_nFlags;
_local1 = (_local1 | attributes.flags);
return (_local1);
}
public function init(_arg1:Polygon):void{
attributes.init(_arg1);
}
public function unlink(_arg1:Polygon):void{
attributes.unlink(_arg1);
}
public function finish(_arg1:Scene3D):void{
attributes.finish(_arg1);
}
public function get id():Number{
return (_id);
}
public function begin(_arg1:Scene3D):void{
attributes.begin(_arg1);
}
public function get type():MaterialType{
return (m_oType);
}
public function renderSprite(_arg1:Sprite2D, _arg2:Material, _arg3:Scene3D):void{
if (attributes){
attributes.drawOnSprite(_arg1, _arg2, _arg3);
};
}
public function set filters(_arg1:Array):void{
_filters = _arg1;
m_bModified = true;
}
}
}//package sandy.materials
Section 88
//MaterialManager (sandy.materials.MaterialManager)
package sandy.materials {
import sandy.core.*;
public final class MaterialManager {
private const m_aList:Array;
public function MaterialManager(){
m_aList = new Array();
super();
}
public function finish(_arg1:Scene3D):void{
var _local2:Material;
for each (_local2 in m_aList) {
_local2.finish(_arg1);
};
}
public function unregister(_arg1:Material):void{
var _local2:int;
_local2 = 0;
while (_local2 < m_aList.length) {
if (m_aList[_local2] == _arg1){
m_aList.splice(_local2, 1);
return;
};
_local2 = (_local2 + 1);
};
}
public function begin(_arg1:Scene3D):void{
var _local2:Material;
for each (_local2 in m_aList) {
_local2.begin(_arg1);
};
}
public function register(_arg1:Material):void{
m_aList.push(_arg1);
}
public function isRegistered(_arg1:Material):Boolean{
var _local2:int;
_local2 = 0;
while (_local2 < m_aList.length) {
if (m_aList[_local2] == _arg1){
return (true);
};
_local2 = (_local2 + 1);
};
return (false);
}
}
}//package sandy.materials
Section 89
//MaterialType (sandy.materials.MaterialType)
package sandy.materials {
public class MaterialType {
private var m_sType:String;
public static const COLOR:MaterialType = new MaterialType("color");
;
public static const WIREFRAME:MaterialType = new MaterialType("wireframe");
;
public static const OUTLINE:MaterialType = new MaterialType("outline");
;
public static const BITMAP:MaterialType = new MaterialType("bitmap");
;
public static const NONE:MaterialType = new MaterialType("default");
;
public static const VIDEO:MaterialType = new MaterialType("video");
;
public static const MOVIE:MaterialType = new MaterialType("movie");
;
public function MaterialType(_arg1:String){
m_sType = _arg1;
}
public function typeString():String{
return (m_sType);
}
}
}//package sandy.materials
Section 90
//MovieMaterial (sandy.materials.MovieMaterial)
package sandy.materials {
import flash.events.*;
import sandy.core.data.*;
import sandy.materials.attributes.*;
import sandy.core.*;
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
import sandy.math.*;
import sandy.util.*;
public class MovieMaterial extends BitmapMaterial {
private var m_bUpdate:Boolean;
private var m_oTimer:Timer;
private var m_oMovie:Sprite;
private var m_oAlpha:ColorTransform;
public static const DEFAULT_FILL_COLOR:uint = 0;
public function MovieMaterial(_arg1:Sprite, _arg2:uint=40, _arg3:MaterialAttributes=null, _arg4:Boolean=false, _arg5:Number=0, _arg6:Number=0){
var _local7:Number;
var _local8:Number;
var _local9:BitmapData;
var _local10:Rectangle;
m_oAlpha = new ColorTransform();
if (_arg4){
_local9 = new BitmapData(_arg1.width, _arg1.height, true, 0);
_local9.draw(_arg1);
_local10 = _local9.getColorBoundsRect(4278190080, 0, false);
_local7 = _local10.width;
_local8 = _local10.height;
} else {
_local7 = (_arg6) ? _arg6 : _arg1.width;
_local8 = (_arg5) ? _arg5 : _arg1.height;
};
super(new BitmapData(_local7, _local8, true, DEFAULT_FILL_COLOR), _arg3);
m_oMovie = _arg1;
m_oType = MaterialType.MOVIE;
m_bUpdate = true;
m_oTimer = new Timer(_arg2);
m_oTimer.addEventListener(TimerEvent.TIMER, _update);
m_oTimer.start();
if (_local9){
_local9.dispose();
_local9 = null;
};
_local10 = null;
_local7 = undefined;
_local8 = undefined;
}
public function stop():void{
m_oTimer.stop();
}
public function get movie():Sprite{
return (m_oMovie);
}
override public function renderPolygon(_arg1:Scene3D, _arg2:Polygon, _arg3:Sprite):void{
m_bUpdate = true;
super.renderPolygon(_arg1, _arg2, _arg3);
}
override public function setTransparency(_arg1:Number):void{
m_oAlpha.alphaMultiplier = NumberUtil.constrain(_arg1, 0, 1);
}
public function start():void{
m_oTimer.start();
}
private function _update(_arg1:Event):void{
if (((m_bUpdate) || (forceUpdate))){
m_oTexture.fillRect(m_oTexture.rect, ColorMath.applyAlpha(DEFAULT_FILL_COLOR, m_oAlpha.alphaMultiplier));
m_oTexture.draw(m_oMovie, null, m_oAlpha, null, null, smooth);
};
m_bUpdate = false;
}
}
}//package sandy.materials
Section 91
//WireFrameMaterial (sandy.materials.WireFrameMaterial)
package sandy.materials {
import sandy.core.data.*;
import sandy.materials.attributes.*;
import sandy.core.*;
import flash.display.*;
public final class WireFrameMaterial extends Material {
public function WireFrameMaterial(_arg1:uint=1, _arg2:uint=0, _arg3:Number=1, _arg4:MaterialAttributes=null){
super(_arg4);
m_oType = MaterialType.WIREFRAME;
attributes.attributes.push(new LineAttributes(_arg1, _arg2, _arg3));
}
override public function renderPolygon(_arg1:Scene3D, _arg2:Polygon, _arg3:Sprite):void{
attributes.draw(_arg3.graphics, _arg2, this, _arg1);
}
}
}//package sandy.materials
Section 92
//ColorMath (sandy.math.ColorMath)
package sandy.math {
public class ColorMath {
public static function applyAlpha(_arg1:uint, _arg2:Number):uint{
var _local3:uint;
_local3 = (_arg1 / 16777216);
return (((_arg1 & 0xFFFFFF) + (Math.floor((_arg2 * _local3)) * 16777216)));
}
public static function calculateLitColour(_arg1:Number, _arg2:Number):Number{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Array;
var _local16:Number;
var _local17:Number;
var _local18:Number;
_local3 = ((_arg1 >> 16) & 0xFF);
_local4 = ((_arg1 >> 8) & 0xFF);
_local5 = (_arg1 & 0xFF);
_local3 = (_local3 * 0.00390625);
_local4 = (_local4 * 0.00390625);
_local5 = (_local5 * 0.00390625);
_local14 = 0;
_local15 = [_local3, _local4, _local5];
_local15.sort();
_local6 = _local15[0];
_local7 = _local15[1];
_local8 = _local15[2];
_local16 = (_local8 - _local6);
_local10 = ((_local6 + _local8) * 0.5);
if (_local10 == 0){
_local11 = 1;
} else {
_local9 = (_local16 * 0.5);
if (_local10 < 0.5){
_local11 = (_local9 / _local10);
} else {
_local11 = (_local9 / (1 - _local10));
};
if (_local16 != 0){
while (true) {
if (_local3 == _local8){
if (_local5 == _local6){
_local14 = 0;
} else {
_local14 = 5;
};
break;
};
if (_local4 == _local8){
if (_local5 == _local6){
_local14 = 1;
} else {
_local14 = 2;
};
break;
};
if (_local3 == _local6){
_local14 = 3;
} else {
_local14 = 4;
};
break;
};
if ((_local14 % 2) == 0){
_local13 = (_local7 - _local6);
} else {
_local13 = (_local8 - _local7);
};
_local13 = (_local13 / _local16);
_local12 = (60 * (_local14 + _local13));
};
};
if (_arg2 < 0.5){
_local9 = (_local11 * _arg2);
} else {
_local9 = (_local11 * (1 - _arg2));
};
_local6 = (_arg2 - _local9);
_local8 = (_arg2 + _local9);
_local14 = Math.floor((_local12 / 60));
_local13 = (((_local12 - (_local14 * 60)) * _local9) / 30);
_local14 = (_local14 % 6);
_local17 = (_local6 + _local13);
_local18 = (_local8 - _local13);
switch (_local14){
case 0:
_local3 = _local8;
_local4 = _local17;
_local5 = _local6;
break;
case 1:
_local3 = _local18;
_local4 = _local8;
_local5 = _local6;
break;
case 2:
_local3 = _local6;
_local4 = _local8;
_local5 = _local17;
break;
case 3:
_local3 = _local6;
_local4 = _local18;
_local5 = _local8;
break;
case 4:
_local3 = _local17;
_local4 = _local6;
_local5 = _local8;
break;
case 5:
_local3 = _local8;
_local4 = _local6;
_local5 = _local18;
break;
};
return (((((_local3 * 0x0100) << 16) | ((_local4 * 0x0100) << 8)) | (_local5 * 0x0100)));
}
public static function hex2rgb(_arg1:Number):Object{
var _local2:Number;
var _local3:Number;
var _local4:Number;
_local2 = ((0xFF0000 & _arg1) >> 16);
_local3 = ((0xFF00 & _arg1) >> 8);
_local4 = (0xFF & _arg1);
return ({r:_local2, g:_local3, b:_local4});
}
public static function rgb2hex(_arg1:Number, _arg2:Number, _arg3:Number):Number{
return ((((_arg1 << 16) | (_arg2 << 8)) | _arg3));
}
public static function hex2rgbn(_arg1:Number):Object{
var _local2:Number;
var _local3:Number;
var _local4:Number;
_local2 = ((0xFF0000 & _arg1) >> 16);
_local3 = ((0xFF00 & _arg1) >> 8);
_local4 = (0xFF & _arg1);
return ({r:(_local2 / 0xFF), g:(_local3 / 0xFF), b:(_local4 / 0xFF)});
}
}
}//package sandy.math
Section 93
//FastMath (sandy.math.FastMath)
package sandy.math {
public class FastMath {
public static const PRECISION_DIV_2PI:Number = 20860.7567009409;
public static const HALF_PI:Number = 1.5707963267949;
public static const TWO_PI:Number = 6.28318530717959;
public static const PRECISION_S:int = 131071;
public static const initialized:Boolean = initialize();
public static const PRECISION:int = 131072;
private static var RAD_SLICE:Number = 4.79368996214263E-5;
private static var tanTable:Array = new Array(PRECISION);
private static var sinTable:Array = new Array(PRECISION);
public static function tan(_arg1:Number):Number{
return (tanTable[int(radToIndex(_arg1))]);
}
public static function sin(_arg1:Number):Number{
return (sinTable[int(radToIndex(_arg1))]);
}
private static function radToIndex(_arg1:Number):int{
return (int(((_arg1 * PRECISION_DIV_2PI) & PRECISION_S)));
}
public static function cos(_arg1:Number):Number{
return (sinTable[int(radToIndex((HALF_PI - _arg1)))]);
}
private static function initialize():Boolean{
var _local1:Number;
var _local2:int;
_local1 = 0;
_local2 = 0;
while (_local2 < PRECISION) {
_local1 = Number((_local2 * RAD_SLICE));
sinTable[_local2] = Number(Math.sin(_local1));
tanTable[_local2] = Number(Math.tan(_local1));
_local2++;
};
return (true);
}
}
}//package sandy.math
Section 94
//IntersectionMath (sandy.math.IntersectionMath)
package sandy.math {
import sandy.core.data.*;
import sandy.bounds.*;
import flash.geom.*;
import sandy.util.*;
public final class IntersectionMath {
public static function isPointInTriangle2D(_arg1:Point, _arg2:Point, _arg3:Point, _arg4:Point):Boolean{
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local5 = (1 / (((_arg2.y - _arg4.y) * (_arg3.x - _arg4.x)) + ((_arg3.y - _arg4.y) * (_arg4.x - _arg2.x))));
_local6 = (_local5 * (((_arg1.y - _arg4.y) * (_arg3.x - _arg4.x)) + ((_arg3.y - _arg4.y) * (_arg4.x - _arg1.x))));
_local7 = (_local5 * (((_arg1.y - _arg2.y) * (_arg4.x - _arg2.x)) + ((_arg4.y - _arg2.y) * (_arg2.x - _arg1.x))));
_local8 = (_local5 * (((_arg1.y - _arg3.y) * (_arg2.x - _arg3.x)) + ((_arg2.y - _arg3.y) * (_arg3.x - _arg1.x))));
return ((((((_local6 > 0)) && ((_local7 > 0)))) && ((_local8 > 0))));
}
public static function intersectionLine3D(_arg1:Vector, _arg2:Vector, _arg3:Vector, _arg4:Vector):Array{
var _local5:Array;
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:Number;
_local5 = [new Vector((0.5 * (_arg1.x + _arg2.x)), (0.5 * (_arg1.y + _arg2.y)), (0.5 * (_arg1.z + _arg2.z))), new Vector((0.5 * (_arg3.x + _arg4.x)), (0.5 * (_arg3.y + _arg4.y)), (0.5 * (_arg3.z + _arg4.z)))];
_local6 = (_arg1.x - _arg3.x);
_local7 = (_arg1.y - _arg3.y);
_local8 = (_arg1.z - _arg3.z);
_local9 = (_arg4.x - _arg3.x);
_local10 = (_arg4.y - _arg3.y);
_local11 = (_arg4.z - _arg3.z);
if (((((NumberUtil.isZero(_local9)) && (NumberUtil.isZero(_local10)))) && (NumberUtil.isZero(_local11)))){
return (_local5);
};
_local12 = (_arg2.x - _arg1.x);
_local13 = (_arg2.y - _arg1.y);
_local14 = (_arg2.z - _arg1.z);
if (((((NumberUtil.isZero(_local12)) && (NumberUtil.isZero(_local13)))) && (NumberUtil.isZero(_local14)))){
return (_local5);
};
_local15 = (((_local6 * _local9) + (_local7 * _local10)) + (_local8 * _local11));
_local16 = (((_local9 * _local12) + (_local10 * _local13)) + (_local11 * _local14));
_local17 = (((_local6 * _local12) + (_local7 * _local13)) + (_local8 * _local14));
_local18 = (((_local9 * _local9) + (_local10 * _local10)) + (_local11 * _local11));
_local19 = (((_local12 * _local12) + (_local13 * _local13)) + (_local14 * _local14));
_local20 = ((_local19 * _local18) - (_local16 * _local16));
if (NumberUtil.isZero(_local20)){
return (_local5);
};
_local21 = (((_local15 * _local16) - (_local17 * _local18)) / _local20);
_local22 = ((_local15 + (_local16 * _local21)) / _local18);
return ([new Vector((_arg1.x + (_local21 * _local12)), (_arg1.y + (_local21 * _local13)), (_arg1.z + (_local21 * _local14))), new Vector((_arg3.x + (_local22 * _local9)), (_arg3.y + (_local22 * _local10)), (_arg3.z + (_local22 * _local11)))]);
}
public static function intersectionBSphere(_arg1:BSphere, _arg2:BSphere):Boolean{
var _local3:Vector;
var _local4:Number;
var _local5:Number;
_local3 = _arg1.position.clone();
_local3.sub(_arg2.position);
_local4 = (_arg1.radius + _arg2.radius);
_local5 = _local3.getNorm();
return ((_local5 <= _local4));
}
public static function intersectionLine2D(_arg1:Point, _arg2:Point, _arg3:Point, _arg4:Point):Point{
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;
_local5 = _arg1.x;
_local6 = _arg1.y;
_local7 = _arg2.x;
_local8 = _arg2.y;
_local9 = _arg3.x;
_local10 = _arg3.y;
_local11 = _arg4.x;
_local12 = _arg4.y;
_local13 = (((_local12 - _local10) * (_local7 - _local5)) - ((_local11 - _local9) * (_local8 - _local6)));
if (_local13 == 0){
return (null);
};
_local14 = (((_local11 - _local9) * (_local6 - _local10)) - ((_local12 - _local10) * (_local5 - _local9)));
_local14 = (_local14 / _local13);
return (new Point((_local5 + (_local14 * (_local7 - _local5))), (_local6 + (_local14 * (_local8 - _local6)))));
}
}
}//package sandy.math
Section 95
//Matrix4Math (sandy.math.Matrix4Math)
package sandy.math {
import sandy.core.data.*;
import sandy.util.*;
public class Matrix4Math {
private const _fastMathInitialized:Boolean;
public static var USE_FAST_MATH:Boolean = false;
public function Matrix4Math(){
_fastMathInitialized = FastMath.initialized;
super();
}
public static function getInverse(_arg1:Matrix4):Matrix4{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
_local2 = Matrix4Math.det(_arg1);
if (Math.abs(_local2) < 0.001){
return (null);
};
_local2 = (1 / _local2);
_local3 = _arg1.n11;
_local4 = _arg1.n21;
_local5 = _arg1.n31;
_local6 = _arg1.n41;
_local7 = _arg1.n12;
_local8 = _arg1.n22;
_local9 = _arg1.n32;
_local10 = _arg1.n42;
_local11 = _arg1.n13;
_local12 = _arg1.n23;
_local13 = _arg1.n33;
_local14 = _arg1.n43;
_local15 = _arg1.n14;
_local16 = _arg1.n24;
_local17 = _arg1.n34;
_local18 = _arg1.n44;
return (new Matrix4((_local2 * (((_local8 * ((_local13 * _local18) - (_local14 * _local17))) - (_local9 * ((_local12 * _local18) - (_local14 * _local16)))) + (_local10 * ((_local12 * _local17) - (_local13 * _local16))))), (-(_local2) * (((_local7 * ((_local13 * _local18) - (_local14 * _local17))) - (_local9 * ((_local11 * _local18) - (_local14 * _local15)))) + (_local10 * ((_local11 * _local17) - (_local13 * _local15))))), (_local2 * (((_local7 * ((_local12 * _local18) - (_local14 * _local16))) - (_local8 * ((_local11 * _local18) - (_local14 * _local15)))) + (_local10 * ((_local11 * _local16) - (_local12 * _local15))))), (-(_local2) * (((_local7 * ((_local12 * _local17) - (_local13 * _local16))) - (_local8 * ((_local11 * _local17) - (_local13 * _local15)))) + (_local9 * ((_local11 * _local16) - (_local12 * _local15))))), (-(_local2) * (((_local4 * ((_local13 * _local18) - (_local14 * _local17))) - (_local5 * ((_local12 * _local18) - (_local14 * _local16)))) + (_local6 * ((_local12 * _local17) - (_local13 * _local16))))), (_local2 * (((_local3 * ((_local13 * _local18) - (_local14 * _local17))) - (_local5 * ((_local11 * _local18) - (_local14 * _local15)))) + (_local6 * ((_local11 * _local17) - (_local13 * _local15))))), (-(_local2) * (((_local3 * ((_local12 * _local18) - (_local14 * _local16))) - (_local4 * ((_local11 * _local18) - (_local14 * _local15)))) + (_local6 * ((_local11 * _local16) - (_local12 * _local15))))), (_local2 * (((_local3 * ((_local12 * _local17) - (_local13 * _local16))) - (_local4 * ((_local11 * _local17) - (_local13 * _local15)))) + (_local5 * ((_local11 * _local16) - (_local12 * _local15))))), (_local2 * (((_local4 * ((_local9 * _local18) - (_local10 * _local17))) - (_local5 * ((_local8 * _local18) - (_local10 * _local16)))) + (_local6 * ((_local8 * _local17) - (_local9 * _local16))))), (-(_local2) * (((_local3 * ((_local9 * _local18) - (_local10 * _local17))) - (_local5 * ((_local7 * _local18) - (_local10 * _local15)))) + (_local6 * ((_local7 * _local17) - (_local9 * _local15))))), (_local2 * (((_local3 * ((_local8 * _local18) - (_local10 * _local16))) - (_local4 * ((_local7 * _local18) - (_local10 * _local15)))) + (_local6 * ((_local7 * _local16) - (_local8 * _local15))))), (-(_local2) * (((_local3 * ((_local8 * _local17) - (_local9 * _local16))) - (_local4 * ((_local7 * _local17) - (_local9 * _local15)))) + (_local5 * ((_local7 * _local16) - (_local8 * _local15))))), (-(_local2) * (((_local4 * ((_local9 * _local14) - (_local10 * _local13))) - (_local5 * ((_local8 * _local14) - (_local10 * _local12)))) + (_local6 * ((_local8 * _local13) - (_local9 * _local12))))), (_local2 * (((_local3 * ((_local9 * _local14) - (_local10 * _local13))) - (_local5 * ((_local7 * _local14) - (_local10 * _local11)))) + (_local6 * ((_local7 * _local13) - (_local9 * _local11))))), (-(_local2) * (((_local3 * ((_local8 * _local14) - (_local10 * _local12))) - (_local4 * ((_local7 * _local14) - (_local10 * _local11)))) + (_local6 * ((_local7 * _local12) - (_local8 * _local11))))), (_local2 * (((_local3 * ((_local8 * _local13) - (_local9 * _local12))) - (_local4 * ((_local7 * _local13) - (_local9 * _local11)))) + (_local5 * ((_local7 * _local12) - (_local8 * _local11)))))));
}
public static function det3x3(_arg1:Matrix4):Number{
return ((((_arg1.n11 * ((_arg1.n22 * _arg1.n33) - (_arg1.n23 * _arg1.n32))) + (_arg1.n21 * ((_arg1.n32 * _arg1.n13) - (_arg1.n12 * _arg1.n33)))) + (_arg1.n31 * ((_arg1.n12 * _arg1.n23) - (_arg1.n22 * _arg1.n13)))));
}
public static function multiply4x3(_arg1:Matrix4, _arg2:Matrix4):Matrix4{
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:Number;
var _local23:Number;
_local3 = _arg1.n11;
_local4 = _arg2.n11;
_local5 = _arg1.n21;
_local6 = _arg2.n21;
_local7 = _arg1.n31;
_local8 = _arg2.n31;
_local9 = _arg1.n12;
_local10 = _arg2.n12;
_local11 = _arg1.n22;
_local12 = _arg2.n22;
_local13 = _arg1.n32;
_local14 = _arg2.n32;
_local15 = _arg1.n13;
_local16 = _arg2.n13;
_local17 = _arg1.n23;
_local18 = _arg2.n23;
_local19 = _arg1.n33;
_local20 = _arg2.n33;
_local21 = _arg2.n14;
_local22 = _arg2.n24;
_local23 = _arg2.n34;
return (new Matrix4((((_local3 * _local4) + (_local9 * _local6)) + (_local15 * _local8)), (((_local3 * _local10) + (_local9 * _local12)) + (_local15 * _local14)), (((_local3 * _local16) + (_local9 * _local18)) + (_local15 * _local20)), ((((_local21 * _local3) + (_local22 * _local9)) + (_local23 * _local15)) + _arg1.n14), (((_local5 * _local4) + (_local11 * _local6)) + (_local17 * _local8)), (((_local5 * _local10) + (_local11 * _local12)) + (_local17 * _local14)), (((_local5 * _local16) + (_local11 * _local18)) + (_local17 * _local20)), ((((_local21 * _local5) + (_local22 * _local11)) + (_local23 * _local17)) + _arg1.n24), (((_local7 * _local4) + (_local13 * _local6)) + (_local19 * _local8)), (((_local7 * _local10) + (_local13 * _local12)) + (_local19 * _local14)), (((_local7 * _local16) + (_local13 * _local18)) + (_local19 * _local20)), ((((_local21 * _local7) + (_local22 * _local13)) + (_local23 * _local19)) + _arg1.n34), 0, 0, 0, 1));
}
public static function multiply(_arg1:Matrix4, _arg2:Matrix4):Matrix4{
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:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
var _local27:Number;
var _local28:Number;
var _local29:Number;
var _local30:Number;
var _local31:Number;
var _local32:Number;
var _local33:Number;
var _local34:Number;
_local3 = _arg1.n11;
_local4 = _arg1.n21;
_local5 = _arg1.n31;
_local6 = _arg1.n41;
_local7 = _arg1.n12;
_local8 = _arg1.n22;
_local9 = _arg1.n32;
_local10 = _arg1.n42;
_local11 = _arg1.n13;
_local12 = _arg1.n23;
_local13 = _arg1.n33;
_local14 = _arg1.n43;
_local15 = _arg1.n14;
_local16 = _arg1.n24;
_local17 = _arg1.n34;
_local18 = _arg1.n44;
_local19 = _arg2.n11;
_local20 = _arg2.n21;
_local21 = _arg2.n31;
_local22 = _arg2.n41;
_local23 = _arg2.n12;
_local24 = _arg2.n22;
_local25 = _arg2.n32;
_local26 = _arg2.n42;
_local27 = _arg2.n13;
_local28 = _arg2.n23;
_local29 = _arg2.n33;
_local30 = _arg2.n43;
_local31 = _arg2.n14;
_local32 = _arg2.n24;
_local33 = _arg2.n34;
_local34 = _arg2.n44;
return (new Matrix4(((((_local3 * _local19) + (_local7 * _local20)) + (_local11 * _local21)) + (_local15 * _local22)), ((((_local3 * _local23) + (_local7 * _local24)) + (_local11 * _local25)) + (_local15 * _local26)), ((((_local3 * _local27) + (_local7 * _local28)) + (_local11 * _local29)) + (_local15 * _local30)), ((((_local3 * _local31) + (_local7 * _local32)) + (_local11 * _local33)) + (_local15 * _local34)), ((((_local4 * _local19) + (_local8 * _local20)) + (_local12 * _local21)) + (_local16 * _local22)), ((((_local4 * _local23) + (_local8 * _local24)) + (_local12 * _local25)) + (_local16 * _local26)), ((((_local4 * _local27) + (_local8 * _local28)) + (_local12 * _local29)) + (_local16 * _local30)), ((((_local4 * _local31) + (_local8 * _local32)) + (_local12 * _local33)) + (_local16 * _local34)), ((((_local5 * _local19) + (_local9 * _local20)) + (_local13 * _local21)) + (_local17 * _local22)), ((((_local5 * _local23) + (_local9 * _local24)) + (_local13 * _local25)) + (_local17 * _local26)), ((((_local5 * _local27) + (_local9 * _local28)) + (_local13 * _local29)) + (_local17 * _local30)), ((((_local5 * _local31) + (_local9 * _local32)) + (_local13 * _local33)) + (_local17 * _local34)), ((((_local6 * _local19) + (_local10 * _local20)) + (_local14 * _local21)) + (_local18 * _local22)), ((((_local6 * _local23) + (_local10 * _local24)) + (_local14 * _local25)) + (_local18 * _local26)), ((((_local6 * _local27) + (_local10 * _local28)) + (_local14 * _local29)) + (_local18 * _local30)), ((((_local6 * _local31) + (_local10 * _local32)) + (_local14 * _local33)) + (_local18 * _local34))));
}
public static function eulerRotation(_arg1:Number, _arg2:Number, _arg3:Number):Matrix4{
var _local4:Matrix4;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
_local4 = new Matrix4();
_arg1 = -(NumberUtil.toRadian(_arg1));
_arg2 = NumberUtil.toRadian(_arg2);
_arg3 = -(NumberUtil.toRadian(_arg3));
_local5 = ((USE_FAST_MATH)==false) ? Math.cos(_arg1) : FastMath.cos(_arg1);
_local6 = ((USE_FAST_MATH)==false) ? Math.sin(_arg1) : FastMath.sin(_arg1);
_local7 = ((USE_FAST_MATH)==false) ? Math.cos(_arg2) : FastMath.cos(_arg2);
_local8 = ((USE_FAST_MATH)==false) ? Math.sin(_arg2) : FastMath.sin(_arg2);
_local9 = ((USE_FAST_MATH)==false) ? Math.cos(_arg3) : FastMath.cos(_arg3);
_local10 = ((USE_FAST_MATH)==false) ? Math.sin(_arg3) : FastMath.sin(_arg3);
_local11 = (_local5 * _local8);
_local12 = (_local6 * _local8);
_local4.n11 = (_local7 * _local9);
_local4.n12 = (_local7 * _local10);
_local4.n13 = -(_local8);
_local4.n21 = ((_local12 * _local9) - (_local5 * _local10));
_local4.n22 = ((_local12 * _local10) + (_local5 * _local9));
_local4.n23 = (_local6 * _local7);
_local4.n31 = ((_local11 * _local9) + (_local6 * _local10));
_local4.n32 = ((_local11 * _local10) - (_local6 * _local9));
_local4.n33 = (_local5 * _local7);
return (_local4);
}
public static function rotationY(_arg1:Number):Matrix4{
var _local2:Matrix4;
var _local3:Number;
var _local4:Number;
_local2 = new Matrix4();
_arg1 = NumberUtil.toRadian(_arg1);
_local3 = ((USE_FAST_MATH)==false) ? Math.cos(_arg1) : FastMath.cos(_arg1);
_local4 = ((USE_FAST_MATH)==false) ? Math.sin(_arg1) : FastMath.sin(_arg1);
_local2.n11 = _local3;
_local2.n13 = -(_local4);
_local2.n31 = _local4;
_local2.n33 = _local3;
return (_local2);
}
public static function axisRotationVector(_arg1:Vector, _arg2:Number):Matrix4{
return (Matrix4Math.axisRotation(_arg1.x, _arg1.y, _arg1.z, _arg2));
}
public static function multiply3x3(_arg1:Matrix4, _arg2:Matrix4):Matrix4{
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;
_local3 = _arg1.n11;
_local4 = _arg2.n11;
_local5 = _arg1.n21;
_local6 = _arg2.n21;
_local7 = _arg1.n31;
_local8 = _arg2.n31;
_local9 = _arg1.n12;
_local10 = _arg2.n12;
_local11 = _arg1.n22;
_local12 = _arg2.n22;
_local13 = _arg1.n32;
_local14 = _arg2.n32;
_local15 = _arg1.n13;
_local16 = _arg2.n13;
_local17 = _arg1.n23;
_local18 = _arg2.n23;
_local19 = _arg1.n33;
_local20 = _arg2.n33;
return (new Matrix4((((_local3 * _local4) + (_local9 * _local6)) + (_local15 * _local8)), (((_local3 * _local10) + (_local9 * _local12)) + (_local15 * _local14)), (((_local3 * _local16) + (_local9 * _local18)) + (_local15 * _local20)), 0, (((_local5 * _local4) + (_local11 * _local6)) + (_local17 * _local8)), (((_local5 * _local10) + (_local11 * _local12)) + (_local17 * _local14)), (((_local5 * _local16) + (_local11 * _local18)) + (_local17 * _local20)), 0, (((_local7 * _local4) + (_local13 * _local6)) + (_local19 * _local8)), (((_local7 * _local10) + (_local13 * _local12)) + (_local19 * _local14)), (((_local7 * _local16) + (_local13 * _local18)) + (_local19 * _local20)), 0, 0, 0, 0, 1));
}
public static function vectorMult(_arg1:Matrix4, _arg2:Vector):Vector{
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local3 = _arg2.x;
_local4 = _arg2.y;
_local5 = _arg2.z;
return (new Vector(((((_local3 * _arg1.n11) + (_local4 * _arg1.n12)) + (_local5 * _arg1.n13)) + _arg1.n14), ((((_local3 * _arg1.n21) + (_local4 * _arg1.n22)) + (_local5 * _arg1.n23)) + _arg1.n24), ((((_local3 * _arg1.n31) + (_local4 * _arg1.n32)) + (_local5 * _arg1.n33)) + _arg1.n34)));
}
public static function scaleVector(_arg1:Vector):Matrix4{
var _local2:Matrix4;
_local2 = new Matrix4();
_local2.n11 = _arg1.x;
_local2.n22 = _arg1.y;
_local2.n33 = _arg1.z;
return (_local2);
}
public static function getTrace(_arg1:Matrix4):Number{
return ((((_arg1.n11 + _arg1.n22) + _arg1.n33) + _arg1.n44));
}
public static function translation(_arg1:Number, _arg2:Number, _arg3:Number):Matrix4{
var _local4:Matrix4;
_local4 = new Matrix4();
_local4.n14 = _arg1;
_local4.n24 = _arg2;
_local4.n34 = _arg3;
return (_local4);
}
public static function addMatrix4(_arg1:Matrix4, _arg2:Matrix4):Matrix4{
return (new Matrix4((_arg1.n11 + _arg2.n11), (_arg1.n12 + _arg2.n12), (_arg1.n13 + _arg2.n13), (_arg1.n14 + _arg2.n14), (_arg1.n21 + _arg2.n21), (_arg1.n22 + _arg2.n22), (_arg1.n23 + _arg2.n23), (_arg1.n24 + _arg2.n24), (_arg1.n31 + _arg2.n31), (_arg1.n32 + _arg2.n32), (_arg1.n33 + _arg2.n33), (_arg1.n34 + _arg2.n34), (_arg1.n41 + _arg2.n41), (_arg1.n42 + _arg2.n42), (_arg1.n43 + _arg2.n43), (_arg1.n44 + _arg2.n44)));
}
public static function translationVector(_arg1:Vector):Matrix4{
var _local2:Matrix4;
_local2 = new Matrix4();
_local2.n14 = _arg1.x;
_local2.n24 = _arg1.y;
_local2.n34 = _arg1.z;
return (_local2);
}
public static function det(_arg1:Matrix4):Number{
return (((((((((_arg1.n11 * _arg1.n22) - (_arg1.n21 * _arg1.n12)) * ((_arg1.n33 * _arg1.n44) - (_arg1.n43 * _arg1.n34))) - (((_arg1.n11 * _arg1.n32) - (_arg1.n31 * _arg1.n12)) * ((_arg1.n23 * _arg1.n44) - (_arg1.n43 * _arg1.n24)))) + (((_arg1.n11 * _arg1.n42) - (_arg1.n41 * _arg1.n12)) * ((_arg1.n23 * _arg1.n34) - (_arg1.n33 * _arg1.n24)))) + (((_arg1.n21 * _arg1.n32) - (_arg1.n31 * _arg1.n22)) * ((_arg1.n13 * _arg1.n44) - (_arg1.n43 * _arg1.n14)))) - (((_arg1.n21 * _arg1.n42) - (_arg1.n41 * _arg1.n22)) * ((_arg1.n13 * _arg1.n34) - (_arg1.n33 * _arg1.n14)))) + (((_arg1.n31 * _arg1.n42) - (_arg1.n41 * _arg1.n32)) * ((_arg1.n13 * _arg1.n24) - (_arg1.n23 * _arg1.n14)))));
}
public static function scale(_arg1:Number, _arg2:Number, _arg3:Number):Matrix4{
var _local4:Matrix4;
_local4 = new Matrix4();
_local4.n11 = _arg1;
_local4.n22 = _arg2;
_local4.n33 = _arg3;
return (_local4);
}
public static function rotationX(_arg1:Number):Matrix4{
var _local2:Matrix4;
var _local3:Number;
var _local4:Number;
_local2 = new Matrix4();
_arg1 = NumberUtil.toRadian(_arg1);
_local3 = ((USE_FAST_MATH)==false) ? Math.cos(_arg1) : FastMath.cos(_arg1);
_local4 = ((USE_FAST_MATH)==false) ? Math.sin(_arg1) : FastMath.sin(_arg1);
_local2.n22 = _local3;
_local2.n23 = _local4;
_local2.n32 = -(_local4);
_local2.n33 = _local3;
return (_local2);
}
public static function vectorMult3x3(_arg1:Matrix4, _arg2:Vector):Vector{
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local3 = _arg2.x;
_local4 = _arg2.y;
_local5 = _arg2.z;
return (new Vector((((_local3 * _arg1.n11) + (_local4 * _arg1.n12)) + (_local5 * _arg1.n13)), (((_local3 * _arg1.n21) + (_local4 * _arg1.n22)) + (_local5 * _arg1.n23)), (((_local3 * _arg1.n31) + (_local4 * _arg1.n32)) + (_local5 * _arg1.n33))));
}
public static function rotationZ(_arg1:Number):Matrix4{
var _local2:Matrix4;
var _local3:Number;
var _local4:Number;
_local2 = new Matrix4();
_arg1 = NumberUtil.toRadian(_arg1);
_local3 = ((USE_FAST_MATH)==false) ? Math.cos(_arg1) : FastMath.cos(_arg1);
_local4 = ((USE_FAST_MATH)==false) ? Math.sin(_arg1) : FastMath.sin(_arg1);
_local2.n11 = _local3;
_local2.n12 = _local4;
_local2.n21 = -(_local4);
_local2.n22 = _local3;
return (_local2);
}
public static function clone(_arg1:Matrix4):Matrix4{
return (new Matrix4(_arg1.n11, _arg1.n12, _arg1.n13, _arg1.n14, _arg1.n21, _arg1.n22, _arg1.n23, _arg1.n24, _arg1.n31, _arg1.n32, _arg1.n33, _arg1.n34, _arg1.n41, _arg1.n42, _arg1.n43, _arg1.n44));
}
public static function axisRotationWithReference(_arg1:Vector, _arg2:Vector, _arg3:Number):Matrix4{
var _local4:Number;
var _local5:Matrix4;
_local4 = ((_arg3 + 360) % 360);
_local5 = Matrix4Math.translation(_arg2.x, _arg2.y, _arg2.z);
_local5 = Matrix4Math.multiply(_local5, Matrix4Math.axisRotation(_arg1.x, _arg1.y, _arg1.z, _local4));
_local5 = Matrix4Math.multiply(_local5, Matrix4Math.translation(-(_arg2.x), -(_arg2.y), -(_arg2.z)));
return (_local5);
}
public static function axisRotation(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Matrix4{
var _local5:Matrix4;
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;
_local5 = new Matrix4();
_arg4 = NumberUtil.toRadian(_arg4);
_local6 = ((USE_FAST_MATH)==false) ? Math.cos(_arg4) : FastMath.cos(_arg4);
_local7 = ((USE_FAST_MATH)==false) ? Math.sin(_arg4) : FastMath.sin(_arg4);
_local8 = (1 - _local6);
_local9 = ((_arg1 * _arg2) * _local8);
_local10 = ((_arg2 * _arg3) * _local8);
_local11 = ((_arg1 * _arg3) * _local8);
_local12 = (_local7 * _arg3);
_local13 = (_local7 * _arg2);
_local14 = (_local7 * _arg1);
_local5.n11 = (_local6 + ((_arg1 * _arg1) * _local8));
_local5.n12 = (-(_local12) + _local9);
_local5.n13 = (_local13 + _local11);
_local5.n21 = (_local12 + _local9);
_local5.n22 = (_local6 + ((_arg2 * _arg2) * _local8));
_local5.n23 = (-(_local14) + _local10);
_local5.n31 = (-(_local13) + _local11);
_local5.n32 = (_local14 + _local10);
_local5.n33 = (_local6 + ((_arg3 * _arg3) * _local8));
return (_local5);
}
}
}//package sandy.math
Section 96
//PlaneMath (sandy.math.PlaneMath)
package sandy.math {
import sandy.core.data.*;
public class PlaneMath {
public static const NEGATIVE:int = -1;
public static const POSITIVE:int = 1;
public static const ON_PLANE:int = 0;
public static function distanceToPoint(_arg1:Plane, _arg2:Vector):Number{
return (((((_arg1.a * _arg2.x) + (_arg1.b * _arg2.y)) + (_arg1.c * _arg2.z)) + _arg1.d));
}
public static function classifyPoint(_arg1:Plane, _arg2:Vector):Number{
var _local3:Number;
_local3 = PlaneMath.distanceToPoint(_arg1, _arg2);
if (_local3 < 0){
return (PlaneMath.NEGATIVE);
};
if (_local3 > 0){
return (PlaneMath.POSITIVE);
};
return (PlaneMath.ON_PLANE);
}
public static function computePlaneFromPoints(_arg1:Vector, _arg2:Vector, _arg3:Vector):Plane{
var _local4:Vector;
var _local5:Number;
_local4 = VectorMath.cross(VectorMath.sub(_arg1, _arg2), VectorMath.sub(_arg1, _arg3));
VectorMath.normalize(_local4);
_local5 = VectorMath.dot(_arg1, _local4);
return (new Plane(_local4.x, _local4.y, _local4.z, _local5));
}
public static function createFromNormalAndPoint(_arg1:Vector, _arg2:Number):Plane{
var _local3:Plane;
_local3 = new Plane();
VectorMath.normalize(_arg1);
_local3.a = _arg1.x;
_local3.b = _arg1.y;
_local3.c = _arg1.z;
_local3.d = _arg2;
PlaneMath.normalizePlane(_local3);
return (_local3);
}
public static function normalizePlane(_arg1:Plane):void{
var _local2:Number;
_local2 = Math.sqrt((((_arg1.a * _arg1.a) + (_arg1.b * _arg1.b)) + (_arg1.c * _arg1.c)));
_arg1.a = (_arg1.a / _local2);
_arg1.b = (_arg1.b / _local2);
_arg1.c = (_arg1.c / _local2);
_arg1.d = (_arg1.d / _local2);
}
}
}//package sandy.math
Section 97
//VectorMath (sandy.math.VectorMath)
package sandy.math {
import sandy.core.data.*;
public class VectorMath {
public static function sub(_arg1:Vector, _arg2:Vector):Vector{
return (new Vector((_arg1.x - _arg2.x), (_arg1.y - _arg2.y), (_arg1.z - _arg2.z)));
}
public static function negate(_arg1:Vector):Vector{
return (new Vector(-(_arg1.x), -(_arg1.y), -(_arg1.z)));
}
public static function addVector(_arg1:Vector, _arg2:Vector):Vector{
return (new Vector((_arg1.x + _arg2.x), (_arg1.y + _arg2.y), (_arg1.z + _arg2.z)));
}
public static function cross(_arg1:Vector, _arg2:Vector):Vector{
return (new Vector(((_arg1.y * _arg2.z) - (_arg1.z * _arg2.y)), ((_arg1.z * _arg2.x) - (_arg1.x * _arg2.z)), ((_arg1.x * _arg2.y) - (_arg1.y * _arg2.x))));
}
public static function scale(_arg1:Vector, _arg2:Number):Vector{
return (new Vector((_arg1.x * _arg2), (_arg1.y * _arg2), (_arg1.z * _arg2)));
}
public static function clone(_arg1:Vector):Vector{
return (new Vector(_arg1.x, _arg1.y, _arg1.z));
}
public static function normalize(_arg1:Vector):Boolean{
var _local2:Number;
_local2 = VectorMath.getNorm(_arg1);
if ((((_local2 == 0)) || ((_local2 == 1)))){
return (false);
};
_arg1.x = (_arg1.x / _local2);
_arg1.y = (_arg1.y / _local2);
_arg1.z = (_arg1.z / _local2);
return (true);
}
public static function dot(_arg1:Vector, _arg2:Vector):Number{
return ((((_arg1.x * _arg2.x) + (_arg1.y * _arg2.y)) + (_arg2.z * _arg1.z)));
}
public static function getNorm(_arg1:Vector):Number{
return (Math.sqrt((((_arg1.x * _arg1.x) + (_arg1.y * _arg1.y)) + (_arg1.z * _arg1.z))));
}
public static function sphrand(_arg1:Number, _arg2:Number):Vector{
var _local3:Vector;
var _local4:Number;
_local3 = new Vector((Math.random() - 0.5), (Math.random() - 0.5), (Math.random() - 0.5));
_local3.normalize();
_local4 = Math.random();
_local4 = (((_arg2 - _arg1) * _local4) + _arg1);
_local3.scale(_local4);
return (_local3);
}
public static function pow(_arg1:Vector, _arg2:Number):Vector{
return (new Vector(Math.pow(_arg1.x, _arg2), Math.pow(_arg1.y, _arg2), Math.pow(_arg1.z, _arg2)));
}
public static function getAngle(_arg1:Vector, _arg2:Vector):Number{
var _local3:Number;
var _local4:Number;
_local3 = (VectorMath.dot(_arg1, _arg2) / (VectorMath.getNorm(_arg1) * VectorMath.getNorm(_arg2)));
_local4 = (1 - (_local3 * _local3));
if (_local4 < 0){
_local4 = 0;
};
return (Math.atan2(Math.sqrt(_local4), _local3));
}
}
}//package sandy.math
Section 98
//Box (sandy.primitive.Box)
package sandy.primitive {
import sandy.core.data.*;
import sandy.core.scenegraph.*;
public class Box extends Shape3D implements Primitive3D {
private var _q:Number;
private var _lg:Number;
private var _radius:Number;
private var _h:Number;
private var m_aFaces:Array;
public static const FACE_RIGHT:uint = 5;
public static const FACE_FRONT:uint = 1;
public static const FACE_LEFT:uint = 4;
public static const FACE_BOTTOM:uint = 2;
public static const FACE_BACK:uint = 0;
public static const FACE_TOP:uint = 3;
public function Box(_arg1:String=null, _arg2:Number=6, _arg3:Number=6, _arg4:Number=6, _arg5:Number=1){
super(_arg1);
_h = _arg3;
_lg = _arg4;
_radius = _arg2;
_q = ((((_arg5 <= 0)) || ((_arg5 > 10)))) ? 1 : _arg5;
geometry = generate();
_generateFaces();
}
private function __tesselate(_arg1:Geometry3D, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number, _arg9:Number, _arg10:Number):void{
var _local11:Geometry3D;
var _local12:Polygon;
var _local13:Vertex;
var _local14:Vertex;
var _local15:Vertex;
var _local16:Vertex;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:UVCoord;
var _local23:UVCoord;
var _local24:UVCoord;
var _local25:UVCoord;
_local11 = _arg1;
if (_arg10 == 0){
_local11.setFaceVertexIds(_local11.getNextFaceID(), _arg2, _arg3, _arg5);
_local11.setFaceUVCoordsIds(_local11.getNextFaceUVCoordID(), _arg6, _arg7, _arg9);
_local11.setFaceVertexIds(_local11.getNextFaceID(), _arg4, _arg5, _arg3);
_local11.setFaceUVCoordsIds(_local11.getNextFaceUVCoordID(), _arg8, _arg9, _arg7);
} else {
_local13 = _local11.aVertex[_arg2];
_local14 = _local11.aVertex[_arg3];
_local15 = _local11.aVertex[_arg4];
_local16 = _local11.aVertex[_arg5];
_local17 = _local11.getNextVertexID();
_local11.setVertex(_local17, ((_local13.x + _local14.x) / 2), ((_local13.y + _local14.y) / 2), ((_local13.z + _local14.z) / 2));
_local18 = _local11.getNextVertexID();
_local11.setVertex(_local18, ((_local14.x + _local15.x) / 2), ((_local14.y + _local15.y) / 2), ((_local14.z + _local15.z) / 2));
_local19 = _local11.getNextVertexID();
_local11.setVertex(_local19, ((_local15.x + _local16.x) / 2), ((_local15.y + _local16.y) / 2), ((_local15.z + _local16.z) / 2));
_local20 = _local11.getNextVertexID();
_local11.setVertex(_local20, ((_local16.x + _local13.x) / 2), ((_local16.y + _local13.y) / 2), ((_local16.z + _local13.z) / 2));
_local21 = _local11.getNextVertexID();
_local11.setVertex(_local21, ((((_local13.x + _local14.x) + _local15.x) + _local16.x) / 4), ((((_local13.y + _local14.y) + _local15.y) + _local16.y) / 4), ((((_local13.z + _local14.z) + _local15.z) + _local16.z) / 4));
_local22 = _local11.aUVCoords[_arg6];
_local23 = _local11.aUVCoords[_arg7];
_local24 = _local11.aUVCoords[_arg8];
_local25 = _local11.aUVCoords[_arg9];
_local11.setUVCoords(_local17, ((_local22.u + _local23.u) / 2), ((_local22.v + _local23.v) / 2));
_local11.setUVCoords(_local18, ((_local23.u + _local24.u) / 2), ((_local23.v + _local24.v) / 2));
_local11.setUVCoords(_local19, ((_local24.u + _local25.u) / 2), ((_local24.v + _local25.v) / 2));
_local11.setUVCoords(_local20, ((_local25.u + _local22.u) / 2), ((_local25.v + _local22.v) / 2));
_local11.setUVCoords(_local21, ((((_local22.u + _local23.u) + _local24.u) + _local25.u) / 4), ((((_local22.v + _local23.v) + _local24.v) + _local25.v) / 4));
__tesselate(_local11, _local21, _local20, _arg2, _local17, _local21, _local20, _arg6, _local17, (_arg10 - 1));
__tesselate(_local11, _local21, _local17, _arg3, _local18, _local21, _local17, _arg7, _local18, (_arg10 - 1));
__tesselate(_local11, _local21, _local18, _arg4, _local19, _local21, _local18, _arg8, _local19, (_arg10 - 1));
__tesselate(_local11, _local21, _local19, _arg5, _local20, _local21, _local19, _arg9, _local20, (_arg10 - 1));
};
}
public function get boxWidth():Number{
return (_radius);
}
private function _generateFaces():void{
var _local1:uint;
var _local2:uint;
var _local3:Number;
var _local4:Number;
var _local5:Number;
m_aFaces = new Array(6);
_local1 = 2;
_local2 = (_local1 * Math.pow(4, (_q - 1)));
_local3 = 0;
while (_local3 < 6) {
m_aFaces[_local3] = new PrimitiveFace(this);
_local4 = ((_local3 + 1) * _local2);
_local5 = (_local3 * _local2);
while (_local5 < _local4) {
(m_aFaces[_local3] as PrimitiveFace).addPolygon(_local5);
_local5++;
};
_local3++;
};
}
override public function toString():String{
return ("sandy.primitive.Box");
}
public function generate(... _args):Geometry3D{
var _local2:Geometry3D;
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;
_local2 = new Geometry3D();
_local3 = (-(_h) / 2);
_local4 = (_radius / 2);
_local5 = (_lg / 2);
_local6 = _local2.getNextVertexID();
_local2.setVertex(_local6, -(_local4), -(_local3), _local5);
_local7 = _local2.getNextVertexID();
_local2.setVertex(_local7, _local4, -(_local3), _local5);
_local8 = _local2.getNextVertexID();
_local2.setVertex(_local8, _local4, _local3, _local5);
_local9 = _local2.getNextVertexID();
_local2.setVertex(_local9, -(_local4), _local3, _local5);
_local10 = _local2.getNextVertexID();
_local2.setVertex(_local10, -(_local4), -(_local3), -(_local5));
_local11 = _local2.getNextVertexID();
_local2.setVertex(_local11, _local4, -(_local3), -(_local5));
_local12 = _local2.getNextVertexID();
_local2.setVertex(_local12, _local4, _local3, -(_local5));
_local13 = _local2.getNextVertexID();
_local2.setVertex(_local13, -(_local4), _local3, -(_local5));
_local2.setUVCoords(0, 0, 0);
_local2.setUVCoords(1, 1, 0);
_local2.setUVCoords(2, 0, 1);
_local2.setUVCoords(3, 1, 1);
__tesselate(_local2, _local6, _local7, _local8, _local9, 0, 2, 3, 1, (_q - 1));
__tesselate(_local2, _local10, _local13, _local12, _local11, 0, 2, 3, 1, (_q - 1));
__tesselate(_local2, _local8, _local12, _local13, _local9, 0, 2, 3, 1, (_q - 1));
__tesselate(_local2, _local6, _local10, _local11, _local7, 0, 2, 3, 1, (_q - 1));
__tesselate(_local2, _local6, _local9, _local13, _local10, 0, 2, 3, 1, (_q - 1));
__tesselate(_local2, _local7, _local11, _local12, _local8, 0, 2, 3, 1, (_q - 1));
return (_local2);
}
public function get boxDepth():Number{
return (_lg);
}
public function get boxHeight():Number{
return (_h);
}
public function getFace(_arg1:uint):PrimitiveFace{
return (m_aFaces[_arg1]);
}
}
}//package sandy.primitive
Section 99
//Cylinder (sandy.primitive.Cylinder)
package sandy.primitive {
import sandy.core.data.*;
import sandy.core.scenegraph.*;
public class Cylinder extends Shape3D implements Primitive3D {
private var m_nPolBase:uint;
private var m_bIsBottomExcluded:Boolean;
private var height:Number;
private var m_nNextPolFace:uint;
private var topRadius:Number;
private var m_bIsWholeMappingEnabled:Boolean;
public var segmentsH:Number;
public var segmentsW:Number;
private var radius:Number;
private var m_bIsTopExcluded:Boolean;
private var m_aFaces:Array;
public static const DEFAULT_HEIGHT:Number = 100;
public static const DEFAULT_SEGMENTSH:Number = 6;
public static const DEFAULT_SCALE:Number = 1;
public static const DEFAULT_RADIUS:Number = 100;
public static const MIN_SEGMENTSH:Number = 2;
public static const MIN_SEGMENTSW:Number = 3;
public static const DEFAULT_SEGMENTSW:Number = 8;
public function Cylinder(_arg1:String=null, _arg2:Number=100, _arg3:Number=100, _arg4:Number=8, _arg5:Number=6, _arg6:Number=NaN, _arg7:Boolean=false, _arg8:Boolean=false, _arg9:Boolean=true){
var _local10:Number;
super(_arg1);
this.segmentsW = Math.max(MIN_SEGMENTSW, ((_arg4) || (DEFAULT_SEGMENTSW)));
this.segmentsH = Math.max(MIN_SEGMENTSH, ((_arg5) || (DEFAULT_SEGMENTSH)));
radius = ((_arg2)==0) ? DEFAULT_RADIUS : _arg2;
height = ((_arg3)==0) ? DEFAULT_HEIGHT : _arg3;
topRadius = (isNaN(_arg6)) ? radius : _arg6;
_local10 = DEFAULT_SCALE;
m_bIsBottomExcluded = _arg7;
m_bIsTopExcluded = _arg8;
m_bIsWholeMappingEnabled = _arg9;
m_nPolBase = (m_bIsBottomExcluded) ? 0 : (this.segmentsW - 2);
m_nNextPolFace = (this.segmentsW * 2);
geometry = generate();
_generateFaces();
}
public function getBottom():PrimitiveFace{
return (m_aFaces[0]);
}
public function getTop():PrimitiveFace{
return (m_aFaces[1]);
}
private function _generateFaces():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
m_aFaces = new Array((this.segmentsW + 2));
if (!m_bIsBottomExcluded){
m_aFaces[0] = new PrimitiveFace(this);
_local2 = 0;
while (_local2 < m_nPolBase) {
PrimitiveFace(m_aFaces[0]).addPolygon(_local2);
_local2++;
};
} else {
m_aFaces[0] = undefined;
};
if (!m_bIsTopExcluded){
m_aFaces[1] = new PrimitiveFace(this);
_local3 = 0;
while (_local3 < m_nPolBase) {
PrimitiveFace(m_aFaces[1]).addPolygon(((_local3 + m_nPolBase) + (m_nNextPolFace * this.segmentsH)));
_local3++;
};
} else {
m_aFaces[1] = undefined;
};
_local1 = 0;
while (_local1 < this.segmentsW) {
m_aFaces[(_local1 + 2)] = new PrimitiveFace(this);
_local4 = 0;
while (_local4 < this.segmentsH) {
PrimitiveFace(m_aFaces[(_local1 + 2)]).addPolygon(((m_nPolBase + (_local1 * 2)) + (_local4 * m_nNextPolFace)));
PrimitiveFace(m_aFaces[(_local1 + 2)]).addPolygon((((m_nPolBase + (_local1 * 2)) + (_local4 * m_nNextPolFace)) + 1));
_local4++;
};
_local1++;
};
}
override public function toString():String{
return ("sandy.primitive.Cylinder");
}
public function generate(... _args):Geometry3D{
var _local2:Geometry3D;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Array;
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:Vertex;
var _local19:Vertex;
var _local20:Vertex;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Array;
var _local26:Number;
var _local27:Number;
var _local28:Number;
var _local29:Number;
var _local30:Number;
var _local31:Boolean;
var _local32:Number;
var _local33:Number;
var _local34:Number;
var _local35:Number;
var _local36:Number;
var _local37:Boolean;
_local2 = new Geometry3D();
_local6 = Math.max(3, this.segmentsW);
_local7 = Math.max(2, this.segmentsH);
_local8 = new Array();
_local4 = 0;
while (_local4 < (_local7 + 1)) {
_local22 = Number((_local4 / _local7));
_local23 = ((height * (_local4 / (_local7 + 0))) - (height / 2));
_local24 = (topRadius + ((radius - topRadius) * (1 - (_local4 / _local7))));
_local25 = new Array();
_local3 = 0;
while (_local3 < _local6) {
_local27 = Number(((2 * _local3) / _local6));
_local28 = (_local24 * Math.sin((_local27 * Math.PI)));
_local29 = (_local24 * Math.cos((_local27 * Math.PI)));
_local26 = _local2.setVertex(_local2.getNextVertexID(), _local29, _local23, _local28);
_local25.push(_local26);
_local3++;
};
_local8.push(_local25);
_local4++;
};
_local9 = _local8.length;
_local4 = 0;
while (_local4 < _local9) {
_local30 = _local8[_local4].length;
_local3 = 0;
while (_local3 < _local30) {
if ((((_local4 > 0)) && ((_local3 >= 0)))){
_local31 = (_local3 == (_local30 - 0));
_local14 = _local8[_local4][(_local31) ? 0 : _local3];
_local15 = _local8[_local4][(((_local3 == 0)) ? _local30 : _local3 - 1)];
_local16 = _local8[(_local4 - 1)][(((_local3 == 0)) ? _local30 : _local3 - 1)];
_local17 = _local8[(_local4 - 1)][(_local31) ? 0 : _local3];
if (m_bIsWholeMappingEnabled){
_local32 = (_local4 / (_local9 - 1));
_local33 = ((_local4 - 1) / (_local9 - 1));
_local34 = ((_local3 + 1) / _local30);
_local35 = (_local3 / _local30);
} else {
_local32 = (_local4 / _local7);
_local33 = ((_local4 - 1) / _local7);
_local34 = 0;
_local35 = 1;
};
_local10 = _local2.setUVCoords(_local2.getNextUVCoordID(), _local34, (1 - _local33));
_local11 = _local2.setUVCoords(_local2.getNextUVCoordID(), _local34, (1 - _local32));
_local12 = _local2.setUVCoords(_local2.getNextUVCoordID(), _local35, (1 - _local32));
_local13 = _local2.setUVCoords(_local2.getNextUVCoordID(), _local35, (1 - _local33));
_local21 = _local2.setFaceVertexIds(_local2.getNextFaceID(), _local14, _local15, _local16);
_local2.setFaceUVCoordsIds(_local21, _local11, _local12, _local13);
_local21 = _local2.setFaceVertexIds(_local2.getNextFaceID(), _local14, _local16, _local17);
_local2.setFaceUVCoordsIds(_local21, _local11, _local13, _local10);
};
_local3++;
};
if ((((((_local4 == 0)) && (!(m_bIsTopExcluded)))) || ((((_local4 == (_local9 - 1))) && (!(m_bIsBottomExcluded)))))){
_local3 = 0;
while (_local3 < (_local30 - 2)) {
_local36 = Math.floor((_local3 / 2));
_local14 = _local8[_local4][_local36];
_local15 = (((_local3 % 2))==0) ? _local8[_local4][((_local30 - 2) - _local36)] : _local8[_local4][(_local36 + 1)];
_local16 = (((_local3 % 2))==0) ? _local8[_local4][((_local30 - 1) - _local36)] : _local8[_local4][((_local30 - 2) - _local36)];
_local18 = _local2.aVertex[_local14];
_local19 = _local2.aVertex[_local15];
_local20 = _local2.aVertex[_local16];
_local37 = (_local4 == 0);
_local11 = _local2.setUVCoords(_local2.getNextUVCoordID(), ((_local37) ? 1 : 0 + ((_local37) ? -1 : 1 * (((_local18.x / radius) / 2) + 0.5))), (1 - (((_local18.z / radius) / 2) + 0.5)));
_local12 = _local2.setUVCoords(_local2.getNextUVCoordID(), ((_local37) ? 1 : 0 + ((_local37) ? -1 : 1 * (((_local19.x / radius) / 2) + 0.5))), (1 - (((_local19.z / radius) / 2) + 0.5)));
_local13 = _local2.setUVCoords(_local2.getNextUVCoordID(), ((_local37) ? 1 : 0 + ((_local37) ? -1 : 1 * (((_local20.x / radius) / 2) + 0.5))), (1 - (((_local20.z / radius) / 2) + 0.5)));
if (_local4 == 0){
_local21 = _local2.setFaceVertexIds(_local2.getNextFaceID(), _local14, _local16, _local15);
_local2.setFaceUVCoordsIds(_local21, _local11, _local13, _local12);
} else {
_local21 = _local2.setFaceVertexIds(_local2.getNextFaceID(), _local14, _local15, _local16);
_local2.setFaceUVCoordsIds(_local21, _local11, _local12, _local13);
};
_local3++;
};
};
_local4++;
};
return (_local2);
}
public function getFace(_arg1:uint):PrimitiveFace{
return (m_aFaces[(2 + _arg1)]);
}
public static function CALCUL_RADIUS_FROM_SIDE(_arg1:uint, _arg2:uint):Number{
return ((_arg2 / (2 * Math.sin((Math.PI / _arg1)))));
}
}
}//package sandy.primitive
Section 100
//Plane3D (sandy.primitive.Plane3D)
package sandy.primitive {
import sandy.core.scenegraph.*;
public class Plane3D extends Shape3D implements Primitive3D {
private var m_sType:String;
private var _lg:Number;
private var _qV:uint;
private var _qH:uint;
private var _h:Number;
public static const ZX_ALIGNED:String = "zx_aligned";
public static const YZ_ALIGNED:String = "yz_aligned";
public static const XY_ALIGNED:String = "xy_aligned";
public function Plane3D(_arg1:String=null, _arg2:Number=100, _arg3:Number=100, _arg4:uint=1, _arg5:uint=1, _arg6:String="xy_aligned"){
super(_arg1);
_h = _arg2;
_lg = _arg3;
_qV = _arg5;
_qH = _arg4;
m_sType = _arg6;
geometry = generate();
}
override public function toString():String{
return ("sandy.primitive.Plane3D");
}
public function generate(... _args):Geometry3D{
var _local2:Geometry3D;
var _local3:uint;
var _local4:uint;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
_local2 = new Geometry3D();
_local5 = (_h / 2);
_local6 = (_lg / 2);
_local7 = (_h / _qV);
_local8 = (_lg / _qH);
_local3 = 0;
_local9 = -(_local5);
_local11 = 0;
while (_local3 <= _qV) {
_local4 = 0;
_local10 = -(_local6);
_local12 = 0;
while (_local4 <= _qH) {
if (m_sType == Plane3D.ZX_ALIGNED){
_local2.setVertex(_local2.getNextVertexID(), _local10, 0, _local9);
} else {
if (m_sType == Plane3D.YZ_ALIGNED){
_local2.setVertex(_local2.getNextVertexID(), 0, _local10, _local9);
} else {
_local2.setVertex(_local2.getNextVertexID(), _local10, _local9, 0);
};
};
_local2.setUVCoords(_local2.getNextUVCoordID(), (_local12 / _lg), (1 - (_local11 / _h)));
_local10 = (_local10 + _local8);
_local12 = (_local12 + _local8);
_local4++;
};
_local9 = (_local9 + _local7);
_local11 = (_local11 + _local7);
_local3++;
};
_local3 = 0;
while (_local3 < _qV) {
_local4 = 0;
while (_local4 < _qH) {
_local2.setFaceVertexIds(_local2.getNextFaceID(), ((_local3 * (_qH + 1)) + _local4), (((_local3 * (_qH + 1)) + _local4) + 1), (((_local3 + 1) * (_qH + 1)) + _local4));
_local2.setFaceUVCoordsIds(_local2.getNextFaceUVCoordID(), ((_local3 * (_qH + 1)) + _local4), (((_local3 * (_qH + 1)) + _local4) + 1), (((_local3 + 1) * (_qH + 1)) + _local4));
_local2.setFaceVertexIds(_local2.getNextFaceID(), (((_local3 * (_qH + 1)) + _local4) + 1), ((((_local3 + 1) * (_qH + 1)) + _local4) + 1), (((_local3 + 1) * (_qH + 1)) + _local4));
_local2.setFaceUVCoordsIds(_local2.getNextFaceUVCoordID(), (((_local3 * (_qH + 1)) + _local4) + 1), ((((_local3 + 1) * (_qH + 1)) + _local4) + 1), (((_local3 + 1) * (_qH + 1)) + _local4));
_local4++;
};
_local3++;
};
return (_local2);
}
}
}//package sandy.primitive
Section 101
//Primitive3D (sandy.primitive.Primitive3D)
package sandy.primitive {
import sandy.core.scenegraph.*;
public interface Primitive3D {
function generate(... _args):Geometry3D;
}
}//package sandy.primitive
Section 102
//PrimitiveMode (sandy.primitive.PrimitiveMode)
package sandy.primitive {
public final class PrimitiveMode {
public static const TRI:String = "tri";
public static const QUAD:String = "quad";
}
}//package sandy.primitive
Section 103
//SkyBox (sandy.primitive.SkyBox)
package sandy.primitive {
import sandy.core.scenegraph.*;
public class SkyBox extends TransformGroup {
private var m_aPlanes:Array;
public function SkyBox(_arg1:String=null, _arg2:Number=100, _arg3:uint=1, _arg4:uint=1){
var _local5:Plane3D;
m_aPlanes = new Array(6);
super(_arg1);
_local5 = new Plane3D((_arg1 + "_left"), _arg2, _arg2, _arg3, _arg4, Plane3D.YZ_ALIGNED);
_local5.rotateX = -90;
_local5.rotateY = 180;
_local5.x = (-(_arg2) / 2);
m_aPlanes[0] = _local5;
_local5 = new Plane3D((_arg1 + "_right"), _arg2, _arg2, _arg3, _arg4, Plane3D.YZ_ALIGNED);
_local5.rotateX = -90;
_local5.x = (_arg2 / 2);
m_aPlanes[1] = _local5;
_local5 = new Plane3D((_arg1 + "_front"), _arg2, _arg2, _arg3, _arg4, Plane3D.XY_ALIGNED);
_local5.z = (_arg2 / 2);
m_aPlanes[2] = _local5;
_local5 = new Plane3D((_arg1 + "_back"), _arg2, _arg2, _arg3, _arg4, Plane3D.XY_ALIGNED);
_local5.rotateY = 180;
_local5.z = (-(_arg2) / 2);
m_aPlanes[3] = _local5;
_local5 = new Plane3D((_arg1 + "_top"), _arg2, _arg2, _arg3, _arg4, Plane3D.ZX_ALIGNED);
_local5.swapCulling();
_local5.rotateX = 180;
_local5.y = (_arg2 / 2);
m_aPlanes[4] = _local5;
_local5 = new Plane3D((_arg1 + "_bottom"), _arg2, _arg2, _arg3, _arg4, Plane3D.ZX_ALIGNED);
_local5.rotateY = 90;
_local5.y = (-(_arg2) / 2);
m_aPlanes[5] = _local5;
for each (_local5 in m_aPlanes) {
_local5.enableBackFaceCulling = false;
_local5.enableForcedDepth = true;
_local5.forcedDepth = 10000000000000;
this.addChild(_local5);
};
}
public function get right():Plane3D{
return (m_aPlanes[1]);
}
public function get left():Plane3D{
return (m_aPlanes[0]);
}
public function get bottom():Plane3D{
return (m_aPlanes[5]);
}
public function get front():Plane3D{
return (m_aPlanes[2]);
}
public function get top():Plane3D{
return (m_aPlanes[4]);
}
public function get back():Plane3D{
return (m_aPlanes[3]);
}
}
}//package sandy.primitive
Section 104
//Trapezoid (sandy.primitive.Trapezoid)
package sandy.primitive {
import sandy.core.data.*;
import sandy.core.scenegraph.*;
public class Trapezoid extends Shape3D implements Primitive3D {
private var _tpth:Number;
private var _q:Number;
private var _lg:Number;
private var _tpxa:Number;
private var _mode:String;
private var taperBack:Number;
private var _tpza:Number;
private var _radius:Number;
private var _h:Number;
private var m_aFaces:Array;
public static const FACE_RIGHT:uint = 5;
public static const FACE_FRONT:uint = 1;
public static const FACE_LEFT:uint = 4;
public static const FACE_BOTTOM:uint = 2;
public static const FACE_BACK:uint = 0;
public static const FACE_TOP:uint = 3;
public function Trapezoid(_arg1:String=null, _arg2:Number=6, _arg3:Number=6, _arg4:Number=6, _arg5:String="tri", _arg6:Number=1, _arg7:Number=1, _arg8:Number=1, _arg9:Number=1, _arg10:Number=1){
super(_arg1);
taperBack = _arg10;
_tpth = _arg9;
_tpxa = _arg7;
_tpza = _arg8;
_h = _arg3;
_lg = _arg4;
_radius = _arg2;
_q = ((((_arg6 <= 0)) || ((_arg6 > 10)))) ? 1 : _arg6;
_mode = (((!((_arg5 == "tri"))) && (!((_arg5 == "quad"))))) ? "tri" : _arg5;
geometry = generate();
_generateFaces();
}
private function __tesselate(_arg1:Geometry3D, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number, _arg9:Number, _arg10:Number):void{
var _local11:Geometry3D;
var _local12:Polygon;
var _local13:Vertex;
var _local14:Vertex;
var _local15:Vertex;
var _local16:Vertex;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:UVCoord;
var _local23:UVCoord;
var _local24:UVCoord;
var _local25:UVCoord;
_local11 = _arg1;
if (_arg10 == 0){
if (_mode == "tri"){
_local11.setFaceVertexIds(_local11.getNextFaceID(), _arg2, _arg3, _arg5);
_local11.setFaceUVCoordsIds(_local11.getNextFaceUVCoordID(), _arg6, _arg7, _arg9);
_local11.setFaceVertexIds(_local11.getNextFaceID(), _arg4, _arg5, _arg3);
_local11.setFaceUVCoordsIds(_local11.getNextFaceUVCoordID(), _arg8, _arg9, _arg7);
} else {
if (_mode == "quad"){
_local11.setFaceVertexIds(_local11.getNextFaceID(), _arg2, _arg3, _arg4, _arg5);
_local11.setFaceUVCoordsIds(_local11.getNextFaceUVCoordID(), _arg6, _arg7, _arg8, _arg9);
};
};
} else {
_local13 = _local11.aVertex[_arg2];
_local14 = _local11.aVertex[_arg3];
_local15 = _local11.aVertex[_arg4];
_local16 = _local11.aVertex[_arg5];
_local17 = _local11.getNextVertexID();
_local11.setVertex(_local17, ((_local13.x + _local14.x) / 2), ((_local13.y + _local14.y) / 2), ((_local13.z + _local14.z) / 2));
_local18 = _local11.getNextVertexID();
_local11.setVertex(_local18, ((_local14.x + _local15.x) / 2), ((_local14.y + _local15.y) / 2), ((_local14.z + _local15.z) / 2));
_local19 = _local11.getNextVertexID();
_local11.setVertex(_local19, ((_local15.x + _local16.x) / 2), ((_local15.y + _local16.y) / 2), ((_local15.z + _local16.z) / 2));
_local20 = _local11.getNextVertexID();
_local11.setVertex(_local20, ((_local16.x + _local13.x) / 2), ((_local16.y + _local13.y) / 2), ((_local16.z + _local13.z) / 2));
_local21 = _local11.getNextVertexID();
_local11.setVertex(_local21, ((((_local13.x + _local14.x) + _local15.x) + _local16.x) / 4), ((((_local13.y + _local14.y) + _local15.y) + _local16.y) / 4), ((((_local13.z + _local14.z) + _local15.z) + _local16.z) / 4));
_local22 = _local11.aUVCoords[_arg6];
_local23 = _local11.aUVCoords[_arg7];
_local24 = _local11.aUVCoords[_arg8];
_local25 = _local11.aUVCoords[_arg9];
_local11.setUVCoords(_local17, ((_local22.u + _local23.u) / 2), ((_local22.v + _local23.v) / 2));
_local11.setUVCoords(_local18, ((_local23.u + _local24.u) / 2), ((_local23.v + _local24.v) / 2));
_local11.setUVCoords(_local19, ((_local24.u + _local25.u) / 2), ((_local24.v + _local25.v) / 2));
_local11.setUVCoords(_local20, ((_local25.u + _local22.u) / 2), ((_local25.v + _local22.v) / 2));
_local11.setUVCoords(_local21, ((((_local22.u + _local23.u) + _local24.u) + _local25.u) / 4), ((((_local22.v + _local23.v) + _local24.v) + _local25.v) / 4));
__tesselate(_local11, _local21, _local20, _arg2, _local17, _local21, _local20, _arg6, _local17, (_arg10 - 1));
__tesselate(_local11, _local21, _local17, _arg3, _local18, _local21, _local17, _arg7, _local18, (_arg10 - 1));
__tesselate(_local11, _local21, _local18, _arg4, _local19, _local21, _local18, _arg8, _local19, (_arg10 - 1));
__tesselate(_local11, _local21, _local19, _arg5, _local20, _local21, _local19, _arg9, _local20, (_arg10 - 1));
};
}
private function _generateFaces():void{
var _local1:uint;
var _local2:uint;
var _local3:Number;
var _local4:Number;
var _local5:Number;
m_aFaces = new Array(6);
_local1 = ((_mode == PrimitiveMode.TRI)) ? 2 : 1;
_local2 = (_local1 * Math.pow(4, (_q - 1)));
_local3 = 0;
while (_local3 < 6) {
m_aFaces[_local3] = new PrimitiveFace(this);
_local4 = ((_local3 + 1) * _local2);
_local5 = (_local3 * _local2);
while (_local5 < _local4) {
(m_aFaces[_local3] as PrimitiveFace).addPolygon(_local5);
_local5++;
};
_local3++;
};
}
override public function toString():String{
return ("sandy.primitive.Box");
}
public function generate(... _args):Geometry3D{
var _local2:Geometry3D;
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;
_local2 = new Geometry3D();
_local3 = (-(_h) / 2);
_local4 = (_radius / 2);
_local5 = (_lg / 2);
_local6 = _local2.getNextVertexID();
_local2.setVertex(_local6, -(_local4), (-(_local3) * _tpxa), _local5);
_local7 = _local2.getNextVertexID();
_local2.setVertex(_local7, _local4, (-(_local3) * _tpxa), _local5);
_local8 = _local2.getNextVertexID();
_local2.setVertex(_local8, (_local4 * _tpth), (_local3 * _tpxa), (_local5 * _tpza));
_local9 = _local2.getNextVertexID();
_local2.setVertex(_local9, (-(_local4) * _tpth), (_local3 * _tpxa), (_local5 * _tpza));
_local10 = _local2.getNextVertexID();
_local2.setVertex(_local10, (-(_local4) * taperBack), -(_local3), -(_local5));
_local11 = _local2.getNextVertexID();
_local2.setVertex(_local11, (_local4 * taperBack), -(_local3), -(_local5));
_local12 = _local2.getNextVertexID();
_local2.setVertex(_local12, ((_local4 * taperBack) * _tpth), _local3, (-(_local5) * _tpza));
_local13 = _local2.getNextVertexID();
_local2.setVertex(_local13, ((-(_local4) * taperBack) * _tpth), _local3, (-(_local5) * _tpza));
_local2.setUVCoords(0, 0, 0);
_local2.setUVCoords(1, 1, 0);
_local2.setUVCoords(2, 0, 1);
_local2.setUVCoords(3, 1, 1);
__tesselate(_local2, _local6, _local7, _local8, _local9, 0, 2, 3, 1, (_q - 1));
__tesselate(_local2, _local10, _local13, _local12, _local11, 0, 2, 3, 1, (_q - 1));
__tesselate(_local2, _local8, _local12, _local13, _local9, 0, 2, 3, 1, (_q - 1));
__tesselate(_local2, _local6, _local10, _local11, _local7, 0, 2, 3, 1, (_q - 1));
__tesselate(_local2, _local6, _local9, _local13, _local10, 0, 2, 3, 1, (_q - 1));
__tesselate(_local2, _local7, _local11, _local12, _local8, 0, 2, 3, 1, (_q - 1));
return (_local2);
}
public function getFace(_arg1:uint):PrimitiveFace{
return (m_aFaces[_arg1]);
}
}
}//package sandy.primitive
Section 105
//NumberUtil (sandy.util.NumberUtil)
package sandy.util {
public class NumberUtil {
private static var __TO_RADIAN:Number = 0.0174532925199433;
private static var _fABS:Function = Math.abs;
private static var __TWO_PI:Number = 6.28318530717959;
private static var __PI:Number = 3.14159265358979;
private static var __TO_DREGREE:Number = 57.2957795130823;
private static var __HALF_PI:Number = 1.5707963267949;
public static var TOL:Number = 1E-5;
public static function areEqual(_arg1:Number, _arg2:Number):Boolean{
return ((_fABS((_arg1 - _arg2)) < TOL));
}
public static function get TO_DEGREE():Number{
return (__TO_DREGREE);
}
public static function get HALF_PI():Number{
return (__HALF_PI);
}
public static function toDegree(_arg1:Number):Number{
return ((_arg1 * TO_DEGREE));
}
public static function roundTo(_arg1:Number, _arg2:Number=0):Number{
if (_arg2 == 0){
_arg2 = 1;
};
return ((Math.round((_arg1 / _arg2)) * _arg2));
}
public static function get TWO_PI():Number{
return (__TWO_PI);
}
public static function isZero(_arg1:Number):Boolean{
return ((_fABS(_arg1) < TOL));
}
public static function get TO_RADIAN():Number{
return (__TO_RADIAN);
}
public static function constrain(_arg1:Number, _arg2:Number, _arg3:Number):Number{
return (Math.max(Math.min(_arg1, _arg3), _arg2));
}
public static function get PI():Number{
return (__PI);
}
public static function toRadian(_arg1:Number):Number{
return ((_arg1 * TO_RADIAN));
}
}
}//package sandy.util
Section 106
//CullingState (sandy.view.CullingState)
package sandy.view {
public class CullingState {
private var m_sState:String;
public static const OUTSIDE:CullingState = new CullingState("outside");
;
public static const INSIDE:CullingState = new CullingState("inside");
;
public static const INTERSECT:CullingState = new CullingState("intersect");
;
public function CullingState(_arg1:String){
m_sState = _arg1;
}
public function toString():String{
return (("[sandy.view.CullingState] :: state : " + m_sState));
}
}
}//package sandy.view
Section 107
//Frustum (sandy.view.Frustum)
package sandy.view {
import sandy.core.data.*;
import sandy.bounds.*;
import sandy.math.*;
import sandy.util.*;
public class Frustum {
public var aPoints:Array;
public var aNormals:Array;
public var aConstants:Array;
public var aPlanes:Array;
public static const INSIDE:CullingState = CullingState.INSIDE;
public static const OUTSIDE:CullingState = CullingState.OUTSIDE;
public static const INTERSECT:CullingState = CullingState.INTERSECT;
public static const LEFT:uint = 3;
public static const NEAR:uint = 1;
public static const BOTTOM:uint = 5;
public static const TOP:uint = 4;
public static const FAR:uint = 0;
public static const EPSILON:Number = 0.005;
public static const RIGHT:uint = 2;
public function Frustum(){
aPlanes = new Array(6);
aPoints = new Array(8);
aNormals = new Array(6);
aConstants = new Array(6);
}
public function clipFrontPlane(_arg1:Array, _arg2:Array):Boolean{
if (_arg1.length <= 2){
return (true);
};
return (clipPolygon(aPlanes[NEAR], _arg1, _arg2));
}
public function clipPolygon(_arg1:Plane, _arg2:Array, _arg3:Array):Boolean{
var _local4:Boolean;
var _local5:Boolean;
var _local6:Vertex;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Array;
var _local11:Array;
var _local12:Array;
var _local13:UVCoord;
var _local14:UVCoord;
var _local15:UVCoord;
var _local16:Vertex;
var _local17:Vertex;
var _local18:Vertex;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Boolean;
var _local23:Boolean;
var _local24:Number;
_local4 = true;
_local5 = true;
_local8 = _arg2.length;
_local10 = new Array();
for each (_local6 in _arg2) {
_local9 = ((((_arg1.a * _local6.wx) + (_arg1.b * _local6.wy)) + (_arg1.c * _local6.wz)) + _arg1.d);
if (_local9 < 0){
_local4 = false;
};
if (_local9 >= 0){
_local5 = false;
};
_local10.push(_local9);
};
if (_local4){
return (false);
};
if (_local5){
_arg2.splice(0);
_arg3.splice(0);
return (true);
};
_local11 = _arg2.splice(0);
_local12 = _arg3.splice(0);
_local13 = _local12[0];
_local14 = null;
_local15 = null;
_local16 = _local11[0];
_local17 = null;
_local18 = null;
_local21 = _local10[0];
_local22 = false;
_local23 = (_local21 >= 0);
_local24 = 0;
_local7 = 1;
while (_local7 <= _local8) {
_local17 = _local11[(_local7 % _local8)];
_local14 = _local12[(_local7 % _local8)];
_local20 = _local10[(_local7 % _local8)];
if (((_local23) && ((_local20 >= 0)))){
_arg2.push(_local17);
_arg3.push(_local14);
} else {
if (((!(_local23)) && ((_local20 >= 0)))){
_local23 = true;
_local22 = _local23;
_local18 = new Vertex();
_local19 = (_local21 / (_local21 - _local20));
_local18.wx = (_local16.wx + ((_local17.wx - _local16.wx) * _local19));
_local18.wy = (_local16.wy + ((_local17.wy - _local16.wy) * _local19));
_local18.wz = (_local16.wz + ((_local17.wz - _local16.wz) * _local19));
_arg2.push(_local18);
_arg2.push(_local17);
_local15 = new UVCoord();
_local15.u = (_local13.u + ((_local14.u - _local13.u) * _local19));
_local15.v = (_local13.v + ((_local14.v - _local13.v) * _local19));
_arg3.push(_local15);
_arg3.push(_local14);
} else {
if (((_local23) && ((_local20 < 0)))){
_local22 = true;
_local23 = false;
_local18 = new Vertex();
_local19 = (_local21 / (_local21 - _local20));
_local18.wx = (_local16.wx + ((_local17.wx - _local16.wx) * _local19));
_local18.wy = (_local16.wy + ((_local17.wy - _local16.wy) * _local19));
_local18.wz = (_local16.wz + ((_local17.wz - _local16.wz) * _local19));
_local15 = new UVCoord();
_local15.u = (_local13.u + ((_local14.u - _local13.u) * _local19));
_local15.v = (_local13.v + ((_local14.v - _local13.v) * _local19));
_arg3.push(_local15);
_arg2.push(_local18);
} else {
_local22 = true;
};
};
};
_local16 = _local17;
_local21 = _local20;
_local13 = _local14;
_local7++;
};
_local10 = null;
return (true);
}
public function pointInFrustum(_arg1:Vector):CullingState{
var _local2:Plane;
for each (_local2 in aPlanes) {
if (PlaneMath.classifyPoint(_local2, _arg1) == PlaneMath.NEGATIVE){
return (Frustum.OUTSIDE);
};
};
return (Frustum.INSIDE);
}
public function boxInFrustum(_arg1:BBox):CullingState{
var _local2:CullingState;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Plane;
var _local7:Vector;
_local2 = Frustum.INSIDE;
for each (_local6 in aPlanes) {
_local3 = 0;
_local4 = 0;
for each (_local7 in _arg1.aTCorners) {
_local5 = ((((_local6.a * _local7.x) + (_local6.b * _local7.y)) + (_local6.c * _local7.z)) + _local6.d);
if (_local5 < 0){
_local3++;
} else {
_local4++;
};
if ((((_local4 > 0)) && ((_local3 > 0)))){
break;
};
};
if (_local4 == 0){
return (Frustum.OUTSIDE);
};
if (_local3 > 0){
return (Frustum.INTERSECT);
};
};
return (_local2);
}
public function computePlanes(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):void{
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Array;
var _local12:int;
_local5 = NumberUtil.toRadian(_arg4);
_local6 = Math.tan((_local5 * 0.5));
_local7 = (-(_local6) * _arg2);
_local8 = (_local7 * _arg1);
_local9 = ((_local7 * _arg3) / _arg2);
_local10 = ((_local8 * _arg3) / _arg2);
_arg2 = -(_arg2);
_arg3 = -(_arg3);
_local11 = aPoints;
_local11[0] = new Vector(_local8, _local7, _arg2);
_local11[1] = new Vector(_local8, -(_local7), _arg2);
_local11[2] = new Vector(-(_local8), -(_local7), _arg2);
_local11[3] = new Vector(-(_local8), _local7, _arg2);
_local11[4] = new Vector(_local10, _local9, _arg3);
_local11[5] = new Vector(_local10, -(_local9), _arg3);
_local11[6] = new Vector(-(_local10), -(_local9), _arg3);
_local11[7] = new Vector(-(_local10), _local9, _arg3);
aPlanes[LEFT] = PlaneMath.computePlaneFromPoints(_local11[2], _local11[3], _local11[6]);
aPlanes[RIGHT] = PlaneMath.computePlaneFromPoints(_local11[0], _local11[1], _local11[4]);
aPlanes[TOP] = PlaneMath.computePlaneFromPoints(_local11[0], _local11[7], _local11[3]);
aPlanes[BOTTOM] = PlaneMath.computePlaneFromPoints(_local11[1], _local11[2], _local11[5]);
aPlanes[NEAR] = PlaneMath.computePlaneFromPoints(_local11[0], _local11[2], _local11[1]);
aPlanes[FAR] = PlaneMath.computePlaneFromPoints(_local11[4], _local11[5], _local11[6]);
_local12 = 0;
while (_local12 < 6) {
PlaneMath.normalizePlane(aPlanes[int(_local12)]);
_local12++;
};
}
public function sphereInFrustum(_arg1:BSphere):CullingState{
var _local2:Number;
var _local3:int;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Plane;
_local2 = 0;
_local3 = 0;
_local4 = _arg1.position.x;
_local5 = _arg1.position.y;
_local6 = _arg1.position.z;
_local7 = _arg1.radius;
for each (_local8 in aPlanes) {
_local2 = ((((_local8.a * _local4) + (_local8.b * _local5)) + (_local8.c * _local6)) + _local8.d);
if (_local2 <= -(_local7)){
return (Frustum.OUTSIDE);
};
if (_local2 > _local7){
_local3++;
};
};
return (((_local3)==6) ? Frustum.INSIDE : Frustum.INTERSECT);
}
public function clipFrustum(_arg1:Array, _arg2:Array):Boolean{
var _local3:Boolean;
var _local4:Boolean;
if (_arg1.length <= 2){
return (true);
};
_local3 = clipPolygon(aPlanes[NEAR], _arg1, _arg2);
_local4 = clipPolygon(aPlanes[LEFT], _arg1, _arg2);
_local3 = ((_local3) || (_local4));
_local4 = clipPolygon(aPlanes[RIGHT], _arg1, _arg2);
_local3 = ((_local3) || (_local4));
_local4 = clipPolygon(aPlanes[BOTTOM], _arg1, _arg2);
_local3 = ((_local3) || (_local4));
_local4 = clipPolygon(aPlanes[TOP], _arg1, _arg2);
_local3 = ((_local3) || (_local4));
return (_local3);
}
public function clipLineFrontPlane(_arg1:Array):Boolean{
var _local2:Plane;
var _local3:Array;
var _local4:Vertex;
var _local5:Vertex;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Vertex;
_local2 = aPlanes[NEAR];
_local3 = _arg1.splice(0);
_local4 = _local3[0];
_local5 = _local3[1];
_local6 = ((((_local2.a * _local4.wx) + (_local2.b * _local4.wy)) + (_local2.c * _local4.wz)) + _local2.d);
_local7 = ((((_local2.a * _local5.wx) + (_local2.b * _local5.wy)) + (_local2.c * _local5.wz)) + _local2.d);
_local8 = 0;
_local9 = new Vertex();
if ((((_local6 < 0)) && ((_local7 >= 0)))){
_local8 = (_local6 / (_local6 - _local7));
_local9.wx = (_local4.wx + ((_local5.wx - _local4.wx) * _local8));
_local9.wy = (_local4.wy + ((_local5.wy - _local4.wy) * _local8));
_local9.wz = (_local4.wz + ((_local5.wz - _local4.wz) * _local8));
_arg1.push(_local9);
_arg1.push(_local5);
return (true);
};
if ((((_local7 < 0)) && ((_local6 >= 0)))){
_local8 = (_local6 / (_local6 - _local7));
_local9.wx = (_local4.wx + ((_local5.wx - _local4.wx) * _local8));
_local9.wy = (_local4.wy + ((_local5.wy - _local4.wy) * _local8));
_local9.wz = (_local4.wz + ((_local5.wz - _local4.wz) * _local8));
_arg1.push(_local4);
_arg1.push(_local9);
return (true);
};
if ((((_local7 < 0)) && ((_local6 < 0)))){
_arg1 = null;
return (true);
};
if ((((_local7 > 0)) && ((_local6 > 0)))){
_arg1.push(_local4);
_arg1.push(_local5);
return (false);
};
return (true);
}
public function extractPlanes(_arg1:Matrix4, _arg2:Boolean):void{
aPlanes[0].a = (_arg1.n14 + _arg1.n11);
aPlanes[0].b = (_arg1.n24 + _arg1.n21);
aPlanes[0].c = (_arg1.n34 + _arg1.n31);
aPlanes[0].d = (_arg1.n44 + _arg1.n41);
aPlanes[1].a = (_arg1.n14 - _arg1.n11);
aPlanes[1].b = (_arg1.n24 - _arg1.n21);
aPlanes[1].c = (_arg1.n34 - _arg1.n31);
aPlanes[1].d = (_arg1.n44 - _arg1.n41);
aPlanes[2].a = (_arg1.n14 - _arg1.n12);
aPlanes[2].b = (_arg1.n24 - _arg1.n22);
aPlanes[2].c = (_arg1.n34 - _arg1.n32);
aPlanes[2].d = (_arg1.n44 - _arg1.n42);
aPlanes[3].a = (_arg1.n14 + _arg1.n12);
aPlanes[3].b = (_arg1.n24 + _arg1.n22);
aPlanes[3].c = (_arg1.n34 + _arg1.n32);
aPlanes[3].d = (_arg1.n44 + _arg1.n42);
aPlanes[4].a = _arg1.n13;
aPlanes[4].b = _arg1.n23;
aPlanes[4].c = _arg1.n33;
aPlanes[4].d = _arg1.n43;
aPlanes[5].a = (_arg1.n14 - _arg1.n13);
aPlanes[5].b = (_arg1.n24 - _arg1.n23);
aPlanes[5].c = (_arg1.n34 - _arg1.n33);
aPlanes[5].d = (_arg1.n44 - _arg1.n43);
if (_arg2 == true){
PlaneMath.normalizePlane(aPlanes[0]);
PlaneMath.normalizePlane(aPlanes[1]);
PlaneMath.normalizePlane(aPlanes[2]);
PlaneMath.normalizePlane(aPlanes[3]);
PlaneMath.normalizePlane(aPlanes[4]);
PlaneMath.normalizePlane(aPlanes[5]);
};
}
}
}//package sandy.view
Section 108
//ViewPort (sandy.view.ViewPort)
package sandy.view {
import flash.geom.*;
public final class ViewPort {
public const offset:Point;
private var m_nH2:int;// = 0
private var m_nRatio:Number;// = 0
private var m_nW2:int;// = 0
private var m_nH:int;// = 0
public var hasChanged:Boolean;// = false
private var m_nW:int;// = 0
public function ViewPort(_arg1:Number, _arg2:Number){
offset = new Point();
hasChanged = false;
m_nW = 0;
m_nW2 = 0;
m_nH = 0;
m_nH2 = 0;
m_nRatio = 0;
super();
width = _arg1;
height = _arg2;
}
public function get width():int{
return (m_nW);
}
public function update():void{
m_nW2 = (m_nW >> 1);
m_nH2 = (m_nH >> 1);
m_nRatio = (m_nH) ? (m_nW / m_nH) : 0;
hasChanged = true;
}
public function get ratio():Number{
return (m_nRatio);
}
public function set height(_arg1:int):void{
m_nH = _arg1;
update();
}
public function set width(_arg1:int):void{
m_nW = _arg1;
update();
}
public function get height():int{
return (m_nH);
}
public function get height2():int{
return (m_nH2);
}
public function get width2():int{
return (m_nW2);
}
}
}//package sandy.view
Section 109
//Andagel (Andagel)
package {
import flash.display.*;
public dynamic class Andagel extends BitmapData {
public function Andagel(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 110
//AnHang (AnHang)
package {
import flash.display.*;
public dynamic class AnHang extends BitmapData {
public function AnHang(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 111
//Anilogo (Anilogo)
package {
import flash.events.*;
import caurina.transitions.*;
import sandy.materials.*;
import sandy.core.data.*;
import sandy.core.scenegraph.*;
import sandy.materials.attributes.*;
import sandy.core.*;
import flash.display.*;
import flash.utils.*;
import sandy.primitive.*;
import flash.media.*;
import flash.xml.*;
public class Anilogo extends MovieClip {
private var app02:Appearance;
private var app03:Appearance;
private var zsource:Number;// = -600
private var sound:Sound;
private var camera:Camera3D;
var sc:Number;// = 0
public var sheet:MovieClip;
var g:Group;
public var lg:MovieClip;
var myRoot:Object;
private var scene:Scene3D;
var planeBg:Plane3D;
private var iload:int;// = 0
private var _soundChannel:SoundChannel;
private var app05:Appearance;
private var app01:Appearance;
private var soundcue:Number;
public function Anilogo(_arg1:Object){
var _local2:Group;
sheet = new Sheet();
lg = new Lg();
sc = 0;
zsource = -600;
iload = 0;
g = new Group();
super();
myRoot = _arg1;
addChild(sheet);
addChild(lg);
lg.x = (sheet.x = 1000);
camera = new Camera3D(640, 480);
camera.z = -800;
_local2 = createScene();
scene = new Scene3D("scene2", this, camera, _local2);
addEventListener(Event.ENTER_FRAME, startPause);
myRoot.btSkipButton.addEventListener(MouseEvent.CLICK, skipIt);
myRoot.btSkipButton.visible = false;
myRoot.generate.alpha = 0;
}
private function skipIt(_arg1:Event):void{
_soundChannel.stop();
removeEventListener(MouseEvent.MOUSE_DOWN, skipIt);
sc = 7600;
}
public function LoadingGame(){
}
function loadCompleted():void{
var _local1:*;
removeEventListener(Event.ENTER_FRAME, enterFrameLoader);
_local1 = g.getChildByName("Plane");
_local1.visible = false;
scene.render();
myRoot.gotoAndStop(2);
}
function loadComplete(_arg1:Event):void{
var _local2:*;
removeEventListener(Event.ENTER_FRAME, enterFrameLoader);
_local2 = g.getChildByName("Plane");
_local2.visible = false;
scene.render();
}
function initial(){
removeEventListener(Event.ENTER_FRAME, startPause);
addEventListener(Event.ENTER_FRAME, enterFrameLoader);
sound = new AnilogoMusic();
_soundChannel = sound.play();
soundcue = -3;
}
function drawArc(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6){
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:*;
var _local11:*;
var _local12:*;
sheet.graphics.clear();
_local7 = (2 * Math.PI);
_local8 = (_arg5 / _arg6);
_local9 = (_arg1 + (Math.cos((_arg4 * _local7)) * _arg3));
_local10 = (_arg2 + (Math.sin((_arg4 * _local7)) * _arg3));
sheet.graphics.beginFill(0xFFFFFF, 0.4);
sheet.graphics.moveTo(_arg1, _arg2);
_local11 = 1;
while (_local11 <= _arg6) {
_local12 = (_arg4 + (_local11 * _local8));
_local9 = (_arg1 + (Math.cos((_local12 * _local7)) * _arg3));
_local10 = (_arg2 + (Math.sin((_local12 * _local7)) * _arg3));
sheet.graphics.lineTo(_local9, _local10);
_local11++;
};
sheet.graphics.moveTo(_arg1, _arg2);
}
function loadProgress(_arg1:ProgressEvent):void{
var _local2:Number;
var _local3:Number;
_local2 = (_arg1.bytesLoaded / _arg1.bytesTotal);
_local2 = Math.round((_local2 * 100));
_local3 = -((3.6 * _local2));
drawArc(296, 172, 130, (270 / 360), (_local3 / 360), 360);
}
private function begin(_arg1:Event):void{
myRoot.gotoAndStop(3);
if (myRoot.currentFrame == 3){
removeEventListener(Event.ENTER_FRAME, begin);
};
}
private function startPause(_arg1:Event):void{
iload++;
if (iload == 30){
initial();
};
}
private function enterFrameLoader(_arg1:Event):void{
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:Number;
if ((sc < 7600)){
sc = Math.round(_soundChannel.position);
//unresolved jump
};
_local2 = g.getChildByName("Plane");
_local3 = g.getChildByName("PlaneBg");
if ((((sc > 100)) && ((soundcue == -3)))){
soundcue = -2;
camera.z = -900;
_local2.visible = true;
if (_local3){
_local3.y = 0;
_local3.pan = -10;
};
zsource = -700;
_local2.pan = 25;
camera.x = 0;
camera.y = 128;
camera.lookAt(0, 0, 0);
sheet.gotoAndStop(4);
_local2.z = -900;
Tweener.addTween(_local2, {z:0, time:0.5, delay:0, transition:"easeOutBack"});
};
if ((((sc > 800)) && ((soundcue == -2)))){
sheet.gotoAndStop(5);
soundcue = -1;
camera.z = -900;
_local2.visible = true;
if (_local3){
_local3.y = 0;
_local3.pan = -10;
};
_local2.x = 32;
_local2.pan = -25;
camera.x = 0;
camera.y = -128;
camera.lookAt(0, 0, 0);
_local2.z = -900;
Tweener.addTween(_local2, {z:0, time:0.5, delay:0, transition:"easeOutBack"});
};
if ((((sc > 1500)) && ((soundcue == -1)))){
sheet.gotoAndStop(6);
soundcue = 0;
camera.z = -900;
_local2.visible = true;
if (_local3){
_local3.y = 0;
_local3.pan = -10;
};
_local2.pan = 10;
_local2.x = 0;
camera.x = 128;
camera.y = -128;
camera.lookAt(-256, 0, 0);
_local2.z = -900;
Tweener.addTween(_local2, {z:0, time:0.5, delay:0, transition:"easeOutBack"});
};
if ((((sc > 2000)) && ((soundcue == 0)))){
sheet.gotoAndStop(7);
soundcue = 1;
camera.z = -900;
_local2.visible = true;
if (_local3){
_local3.y = 0;
_local3.pan = -10;
};
_local2.pan = -25;
camera.x = -64;
camera.y = -128;
_local2.x = 64;
camera.lookAt(0, 0, 0);
_local2.z = -900;
Tweener.addTween(_local2, {z:0, time:0.5, delay:0, transition:"easeOutBack"});
};
if ((((sc > 2900)) && ((soundcue == 1)))){
sheet.gotoAndStop(1);
soundcue = 2;
_local2.visible = true;
if (_local3){
_local3.y = 0;
_local3.pan = -10;
};
zsource = -200;
_local2.pan = 25;
_local2.x = 0;
camera.x = 0;
camera.y = 128;
camera.lookAt(0, 0, 0);
};
if ((((sc > 3280)) && ((soundcue == 2)))){
soundcue = 3;
};
if ((((sc > 3450)) && ((soundcue == 3)))){
camera.z = -500;
soundcue = 4;
zsource = -200;
_local2.pan = -35;
camera.x = 64;
camera.y = -164;
_local2.x = 32;
camera.lookAt(0, 0, 0);
};
if ((((sc > 3800)) && ((soundcue == 4)))){
soundcue = 5;
if (_local3){
_local3.visible = false;
};
_local2.pan = -15;
camera.z = 600;
zsource = -900;
camera.x = 0;
camera.y = 0;
camera.lookAt(0, 0, 0);
};
if ((((sc > 3820)) && ((soundcue == 5)))){
soundcue = 6;
zsource = -1800;
};
if ((((sc > 3970)) && ((soundcue == 6)))){
soundcue = 7;
sheet.gotoAndStop(2);
_local3.x = -256;
Tweener.addTween(_local3, {x:0x0100, time:4, delay:0, transition:"linear"});
};
if ((((sc > 4000)) && ((soundcue == 7)))){
soundcue = 8;
camera.z = -1000;
if (_local3){
_local3.visible = true;
_local3.y = 0;
_local3.z = 0x0100;
_local3.pan = -10;
};
_local2.pan = -25;
camera.x = 0;
camera.y = 64;
Tweener.addTween(camera, {y:-128, time:4, delay:0, transition:"linear"});
zsource = -700;
};
if (sc > 7100){
if (((_local3) && ((soundcue == 8)))){
_local3.visible = false;
};
camera.z = (camera.z + ((0 - camera.z) * 0.4));
};
if (sc < 7100){
_local2.pan = (_local2.pan + 0.5);
if (_local3){
_local3.pan = (_local3.pan + 0.2);
};
camera.z = (camera.z + ((zsource - camera.z) * 0.4));
camera.lookAt(0, 0, 0);
camera.y = (camera.y + 2);
};
if (sc > 7500){
if (soundcue == 8){
soundcue = 9;
sheet.gotoAndStop(3);
_local2.pan = 125;
LoadingGame();
};
if (soundcue == 9){
if (_local2.pan > 200){
_local2.pan = 125;
_local3.pan = 125;
camera.z = 100;
};
_local2.pan = (_local2.pan + 0.5);
camera.x = 64;
camera.y = 64;
camera.z = (camera.z + ((zsource - camera.z) * 0.4));
zsource = 1000;
camera.lookAt(64, 64, 0);
};
};
_local4 = stage.loaderInfo.bytesTotal;
_local5 = stage.loaderInfo.bytesLoaded;
_local6 = Math.round(((_local5 * 100) / _local4));
_local7 = -((3.6 * _local6));
drawArc(296, 172, 130, (270 / 360), (_local7 / 360), 360);
if ((((_local6 >= 100)) && ((sc > 7500)))){
_local2.visible = false;
scene.render();
myRoot.generate.alpha = 1;
myRoot.btSkipButton.visible = false;
addEventListener(Event.ENTER_FRAME, begin);
removeEventListener(Event.ENTER_FRAME, enterFrameLoader);
};
if ((((_local6 >= 100)) && ((sc < 7500)))){
myRoot.btSkipButton.visible = true;
myRoot.btSkipButton.alpha = 1;
};
if (_local6 >= 100){
sheet.graphics.clear();
};
scene.render();
}
private function createScene():Group{
var _local1:MovieMaterial;
var _local2:MovieMaterial;
var _local3:Plane3D;
_local1 = new MovieMaterial(sheet, 40, null);
_local1.smooth = false;
_local2 = new MovieMaterial(lg, 40, null);
app05 = new Appearance(_local1);
app02 = new Appearance(_local2);
_local3 = new Plane3D("Plane", 560, 800, 8, 8, Plane3D.XY_ALIGNED);
_local3.appearance = app05;
g.addChild(_local3);
_local3.visible = false;
planeBg = new Plane3D("PlaneBg", 1200, 2000, 6, 6, Plane3D.XY_ALIGNED);
planeBg.appearance = app02;
planeBg.enableForcedDepth = true;
planeBg.forcedDepth = 10000;
planeBg.x = 0;
planeBg.y = 0;
planeBg.z = 0;
g.addChild(planeBg);
planeBg.visible = false;
return (g);
}
}
}//package
Section 112
//AnilogoMusic (AnilogoMusic)
package {
import flash.media.*;
public dynamic class AnilogoMusic extends Sound {
}
}//package
Section 113
//animat (animat)
package {
import flash.display.*;
public dynamic class animat extends MovieClip {
}
}//package
Section 114
//Ast01 (Ast01)
package {
import flash.display.*;
public dynamic class Ast01 extends BitmapData {
public function Ast01(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 115
//Ast02 (Ast02)
package {
import flash.display.*;
public dynamic class Ast02 extends BitmapData {
public function Ast02(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 116
//Ast03 (Ast03)
package {
import flash.display.*;
public dynamic class Ast03 extends BitmapData {
public function Ast03(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 117
//Blazer (Blazer)
package {
import flash.display.*;
public dynamic class Blazer extends MovieClip {
}
}//package
Section 118
//Bomb (Bomb)
package {
import flash.display.*;
public dynamic class Bomb extends BitmapData {
public function Bomb(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 119
//Bong (Bong)
package {
import flash.media.*;
public dynamic class Bong extends Sound {
}
}//package
Section 120
//bossArms (bossArms)
package {
import flash.display.*;
public dynamic class bossArms extends BitmapData {
public function bossArms(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 121
//bossHead (bossHead)
package {
import flash.display.*;
public dynamic class bossHead extends BitmapData {
public function bossHead(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 122
//bossMat (bossMat)
package {
import flash.display.*;
public dynamic class bossMat extends BitmapData {
public function bossMat(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 123
//Chem01Aim (Chem01Aim)
package {
import flash.media.*;
public dynamic class Chem01Aim extends Sound {
}
}//package
Section 124
//Chem02Elevator (Chem02Elevator)
package {
import flash.media.*;
public dynamic class Chem02Elevator extends Sound {
}
}//package
Section 125
//Chem03Ship (Chem03Ship)
package {
import flash.media.*;
public dynamic class Chem03Ship extends Sound {
}
}//package
Section 126
//Chem04Demagnetize (Chem04Demagnetize)
package {
import flash.media.*;
public dynamic class Chem04Demagnetize extends Sound {
}
}//package
Section 127
//Chem05Magnetize (Chem05Magnetize)
package {
import flash.media.*;
public dynamic class Chem05Magnetize extends Sound {
}
}//package
Section 128
//Chem06Level1 (Chem06Level1)
package {
import flash.media.*;
public dynamic class Chem06Level1 extends Sound {
}
}//package
Section 129
//Chem07Farpost (Chem07Farpost)
package {
import flash.media.*;
public dynamic class Chem07Farpost extends Sound {
}
}//package
Section 130
//Chem08Zoom (Chem08Zoom)
package {
import flash.media.*;
public dynamic class Chem08Zoom extends Sound {
}
}//package
Section 131
//Chem09Divert (Chem09Divert)
package {
import flash.media.*;
public dynamic class Chem09Divert extends Sound {
}
}//package
Section 132
//Chem10Between (Chem10Between)
package {
import flash.media.*;
public dynamic class Chem10Between extends Sound {
}
}//package
Section 133
//Chem11Power (Chem11Power)
package {
import flash.media.*;
public dynamic class Chem11Power extends Sound {
}
}//package
Section 134
//Chem12Bridge (Chem12Bridge)
package {
import flash.media.*;
public dynamic class Chem12Bridge extends Sound {
}
}//package
Section 135
//Chem13Battle (Chem13Battle)
package {
import flash.media.*;
public dynamic class Chem13Battle extends Sound {
}
}//package
Section 136
//Chem14Guards (Chem14Guards)
package {
import flash.media.*;
public dynamic class Chem14Guards extends Sound {
}
}//package
Section 137
//Chem15Escape (Chem15Escape)
package {
import flash.media.*;
public dynamic class Chem15Escape extends Sound {
}
}//package
Section 138
//ChemCat01 (ChemCat01)
package {
import flash.display.*;
public dynamic class ChemCat01 extends BitmapData {
public function ChemCat01(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 139
//ChemicoyBot (ChemicoyBot)
package {
import flash.display.*;
public dynamic class ChemicoyBot extends BitmapData {
public function ChemicoyBot(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 140
//ChemPoster (ChemPoster)
package {
import flash.display.*;
public dynamic class ChemPoster extends BitmapData {
public function ChemPoster(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 141
//ChemWall (ChemWall)
package {
import flash.display.*;
public dynamic class ChemWall extends BitmapData {
public function ChemWall(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 142
//Computer (Computer)
package {
import flash.display.*;
public dynamic class Computer extends BitmapData {
public function Computer(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 143
//ControlPanel (ControlPanel)
package {
import flash.display.*;
public dynamic class ControlPanel extends BitmapData {
public function ControlPanel(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 144
//Dust (Dust)
package {
import flash.display.*;
public dynamic class Dust extends BitmapData {
public function Dust(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 145
//Eerie02 (Eerie02)
package {
import flash.media.*;
public dynamic class Eerie02 extends Sound {
}
}//package
Section 146
//ElevatorDown (ElevatorDown)
package {
import flash.display.*;
public dynamic class ElevatorDown extends BitmapData {
public function ElevatorDown(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 147
//ElevatorEnd (ElevatorEnd)
package {
import flash.media.*;
public dynamic class ElevatorEnd extends Sound {
}
}//package
Section 148
//ElevatorLoop (ElevatorLoop)
package {
import flash.media.*;
public dynamic class ElevatorLoop extends Sound {
}
}//package
Section 149
//Enemy (Enemy)
package {
import caurina.transitions.*;
import sandy.core.scenegraph.*;
import flash.display.*;
public class Enemy extends Sprite2D {
public var hp:int;// = 10
var oz:Number;// = 0
private var gj:MovieClip;
public var thisTarget;
private var rn:Number;
private var gd:MovieClip;
public var hpt:int;
public var spd:Number;// = 0
public var laser:Sprite2D;
public var alive:Boolean;// = true
private var hold:Number;// = 0.5
public var stand:Bitmap;
var ox:Number;// = 0
var oy:Number;// = 0
private var gs:MovieClip;
public var avhp;
public function Enemy(_arg1, _arg2){
hp = 10;
hpt = hp;
ox = 0;
oy = 0;
oz = 0;
rn = Math.random();
hold = 0.5;
alive = true;
spd = 0;
gs = new GuardShoot();
gj = new GuardJump();
gd = new GuardDeath();
if (rn < 0.3){
stand = new Bitmap(new EnemyIdle01(0, 0));
} else {
if ((((rn > 0.2)) && ((rn < 0.7)))){
stand = new Bitmap(new EnemyIdle02(0, 0));
} else {
stand = new Bitmap(new EnemyIdle03(0, 0));
};
};
super(_arg1, stand, _arg2);
}
public function shoot():void{
var px:Number;
var py:Number;
var pz:Number;
if (alive == true){
if (Tweener.isTweening(laser) == false){
content = gs;
laser.visible = true;
gs.gotoAndPlay(2);
avhp.shootsound();
laser.setPosition(x, y, z);
px = thisTarget.x;
py = (thisTarget.y + 12);
pz = (thisTarget.z + (avhp.speed * 16));
Tweener.addTween(laser, {x:px, y:py, z:pz, time:1, transition:"linear", onComplete:function (){
hitPlayer();
}});
};
Tweener.addTween(this, {time:1, transition:"linear", onComplete:function (){
idle();
dodge();
}});
};
}
public function shotSize(_arg1:int):void{
laser.scale = _arg1;
}
public function jump():void{
var newx:Number;
var newz:Number;
newx = (ox + ((Math.random() * 300) * (Math.random() - 0.5)));
newz = (oz + ((Math.random() * 300) * (Math.random() - 0.5)));
content = gj;
Tweener.addTween(this, {x:newx, z:newz, time:1, transition:"easeInOut", onComplete:function (){
idle();
}});
}
public function death():void{
this.container.mouseEnabled = false;
Tweener.removeTweens(this);
Tweener.removeTweens(laser);
hp = -1;
laser.visible = false;
gd.gotoAndPlay(1);
content = gd;
}
public function hitPlayer():void{
laser.visible = false;
avhp.damageTest(laser, thisTarget);
}
public function relive():void{
this.container.mouseEnabled = true;
}
public function shot():void{
jump();
}
public function dodge():void{
var _local1:*;
_local1 = (Math.random() * 10);
if (_local1 > 5){
jump();
};
}
public function idle():void{
var dhold:*;
dhold = (Math.random() * 1);
laser.setPosition(x, y, z);
content = gs;
gs.gotoAndStop(15);
if (alive == true){
Tweener.addTween(this, {time:hold, transition:"linear", delay:dhold, onComplete:function (){
shoot();
}});
};
}
}
}//package
Section 150
//EnemyIdle01 (EnemyIdle01)
package {
import flash.display.*;
public dynamic class EnemyIdle01 extends BitmapData {
public function EnemyIdle01(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 151
//EnemyIdle02 (EnemyIdle02)
package {
import flash.display.*;
public dynamic class EnemyIdle02 extends BitmapData {
public function EnemyIdle02(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 152
//EnemyIdle03 (EnemyIdle03)
package {
import flash.display.*;
public dynamic class EnemyIdle03 extends BitmapData {
public function EnemyIdle03(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 153
//EnergyBeam (EnergyBeam)
package {
import flash.display.*;
public dynamic class EnergyBeam extends BitmapData {
public function EnergyBeam(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 154
//EnergyField (EnergyField)
package {
import sandy.primitive.*;
public class EnergyField extends Plane3D {
var hp:int;// = 10
var hpt:int;
var alive:Boolean;// = true
public function EnergyField(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7:String){
hp = 10;
hpt = hp;
alive = true;
super(name, _arg2, _arg3, _arg5, _arg5, _arg6);
}
private function getHp():int{
return (hp);
}
public function shot():void{
hp = (hp - 1);
if (hp == 0){
kill();
};
}
public function kill():void{
visible = false;
alive = false;
}
}
}//package
Section 155
//EnergySource (EnergySource)
package {
import flash.display.*;
public dynamic class EnergySource extends BitmapData {
public function EnergySource(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 156
//Enshot (Enshot)
package {
import flash.media.*;
public dynamic class Enshot extends Sound {
}
}//package
Section 157
//Eye (Eye)
package {
import flash.display.*;
public dynamic class Eye extends MovieClip {
}
}//package
Section 158
//Forcefield (Forcefield)
package {
import flash.display.*;
public dynamic class Forcefield extends BitmapData {
public function Forcefield(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 159
//FxBeam (FxBeam)
package {
import flash.media.*;
public dynamic class FxBeam extends Sound {
}
}//package
Section 160
//FxSiren (FxSiren)
package {
import flash.media.*;
public dynamic class FxSiren extends Sound {
}
}//package
Section 161
//Game3D (Game3D)
package {
import flash.events.*;
import caurina.transitions.*;
import sandy.materials.*;
import sandy.core.scenegraph.*;
import sandy.core.*;
import flash.display.*;
import sandy.events.*;
import sandy.primitive.*;
import sandy.math.*;
import flash.media.*;
import flash.net.*;
public class Game3D extends MovieClip {
var floating:Boolean;// = false
var mtTrSu01:BitmapMaterial;
var liftHeight:Number;// = 1000
var jiggle:Number;// = 0
var mtp62:BitmapMaterial;
private var mSad:Sound;
var rad:Number;// = 0
var bossArmsmat:BitmapMaterial;
var tur1:Turret;
var tur2:Turret;
var tur3:Turret;
var tur4:Turret;
var tur5:Turret;
var tur6:Turret;
private var fxBlast:Sound;
var speed:int;// = 48
var mShip:Trapezoid;
var sniperCam:Number;// = 0
var striderAttack:Boolean;// = false
var matTer01:BitmapMaterial;
var g:Group;
var kFov:int;// = 60
var covernum:int;// = 32
var steering;// = false
var option:Boolean;// = false
var killed:int;// = 0
var finished:Boolean;// = false
var helpNum:int;// = 1
private var scene:Scene3D;
var roofwalk:Boolean;// = false
var countNext:Number;// = 0
var en1:Enemy;
var en2:Enemy;
private var fxAward:Sound;
var en5:Enemy;
var en6:Enemy;
var en3:Enemy;
var battle:Boolean;// = false
var en4:Enemy;
private var money:Sound;
var videoScreen:Plane3D;
var tun02:Cylinder;
var tun03:Cylinder;
var tun04:Cylinder;
private var fxSiren:Sound;
var tun01:Cylinder;
var medicate:Boolean;// = false
var elevator:int;// = 0
var pil1:Box;
var pil2:Box;
var pil3:Box;
var pil4:Box;
var pil5:Box;
var mtBomb:BitmapMaterial;
var poidSpeed:Number;// = 1
private var sound:Sound;
var pipeFront:BitmapMaterial;
var matHv01:BitmapMaterial;
var skyC1:BitmapMaterial;
private var sfxSpeeder01:Sound;
var skyC5:BitmapMaterial;
var bossShield:BitmapMaterial;
var matUnder:BitmapMaterial;
var matForce:BitmapMaterial;
var oSen:Number;// = 0.8
var target:Object;
var matFan:BitmapMaterial;
private var vcChannel:SoundChannel;
var meSu01:BitmapMaterial;
private var musicChannel01:SoundChannel;
private var musicChannel02:SoundChannel;
var animated:MovieClip;
var still:Boolean;// = false
var grp12:Sprite2D;
var tsz:Number;// = 4000
var bFace:Plane3D;
var motherShip01:TransformGroup;
var ter01:TerrainCreator2;
var ter02:TerrainCreator2;
var ter03:TerrainCreator2;
var ter04:TerrainCreator2;
var ter05:TerrainCreator2;
var grp23:Sprite2D;
var beam01:Plane3D;
var beam02:Plane3D;
var beam03:Plane3D;
var xmax:int;// = 100
var grp22:Sprite2D;
var beam04:Plane3D;
var grp31:Sprite2D;
var grp33:Sprite2D;
var grp34:Sprite2D;
var skyJ1:BitmapMaterial;
var skyJ2:BitmapMaterial;
var skyJ3:BitmapMaterial;
var skyJ4:BitmapMaterial;
var gunTalk:Boolean;// = false
var grp36:Sprite2D;
var r11:Plane3D;
var skyJ5:BitmapMaterial;
var r13:Plane3D;
var r14:Plane3D;
var r15:Plane3D;
var dropAttack:Boolean;// = false
var r18:Plane3D;
var grp32:Sprite2D;
var r17:Plane3D;
var r10:Plane3D;
var r12:Plane3D;
var r16:Plane3D;
var bFace2:Plane3D;
var bFace3:Plane3D;
var bFace4:Plane3D;
var bFace5:Plane3D;
var computer02:Sprite2D;
var computer04:Sprite2D;
var boss2:Boolean;// = false
var boss1:Boolean;// = false
var matElevator:BitmapMaterial;
var playerAlive:Boolean;// = true
var matArrow:BitmapMaterial;
private var chem01:Sound;
private var chem02:Sound;
private var chem03:Sound;
private var chem04:Sound;
private var chem06:Sound;
private var chem07:Sound;
private var chem08:Sound;
private var chem09:Sound;
var freeze:Number;// = 1
private var chem05:Sound;
var bossx:Number;
private var chem10:Sound;
private var chem11:Sound;
private var chem12:Sound;
private var chem13:Sound;
private var chem14:Sound;
private var chem15:Sound;
var bossy:Number;
var bossz:Number;
var pt2:Plane3D;
var sideNum:int;// = 6
var zmax:int;// = 50
var onMothership:Boolean;// = false
var pt4:Plane3D;
var skyP1:BitmapMaterial;
var skyP2:BitmapMaterial;
var skyP3:BitmapMaterial;
var skyP4:BitmapMaterial;
private var bong:Sound;
var pt3:Plane3D;
var skyP5:BitmapMaterial;
var pt1:Plane3D;
var anchor:Sprite2D;
var xmin:int;// = -100
var showCredits:Boolean;// = false
var player:TransformGroup;
var plan01:Plane3D;
var plan02:Plane3D;
var plan03:Plane3D;
var plan04:Plane3D;
var plan05:Plane3D;
var wave:Number;// = 0
var skyR1:BitmapMaterial;
var skyR2:BitmapMaterial;
var skyR3:BitmapMaterial;
var skyR4:BitmapMaterial;
var skyR5:BitmapMaterial;
var rumamt:Number;// = 0
var skyR6:BitmapMaterial;
var locked:Boolean;// = false
var fan:Plane3D;
private var enshot:Sound;
private var camera:Camera3D;
var degrees;// = 0
var mo01:BitmapMaterial;
var chemWall:BitmapMaterial;
var parachute:Boolean;// = false
var bossHeadmat:BitmapMaterial;
var mtRoofwall:BitmapMaterial;
var pxs:Number;
private var mChase:Sound;
var jumpShip:Boolean;// = false
var world:World3D;
var zmin:int;// = -300
private var fxBeam:Sound;
var pipeBack:BitmapMaterial;
var zoomdir:int;// = 1
var ptChem:Plane3D;
var game;
var tiSu01:BitmapMaterial;
var gate01:Box;
var gate02:Box;
var matChem01:BitmapMaterial;
var gunman:Sprite2D;
var forest:TransformGroup;
var pSpdX:int;// = 0
var pSpdZ:int;// = 0
var scr:Number;// = 0
var minY:Number;// = 4
var chapter:int;// = 1
var sBox:SkyBox;
private var mFinale:Sound;
var poster4:Plane3D;
private var pipev:Sound;
var radius;// = 0x0100
var offset:Number;// = 0
var bigBoss:TransformGroup;
var moSu01:BitmapMaterial;
var shp:TransformGroup;
var cntBeam:int;// = 0
var Hud;
var bossChem:BitmapMaterial;
private var saveus:Sound;
var medipoid:Medipoid;
var shooter:Number;// = 0
var pipewarn:Number;// = 0
var spotLight:BitmapMaterial;
var kAlt:Number;// = 120
var bossHp:Number;// = 160
var m1;
var m2;
var m0;
var rooflook:Boolean;// = false
var prison:Plane3D;
var pHp:Number;// = 300
var andagel:Sprite2D;
var mp;
var sfxGun01:Sound;
var p1:Plane3D;
var p2:Plane3D;
var p3:Plane3D;
var p4:Plane3D;
private var sfxGravity01:Sound;
var mtRooffloor:BitmapMaterial;
private var sfxElevatorLoop:Sound;
private var fxm:SoundChannel;
var soundcue2:Number;// = 0
var st1:Strider;
var st2:Strider;
var r1:Plane3D;
var r3:Plane3D;
var dum:Number;
var r7:Plane3D;
var r9:Plane3D;
var r4:Plane3D;
var r6:Plane3D;
var r8:Plane3D;
var absA:Number;// = 0
var wobbler:Number;// = 0.0698131700797732
var r5:Plane3D;
var r2:Plane3D;
var mshipAlive:Boolean;// = true
var absZ:int;// = 0
private var sfxWind:Sound;
var stg;
var matGate:BitmapMaterial;
var onShp:Boolean;// = false
var jigd:Number;// = 1
var gSen:Number;// = 0.8
var once:Boolean;// = false
var rumble:Boolean;// = false
var videoRim:Plane3D;
var matLevel1:BitmapMaterial;
var matLevel2:BitmapMaterial;
var matLevel3:BitmapMaterial;
var mediAlive:Boolean;// = false
var bossDist:Number;
var matLevel4:BitmapMaterial;
var fxEnBe:BitmapMaterial;
var matPoster:BitmapMaterial;
var pTiltMax:Number;// = -80
var lift:TransformGroup;
var compBoss:Sprite2D;
var aniMaterial:MovieMaterial;
var dying:Boolean;// = false
private var sfxChannel01:SoundChannel;
private var sfxChannel02:SoundChannel;
private var sfxChannel03:SoundChannel;
private var sfxChannel04:SoundChannel;
private var sfxElevatorEnd:Sound;
var skysz:Number;// = 0x8000
var camzm:Number;// = 0
var sector:int;// = 0
var crashsite:Boolean;// = false
var spot1:Plane3D;
var spot2:Plane3D;
var spot3:Plane3D;
var spot4:Plane3D;
var drpShp01:Box;
var drpShp03:Box;
var drpShp02:Box;
var matRim:BitmapMaterial;
var gunTalk2:Boolean;// = false
var gotoTen:Boolean;// = false
var pTiltMin:Number;// = 10
private var nowhere:Sound;
var bl01:Box;
var tunL:int;// = 0x0800
var grpMom:Sprite2D;
var crossBridge:Boolean;// = false
public function Game3D(_arg1:Object){
var _local2:Group;
zoomdir = 1;
dropAttack = false;
striderAttack = false;
parachute = false;
dying = false;
gotoTen = false;
gunTalk = false;
gunTalk2 = false;
mediAlive = false;
onMothership = false;
locked = false;
boss1 = false;
boss2 = false;
battle = false;
mshipAlive = true;
crashsite = false;
floating = false;
rooflook = false;
roofwalk = false;
medicate = false;
showCredits = false;
finished = false;
crossBridge = false;
onShp = false;
option = false;
jumpShip = false;
steering = false;
rumble = false;
once = false;
playerAlive = true;
jiggle = 0;
helpNum = 1;
freeze = 1;
shooter = 0;
sideNum = 6;
bossHp = 160;
elevator = 0;
offset = 0;
absZ = 0;
pTiltMax = -80;
pTiltMin = 10;
killed = 0;
radius = 0x0100;
degrees = 0;
xmin = -100;
xmax = 100;
zmin = -300;
zmax = 50;
animated = new animat();
rumamt = 0;
pipewarn = 0;
soundcue2 = 0;
countNext = 0;
kAlt = 120;
jigd = 1;
scr = 0;
cntBeam = 0;
tunL = 0x0800;
speed = 48;
minY = 4;
tsz = 4000;
pSpdX = 0;
pSpdZ = 0;
kFov = 60;
bigBoss = new TransformGroup("bigboss");
shp = new TransformGroup("tgt1");
player = new TransformGroup("Player");
forest = new TransformGroup("Forest");
lift = new TransformGroup("Lift");
motherShip01 = new TransformGroup("mship");
covernum = 32;
absA = 0;
pHp = 300;
sector = 0;
chapter = 1;
camzm = 0;
wobbler = ((4 / 180) * Math.PI);
rad = 0;
wave = 0;
gSen = 0.8;
oSen = 0.8;
sniperCam = 0;
still = false;
poidSpeed = 1;
liftHeight = 1000;
skysz = 0x8000;
super();
Matrix4Math.USE_FAST_MATH = true;
camera = new Camera3D(640, 480);
camera.far = 34000;
camera.near = 1;
camera.fov = kFov;
camera.setPosition(0, 12, 0);
_local2 = createScene();
scene = new Scene3D("scene", this, camera, _local2);
scene.rectClipping = true;
sound = new Eerie02();
sfxElevatorLoop = new ElevatorLoop();
sfxElevatorEnd = new ElevatorEnd();
sfxWind = new Winddown();
fxBeam = new FxBeam();
saveus = new SaveUs();
money = new Money();
nowhere = new Nowhere();
fxAward = new Reward();
sfxGravity01 = new Gravity01();
sfxSpeeder01 = new Speeder01();
bong = new Bong();
enshot = new Enshot();
fxSiren = new FxSiren();
fxBlast = new Nuclear();
mSad = new MusicSad();
mFinale = new SndFinale();
mChase = new MusicChase();
chem01 = new Chem01Aim();
chem02 = new Chem02Elevator();
chem03 = new Chem03Ship();
chem04 = new Chem04Demagnetize();
chem05 = new Chem05Magnetize();
chem06 = new Chem06Level1();
chem07 = new Chem07Farpost();
chem08 = new Chem08Zoom();
chem09 = new Chem09Divert();
chem10 = new Chem10Between();
chem11 = new Chem11Power();
chem12 = new Chem12Bridge();
chem13 = new Chem13Battle();
chem14 = new Chem14Guards();
chem15 = new Chem15Escape();
pipev = new VcPipe();
musicChannel01 = sound.play(0, 9999);
stg = _arg1.stage;
game = _arg1;
Hud = game.getChildByName("hud");
stg.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
stg.addEventListener(KeyboardEvent.KEY_UP, keyUpHandler);
Hud.optPanel.helppan.btGuide.addEventListener(MouseEvent.CLICK, goGuide);
Hud.optionsNo.addEventListener(MouseEvent.CLICK, goProto);
Hud.optPanel.helppan.btSlower.addEventListener(MouseEvent.CLICK, mouseSlower);
Hud.optPanel.helppan.btFaster.addEventListener(MouseEvent.CLICK, mouseFaster);
Hud.optPanel.btHelpLast.addEventListener(MouseEvent.CLICK, helpLast);
Hud.optPanel.btHelpNext.addEventListener(MouseEvent.CLICK, helpNext);
Hud.btHelp.addEventListener(MouseEvent.CLICK, helpPanel);
Hud.optionsBt.addEventListener(MouseEvent.CLICK, optClick);
Hud.optionsBt1.addEventListener(MouseEvent.CLICK, optClick1);
Hud.optionsBt2.addEventListener(MouseEvent.CLICK, optClick2);
Hud.loadGame.addEventListener(MouseEvent.CLICK, optClick3);
stg.addEventListener(MouseEvent.MOUSE_WHEEL, onWheel);
addEventListener(Event.ENTER_FRAME, loopSplash);
Hud.optLoad.btForward.addEventListener(MouseEvent.CLICK, clickForward);
Hud.optLoad.btBack.addEventListener(MouseEvent.CLICK, clickBack);
Hud.optLoad.btAction.addEventListener(MouseEvent.CLICK, startGame);
Hud.hudhealth.alpha = 0;
Hud.mcAward.alpha = 0;
Hud.mcAward.visible = false;
Hud.mcAward.mouseEnabled = false;
Hud.optLoad.mcPic.mouseEnabled = false;
player.pan = 290;
player.z = -117000;
target = player;
covernum = 60;
createCover(0.1, -126000);
changeSprite("space");
asteroids();
player.z = (player.z + 7000);
sfxChannel04 = fxSiren.play(0, 1);
sfxChannel04.stop();
Hud.hudhealth.healthmask.scaleX = 0.5;
Hud.reticule.buttonMode = false;
Hud.crosshairs.buttonMode = false;
Hud.reticule.threatBar.visible = false;
Hud.reticule.gotoAndStop(1);
sBox.front.enableForcedDepth = true;
sBox.front.forcedDepth = 6000;
}
private function rooftop():void{
Hud.gotoAndStop("intro");
removeEventListener(Event.ENTER_FRAME, loopSplash);
player.pan = 290;
sBox.front.z = (sBox.front.z - 0x0100);
sBox.back.z = (sBox.back.z + 0x0100);
sBox.left.x = (sBox.left.x + 0x0100);
sBox.right.x = (sBox.right.x - 0x0100);
Tweener.addTween(player, {x:(player.x - 0x0100), time:5, transition:"linear", onComplete:function (){
changeSky(skyR1, skyR2, skyR3, skyR4, skyR5, skyR6);
Hud.blok.alpha = 0;
roofrun();
}});
}
private function createCover(_arg1:Number, _arg2:int):void{
var _local3:int;
var _local4:Sprite2D;
_local3 = 0;
while (_local3 < covernum) {
_arg1 = 0.04;
_local4 = createSprite(new ChemicoyBot(0, 0), _arg1, _local3, "cv");
_local4.y = (100 * _arg1);
_local4.x = ((Math.random() * 300) * (Math.random() - 0.5));
_local4.z = (_arg2 + ((Math.random() * 300) * (Math.random() - 0.5)));
_local4.setBoundingSphereRadius(10);
_local4.container.mouseEnabled = false;
g.addChild(_local4);
_local3++;
};
}
private function createStrider(_arg1:int, _arg2:int, _arg3:int, _arg4:Number, _arg5:Group, _arg6:String):Strider{
var _local7:*;
var _local8:Sprite2D;
_local7 = new Strider(_arg6, new StriderSide(), _arg4);
_local7.enableEvents = true;
_local7.setPosition(_arg1, _arg2, _arg3);
_local7.ox = _arg1;
_local7.oz = _arg3;
_arg5.addChild(_local7);
_local7.addEventListener(MouseEvent.MOUSE_OVER, onStrider);
_local7.container.addEventListener(MouseEvent.MOUSE_OUT, offTarget);
_local7.addEventListener(MouseEvent.CLICK, striderHit);
_local8 = createSprite(new GuardShot(0, 0), 0.5, 1, "sr");
g.addChild(_local8);
_local8.setPosition(_arg1, _arg2, _arg3);
_local7.laser = _local8;
_local7.avhp = this;
_local8.container.mouseEnabled = false;
_local8.visible = false;
_local7.thisTarget = player;
return (_local7);
}
private function striderHit(_arg1:BubbleEvent):void{
var _local2:Strider;
var _local3:Number;
if (striderAttack == true){
_local2 = (_arg1.target as Strider);
_local2.hp = (_local2.hp - 1);
_local3 = ((1 / _local2.hpt) * _local2.hp);
Hud.reticule.threatBar.scaleY = _local3;
_local2.shot();
Hud.healthbar.scaleX = (Hud.healthbar.scaleX - 0.1);
if (_local2.hp == 0){
if (_local2.alive == true){
_local2.alive = false;
_local2.die();
killed = (killed + 1);
};
};
};
}
private function createComputer(_arg1, _arg2, _arg3, _arg4, _arg5:String, _arg6:String):Sprite2D{
var _local7:*;
var _local8:Bitmap;
_local7 = createSprite(new Grapple(0, 0), 0.2, 1, _arg6);
_local7.setPosition(_arg2, _arg3, _arg4);
_arg1.addChild(_local7);
_local7.enableEvents = true;
if (_arg5 == "elevate"){
_local7.addEventListener(MouseEvent.CLICK, raise);
_local8 = new Bitmap(new Computer(0, 0));
_local7.content = _local8;
_local7.addEventListener(MouseEvent.MOUSE_OVER, onTargetClose);
} else {
if (_arg5 == "lower"){
_local8 = new Bitmap(new ElevatorDown(0, 0));
_local7.content = _local8;
_local7.addEventListener(MouseEvent.CLICK, lower);
_local7.addEventListener(MouseEvent.MOUSE_OVER, onTargetClose);
} else {
if (_arg5 == "process"){
_local7.addEventListener(MouseEvent.CLICK, processObject);
_local7.addEventListener(MouseEvent.MOUSE_OVER, onTargetClose);
_local8 = new Bitmap(new EnergySource(0, 0));
_local7.content = _local8;
};
};
};
_local7.container.addEventListener(MouseEvent.MOUSE_OUT, offTarget);
return (_local7);
}
private function zoomin():void{
Hud.btHelp.visible = false;
sniperCam = -200;
Hud.crosshairs.alpha = 0.5;
Hud.crosshairs.mouseEnabled = false;
Tweener.addTween(camera, {fov:8, time:1, transition:"easeOutExpo"});
gSen = (oSen * 0.3);
Hud.gunFlash.alpha = 0;
}
private function moveSkybox():void{
dum = (skysz - 0x0100);
sBox.front.z = (shp.z + dum);
sBox.back.z = (shp.z - dum);
sBox.front.x = shp.x;
sBox.bottom.x = (sBox.back.x = (sBox.top.x = shp.x));
sBox.bottom.z = (sBox.left.z = (sBox.right.z = (sBox.top.z = shp.z)));
sBox.left.x = (shp.x - dum);
sBox.right.x = (shp.x + dum);
}
public function shootsound():void{
fxm = enshot.play();
}
private function onTarget(_arg1:MouseEvent):void{
Hud.reticule.gotoAndStop(2);
}
private function gunShot(_arg1:Event):void{
if (option == false){
if (camera.z == 0){
Hud.gunFlash.gotoAndPlay(2);
};
};
}
private function enterFrameHandler(_arg1:Event):void{
var posx:Number;
var posy:Number;
var pxs:Number;
var vol:*;
var jam:Number;
var angle:*;
var xposition:*;
var zposition:*;
var syrr:Number;
var sycr:Number;
var sprr:Number;
var spcr:Number;
var rnd:*;
var rnd2:*;
var cvx:*;
var cvxx:*;
var spT:*;
var spTz:*;
var event = _arg1;
posx = (stage.mouseX - 300);
posy = (stage.mouseY - 200);
pxs = (posx * 0.01);
absA = ((absA + pxs) % 180);
camera.roll = (camera.roll + ((pxs - camera.roll) * 0.1));
rad = (rad + wobbler);
wave = (wave + Math.cos(rad));
shp.y = (kAlt + (wave * 4));
if (onShp == true){
speed = 64;
};
shp.moveForward(speed);
absZ = (absZ + speed);
if (medicate == false){
angle = (degrees * (Math.PI / 180));
degrees = (degrees + poidSpeed);
xposition = (radius * Math.cos(angle));
zposition = (radius * Math.sin(angle));
medipoid.x = (xposition + player.x);
medipoid.z = (zposition + player.z);
medipoid.y = ((player.y + 0x0100) + (wave * 2));
};
if (still == false){
if (steering == false){
sprr = (((posx * 0.01) * gSen) * 2);
spcr = ((sprr * Math.abs(sprr)) * 0.1);
player.rotateAxis(0, 1, 0, spcr);
};
syrr = (((posy * 0.01) * gSen) * 2.5);
sycr = ((syrr * Math.abs(syrr)) * 0.1);
player.tilt = (player.tilt + sycr);
if ((player.tilt > pTiltMin)){
player.tilt = pTiltMin;
//unresolved jump
};
if ((player.tilt < pTiltMax)){
player.tilt = pTiltMax;
//unresolved jump
};
};
if (camzm > -1){
player.moveHorizontally((pSpdZ * freeze));
jiggle = (jiggle + (((Math.abs(pSpdZ) * jigd) * 3) + ((Math.abs(pSpdX) * jigd) * 3)));
if (jiggle > 100){
jigd = -1;
};
if (jiggle < -10){
jigd = 1;
};
player.moveSideways((pSpdX * freeze));
drpShp03.roll = 0;
shp.tilt = (shp.x = (shp.pan = 0));
} else {
en1.spd = (en2.spd = (en3.spd = (en4.spd = (en5.spd = (en6.spd = speed)))));
if (steering == true){
speed = Math.floor(-(posy));
shp.pan = (shp.pan + (pxs * gSen));
drpShp03.roll = (posx * -0.1);
};
if (steering == false){
shp.pan = 0;
};
};
vol = Math.abs((speed * 0.01));
if (sector == 1){
if (boss1 == true){
bFace3.lookAt(target.x, target.y, target.z);
bFace3.setPosition(bigBoss.x, (bigBoss.y + (wave * 2)), (bigBoss.z + 128));
bFace2.y = (wave * -3);
if (bossHp < 80){
bFace4.visible = true;
bFace5.visible = true;
bFace4.roll = (bFace4.roll + 4);
bFace5.roll = (bFace5.roll + 4);
};
en1.setPosition(bigBoss.x, (bigBoss.y + 500), (bigBoss.z - 20));
en2.setPosition(bigBoss.x, (bigBoss.y - 450), (bigBoss.z - 20));
en3.setPosition((bigBoss.x + 640), (bigBoss.y + 200), (bigBoss.z - 20));
en4.setPosition((bigBoss.x - 640), (bigBoss.y + 200), (bigBoss.z - 20));
en5.setPosition(bigBoss.x, bigBoss.y, (bigBoss.z - 200));
en6.setPosition(bigBoss.x, bigBoss.y, (bigBoss.z - 200));
en1.enableForcedDepth = (en2.enableForcedDepth = (en3.enableForcedDepth = (en4.enableForcedDepth = (en5.enableForcedDepth = (en6.enableForcedDepth = true)))));
en1.forcedDepth = 2100;
en2.forcedDepth = 2105;
en3.forcedDepth = 2106;
en4.forcedDepth = 2107;
en5.forcedDepth = 2108;
en6.forcedDepth = 2109;
if (bossHp <= 0){
if (Hud.hudhealth.healthmask.scaleX == 1){
award(5, "METAL MASTER : Gold award", "You defeated the battlebot without taking damage");
} else {
award(5, "METAL CRUNCHER : Silver award", "You took damage but defeated the Battlebot");
};
killed = 0;
computer04.visible = true;
computer04.y = 7990;
musicChannel01.stop();
musicChannel01 = fxBlast.play(0, 1);
bFace4.visible = false;
bFace5.visible = false;
boss1 = false;
chemicopsAlive(false);
hideEnemies();
Tweener.addTween(bigBoss, {y:7000, time:40, transition:"linear"});
Tweener.addTween(bFace3, {y:7000, time:40, transition:"linear"});
turretForceDepth(false);
bFace.enableForcedDepth = (bFace2.enableForcedDepth = (bFace3.enableForcedDepth = (bFace4.enableForcedDepth = (bFace5.enableForcedDepth = false))));
en1.enableForcedDepth = (en2.enableForcedDepth = (en3.enableForcedDepth = (en4.enableForcedDepth = (en5.enableForcedDepth = (en6.enableForcedDepth = false)))));
};
};
rnd = Math.random();
videoRim.container.alpha = rnd;
fan.roll = (fan.roll + 2);
if (beam04.visible == false){
beam01.pan = (beam01.pan + 0.5);
beam02.pan = (beam02.pan + 4);
beam03.pan = (beam03.pan - 1);
};
sBox.y = player.y;
if (chapter == 6){
if (player.x < -256){
zmin = ((shp.z + 0x0200) - 200);
xmin = -700;
} else {
zmin = (shp.z - 200);
xmin = -200;
};
if (player.z < (shp.z + 0x0100)){
xmin = -200;
} else {
xmin = -700;
};
};
lift.y = (lift.y + elevator);
if (chapter == 6){
fallSprite(-4000);
} else {
if (chapter == 5){
if (compBoss.visible == true){
tornado(-768, 8000, shp.z);
} else {
tornado(-768, -8000, shp.z);
};
} else {
flySprite();
};
};
shp.x = 0;
shp.pan = 0;
steering = false;
if (absZ > 22000){
kAlt = 120;
if ((shp.z - tun01.z) > (tunL * 0.5)){
tun01.z = (tun01.z + tunL);
};
tun02.z = (tun01.z + tunL);
tun03.z = (tun01.z + (tunL * 2));
tun04.z = (tun01.z - tunL);
tun01.y = (tun02.y = (tun03.y = (tun04.y = kAlt)));
chapter = 7;
if (pipewarn == 0){
pipewarn = 1;
instruct("frBehind");
vcChannel = pipev.play();
setVolume(6, vcChannel);
};
};
};
if ((((chapter == 1)) || ((chapter == 2)))){
if (mediAlive == false){
rnd2 = Math.random();
prison.container.alpha = rnd2;
};
if (bossHp <= 0){
if (mediAlive == false){
prison.visible = false;
zmax = -66812;
sfxChannel02 = sfxWind.play();
mediAlive = true;
instruct("frMedi", 0);
award(1, "THANK YOU FOR RELEASING ME!", "You have freed the medibot.");
Tweener.addTween(medipoid, {x:player.x, y:(player.y + 0x0200), z:player.z, time:10, delay:0, transition:"easeOutQuint", onComplete:function (){
medicate = false;
}});
};
};
};
if (chapter == 6){
resetTurrets(20);
bossDist = 0x0800;
boss2 = true;
};
if (chapter == 7){
if (boss2 == true){
bigBoss.x = 0;
bigBoss.y = 120;
bigBoss.z = (target.z - bossDist);
tur1.setPosition(0x0100, 0, 230);
tur2.setPosition(-256, 0, 232);
tur3.setPosition(0, 0x0100, 234);
tur4.setPosition(0, -256, 235);
bFace.scaleX = (bFace.scaleY = 0.5);
bFace2.scaleX = (bFace2.scaleY = 0.5);
bFace.enableForcedDepth = true;
bFace2.enableForcedDepth = true;
bFace.forcedDepth = 0x0800;
bFace2.forcedDepth = 2000;
tun01.enableForcedDepth = (tun02.enableForcedDepth = (tun03.enableForcedDepth = (tun04.enableForcedDepth = true)));
tun01.forcedDepth = 13000;
tun02.forcedDepth = 12999;
tun03.forcedDepth = 12998;
tun04.forcedDepth = 12997;
turretForceDepth(true);
tur1.forcedDepth = 2004;
tur2.forcedDepth = 2005;
tur3.forcedDepth = 2006;
tur4.forcedDepth = 2007;
bFace2.container.mouseEnabled = false;
bigBoss.roll = (bigBoss.roll + 8);
bFace2.roll = (bFace2.roll - 20);
bossDist = (bossDist - 5);
if (bigBoss.z > target.z){
playerAlive = false;
death();
};
};
if (boss2 == true){
if (bossHp < -80){
bFace4.visible = true;
bFace5.visible = true;
bFace4.roll = (bFace4.roll + 4);
bFace5.roll = (bFace5.roll + 4);
};
if (bossHp <= 0){
if (Hud.hudhealth.healthmask.scaleX == 1){
award(5, "PIPECLEANER : Gold award", "You escaped the pipecleaner");
} else {
award(5, "PIPECLEANER : Gold award", "You escaped the pipecleaner");
};
musicChannel01.stop();
sfxChannel04.stop();
musicChannel01 = fxBlast.play(0, 1);
boss2 = false;
};
};
};
if (chapter == 8){
kAlt = 120;
cvx = g.getChildByName("tr1");
if ((target.z - cvx.z) > 0x2000){
moveForest(0, 0, 0x4000);
};
motherShip01.pan = (motherShip01.pan + 0.3);
en1.setPosition(motherShip01.x, motherShip01.y, motherShip01.z);
en2.setPosition(motherShip01.x, motherShip01.y, motherShip01.z);
en3.setPosition(motherShip01.x, motherShip01.y, motherShip01.z);
en4.setPosition(motherShip01.x, motherShip01.y, motherShip01.z);
en5.setPosition(motherShip01.x, motherShip01.y, motherShip01.z);
if (shp.z > 24000){
if (speed != 0){
showEnemies();
en1.setPosition(drpShp01.x, (drpShp01.y + 80), drpShp01.z);
en2.setPosition(drpShp01.x, (drpShp01.y + 80), (drpShp01.z + 128));
en3.setPosition(drpShp01.x, (drpShp01.y + 80), (drpShp01.z - 128));
en4.setPosition(drpShp02.x, (drpShp02.y + 80), drpShp02.z);
en5.setPosition((drpShp02.x - 20), (drpShp02.y + 80), (drpShp02.z + 128));
en6.setPosition((drpShp02.x + 20), (drpShp02.y + 80), (drpShp02.z - 128));
drpShp01.setPosition((-400 + (wave * 4)), (target.y + (wave * 4)), (target.z - 900));
drpShp02.setPosition(-1000, (target.y + (wave * 2)), ((target.z + 200) + (wave * 8)));
if (dropAttack == false){
dropAttack = true;
killed = 0;
chemicopsAlive(true);
en1.hp = (en2.hp = (en3.hp = (en4.hp = (en5.hp = (en6.hp = 10)))));
en1.shot();
en2.shot();
en3.shot();
en4.shot();
en5.shot();
en6.shot();
};
};
};
if (shp.z < 34000){
if (shp.z > 15596){
if (once == false){
ptChem.visible = false;
videoScreen.visible = false;
videoRim.visible = false;
once = true;
flySprite();
sfxChannel04.stop();
sfxChannel04 = fxBlast.play(0, 1);
letterbox(false);
chemicopsAlive(false);
};
motherShip01.tilt = (motherShip01.tilt + 0.3);
rumble = true;
camera.far = 34000;
poster4.scaleX = 32;
poster4.scaleY = 32;
poster4.setPosition(0, 0x0F00, 10000);
poster4.enableForcedDepth = true;
poster4.forcedDepth = 30000;
spriteBlast();
};
} else {
rumble = false;
modSkybox(1);
};
steering = false;
mp.setPosition(target.x, -20, target.z);
moveMountain();
groundTile();
shp.roll = 0;
};
if (chapter == 9){
kAlt = 120;
steering = false;
cvx = g.getChildByName("tr1");
groundTile();
shp.roll = 0;
moveSkybox();
if (crashsite == false){
if (shp.z > (cvx.z - 0x1000)){
shp.z = (cvx.z - 4296);
exitShip();
anchor.visible = false;
disperseGrapples(shp);
letterbox(false);
};
} else {
if (crashsite == true){
if (onShp == false){
st1.lookAt(target.x, 440, (target.z + 0x0100));
st1.moveForward(3);
st2.lookAt(target.x, 440, (target.z - 0x0100));
st2.moveForward(3);
} else {
moveMountain(true);
if ((target.z - cvx.z) > 0x2000){
moveForest(0, 0, 0x4000);
};
if (striderAttack == false){
st1.thisTarget = shp;
st2.thisTarget = shp;
striderAttack = true;
st1.oz = 1000;
st1.ox = 1000;
st1.run();
st2.runSide();
moveForest(6000, 0, 0x4000);
killed = 0;
};
if (st1.alive == true){
st1.lookAt((shp.x + (wave * 64)), 440, (shp.z - 1000));
st1.moveForward(70);
if ((st1.z > (shp.z - 1000))){
st1.z = (shp.z - 1000);
//unresolved jump
};
};
if (st2.alive == true){
st2.lookAt(((shp.x - 2000) + (wave * 10)), 440, shp.z);
st2.moveForward(70);
if ((st2.x > (shp.x - 1000))){
st2.x = (shp.x - 1000);
//unresolved jump
};
};
};
};
};
if (gotoTen == true){
countNext = (countNext + 1);
if (countNext >= 120){
chapter = 10;
loadChapter(10);
};
};
if (killed == 2){
gotoTen = true;
musicChannel01.stop();
killed = 0;
};
mp.setPosition(shp.x, -20, shp.z);
};
if (chapter == 10){
if (player.z > (gate01.z - 600)){
if (player.y < 20){
player.z = (gate01.z - 600);
};
};
if (onShp == true){
speed = 0x0100;
mp.setPosition(target.x, -20, target.z);
};
boss1 = false;
cvxx = g.getChildByName("tr1");
if ((target.z - cvxx.z) > 0x2000){
moveForest(0, 0, 0x4000);
};
moveMountain(true);
if (battle == false){
if (shp.z > (gate01.z - 2000)){
letterbox(false);
exitShip();
anchor.visible = false;
mp.setPosition(gate01.x, -5, (gate01.z - 8392));
battle = true;
};
};
if (onMothership == true){
if (mshipAlive == true){
shp.x = motherShip01.x;
shp.z = motherShip01.z;
mp.setPosition(motherShip01.x, -20, motherShip01.z);
bigBoss.roll = (bigBoss.roll + 3);
bFace2.roll = (bFace2.roll - 20);
tur1.visible = (tur2.visible = (tur3.visible = (tur4.visible = true)));
};
mShip.y = -1024;
bFace.enableForcedDepth = true;
bFace2.enableForcedDepth = true;
bFace.forcedDepth = 0x0800;
bFace2.forcedDepth = 2000;
turretForceDepth(true);
tur1.forcedDepth = 2004;
tur2.forcedDepth = 2005;
tur3.forcedDepth = 2006;
tur4.forcedDepth = 2007;
};
if ((((bossHp <= 0)) && ((mshipAlive == true)))){
sniperCam = 34;
zoomout();
mshipAlive = false;
spT = new Bitmap(new AnHang(0, 0));
andagel.content = spT;
instruct("frImpact", 1);
killEnemies();
bFace.enableForcedDepth = false;
bFace2.enableForcedDepth = false;
};
if (finished == false){
if (mshipAlive == true){
showEnemies();
if ((motherShip01.z > (gate01.z - 20000))){
motherShip01.z = (gate01.z - 20000);
//unresolved jump
};
motherShip01.lookAt(gate01.x, 2000, gate01.z);
motherShip01.y = 3000;
grpMom.setPosition((motherShip01.x + 200), (motherShip01.y + 640), motherShip01.z);
motherShip01.moveForward(10);
} else {
Hud.btHelp.y = 1000;
if (motherShip01.z < (gate01.z - 3092)){
if (jumpShip == true){
player.y = (player.y + 5);
player.z = (player.z - 5);
floating = true;
camera.z = -300;
if (motherShip01.z > (gate01.z - 6000)){
gate01.tilt = (gate01.tilt - 1);
gate02.roll = (gate02.roll - 1);
};
};
if ((((motherShip01.z > (gate01.z - 15000))) && ((jumpShip == false)))){
jumpShip = true;
motherShip01.y = (motherShip01.y - 500);
bFace.enableForcedDepth = false;
bFace2.enableForcedDepth = false;
thirdPerson();
};
mp.setPosition((gate01.x + 0x2000), -5, (gate01.z - 0x4000));
mp.scaleX = (mp.scaleY = (mp.scaleZ = 2));
shp.x = motherShip01.x;
shp.z = motherShip01.z;
rumble = true;
if (motherShip01.roll > -30){
motherShip01.roll = (motherShip01.roll - 0.05);
};
motherShip01.z = (motherShip01.z + 64);
motherShip01.x = gate01.x;
if ((motherShip01.y > 0x0200)){
motherShip01.y = (motherShip01.y - 2);
//unresolved jump
};
} else {
if (parachute == false){
poster4.scaleX = 32;
poster4.scaleY = 32;
poster4.setPosition(0, 0x0F00, (gate01.z - 1000));
poster4.enableForcedDepth = true;
poster4.forcedDepth = 1000;
poster4.lookAt(player.x, player.y, player.z);
Tweener.addTween(poster4.container, {alpha:0, time:10, transition:"linear"});
plan01.visible = (plan02.visible = (plan03.visible = false));
rumble = false;
gate01.tilt = 15;
gate02.roll = 20;
player.swapParent(g);
player.setPosition(motherShip01.x, 3000, (motherShip01.z - 4000));
parachute = true;
musicChannel01.stop();
musicChannel01 = fxBlast.play(0, 1);
award(7, "BATTLE TESTED : Gold award", "You took down a mothership");
ter01.enableForcedDepth = (ter02.enableForcedDepth = (ter03.enableForcedDepth = (ter04.enableForcedDepth = (ter05.enableForcedDepth = false))));
mp.scaleX = (mp.scaleY = (mp.scaleZ = 1));
bigBoss.swapParent(g);
shp.x = player.x;
shp.z = player.z;
bigBoss.z = (gate01.z - 2000);
bigBoss.x = -1000;
ter01.scaleX = (ter01.scaleZ = 1);
bFace.enableForcedDepth = true;
bFace2.enableForcedDepth = true;
motherShip01.z = (gate01.z + 2000);
motherShip01.x = -3000;
motherShip01.roll = 0;
motherShip01.tilt = 45;
motherShip01.y = 3600;
grp12.visible = (grp22.visible = (grp23.visible = (grp31.visible = (grp32.visible = false))));
r9.setPosition(-1000, 2, (gate01.z - 2500));
r6.setPosition(0, 2, (gate01.z - 2000));
r7.setPosition(-1000, 2, (gate01.z + 1500));
r8.setPosition(1700, 2, (gate01.z - 1500));
thirdPerson();
pil1.setPosition(-4000, 2000, (shp.z + 42000));
pil2.setPosition(-2000, 2000, (shp.z + 42000));
pil3.setPosition(1000, 2000, (shp.z + 44000));
pil4.setPosition(4000, 2000, (shp.z + 42000));
};
};
};
};
steering = false;
groundTile();
shp.roll = 0;
boss1 = false;
boss2 = false;
if (finished == false){
if (parachute == true){
ter01.enableForcedDepth = (ter02.enableForcedDepth = (ter03.enableForcedDepth = (ter04.enableForcedDepth = (ter05.enableForcedDepth = false))));
ter01.scaleY = 1;
ter02.scaleX = (ter02.scaleZ = 1);
ter02.scaleY = 1;
ter03.scaleX = (ter01.scaleZ = 1);
ter03.scaleY = 1;
ter04.scaleX = (ter02.scaleZ = 1);
ter04.scaleY = 1;
ter05.scaleX = (ter01.scaleZ = 1);
ter05.scaleY = 1;
if (player.y > 384){
floating = false;
mp.scaleX = (mp.scaleY = (mp.scaleZ = 1));
mp.setPosition(gate01.x, -20, (gate01.z - 4000));
xmin = -4000;
xmax = 4000;
zmin = (gate01.z - 6000);
zmax = (gate01.z - 500);
bindPlayer();
player.moveForward(20);
player.y = (player.y - 2);
if ((player.y > 3000)){
player.y = 3000;
//unresolved jump
};
shp.x = player.x;
shp.z = player.z;
medipoid.container.alpha = 0;
} else {
shp.x = 0;
medipoid.container.alpha = 1;
parachute = false;
musicChannel01 = mSad.play();
setVolume(2, musicChannel01);
musicChannel01.addEventListener(Event.SOUND_COMPLETE, onPlaybackComplete);
finished = true;
player.y = 16;
player.z = (player.x = 0);
chapter = 11;
instruct("frEnd", 6);
spTz = new Bitmap(new Andagel(0, 0));
andagel.content = spTz;
pTiltMax = 10;
pTiltMin = 20;
enterShip();
};
};
};
};
if (chapter == 11){
andagel.enableForcedDepth = true;
andagel.forcedDepth = 0;
ter01.enableForcedDepth = (ter02.enableForcedDepth = (ter03.enableForcedDepth = (ter04.enableForcedDepth = (ter05.enableForcedDepth = false))));
mp.setPosition(target.x, -20, target.z);
setVolume(vol, sfxChannel03);
moveMountain();
groundTile();
bindShip(75000);
shp.roll = 0;
if (showCredits == false){
if (camera.z < -62){
camera.z = (camera.z + 1.1);
};
};
camera.y = 28;
};
if (rumble == true){
this.x = (this.y = ((Math.random() * 10) * (Math.random() - 0.5)));
};
anchor.setPosition(shp.x, (shp.y - 0x0100), shp.z);
if (chapter == 7){
if ((((((absZ > 50000)) && ((boss2 == false)))) && ((absZ < 70000)))){
bigBoss.visible = false;
shp.tilt = 90;
tun01.enableForcedDepth = (tun02.enableForcedDepth = (tun03.enableForcedDepth = (tun04.enableForcedDepth = false)));
shp.moveUpwards((speed * 2));
if (camzm > -800){
thirdPerson();
};
};
if ((((absZ > 70000)) && ((shp.tilt == 90)))){
shp.tilt = 0;
shp.z = -26384;
tun01.z = -32000;
tun02.z = -32000;
tun03.z = -32000;
tun04.z = -32000;
fallSprite(-4000);
firstPerson();
};
if (absZ > 80000){
changeSector(sector, 1);
};
};
Hud.reticule.x = (300 + posx);
Hud.reticule.y = (200 + posy);
if (camzm >= 0){
Hud.gunFlash.x = (670 + (posx * 0.3));
Hud.gunFlash.y = (((470 + (posy * 0.1)) - (player.tilt * 2)) - (jiggle * 0.1));
Hud.gunFlash.rotation = (15 - (posy * 0.01));
if (Hud.gunFlash.currentFrame == 1){
Hud.gunFlash.aarm.rotation = ((15 + (posx * 0.05)) - (posy * 0.1));
Hud.gunFlash.ahead.rotation = ((15 + (posx * 0.05)) - (posy * 0.1));
};
};
if (floating == false){
bindPlayer();
};
jam = (jiggle * 0.01);
camera.y = (12 + jam);
camera.x = (-5 + jam);
moveSkybox();
scene.render();
}
private function keyDownHandler(_arg1:KeyboardEvent):void{
if ((((_arg1.keyCode == 38)) || ((_arg1.keyCode == 87)))){
if (locked == false){
pSpdZ = 8;
};
};
if ((((_arg1.keyCode == 40)) || ((_arg1.keyCode == 83)))){
if (locked == false){
pSpdZ = -8;
};
};
if ((((_arg1.keyCode == 39)) || ((_arg1.keyCode == 68)))){
if (locked == false){
pSpdX = 8;
};
};
if ((((_arg1.keyCode == 37)) || ((_arg1.keyCode == 65)))){
if (locked == false){
pSpdX = -8;
};
};
if (_arg1.keyCode == 13){
if (Hud.currentLabel == "playing"){
if (((((!((freeze == 0))) && ((option == false)))) && ((mshipAlive == true)))){
if (zoomdir == 1){
zoomdir = 0;
zoomin();
} else {
zoomdir = 1;
sniperCam = 34;
zoomout();
};
};
};
};
if (_arg1.keyCode == 52){
if (Hud.currentLabel == "playing"){
if (((((!((freeze == 0))) && ((option == false)))) && ((mshipAlive == true)))){
if (zoomdir == 1){
zoomdir = 0;
zoomin();
} else {
zoomdir = 1;
sniperCam = 34;
zoomout();
};
};
};
};
if (_arg1.keyCode == 56){
if (sector != 5){
absZ = (absZ + 5000);
shp.z = (shp.z + 5000);
};
};
if (_arg1.keyCode == 32){
if ((((((dying == false)) && ((option == false)))) && ((mshipAlive == true)))){
if (onShp == true){
drpShp03.roll = 0;
if (camzm != 0){
if (chapter != 11){
firstPerson();
};
} else {
thirdPerson();
};
} else {
if (camera.z != 0){
pTiltMax = -80;
pTiltMin = 10;
Hud.gunFlash.visible = true;
Hud.reticule.visible = true;
andagel.visible = false;
Hud.btHelp.visible = true;
Hud.gunFlash.alpha = 1;
Tweener.addTween(camera, {z:0, time:0.6, transition:"easeOutBack"});
resizeGround(384);
} else {
sniperCam = 34;
Hud.crosshairs.alpha = 0;
gSen = oSen;
camera.fov = kFov;
pTiltMax = -80;
pTiltMin = 45;
if (chapter > 7){
pTiltMax = 5;
pTiltMin = 80;
};
andagel.visible = true;
Hud.reticule.visible = false;
Hud.gunFlash.visible = false;
Tweener.addTween(camera, {z:-800, time:0.6, transition:"easeOut"});
resizeGround(4000);
};
};
};
};
}
private function exitShip():void{
firstPerson();
sfxChannel03.stop();
onShp = false;
floating = true;
speed = 0;
player.swapParent(g);
medipoid.swapParent(g);
anchor.visible = true;
player.x = shp.x;
player.z = (shp.z - 860);
player.y = 16;
target = player;
if ((sector > 1)){
resizeGround(384);
//unresolved jump
};
kAlt = 300;
pTiltMax = -80;
pTiltMin = 10;
}
private function loadChapter(_arg1):void{
var _local2:*;
Hud.hudhealth.alpha = 1;
Hud.btHelp.y = 460;
Hud.btHelp.x = 320;
Hud.optionsBt.x = 1200;
if (_arg1 == 1){
camera.far = 34000;
instruct("move", 4);
vcChannel = chem01.play();
setVolume(7, vcChannel);
letterbox(false);
anchor.visible = false;
};
if (_arg1 == 2){
camera.far = 34000;
instruct("move", 4);
vcChannel = chem01.play();
setVolume(7, vcChannel);
letterbox(false);
anchor.visible = false;
};
if (_arg1 == 3){
camera.far = 34000;
rumble = false;
boss1 = false;
loadLevel(chapter);
player.setPosition(1500, 2000, (shp.z - 4100));
lift.y = 2000;
letterbox(false);
r2.x = -1536;
r2.z = (shp.z + 0x0200);
r16.visible = false;
};
if (_arg1 == 4){
camera.far = 34000;
rumble = false;
boss1 = false;
loadLevel(chapter);
player.setPosition(-1536, 2000, (shp.z - 4100));
lift.y = 2000;
grp31.visible = (grp32.visible = (grp33.visible = (grp34.visible = (grp36.visible = true))));
computer02.visible = true;
computer02.y = 2040;
letterbox(false);
r2.x = -1536;
r2.z = (shp.z + 0x0200);
r16.visible = false;
};
if (_arg1 == 5){
grp31.visible = (grp32.visible = (grp33.visible = (grp34.visible = (grp36.visible = false))));
rumble = false;
r2.x = -512;
r2.z = (shp.z + 0x0200);
boss1 = false;
bigBoss.setPosition(-512, 7000, ((shp.z - 0x0200) + 128));
loadLevel(chapter);
player.setPosition(-768, 8000, (shp.z + 0x0100));
lift.y = 8000;
letterbox(false);
anchor.visible = true;
changeSprite("energy");
};
if (_arg1 == 6){
grp31.visible = (grp32.visible = (grp33.visible = (grp34.visible = (grp36.visible = false))));
loadLevel(chapter);
player.setPosition(-512, 8000, (shp.z + 0x0200));
lift.y = 8000;
killEnemies();
lowerAuto();
createPipecleaner();
resetTurrets(20);
anchor.visible = true;
};
if (_arg1 == 7){
bossDist = 0x1000;
boss2 = true;
loadLevel(chapter);
lift.y = 1000;
killEnemies();
createPipecleaner();
scenePipecleaner();
resetTurrets(20);
modSkybox(0);
instruct("frBehind");
vcChannel = pipev.play();
setVolume(6, vcChannel);
};
if (_arg1 == 8){
removeEventListener(Event.ENTER_FRAME, loopSplash);
player.tilt = 0;
player.y = 16;
player.z = -70256;
sBox.z = 0;
Hud.gotoAndStop("playing");
shp.z = 0;
changeSector(sector, 1);
enterShip();
addEventListener(Event.ENTER_FRAME, enterFrameHandler);
stg.addEventListener(MouseEvent.MOUSE_DOWN, gunShot);
bigBoss.y = -10000;
st1.visible = (st2.visible = false);
};
if (_arg1 == 9){
if (!mp){
createDesert();
//unresolved jump
};
instruct("frCode");
Hud.mcAward.gotoAndStop(1);
musicChannel01.stop();
killEnemies();
if (shp.z < 0){
sBox.z = 0;
player.z = 10000;
shp.z = 10000;
};
if ((onShp == false)){
enterShip();
//unresolved jump
};
moveForest(-6000, 0, 50000);
_local2 = g.getChildByName("tr1");
compBoss.visible = true;
compBoss.setPosition((_local2.x + 0x0200), 60, _local2.z);
st1.visible = (st2.visible = true);
st1.setPosition((_local2.x - 0x0800), 0x0200, (_local2.z + 0x0200));
st2.setPosition((_local2.x - 0x0800), 0x0200, (_local2.z - 0x0200));
striderAttack = false;
st1.hp = (st2.hp = 50);
st1.alive = (st2.alive = true);
st1.tlock = (st2.tlock = false);
st1.sidex = (st2.sidex = false);
st1.content = st1.standing;
st2.content = st2.standing;
ter01.z = _local2.z;
ter01.x = (_local2.x - 3000);
ter02.z = (_local2.z + 2000);
ter02.x = (_local2.x + 2000);
ter01.scaleX = (ter01.scaleZ = 0.3);
ter01.scaleY = 5;
ter02.scaleX = (ter02.scaleZ = 0.5);
ter02.scaleY = 4;
kAlt = 120;
steering = false;
moveSkybox();
killed = 0;
};
if (_arg1 == 10){
removeEventListener(Event.ENTER_FRAME, loopSplash);
if (!mp){
createDesert();
//unresolved jump
};
musicChannel01.stop();
musicChannel01 = mSad.play(0, 9999);
setVolume(2, musicChannel01);
letterbox(true);
instruct("frGate");
chemicopsAlive(false);
en1.shotSize(0.5);
en2.shotSize(0.5);
en3.shotSize(0.5);
en4.shotSize(0.5);
en5.shotSize(0.5);
en6.shotSize(0.5);
player.tilt = 0;
player.y = 16;
Hud.gotoAndStop("playing");
addEventListener(Event.ENTER_FRAME, enterFrameHandler);
stg.addEventListener(MouseEvent.MOUSE_DOWN, gunShot);
st1.visible = (st2.visible = false);
if (shp.z < 50000){
player.z = 50000;
sBox.z = 0;
shp.z = 50000;
};
motherShip01.z = (shp.z + 30000);
speed = 0;
enterShip();
target = shp;
moveSkybox();
Hud.mcAward.gotoAndStop(1);
absZ = 0;
createGate((shp.z + 70000));
resizeGround(4000);
pt1.swapParent(motherShip01);
pt1.setPosition(-256, 520, -256);
pt2.swapParent(motherShip01);
pt2.setPosition(-256, 520, 0x0100);
pt3.swapParent(motherShip01);
pt3.setPosition(0x0100, 520, -256);
pt4.swapParent(motherShip01);
pt4.setPosition(0x0100, 520, 0x0100);
createPipecleaner();
bossTurret();
resetTurrets(10);
bigBoss.swapParent(motherShip01);
bigBoss.visible = true;
bigBoss.x = 0;
bigBoss.y = 550;
bigBoss.z = -640;
tur1.setPosition(0x0100, 0, 230);
tur2.setPosition(-256, 0, 232);
tur3.setPosition(0, 0x0100, 234);
tur4.setPosition(0, -256, 235);
bFace.scaleX = (bFace.scaleY = 0.5);
bFace2.scaleX = (bFace2.scaleY = 0.5);
bFace2.container.mouseEnabled = false;
turretForceDepth(false);
bFace.enableForcedDepth = false;
bFace2.enableForcedDepth = false;
bFace3.enableForcedDepth = false;
bFace4.enableForcedDepth = false;
bFace5.enableForcedDepth = false;
showEnemies();
tur1.visible = false;
tur2.visible = false;
tur3.visible = false;
tur4.visible = false;
en1.swapParent(motherShip01);
en2.swapParent(motherShip01);
en3.swapParent(motherShip01);
en4.swapParent(motherShip01);
en5.swapParent(motherShip01);
en6.swapParent(motherShip01);
en1.laser.swapParent(motherShip01);
en2.laser.swapParent(motherShip01);
en3.laser.swapParent(motherShip01);
en4.laser.swapParent(motherShip01);
en5.laser.swapParent(motherShip01);
en6.laser.swapParent(motherShip01);
grpMom.scale = 0.05;
};
if (_arg1 == 11){
Hud.btHelp.y = 900;
removeEventListener(Event.ENTER_FRAME, loopSplash);
if (!mp){
createDesert();
//unresolved jump
};
musicChannel01.stop();
letterbox(true);
chemicopsAlive(false);
player.tilt = 0;
player.y = 16;
Hud.gotoAndStop("playing");
addEventListener(Event.ENTER_FRAME, enterFrameHandler);
st1.visible = (st2.visible = false);
if (shp.z < 50000){
player.z = 50000;
sBox.z = 0;
shp.z = 50000;
};
motherShip01.z = (shp.z + 30000);
speed = 0;
enterShip();
target = shp;
moveSkybox();
Hud.mcAward.gotoAndStop(1);
absZ = 0;
resizeGround(4000);
pt1.swapParent(motherShip01);
pt1.setPosition(-256, 520, -256);
pt2.swapParent(motherShip01);
pt2.setPosition(-256, 520, 0x0100);
pt3.swapParent(motherShip01);
pt3.setPosition(0x0100, 520, -256);
pt4.swapParent(motherShip01);
pt4.setPosition(0x0100, 520, 0x0100);
createPipecleaner();
bossTurret();
shp.x = 0;
parachute = false;
finished = true;
player.y = 16;
player.z = (player.x = 0);
chapter = 11;
pt1.visible = false;
pTiltMax = 10;
pTiltMin = 20;
floating = true;
player.x = shp.x;
player.z = shp.z;
floating = false;
xmin = -100;
xmax = 100;
zmin = -300;
zmax = 50;
onShp = true;
medipoid.swapParent(shp);
player.swapParent(shp);
anchor.visible = false;
player.y = 32;
player.z = -128;
target = shp;
resizeGround(4000);
en1.thisTarget = (en2.thisTarget = (en3.thisTarget = (en4.thisTarget = (en5.thisTarget = (en6.thisTarget = target)))));
drpShp03.roll = 0;
if (chapter == 11){
pTiltMax = 10;
pTiltMin = 20;
};
Hud.mcInstructions.mouseEnabled = false;
Hud.mcInstructions.visible = true;
Hud.mcInstructions.alpha = 1;
Hud.mcInstructions.gotoAndStop("fini");
musicChannel01 = mChase.play();
setVolume(2, musicChannel01);
musicChannel01.addEventListener(Event.SOUND_COMPLETE, logo);
thirdPerson();
sfxChannel03.stop();
addEventListener(Event.ENTER_FRAME, enterCredit);
};
}
private function createTunnel():void{
var _local1:int;
tunL = 0x1000;
_local1 = 20000;
tun01 = new Cylinder("Tunnel01", 720, tunL, 6, 16, 720, true, true, false);
tun01.appearance = new Appearance(matChem01);
tun01.setPosition(0, 1220, (shp.z + _local1));
tun01.rotateAxis(1, 0, 0, 90);
tun01.swapCulling();
g.addChild(tun01);
tun02 = new Cylinder("Tunnel02", 720, tunL, 6, 8, 720, true, true, false);
tun02.appearance = new Appearance(matChem01);
tun02.setPosition(0, 1220, ((shp.z + tunL) + _local1));
tun02.rotateAxis(1, 0, 0, 90);
tun02.swapCulling();
g.addChild(tun02);
tun03 = new Cylinder("Tunnel03", 720, tunL, 6, 8, 720, true, true, false);
tun03.appearance = new Appearance(matChem01);
tun03.setPosition(0, 1220, ((shp.z + _local1) + (tunL * 2)));
tun03.rotateAxis(1, 0, 0, 90);
tun03.swapCulling();
g.addChild(tun03);
tun04 = new Cylinder("Tunnel04", 720, tunL, 6, 8, 720, true, false, false);
tun04.appearance = new Appearance(matChem01);
tun04.setPosition(0, 1220, ((shp.z + _local1) + (tunL * 2)));
tun04.rotateAxis(1, 0, 0, 90);
tun04.swapCulling();
g.addChild(tun04);
tun01.visible = (tun02.visible = (tun03.visible = (tun04.visible = false)));
}
private function keyUpHandler(_arg1:KeyboardEvent):void{
if ((((_arg1.keyCode == 38)) || ((_arg1.keyCode == 87)))){
pSpdZ = 0;
};
if ((((_arg1.keyCode == 40)) || ((_arg1.keyCode == 83)))){
pSpdZ = 0;
};
if ((((_arg1.keyCode == 39)) || ((_arg1.keyCode == 68)))){
pSpdX = 0;
};
if ((((_arg1.keyCode == 37)) || ((_arg1.keyCode == 65)))){
pSpdX = 0;
};
}
private function spriteSpread():void{
var _local1:int;
var _local2:*;
_local1 = 1;
while (_local1 < covernum) {
_local2 = g.getChildByName(("cv" + _local1));
_local2.container.alpha = 0;
_local2.x = (target.x + ((Math.random() * 12000) * (Math.random() - 0.5)));
_local2.y = 192;
_local1++;
};
}
private function onWheel(_arg1:MouseEvent):void{
if (Hud.currentLabel == "playing"){
sniperCam = (sniperCam + (_arg1.delta * 32));
if ((((((((((camzm == 0)) && ((camera.z == 0)))) && (!((freeze == 0))))) && ((option == false)))) && ((mshipAlive == true)))){
if (sniperCam < -200){
zoomin();
} else {
if (sniperCam > 0){
sniperCam = 34;
};
zoomout();
};
};
};
}
private function bitmapTexture(_arg1, _arg2):BitmapMaterial{
var _local3:Bitmap;
var _local4:BitmapData;
var _local5:*;
_local3 = new Bitmap(_arg1);
_local4 = _local3.bitmapData;
_local5 = new BitmapMaterial(_local4, null, _arg2);
return (_local5);
}
private function createTurret(_arg1:int, _arg2:int, _arg3:int, _arg4:Number, _arg5:Group, _arg6:String):Turret{
var _local7:*;
var _local8:Sprite2D;
_local7 = new Turret(_arg6, _arg4);
_local7.enableEvents = true;
_local7.setPosition(_arg1, _arg2, _arg3);
_local7.ox = _arg1;
_local7.oz = _arg3;
_arg5.addChild(_local7);
_local7.addEventListener(MouseEvent.MOUSE_OVER, onTurret);
_local7.container.addEventListener(MouseEvent.MOUSE_OUT, offTarget);
_local7.addEventListener(MouseEvent.CLICK, turretHit);
_local8 = createSprite(new GuardShot(0, 0), 0.5, 1, "sr");
g.addChild(_local8);
_local8.setPosition(_arg1, _arg2, _arg3);
_local7.laser = _local8;
_local7.avhp = this;
_local8.container.mouseEnabled = false;
_local8.visible = false;
_local7.thisTarget = player;
return (_local7);
}
private function flySprite():void{
var _local1:int;
var _local2:*;
_local1 = 1;
for (;_local1 < covernum;_local2.moveForward(4), if ((((Math.abs((_local2.z - target.z)) > 1000)) || ((Math.abs((_local2.x - target.x)) > 1000)))){
_local2.rotateY = (Math.random() * 300);
_local2.container.alpha = 0.4;
_local2.z = (target.z + ((Math.random() * 800) * (Math.random() - 0.5)));
_local2.x = (target.x + ((Math.random() * 800) * (Math.random() - 0.5)));
_local2.y = ((Math.random() * 800) * (Math.random() - 0.5));
}, _local1++) {
_local2 = g.getChildByName(("cv" + _local1));
_local2.scale = 0.1;
if ((_local2.container.alpha < 1)){
_local2.container.alpha = (_local2.container.alpha + 0.2);
continue;
};
};
}
private function setVol(_arg1, _arg2:Number):void{
var _local3:SoundTransform;
_local3 = _arg1.soundTransform;
_local3.volume = _arg2;
_arg1.soundTransform = _local3;
}
private function createSkybox():void{
sBox = new SkyBox("game_sky", (skysz * 2), 6, 6);
changeSky(skyP1, skyP2, skyP3, skyP4, skyP5, skyP5);
sBox.front.enableForcedDepth = true;
sBox.front.forcedDepth = 110000;
sBox.back.enableForcedDepth = true;
sBox.back.forcedDepth = 110001;
sBox.left.enableForcedDepth = true;
sBox.left.forcedDepth = 110002;
sBox.right.enableForcedDepth = true;
sBox.right.forcedDepth = 110003;
sBox.top.rotateX = 180;
sBox.top.swapCulling();
sBox.bottom.rotateX = 180;
sBox.bottom.swapCulling();
g.addChild(sBox);
sBox.z = -68000;
}
private function resetTurrets(_arg1:Number):void{
tur1.hp = _arg1;
tur2.hp = _arg1;
tur3.hp = _arg1;
tur4.hp = _arg1;
tur1.resurrect();
tur2.resurrect();
tur3.resurrect();
tur4.resurrect();
bossHp = (_arg1 * 4);
}
private function enterShip():void{
floating = true;
sfxChannel01 = sfxElevatorEnd.play();
player.x = shp.x;
player.z = shp.z;
deck();
}
private function roofrun():void{
var gm:MovieClip;
sBox.front.forcedDepth = 110000;
addEventListener(Event.ENTER_FRAME, enterRoof);
pt1.setPosition(player.x, (player.y - 20), player.z);
pt2.setPosition((player.x - 0x0200), (player.y - 20), player.z);
pt3.setPosition((player.x - 0x0400), (player.y - 20), player.z);
pt4.setPosition((player.x + 0x0100), (player.y + 236), player.z);
spot1.setPosition((player.x - 1324), (player.y + 250), (player.z + 312));
spot2.setPosition((player.x - 1324), (player.y + 250), (player.z - 312));
spot3.setPosition((player.x - 0x0200), (player.y + 300), (player.z + 312));
spot4.setPosition((player.x - 0x0200), (player.y + 300), (player.z - 312));
pt4.appearance = new Appearance(mtRoofwall);
pt4.roll = 90;
pt4.pan = 90;
videoScreen.pan = 0;
videoRim.pan = 0;
videoRim.setPosition((player.x - 0x0200), (player.y + 0x0200), (player.z + 2024));
videoScreen.setPosition((player.x - 0x0200), (player.y + 0x0200), (player.z + 2024));
gm = new Stomp();
gunman = createSprite(new EnemyIdle01(0, 0), 0.4, 1, "gunman");
gunman.content = gm;
gunman.setPosition((player.x + 200), player.y, player.z);
g.addChild(gunman);
changeSprite("chemicoy");
xmin = (player.x - 1224);
xmax = (player.x + 200);
zmin = (player.z - 200);
zmax = (player.z + 200);
gSen = (oSen = 1.3);
Hud.hand.gotoAndStop(2);
Tweener.addTween(player, {x:(player.x - 1220), time:15, transition:"linear", onComplete:function (){
letterbox(false);
Hud.hand.gotoAndStop(3);
roofwalk = true;
instruct("frWalk", 0);
sfxChannel02 = nowhere.play();
setVolume(2, sfxChannel02);
}});
instruct("frLook", 5);
}
private function instruct(_arg1:String, _arg2:Number=0):void{
var fr = _arg1;
var dl = _arg2;
Tweener.removeTweens(Hud.mcInstructions);
Hud.mcInstructions.mouseEnabled = false;
Hud.mcInstructions.visible = true;
Hud.mcInstructions.alpha = 0;
Hud.mcInstructions.gotoAndStop(fr);
Tweener.addTween(Hud.mcInstructions, {alpha:1, time:3, delay:(0 + dl), transition:"easeOut"});
Tweener.addTween(Hud.mcInstructions, {alpha:0, time:2, delay:(20 + dl), transition:"easeIn", onComplete:function (){
Hud.mcInstructions.visible = false;
}});
}
private function rappel(_arg1:Event):void{
player.y = (player.y + 2);
if (player.y > 0){
sfxChannel01.stop();
loadArea();
};
scene.render();
}
private function moveMountain(_arg1:Boolean=false):void{
var _local2:Number;
if (_arg1 == true){
_local2 = Math.random();
ter01.scaleX = (ter01.scaleZ = 0.3);
ter01.scaleY = 5;
ter02.scaleX = (ter02.scaleZ = 0.5);
ter02.scaleY = 4;
ter03.scaleX = (ter01.scaleZ = 0.3);
ter03.scaleY = 5;
ter04.scaleX = (ter02.scaleZ = 0.3);
ter04.scaleY = 4;
ter05.scaleX = (ter01.scaleZ = 0.4);
ter05.scaleY = 5;
} else {
ter01.scaleX = (ter01.scaleZ = 1);
ter01.scaleY = 1;
ter02.scaleX = (ter02.scaleZ = 1);
ter02.scaleY = 1;
ter03.scaleX = (ter01.scaleZ = 1);
ter03.scaleY = 1;
ter04.scaleX = (ter02.scaleZ = 1);
ter04.scaleY = 1;
ter05.scaleX = (ter01.scaleZ = 1);
ter05.scaleY = 1;
};
if ((shp.z - ter05.z) > 10000){
ter05.z = (ter05.z + 20000);
};
if ((shp.z - ter01.z) > 20000){
ter01.z = (ter01.z + 40000);
ter01.x = 3500;
};
if ((shp.z - ter02.z) > 10000){
ter02.z = (ter02.z + 20000);
ter02.x = -3500;
};
if ((shp.z - ter03.z) > 10000){
ter03.z = (ter03.z + 20000);
ter03.x = 3000;
};
if ((shp.z - ter04.z) > 20000){
ter04.z = (ter04.z + 40000);
ter04.x = -3000;
};
if (chapter == 10){
if (ter01.z > (gate01.z - 2000)){
ter01.enableForcedDepth = true;
ter01.forcedDepth = 30100;
};
if (ter02.z > (gate01.z - 2000)){
ter02.enableForcedDepth = true;
ter02.forcedDepth = 30101;
};
if (ter03.z > (gate01.z - 2000)){
ter03.enableForcedDepth = true;
ter03.forcedDepth = 30102;
};
if (ter04.z > (gate01.z - 2000)){
ter04.enableForcedDepth = true;
ter04.forcedDepth = 30103;
};
if (ter05.z > (gate01.z - 2000)){
ter05.enableForcedDepth = true;
ter05.forcedDepth = 30104;
};
};
}
private function bindPlayer():void{
if ((player.z > zmax)){
player.z = zmax;
//unresolved jump
};
if ((player.z < zmin)){
player.z = zmin;
//unresolved jump
};
if ((player.x > xmax)){
player.x = xmax;
//unresolved jump
};
if ((player.x < xmin)){
player.x = xmin;
//unresolved jump
};
}
private function ground(_arg1:String, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:int, _arg8:int, _arg9:String, _arg10:String, _arg11, _arg12:Boolean, _arg13:Number, _arg14:Boolean, _arg15:Boolean, _arg16:Group=null):Plane3D{
var _local17:Plane3D;
_local17 = new Plane3D(_arg1, _arg2, _arg3, _arg7, _arg8, _arg9);
_local17.appearance = new Appearance(_arg11);
_local17.setPosition(_arg4, _arg5, _arg6);
_local17.enableForcedDepth = _arg12;
_local17.enableBackFaceCulling = _arg14;
_local17.useSingleContainer = true;
if (_arg12 == true){
_local17.forcedDepth = (8000 + _arg13);
};
_local17.enableNearClipping = true;
if (_arg16 != null){
_arg16.addChild(_local17);
};
return (_local17);
}
private function moveSidesprite(_arg1:int=0, _arg2:int=0, _arg3:int=0):void{
var _local4:int;
var _local5:*;
_local4 = 0;
while (_local4 < sideNum) {
_local5 = g.getChildByName(("ss" + _local4));
_local5.z = 100000(((Math.random() * 20000) * (Math.random() - 0.5)));
_local4++;
};
}
private function createMountains():void{
ter01 = new TerrainCreator2(new HmValleyhome(0, 0), "m1", 6, 0x0100, 5, 0x1000, 0x1000, 8, 0x0100, 0x0100, false, false, 6, 7, true);
ter01.appearance = new Appearance(moSu01);
ter01.setPosition(-4096, 0, 0);
g.addChild(ter01);
ter02 = new TerrainCreator2(new Mountain01(0, 0), "m2", 6, 0x0100, 16, 0x1000, 0x1000, 14, 0x0100, 0x0100, false, false, 6, 7, true);
ter02.appearance = new Appearance(moSu01);
ter02.setPosition(0x1000, 0, 0);
g.addChild(ter02);
ter03 = new TerrainCreator2(new Mountain01(0, 0), "m8", 12, 0x0100, 5, 0x1000, 0x1000, 8, 0x0100, 0x0100, false, false, 6, 7, true);
ter03.appearance = new Appearance(moSu01);
ter03.setPosition(0x1000, 0, 0x2000);
g.addChild(ter03);
ter04 = new TerrainCreator2(new Mesa01(0, 0), "m10", 8, 0x0100, 5, 0x1000, 0x1000, 4, 0x0100, 0x0100, false, false, 6, 7, true);
ter04.appearance = new Appearance(meSu01);
ter04.setPosition(-4096, 0, 0x3000);
g.addChild(ter04);
ter05 = new TerrainCreator2(new Mesa01(0, 0), "m0", 16, 0x0100, 12, 29096, 9096, 8, 0x0100, 0x0100, false, false, 6, 7, true);
ter05.appearance = new Appearance(meSu01);
ter05.setPosition(12096, 0, 7000);
g.addChild(ter05);
}
private function moveSprite():void{
var _local1:int;
var _local2:*;
_local1 = 1;
for (;_local1 < covernum;if (_local2.container.visible == false){
_local2.z = target.z;
_local2.x = target.x;
_local2.y = 0;
_local2.rotateY = (-(absA) * 2);
_local2.container.alpha = 0.4;
_local2.moveForward(((target.y + 128) + (Math.random() * (128 + (target.y * 8)))));
_local2.moveSideways(((Math.random() * (150 + (target.y * 8))) * (Math.random() - 0.5)));
}, _local1++) {
_local2 = g.getChildByName(("cv" + _local1));
if ((_local2.container.alpha < 1)){
_local2.container.alpha = (_local2.container.alpha + 0.2);
continue;
};
};
}
public function bongsound():void{
fxm = bong.play();
}
private function loopSplash(_arg1:Event):void{
sBox.z = target.z;
player.pan = (player.pan + 0.1);
player.y = 0;
asteroids();
Hud.mcAward.mouseEnabled = false;
scene.render();
if (Hud.currentLabel == "intro"){
if (Hud.quote.currentFrame == 3100){
doneIntro();
};
};
}
private function spriteBlast():void{
var _local1:int;
var _local2:*;
_local1 = 1;
for (;_local1 < covernum;(_local2.z = (_local2.z + 0x0100)), (_local2.scale = 4), if (((((_local2.z - target.z) > 4000)) || ((Math.abs((_local2.x - target.x)) > 20000)))){
_local2.container.alpha = 0.4;
_local2.z = ((target.z - 3000) - (Math.random() * 8000));
_local2.x = (target.x + ((Math.random() * 12000) * (Math.random() - 0.5)));
_local2.y = 160;
}, _local1++) {
_local2 = g.getChildByName(("cv" + _local1));
if ((_local2.container.alpha < 1)){
_local2.container.alpha = (_local2.container.alpha + 0.2);
continue;
};
};
}
private function movePillar():void{
if ((shp.z - pil1.z) > 10000){
pil1.z = (pil1.z + 20000);
};
if ((shp.z - bl01.z) > 6000){
bl01.z = (bl01.z + 14000);
};
if ((shp.z - pil2.z) > 20000){
pil2.z = (pil2.z + 40000);
pil2.x = 3500;
};
if ((shp.z - pil3.z) > 10000){
pil3.z = (pil3.z + 20000);
pil3.x = -3500;
};
if ((shp.z - pil4.z) > 10000){
pil4.z = (pil4.z + 20000);
pil4.x = 3000;
};
}
private function death():void{
dying = true;
firstPerson();
killEnemies();
boss1 = false;
pTiltMax = -80;
pTiltMin = 45;
andagel.visible = true;
Hud.reticule.visible = false;
Hud.gunFlash.visible = false;
Tweener.addTween(camera, {z:-4024, time:6, transition:"linear", onComplete:function (){
Hud.btHelp.visible = true;
restart();
}});
sniperCam = 34;
Hud.crosshairs.alpha = 0;
gSen = oSen;
camera.fov = kFov;
letterbox(true);
removeEventListener(Event.ENTER_FRAME, enterFrameHandler);
addEventListener(Event.ENTER_FRAME, dead);
}
private function award(_arg1:int, _arg2:String, _arg3:String):void{
var dl = _arg1;
var fr = _arg2;
var fr2 = _arg3;
Tweener.removeTweens(Hud.mcAward);
Hud.mcAward.visible = true;
Hud.mcAward.alpha = 0;
Hud.mcAward.gotoAndStop(1);
Hud.mcAward.awardType.text = fr;
Hud.mcAward.awardMessage.text = fr2;
Tweener.addTween(Hud.mcAward, {alpha:1, time:1, delay:(0 + dl), transition:"linear", onComplete:function (){
Hud.mcAward.gotoAndStop(2);
sfxChannel04 = fxAward.play();
}});
Tweener.addTween(Hud.mcAward, {alpha:0, time:2, delay:(10 + dl), transition:"easeIn", onComplete:function (){
Hud.mcAward.visible = false;
}});
}
private function createSidesprites(_arg1:int):void{
var _local2:int;
var _local3:Sprite2D;
var _local4:*;
_local2 = 0;
while (_local2 < _arg1) {
_local4 = 32;
_local3 = createSprite(new SideSunset01(0, 0), _local4, _local2, "ss");
_local3.y = (58 * _local4);
if (_local2 < 3){
_local3.x = 0x3000;
_local3.z = (10000 + (_local2 * 0x4000));
} else {
_local3.x = -12288;
_local3.z = (10000 + ((_local2 - 3) * 0x4000));
};
_local3.setBoundingSphereRadius(10);
g.addChild(_local3);
_local2++;
};
}
private function sceneChemicoy():void{
var _local1:Sprite2D;
var _local2:Sprite2D;
var _local3:Sprite2D;
var _local4:Sprite2D;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:*;
var _local11:*;
var _local12:*;
var _local13:Plane3D;
var _local14:Plane3D;
drpShp01 = gameBox("drpShp01", 0x0100, 64, 0x0200, 21000, 200, 0, 1, g, mtp62, matHv01, matChem01, matChem01, matChem01, matChem01);
drpShp02 = gameBox("drpShp02", 0x0100, 64, 0x0200, -22512, 100, 0, 1, g, mtp62, matHv01, matChem01, matChem01, matChem01, matChem01);
drpShp03 = gameBox("drpShp03", 0x0100, 64, 0x0200, 0, -34, 0, 4, shp, mtp62, matHv01, matUnder, matChem01, matChem01, matUnder);
pil1 = gameBox("pillar1", 128, 2000, 0x0100, 0x0600, -100, (shp.z + 0x0300), 1, g, matChem01);
pil2 = gameBox("pillar2", 0x0100, 1000, 0x0100, 0x0600, 1400, (shp.z - 4000), 1, g, matChem01);
pil3 = gameBox("pillar3", 0x0200, 0x0400, 0, 0, 0, (shp.z - 4000), 1, g, matChem01);
pil4 = gameBox("pillar4", 0x0100, 2000, 0x0100, -1408, 800, (shp.z + 0x0200), 1, g, matChem01);
pil5 = gameBox("pillar5", 128, 1000, 128, 0, -544, (shp.z - 0x0200), 1, g, matChem01);
pil5.enableForcedDepth = true;
pil5.forcedDepth = 16000;
bl01 = gameBox("Bl01", 0x0200, 0x0400, 0x0200, 0x0600, 1400, (shp.z + 2000), 2, g, matChem01);
_local1 = createComputer(g, 0, 10, (shp.z - 0x0200), "elevate", "comp1");
_local2 = createComputer(g, 0x0600, 1020, (shp.z + 0x0400), "elevate", "comp2");
computer02 = createComputer(g, -1536, 2020, (shp.z + 0x0200), "elevate", "comp3");
computer02.visible = false;
_local3 = createComputer(g, -512, 3100, (shp.z + 0x0200), "elevate", "comp4");
computer04 = createComputer(g, -512, 7990, (shp.z + 0x0200), "lower", "comp5");
computer04.visible = false;
computer04.y = -2048;
_local4 = createComputer(g, 128, 2020, (shp.z - 3800), "process", "controlPanel");
compBoss = createComputer(g, -768, 8000, shp.z, "process", "compBoss");
anchor = createGrapple(g, 0, 0, 0, "anchor", "anchor");
grpMom = createGrapple(g, 22220, 0, 0, "mom", "anchor");
grp12 = createGrapple(g, -160, 0, (shp.z - 600), "grapple", "grapp12");
grp22 = createGrapple(g, 0x0300, 990, shp.z, "grapple", "grap22");
grp23 = createGrapple(g, 0x0600, 990, shp.z, "grapple", "grap23");
grp31 = createGrapple(g, 0x0600, 1990, (shp.z - 4200), "grapple", "grap31");
grp32 = createGrapple(g, 128, 1990, (shp.z - 4000), "grapple", "grap32");
grp34 = createGrapple(g, -1536, 1990, (shp.z - 4000), "grapple", "grap34");
grp33 = createGrapple(g, 128, 1990, (shp.z - 2512), "grapple", "grap33");
grp36 = createGrapple(g, -1536, 1990, (shp.z + 0x0100), "grapple", "grap36");
grp36.visible = false;
pt1 = ground("tn", 0x0200, 0x0200, 0, 60, 0, 8, 8, Plane3D.ZX_ALIGNED, "tri", matChem01, false, 2, false, true, g);
pt2 = ground("tn2", 0x0200, 0x0200, 0, -80, 0, 8, 8, Plane3D.ZX_ALIGNED, "tri", matChem01, false, 2, false, true, g);
pt3 = ground("tn3", 0x0200, 0x0200, -1024, 7960, shp.z, 8, 8, Plane3D.ZX_ALIGNED, "tri", matChem01, false, 2, false, true, g);
pt4 = ground("tn4", 0x0200, 0x0200, -512, 7960, shp.z, 8, 8, Plane3D.ZX_ALIGNED, "tri", matChem01, false, 2, false, true, g);
ptChem = ground("tn5", 0x4000, 0x4000, 0, 0x2000, -8192, 3, 3, Plane3D.XY_ALIGNED, "tri", chemWall, false, 2, true, true, g);
ptChem.pan = 180;
_local5 = ground("pli", 0x0600, 0x0600, 0, 0, 0, 4, 4, Plane3D.XY_ALIGNED, "tri", bossChem, false, 2, false, true, g);
bFace = _local5;
_local6 = ground("pli2", 0x0600, 0x0600, 0, 0, 64, 3, 3, Plane3D.XY_ALIGNED, "tri", bossArmsmat, false, 2, false, true, g);
bFace2 = _local6;
_local7 = ground("pli3", 0x0600, 0x0600, 0, 0, 128, 4, 4, Plane3D.XY_ALIGNED, "tri", bossHeadmat, false, 2, false, true, g);
bFace3 = _local7;
_local8 = ground("pli4", 0x0600, 400, 0, 0, 32, 4, 4, Plane3D.XY_ALIGNED, "tri", bossShield, false, 2, false, true, g);
bFace4 = _local8;
_local9 = ground("pli5", 400, 0x0600, 0, 0, 40, 4, 4, Plane3D.XY_ALIGNED, "tri", bossShield, false, 2, false, true, g);
bFace5 = _local9;
bFace3.container.mouseEnabled = false;
bigBoss.addChild(bFace);
bigBoss.addChild(bFace2);
bigBoss.addChild(bFace4);
bigBoss.addChild(bFace5);
g.addChild(bFace3);
bigBoss.setPosition(-512, 7000, (shp.z - 0x0400));
g.addChild(bigBoss);
_local10 = ground("w4", 0x0400, 720, -512, 4000, (shp.z + 0x0200), 2, 2, Plane3D.ZX_ALIGNED, "tri", matRim, false, 12410, false, true, g);
_local11 = ground("w5", 0x0400, 720, -512, 5000, (shp.z + 0x0200), 2, 2, Plane3D.ZX_ALIGNED, "tri", matRim, false, 12440, false, true, g);
_local12 = ground("w6", 0x0400, 720, -512, 6000, (shp.z + 0x0200), 2, 2, Plane3D.ZX_ALIGNED, "tri", matRim, false, 12440, false, true, g);
_local13 = ground("arr", 0x0100, 0x0100, 0x0600, 1700, (shp.z - 3600), 2, 2, Plane3D.XY_ALIGNED, "tri", matArrow, false, 12110, true, true, g);
_local13.pan = 180;
ground("w1", 0x0400, 720, 0, 1300, (shp.z + 2000), 2, 2, Plane3D.XY_ALIGNED, "tri", matRim, false, 12410, false, true, g);
ground("w2", 0x0400, 720, 0, 1300, (shp.z + 4000), 2, 2, Plane3D.XY_ALIGNED, "tri", matRim, false, 12440, false, true, g);
ground("w3", 0x0400, 720, 0, 1300, (shp.z + 6000), 2, 2, Plane3D.XY_ALIGNED, "tri", matRim, false, 12440, false, true, g);
ground("road", 720, 192, 0, 300, shp.z, 2, 2, Plane3D.XY_ALIGNED, "tri", matChem01, false, 12110, true, true, g);
poster4 = ground("lv4", 0x0100, 0x0100, 0, 128, (shp.z - 100), 2, 2, Plane3D.XY_ALIGNED, "tri", matLevel4, false, 12210, false, true, g);
r2 = ground("road2", 0x0200, 0x0200, 0, -40, (shp.z - 0x0200), 10, 10, Plane3D.ZX_ALIGNED, "tri", matElevator, false, 12111, false, true, g);
r2.swapParent(lift);
r3 = ground("road3", 0x0200, 0x0200, 0, -40, (shp.z - 0x0600), 1, 1, Plane3D.ZX_ALIGNED, "tri", matChem01, false, 12112, false, true, g);
r4 = ground("road4", 0x0200, 0x0200, 0, -40, (shp.z - 0x0800), 1, 1, Plane3D.ZX_ALIGNED, "tri", matChem01, false, 12113, false, true, g);
r5 = ground("road5", 800, 192, 0, -440, (shp.z - 2312), 2, 2, Plane3D.XY_ALIGNED, "tri", matChem01, false, 12114, false, true, g);
ground("lv3", 0x0100, 0x0100, 0, 1100, (shp.z + 0x0300), 2, 2, Plane3D.XY_ALIGNED, "tri", matLevel3, false, 12230, false, true, g);
pt1.setPosition(0, -40, (shp.z - 0x0800));
pt2.setPosition(0, -40, (shp.z - 0x0600));
r3.visible = false;
r4.visible = false;
r1 = ground("road1", 0x0200, 0x0200, 0, 960, shp.z, 1, 1, Plane3D.ZX_ALIGNED, "tri", matChem01, false, 12111, false, false, g);
r6 = ground("road6", 0x0200, 0x0200, 0, 960, (shp.z + 0x0200), 1, 1, Plane3D.ZX_ALIGNED, "tri", matChem01, false, 12112, false, false, g);
r7 = ground("l402", 0x0200, 0x0200, 0x0300, 960, shp.z, 1, 1, Plane3D.ZX_ALIGNED, "tri", matChem01, false, 12113, false, false, g);
r8 = ground("l403", 0x0200, 0x0200, 0x0600, 960, shp.z, 1, 1, Plane3D.ZX_ALIGNED, "tri", matChem01, false, 12114, false, false, g);
r9 = ground("l404", 0x0200, 0x0200, 0x0600, 960, (shp.z + 0x0200), 1, 1, Plane3D.ZX_ALIGNED, "tri", matChem01, false, 12115, false, false, g);
r10 = ground("lift2", 0x0200, 0x0200, 0x0600, 960, (shp.z + 0x0400), 1, 1, Plane3D.ZX_ALIGNED, "tri", matElevator, false, 12116, false, false, g);
_local14 = ground("Beam04", 0x0100, 0x0100, 860, 1960, (shp.z + 0x0400), 4, 4, Plane3D.XY_ALIGNED, "quad", matLevel2, false, 12118, false, false, g);
_local14.pan = -90;
r11 = ground("l302", 0x0200, 0x0200, 0x0600, 1960, (shp.z - 4000), 1, 1, Plane3D.ZX_ALIGNED, "tri", matChem01, false, 12117, false, false, g);
beam01 = ground("beam1", 0x0200, 896, -640, 1960, (shp.z - 4000), 4, 4, Plane3D.XY_ALIGNED, "quad", fxEnBe, false, 12118, false, false, g);
beam02 = ground("beam2", 0x0200, 896, 800, 1960, (shp.z - 4000), 4, 4, Plane3D.XY_ALIGNED, "quad", fxEnBe, false, 12118, false, false, g);
beam03 = ground("beam3", 0x0200, 896, 60, 1960, (shp.z - 3000), 4, 4, Plane3D.XY_ALIGNED, "quad", fxEnBe, false, 12118, false, false, g);
r12 = ground("l304", 0x0200, 0x0200, 128, 1960, (shp.z - 4000), 1, 1, Plane3D.ZX_ALIGNED, "tri", matChem01, false, 12119, false, false, g);
r13 = ground("l305", 0x0200, 0x0200, 128, 1960, (shp.z - 2512), 1, 1, Plane3D.ZX_ALIGNED, "tri", matChem01, false, 12120, false, false, g);
r14 = ground("l306", 0x0200, 0x0200, -1408, 1960, (shp.z - 4000), 1, 1, Plane3D.ZX_ALIGNED, "tri", matChem01, false, 12121, false, false, g);
ground("SNIPE", 0x0200, 0x0200, -4000, 1960, (shp.z - 1000), 1, 1, Plane3D.ZX_ALIGNED, "tri", matChem01, false, 12121, false, false, g);
beam04 = ground("beam4", 4000, 0x0200, -1536, 1960, (shp.z - 1744), 6, 6, Plane3D.ZX_ALIGNED, "tri", fxEnBe, false, 12123, false, false, g);
beam04.visible = false;
r16 = ground("l310", 0x0200, 0x0200, -1536, 1960, (shp.z + 0x0200), 1, 1, Plane3D.ZX_ALIGNED, "tri", matElevator, false, 12124, false, false, g);
videoRim = ground("videoRim", 1000, 2000, 200, 1960, (shp.z - 1312), 2, 2, Plane3D.XY_ALIGNED, "tri", matPoster, false, 12114, false, false, g);
videoRim.pan = 180;
videoScreen = ground("fence02", 1200, 2400, 200, 1960, (shp.z - 1312), 2, 2, Plane3D.XY_ALIGNED, "tri", matRim, false, 12114, false, false, g);
ground("lv1", 0x0100, 0x0100, -1408, 2960, (shp.z + 1600), 2, 2, Plane3D.XY_ALIGNED, "tri", matLevel1, false, 12232, false, true, g);
r17 = ground("l201", 0x0200, 0x0200, -1024, 2960, (shp.z + 0x0200), 1, 1, Plane3D.ZX_ALIGNED, "tri", matChem01, false, 12125, false, false, g);
r18 = ground("l202", 0x0200, 0x0200, -512, 2960, (shp.z + 0x0200), 1, 1, Plane3D.ZX_ALIGNED, "tri", matElevator, false, 12126, false, false, g);
prison = ground("prison", 0x0200, 0x0200, 22220, 0, 0, 1, 1, Plane3D.XY_ALIGNED, "tri", matForce, false, 12126, false, false, g);
fan = ground("l402", 0x0200, 0x0200, 0x0200, 960, shp.z, 6, 6, Plane3D.XY_ALIGNED, "tri", matFan, false, 12127, false, false, g);
fan.pan = 90;
fan.container.mouseEnabled = false;
g.addChild(lift);
}
private function hideEnemies():void{
en1.visible = (en2.visible = (en3.visible = (en4.visible = (en5.visible = (en6.visible = false)))));
}
private function clickBack(_arg1:MouseEvent):void{
chapter = (chapter - 1);
if (chapter < 8){
sector = 0;
};
if ((((chapter > 7)) && ((chapter < 12)))){
sector = 1;
};
if (chapter < 1){
chapter = 1;
} else {
Hud.optLoad.txtChapter.text = ("CHAPTER " + chapter);
Hud.optLoad.btAction.x = -100;
Hud.optLoad.btAction.alpha = 0;
Tweener.removeTweens(Hud.optLoad.btAction);
Tweener.addTween(Hud.optLoad.btAction, {alpha:1, x:0, time:1, transition:"easeOut"});
Hud.optLoad.mcPic.mouseEnabled = false;
Hud.optLoad.mcPic.x = -100;
Hud.optLoad.mcPic.alpha = 0;
Hud.optLoad.mcPic.gotoAndStop(chapter);
Tweener.removeTweens(Hud.optLoad.mcPic);
Tweener.addTween(Hud.optLoad.mcPic, {alpha:1, x:0, time:1, transition:"easeOut"});
};
}
private function modSkybox(_arg1:Number):void{
sBox.front.container.alpha = _arg1;
sBox.back.container.alpha = _arg1;
sBox.left.container.alpha = _arg1;
sBox.right.container.alpha = _arg1;
sBox.top.container.alpha = _arg1;
sBox.bottom.container.alpha = _arg1;
}
private function bossTurret():void{
tur1.swapParent(bigBoss);
tur2.swapParent(bigBoss);
tur3.swapParent(bigBoss);
tur4.swapParent(bigBoss);
tur1.setPosition(-64, 520, 1);
tur2.setPosition(-64, -300, 2);
tur3.setPosition(600, 64, 3);
tur4.setPosition(-600, 64, 4);
tur1.resurrect();
tur2.resurrect();
tur3.resurrect();
tur4.resurrect();
turretForceDepth(true);
tur1.forcedDepth = 2004;
tur2.forcedDepth = 2005;
tur3.forcedDepth = 2006;
tur4.forcedDepth = 2007;
}
private function mouseIcon():void{
Hud.optPanel.helppan.msSens.x = ((gSen * 100) - 100);
}
private function createSprite(_arg1, _arg2:Number, _arg3:int, _arg4:String):Sprite2D{
var _local5:BitmapData;
var _local6:Bitmap;
_local5 = _arg1;
_local6 = new Bitmap(_local5);
return (new Sprite2D((_arg4 + _arg3), _local6, _arg2));
}
private function onClick(_arg1:BubbleEvent):void{
var _local2:Sprite2D;
_local2 = (_arg1.target as Sprite2D);
}
private function lower(_arg1:BubbleEvent):void{
var gr:Sprite2D;
var evt = _arg1;
sniperCam = 34;
zoomout();
gr = (evt.target as Sprite2D);
if ((((Math.abs((gr.x - player.x)) < 100)) && ((Math.abs((gr.z - player.z)) < 100)))){
freeze = 0;
changeZone(gr.name);
r2.x = gr.x;
r2.z = gr.z;
player.swapParent(lift);
player.y = 16;
sfxChannel01 = sfxElevatorLoop.play(0, 9999);
sfxChannel02 = sfxElevatorEnd.play();
gr.visible = false;
gr.y = -2048;
anchor.visible = true;
Hud.btHelp.visible = false;
};
Tweener.addTween(lift, {y:liftHeight, time:20, transition:"linear", onComplete:function (){
Hud.btHelp.visible = true;
freeze = 1;
sfxChannel01.stop();
sfxChannel01 = sfxElevatorEnd.play();
player.swapParent(g);
player.y = (lift.y + 16);
letterbox(false);
Hud.gotoAndStop("playing");
}});
}
private function scenePipecleaner():void{
var _local1:int;
absZ = 22000;
shp.z = -58000;
_local1 = -20000;
tun01.setPosition(0, 1220, (shp.z + _local1));
tun02.setPosition(0, 1220, ((shp.z + tunL) + _local1));
tun03.setPosition(0, 1220, ((shp.z + _local1) + (tunL * 2)));
tun04.setPosition(0, 1220, ((shp.z + _local1) + (tunL * 2)));
tun01.y = (tun02.y = (tun03.y = (tun04.y = kAlt)));
}
private function resetChemicops():void{
en1.relive();
en2.relive();
en3.relive();
en4.relive();
en5.relive();
en6.relive();
chemicopsAlive(true);
en1.shot();
en2.shot();
en3.shot();
en4.shot();
en5.shot();
en6.shot();
}
private function asteroids():void{
var _local1:int;
var _local2:*;
_local1 = 1;
for (;_local1 < covernum;_local2.moveForward(-16), if (((((_local2.z - target.z) < -4000)) || ((Math.abs((_local2.x - target.x)) > 20000)))){
_local2.container.alpha = 0.4;
_local2.z = ((target.z + 3000) + (Math.random() * 8000));
_local2.x = (target.x + ((Math.random() * 12000) * (Math.random() - 0.5)));
_local2.y = ((Math.random() * 4000) * (Math.random() - 0.5));
}, _local1++) {
_local2 = g.getChildByName(("cv" + _local1));
if ((_local2.container.alpha < 1)){
_local2.container.alpha = (_local2.container.alpha + 0.2);
continue;
};
};
}
private function changeSector(_arg1:int=1, _arg2:int=1):void{
if (_arg1 == 0){
sector = 1;
player.y = -1100;
sBox.z = (player.z = -70512);
player.pan = 0;
changeSky(skyC1, skyC1, skyC1, skyC1, skyC5, skyC5);
sfxChannel01 = sfxElevatorLoop.play(0, 9999);
changeSprite("chemicoy");
} else {
if (_arg1 == 1){
createDesert();
en1.alive = (en2.alive = (en3.alive = (en4.alive = (en5.alive = true))));
en6.alive = false;
chapter = 8;
videoRim.setPosition(0, 0x2000, 0);
videoScreen.setPosition(0, 0x2000, 0);
videoScreen.pan = 180;
videoRim.pan = 180;
};
};
}
private function helpPanel(_arg1:MouseEvent):void{
if (option == false){
if (Hud.currentLabel == "intro"){
removeEventListener(Event.ENTER_FRAME, enterRoof);
} else {
removeEventListener(Event.ENTER_FRAME, enterFrameHandler);
};
option = true;
Hud.optPanel.x = 320;
} else {
if (option == true){
option = false;
Hud.optPanel.x = 1200;
if (Hud.currentLabel == "intro"){
addEventListener(Event.ENTER_FRAME, enterRoof);
} else {
addEventListener(Event.ENTER_FRAME, enterFrameHandler);
};
};
};
}
private function moveForest(_arg1:int=0, _arg2:int=0, _arg3:int=0):void{
var _local4:int;
var _local5:*;
_local4 = 0;
while (_local4 < 26) {
_local5 = g.getChildByName(("tr" + _local4));
_local5.moveForward(_arg3);
_local5.x = (_local5.x + _arg1);
if (chapter == 10){
if (_local5.z > (gate01.z - 2000)){
_local5.z = (_local5.z - 3000);
};
};
_local4++;
};
}
private function changeSky(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6):void{
sBox.front.appearance = new Appearance(_arg1);
sBox.back.appearance = new Appearance(_arg3);
sBox.left.appearance = new Appearance(_arg4);
sBox.right.appearance = new Appearance(_arg2);
sBox.top.appearance = new Appearance(_arg5);
sBox.bottom.appearance = new Appearance(_arg6);
}
private function resizeGround(_arg1:Number){
var _local2:Number;
if (chapter > 7){
tsz = _arg1;
_local2 = (_arg1 / 4000);
p1.scaleX = (p1.scaleZ = (p2.scaleX = (p2.scaleZ = (p3.scaleX = (p3.scaleZ = (p4.scaleX = (p4.scaleZ = _local2)))))));
p1.x = 0;
p1.z = 0;
p2.x = -(tsz);
p2.z = 0;
p3.x = 0;
p3.z = tsz;
p4.x = -(tsz);
p4.z = tsz;
};
}
private function endit(_arg1:Event):void{
SoundMixer.stopAll();
Hud.mcInstructions.credit.gotoAndStop(11);
}
private function damage(_arg1:Number):void{
if (option == false){
Hud.hudhealth.healthmask.scaleX = (Hud.hudhealth.healthmask.scaleX - 0.05);
};
if ((((dropAttack == false)) && ((chapter == 8)))){
if (option == false){
Hud.hudhealth.healthmask.scaleX = (Hud.hudhealth.healthmask.scaleX + 0.05);
};
};
if ((((Hud.hudhealth.healthmask.scaleX < 0)) && ((playerAlive == true)))){
playerAlive = false;
Hud.btHelp.visible = false;
death();
};
}
private function mouseSlower(_arg1:MouseEvent):void{
if (oSen > 0.2){
oSen = (oSen - 0.1);
gSen = oSen;
};
mouseIcon();
}
private function startGame(_arg1:MouseEvent):void{
if ((((chapter == 1)) || ((chapter == 2)))){
createMediPrison(0x0600, 1256, (shp.z + 0x0300));
} else {
medipoid = createMedipoid(0, 2000, (shp.z - 1700), 0.4, g, "med1");
mediAlive = true;
medicate = false;
};
if (chapter == 1){
rooftop();
};
if ((((sector == 0)) && ((chapter > 1)))){
loadArea();
};
if (chapter == 11){
showCredits = true;
};
if (chapter > 7){
sector = 1;
loadArea();
};
}
private function spawn(_arg1, _arg2:Number, _arg3:Number, _arg4:Number):void{
var _local5:Number;
_local5 = ((Math.random() * 0x0200) * (Math.random() - 0.5));
_arg1.setPosition((_arg2 + _local5), (_arg3 + 20), (_arg4 + _local5));
_arg1.alive = true;
_arg1.ox = _arg1.x;
_arg1.oz = _arg1.z;
_arg1.hp = _arg1.hpt;
_arg1.visible = true;
}
private function changeZone(_arg1:String):void{
if (chapter < 8){
if (_arg1 == "grapp121"){
instruct("frElevator");
award(5, "BABY STEPS : Bronze award", "You have passed your first challenge");
vcChannel.stop();
vcChannel = chem02.play();
setVolume(7, vcChannel);
xmin = -172;
xmax = 172;
zmin = -68700;
zmax = -68320;
};
if (_arg1 == "comp11"){
liftHeight = 1000;
letterbox(true);
pt1.setPosition(0, 960, shp.z);
pt2.setPosition(0, 960, (shp.z + 0x0200));
r3.visible = true;
r4.visible = true;
r1.visible = false;
r6.visible = false;
instruct("frShip", 6);
vcChannel.stop();
vcChannel = chem03.play();
setVolume(6, vcChannel);
spawn(en4, 0x0600, 990, (shp.z + 0x0100));
grp12.visible = false;
xmin = -172;
xmax = 172;
zmin = -68700;
zmax = (shp.z + 700);
};
if (_arg1 == "grap221"){
pt1.setPosition(0x0300, 960, shp.z);
pt2.setPosition(0x0600, 960, shp.z);
r1.visible = true;
r6.visible = true;
r7.visible = false;
r8.visible = false;
xmin = 560;
xmax = 952;
zmin = -68070;
zmax = -67920;
};
if (_arg1 == "grap231"){
chapter = 2;
pt1.setPosition(0x0600, 960, (shp.z + 0x0200));
pt2.setPosition(0x0600, 960, shp.z);
r2.x = 0x0600;
r2.z = (shp.z + 0x0400);
r10.setPosition(0, 960, (shp.z - 0x0200));
r7.visible = true;
r8.visible = false;
r9.visible = false;
xmin = (0x0600 - 200);
xmax = (0x0600 + 200);
zmin = -68070;
if (en4.alive == true){
en4.shot();
};
if (mediAlive == true){
zmax = -66812;
} else {
zmax = -67600;
};
};
if (_arg1 == "comp21"){
killEnemies();
en4.death();
tur1.scaleX = (tur2.scaleX = (tur3.scaleX = (tur4.scaleX = 1)));
tur1.scaleY = (tur2.scaleY = (tur3.scaleY = (tur4.scaleY = 1)));
sceneChemicops();
liftHeight = 2000;
letterbox(true);
r7.visible = true;
r8.visible = false;
instruct("frZoom", 15);
vcChannel.stop();
vcChannel = chem07.play();
setVolume(6, vcChannel);
grp22.visible = (grp23.visible = false);
xmin = (0x0600 - 200);
xmax = (0x0600 + 200);
zmin = ((shp.z + 0x0400) - 200);
zmax = ((shp.z + 0x0400) + 200);
};
if (_arg1 == "grap311"){
r10.visible = true;
r10.setPosition(0x0600, 1960, (shp.z + 0x0400));
r12.visible = true;
r13.visible = true;
r14.visible = true;
r11.visible = false;
pt1.setPosition(r11.x, r11.y, r11.z);
r8.visible = true;
r2.x = -1536;
r2.z = (shp.z + 0x0200);
r16.visible = false;
if (chapter == 2){
sfxChannel02.stop();
sfxChannel02 = fxBeam.play(0, 9999);
chapter = 3;
};
if (beam04.visible == false){
instruct("frDivert", 5);
vcChannel.stop();
vcChannel = chem09.play();
setVolume(6, vcChannel);
};
xmin = (0x0600 - 200);
xmax = (0x0600 + 200);
zmin = ((shp.z - 4000) - 200);
zmax = ((shp.z - 4000) + 200);
tur1.scaleX = (tur2.scaleX = (tur3.scaleX = (tur4.scaleX = 1)));
tur1.scaleY = (tur2.scaleY = (tur3.scaleY = (tur4.scaleY = 1)));
};
if (_arg1 == "grap321"){
if (beam04.visible == false){
instruct("frShoot", 2);
vcChannel.stop();
vcChannel = chem11.play();
setVolume(6, vcChannel);
};
xmin = (128 - 200);
xmax = (128 + 200);
zmin = ((shp.z - 4000) - 200);
zmax = ((shp.z - 4000) + 200);
r11.visible = true;
r13.visible = true;
r14.visible = true;
r12.visible = false;
pt1.setPosition(r12.x, r12.y, r12.z);
};
if (_arg1 == "grap331"){
xmin = (128 - 200);
xmax = (128 + 200);
zmin = ((shp.z - 2512) - 200);
zmax = ((shp.z - 2512) + 200);
r11.visible = true;
r12.visible = true;
r14.visible = true;
r13.visible = false;
pt1.setPosition(r13.x, r13.y, r13.z);
};
if (_arg1 == "grap341"){
if (beam04.visible == false){
zmin = ((shp.z - 4000) - 200);
zmax = ((shp.z - 4000) + 200);
} else {
zmin = ((shp.z - 4000) - 200);
zmax = ((shp.z + 0x0200) + 200);
if (crossBridge == false){
crossBridge = true;
spawn(en4, -4000, 1990, (shp.z - 1000));
spawn(en5, -4000, 1990, (shp.z - 1100));
vcChannel.stop();
vcChannel = chem13.play();
setVolume(6, vcChannel);
en4.shot();
en5.shot();
};
};
xmin = (-1536 - 200);
xmax = (-1536 + 200);
r11.visible = true;
r12.visible = true;
r13.visible = true;
r14.visible = false;
pt1.setPosition(r14.x, r14.y, r14.z);
liftHeight = 2990;
};
if (_arg1 == "grap361"){
xmin = (-1536 - 200);
xmax = (-1536 + 200);
zmin = ((shp.z - 3000) - 200);
zmax = ((shp.z + 0x0300) + 200);
liftHeight = 2990;
};
if (_arg1 == "comp31"){
letterbox(true);
killEnemies();
en4.death();
en5.death();
en4.content = en4.stand;
en5.content = en5.stand;
pt1.setPosition(-1024, 2960, (shp.z + 0x0200));
pt2.setPosition(-512, 2960, (shp.z + 0x0200));
pt2.appearance = new Appearance(matElevator);
r14.visible = true;
r17.visible = false;
r18.visible = false;
instruct("frCops", 10);
vcChannel.stop();
vcChannel = chem14.play();
setVolume(6, vcChannel);
grp31.visible = (grp32.visible = (grp33.visible = (grp34.visible = (grp36.visible = false))));
xmin = (-1408 - 50);
xmax = -360;
zmin = ((shp.z + 0x0200) - 200);
zmax = ((shp.z + 0x0200) + 200);
chapter = 4;
spawn(en1, -512, 2990, (shp.z + 0x0200));
spawn(en2, -512, 2990, (shp.z + 0x0200));
spawn(en3, -512, 2990, (shp.z + 0x0200));
spawn(en4, -512, 2990, (shp.z + 0x0200));
spawn(en5, -512, 2990, (shp.z + 0x0200));
spawn(en6, -512, 2990, (shp.z + 0x0200));
liftHeight = 3000;
};
if (_arg1 == "comp41"){
chapter = 5;
loadLevel(5);
award(5, "ROAD TO POWER : Gold award", "The String Fusion source is right above you - You've found the way.");
};
if (_arg1 == "comp51"){
loadLevel(6);
};
};
}
private function thirdPerson():void{
Hud.reticule.visible = false;
andagel.visible = true;
camzm = -800;
camera.fov = kFov;
gSen = oSen;
Hud.gotoAndStop("ship");
Tweener.addTween(camera, {z:-800, time:0.6, transition:"easeOutBack"});
camera.far = (Math.abs(camzm) * 100);
if ((sector > 1)){
resizeGround((Math.abs((camzm * 2)) + 4000));
//unresolved jump
};
drpShp03.visible = true;
pTiltMax = -80;
pTiltMin = 45;
if (chapter > 7){
pTiltMax = -5;
pTiltMin = 80;
};
}
private function turretForceDepth(_arg1:Boolean):void{
tur1.enableForcedDepth = (tur2.enableForcedDepth = (tur3.enableForcedDepth = (tur4.enableForcedDepth = _arg1)));
}
private function swerveVolume(_arg1:Number, _arg2):void{
var _local3:SoundTransform;
_local3 = _arg2.soundTransform;
_local3.volume = _arg1;
_arg2.soundTransform = _local3;
}
private function anchorClick(_arg1:BubbleEvent):void{
var gr:Sprite2D;
var evt = _arg1;
if (freeze != 0){
Hud.gunFlash.alpha = 1;
Hud.btHelp.visible = true;
camera.fov = kFov;
Hud.crosshairs.alpha = 0;
gSen = oSen;
sfxChannel03 = sfxGravity01.play();
gr = (evt.target as Sprite2D);
floating = true;
};
Tweener.addTween(player, {x:(gr.x + 16), y:gr.y, z:gr.z, time:1, transition:"easeInOutBack", onComplete:function (){
floating = false;
enterShip();
}});
}
private function chemicopsAlive(_arg1:Boolean):void{
en1.alive = (en2.alive = (en3.alive = (en4.alive = (en5.alive = (en6.alive = _arg1)))));
}
private function createEnemy(_arg1:int, _arg2:int, _arg3:int, _arg4:Number, _arg5:Group, _arg6:String):Enemy{
var _local7:*;
var _local8:Sprite2D;
_local7 = new Enemy(_arg6, _arg4);
_local7.enableEvents = true;
_local7.setPosition(_arg1, _arg2, _arg3);
_local7.ox = _arg1;
_local7.oz = _arg3;
_arg5.addChild(_local7);
_local7.addEventListener(MouseEvent.MOUSE_OVER, onThreat);
_local7.container.addEventListener(MouseEvent.MOUSE_OUT, offTarget);
_local7.addEventListener(MouseEvent.CLICK, enemyHit);
_local8 = createSprite(new GuardShot(0, 0), 0.5, 1, "sr");
g.addChild(_local8);
_local8.setPosition(_arg1, _arg2, _arg3);
_local7.laser = _local8;
_local7.avhp = this;
_local8.container.mouseEnabled = false;
_local8.visible = false;
_local7.thisTarget = player;
return (_local7);
}
private function createGate(_arg1:Number=60000):void{
gate01 = gameBox("gate01", 0x0200, 0x0800, 0x0200, -1024, 0x0400, _arg1, 4, g, matGate);
gate02 = gameBox("gate02", 0x0200, 0x0800, 0x0200, 0x0400, 0x0400, _arg1, 3, g, matGate);
gate01.pan = -90;
grp12.visible = (grp22.visible = (grp23.visible = (grp31.visible = (grp32.visible = true))));
grp12.setPosition((-1024 + 0x0200), 800, _arg1);
grp12.scale = 1;
grp22.setPosition((0x0400 - 0x0200), 1100, _arg1);
grp23.setPosition((-1024 + 0x0200), 1400, _arg1);
grp31.setPosition((0x0400 - 0x0200), 1700, _arg1);
grp32.setPosition(-1024, 2080, _arg1);
grp32.scale = 1;
r9.visible = (r6.visible = (r7.visible = (r8.visible = true)));
r9.setPosition((-1024 + 0x0200), (800 - 120), _arg1);
r6.setPosition((0x0400 - 0x0200), (1100 - 60), _arg1);
r7.setPosition((-1024 + 0x0200), (1400 - 60), _arg1);
r8.setPosition((0x0400 - 0x0200), (1700 - 60), _arg1);
plan01 = ground("plan01", 0x0800, 0x0800, 0, 0x0400, (_arg1 + 280), 2, 2, Plane3D.XY_ALIGNED, "tri", matForce, false, 30510, true, true, g);
plan02 = ground("plan02", 0x0800, 0x4000, -9000, 0x0400, (_arg1 + 400), 2, 2, Plane3D.XY_ALIGNED, "tri", matForce, false, 30511, true, true, g);
plan03 = ground("plan03", 0x0800, 0x4000, 9000, 0x0400, (_arg1 + 400), 3, 3, Plane3D.XY_ALIGNED, "tri", matForce, false, 30512, true, true, g);
plan04 = ground("plan04", 0x0800, 0x0800, -16384, 0x0400, (_arg1 + 400), 2, 2, Plane3D.XY_ALIGNED, "tri", matGate, false, 12513, false, true, g);
plan05 = ground("plan05", 0x0800, 0x0800, 0x4000, 0x0400, (_arg1 + 400), 2, 2, Plane3D.XY_ALIGNED, "tri", matGate, false, 12514, false, true, g);
plan01.enableForcedDepth = true;
plan02.enableForcedDepth = true;
plan03.enableForcedDepth = true;
plan01.forcedDepth = 30000;
plan02.forcedDepth = 30001;
plan03.forcedDepth = 30002;
pt1.setPosition(-1000, 2050, _arg1);
pt2.setPosition(1000, 2050, _arg1);
}
private function offTarget(_arg1:MouseEvent):void{
Hud.reticule.threatBar.visible = false;
Hud.reticule.gotoAndStop(1);
}
private function distance(_arg1, _arg2):Number{
var _local3:*;
var _local4:*;
var _local5:Number;
_local4 = (_arg2.x - _arg1.x);
_local5 = (_arg2.z - _arg1.z);
_local3 = Math.sqrt(((_local4 * _local4) + (_local5 * _local5)));
return (_local3);
}
private function doneIntro():void{
sBox.front.forcedDepth = 110000;
Hud.quote.stop();
Hud.quote.gotoAndStop(3100);
Hud.quote.visible = 0;
Tweener.removeTweens(player);
Hud.hand.visible = false;
SoundMixer.stopAll();
removeEventListener(Event.ENTER_FRAME, enterRoof);
xmin = -172;
xmax = 172;
zmin = -70256;
zmax = -69332;
player.x = 0;
player.tilt = 0;
player.y = 16;
player.z = -70256;
player.pan = 0;
addEventListener(Event.ENTER_FRAME, loopSplash);
pt1.setPosition(0, -40, (shp.z - 0x0800));
pt2.setPosition(0, -40, (shp.z - 0x0600));
pt3.setPosition(-1024, 7960, shp.z);
pt4.setPosition(-512, 7960, shp.z);
pt4.appearance = new Appearance(matChem01);
pt4.pan = 0;
pt4.roll = 0;
spot1.setPosition(-200, 0, (shp.z - 1400));
spot2.setPosition(200, 0, (shp.z - 1400));
spot3.setPosition(-400, 0, (shp.z - 600));
spot4.setPosition(400, 0, (shp.z - 600));
videoScreen.pan = 180;
videoRim.pan = 180;
videoRim.setPosition(200, 1960, (shp.z - 1312));
videoScreen.setPosition(200, 1960, (shp.z - 1312));
gSen = (oSen = 1);
Tweener.removeTweens(Hud.mcInstructions);
Hud.mcInstructions.visible = false;
if (sector == 0){
removeEventListener(Event.ENTER_FRAME, loopSplash);
changeSector(0, 1);
addEventListener(Event.ENTER_FRAME, rappel);
player.lookAt(player.x, player.y, (player.z + 0x0200));
Hud.gotoAndStop("rope");
} else {
removeEventListener(Event.ENTER_FRAME, loopSplash);
addEventListener(Event.ENTER_FRAME, rappel);
Hud.gotoAndStop("rope");
removeEventListener(Event.ENTER_FRAME, rappel);
xmin = -172;
xmax = 172;
zmin = -70256;
zmax = -69332;
player.tilt = 0;
player.y = 16;
player.z = -70256;
sBox.z = 0;
Hud.gotoAndStop("playing");
shp.z = 0;
changeSector(sector, 1);
enterShip();
addEventListener(Event.ENTER_FRAME, enterFrameHandler);
stg.addEventListener(MouseEvent.MOUSE_DOWN, gunShot);
};
}
private function bindShip(_arg1:int):void{
if ((shp.x > _arg1)){
shp.x = _arg1;
//unresolved jump
};
if ((shp.x < -(_arg1))){
shp.x = -(_arg1);
//unresolved jump
};
}
private function createDesert():void{
mp = ground("masterPlane", 0x4000, 0x4000, 0, 0, 8000, 8, 8, Plane3D.ZX_ALIGNED, "tri", tiSu01, true, 12100, true, true, g);
p1 = ground("plane1", tsz, tsz, 0, 0, 0, 8, 8, Plane3D.ZX_ALIGNED, "tri", tiSu01, true, 12010, true, true, g);
p2 = ground("plane2", tsz, tsz, -(tsz), 0, 0, 8, 8, Plane3D.ZX_ALIGNED, "tri", tiSu01, true, 12011, true, true, g);
p3 = ground("plane3", tsz, tsz, 0, 0, tsz, 8, 8, Plane3D.ZX_ALIGNED, "tri", tiSu01, true, 12012, true, true, g);
p4 = ground("plane4", tsz, tsz, -(tsz), 0, tsz, 8, 8, Plane3D.ZX_ALIGNED, "tri", tiSu01, true, 12013, true, true, g);
p1.enableClipping = true;
mShip = createTrapezoid("ms1", 0x1000, 0x0400, 8012, 0, 0, 0, 4, motherShip01, 0.5, 1, 0.7, 1, matHv01, matHv01, matUnder, matUnder, matElevator, matElevator);
g.addChild(motherShip01);
motherShip01.setPosition(0, 4000, 1000);
createForest(26, 12000, 0, 20000, "grass", 2);
createSidesprites(sideNum);
createMountains();
kAlt = 120;
en1.shot();
en2.shot();
en3.shot();
en4.shot();
en5.shot();
en6.shot();
rumble = false;
poster4.appearance = new Appearance(mtBomb);
mp.visible = true;
sfxChannel04.stop();
musicChannel01.stop();
musicChannel01 = mChase.play(0, 9999);
setVolume(2, musicChannel01);
r1.visible = (r2.visible = (r3.visible = (r4.visible = (r5.visible == false))));
sector = 2;
absZ = -250000;
changeSprite("dust");
spriteSpread();
changeSky(skyJ1, skyJ2, skyJ3, skyJ4, skyJ5, skyJ5);
modSkybox(1);
pil1.setPosition(-4000, 2000, 42000);
pil2.setPosition(-2000, 2000, 42000);
pil3.setPosition(1000, 2000, 44000);
pil4.setPosition(4000, 2000, 44000);
sBox.y = player.y;
resizeGround(384);
}
private function enterCredit(_arg1:Event):void{
scr = Math.round(musicChannel01.position);
if ((((scr > 5000)) && ((soundcue2 == 0)))){
soundcue2 = 1;
Hud.mcInstructions.credit.gotoAndStop(1);
};
if ((((scr > 10000)) && ((soundcue2 == 1)))){
soundcue2 = 2;
Hud.mcInstructions.credit.gotoAndStop(2);
};
if ((((scr > 15000)) && ((soundcue2 == 2)))){
soundcue2 = 3;
Hud.mcInstructions.credit.gotoAndStop(3);
};
if ((((scr > 20000)) && ((soundcue2 == 3)))){
soundcue2 = 4;
Hud.mcInstructions.credit.gotoAndStop(4);
};
if ((((scr > 25000)) && ((soundcue2 == 4)))){
soundcue2 = 5;
Hud.mcInstructions.credit.gotoAndStop(5);
};
if ((((scr > 30000)) && ((soundcue2 == 5)))){
soundcue2 = 6;
Hud.mcInstructions.credit.gotoAndStop(6);
};
if ((((scr > 35000)) && ((soundcue2 == 6)))){
soundcue2 = 7;
Hud.mcInstructions.credit.gotoAndStop(7);
};
if ((((scr > 40000)) && ((soundcue2 == 7)))){
soundcue2 = 8;
Hud.mcInstructions.credit.gotoAndStop(8);
};
if ((((scr > 45000)) && ((soundcue2 == 8)))){
soundcue2 = 9;
Hud.mcInstructions.credit.gotoAndStop(9);
};
if ((((scr > 50000)) && ((soundcue2 == 9)))){
soundcue2 = 10;
Hud.mcInstructions.credit.gotoAndStop(10);
};
}
private function createForest(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:String, _arg6:Number):void{
var _local7:TransformGroup;
var _local8:*;
var _local9:*;
var _local10:int;
var _local11:Number;
var _local12:Sprite2D;
_local7 = new TransformGroup("forest");
_local8 = new TreeSunset01(0, 0);
_local9 = new TreeSunset02(0, 0);
_local10 = 0;
while (_local10 < _arg1) {
_local11 = _arg6;
if (_arg5 == "grass"){
if (_local10 < 12){
_local12 = createSprite(_local8, _local11, _local10, "tr");
} else {
if ((((_local10 > 11)) && ((_local10 < 30)))){
_local12 = createSprite(_local9, _local11, _local10, "tr");
} else {
_local12 = createSprite(_local9, _local11, _local10, "tr");
};
};
};
_local12.y = (118 * _local11);
_local12.setBoundingSphereRadius(120);
_local12.x = (((Math.random() * _arg2) * (Math.random() - 0.5)) + _arg3);
_local12.z = (((Math.random() * _arg2) * (Math.random() - 0.5)) + _arg4);
_local7.addChild(_local12);
g.addChild(_local12);
_local10++;
};
}
private function optClick1(_arg1:MouseEvent):void{
Tweener.addTween(player, {z:-108000, time:2, transition:"easeInOutBack"});
xmin = -172;
xmax = 172;
zmin = -70256;
zmax = -69332;
Hud.gotoAndStop("menu");
}
private function optClick2(_arg1:MouseEvent):void{
if (Hud.currentLabel == "menu"){
Hud.gotoAndStop("visit");
Tweener.addTween(player, {z:-107000, time:2, transition:"easeInOutBack"});
} else {
if (Hud.currentLabel == "visit"){
Tweener.addTween(player, {z:-109000, time:2, transition:"easeInOutBack"});
Hud.gotoAndStop("menu");
} else {
if (Hud.currentLabel == "loadgame"){
Tweener.addTween(player, {z:-109000, time:2, transition:"easeInOutBack"});
chapter = 1;
sector = 0;
Hud.gotoAndStop("menu");
};
};
};
}
private function optClick3(_arg1:MouseEvent):void{
Hud.gotoAndStop("loadgame");
Tweener.addTween(player, {z:-107000, time:2, transition:"easeInOutBack"});
}
private function clickForward(_arg1:MouseEvent):void{
chapter++;
if (chapter < 8){
sector = 0;
};
if ((((chapter > 7)) && ((chapter < 12)))){
sector = 1;
};
if (chapter > 11){
chapter = 11;
} else {
Hud.optLoad.txtChapter.text = ("CHAPTER " + chapter);
Hud.optLoad.btAction.x = 100;
Hud.optLoad.btAction.alpha = 0;
Tweener.removeTweens(Hud.optLoad.btAction);
Tweener.addTween(Hud.optLoad.btAction, {alpha:1, x:0, time:1, transition:"easeOut"});
Hud.optLoad.mcPic.mouseEnabled = false;
Hud.optLoad.mcPic.x = 100;
Hud.optLoad.mcPic.alpha = 0;
Hud.optLoad.mcPic.gotoAndStop(chapter);
Tweener.removeTweens(Hud.optLoad.mcPic);
Tweener.addTween(Hud.optLoad.mcPic, {alpha:1, x:0, time:1, transition:"easeOut"});
};
}
private function createTrapezoid(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10:Number, _arg11:Number, _arg12:Number, _arg13:Number, _arg14, _arg15=null, _arg16=null, _arg17=null, _arg18=null, _arg19=null):Trapezoid{
var _local20:Trapezoid;
_local20 = new Trapezoid(_arg1, _arg2, _arg3, _arg4, PrimitiveMode.TRI, _arg8, _arg10, _arg11, _arg12, _arg13);
_local20.getFace(0).appearance = new Appearance(_arg14);
if (_arg15 == null){
_local20.getFace(1).appearance = new Appearance(_arg14);
_local20.getFace(2).appearance = new Appearance(_arg14);
_local20.getFace(3).appearance = new Appearance(_arg14);
_local20.getFace(4).appearance = new Appearance(_arg14);
_local20.getFace(5).appearance = new Appearance(_arg14);
} else {
_local20.getFace(1).appearance = new Appearance(_arg15);
_local20.getFace(2).appearance = new Appearance(_arg16);
_local20.getFace(3).appearance = new Appearance(_arg17);
_local20.getFace(4).appearance = new Appearance(_arg18);
_local20.getFace(5).appearance = new Appearance(_arg19);
};
_local20.setPosition(_arg5, _arg6, _arg7);
_arg9.addChild(_local20);
return (_local20);
}
private function lowerAuto():void{
freeze = 0;
r2.x = -512;
r2.z = (shp.z + 0x0200);
player.swapParent(lift);
player.y = 16;
sfxChannel01 = sfxElevatorLoop.play(0, 9999);
sfxChannel02 = sfxElevatorEnd.play();
letterbox(true);
Hud.btHelp.visible = false;
Tweener.addTween(lift, {y:liftHeight, time:20, transition:"linear", onComplete:function (){
Hud.btHelp.visible = true;
freeze = 1;
sfxChannel01.stop();
sfxChannel01 = sfxElevatorEnd.play();
player.swapParent(g);
player.y = (lift.y + 16);
letterbox(false);
Hud.gotoAndStop("playing");
}});
}
private function dead(_arg1:Event):void{
player.tilt = 5;
player.rotateAxis(0, 1, 0, 0.5);
scene.render();
}
private function showEnemies():void{
en1.visible = (en2.visible = (en3.visible = (en4.visible = (en5.visible = (en6.visible = true)))));
}
public function onPlaybackComplete(_arg1:Event):void{
Hud.mcInstructions.mouseEnabled = false;
Hud.mcInstructions.visible = true;
Hud.mcInstructions.alpha = 1;
Hud.mcInstructions.gotoAndStop("fini");
letterbox(true);
sfxChannel03.stop();
showCredits = true;
camera.z = -800;
musicChannel01 = mChase.play();
setVolume(2, musicChannel01);
musicChannel01.addEventListener(Event.SOUND_COMPLETE, logo);
addEventListener(Event.ENTER_FRAME, enterCredit);
}
private function gameBox(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11=null, _arg12=null, _arg13=null, _arg14=null, _arg15=null):Box{
var _local16:Box;
_local16 = new Box(_arg1, _arg2, _arg3, _arg4, _arg8);
_local16.getFace(0).appearance = new Appearance(_arg10);
if (_arg11 == null){
_local16.getFace(1).appearance = new Appearance(_arg10);
_local16.getFace(2).appearance = new Appearance(_arg10);
_local16.getFace(3).appearance = new Appearance(_arg10);
_local16.getFace(4).appearance = new Appearance(_arg10);
_local16.getFace(5).appearance = new Appearance(_arg10);
} else {
_local16.getFace(1).appearance = new Appearance(_arg11);
_local16.getFace(2).appearance = new Appearance(_arg12);
_local16.getFace(3).appearance = new Appearance(_arg13);
_local16.getFace(4).appearance = new Appearance(_arg14);
_local16.getFace(5).appearance = new Appearance(_arg15);
};
_local16.setPosition(_arg5, _arg6, _arg7);
_arg9.addChild(_local16);
return (_local16);
}
private function sceneChemicops():void{
r5.setPosition(-1286, 0x0A00, (shp.z + 0x0200));
r5.pan = 90;
}
private function turretHit(_arg1:BubbleEvent):void{
var _local2:Turret;
var _local3:Number;
_local2 = (_arg1.target as Turret);
if (_local2.hp > 0){
_local2.hp = (_local2.hp - 1);
bossHp = (bossHp - 1);
_local3 = ((1 / _local2.hpt) * _local2.hp);
Hud.reticule.threatBar.scaleY = _local3;
_local2.shot();
Hud.healthbar.scaleX = (Hud.healthbar.scaleX - 0.1);
};
if (_local2.hp == 0){
killEnemy(_arg1.target);
};
}
private function motherClick(_arg1:BubbleEvent):void{
var gr:Sprite2D;
var evt = _arg1;
locked = false;
grp12.visible = (grp22.visible = (grp23.visible = (grp31.visible = (grp32.visible = (grp33.visible = false)))));
if (freeze != 0){
camera.fov = kFov;
Hud.crosshairs.alpha = 0;
gSen = oSen;
sfxChannel03 = sfxGravity01.play();
gr = (evt.target as Sprite2D);
floating = true;
xmin = -400;
xmax = 400;
zmin = -400;
zmax = 400;
onMothership = true;
resizeGround(4000);
resetChemicops();
en1.thisTarget = player;
en2.thisTarget = player;
en3.thisTarget = player;
en4.thisTarget = player;
en5.thisTarget = player;
en6.thisTarget = player;
spawn(en1, 128, 550, 0);
spawn(en2, 128, 550, 0);
spawn(en3, 128, 550, 0);
spawn(en4, 128, 550, 0);
spawn(en5, 128, 550, 0);
spawn(en6, 128, 550, 0);
grpMom.visible = false;
Hud.gunFlash.alpha = 1;
Tweener.addTween(player, {x:(gr.x + 16), y:gr.y, z:gr.z, time:1, transition:"easeInOutBack", onComplete:function (){
floating = false;
player.setPosition(0, 550, 0);
player.swapParent(motherShip01);
}});
};
}
private function disperseGrapples(_arg1):void{
var _local2:*;
_local2 = compBoss;
grp31.visible = (grp32.visible = (grp33.visible = (grp34.visible = (grp36.visible = true))));
grp31.setPosition((_local2.x + 500), 16, _local2.z);
grp32.setPosition((_local2.x + 1000), 16, _local2.z);
grp33.setPosition((_local2.x + 2000), 16, _local2.z);
grp34.setPosition((_local2.x + 3000), 16, (_local2.z - 1000));
grp36.setPosition((_local2.x + 5000), 16, (_local2.z - 2000));
}
public function damageTest(_arg1, _arg2):void{
var _local3:*;
_local3 = distance(_arg1, _arg2);
if (_local3 < 16){
damage(_local3);
};
}
private function deck():void{
floating = false;
xmin = -100;
xmax = 100;
zmin = -300;
zmax = 50;
sfxChannel01 = sfxElevatorEnd.play();
sfxChannel03 = sfxSpeeder01.play(0, 99999);
onShp = true;
medipoid.swapParent(shp);
player.swapParent(shp);
anchor.visible = false;
player.y = 32;
player.z = -128;
target = shp;
resizeGround(4000);
en1.thisTarget = (en2.thisTarget = (en3.thisTarget = (en4.thisTarget = (en5.thisTarget = (en6.thisTarget = target)))));
drpShp03.roll = 0;
if (chapter == 11){
pTiltMax = 10;
pTiltMin = 20;
};
}
private function createPipecleaner():void{
bFace.appearance = new Appearance(pipeBack);
bFace2.appearance = new Appearance(pipeFront);
bFace3.visible = false;
bFace4.visible = false;
bFace5.visible = false;
}
private function createGrapple(_arg1, _arg2, _arg3, _arg4, _arg5:String, _arg6:String):Sprite2D{
var _local7:*;
_local7 = createSprite(new Grapple(0, 0), 0.2, 1, _arg6);
_local7.setPosition(_arg2, _arg3, _arg4);
_arg1.addChild(_local7);
_local7.enableEvents = true;
if (_arg5 == "grapple"){
_local7.addEventListener(MouseEvent.CLICK, grappleClick);
} else {
if (_arg5 == "mom"){
_local7.addEventListener(MouseEvent.CLICK, motherClick);
} else {
_local7.addEventListener(MouseEvent.CLICK, anchorClick);
};
};
_local7.container.addEventListener(MouseEvent.MOUSE_OVER, onTarget);
_local7.container.addEventListener(MouseEvent.MOUSE_OUT, offTarget);
return (_local7);
}
private function groundTile():void{
var _local1:Number;
var _local2:Number;
var _local3:*;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:*;
_local1 = target.x;
_local2 = target.z;
_local3 = g.getChildByName("pillar4");
_local3.pan = (_local3.pan + 5);
_local4 = (p1.x - _local1);
_local5 = (p2.x - _local1);
_local6 = (p1.z - _local2);
_local7 = (p3.z - _local2);
if (_local4 > tsz){
_local8 = shp.y;
p1.setPosition((p2.x - tsz), (minY - 1), p2.z);
} else {
if (_local4 < -(tsz)){
p1.setPosition((p2.x + tsz), (minY - 1), p2.z);
};
};
if (_local5 > tsz){
p2.setPosition((p1.x - tsz), (minY - 1), p1.z);
} else {
if (_local5 < -(tsz)){
p2.setPosition((p1.x + tsz), (minY - 1), p1.z);
};
};
if (_local6 > tsz){
p1.setPosition(p3.x, (minY - 1), (p3.z - tsz));
} else {
if (_local6 < -(tsz)){
p1.setPosition(p3.x, (minY - 1), (p3.z + tsz));
};
};
if (_local7 > tsz){
p3.setPosition(p1.x, (minY - 1), (p1.z - tsz));
} else {
if (_local7 < -(tsz)){
p3.setPosition(p1.x, (minY - 1), (p1.z + tsz));
};
};
p2.z = p1.z;
p3.x = p1.x;
p4.z = p3.z;
p4.x = p2.x;
p4.y = (p3.y = (p2.y = (p1.y = 0)));
}
private function onThreat(_arg1:BubbleEvent):void{
var _local2:Enemy;
var _local3:Number;
Hud.reticule.threatBar.visible = true;
Hud.reticule.gotoAndStop("threat");
_local2 = (_arg1.target as Enemy);
if (_local2.hp > 0){
_local3 = ((1 / _local2.hpt) * _local2.hp);
Hud.reticule.threatBar.scaleY = _local3;
};
}
private function killEnemies():void{
chemicopsAlive(false);
}
private function createScene():Group{
g = new Group();
createTextures();
createSkybox();
player.addChild(camera);
shp.addChild(player);
shp.z = -68000;
shp.y = 1100;
g.addChild(shp);
sceneChemicoy();
andagel = createSprite(new Andagel(0, 0), 0.2, 1, "andagel");
player.addChild(andagel);
andagel.setPosition(0, 0, 0);
en1 = createEnemy(0, -8048, (shp.z - 1700), 0.4, g, "enemy1");
en2 = createEnemy(40, -8048, (shp.z - 1800), 0.4, g, "enemy2");
en3 = createEnemy(-20, -8048, (shp.z - 1500), 0.4, g, "enemy3");
en4 = createEnemy(0x0600, -2048, (shp.z + 500), 0.4, g, "enemy4");
en5 = createEnemy(1564, -2048, (shp.z + 400), 0.4, g, "enemy5");
en6 = createEnemy(1380, -2048, (shp.z + 300), 0.4, g, "enemy6");
tur1 = createTurret(-64, 520, 1, 4, g, "turret1");
tur2 = createTurret(-64, -300, 2, 4, g, "turret2");
tur3 = createTurret(600, 64, 3, 4, g, "turret3");
tur4 = createTurret(-600, 64, 4, 4, g, "turret4");
tur5 = createTurret(0x0200, 0x0200, 500, 0.1, g, "turret5");
tur6 = createTurret(-512, -512, 500, 0.1, g, "turret6");
turretForceDepth(true);
tur1.forcedDepth = 2000;
tur2.forcedDepth = 2005;
tur3.forcedDepth = 2006;
tur4.forcedDepth = 2007;
bFace.enableForcedDepth = true;
bFace.forcedDepth = 2028;
bFace2.enableForcedDepth = true;
bFace2.forcedDepth = 2020;
bFace3.enableForcedDepth = true;
bFace3.forcedDepth = 1980;
bFace4.enableForcedDepth = true;
bFace4.forcedDepth = 1999;
bFace5.enableForcedDepth = true;
bFace5.forcedDepth = 1998;
bigBoss.addChild(tur1);
bigBoss.addChild(tur2);
bigBoss.addChild(tur3);
bigBoss.addChild(tur4);
bigBoss.addChild(tur5);
bigBoss.addChild(tur6);
st1 = createStrider(22048, 0, 1000, 5, g, "strider1");
st2 = createStrider(22048, 0, 1000, 5, g, "strider2");
spot1 = ground("spot1", 192, 0x0400, -200, 0, (shp.z - 1400), 3, 3, Plane3D.YZ_ALIGNED, "tri", spotLight, false, 12128, false, true, g);
spot2 = ground("spot2", 192, 0x0400, 200, 0, (shp.z - 1400), 3, 3, Plane3D.YZ_ALIGNED, "tri", spotLight, false, 12129, false, true, g);
spot3 = ground("spot1", 0x0100, 0x0400, -400, 0, (shp.z - 600), 3, 3, Plane3D.YZ_ALIGNED, "tri", spotLight, false, 12130, false, true, g);
spot4 = ground("spot2", 0x0100, 0x0400, 400, 0, (shp.z - 600), 3, 3, Plane3D.YZ_ALIGNED, "tri", spotLight, false, 12131, false, true, g);
speed = 0;
player.swapParent(g);
player.x = shp.x;
player.z = (shp.z - 2512);
player.y = 16;
target = player;
kAlt = 1380;
return (g);
}
private function helpLast(_arg1:MouseEvent):void{
helpNum--;
if (helpNum == 0){
helpNum = 9;
};
Hud.optPanel.helppan.x = -1200;
Hud.optPanel.helppan.alpha = 0;
Hud.optPanel.helppan.gotoAndStop(helpNum);
if ((helpNum == 1)){
Hud.optPanel.helppan.msSens.alpha = 1;
} else {
Hud.optPanel.helppan.msSens.alpha = 0;
};
Tweener.removeTweens(Hud.optPanel.helppan);
Tweener.addTween(Hud.optPanel.helppan, {alpha:1, x:0, time:1, transition:"easeOut"});
}
private function grappleClick(_arg1:BubbleEvent):void{
var gr:Sprite2D;
var evt = _arg1;
if (onShp == true){
exitShip();
};
if (freeze != 0){
camera.fov = kFov;
Hud.crosshairs.alpha = 0;
gSen = oSen;
Hud.btHelp.visible = true;
Hud.gunFlash.alpha = 1;
sfxChannel03 = sfxGravity01.play();
gr = (evt.target as Sprite2D);
if (chapter == 10){
if (gr.name == "grap221"){
grp12.visible = false;
};
if (gr.name == "grap231"){
grp12.visible = (grp22.visible = false);
};
if (gr.name == "grap311"){
grp12.visible = (grp22.visible = (grp23.visible = false));
};
if (gr.name == "grap321"){
grp12.visible = (grp22.visible = (grp23.visible = (grp31.visible = false)));
};
};
if (sector == 1){
changeZone(gr.name);
};
floating = true;
Tweener.addTween(player, {x:(gr.x + 16), y:gr.y, z:gr.z, time:1, transition:"easeInOutBack", onComplete:function (){
if (chapter == 10){
gr.visible = false;
locked = true;
if (player.y > 1900){
grpMom.scale = 1;
letterbox(false);
};
};
if (sector == 1){
floating = false;
};
}});
};
}
private function onObstacle(_arg1:BubbleEvent):void{
var _local2:EnergyField;
var _local3:Number;
Hud.reticule.threatBar.visible = true;
Hud.reticule.gotoAndStop("threat");
_local2 = (_arg1.target as EnergyField);
_local3 = ((1 / _local2.hpt) * _local2.hp);
Hud.reticule.threatBar.scaleY = _local3;
}
private function logo(_arg1:Event):void{
removeEventListener(Event.ENTER_FRAME, enterCredit);
removeEventListener(Event.ENTER_FRAME, enterFrameHandler);
Hud.mcInstructions.credit.gotoAndStop("lg");
musicChannel01 = mFinale.play();
musicChannel01.addEventListener(Event.SOUND_COMPLETE, endit);
setVolume(2, musicChannel01);
}
function goProto(_arg1:MouseEvent):void{
var _local2:String;
var _local3:URLRequest;
_local2 = "http://www.newgrounds.com/";
_local3 = new URLRequest(_local2);
navigateToURL(_local3, "_blank");
}
private function onStrider(_arg1:BubbleEvent):void{
var _local2:Strider;
var _local3:Number;
if (striderAttack == true){
Hud.reticule.threatBar.visible = true;
Hud.reticule.gotoAndStop("threat");
_local2 = (_arg1.target as Strider);
if (_local2.hp > 0){
_local3 = ((1 / _local2.hpt) * _local2.hp);
Hud.reticule.threatBar.scaleY = _local3;
};
};
}
private function helpNext(_arg1:MouseEvent):void{
helpNum++;
if (helpNum == 10){
helpNum = 1;
};
Hud.optPanel.helppan.x = 1200;
Hud.optPanel.helppan.alpha = 0;
Hud.optPanel.helppan.gotoAndStop(helpNum);
if ((helpNum == 1)){
Hud.optPanel.helppan.msSens.alpha = 1;
} else {
Hud.optPanel.helppan.msSens.alpha = 0;
};
Tweener.removeTweens(Hud.optPanel.helppan);
Tweener.addTween(Hud.optPanel.helppan, {alpha:1, x:0, time:1, transition:"easeOut"});
}
private function createMedipoid(_arg1:int, _arg2:int, _arg3:int, _arg4:Number, _arg5:Group, _arg6:String):Medipoid{
var _local7:*;
var _local8:Sprite2D;
_local7 = new Medipoid(_arg6, _arg4);
_local7.enableEvents = true;
_local7.setPosition(_arg1, _arg2, _arg3);
_arg5.addChild(_local7);
_local7.container.addEventListener(MouseEvent.MOUSE_OUT, offMedipoid);
_local7.container.addEventListener(MouseEvent.MOUSE_DOWN, clickMedipoid);
_local7.container.addEventListener(MouseEvent.MOUSE_UP, mouseup);
_local8 = createSprite(new MediPower(0, 0), 0.5, 1, "sr");
g.addChild(_local8);
_local8.setPosition(_arg1, _arg2, _arg3);
_local8.container.mouseEnabled = false;
_local7.laser = _local8;
_local7.avhp = this;
_local8.visible = false;
_local7.thisTarget = player;
return (_local7);
}
private function setVolume(_arg1:Number, _arg2):void{
var _local3:SoundTransform;
_local3 = _arg2.soundTransform;
_local3.volume = _arg1;
_arg2.soundTransform = _local3;
}
private function restart():void{
dying = false;
letterbox(false);
playerAlive = true;
removeEventListener(Event.ENTER_FRAME, dead);
addEventListener(Event.ENTER_FRAME, enterFrameHandler);
Hud.hudhealth.healthmask.scaleX = 1;
pTiltMax = -80;
pTiltMin = 10;
Hud.gunFlash.visible = true;
Hud.reticule.visible = true;
andagel.visible = false;
camera.z = 0;
if (chapter == 10){
resetTurrets(10);
resetChemicops();
en1.hp = (en2.hp = (en3.hp = (en4.hp = (en5.hp = (en6.hp = 10)))));
} else {
if (chapter == 1){
en4.alive = true;
en4.hp = 10;
} else {
if (chapter == 2){
en4.alive = true;
en4.hp = 10;
} else {
if (chapter == 8){
killed = 0;
en1.relive();
en2.relive();
en3.relive();
en4.relive();
en5.relive();
en6.relive();
chemicopsAlive(true);
en1.hp = (en2.hp = (en3.hp = (en4.hp = (en5.hp = (en6.hp = 10)))));
en1.shot();
en2.shot();
en3.shot();
en4.shot();
en5.shot();
en6.shot();
} else {
if (chapter == 9){
if (onShp == false){
killed = 0;
st1.hp = 50;
st2.hp = 50;
st1.alive = true;
st2.alive = true;
st1.walk();
st2.walk();
} else {
if (onShp == true){
killed = 0;
st1.hp = 50;
st2.hp = 50;
st1.alive = true;
st2.alive = true;
st1.run();
st2.runSide();
};
};
} else {
loadChapter(chapter);
if (chapter == 5){
musicChannel01.stop();
bFace3.setPosition(bigBoss.x, (bigBoss.y + (wave * 2)), (bigBoss.z + 128));
};
};
};
};
};
};
}
private function fallSprite(_arg1):void{
var _local2:int;
var _local3:*;
_local2 = 1;
for (;_local2 < covernum;(_local3.y = (_local3.y - 200)), if (_local3.y < _arg1){
_local3.x = ((Math.random() * 16000) * (Math.random() - 0.5));
_local3.z = (-68000 + ((Math.random() * 16000) * (Math.random() - 0.5)));
_local3.y = ((Math.random() * 16000) + 0x2000);
_local3.container.alpha = 0.4;
}, _local2++) {
_local3 = g.getChildByName(("cv" + _local2));
if ((_local3.container.alpha < 1)){
_local3.container.alpha = (_local3.container.alpha + 0.2);
continue;
};
};
}
private function mouseup(_arg1:MouseEvent):void{
if (mediAlive == true){
still = false;
poidSpeed = (poidSpeed * -1);
medicate = false;
medipoid.stopFeed();
};
}
private function firstPerson():void{
Hud.reticule.visible = true;
andagel.visible = false;
Hud.gunFlash.alpha = 1;
Hud.btHelp.visible = true;
camzm = 0;
pTiltMax = -80;
pTiltMin = 10;
Tweener.addTween(camera, {z:0, time:0.6, transition:"easeOut"});
resizeGround(4000);
drpShp03.visible = true;
steering = false;
camera.far = 74000;
Hud.gotoAndStop("playing");
}
private function createMediPrison(_arg1:Number, _arg2:Number, _arg3:Number):void{
medicate = true;
medipoid = createMedipoid(_arg1, _arg2, (_arg3 + 64), 0.4, g, "med1");
prison.setPosition(_arg1, _arg2, (_arg3 + 10));
bossHp = 40;
tur1.swapParent(g);
tur2.swapParent(g);
tur3.swapParent(g);
tur4.swapParent(g);
tur1.scaleX = (tur2.scaleX = (tur3.scaleX = (tur4.scaleX = 0.4)));
tur1.scaleY = (tur2.scaleY = (tur3.scaleY = (tur4.scaleY = 0.4)));
tur1.setPosition((_arg1 - 0x0100), (_arg2 - 120), _arg3);
tur2.setPosition((_arg1 - 0x0100), (_arg2 + 120), _arg3);
tur3.setPosition((_arg1 + 0x0100), (_arg2 - 120), _arg3);
tur4.setPosition((_arg1 + 0x0100), (_arg2 + 120), _arg3);
turretForceDepth(false);
resetTurrets(10);
}
private function loadLevel(_arg1):void{
if (_arg1 == 3){
sceneChemicops();
liftHeight = 2000;
r10.visible = true;
r10.setPosition(0x0600, 1960, (shp.z + 0x0400));
r12.visible = (r13.visible = (r14.visible = true));
r11.visible = false;
pt1.setPosition(r11.x, r11.y, r11.z);
r8.visible = true;
r2.x = -1536;
r2.z = (shp.z + 0x0200);
r16.visible = false;
sfxChannel02 = fxBeam.play(0, 9999);
if (chapter == 2){
sfxChannel02 = fxBeam.play(0, 9999);
};
chapter = 3;
instruct("frDivert", 5);
vcChannel = chem09.play();
setVolume(6, vcChannel);
xmin = (0x0600 - 200);
xmax = (0x0600 + 200);
zmin = ((shp.z - 4000) - 200);
zmax = ((shp.z - 4000) + 200);
};
if (_arg1 == 4){
sceneChemicops();
zmin = ((shp.z - 4000) - 200);
zmax = ((shp.z + 0x0200) + 200);
spawn(en4, -4000, 1990, (shp.z - 1000));
spawn(en5, -4000, 1990, (shp.z - 1100));
en1.setPosition(22222, 22222, 22222);
en2.setPosition(22222, 22222, 22222);
en3.setPosition(22222, 22222, 22222);
en6.setPosition(22222, 22222, 22222);
vcChannel.stop();
vcChannel = chem13.play();
setVolume(6, vcChannel);
en4.shot();
en5.shot();
xmin = (-1536 - 200);
xmax = (-1536 + 200);
r11.visible = true;
r12.visible = true;
r13.visible = true;
r14.visible = false;
pt1.setPosition(r14.x, r14.y, r14.z);
liftHeight = 2990;
beam01.visible = (beam02.visible = (beam03.visible = false));
beam04.visible = true;
};
if (_arg1 == 5){
bossTurret();
sceneChemicops();
compBoss.y = 8000;
compBoss.visible = true;
modSkybox(0.2);
letterbox(true);
r17.visible = true;
r16.visible = true;
r16.setPosition(-1024, 2960, (shp.z + 0x0400));
pt1.setPosition(-1024, 7960, (shp.z + 0x0200));
pt2.setPosition(-768, 7000, (shp.z - 0x0400));
pt3.setPosition(-1024, 7960, shp.z);
pt4.setPosition(-512, 7960, shp.z);
r6.visible = false;
r1.visible = false;
xmin = (-1024 - 200);
xmax = (-512 + 200);
zmin = (shp.z - 200);
zmax = ((shp.z + 0x0200) + 200);
liftHeight = 8000;
spot1.setPosition((-768 + 0x0200), 8400, ((shp.z + 0x0100) + 0x0200));
spot2.setPosition((-768 + 0x0200), 8400, ((shp.z + 0x0100) - 0x0200));
spot3.setPosition((-768 - 0x0200), 8400, ((shp.z + 0x0100) + 0x0200));
spot4.setPosition((-768 - 0x0200), 8400, ((shp.z + 0x0100) - 0x0200));
spawn(en1, -22768, 10000, (shp.z + 0x0100));
spawn(en2, -22768, 10000, (shp.z + 0x0100));
spawn(en3, -22768, 10000, (shp.z + 0x0100));
spawn(en4, -22768, 10000, (shp.z + 0x0100));
spawn(en5, -22768, 10000, (shp.z + 0x0100));
spawn(en6, -22768, 10000, (shp.z + 0x0100));
killEnemies();
en1.death();
en2.death();
en3.death();
en4.death();
en5.death();
en6.death();
changeSprite("energy");
};
if (_arg1 == 6){
sceneChemicops();
if (!tun01){
createTunnel();
//unresolved jump
};
tun01.visible = (tun02.visible = (tun03.visible = (tun04.visible = true)));
modSkybox(0.2);
liftHeight = 1000;
letterbox(true);
changeSprite("debris");
chapter = 6;
createPipecleaner();
resetTurrets(20);
bossTurret();
r17.visible = true;
r16.setPosition(-1024, 2960, (shp.z + 0x0400));
pt1.setPosition(0, 960, shp.z);
pt2.setPosition(0, 960, (shp.z + 0x0200));
r6.visible = false;
r1.visible = false;
tun01.visible = (tun02.visible = (tun03.visible = (tun04.visible = true)));
sfxChannel04 = fxSiren.play(0, 9999);
instruct("frEscape", 5);
rumble = true;
musicChannel01.stop();
musicChannel01 = mChase.play(0, 9999);
setVolume(2, musicChannel01);
vcChannel.stop();
vcChannel = chem15.play();
setVolume(6, vcChannel);
xmin = -712;
xmax = 200;
zmin = (shp.z - 200);
zmax = ((shp.z + 0x0200) + 200);
};
if (_arg1 == 7){
if (!tun01){
createTunnel();
//unresolved jump
};
tun01.visible = (tun02.visible = (tun03.visible = (tun04.visible = true)));
liftHeight = 1000;
letterbox(false);
changeSprite("debris");
chapter = 7;
createPipecleaner();
r17.visible = true;
r16.setPosition(-1024, 2960, (shp.z + 0x0400));
pt1.setPosition(0, 960, shp.z);
pt2.setPosition(0, 960, (shp.z + 0x0200));
r6.visible = false;
r1.visible = false;
rumble = true;
musicChannel01.stop();
musicChannel01 = mChase.play(0, 9999);
setVolume(2, musicChannel01);
enterShip();
resetTurrets(20);
bossTurret();
modSkybox(0);
};
}
private function processObject(_arg1:BubbleEvent):void{
var gr:Sprite2D;
var evt = _arg1;
sniperCam = 34;
zoomout();
gr = (evt.target as Sprite2D);
if ((((Math.abs((gr.x - player.x)) < 100)) && ((Math.abs((gr.z - player.z)) < 100)))){
if (gr.name == "controlPanel1"){
sfxChannel02.stop();
sfxChannel02 = sfxWind.play();
instruct("frBridge");
computer02.visible = true;
grp36.visible = true;
award(3, "PUZZLE MASTER : Bronze award", "You completed the powerdown sequence");
vcChannel.stop();
vcChannel = chem12.play();
setVolume(6, vcChannel);
beam01.visible = (beam02.visible = (beam03.visible = false));
beam04.visible = true;
gr.visible = false;
gr.y = -2048;
chapter = 4;
} else {
if (gr.name == "compBoss1"){
if (chapter != 9){
grp31.visible = (grp32.visible = (grp33.visible = (grp34.visible = (grp36.visible = false))));
compBoss.y = -2048;
compBoss.visible = false;
Hud.btHelp.visible = false;
rumble = true;
letterbox(true);
chemicopsAlive(true);
Tweener.addTween(bigBoss, {y:8600, time:12, transition:"linear", onComplete:function (){
Hud.btHelp.visible = true;
musicChannel01.stop();
musicChannel01 = mSad.play(0, 9999);
setVolume(2, musicChannel01);
letterbox(false);
en1.shot();
en2.shot();
en3.shot();
en4.shot();
en5.shot();
en6.shot();
bossx = bigBoss.x;
bossy = bigBoss.y;
bossz = bigBoss.z;
}});
boss1 = true;
bFace4.visible = false;
bFace5.visible = false;
resetTurrets(40);
hideEnemies();
} else {
anchor.visible = true;
instruct("frTrap");
crashsite = true;
compBoss.visible = false;
musicChannel01 = mChase.play(0, 9999);
setVolume(2, musicChannel01);
st1.walk();
st2.walk();
};
};
};
};
}
private function loadArea():void{
sBox.front.forcedDepth = 110000;
removeEventListener(Event.ENTER_FRAME, loopSplash);
changeSector(0, 1);
addEventListener(Event.ENTER_FRAME, rappel);
Hud.gotoAndStop("rope");
removeEventListener(Event.ENTER_FRAME, rappel);
player.tilt = 0;
player.y = 16;
sBox.z = 0;
sfxChannel01.stop();
sfxChannel01 = sfxElevatorEnd.play();
addEventListener(Event.ENTER_FRAME, enterFrameHandler);
stg.addEventListener(MouseEvent.MOUSE_DOWN, gunShot);
vcChannel = chem01.play();
setVolume(7, vcChannel);
vcChannel.stop();
musicChannel01.stop();
musicChannel01 = sound.play(0, 9999);
Hud.gotoAndStop("playing");
Hud.reticule.alpha = 1;
loadChapter(chapter);
if (chapter > 2){
Hud.hudhealth.healthmask.scaleX = 1;
};
}
private function optClick(_arg1:MouseEvent):void{
if (Hud.currentLabel == "splash"){
Tweener.addTween(player, {z:-108000, time:2, transition:"easeInOutBack"});
xmin = -172;
xmax = 172;
zmin = -70256;
zmax = -69332;
Hud.gotoAndStop("menu");
} else {
if (Hud.currentLabel == "menu"){
if ((((chapter == 1)) || ((chapter == 2)))){
createMediPrison(0x0600, 1256, (shp.z + 0x0300));
} else {
medipoid = createMedipoid(0, 2000, (shp.z - 1700), 0.4, g, "med1");
mediAlive = true;
medicate = false;
};
rooftop();
} else {
if (Hud.currentLabel == "intro"){
doneIntro();
} else {
if (Hud.currentLabel == "rope"){
removeEventListener(Event.ENTER_FRAME, rappel);
player.tilt = 0;
player.y = 16;
sBox.z = 0;
sfxChannel01.stop();
sfxChannel01 = sfxElevatorEnd.play();
Hud.gotoAndStop("playing");
vcChannel = chem01.play();
setVolume(7, vcChannel);
vcChannel.stop();
musicChannel01.stop();
musicChannel01 = sound.play(0, 9999);
stg.addEventListener(MouseEvent.MOUSE_DOWN, gunShot);
loadChapter(chapter);
addEventListener(Event.ENTER_FRAME, enterFrameHandler);
};
};
};
};
}
private function clickMedipoid(_arg1:MouseEvent):void{
if (mediAlive == true){
still = true;
medicate = true;
medipoid.shoot();
};
}
private function zoomout():void{
Hud.btHelp.visible = true;
Hud.crosshairs.alpha = 0;
Hud.gunFlash.alpha = 1;
gSen = oSen;
Tweener.addTween(camera, {fov:kFov, time:1, transition:"easeOutExpo"});
}
private function killHiko(_arg1:Event):void{
Hud.blok.alpha = 1;
removeEventListener(Event.ENTER_FRAME, enterRoof);
Hud.quote.play();
xmin = -172;
xmax = 172;
zmin = -70256;
zmax = -69332;
player.x = 0;
player.tilt = 0;
player.y = 16;
player.z = -70256;
player.pan = 0;
addEventListener(Event.ENTER_FRAME, loopSplash);
pt1.setPosition(0, -40, (shp.z - 0x0800));
pt2.setPosition(0, -40, (shp.z - 0x0600));
pt3.setPosition(-1024, 7960, shp.z);
pt4.setPosition(-512, 7960, shp.z);
pt4.appearance = new Appearance(matChem01);
pt4.pan = 0;
pt4.roll = 0;
spot1.setPosition(-200, 0, (shp.z - 1400));
spot2.setPosition(200, 0, (shp.z - 1400));
spot3.setPosition(-400, 0, (shp.z - 600));
spot4.setPosition(400, 0, (shp.z - 600));
videoRim.setPosition(200, 1960, (shp.z - 1312));
videoScreen.setPosition(200, 1960, (shp.z - 1312));
videoScreen.pan = 180;
videoRim.pan = 180;
}
private function changeSprite(_arg1:String):void{
var _local2:int;
var _local3:Bitmap;
var _local4:*;
_local2 = 1;
while (_local2 < covernum) {
_local4 = g.getChildByName(("cv" + _local2));
if (_arg1 == "chemicoy"){
_local3 = new Bitmap(new ChemicoyBot(0, 0));
};
if (_arg1 == "energy"){
_local3 = new Bitmap(new WarpPic(0, 0));
_local4.scale = 0.2;
};
if (_arg1 == "space"){
if (_local2 < 8){
_local3 = new Bitmap(new Ast01(0, 0));
} else {
if ((((_local2 > 7)) && ((_local2 < 15)))){
_local3 = new Bitmap(new Ast02(0, 0));
} else {
_local3 = new Bitmap(new Ast03(0, 0));
};
};
_local4.scale = 1;
};
if (_arg1 == "debris"){
if (_local2 < 8){
_local3 = new Bitmap(new Ast01(0, 0));
} else {
if ((((_local2 > 7)) && ((_local2 < 15)))){
_local3 = new Bitmap(new Ast02(0, 0));
} else {
_local3 = new Bitmap(new Ast03(0, 0));
};
};
_local4.scale = 2;
};
if (_arg1 == "dust"){
_local3 = new Bitmap(new Dust(0, 0));
_local4.scale = 2;
};
_local4.content = _local3;
_local2++;
};
}
private function killEnemy(_arg1):void{
bongsound();
_arg1.death();
_arg1.alive = false;
killed = (killed + 1);
if (killed == 6){
if (chapter == 8){
award(5, "SURF SHOOTER : Silver award", "You have defeated the chemicops");
musicChannel01.stop();
chapter = 9;
absZ = 0;
camera.fov = kFov;
Hud.crosshairs.alpha = 0;
gSen = oSen;
loadChapter(chapter);
};
};
}
public function healPlayer():void{
Hud.hudhealth.healthmask.scaleX = (Hud.hudhealth.healthmask.scaleX + 0.05);
if (Hud.hudhealth.healthmask.scaleX > 1){
Hud.hudhealth.healthmask.scaleX = 1;
};
}
private function enemyHit(_arg1:BubbleEvent):void{
var _local2:Enemy;
var _local3:Number;
if (boss1 == false){
_local2 = (_arg1.target as Enemy);
if (_local2.hp > 0){
_local2.hp = (_local2.hp - 1);
_local3 = ((1 / _local2.hpt) * _local2.hp);
Hud.reticule.threatBar.scaleY = _local3;
_local2.shot();
Hud.healthbar.scaleX = (Hud.healthbar.scaleX - 0.1);
};
if (_local2.hp == 0){
killEnemy(_arg1.target);
};
};
}
function goGuide(_arg1:MouseEvent):void{
var _local2:String;
var _local3:URLRequest;
_local2 = "http://www.protopop.com/games/andagel/gameguide/";
_local3 = new URLRequest(_local2);
navigateToURL(_local3, "_blank");
}
private function sideSprite():void{
var _local1:int;
var _local2:*;
_local1 = 1;
for (;_local1 < covernum;if ((shp.z - _local2.z) > 20000){
if (Math.floor((Math.random() * 10)) > 5){
_local2.x = ((target.x + (Math.random() * 12000)) + 2600);
} else {
_local2.x = (target.x - ((Math.random() * 8000) + 2600));
};
_local2.y = 1400;
if ((_local2.scale == 20)){
_local2.y = -1000;
} else {
_local2.y = 500;
};
_local2.setBoundingSphereRadius(0x0200);
_local2.rotateY = 0;
_local2.container.alpha = 0.4;
_local2.z = (target.z + (16000 + (Math.random() * 16000)));
}, _local1++) {
_local2 = g.getChildByName(("cv" + _local1));
if ((_local2.container.alpha < 1)){
_local2.container.alpha = (_local2.container.alpha + 0.2);
continue;
};
};
}
private function mouseFaster(_arg1:MouseEvent):void{
if (oSen < 2){
oSen = (oSen + 0.1);
gSen = oSen;
};
mouseIcon();
}
private function tornado(_arg1, _arg2, _arg3):void{
var _local4:int;
var _local5:*;
_local4 = 1;
for (;_local4 < covernum;_local5.moveForward(4), if ((((Math.abs((_local5.z - _arg3)) > 100)) || ((Math.abs((_local5.x - _arg1)) > 100)))){
_local5.rotateX = (Math.random() * 300);
_local5.rotateY = (Math.random() * 300);
_local5.container.alpha = 0.4;
_local5.z = _arg3;
_local5.x = _arg1;
_local5.y = _arg2;
}, _local4++) {
_local5 = g.getChildByName(("cv" + _local4));
_local5.scale = 0.1;
if ((_local5.container.alpha < 1)){
_local5.container.alpha = (_local5.container.alpha + 0.2);
continue;
};
};
}
private function offMedipoid(_arg1:MouseEvent):void{
if (mediAlive == true){
still = false;
medicate = false;
medipoid.stopFeed();
};
}
private function onTargetClose(_arg1:BubbleEvent):void{
var _local2:Sprite2D;
_local2 = (_arg1.target as Sprite2D);
if ((((Math.abs((_local2.x - player.x)) < 100)) && ((Math.abs((_local2.z - player.z)) < 100)))){
Hud.reticule.gotoAndStop(3);
};
}
private function onTurret(_arg1:BubbleEvent):void{
var _local2:Turret;
var _local3:Number;
Hud.reticule.threatBar.visible = true;
Hud.reticule.gotoAndStop("threat");
_local2 = (_arg1.target as Turret);
if (_local2.hp > 0){
_local3 = ((1 / _local2.hpt) * _local2.hp);
Hud.reticule.threatBar.scaleY = _local3;
};
}
private function enterRoof(_arg1:Event):void{
var _local2:*;
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;
_local2 = Math.random();
videoRim.container.alpha = _local2;
_local3 = (stage.mouseX - 300);
_local4 = (stage.mouseY - 200);
_local5 = (_local3 * 0.01);
absA = ((absA + _local5) % 180);
_local6 = (((_local3 * 0.01) * gSen) * 2);
_local7 = ((_local6 * Math.abs(_local6)) * 0.1);
player.rotateAxis(0, 1, 0, _local7);
_local8 = (((_local4 * 0.01) * gSen) * 2.5);
_local9 = ((_local8 * Math.abs(_local8)) * 0.1);
player.tilt = (player.tilt + _local9);
if (roofwalk == true){
gunman.lookAt(player.x, player.y, player.z);
if ((gunTalk2 == false)){
gunman.moveForward(3);
//unresolved jump
};
xmax = (gunman.x - 64);
if (gunman.x < -512){
if (gunTalk == false){
gunTalk = true;
Hud.hand.play();
sfxChannel02 = saveus.play();
setVolume(2, sfxChannel02);
};
};
if (gunman.x < -1424){
if (gunTalk2 == false){
gunTalk2 = true;
letterbox(true);
sfxChannel02 = money.play();
setVolume(2, sfxChannel02);
sfxChannel02.addEventListener(Event.SOUND_COMPLETE, killHiko);
};
};
player.moveHorizontally((pSpdZ * freeze));
jiggle = (jiggle + (((Math.abs(pSpdZ) * jigd) * 3) + ((Math.abs(pSpdX) * jigd) * 3)));
if (jiggle > 100){
jigd = -1;
};
if (jiggle < -10){
jigd = 1;
};
player.moveSideways((pSpdX * freeze));
_local10 = (jiggle * 0.01);
camera.y = (12 + _local10);
camera.x = (-5 + _local10);
} else {
this.x = (this.y = ((Math.random() * 40) * (Math.random() - 0.5)));
player.z = pt1.z;
jiggle = (jiggle + (((Math.abs(6) * jigd) * 3) + ((Math.abs(6) * jigd) * 3)));
if (jiggle > 100){
jigd = -1;
};
if (jiggle < -10){
jigd = 1;
};
_local11 = (jiggle * 0.01);
camera.y = (12 + _local11);
camera.x = (-5 + _local11);
};
bindPlayer();
flySprite();
pTiltMin = 10;
pTiltMax = -80;
if ((player.tilt > pTiltMin)){
player.tilt = pTiltMin;
//unresolved jump
};
if ((player.tilt < pTiltMax)){
player.tilt = pTiltMax;
//unresolved jump
};
scene.render();
}
private function createTextures():void{
skyC1 = bitmapTexture(new SkyChemicoy01(0, 0), 0);
skyC5 = bitmapTexture(new SkyChemicoy05(0, 0), 0);
skyJ1 = bitmapTexture(new SkyDarkset01(0, 0), 0);
skyJ2 = bitmapTexture(new SkyDarkset02(0, 0), 0);
skyJ3 = bitmapTexture(new SkyDarkset03(0, 0), 0);
skyJ4 = bitmapTexture(new SkyDarkset04(0, 0), 0);
skyJ5 = bitmapTexture(new SkyDarkset05(0, 0), 0);
skyP1 = bitmapTexture(new SkySpace01(0, 0), 0);
skyP2 = bitmapTexture(new SkySpace02(0, 0), 0);
skyP3 = bitmapTexture(new SkySpace03(0, 0), 0);
skyP4 = bitmapTexture(new SkySpace04(0, 0), 0);
skyP5 = bitmapTexture(new SkySpace05(0, 0), 0);
skyR1 = bitmapTexture(new SkyRoof01(0, 0), 0);
skyR2 = bitmapTexture(new SkyRoof02(0, 0), 0);
skyR3 = bitmapTexture(new SkyRoof03(0, 0), 0);
skyR4 = bitmapTexture(new SkyRoof04(0, 0), 0);
skyR5 = bitmapTexture(new SkyRoof05(0, 0), 0);
skyR6 = bitmapTexture(new SkyRoof06(0, 0), 0);
matGate = bitmapTexture(new Gate(0, 0), 0);
matPoster = bitmapTexture(new ChemPoster(0, 0), 0);
matUnder = bitmapTexture(new HoverUnder(0, 0), 0);
matRim = bitmapTexture(new VideoRim(0, 0), 0);
matArrow = bitmapTexture(new GoldenArrow(0, 0), 0);
matLevel1 = bitmapTexture(new Level1(0, 0), 0);
matLevel2 = bitmapTexture(new Level2(0, 0), 0);
matLevel3 = bitmapTexture(new Level3(0, 0), 0);
matLevel4 = bitmapTexture(new Level4(0, 0), 0);
mtBomb = bitmapTexture(new Bomb(0, 0), 0);
mtRoofwall = bitmapTexture(new RoofWall(0, 0), 0);
mtRooffloor = bitmapTexture(new RoofFloor(0, 0), 0);
mtp62 = bitmapTexture(new TxGround(0, 0), 0);
matHv01 = bitmapTexture(new MatHover01(0, 0), 0);
matChem01 = bitmapTexture(new ChemCat01(0, 0), 0);
matElevator = bitmapTexture(new MatElevator(0, 0), 0);
matFan = bitmapTexture(new MatFan(0, 0), 0);
matForce = bitmapTexture(new Forcefield(0, 0), 0);
spotLight = bitmapTexture(new Spotlight(0, 0), 0);
chemWall = bitmapTexture(new ChemWall(0, 0), 0);
mo01 = bitmapTexture(new Mountain01(0, 0), 0);
moSu01 = bitmapTexture(new MountainSunset01(0, 0), 0);
tiSu01 = bitmapTexture(new TileSunset01(0, 0), 0);
meSu01 = bitmapTexture(new MesaSunset01(0, 0), 0);
fxEnBe = bitmapTexture(new EnergyBeam(0, 0), 0);
aniMaterial = new MovieMaterial(animated, 40);
bossChem = bitmapTexture(new bossMat(0, 0), 0);
bossHeadmat = bitmapTexture(new bossHead(0, 0), 0);
bossArmsmat = bitmapTexture(new bossArms(0, 0), 0);
bossShield = bitmapTexture(new Shield(0, 0), 0);
pipeFront = bitmapTexture(new PipeFront(0, 0), 0);
pipeBack = bitmapTexture(new PipeBack(0, 0), 0);
}
private function letterbox(_arg1:Boolean):void{
if (_arg1 == true){
Tweener.addTween(Hud.barTop, {x:320, y:40, time:2, transition:"easeOutExpo"});
Tweener.addTween(Hud.barBottom, {x:320, y:440, time:2, transition:"easeOutExpo"});
} else {
Tweener.addTween(Hud.barTop, {x:320, y:-50, time:2, transition:"easeOutExpo"});
Tweener.addTween(Hud.barBottom, {x:320, y:540, time:2, transition:"easeOutExpo"});
};
}
private function raise(_arg1:BubbleEvent):void{
var gr:Sprite2D;
var evt = _arg1;
sniperCam = 34;
zoomout();
gr = (evt.target as Sprite2D);
if ((((Math.abs((gr.x - player.x)) < 100)) && ((Math.abs((gr.z - player.z)) < 100)))){
freeze = 0;
gr.visible = false;
gr.y = -2048;
changeZone(gr.name);
r2.x = gr.x;
r2.z = gr.z;
player.swapParent(lift);
player.y = 16;
sfxChannel01 = sfxElevatorLoop.play(0, 9999);
sfxChannel02 = sfxElevatorEnd.play();
rumble = true;
Hud.btHelp.visible = false;
Tweener.addTween(lift, {y:liftHeight, time:20, transition:"linear", onComplete:function (){
Hud.btHelp.visible = true;
freeze = 1;
sfxChannel01.stop();
sfxChannel01 = sfxElevatorEnd.play();
player.swapParent(g);
letterbox(false);
player.y = (lift.y + 16);
rumble = false;
if ((gr.name == "comp31")){
resetChemicops();
//unresolved jump
};
}});
};
}
private function onMedipoid(_arg1:BubbleEvent):void{
Hud.reticule.threatBar.visible = true;
Hud.reticule.gotoAndStop("threat");
}
}
}//package
Section 162
//Gate (Gate)
package {
import flash.display.*;
public dynamic class Gate extends BitmapData {
public function Gate(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 163
//GoldenArrow (GoldenArrow)
package {
import flash.display.*;
public dynamic class GoldenArrow extends BitmapData {
public function GoldenArrow(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 164
//Grapple (Grapple)
package {
import flash.display.*;
public dynamic class Grapple extends BitmapData {
public function Grapple(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 165
//Gravity01 (Gravity01)
package {
import flash.media.*;
public dynamic class Gravity01 extends Sound {
}
}//package
Section 166
//GuardDeath (GuardDeath)
package {
import flash.display.*;
public dynamic class GuardDeath extends MovieClip {
public function GuardDeath(){
addFrameScript(159, frame160);
}
function frame160(){
stop();
}
}
}//package
Section 167
//GuardJump (GuardJump)
package {
import flash.display.*;
public dynamic class GuardJump extends MovieClip {
}
}//package
Section 168
//GuardShoot (GuardShoot)
package {
import flash.display.*;
public dynamic class GuardShoot extends MovieClip {
public function GuardShoot(){
addFrameScript(0, frame1, 14, frame15);
}
function frame15(){
stop();
}
function frame1(){
stop();
}
}
}//package
Section 169
//GuardShot (GuardShot)
package {
import flash.display.*;
public dynamic class GuardShot extends BitmapData {
public function GuardShot(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 170
//Gun01 (Gun01)
package {
import flash.media.*;
public dynamic class Gun01 extends Sound {
}
}//package
Section 171
//HeightmapPlateau01 (HeightmapPlateau01)
package {
import flash.display.*;
public dynamic class HeightmapPlateau01 extends BitmapData {
public function HeightmapPlateau01(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 172
//HmValleyhome (HmValleyhome)
package {
import flash.display.*;
public dynamic class HmValleyhome extends BitmapData {
public function HmValleyhome(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 173
//HoverUnder (HoverUnder)
package {
import flash.display.*;
public dynamic class HoverUnder extends BitmapData {
public function HoverUnder(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 174
//Level1 (Level1)
package {
import flash.display.*;
public dynamic class Level1 extends BitmapData {
public function Level1(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 175
//Level2 (Level2)
package {
import flash.display.*;
public dynamic class Level2 extends BitmapData {
public function Level2(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 176
//Level3 (Level3)
package {
import flash.display.*;
public dynamic class Level3 extends BitmapData {
public function Level3(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 177
//Level4 (Level4)
package {
import flash.display.*;
public dynamic class Level4 extends BitmapData {
public function Level4(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 178
//Lg (Lg)
package {
import flash.display.*;
public dynamic class Lg extends MovieClip {
}
}//package
Section 179
//Man (Man)
package {
import flash.display.*;
public dynamic class Man extends MovieClip {
}
}//package
Section 180
//MatElevator (MatElevator)
package {
import flash.display.*;
public dynamic class MatElevator extends BitmapData {
public function MatElevator(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 181
//MatFan (MatFan)
package {
import flash.display.*;
public dynamic class MatFan extends BitmapData {
public function MatFan(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 182
//MatHover01 (MatHover01)
package {
import flash.display.*;
public dynamic class MatHover01 extends BitmapData {
public function MatHover01(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 183
//MediFeed (MediFeed)
package {
import flash.display.*;
public dynamic class MediFeed extends BitmapData {
public function MediFeed(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 184
//Medipoid (Medipoid)
package {
import flash.events.*;
import caurina.transitions.*;
import sandy.core.scenegraph.*;
import flash.display.*;
public class Medipoid extends Sprite2D {
public var thisTarget;
private var txFeed:Bitmap;
public var spd:Number;// = 0
public var laser:Sprite2D;
private var stand;
public var avhp;
public function Medipoid(_arg1, _arg2){
spd = 0;
txFeed = new Bitmap(new MediFeed(0, 0));
stand = new Bitmap(new MediPoid(0, 0));
super(_arg1, stand, _arg2);
}
public function feed():void{
content = txFeed;
shoot();
}
public function shoot():void{
var px:Number;
var py:Number;
var pz:Number;
content = txFeed;
laser.visible = true;
laser.setPosition(x, y, z);
px = thisTarget.x;
py = (thisTarget.y + 12);
pz = (thisTarget.z + (avhp.speed * 16));
Tweener.addTween(laser, {x:px, y:py, z:pz, time:0.5, transition:"linear", onComplete:function (){
hitPlayer();
shoot();
}});
}
public function shotSize(_arg1:int):void{
laser.scale = _arg1;
}
private function hitPlayer():void{
laser.visible = false;
avhp.healPlayer();
}
public function stopFeed():void{
content = stand;
Tweener.removeTweens(laser);
laser.visible = false;
laser.setPosition(x, y, z);
}
}
}//package
Section 185
//MediPoid (MediPoid)
package {
import flash.display.*;
public dynamic class MediPoid extends BitmapData {
public function MediPoid(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 186
//MediPower (MediPower)
package {
import flash.display.*;
public dynamic class MediPower extends BitmapData {
public function MediPower(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 187
//Mesa (Mesa)
package {
import flash.display.*;
public dynamic class Mesa extends BitmapData {
public function Mesa(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 188
//Mesa01 (Mesa01)
package {
import flash.display.*;
public dynamic class Mesa01 extends BitmapData {
public function Mesa01(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 189
//MesaSunset01 (MesaSunset01)
package {
import flash.display.*;
public dynamic class MesaSunset01 extends BitmapData {
public function MesaSunset01(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 190
//MochiBot (MochiBot)
package {
import flash.display.*;
import flash.net.*;
import flash.system.*;
public dynamic class MochiBot extends Sprite {
public static function track(_arg1:Sprite, _arg2:String):MochiBot{
var _local3:MochiBot;
var _local4:String;
var _local5:URLVariables;
var _local6:String;
var _local7:URLRequest;
var _local8:Loader;
if (Security.sandboxType == "localWithFile"){
return (null);
};
_local3 = new (MochiBot);
_arg1.addChild(_local3);
Security.allowDomain("*");
Security.allowInsecureDomain("*");
_local4 = "http://core.mochibot.com/my/core.swf";
_local5 = new URLVariables();
_local5["sb"] = Security.sandboxType;
_local5["v"] = Capabilities.version;
_local5["swfid"] = _arg2;
_local5["mv"] = "8";
_local5["fv"] = "9";
_local6 = _local3.root.loaderInfo.loaderURL;
if (_local6.indexOf("http") == 0){
_local5["url"] = _local6;
} else {
_local5["url"] = "local";
};
_local7 = new URLRequest(_local4);
_local7.contentType = "application/x-www-form-urlencoded";
_local7.method = URLRequestMethod.POST;
_local7.data = _local5;
_local8 = new Loader();
_local3.addChild(_local8);
_local8.load(_local7);
return (_local3);
}
}
}//package
Section 191
//Money (Money)
package {
import flash.media.*;
public dynamic class Money extends Sound {
}
}//package
Section 192
//Mountain01 (Mountain01)
package {
import flash.display.*;
public dynamic class Mountain01 extends BitmapData {
public function Mountain01(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 193
//MountainSunset01 (MountainSunset01)
package {
import flash.display.*;
public dynamic class MountainSunset01 extends BitmapData {
public function MountainSunset01(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 194
//MusicChase (MusicChase)
package {
import flash.media.*;
public dynamic class MusicChase extends Sound {
}
}//package
Section 195
//MusicSad (MusicSad)
package {
import flash.media.*;
public dynamic class MusicSad extends Sound {
}
}//package
Section 196
//NewgroundsAPI (NewgroundsAPI)
package {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.net.*;
public class NewgroundsAPI {
public static const ADS_APPROVED:Number = 3;
public static const bridge:Sprite = new Sprite();
private static const STAT_NEW_VERSION:Number = 4;
private static const STAT_AUTHOR_SITE:Number = 2;
private static const GATEWAY_URL:String = "http://www.ngads.com/gateway.php";
private static const NEWGROUNDS_URL:String = "http://www.newgrounds.com";
private static const STAT_CUSTOM_STATS:Number = 50;
private static const STAT_MOVIE_VIEWS:Number = 1;
private static const STAT_NEWGROUNDS:Number = 3;
public static const NEW_VERSION:Number = 2;
public static const DENY_HOST:Number = 1;
private static var tracker_id:Number;
private static var movie_options:Object = new Object();
private static var connected:Boolean;
private static var custom_events:Object = new Object();
private static var host:String;
private static var linked:Boolean;
private static var events:Object = new Object();
private static var debug:Boolean;
private static var version:String;
private static var custom_links:Object = new Object();
public static function getNewVersionURL(){
return (((((((GATEWAY_URL + "?&id=") + tracker_id) + "&host=") + escape(host)) + "&stat=") + STAT_NEW_VERSION));
}
private static function ReadGatewayData(_arg1:Object){
var _local2:*;
var _local3:String;
var _local4:*;
var _local5:URLLoader;
for (_local2 in _arg1) {
_arg1[_local2] = unescape(_arg1[_local2]);
movie_options[_local2] = _arg1[_local2];
};
if (_arg1["settings_loaded"]){
SendMessage("You have successfully connected to the Newgrounds API gateway!");
SendMessage((("Movie Identified as '" + movie_options["movie_name"]) + "'"));
if (movie_options["message"]){
SendMessage(movie_options["message"]);
};
if (movie_options["ad_url"]){
SendMessage("Your movie has been approved to run Flash Ads");
if (events[ADS_APPROVED]){
var _local6 = events;
_local6[ADS_APPROVED](movie_options["ad_url"]);
} else {
onAdsApproved(movie_options["ad_url"]);
};
};
if (((movie_options["movie_version"]) && (!((String(movie_options["movie_version"]) == String(version)))))){
SendMessage("WARNING: The movie version configured in your API settings does not match this movie's version!");
if (events[NEW_VERSION]){
_local6 = events;
_local6[NEW_VERSION]({version:movie_options["movie_version"], real_url:getMovieURL(), redirect_url:getNewVersionURL()});
} else {
onNewVersionAvailable(movie_options["movie_version"], getMovieURL(), getNewVersionURL());
};
};
if (movie_options["deny_host"]){
SendMessage("You have blocked 'localHost' in your API settings.");
SendMessage("If you wish to test your movie you will need to remove this block.");
if (events[DENY_HOST]){
_local6 = events;
_local6[DENY_HOST]({host:host, real_url:getMovieURL(), redirect_url:getNewVersionURL()});
} else {
onDenyHost(host, getMovieURL(), getNewVersionURL());
};
};
if (movie_options["request_portal_url"]){
_local3 = bridge.root.loaderInfo.url;
_local4 = ((((GATEWAY_URL + "?&id=") + tracker_id) + "&portal_url=") + escape(_local3));
_local5 = new URLLoader(new URLRequest(_local4));
};
if (events[69]){
_local6 = events;
_local6[69]();
};
} else {
if (!movie_options["settings_loaded"]){
SendError("Could not establish connection to the API gateway.");
};
};
}
public static function setMovieVersion(_arg1){
if (!_arg1){
SendError("Missing required 'version' in NewgroundsAPI.setMovieVersion(version:String)");
} else {
version = String(_arg1);
};
}
public static function loadCustomLink(_arg1:String){
if (!_arg1){
SendError("Missing required 'link_name' parameter in NewgroundsAPI.loadCustomLink(link_name:String)");
} else {
if (!custom_links[_arg1]){
SendError(("Attempted to open undefined custom link: " + _arg1));
} else {
SendLink(custom_links[_arg1]);
};
};
}
public static function addCustomLink(_arg1:Number, _arg2:String){
if (!_arg1){
SendError("Missing required 'id' parameter in NewgroundsAPI.AddCustomLink(id:Number, link_name:String)");
} else {
if (!_arg2){
SendError("Missing required 'link_name' parameter in NewgroundsAPI.AddCustomLink(id:Number, link_name:String)");
} else {
custom_links[_arg2] = (STAT_CUSTOM_STATS + _arg1);
SendMessage(((("Created custom link " + _arg1) + ": ") + _arg2));
};
};
}
public static function getMovieURL(){
if (movie_options["movie_url"]){
return (movie_options["movie_url"]);
};
return ("Newgrounds.com");
}
public static function debugMode(){
debug = true;
}
public static function getAdURL(){
return (movie_options["ad_url"]);
}
private static function SendStat(_arg1:Number, _arg2:Boolean, _arg3=null){
var target_url:*;
var XML_Loaded:Function;
var x:*;
var request:URLRequest;
var gateway_loader:URLLoader;
var stat_id = _arg1;
var open_in_browser = _arg2;
var extra = _arg3;
if (!tracker_id){
SendError("You must call NewgroundsAPI.connectMovie() with a valid movie id before using API features!");
} else {
XML_Loaded = function (_arg1:Event){
var _local2:XML;
var _local3:Object;
var _local4:XMLList;
var _local5:XML;
var _local6:*;
var _local7:*;
XML.ignoreWhitespace = true;
_local2 = XML(_arg1.target.data);
_local3 = new Object();
_local4 = _local2.children();
for each (_local5 in _local4) {
_local6 = _local5.localName();
_local7 = _local5.attribute("value");
if (_local7 == Number(_local7)){
_local7 = Number(_local7);
};
_local3[_local6] = _local7;
};
ReadGatewayData(_local3);
};
target_url = (((((((GATEWAY_URL + "?&id=") + tracker_id) + "&host=") + escape(host)) + "&stat=") + stat_id) + addSeed());
if (extra){
for (x in extra) {
target_url = (target_url + ((("&" + escape(x)) + "=") + escape(extra[x])));
};
};
if (debug){
target_url = (target_url + "&debug=1");
};
if (open_in_browser){
request = new URLRequest((target_url + addSeed()));
navigateToURL(request, "_blank");
} else {
gateway_loader = new URLLoader(new URLRequest((target_url + addSeed())));
gateway_loader.addEventListener(Event.COMPLETE, XML_Loaded);
};
};
}
public static function onAdsApproved(_arg1:String){
}
public static function loadMySite(_arg1:Event=null){
SendLink(STAT_AUTHOR_SITE);
}
private static function SendMessage(_arg1:String){
}
public static function linkAPI(_arg1){
_arg1.addChild(bridge);
linked = true;
}
public static function loadNewgrounds(_arg1:Event=null, _arg2:String=null){
var _local3:URLRequest;
var _local4:*;
if (!tracker_id){
_local3 = new URLRequest(((NEWGROUNDS_URL + "/") + _arg2));
navigateToURL(_local3, "_blank");
} else {
_local4 = null;
if (_arg2){
_local4 = new Object();
_local4.page = _arg2;
};
SendLink(STAT_NEWGROUNDS, _local4);
};
}
private static function SendLink(_arg1, _arg2=null){
SendStat(_arg1, true, _arg2);
}
public static function logCustomEvent(_arg1:String){
if (!_arg1){
SendError("Missing required 'event_name' parameter in NewgroundsAPI.logCustomEvent(event_name:String)");
} else {
if (!custom_events[_arg1]){
SendError(("Attempted to log undefined custom event: " + _arg1));
} else {
SendEvent(custom_events[_arg1]);
};
};
}
private static function SendError(_arg1:String){
}
public static function addCustomEvent(_arg1:Number, _arg2:String){
if (!_arg1){
SendError("Missing required 'id' parameter in NewgroundsAPI.AddCustomEvent(id:Number, event_name:String)");
} else {
if (!_arg2){
SendError("Missing required 'event_name' parameter in NewgroundsAPI.AddCustomEvent(id:Number, event_name:String)");
} else {
custom_events[_arg2] = (STAT_CUSTOM_STATS + _arg1);
SendMessage(("Created custom event: " + _arg2));
};
};
}
private static function addSeed(){
return (("&seed=" + Math.random()));
}
public static function addEventListener(_arg1:Number, _arg2:Function){
events[_arg1] = _arg2;
}
private static function SendEvent(_arg1){
SendStat(_arg1, false);
}
public static function onNewVersionAvailable(_arg1:String, _arg2:String, _arg3:String){
var sw:*;
var sh:*;
var tw:*;
var th:*;
var mg:*;
var _root:*;
var overlay:MovieClip;
var overlay_x:*;
var overlay_y:*;
var close_x:*;
var blankarea:TextField;
var header:TextField;
var header_format:TextFormat;
var msgtext:TextField;
var msgtext_format:TextFormat;
var msgtext_link:TextFormat;
var version = _arg1;
var movie_url = _arg2;
var redirect_url = _arg3;
sw = bridge.stage.stageWidth;
sh = bridge.stage.stageHeight;
tw = 350;
th = 160;
mg = 20;
_root = bridge.root;
overlay = new MovieClip();
overlay.graphics.beginFill(0, 0.6);
overlay.graphics.lineStyle(0, 0);
overlay.graphics.drawRect(0, 0, sw, sh);
overlay.graphics.endFill();
overlay_x = Math.round(((sw - tw) / 2));
overlay_y = Math.round(((sh - th) / 2));
overlay.graphics.beginFill(102);
overlay.graphics.lineStyle(10, 0);
overlay.graphics.drawRect((overlay_x - mg), (overlay_y - mg), (tw + mg), (th + mg));
overlay.graphics.endFill();
overlay.close = function (_arg1:Event){
_root.removeChild(overlay);
};
close_x = new MovieClip();
close_x.graphics.beginFill(0, 0.1);
close_x.graphics.lineStyle(3, 22015);
close_x.graphics.drawRect(0, 0, 16, 16);
close_x.graphics.endFill();
close_x.graphics.moveTo(4, 4);
close_x.graphics.lineTo(13, 13);
close_x.graphics.moveTo(13, 4);
close_x.graphics.lineTo(4, 13);
close_x.x = ((overlay_x + tw) - 26);
close_x.y = (overlay_y - 10);
close_x.addEventListener(MouseEvent.CLICK, overlay.close);
blankarea = new TextField();
blankarea.x = (overlay_x - mg);
blankarea.y = (overlay_y - mg);
blankarea.width = (tw + mg);
blankarea.height = (th + mg);
blankarea.selectable = false;
header = new TextField();
header.width = tw;
header.x = overlay_x;
header.y = overlay_y;
header.height = 100;
header.selectable = false;
header_format = new TextFormat();
header_format.font = "Arial Black";
header_format.color = 0xFFFFFF;
header_format.size = 20;
header.defaultTextFormat = header_format;
header.text = "New Version Available!";
msgtext = new TextField();
msgtext.x = overlay_x;
msgtext.y = (overlay_y + 70);
msgtext.width = tw;
msgtext.height = 60;
msgtext.selectable = false;
msgtext_format = new TextFormat();
msgtext_format.font = "Arial";
msgtext_format.color = 0xFFFFFF;
msgtext_format.size = 12;
msgtext_format.bold = true;
msgtext_link = new TextFormat();
msgtext_link.font = "Arial";
msgtext_link.color = 0xFFFF00;
msgtext_link.size = 12;
msgtext_link.bold = true;
msgtext_link.url = redirect_url;
msgtext_link.target = "_blank";
if (version){
version = ("Version " + version);
} else {
version = "A new version";
};
msgtext.defaultTextFormat = msgtext_format;
msgtext.appendText((version + " is now available"));
if (movie_url){
msgtext.appendText(" at:\n");
msgtext.defaultTextFormat = msgtext_link;
msgtext.appendText(movie_url);
} else {
msgtext.appendText("!");
};
_root.addChild(overlay);
overlay.addChild(blankarea);
overlay.addChild(header);
overlay.addChild(msgtext);
overlay.addChild(close_x);
}
public static function onDenyHost(_arg1:String, _arg2:String, _arg3:String){
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:MovieClip;
var _local10:TextField;
var _local11:TextField;
var _local12:TextFormat;
var _local13:TextField;
var _local14:TextFormat;
var _local15:TextFormat;
_local4 = bridge.stage.stageWidth;
_local5 = bridge.stage.stageHeight;
_local6 = 350;
_local7 = 160;
_local8 = bridge.root;
_local9 = new MovieClip();
_local9.graphics.beginFill(0x660000);
_local9.graphics.lineStyle(20, 0);
_local9.graphics.drawRect(0, 0, _local4, _local5);
_local9.graphics.endFill();
_local10 = new TextField();
_local10.x = 0;
_local10.y = 0;
_local10.width = _local4;
_local10.height = _local5;
_local10.selectable = false;
_local11 = new TextField();
_local11.x = Math.round(((_local4 - _local6) / 2));
_local11.y = Math.round(((_local5 - _local7) / 2.5));
_local11.width = _local6;
_local11.height = 100;
_local11.selectable = false;
_local12 = new TextFormat();
_local12.font = "Arial Black";
_local12.color = 0xFF0000;
_local12.size = 38;
_local11.defaultTextFormat = _local12;
_local11.text = "ERROR!";
_local13 = new TextField();
_local13.x = Math.round(((_local4 - _local6) / 2));
_local13.y = (Math.round(((_local5 - _local7) / 2.5)) + 80);
_local13.width = _local6;
_local13.height = 80;
_local13.selectable = false;
_local14 = new TextFormat();
_local14.font = "Arial";
_local14.color = 0xFFFFFF;
_local14.size = 12;
_local14.bold = true;
_local15 = new TextFormat();
_local15.font = "Arial";
_local15.color = 0xFFFF00;
_local15.size = 12;
_local15.bold = true;
_local15.url = _arg3;
_local15.target = "_blank";
_local13.defaultTextFormat = _local14;
_local13.appendText((("This movie has not been approved for use on " + _arg1) + "\n"));
_local13.appendText("For an approved copy, please visit:\n");
_local13.defaultTextFormat = _local15;
_local13.appendText(_arg2);
_local8.addChild(_local9);
_local9.addChild(_local10);
_local9.addChild(_local11);
_local9.addChild(_local13);
}
public static function connectMovie(_arg1:Number){
var _local2:String;
var _local3:*;
if (!_arg1){
SendError("Missing required 'id' parameter in NewgroundsAPI.connectMovie(id:Number)");
} else {
if (!linked){
SendError("Attempted to call MewgroundsAPI.connectMovie() without first calling NewgroundsAPI.linkAPI(this)");
} else {
if (!tracker_id){
SendMessage("Connecting to API gateway...");
tracker_id = _arg1;
_local2 = bridge.root.loaderInfo.url;
host = _local2.split("/")[2].toLowerCase();
if (host.length < 1){
host = "localhost";
};
_local3 = new Object();
SendEvent(STAT_MOVIE_VIEWS);
};
};
};
}
public static function isInstalled(){
return (true);
}
}
}//package
Section 197
//Nowhere (Nowhere)
package {
import flash.media.*;
public dynamic class Nowhere extends Sound {
}
}//package
Section 198
//Nuclear (Nuclear)
package {
import flash.media.*;
public dynamic class Nuclear extends Sound {
}
}//package
Section 199
//PipeBack (PipeBack)
package {
import flash.display.*;
public dynamic class PipeBack extends BitmapData {
public function PipeBack(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 200
//PipeFront (PipeFront)
package {
import flash.display.*;
public dynamic class PipeFront extends BitmapData {
public function PipeFront(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 201
//PoidEye (PoidEye)
package {
import flash.display.*;
public dynamic class PoidEye extends BitmapData {
public function PoidEye(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 202
//Reward (Reward)
package {
import flash.media.*;
public dynamic class Reward extends Sound {
}
}//package
Section 203
//RoofFloor (RoofFloor)
package {
import flash.display.*;
public dynamic class RoofFloor extends BitmapData {
public function RoofFloor(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 204
//RoofWall (RoofWall)
package {
import flash.display.*;
public dynamic class RoofWall extends BitmapData {
public function RoofWall(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 205
//Rotor (Rotor)
package {
import flash.display.*;
public dynamic class Rotor extends MovieClip {
public function Rotor(){
addFrameScript(0, frame1, 39, frame40);
}
function frame1(){
stop();
}
function frame40(){
stop();
}
}
}//package
Section 206
//SaveUs (SaveUs)
package {
import flash.media.*;
public dynamic class SaveUs extends Sound {
}
}//package
Section 207
//Sheet (Sheet)
package {
import flash.display.*;
public dynamic class Sheet extends MovieClip {
public var lang2:MovieClip;
public var lang3:MovieClip;
public var lang4:MovieClip;
public var lang1:MovieClip;
public function Sheet(){
addFrameScript(0, frame1, 3, frame4, 4, frame5, 5, frame6, 6, frame7);
}
function frame6(){
lang3.gotoAndStop((Math.floor((Math.random() * 3)) + 1));
}
function frame7(){
lang4.gotoAndStop((Math.floor((Math.random() * 4)) + 1));
}
function frame1(){
stop();
}
function frame4(){
lang1.gotoAndStop((Math.floor((Math.random() * 6)) + 1));
}
function frame5(){
lang2.gotoAndStop((Math.floor((Math.random() * 4)) + 1));
}
}
}//package
Section 208
//Shield (Shield)
package {
import flash.display.*;
public dynamic class Shield extends BitmapData {
public function Shield(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 209
//SideSunset01 (SideSunset01)
package {
import flash.display.*;
public dynamic class SideSunset01 extends BitmapData {
public function SideSunset01(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 210
//SkyChemicoy01 (SkyChemicoy01)
package {
import flash.display.*;
public dynamic class SkyChemicoy01 extends BitmapData {
public function SkyChemicoy01(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 211
//SkyChemicoy05 (SkyChemicoy05)
package {
import flash.display.*;
public dynamic class SkyChemicoy05 extends BitmapData {
public function SkyChemicoy05(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 212
//SkyDarkset01 (SkyDarkset01)
package {
import flash.display.*;
public dynamic class SkyDarkset01 extends BitmapData {
public function SkyDarkset01(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 213
//SkyDarkset02 (SkyDarkset02)
package {
import flash.display.*;
public dynamic class SkyDarkset02 extends BitmapData {
public function SkyDarkset02(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 214
//SkyDarkset03 (SkyDarkset03)
package {
import flash.display.*;
public dynamic class SkyDarkset03 extends BitmapData {
public function SkyDarkset03(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 215
//SkyDarkset04 (SkyDarkset04)
package {
import flash.display.*;
public dynamic class SkyDarkset04 extends BitmapData {
public function SkyDarkset04(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 216
//SkyDarkset05 (SkyDarkset05)
package {
import flash.display.*;
public dynamic class SkyDarkset05 extends BitmapData {
public function SkyDarkset05(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 217
//SkyRoof01 (SkyRoof01)
package {
import flash.display.*;
public dynamic class SkyRoof01 extends BitmapData {
public function SkyRoof01(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 218
//SkyRoof02 (SkyRoof02)
package {
import flash.display.*;
public dynamic class SkyRoof02 extends BitmapData {
public function SkyRoof02(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 219
//SkyRoof03 (SkyRoof03)
package {
import flash.display.*;
public dynamic class SkyRoof03 extends BitmapData {
public function SkyRoof03(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 220
//SkyRoof04 (SkyRoof04)
package {
import flash.display.*;
public dynamic class SkyRoof04 extends BitmapData {
public function SkyRoof04(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 221
//SkyRoof05 (SkyRoof05)
package {
import flash.display.*;
public dynamic class SkyRoof05 extends BitmapData {
public function SkyRoof05(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 222
//SkyRoof06 (SkyRoof06)
package {
import flash.display.*;
public dynamic class SkyRoof06 extends BitmapData {
public function SkyRoof06(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 223
//SkySpace01 (SkySpace01)
package {
import flash.display.*;
public dynamic class SkySpace01 extends BitmapData {
public function SkySpace01(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 224
//SkySpace02 (SkySpace02)
package {
import flash.display.*;
public dynamic class SkySpace02 extends BitmapData {
public function SkySpace02(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 225
//SkySpace03 (SkySpace03)
package {
import flash.display.*;
public dynamic class SkySpace03 extends BitmapData {
public function SkySpace03(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 226
//SkySpace04 (SkySpace04)
package {
import flash.display.*;
public dynamic class SkySpace04 extends BitmapData {
public function SkySpace04(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 227
//SkySpace05 (SkySpace05)
package {
import flash.display.*;
public dynamic class SkySpace05 extends BitmapData {
public function SkySpace05(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 228
//SndFinale (SndFinale)
package {
import flash.media.*;
public dynamic class SndFinale extends Sound {
}
}//package
Section 229
//Speeder01 (Speeder01)
package {
import flash.media.*;
public dynamic class Speeder01 extends Sound {
}
}//package
Section 230
//Spotlight (Spotlight)
package {
import flash.display.*;
public dynamic class Spotlight extends BitmapData {
public function Spotlight(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 231
//Stomp (Stomp)
package {
import flash.display.*;
public dynamic class Stomp extends MovieClip {
}
}//package
Section 232
//Strider (Strider)
package {
import caurina.transitions.*;
import sandy.core.scenegraph.*;
import flash.display.*;
public class Strider extends Sprite2D {
public var sidex:Boolean;// = false
var rn:Number;
public var standing:MovieClip;
private var ss:MovieClip;
private var runfront:MovieClip;
private var jumpside:MovieClip;
var hpt:int;
private var jumpfront:MovieClip;
var hold:Number;// = 0.5
var laser:Sprite2D;
var alive:Boolean;// = true
var hp:int;// = 50
private var walking:MovieClip;
public var tlock:Boolean;// = false
var spd:Number;// = 0
var thisTarget;
public var oa:Number;// = 0
public var ox:Number;// = 0
public var oy:Number;// = 0
public var oz:Number;// = 0
public var avhp;
public function Strider(_arg1, _arg2, _arg3){
hp = 50;
hpt = hp;
ox = 0;
oy = 0;
oz = 0;
oa = 0;
tlock = false;
standing = new StriderStand();
walking = new StriderWalk();
runfront = new StriderRunFront();
jumpfront = new StriderJumpFront();
jumpside = new StriderJumpSide();
ss = new StriderSide();
rn = Math.random();
hold = 0.5;
alive = true;
spd = 0;
sidex = false;
super(_arg1, standing, _arg3);
standing.gotoAndStop(1);
}
public function shotSize(_arg1:int):void{
laser.scale = _arg1;
}
public function shoot():void{
var px:Number;
var py:Number;
var pz:Number;
if (alive == true){
if (Tweener.isTweening(laser) == false){
laser.visible = true;
laser.setPosition(x, y, z);
px = thisTarget.x;
py = (thisTarget.y + 12);
pz = (thisTarget.z + (avhp.speed * 16));
avhp.shootsound();
Tweener.addTween(laser, {x:px, y:py, z:pz, time:1, transition:"linear", onComplete:function (){
hitPlayer();
}});
};
Tweener.addTween(this, {time:1, transition:"linear", onComplete:function (){
idle();
}});
};
}
public function jump():void{
ox = (1000 + (Math.random() * 4000));
oz = (1000 + (Math.random() * 4000));
oa = ((Math.random() * 4000) * (Math.random() - 0.5));
}
public function hitPlayer():void{
laser.visible = false;
avhp.damageTest(laser, thisTarget);
}
public function runSide():void{
var _local1:Number;
content = ss;
_local1 = (((Math.random() * 10) * 2) + 1);
ss.gotoAndPlay(Math.floor(_local1));
}
public function die():void{
content = standing;
walking.gotoAndStop(1);
}
public function run():void{
var _local1:Number;
content = runfront;
_local1 = (((Math.random() * 10) * 2) + 1);
runfront.gotoAndPlay(Math.floor(_local1));
}
private function getHp():int{
return (hp);
}
public function shot():void{
}
public function walk():void{
var _local1:Number;
content = walking;
_local1 = (((Math.random() * 10) * 2) + 1);
walking.gotoAndPlay(Math.floor(_local1));
}
public function idle():void{
var dhold:*;
dhold = (Math.random() * 2);
Tweener.addTween(this, {time:hold, transition:"linear", delay:dhold, onComplete:function (){
shoot();
}});
}
}
}//package
Section 233
//StriderJumpFront (StriderJumpFront)
package {
import flash.display.*;
public dynamic class StriderJumpFront extends MovieClip {
public function StriderJumpFront(){
addFrameScript(14, frame15);
}
function frame15(){
stop();
}
}
}//package
Section 234
//StriderJumpSide (StriderJumpSide)
package {
import flash.display.*;
public dynamic class StriderJumpSide extends MovieClip {
public function StriderJumpSide(){
addFrameScript(14, frame15);
}
function frame15(){
stop();
}
}
}//package
Section 235
//StriderRunFront (StriderRunFront)
package {
import flash.display.*;
public dynamic class StriderRunFront extends MovieClip {
}
}//package
Section 236
//StriderSide (StriderSide)
package {
import flash.display.*;
public dynamic class StriderSide extends MovieClip {
}
}//package
Section 237
//StriderStand (StriderStand)
package {
import flash.display.*;
public dynamic class StriderStand extends MovieClip {
public function StriderStand(){
addFrameScript(14, frame15);
}
function frame15(){
stop();
}
}
}//package
Section 238
//StriderWalk (StriderWalk)
package {
import flash.display.*;
public dynamic class StriderWalk extends MovieClip {
public function StriderWalk(){
addFrameScript(0, frame1, 30, frame31);
}
function frame1(){
stop();
}
function frame31(){
gotoAndPlay(2);
}
}
}//package
Section 239
//TerrainCreator2 (TerrainCreator2)
package {
import sandy.core.data.*;
import sandy.core.scenegraph.*;
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
import sandy.primitive.*;
public class TerrainCreator2 extends Plane3D {
public var magnitude:Number;
private var likeCoordinates:Array;
private var quality:int;
private var bitChan:uint;
private var oct:int;
private var height:int;
private var sampleRate:int;
private var seed:int;
public var perlin:BitmapData;
private var a:Array;
private var stitch:Boolean;
private var length:int;
private var gs:Boolean;
private var sampleY:int;
private var sampleX:int;
private var fractals:Boolean;
public function TerrainCreator2(_arg1, _arg2:String=null, _arg3:Number=1, _arg4:int=128, _arg5:int=9, _arg6:int=1000, _arg7:int=1000, _arg8:int=10, _arg9:int=200, _arg10:int=200, _arg11:Boolean=false, _arg12:Boolean=true, _arg13:int=10, _arg14:uint=7, _arg15:Boolean=true){
likeCoordinates = new Array();
super(_arg2, _arg6, _arg7, _arg8, _arg8, Plane3D.ZX_ALIGNED);
perlin = new BitmapData(_arg9, _arg10, false, 0);
perlin = _arg1;
sampleX = (_arg8 / perlin.width);
sampleY = (_arg8 / perlin.height);
quality = _arg8;
enableBackFaceCulling = false;
useSingleContainer = true;
oct = 1;
length = _arg7;
height = _arg6;
stitch = _arg11;
fractals = _arg12;
bitChan = _arg14;
gs = _arg15;
sampleRate = _arg13;
a = new Array();
a.push(new Point());
magnitude = _arg3;
parseBMD();
}
public function updateTerrain():void{
perlin.perlinNoise((perlin.width / 2), (perlin.height / 2), oct, seed, stitch, fractals, bitChan, gs, a);
parseBMD();
}
private function getAVG(_arg1:int, _arg2:int, _arg3:Number):Number{
var _local4:Number;
var _local5:int;
var _local6:int;
_local4 = perlin.getPixel(_arg1, _arg2);
_local5 = (_arg1 - _arg3);
while (_local5 < (_arg1 + _arg3)) {
_local6 = (_arg2 - _arg3);
while (_local6 < (_arg2 + _arg3)) {
if ((((((((_local5 >= 0)) && ((_local5 <= perlin.width)))) && ((_local6 >= 0)))) && ((_local6 <= perlin.height)))){
_local4 = (_local4 + 0);
};
_local6++;
};
_local5++;
};
return (_local4);
}
public function moveMap(_arg1:int=1, _arg2:int=1):void{
a[0].x = (a[0].x + _arg1);
a[0].y = (a[0].y + _arg2);
updateTerrain();
}
private function parseBMD():void{
var _local1:Geometry3D;
var _local2:int;
var _local3:Vertex;
var _local4:int;
var _local5:int;
var _local6:int;
_local1 = geometry;
_local2 = 0;
for each (_local3 in geometry.aVertex) {
_local4 = 0;
_local5 = int((_local2 % (quality + 1)));
_local6 = int(((_local2 - _local5) / (quality + 1)));
_local6 = (_local6 * (perlin.width / quality));
_local5 = (_local5 * (perlin.height / quality));
_local4 = getAVG(_local6, _local5, sampleRate);
_local3.y = ((_local4 * magnitude) * 1E-5);
_local2++;
};
geometry = _local1;
}
}
}//package
Section 240
//TileSunset01 (TileSunset01)
package {
import flash.display.*;
public dynamic class TileSunset01 extends BitmapData {
public function TileSunset01(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 241
//TreeSunset01 (TreeSunset01)
package {
import flash.display.*;
public dynamic class TreeSunset01 extends BitmapData {
public function TreeSunset01(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 242
//TreeSunset02 (TreeSunset02)
package {
import flash.display.*;
public dynamic class TreeSunset02 extends BitmapData {
public function TreeSunset02(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 243
//Turret (Turret)
package {
import sandy.core.scenegraph.*;
import flash.display.*;
public class Turret extends Sprite2D {
var hp:int;// = 40
var oz:Number;// = 0
var gd:MovieClip;
var rn:Number;
var thisTarget;
var hpt:int;
var spd:Number;// = 0
var laser:Sprite2D;
var hold:Number;// = 1
var stand:Bitmap;
var ox:Number;// = 0
var gj:MovieClip;
private var gs:MovieClip;
var alive:Boolean;// = true
var avhp;
public function Turret(_arg1, _arg2){
hp = 40;
hpt = hp;
ox = 0;
oz = 0;
gs = new Rotor();
gj = new Blazer();
gd = new GuardDeath();
rn = Math.random();
hold = 1;
alive = true;
spd = 0;
stand = new Bitmap(new EnemyIdle01(0, 0));
super(_arg1, stand, _arg2);
content = gs;
gs.gotoAndStop(1);
}
public function shot():void{
}
private function getHp():int{
return (hp);
}
public function shoot():void{
}
public function shotSize(_arg1:int):void{
}
public function jump():void{
}
public function death():void{
hp = -1;
laser.visible = false;
gs.gotoAndPlay(2);
}
public function hitPlayer():void{
}
public function resurrect():void{
gs.gotoAndStop(1);
hpt = hp;
}
public function idle():void{
}
public function dodge():void{
}
}
}//package
Section 244
//TxGround (TxGround)
package {
import flash.display.*;
public dynamic class TxGround extends BitmapData {
public function TxGround(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 245
//TxValleyhome (TxValleyhome)
package {
import flash.display.*;
public dynamic class TxValleyhome extends BitmapData {
public function TxValleyhome(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 246
//WarpPic (WarpPic)
package {
import flash.display.*;
public dynamic class WarpPic extends BitmapData {
public function WarpPic(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 247
//VcPipe (VcPipe)
package {
import flash.media.*;
public dynamic class VcPipe extends Sound {
}
}//package
Section 248
//VideoRim (VideoRim)
package {
import flash.display.*;
public dynamic class VideoRim extends BitmapData {
public function VideoRim(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 249
//Winddown (Winddown)
package {
import flash.media.*;
public dynamic class Winddown extends Sound {
}
}//package