Section 1
//MainTimeline (flash3dpano_empty_fla.MainTimeline)
package flash3dpano_empty_fla {
import flash.geom.*;
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.media.*;
import flash.net.*;
import flash.ui.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.system.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class MainTimeline extends MovieClip {
public var menuItem:ContextMenuItem;
public var skin2:SkinClass;
public var video:VideoPanoClass;
public var skin:SkinClass;
public var pano:PanoCube;
public var customContextMenu:ContextMenu;
public var skinstr:String;
public var panoramastr:String;
public var videostr:String;
public function MainTimeline(){
addFrameScript(0, frame1);
}
public function attachVideo(_arg1:String){
var str = _arg1;
try {
video = new VideoPanoClass(pano);
video.xmlConfig(new XML(str));
skin.video = video;
if (skin2){
skin2.video = video;
};
} catch(error:Error) {
};
}
function frame1(){
try {
if (stage){
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
};
} catch(err:Error) {
};
pano = new PanoCube();
addChild(pano);
try {
if (stage){
pano.windowWidth = stage.stageWidth;
pano.windowHeight = stage.stageHeight;
};
} catch(err:Error) {
};
panoramastr = "<panorama>\n<view>\n<start pan=\"13.6\" tilt=\"-1.2\" fov=\"78\"/>\n<min pan=\"0\" tilt=\"-90\" fov=\"10\"/>\n<max pan=\"360\" tilt=\"90\" fov=\"120\"/>\n</view><display width=\"1000\" height=\"700\" quality=\"12\" changemotionquality=\"1\" changestagequality=\"1\" smoothing=\"1\" scalemode=\"stage\" />\n<input tilesize=\"2012\" subtiles=\"1\" ><preview images=\"1\" color=\"0x808080\"/>\n</input>\n<control sensitifity=\"8\" simulatemass=\"1\" locked=\"0\" lockedwheel=\"0\" />\n<cursor ownonmovement=\"1\" ownondefault=\"1\" />\n</panorama>";
pano.xmlConfig(new XML(panoramastr));
if (root.loaderInfo.parameters.panorama){
pano.xmlConfig(new XML(root.loaderInfo.parameters.panorama));
};
skin = new SkinClass(pano);
skinstr = "<skin><element type=\"text\"x=\"10\" y=\"10\" anchor=\"0\" width=\"179\" height=\"20\" id=\"Loading text\" visible=\"1\" alpha=\"1\" scalex=\"1\" scaley=\"1\" center=\"4\" text=\"<b>Loading......</b>\" align=\"0\" color=\"0x000000\" bordercolor=\"0x000000\" backgroundcolor=\"0xffffff\" background=\"0\" border=\"0\" >\n<action src=\"loaded\" type=\"hide\" value=\"\" value2=\"\" target=\"$self\" />\n</element>\n</skin>";
if (root.loaderInfo.parameters.skin){
skinstr = root.loaderInfo.parameters.skin;
};
try {
skin.xmlConfig(new XML(skinstr));
} catch(error:Error) {
};
addChild(skin);
if (root.loaderInfo.parameters.skin2){
try {
skin2 = new SkinClass(pano);
skin2.xmlConfig(new XML(root.loaderInfo.parameters.skin2));
addChild(skin2);
} catch(error:Error) {
};
};
customContextMenu = new ContextMenu();
customContextMenu.hideBuiltInItems();
if (root.loaderInfo.parameters.hideabout){
pano.showAboutPano2VR = !((root.loaderInfo.parameters.hideabout == 1));
};
if (pano.showAboutPano2VR){
menuItem = new ContextMenuItem("About Pano2VR Player...");
menuItem.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, about);
customContextMenu.customItems.push(menuItem);
};
contextMenu = customContextMenu;
if (root.loaderInfo.parameters.pan){
pano.setPan(root.loaderInfo.parameters.pan);
};
if (root.loaderInfo.parameters.tilt){
pano.setTilt(root.loaderInfo.parameters.tilt);
};
if (root.loaderInfo.parameters.fov){
pano.setFov(root.loaderInfo.parameters.fov);
};
videostr = "<video></video>";
if (root.loaderInfo.parameters.video){
videostr = root.loaderInfo.parameters.video;
attachVideo(videostr);
};
if (root.loaderInfo.parameters.externalinterface){
try {
ExternalInterface.addCallback("getPan", pano.getPan);
ExternalInterface.addCallback("setPan", pano.setPan);
ExternalInterface.addCallback("changePan", pano.changePan);
ExternalInterface.addCallback("getTilt", pano.getTilt);
ExternalInterface.addCallback("setTilt", pano.setTilt);
ExternalInterface.addCallback("changeTilt", pano.changeTilt);
ExternalInterface.addCallback("getFov", pano.getFov);
ExternalInterface.addCallback("setFov", pano.setFov);
ExternalInterface.addCallback("changeFov", pano.changeFov);
ExternalInterface.addCallback("moveTo", pano.moveTo);
ExternalInterface.addCallback("setAutorotate", pano.setAutorotate);
ExternalInterface.addCallback("setLocked", pano.setLocked);
ExternalInterface.addCallback("isComplete", pano.isComplete);
ExternalInterface.addCallback("stop", pano.stopAutorotate);
ExternalInterface.addCallback("stopAutorotate", pano.stopAutorotate);
} catch(error:Error) {
};
};
}
public function about(_arg1:Event){
var _local2:URLRequest;
_local2 = new URLRequest("http://gardengnomesoftware.com/pano2vr");
navigateToURL(_local2, "_blank");
}
}
}//package flash3dpano_empty_fla
Section 2
//CursorDataClass (CursorDataClass)
package {
import flash.display.*;
public dynamic class CursorDataClass extends BitmapData {
public function CursorDataClass(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 3
//Hotspot (Hotspot)
package {
import flash.geom.*;
import flash.display.*;
public class Hotspot {
var onCallback:Function;
var posPan:Number;
var clip:MovieClip;
var posTilt:Number;
var target:String;
var id:String;
var ofs:Point;
var url:String;
var title:String;
public function Hotspot(){
ofs = new Point();
}
}
}//package
Section 4
//HotspotImageClass (HotspotImageClass)
package {
import flash.display.*;
public dynamic class HotspotImageClass extends BitmapData {
public function HotspotImageClass(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 5
//ImageRepository (ImageRepository)
package {
import flash.display.*;
public class ImageRepository {
public function getImage(_arg1:String):BitmapData{
if (_arg1 == "pre0"){
return (new ReposImage_pre0Class(0, 0));
};
if (_arg1 == "pre1"){
return (new ReposImage_pre1Class(0, 0));
};
if (_arg1 == "pre2"){
return (new ReposImage_pre2Class(0, 0));
};
if (_arg1 == "pre3"){
return (new ReposImage_pre3Class(0, 0));
};
if (_arg1 == "pre4"){
return (new ReposImage_pre4Class(0, 0));
};
if (_arg1 == "pre5"){
return (new ReposImage_pre5Class(0, 0));
};
if (_arg1 == "img0"){
return (new ReposImage_img0Class(0, 0));
};
if (_arg1 == "img1"){
return (new ReposImage_img1Class(0, 0));
};
if (_arg1 == "img2"){
return (new ReposImage_img2Class(0, 0));
};
if (_arg1 == "img3"){
return (new ReposImage_img3Class(0, 0));
};
if (_arg1 == "img4"){
return (new ReposImage_img4Class(0, 0));
};
if (_arg1 == "img5"){
return (new ReposImage_img5Class(0, 0));
};
return (new BitmapData(16, 16));
}
}
}//package
Section 6
//Matrix4d (Matrix4d)
package {
public class Matrix4d {
private var n31:Number;
private var n32:Number;
private var n11:Number;
private var n13:Number;
private var n14:Number;
private var n33:Number;
private var n12:Number;
private var n42:Number;
private var n21:Number;
private var n22:Number;
private var n23:Number;
private var n24:Number;
private var n34:Number;
private var n41:Number;
private var n43:Number;
private var n44:Number;
public function Matrix4d(){
setIdent();
}
public function setScale(_arg1:Number):void{
n11 = _arg1;
n12 = 0;
n13 = 0;
n14 = 0;
n21 = 0;
n22 = _arg1;
n23 = 0;
n24 = 0;
n31 = 0;
n32 = 0;
n33 = _arg1;
n34 = 0;
n41 = 0;
n42 = 0;
n43 = 0;
n44 = 1;
}
public function setRotZ(_arg1:Number):void{
var _local2:Number;
var _local3:Number;
_local2 = Math.cos(_arg1);
_local3 = Math.sin(_arg1);
n11 = _local2;
n12 = _local3;
n13 = 0;
n14 = 0;
n21 = -(_local3);
n22 = _local2;
n23 = 0;
n24 = 0;
n31 = 0;
n32 = 0;
n33 = 1;
n34 = 0;
n41 = 0;
n42 = 0;
n43 = 0;
n44 = 1;
}
public function setRotY(_arg1:Number):void{
var _local2:Number;
var _local3:Number;
_local2 = Math.cos(_arg1);
_local3 = Math.sin(_arg1);
n11 = _local2;
n12 = 0;
n13 = -(_local3);
n14 = 0;
n21 = 0;
n22 = 1;
n23 = 0;
n24 = 0;
n31 = _local3;
n32 = 0;
n33 = _local2;
n34 = 0;
n41 = 0;
n42 = 0;
n43 = 0;
n44 = 1;
}
public function setRotX(_arg1:Number):void{
var _local2:Number;
var _local3:Number;
_local2 = Math.cos(_arg1);
_local3 = Math.sin(_arg1);
n11 = 1;
n12 = 0;
n13 = 0;
n14 = 0;
n21 = 0;
n22 = _local2;
n23 = _local3;
n24 = 0;
n31 = 0;
n32 = -(_local3);
n33 = _local2;
n34 = 0;
n41 = 0;
n42 = 0;
n43 = 0;
n44 = 1;
}
public function toString():String{
var _local1:String;
_local1 = new String("Matrix(\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);
}
public function setIdent():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;
}
public function mulVector(_arg1:Vector3d, _arg2:Vector3d):void{
_arg2.x = (((_arg1.x * n11) + (_arg1.y * n12)) + (_arg1.z * n13));
_arg2.y = (((_arg1.x * n21) + (_arg1.y * n22)) + (_arg1.z * n23));
_arg2.z = (((_arg1.x * n31) + (_arg1.y * n32)) + (_arg1.z * n33));
}
public static function multiply(_arg1:Matrix4d, _arg2:Matrix4d):Matrix4d{
var _local3:Matrix4d;
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;
var _local35:Number;
_local3 = new (Matrix4d);
_local4 = _arg1.n11;
_local5 = _arg2.n11;
_local12 = _arg1.n12;
_local7 = _arg2.n21;
_local20 = _arg1.n13;
_local9 = _arg2.n31;
_local28 = _arg1.n14;
_local11 = _arg2.n41;
_local3.n11 = ((((_local4 * _local5) + (_local12 * _local7)) + (_local20 * _local9)) + (_local28 * _local11));
_local13 = _arg2.n12;
_local15 = _arg2.n22;
_local17 = _arg2.n32;
_local19 = _arg2.n42;
_local3.n12 = ((((_local4 * _local13) + (_local12 * _local15)) + (_local20 * _local17)) + (_local28 * _local19));
_local21 = _arg2.n13;
_local23 = _arg2.n23;
_local25 = _arg2.n33;
_local27 = _arg2.n43;
_local3.n13 = ((((_local4 * _local21) + (_local12 * _local23)) + (_local20 * _local25)) + (_local28 * _local27));
_local29 = _arg2.n14;
_local31 = _arg2.n24;
_local33 = _arg2.n34;
_local35 = _arg2.n44;
_local3.n14 = ((((_local4 * _local29) + (_local12 * _local31)) + (_local20 * _local33)) + (_local28 * _local35));
_local6 = _arg1.n21;
_local14 = _arg1.n22;
_local22 = _arg1.n23;
_local30 = _arg1.n24;
_local3.n21 = ((((_local6 * _local5) + (_local14 * _local7)) + (_local22 * _local9)) + (_local30 * _local11));
_local3.n22 = ((((_local6 * _local13) + (_local14 * _local15)) + (_local22 * _local17)) + (_local30 * _local19));
_local3.n23 = ((((_local6 * _local21) + (_local14 * _local23)) + (_local22 * _local25)) + (_local30 * _local27));
_local3.n24 = ((((_local6 * _local29) + (_local14 * _local31)) + (_local22 * _local33)) + (_local30 * _local35));
_local8 = _arg1.n31;
_local16 = _arg1.n32;
_local24 = _arg1.n33;
_local32 = _arg1.n34;
_local3.n31 = ((((_local8 * _local5) + (_local16 * _local7)) + (_local24 * _local9)) + (_local32 * _local11));
_local3.n32 = ((((_local8 * _local13) + (_local16 * _local15)) + (_local24 * _local17)) + (_local32 * _local19));
_local3.n33 = ((((_local8 * _local21) + (_local16 * _local23)) + (_local24 * _local25)) + (_local32 * _local27));
_local3.n34 = ((((_local8 * _local29) + (_local16 * _local31)) + (_local24 * _local33)) + (_local32 * _local35));
_local10 = _arg1.n41;
_local18 = _arg1.n42;
_local26 = _arg1.n43;
_local34 = _arg1.n44;
_local3.n41 = ((((_local10 * _local5) + (_local18 * _local7)) + (_local26 * _local9)) + (_local34 * _local11));
_local3.n42 = ((((_local10 * _local13) + (_local18 * _local15)) + (_local26 * _local17)) + (_local34 * _local19));
_local3.n43 = ((((_local10 * _local21) + (_local18 * _local23)) + (_local26 * _local25)) + (_local34 * _local27));
_local3.n44 = ((((_local10 * _local29) + (_local18 * _local31)) + (_local26 * _local33)) + (_local34 * _local35));
return (_local3);
}
}
}//package
Section 7
//PanoConfigXML (PanoConfigXML)
package {
public class PanoConfigXML {
public function applyConfig(_arg1:XML, _arg2:PanoCube){
var os:String;
var i:int;
var h:String;
var hotspot:XML;
var id:String;
var title:String;
var url:String;
var target:String;
var pan:Number;
var tilt:Number;
var width:int;
var height:int;
var config = _arg1;
var pano = _arg2;
try {
if (config.hasOwnProperty("@hideabout")){
pano.showAboutPano2VR = !((config.@hideabout == 1));
};
if (config.hasOwnProperty("input")){
if (config.input.hasOwnProperty("@order")){
os = (pano.faceOrder[0] = config.input.@order);
i = 0;
while (i < 6) {
pano.faceOrder[i] = os.charAt(i);
i = (i + 1);
};
};
if (config.input.hasOwnProperty("@cylinder")){
pano.isCylinder = (config.input.@cylinder == 1);
};
if (config.input.hasOwnProperty("@width")){
pano.cylinderImageWidth = config.input.@width;
};
if (config.input.hasOwnProperty("@height")){
pano.cylinderImageHeight = config.input.@height;
};
if (config.input.hasOwnProperty("@tilesize")){
pano.tileSize = config.input.@tilesize;
};
if (config.input.hasOwnProperty("@subtiles")){
pano.subtiles = config.input.@subtiles;
};
if (config.input.hasOwnProperty("preview")){
if (config.input.preview.hasOwnProperty("@images")){
pano.hasPrevImages = (config.input.preview.@images == 1);
};
if (config.input.preview.hasOwnProperty("@color")){
pano.preloadColor = config.input.preview.@color;
};
};
if (config.input.hasOwnProperty("@tile0url")){
pano.loadTile(0, config.input.@tile0url);
};
if (config.input.hasOwnProperty("@tile1url")){
pano.loadTile(1, config.input.@tile1url);
};
if (config.input.hasOwnProperty("@tile2url")){
pano.loadTile(2, config.input.@tile2url);
};
if (config.input.hasOwnProperty("@tile3url")){
pano.loadTile(3, config.input.@tile3url);
};
if (config.input.hasOwnProperty("@tile4url")){
pano.loadTile(4, config.input.@tile4url);
};
if (config.input.hasOwnProperty("@tile5url")){
pano.loadTile(5, config.input.@tile5url);
};
if (config.input.hasOwnProperty("@hstile0url")){
pano.loadTile(6, config.input.@hstile0url);
};
if (config.input.hasOwnProperty("@hstile1url")){
pano.loadTile(7, config.input.@hstile1url);
};
};
if (config.hasOwnProperty("view")){
if (config.view.hasOwnProperty("start")){
if (config.view.start.hasOwnProperty("@pan")){
pano.pan.cur = config.view.start.@pan;
pano.pan.def = config.view.start.@pan;
};
if (config.view.start.hasOwnProperty("@tilt")){
pano.tilt.cur = config.view.start.@tilt;
pano.tilt.def = config.view.start.@tilt;
};
if (config.view.start.hasOwnProperty("@fov")){
pano.fov.cur = config.view.start.@fov;
pano.fov.def = config.view.start.@fov;
};
};
if (config.view.hasOwnProperty("min")){
if (config.view.min.hasOwnProperty("@pan")){
pano.pan.min = config.view.min.@pan;
};
if (config.view.min.hasOwnProperty("@tilt")){
pano.tilt.min = config.view.min.@tilt;
};
if (config.view.min.hasOwnProperty("@fov")){
pano.fov.min = config.view.min.@fov;
};
};
if (config.view.hasOwnProperty("max")){
if (config.view.max.hasOwnProperty("@pan")){
pano.pan.max = config.view.max.@pan;
};
if (config.view.max.hasOwnProperty("@tilt")){
pano.tilt.max = config.view.max.@tilt;
};
if (config.view.max.hasOwnProperty("@fov")){
pano.fov.max = config.view.max.@fov;
};
};
};
if (config.hasOwnProperty("autorotate")){
pano.autorotate = true;
if (config.autorotate.hasOwnProperty("@delay")){
pano.autorotate_timeout = config.autorotate.@delay;
};
if (config.autorotate.hasOwnProperty("@speed")){
pano.autorotate = !((config.autorotate.@speed == 0));
pano.autorotate_pan = config.autorotate.@speed;
};
if (config.autorotate.hasOwnProperty("@returntohorizon")){
pano.autorotate_tilt_force = config.autorotate.@returntohorizon;
};
if (config.autorotate.hasOwnProperty("@onlyinfocus")){
pano.autorotate_onlyinfocus = (config.autorotate.@onlyinfocus == 1);
};
if (config.autorotate.hasOwnProperty("@startloaded")){
pano.autorotate_onlyloaded = (config.autorotate.@startloaded == 1);
};
};
if (config.hasOwnProperty("control")){
if (config.control.hasOwnProperty("@sensitifity")){
pano.sensitifity = config.control.@sensitifity;
};
if (config.control.hasOwnProperty("@simulatemass")){
pano.simulateMass = (config.control.@simulatemass == 1);
};
if (config.control.hasOwnProperty("@locked")){
pano.setLocked((config.control.@locked == 1));
};
};
if (config.hasOwnProperty("cursor")){
if (config.cursor.hasOwnProperty("@ownonmovement")){
pano.useOwnMoveCursor = (config.cursor.@ownonmovement == 1);
};
if (config.cursor.hasOwnProperty("@ownondefault")){
pano.useOwnCursor = (config.cursor.@ownondefault == 1);
};
};
if (config.hasOwnProperty("display")){
if (config.display.hasOwnProperty("@width")){
pano.windowWidth = config.display.@width;
};
if (config.display.hasOwnProperty("@height")){
pano.windowHeight = config.display.@height;
};
if (config.display.hasOwnProperty("@quality")){
pano.meshBase = config.display.@quality;
};
if (config.display.hasOwnProperty("@changemotionquality")){
pano.meshAuto = (config.display.@changemotionquality == 1);
};
if (config.display.hasOwnProperty("@changestagequality")){
pano.changeStageQuality = (config.display.@changestagequality == 1);
};
if (config.display.hasOwnProperty("@smoothing")){
pano.changeBmpSmooth = (config.display.@smoothing == 1);
};
if (config.display.hasOwnProperty("@scalemode")){
h = config.display.@scalemode;
pano.stageMode = h;
pano.windowScaleIgnore = (h == "no");
};
};
if (config.hasOwnProperty("qthotspots")){
pano.hasHotspots = true;
if (config.qthotspots.hasOwnProperty("label")){
if (config.qthotspots.label.hasOwnProperty("@width")){
pano.hotspottxtWidth = config.qthotspots.label.@width;
};
if (config.qthotspots.label.hasOwnProperty("@height")){
pano.hotspottxtHeight = config.qthotspots.label.@height;
};
if (config.qthotspots.label.hasOwnProperty("@movement")){
pano.hotspottxtContinous = (config.qthotspots.label.@movement == 1);
};
if (config.qthotspots.label.hasOwnProperty("@border")){
pano.hotspottxtBorder = (config.qthotspots.label.@border == 1);
};
if (config.qthotspots.label.hasOwnProperty("@background")){
pano.hotspottxtBackground = (config.qthotspots.label.@background == 1);
};
if (config.qthotspots.label.hasOwnProperty("@bordercolor")){
pano.hotspottxtBorderColor = config.qthotspots.label.@bordercolor;
};
if (config.qthotspots.label.hasOwnProperty("@backgroundcolor")){
pano.hotspottxtBackgroundColor = config.qthotspots.label.@backgroundcolor;
};
if (config.qthotspots.label.hasOwnProperty("@textcolor")){
pano.hotspottxtTextColor = config.qthotspots.label.@textcolor;
};
};
for each (hotspot in config.qthotspots.hotspot) {
url = "";
target = "";
title = "";
if (hotspot.hasOwnProperty("@id")){
if (hotspot.hasOwnProperty("@title")){
title = hotspot.@title;
};
if (hotspot.hasOwnProperty("@url")){
url = hotspot.@url;
};
if (hotspot.hasOwnProperty("@target")){
target = hotspot.@target;
};
pano.addQtHotspot(hotspot.@id, title, url, target);
};
};
};
if (config.hasOwnProperty("hotspots")){
for each (hotspot in config.hotspots.hotspot) {
id = "";
url = "";
target = "";
title = "";
if (hotspot.hasOwnProperty("@id")){
id = hotspot.@id;
};
if (hotspot.hasOwnProperty("@title")){
title = hotspot.@title;
};
if (hotspot.hasOwnProperty("@url")){
url = hotspot.@url;
};
if (hotspot.hasOwnProperty("@target")){
target = hotspot.@target;
};
pan = 0;
if (hotspot.hasOwnProperty("@pan")){
pan = hotspot.@pan;
};
tilt = 0;
if (hotspot.hasOwnProperty("@tilt")){
tilt = hotspot.@tilt;
};
width = 0;
if (hotspot.hasOwnProperty("@width")){
width = hotspot.@width;
};
height = 0;
if (hotspot.hasOwnProperty("@height")){
height = hotspot.@height;
};
if (url == ""){
pano.addTextHotspot(id, pan, tilt, title, width, height);
} else {
pano.addUrlHotspot(id, pan, tilt, title, url, target, width, height);
};
};
};
} catch(error:Error) {
};
}
}
}//package
Section 8
//PanoCube (PanoCube)
package {
import flash.geom.*;
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
public class PanoCube extends Sprite {
public var onRotate:Function;
private var cursorData:BitmapData;
public var hasHotspots:Boolean;
public var controllerFlags:String;// = ""
public var cubeTiles:Number;
public var dA:Number;
public var hasOverlay:Boolean;// = false
public var useOwnMoveCursor:Boolean;// = false
private var m:Matrix;
public var turn:Boolean;
public var started:Boolean;
public var onRollOutQtHotspot:Function;
public var pan:PanoViewLimits;
private var ed:Number;
public var keyShiftDown:Boolean;// = false
public var cylinderImageHeight:Number;// = 0
public var sensitifity:Number;
public var useOwnCursor:Boolean;// = false
public var autorotate_onlyinfocus:Boolean;
private var autoMoveTo:Boolean;
public var hasPrevImages:Boolean;// = true
public var showfps:Boolean;
public var fov:PanoViewLimits;
public var hotspottxtBorder:Boolean;// = true
private var framecnt:Number;
var intBytesLoaded:int;// = 0
public var lastkeyascii:Number;
private var lastMouseDown:Number;
public var hotspot_txt:TextField;
public var hotspottxtWidth:Number;// = 0
public var alphaOverlay:Number;// = 1
public var useMask:Boolean;
public var showAboutPano2VR:Boolean;
public var controllerPos:Number;
public var keyCtrlDown:Boolean;// = false
public var windowHeight:Number;// = 300
public var meshAuto:Boolean;// = true
public var dTilt:Number;
private var isStopped:Boolean;// = false
public var subtiles:Number;
public var hotspottxtBackground:Boolean;// = true
public var initMovClip:Boolean;// = true
public var autoplay:Boolean;
private var mat:Matrix4d;
private var lastaction_dt:Number;
private var panomask:Shape;
public var lastkeycode:Number;
public var dPan:Number;
public var cylinderImageWidth:Number;// = 0
public var cylTilesXS:Number;
public var windowScaleIgnore:Boolean;
public var stageMode:String;
public var changeBmpSmooth:Boolean;// = false
public var hotspottxtHeight:Number;// = 0
public var dFov:Number;
public var bmpTile:Array;
public var dirtyMask:Boolean;
public var rect:Rectangle;
public var autorotate_timeout:Number;
public var hotspottxtTextColor:uint;// = 0
public var bmpVideo:BitmapData;
public var busy:Boolean;
public var bmp_hs:Array;
private var autoMoveSpeed:Number;
public var isInFocus:Boolean;
private var bmp_loadedpf:Array;
private var cylTilesXBase:Number;
public var onClickQtHotspot:Function;
public var autorotate_onlyloaded:Boolean;
public var completed:Boolean;
public var meshBase:Number;// = 8
private var oldCursorId:int;// = -1
private var externalTiles:Array;
public var autorotate_tilt_force:Number;
public var key_down:Boolean;// = false
public var keyAltDown:Boolean;// = false
public var mdown:Point;
public var hotspottxtBorderColor:uint;// = 0
private var cubeWidth:Number;// = 1
public var canv:MovieClip;
public var qthotspots:Array;
public var autorotate_pan:Number;
private var va:Array;
public var imageRepos:ImageRepository;
private var mcur:Point;
public var tilt:PanoViewLimits;
public var onRollOverHotspot:Function;
public var currentHotspotId:int;
public var preloadColor:Number;
var intBytesTotal:int;// = 0
public var faceOrder:Array;
public var bmpTileOverlay:Array;
private var locked:Boolean;// = false
public var currentHotspot:Hotspot;
public var onRollOverQtHotspot:Function;
public var isCylinder:Boolean;
public var controllerAlpha:Number;
private var vat:Array;
public var canvOv:MovieClip;
private var hs_local:Number;
public var simulateMass:Boolean;
private var cursor:Bitmap;
public var hotspottxtBackgroundColor:uint;// = 0xFFFFFF
public var enable_callback:Boolean;
public var hotspots:Array;
private var bmpSmooth:Boolean;
public var onClickHotspot:Function;
public var windowWidth:Number;// = 300
public var onRollOutHotspot:Function;
private var mdownt:Number;
private var cylTilesX:Number;
private var cylTilesY:Number;
public var tileSize:Number;
public var autorotate:Boolean;
public var dirty:Boolean;
public var hotspottxtContinous:Boolean;// = true
public var changeStageQuality:Boolean;// = true
public var meshCylBase:Number;// = 6
private var bmp_loaded:Array;
public function PanoCube(){
var _local1:int;
hasPrevImages = true;
locked = false;
meshBase = 8;
meshCylBase = 6;
meshAuto = true;
changeBmpSmooth = false;
changeStageQuality = true;
cylinderImageWidth = 0;
cylinderImageHeight = 0;
key_down = false;
keyShiftDown = false;
keyCtrlDown = false;
keyAltDown = false;
initMovClip = true;
controllerFlags = "";
hotspottxtWidth = 0;
hotspottxtHeight = 0;
hotspottxtTextColor = 0;
hotspottxtBorderColor = 0;
hotspottxtBackgroundColor = 0xFFFFFF;
hotspottxtBorder = true;
hotspottxtBackground = true;
hotspottxtContinous = true;
windowWidth = 300;
windowHeight = 300;
useOwnCursor = false;
useOwnMoveCursor = false;
oldCursorId = -1;
cubeWidth = 1;
isStopped = false;
intBytesLoaded = 0;
intBytesTotal = 0;
hasOverlay = false;
alphaOverlay = 1;
super();
framecnt = 0;
showAboutPano2VR = true;
fov = new PanoViewLimits(90, 20, 120);
pan = new PanoViewLimits(0, 0, 360);
tilt = new PanoViewLimits(0, -90, 90);
imageRepos = new ImageRepository();
canv = new MovieClip();
canvOv = new MovieClip();
bmpTile = new Array();
bmpTileOverlay = new Array();
bmp_hs = new Array();
bmp_loaded = new Array();
bmp_loadedpf = new Array();
va = new Array();
vat = new Array();
m = new Matrix();
hotspots = new Array();
qthotspots = new Array();
mdown = new Point();
mdown.x = mouseX;
mdown.y = mouseY;
mcur = new Point();
mcur.x = mouseX;
mcur.y = mouseY;
mdownt = 0;
turn = false;
cubeTiles = meshBase;
rect = new Rectangle();
hs_local = 0;
dPan = 0;
dTilt = 0;
dFov = 0;
autorotate_pan = 0.5;
autorotate_tilt_force = 0.5;
autorotate_timeout = 5;
autorotate = false;
autorotate_onlyinfocus = false;
enable_callback = false;
controllerPos = (0 + (2 * 3));
controllerAlpha = 100;
bmpSmooth = true;
isCylinder = false;
cylTilesXS = 6;
enable_callback = true;
completed = false;
preloadColor = 16777216;
windowScaleIgnore = false;
lastaction_dt = 0;
tileSize = 0;
subtiles = 1;
externalTiles = new Array();
_local1 = 0;
while (_local1 < 8) {
externalTiles[_local1] = null;
_local1++;
};
sensitifity = 8;
simulateMass = true;
hasHotspots = false;
hotspottxtWidth = 200;
hotspottxtHeight = 20;
onClickQtHotspot = undefined;
useMask = true;
faceOrder = new Array();
autoMoveTo = false;
_local1 = 0;
while (_local1 < 8) {
faceOrder[_local1] = _local1;
_local1++;
};
addEventListener(Event.ENTER_FRAME, init);
}
function redrawCursor(_arg1:Event):void{
var _local2:int;
var _local3:int;
var _local4:Number;
var _local5:int;
if (_arg1 != null){
if (_arg1.type == MouseEvent.MOUSE_MOVE){
isInFocus = true;
};
};
if (useOwnMoveCursor){
if (((((useOwnCursor) || (turn))) && (isInFocus))){
cursor.visible = true;
Mouse.hide();
cursor.x = (root.mouseX - 16);
cursor.y = (root.mouseY - 16);
_local2 = (mdown.x - root.mouseX);
_local3 = (mdown.y - root.mouseY);
_local4 = (Math.abs(_local2) + Math.abs(_local3));
_local5 = 9;
if (turn){
if (_local4 < 2){
_local5 = 4;
} else {
if (_local2 > (2 * Math.abs(_local3))){
_local5 = 1;
};
if (-(_local2) > (2 * Math.abs(_local3))){
_local5 = 7;
};
if (_local3 > (2 * Math.abs(_local2))){
_local5 = 3;
};
if (-(_local3) > (2 * Math.abs(_local2))){
_local5 = 5;
};
if (_local5 == 9){
if ((((_local2 > 0)) && ((_local3 > 0)))){
_local5 = 0;
};
if ((((_local2 < 0)) && ((_local3 > 0)))){
_local5 = 6;
};
if ((((_local2 > 0)) && ((_local3 < 0)))){
_local5 = 2;
};
if ((((_local2 < 0)) && ((_local3 < 0)))){
_local5 = 8;
};
};
};
} else {
if (currentHotspotId > 0){
if (currentHotspot){
if (currentHotspot.url != ""){
_local5 = 10;
} else {
_local5 = 12;
};
} else {
_local5 = 11;
};
};
};
if (_local5 != oldCursorId){
oldCursorId = _local5;
cursor.bitmapData.copyPixels(cursorData, new Rectangle((int((_local5 / 3)) * 32), ((_local5 % 3) * 32), 32, 32), new Point(0, 0), null, null, false);
};
} else {
Mouse.show();
cursor.visible = false;
};
};
}
public function bytesLoaded():int{
return (intBytesLoaded);
}
private function doClickHotspot(_arg1:Event){
var hs:MovieClip;
var i:int;
var request:URLRequest;
var e = _arg1;
hs = MovieClip(e.currentTarget);
i = 0;
while (i < hotspots.length) {
if (hotspots[i].clip == hs){
if (onClickHotspot != null){
try {
onClickHotspot(hotspots[i].id, hotspots[i].clip, hotspots[i].url, hotspots[i].target);
} catch(error:Error) {
};
} else {
if (hotspots[i].url != ""){
request = new URLRequest(hotspots[i].url);
navigateToURL(request, hotspots[i].target);
};
};
};
i = (i + 1);
};
}
public function doEnterFrame(_arg1:Event):void{
var _local2:MovieClip;
var _local3:Date;
var _local4:Date;
var _local5:Number;
_local2 = MovieClip(root);
if (((!(isStopped)) && (!((_local2 == null))))){
if (_local2.currentFrame >= 1){
init_faces();
updateBytesTotal();
};
if ((((_local2.currentFrame == _local2.totalFrames)) && (completed))){
isStopped = true;
_local2.stop();
};
};
if (((((isNaN(pan.cur)) || (isNaN(tilt.cur)))) || (isNaN(fov.cur)))){
pan.cur = 0;
tilt.cur = 0;
fov.cur = 70;
};
if (started){
if (intBytesLoaded != intBytesTotal){
updateBytesLoaded();
};
dA = 0;
if (key_down){
resetlastaction();
autoplay = false;
dPan = 0;
dTilt = 0;
dFov = 0;
if (lastkeycode == 39){
dPan = -1;
};
if (lastkeycode == 37){
dPan = 1;
};
if (lastkeycode == 40){
dTilt = -1;
};
if (lastkeycode == 38){
dTilt = 1;
};
if (lastkeyascii == 43){
dFov = -1;
};
if (lastkeyascii == 45){
dFov = 1;
};
if (keyCtrlDown){
dFov = 1;
};
if (keyShiftDown){
dFov = -1;
};
changeTilt(dTilt);
changePan(dPan);
changeFov(dFov);
dA = (((dPan * dPan) + (dTilt * dTilt)) + (dFov * dFov));
setMeshDensity(dA);
};
if (turn){
resetlastaction();
_local3 = new Date();
mdownt = ((2 * sensitifity) * 1E-5);
dTilt = ((-((mcur.y - mdown.y)) * mdownt) * fov.cur);
dPan = ((-((mcur.x - mdown.x)) * mdownt) * fov.cur);
dA = (((dPan * dPan) + (dTilt * dTilt)) + (dFov * dFov));
setMeshDensity(dA);
changeTilt(dTilt);
changePan(dPan);
dirty = ((!((dA == 0))) || (!((cubeTiles == meshBase))));
};
if (((autorotate) && (!(autoplay)))){
_local4 = new Date();
if (((_local4.getTime() - lastaction_dt) / 1000) > autorotate_timeout){
autoplay = true;
};
};
if (!autoplay){
autoMoveTo = false;
};
if (((((autoplay) && (((((!(autorotate_onlyinfocus)) || (isInFocus))) || (autoMoveTo))))) && (((!(autorotate_onlyloaded)) || (completed))))){
if (autoMoveTo){
dTilt = (tilt.dest - tilt.cur);
dFov = (fov.dest - fov.cur);
dPan = (pan.dest - pan.cur);
_local5 = Math.sqrt((((dPan * dPan) + (dTilt * dTilt)) + (dFov * dFov)));
if (_local5 > 0.1){
if (_local5 > (5 * autoMoveSpeed)){
dA = autoMoveSpeed;
} else {
dA = (_local5 * 0.2);
};
resetlastaction();
} else {
dA = _local5;
if (_local5 == 0){
_local5 = 1;
};
autoMoveTo = false;
autoplay = false;
};
dPan = ((dPan / _local5) * dA);
dTilt = ((dTilt / _local5) * dA);
dFov = ((dFov / _local5) * dA);
} else {
dTilt = ((autorotate_tilt_force * (0 - tilt.cur)) / 100);
dFov = ((autorotate_tilt_force * (fov.def - fov.cur)) / 100);
dPan = ((dPan * 0.95) + (-(autorotate_pan) * 0.05));
};
dA = (((dPan * dPan) + (dTilt * dTilt)) + (dFov * dFov));
setMeshDensity(dA);
changeTilt(dTilt);
changePan(dPan);
changeFov(dFov);
dirty = true;
};
if (((((((!(key_down)) && (!(turn)))) && (!(autoplay)))) && (!(autoMoveTo)))){
if (simulateMass){
dTilt = (dTilt * 0.85);
dPan = (dPan * 0.85);
dFov = (dFov * 0.85);
dA = (((dPan * dPan) + (dTilt * dTilt)) + (dFov * dFov));
} else {
dA = 0;
};
if (dA < 0.01){
setMeshDensity(0);
if (dA > 0){
dirty = true;
};
dTilt = 0;
dPan = 0;
dFov = 0;
} else {
setMeshDensity(dA);
changeTilt(dTilt);
changePan(dPan);
changeFov(dFov);
dirty = true;
};
};
if (dA < 0.01){
if (changeBmpSmooth){
bmpSmooth = true;
};
if (changeStageQuality){
if (stage){
stage.quality = "HIGH";
};
};
} else {
if (changeBmpSmooth){
bmpSmooth = false;
};
if (changeStageQuality){
if (stage){
stage.quality = "LOW";
};
};
};
if (dirty){
dirty = false;
doPaint();
};
if (hasHotspots){
checkHotspots(mcur.x, mcur.y);
};
};
}
public function setMeshDensity(_arg1:Number):void{
if (meshAuto){
if (_arg1 < 0.25){
cubeTiles = meshBase;
cylTilesY = meshCylBase;
} else {
if (_arg1 < 4){
cubeTiles = (meshBase - 1);
cylTilesY = (meshCylBase - 1);
} else {
cubeTiles = (meshBase - 2);
cylTilesY = (meshCylBase - 2);
};
};
if (cubeTiles < 2){
cubeTiles = 2;
};
if (cylTilesY < 2){
cylTilesY = 2;
};
} else {
cubeTiles = meshBase;
cylTilesY = meshCylBase;
};
}
public function isComplete():Boolean{
return (completed);
}
public function doMouseWheel(_arg1:MouseEvent):void{
if (isInFocus){
changeFov((_arg1.delta / 3), true);
autoplay = false;
resetlastaction();
_arg1.stopImmediatePropagation();
_arg1.preventDefault();
};
}
public function doRollOver(_arg1:MouseEvent):void{
isInFocus = true;
}
public function setup_cube():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local3 = 1.0025;
if (isCylinder == true){
return;
};
_local4 = ((fov.cur / 2) * (Math.PI / 180));
_local5 = Math.floor((((rect.height / 2) / Math.tan(_local4)) * 2));
if (tileSize > 0){
_local3 = (1.0005 + (((tileSize / _local5) * 2) / tileSize));
};
va = new Array();
_local1 = 0;
while (_local1 < 6) {
va.push(new Vector3d(-(_local3), -(_local3), -1));
va.push(new Vector3d(_local3, -(_local3), -1));
va.push(new Vector3d(-(_local3), _local3, -1));
va.push(new Vector3d(_local3, _local3, -1));
if (_local1 < 4){
_local2 = 0;
while (_local2 < 4) {
va[((va.length - 4) + _local2)].roty(((Math.PI * 0.5) * _local1));
_local2++;
};
};
if (_local1 == 4){
_local2 = 0;
while (_local2 < 4) {
va[((va.length - 4) + _local2)].rotx((Math.PI * 0.5));
_local2++;
};
};
if (_local1 == 5){
_local2 = 0;
while (_local2 < 4) {
va[((va.length - 4) + _local2)].rotx((-(Math.PI) * 0.5));
_local2++;
};
};
_local1++;
};
cubeWidth = _local3;
}
public function doKeyDown(_arg1:KeyboardEvent):void{
if (!locked){
lastkeycode = _arg1.keyCode;
lastkeyascii = _arg1.charCode;
keyShiftDown = _arg1.shiftKey;
keyCtrlDown = _arg1.ctrlKey;
keyAltDown = _arg1.altKey;
if (_arg1.shiftKey){
if (_arg1.keyCode == 73){
showfps = !(showfps);
if (!showfps){
};
};
if (_arg1.keyCode == 72){
meshBase++;
};
if (_arg1.keyCode == 76){
meshBase--;
};
};
key_down = true;
dirty = true;
};
}
public function loadTile(_arg1:int, _arg2:String){
var ldr:Loader;
var tilenr = _arg1;
var url = _arg2;
try {
ldr = new Loader();
ldr.load(new URLRequest(url));
externalTiles[tilenr] = ldr;
updateBytesTotal();
} catch(error:Error) {
};
}
private function checkHotspots(_arg1:int, _arg2:int):void{
var d:Number;
var dx:Number;
var dy:Number;
var px:int;
var py:int;
var cpan:Number;
var ctilt:Number;
var v:Vector3d;
var ix:Number;
var iy:Number;
var face:Number;
var p:Point;
var facec:Number;
var cp:Number;
var pmm:Number;
var cw:Number;
var pd:Number;
var hsnr:Number;
var hs:Hotspot;
var npx:Number;
var npy:Number;
var x = _arg1;
var y = _arg2;
if (hasHotspots){
p = getPositionAngles(x, y);
cpan = p.x;
ctilt = p.y;
v = new Vector3d(0, 0, -1);
v.rotx(((ctilt * Math.PI) / 180));
v.roty(((cpan * Math.PI) / 180));
v.rotx(((-(tilt.cur) * Math.PI) / 180));
v.roty(((-(pan.cur) * Math.PI) / 180));
if (isCylinder){
cp = 0;
pmm = (pan.max - pan.min);
cp = (Math.atan2(v.x, -(v.z)) - ((pan.min * Math.PI) / 180));
if (cp < 0){
cp = (cp + (2 * Math.PI));
};
cp = (((6 * cp) * 360) / ((2 * Math.PI) * pmm));
face = Math.floor(cp);
ix = (cp - face);
cw = (cylinderImageWidth / 6);
px = Math.floor((cw * ix));
iy = (-(v.y) / Math.sqrt(((v.x * v.x) + (v.z * v.z))));
py = Math.floor((((((cylinderImageWidth / Math.PI) * (360 / pmm)) * iy) + cylinderImageHeight) / 2));
if (px < 0){
px = 0;
};
if (py < 0){
py = 0;
};
if (px >= cw){
px = (cw - 1);
};
if (py >= cylinderImageHeight){
py = (cylinderImageHeight - 1);
};
} else {
if ((((((v.z < 0)) && ((v.z <= -(Math.abs(v.x)))))) && ((v.z <= -(Math.abs(v.y)))))){
ix = (0.5 * (1 - (v.x / v.z)));
iy = (0.5 * (1 + (v.y / v.z)));
face = 0;
};
if ((((((v.x >= 0)) && ((v.x >= Math.abs(v.y))))) && ((v.x >= Math.abs(v.z))))){
ix = (0.5 * (1 + (v.z / v.x)));
iy = (0.5 * (1 - (v.y / v.x)));
face = 1;
};
if ((((((v.z >= 0)) && ((v.z >= Math.abs(v.x))))) && ((v.z >= Math.abs(v.y))))){
ix = (0.5 * (1 - (v.x / v.z)));
iy = (0.5 * (1 - (v.y / v.z)));
face = 2;
};
if ((((((v.x <= 0)) && ((v.x <= -(Math.abs(v.y)))))) && ((v.x <= -(Math.abs(v.z)))))){
ix = (0.5 * (1 + (v.z / v.x)));
iy = (0.5 * (1 + (v.y / v.x)));
face = 3;
};
if ((((((v.y >= 0)) && ((v.y >= Math.abs(v.x))))) && ((v.y >= Math.abs(v.z))))){
ix = (0.5 * (1 + (v.x / v.y)));
iy = (0.5 * (1 - (v.z / v.y)));
face = 4;
};
if ((((((v.y <= 0)) && ((v.y <= -(Math.abs(v.x)))))) && ((v.y <= -(Math.abs(v.z)))))){
ix = (0.5 * (1 - (v.x / v.y)));
iy = (0.5 * (1 - (v.z / v.y)));
face = 5;
};
px = Math.floor((tileSize * ix));
py = Math.floor((tileSize * iy));
};
facec = Math.floor((face / 3));
if (bmp_hs[facec] == null){
hsnr = 0;
} else {
pd = bmp_hs[facec].getPixel(px, py);
hsnr = 0;
if (!isNaN(pd)){
if ((((face == 2)) || ((face == 5)))){
hsnr = (pd % 0x0100);
};
if ((((face == 1)) || ((face == 4)))){
hsnr = (Math.floor((pd / 0x0100)) % 0x0100);
};
if ((((face == 0)) || ((face == 3)))){
hsnr = (Math.floor((pd / (0x0100 * 0x0100))) % 0x0100);
};
};
};
canv.useHandCursor = (hsnr > 0);
canv.buttonMode = (hsnr > 0);
if (hasOverlay){
canvOv.useHandCursor = canv.useHandCursor;
canvOv.buttonMode = canv.buttonMode;
};
if ((((hsnr > 0)) && (isInFocus))){
hs = this.qthotspots[hsnr];
if (hs != null){
if (currentHotspot != hs){
if (((!((onRollOutQtHotspot == null))) && (!((currentHotspot == null))))){
try {
onRollOutQtHotspot(currentHotspot.id, currentHotspot.title, currentHotspot.url, currentHotspot.target);
} catch(error:Error) {
};
};
if (hotspottxtWidth > 0){
hotspot_txt.autoSize = TextFieldAutoSize.NONE;
hotspot_txt.width = hotspottxtWidth;
hotspot_txt.height = hotspottxtHeight;
} else {
hotspot_txt.autoSize = TextFieldAutoSize.CENTER;
hotspot_txt.wordWrap = true;
};
hotspot_txt.htmlText = hs.title;
hotspot_txt.visible = (hs.title.length > 0);
hotspot_txt.backgroundColor = hotspottxtBackgroundColor;
hotspot_txt.borderColor = hotspottxtBorderColor;
hotspot_txt.border = hotspottxtBorder;
hotspot_txt.textColor = hotspottxtTextColor;
hotspot_txt.background = hotspottxtBackground;
hotspot_txt.selectable = false;
currentHotspot = hs;
if (((!((onRollOverQtHotspot == null))) && (!((currentHotspot == null))))){
try {
onRollOverQtHotspot(currentHotspot.id, currentHotspot.title, currentHotspot.url, currentHotspot.target);
} catch(error:Error) {
};
};
};
npx = ((hs.ofs.x + x) - (hotspot_txt.width / 2));
npy = ((hs.ofs.y + y) + 20);
if (((((((hotspottxtContinous) || (!((currentHotspot == hs))))) || ((Math.abs((hotspot_txt.x - npx)) > (hotspot_txt.width / 2))))) || (((Math.abs((hotspot_txt.y - npy)) - 25) > hotspot_txt.height)))){
hotspot_txt.x = npx;
hotspot_txt.y = npy;
};
};
} else {
if (((!((onRollOutQtHotspot == null))) && (!((currentHotspot == null))))){
try {
onRollOutQtHotspot(currentHotspot.id, currentHotspot.title, currentHotspot.url, currentHotspot.target);
} catch(error:Error) {
};
};
currentHotspot = null;
hotspot_txt.visible = false;
};
if (currentHotspotId != hsnr){
currentHotspotId = hsnr;
redrawCursor(null);
};
} else {
currentHotspotId = 0;
};
}
public function update(){
dirty = true;
}
public function setPan(_arg1:Number):void{
if (!isNaN(_arg1)){
dirty = ((dirty) || (!((pan.cur == _arg1))));
pan.cur = _arg1;
};
checkLimits();
}
public function setPanLimits(_arg1:Number, _arg2:Number):void{
pan.min = _arg1;
pan.max = _arg2;
checkLimits();
}
function doMouseDoubleClick(){
}
public function setFovLimits(_arg1:Number, _arg2:Number):void{
fov.min = _arg1;
fov.max = _arg2;
checkLimits();
}
public function setFov(_arg1:Number):void{
if (!isNaN(_arg1)){
if (fov.cur != _arg1){
setup_cube();
fov.cur = _arg1;
dirty = true;
};
};
checkLimits();
}
private function init_cylinder_tiles(){
loadBitmaps();
}
public function init(_arg1:Event):void{
var v:Vector3d;
var cf:Number;
var k:Number;
var text_fmt:TextFormat;
var event = _arg1;
started = false;
updateBytesTotal();
removeEventListener(Event.ENTER_FRAME, init);
if (isCylinder){
init_cylinder();
} else {
init_cube();
};
addChild(canv);
if (hasOverlay){
addChild(canvOv);
};
panomask = new Shape();
addChild(panomask);
rect.width = windowWidth;
rect.height = windowHeight;
isInFocus = false;
addEventListener(Event.ENTER_FRAME, doEnterFrame, false, 0, true);
try {
if (stage){
stage.addEventListener(KeyboardEvent.KEY_DOWN, doKeyDown, false, 0, true);
stage.addEventListener(KeyboardEvent.KEY_UP, doKeyUp, false, 0, true);
stage.addEventListener(Event.RESIZE, doStageResize, false, 0, true);
stage.addEventListener(MouseEvent.MOUSE_DOWN, doMouseDown, false, 0, true);
stage.addEventListener(MouseEvent.MOUSE_UP, doMouseUp, false, 0, true);
stage.addEventListener(MouseEvent.MOUSE_MOVE, doMouseMove, false, 0, true);
stage.addEventListener(MouseEvent.MOUSE_WHEEL, doMouseWheel, false, 0, true);
stage.addEventListener(Event.DEACTIVATE, doDeactivate, false, 0, true);
} else {
addEventListener(KeyboardEvent.KEY_DOWN, doKeyDown, false, 0, true);
addEventListener(KeyboardEvent.KEY_UP, doKeyUp, false, 0, true);
addEventListener(MouseEvent.MOUSE_DOWN, doMouseDown, false, 0, true);
addEventListener(MouseEvent.MOUSE_UP, doMouseUp, false, 0, true);
addEventListener(MouseEvent.MOUSE_MOVE, doMouseMove, false, 0, true);
addEventListener(MouseEvent.MOUSE_WHEEL, doMouseWheel, false, 0, true);
addEventListener(Event.DEACTIVATE, doDeactivate, false, 0, true);
};
} catch(err:Error) {
};
addEventListener(MouseEvent.MOUSE_MOVE, redrawCursor, false, 0, true);
canv.addEventListener(MouseEvent.MOUSE_OVER, doRollOver, false, 0, true);
canv.addEventListener(MouseEvent.MOUSE_OUT, doRollOut, false, 0, true);
if (hasOverlay){
canvOv.addEventListener(MouseEvent.MOUSE_OVER, doRollOver, false, 0, true);
canvOv.addEventListener(MouseEvent.MOUSE_OUT, doRollOut, false, 0, true);
};
stage.addEventListener(Event.MOUSE_LEAVE, hideCursor, false, 0, true);
try {
if (((stage) && (!((stageMode == ""))))){
if (stageMode == "no"){
stage.scaleMode = StageScaleMode.NO_SCALE;
};
if (stageMode == "stage"){
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
};
if (stageMode == "noborder"){
stage.scaleMode = StageScaleMode.NO_BORDER;
};
if (stageMode == "exact"){
stage.scaleMode = StageScaleMode.EXACT_FIT;
};
};
} catch(err:Error) {
};
setMeshDensity(0);
hotspot_txt = new TextField();
text_fmt = new TextFormat();
text_fmt.font = "Verdana";
text_fmt.size = 12;
text_fmt.color = 0;
text_fmt.align = TextFormatAlign.CENTER;
hotspot_txt.defaultTextFormat = text_fmt;
hotspot_txt.selectable = false;
hotspot_txt.borderColor = 0;
hotspot_txt.backgroundColor = 0xFFFFFF;
hotspot_txt.type = TextFieldType.DYNAMIC;
hotspot_txt.htmlText = "HS";
hotspot_txt.alpha = 70;
hotspot_txt.border = true;
hotspot_txt.background = true;
hotspot_txt.multiline = true;
hotspot_txt.visible = false;
addChild(hotspot_txt);
doStageResize(null);
updateMask();
cursor = new Bitmap();
cursor.bitmapData = new BitmapData(32, 32, true);
stage.addChild(cursor);
cursor.addEventListener(MouseEvent.MOUSE_OVER, doRollOver, false, 0, true);
cursor.addEventListener(MouseEvent.MOUSE_OUT, doRollOut, false, 0, true);
cursor.visible = false;
cursorData = new CursorDataClass(0, 0);
if (useOwnCursor){
Mouse.hide();
};
}
private function doRollOutHotspot(_arg1:Event){
var hs:MovieClip;
var i:int;
var e = _arg1;
hs = MovieClip(e.currentTarget);
if (onRollOutHotspot != null){
i = 0;
while (i < hotspots.length) {
if (hotspots[i].clip == hs){
try {
onRollOutHotspot(hotspots[i].id, hotspots[i].clip);
} catch(error:Error) {
};
};
i = (i + 1);
};
} else {
if (hs.hasOwnProperty("hstext")){
hs.hstext.visible = false;
};
};
}
public function stopAutorotate():void{
autoplay = false;
autoMoveTo = false;
}
public function getPan():Number{
return (pan.cur);
}
public function getPositionAngles(_arg1:int, _arg2:int):Point{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Point;
_local3 = (rect.height / (2 * Math.tan(((fov.cur * Math.PI) / 360))));
_local4 = (_arg1 - (rect.width / 2));
_local5 = (_arg2 - (rect.height / 2));
_local6 = new Point();
_local6.x = ((180 * Math.atan((_local4 / _local3))) / Math.PI);
_local6.y = ((180 * Math.atan((_local5 / Math.sqrt(((_local4 * _local4) + (_local3 * _local3)))))) / Math.PI);
return (_local6);
}
public function addTextHotspot(_arg1:String, _arg2:Number, _arg3:Number, _arg4:String, _arg5:Number=0, _arg6:Number=0){
var _local7:MovieClip;
_local7 = new UrlHotspotClass();
_local7.hstext.htmlText = _arg4;
if (_arg5 > 0){
_local7.hstext.x = (_local7.hstext.x + ((_local7.hstext.width - _arg5) / 2));
_local7.hstext.width = _arg5;
};
if (_arg6 > 0){
_local7.hstext.height = _arg6;
};
if ((((_arg6 == 0)) && ((_arg5 == 0)))){
_local7.hstext.autoSize = TextFieldAutoSize.CENTER;
};
_local7.hstext.visible = false;
_local7.useHandCursor = false;
addHotspot(_arg1, _arg2, _arg3, _local7);
}
public function controller_callback(_arg1:String, _arg2:Number){
if (!isNaN(_arg2)){
if (_arg1 == "zoom"){
changeFov(-(_arg2));
return (true);
};
if (_arg1 == "fov"){
changeFov(_arg2);
return (true);
};
if (_arg1 == "pan"){
changePan(_arg2);
return (true);
};
if (_arg1 == "tilt"){
changeTilt(_arg2);
return (true);
};
if (_arg1 == "quality"){
if (_arg2 < 3){
cubeTiles = 4;
};
cubeTiles = _arg2;
return (true);
};
if (_arg1 == "autoplay"){
autoplay = !((_arg2 == 0));
if (_arg2 == 0){
resetlastaction();
};
return (true);
};
if (_arg1 == "autorotate"){
autorotate = !((_arg2 == 0));
return (true);
};
} else {
if ((((_arg1 == "zoom")) || ((_arg1 == "fov")))){
return (fov.cur);
};
if (_arg1 == "pan"){
return (pan.cur);
};
if (_arg1 == "tilt"){
return (tilt.cur);
};
if (_arg1 == "autoplay"){
return ((autoplay) ? 1 : 0);
};
if (_arg1 == "autorotate"){
return ((autorotate) ? 1 : 0);
};
if (_arg1 == "flags"){
return (controllerFlags);
};
};
return (false);
}
private function loadBitmaps():void{
var cf:int;
var imgNr:int;
var notLoaded:Boolean;
var tmpBmp:BitmapData;
var tileofs:int;
var ldr:Loader;
var sx:int;
var sy:int;
var loadedTile:Boolean;
var mat:Matrix;
notLoaded = false;
tileofs = ((tileSize + (subtiles - 1)) / subtiles);
cf = 0;
while (cf < 6) {
if ((((bmpTile[cf] == null)) && ((((tileSize > 0)) || (isCylinder))))){
if (isCylinder){
bmpTile[cf] = new BitmapData((cylinderImageWidth / 6), cylinderImageHeight, false, preloadColor);
if (hasOverlay){
bmpTileOverlay[cf] = new BitmapData((cylinderImageWidth / 6), cylinderImageHeight, true);
};
} else {
bmpTile[cf] = new BitmapData(tileSize, tileSize, false, preloadColor);
if (hasOverlay){
bmpTileOverlay[cf] = new BitmapData(tileSize, tileSize, true);
};
};
if (preloadColor >= 16777216){
bmpTile[cf].noise(23, 0, 95, 7, true);
};
};
cf = (cf + 1);
};
cf = 0;
while (cf < 6) {
if (externalTiles[cf] != null){
ldr = externalTiles[cf];
if (!bmp_loaded[cf]){
try {
if (tileSize <= 0){
notLoaded = true;
tileSize = ldr.width;
} else {
if (ldr.content != null){
bmpTile[cf].draw(ldr.content);
bmp_loaded[cf] = (ldr.contentLoaderInfo.bytesLoaded == ldr.contentLoaderInfo.bytesTotal);
} else {
notLoaded = true;
};
if (ldr.contentLoaderInfo.bytesLoaded < ldr.contentLoaderInfo.bytesTotal){
notLoaded = true;
};
};
} catch(error:Error) {
notLoaded = true;
};
};
} else {
if (hasPrevImages){
loadedTile = false;
imgNr = ((cf * subtiles) * subtiles);
sy = 0;
while (sy < subtiles) {
sx = 0;
while (sx < subtiles) {
if (bmp_loaded[imgNr]){
loadedTile = true;
};
imgNr = (imgNr + 1);
sx = (sx + 1);
};
sy = (sy + 1);
};
if (!loadedTile){
try {
if (!bmp_loadedpf[cf]){
tmpBmp = imageRepos.getImage(("pre" + cf));
bmp_loadedpf[cf] = true;
mat = new Matrix();
mat.scale((bmpTile[cf].width / tmpBmp.width), (bmpTile[cf].height / tmpBmp.height));
bmpTile[cf].draw(tmpBmp, mat, null, null, null, true);
};
} catch(error:Error) {
};
};
};
imgNr = ((cf * subtiles) * subtiles);
sy = 0;
while (sy < subtiles) {
sx = 0;
while (sx < subtiles) {
try {
if (!bmp_loaded[imgNr]){
tmpBmp = imageRepos.getImage(("img" + imgNr));
bmpTile[cf].copyPixels(tmpBmp, tmpBmp.rect, new Point((sx * tileofs), (sy * tileofs)));
bmp_loaded[imgNr] = true;
if (hasOverlay){
tmpBmp = imageRepos.getImage(("imgo" + imgNr));
bmpTileOverlay[cf].copyPixels(tmpBmp, tmpBmp.rect, new Point((sx * tileofs), (sy * tileofs)));
};
};
} catch(error:Error) {
notLoaded = true;
};
imgNr = (imgNr + 1);
sx = (sx + 1);
};
sy = (sy + 1);
};
};
cf = (cf + 1);
};
if (hasHotspots){
cf = 0;
while (cf < 2) {
if (externalTiles[(cf + 6)] != null){
ldr = externalTiles[(cf + 6)];
try {
if (ldr.content != null){
if (!bmp_loaded[(cf + 6)]){
bmp_hs[cf] = new BitmapData(tileSize, tileSize, false, preloadColor);
bmp_hs[cf].draw(ldr.content);
bmp_loaded[(cf + 6)] = (ldr.contentLoaderInfo.bytesLoaded == ldr.contentLoaderInfo.bytesTotal);
};
} else {
notLoaded = true;
};
if (ldr.contentLoaderInfo.bytesLoaded < ldr.contentLoaderInfo.bytesTotal){
notLoaded = true;
};
} catch(error:Error) {
notLoaded = true;
};
} else {
if (bmp_hs[cf] == null){
try {
bmp_hs[cf] = imageRepos.getImage(("hs" + cf));
} catch(error:Error) {
notLoaded = true;
};
};
};
cf = (cf + 1);
};
};
if (!notLoaded){
completed = true;
};
}
public function getFov():Number{
return (fov.cur);
}
public function bytesTotal():int{
return (intBytesTotal);
}
public function decodeStrip(_arg1:BitmapData):void{
var _local2:int;
var _local3:int;
var _local4:Rectangle;
var _local5:int;
_local2 = _arg1.width;
_local3 = _arg1.height;
_local5 = 0;
while (_local5 < 6) {
subtiles = 1;
if (_local2 < _local3){
tileSize = _local2;
_local4 = new Rectangle(0, (tileSize * _local5), tileSize, tileSize);
} else {
tileSize = _local3;
_local4 = new Rectangle((tileSize * _local5), 0, tileSize, tileSize);
};
bmpTile[_local5] = new BitmapData(tileSize, tileSize, false);
bmpTile[_local5].copyPixels(_arg1, _local4, new Point(0, 0));
bmp_loaded[_local5] = true;
_local5++;
};
}
public function setAutorotate(_arg1:Number, _arg2:Number, _arg3:Number=0, _arg4:Boolean=false):void{
autorotate_pan = _arg1;
autorotate = !((_arg1 == 0));
if (!isNaN(_arg2)){
autorotate_timeout = _arg2;
};
if (!isNaN(_arg3)){
autorotate_tilt_force = _arg3;
};
autorotate_onlyinfocus = (_arg4 == true);
if (_arg1 == 0){
autoplay = false;
};
}
public function init_faces():void{
if (isCylinder){
init_cylinder_tiles();
} else {
init_cubefaces();
};
started = true;
dirtyMask = true;
dirty = true;
}
public function doMouseMove(_arg1:MouseEvent):void{
mcur.x = _arg1.stageX;
mcur.y = _arg1.stageY;
}
public function addUrlHotspot(_arg1:String, _arg2:Number, _arg3:Number, _arg4:String, _arg5:String, _arg6:String, _arg7:Number=0, _arg8:Number=0){
var _local9:MovieClip;
_local9 = new UrlHotspotClass();
_local9.hstext.htmlText = _arg4;
if (_arg7 > 0){
_local9.hstext.x = (_local9.hstext.x + ((_local9.hstext.width - _arg7) / 2));
_local9.hstext.width = _arg7;
};
if (_arg8 > 0){
_local9.hstext.height = _arg8;
};
if ((((_arg8 == 0)) && ((_arg7 == 0)))){
_local9.hstext.autoSize = TextFieldAutoSize.CENTER;
};
_local9.buttonMode = true;
_local9.hstext.visible = false;
addHotspot(_arg1, _arg2, _arg3, _local9, _arg5, _arg6);
}
public function setWindowPos(_arg1:Number, _arg2:Number){
rect.left = _arg1;
rect.top = _arg2;
rect.width = windowWidth;
rect.height = windowHeight;
dirtyMask = true;
}
public function init_cube():void{
var _local1:Number;
var _local2:int;
_local2 = ((6 * subtiles) * subtiles);
_local1 = 0;
while (_local1 < _local2) {
bmp_loaded.push(false);
_local1++;
};
_local1 = 0;
while (_local1 < 6) {
bmp_loadedpf.push(false);
_local1++;
};
setup_cube();
setMeshDensity(0);
}
public function setLocked(_arg1:Boolean):void{
locked = _arg1;
}
public function setWindowSize(_arg1:Number, _arg2:Number){
rect.width = _arg1;
windowWidth = _arg1;
rect.height = _arg2;
windowHeight = _arg2;
windowScaleIgnore = (_arg1 > 0);
dirtyMask = true;
}
public function init_cylinder(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local7 = (pan.max - pan.min);
if (meshBase > 5){
cylTilesXBase = (12 * Math.floor(((meshBase - 3) / 2)));
meshCylBase = Math.floor(((meshBase + 4) / 2));
} else {
cylTilesXBase = 12;
meshCylBase = 4;
};
cylTilesXBase = Math.ceil((((cylTilesXBase * _local7) / 360) / cylTilesXS));
if ((cylTilesXBase * cylTilesXS) < 10){
cylTilesXBase = Math.ceil((10 / cylTilesXS));
};
cylTilesX = cylTilesXBase;
isCylinder = true;
if (cylTilesXS < 1){
cylTilesXS = 1;
};
_local1 = 0;
while (_local1 < cylTilesXS) {
bmp_loaded.push(false);
bmp_loadedpf.push(false);
_local1++;
};
if (bmp_loaded[0]){
_local4 = (cylTilesXS * bmpTile[0].width);
_local5 = bmpTile[0].height;
} else {
_local4 = cylinderImageWidth;
_local5 = cylinderImageHeight;
};
setup_cylinder(_local4, _local5);
_local8 = ((180 / Math.PI) * Math.atan(((_local5 * Math.PI) / (_local4 * (360 / _local7)))));
if (tilt.min < -(_local8)){
tilt.min = -(_local8);
};
if (tilt.max > _local8){
tilt.max = _local8;
};
checkLimits();
}
private function init_cubefaces():void{
loadBitmaps();
setup_cube();
}
public function moveTo(_arg1:Number, _arg2:Number, _arg3:Number=0, _arg4:Number=0.4){
pan.dest = _arg1;
if (_arg3 == 0){
_arg3 = fov.cur;
};
while ((pan.dest - pan.cur) > 180) {
pan.dest = (pan.dest - 360);
};
while ((pan.dest - pan.cur) < -180) {
pan.dest = (pan.dest + 360);
};
tilt.dest = _arg2;
while ((tilt.dest - tilt.cur) > 180) {
tilt.dest = (tilt.dest - 360);
};
while ((tilt.dest - tilt.cur) < -180) {
tilt.dest = (tilt.dest + 360);
};
fov.dest = _arg3;
if (((isNaN(_arg4)) || ((_arg4 <= 0)))){
autoMoveSpeed = 0.4;
} else {
autoMoveSpeed = _arg4;
};
autoMoveTo = true;
autoplay = true;
}
public function setTilt(_arg1:Number):void{
if (!isNaN(_arg1)){
dirty = ((dirty) || (!((tilt.cur == _arg1))));
tilt.cur = _arg1;
};
checkLimits();
}
public function xmlConfig(_arg1:XML):void{
var _local2:PanoConfigXML;
_local2 = new PanoConfigXML();
_local2.applyConfig(_arg1, this);
}
public function removeAllListener():void{
removeEventListener(Event.ENTER_FRAME, doEnterFrame);
removeEventListener(MouseEvent.MOUSE_DOWN, doMouseDown);
removeEventListener(MouseEvent.MOUSE_UP, doMouseUp);
removeEventListener(MouseEvent.MOUSE_MOVE, doMouseMove);
removeEventListener(MouseEvent.MOUSE_WHEEL, doMouseWheel);
removeEventListener(KeyboardEvent.KEY_DOWN, doKeyDown);
removeEventListener(KeyboardEvent.KEY_UP, doKeyUp);
removeEventListener(Event.DEACTIVATE, doDeactivate);
try {
if (stage){
stage.removeEventListener(Event.RESIZE, doStageResize);
stage.removeEventListener(Event.ENTER_FRAME, doEnterFrame);
stage.removeEventListener(MouseEvent.MOUSE_DOWN, doMouseDown);
stage.removeEventListener(MouseEvent.MOUSE_UP, doMouseUp);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, doMouseMove);
stage.removeEventListener(MouseEvent.MOUSE_WHEEL, doMouseWheel);
stage.removeEventListener(KeyboardEvent.KEY_DOWN, doKeyDown);
stage.removeEventListener(KeyboardEvent.KEY_UP, doKeyUp);
stage.removeEventListener(Event.DEACTIVATE, doDeactivate);
};
} catch(err:Error) {
};
removeEventListener(MouseEvent.MOUSE_MOVE, redrawCursor);
canv.removeEventListener(MouseEvent.MOUSE_OVER, doRollOver);
canv.removeEventListener(MouseEvent.MOUSE_OUT, doRollOut);
if (hasOverlay){
canvOv.removeEventListener(MouseEvent.MOUSE_OVER, doRollOver);
canvOv.removeEventListener(MouseEvent.MOUSE_OUT, doRollOut);
};
cursor.removeEventListener(MouseEvent.MOUSE_OVER, doRollOver);
cursor.removeEventListener(MouseEvent.MOUSE_OUT, doRollOut);
stage.removeEventListener(Event.MOUSE_LEAVE, hideCursor);
}
private function DisplayTile(_arg1:BitmapData, _arg2:Point, _arg3:Point, _arg4:Vector3d, _arg5:Vector3d, _arg6:Vector3d, _arg7:Vector3d, _arg8:Number, _arg9:Number, _arg10:BitmapData=null):void{
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Vector3d;
var _local16:Vector3d;
var _local17:Point;
var _local18:Point;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Matrix;
var _local23:Matrix;
_local11 = -0.01;
_local12 = rect.width;
_local13 = rect.height;
if (_arg1 == null){
return;
};
if ((((((((((_arg9 < 5)) && (!(isCylinder)))) || ((((_arg9 < 2)) && (isCylinder))))) || ((((((((_arg4.pz < _local11)) && ((_arg5.pz < _local11)))) && ((_arg6.pz < _local11)))) && ((_arg7.pz < _local11)))))) && ((((_arg9 < 1)) || ((((((((((((((_arg4.px >= 0)) || ((_arg5.px >= 0)))) || ((_arg6.px >= 0)))) || ((_arg7.px >= 0)))) && ((((((((_arg4.py >= 0)) || ((_arg5.py >= 0)))) || ((_arg6.py >= 0)))) || ((_arg7.py >= 0)))))) && ((((((((_arg4.px <= _local12)) || ((_arg5.px <= _local12)))) || ((_arg6.px <= _local12)))) || ((_arg7.px <= _local12)))))) && ((((((((_arg4.py <= _local13)) || ((_arg5.py <= _local13)))) || ((_arg6.py <= _local13)))) || ((_arg7.py <= _local13)))))))))){
if ((_arg8 > 0)){
_local15 = new Vector3d();
_local16 = new Vector3d();
_local19 = (rect.width >> 1);
_local20 = (rect.height >> 1);
if (((((_arg8 & 1) == 0)) || (isCylinder))){
_local15.x = ((_arg4.x + _arg6.x) * 0.5);
_local15.y = ((_arg4.y + _arg6.y) * 0.5);
_local15.z = (_local15.pz = ((_arg4.z + _arg6.z) * 0.5));
_local16.x = ((_arg5.x + _arg7.x) * 0.5);
_local16.y = ((_arg5.y + _arg7.y) * 0.5);
_local16.z = (_local16.pz = ((_arg5.z + _arg7.z) * 0.5));
if (_local15.z < 0){
_local21 = ((_local15.z)>-1E-5) ? 10000 : (-(ed) / _local15.z);
_local15.px = ((_local15.x * _local21) + _local19);
_local15.py = ((_local15.y * _local21) + _local20);
} else {
_local15.px = ((_local15.x * 1000) + _local19);
_local15.py = ((_local15.y * 1000) + _local20);
};
if (_local16.z < 0){
_local21 = ((_local16.z)>-1E-5) ? 10000 : (-(ed) / _local16.z);
_local16.px = ((_local16.x * _local21) + _local19);
_local16.py = ((_local16.y * _local21) + _local20);
} else {
_local16.px = ((_local16.x * 1000) + _local19);
_local16.py = ((_local16.y * 1000) + _local20);
};
_local18 = new Point(_arg3.x, (_arg3.y * 2));
_local17 = new Point(_arg2.x, (_arg2.y + (1 / _local18.y)));
DisplayTile(_arg1, _arg2, _local18, _arg4, _arg5, _local15, _local16, (_arg8 - 1), (_arg9 + 1), _arg10);
DisplayTile(_arg1, _local17, _local18, _local15, _local16, _arg6, _arg7, (_arg8 - 1), (_arg9 + 1), _arg10);
} else {
_local15.x = ((_arg4.x + _arg5.x) * 0.5);
_local15.y = ((_arg4.y + _arg5.y) * 0.5);
_local15.z = (_local15.pz = ((_arg4.z + _arg5.z) * 0.5));
_local16.x = ((_arg6.x + _arg7.x) * 0.5);
_local16.y = ((_arg6.y + _arg7.y) * 0.5);
_local16.z = (_local16.pz = ((_arg6.z + _arg7.z) * 0.5));
if (_local15.z < 0){
_local21 = ((_local15.z)>-1E-5) ? 10000 : (-(ed) / _local15.z);
_local15.px = ((_local15.x * _local21) + _local19);
_local15.py = ((_local15.y * _local21) + _local20);
} else {
_local15.px = ((_local15.x * 1000) + _local19);
_local15.py = ((_local15.y * 1000) + _local20);
};
if (_local16.z < 0){
_local21 = ((_local16.z)>-1E-5) ? 10000 : (-(ed) / _local16.z);
_local16.px = ((_local16.x * _local21) + _local19);
_local16.py = ((_local16.y * _local21) + _local20);
} else {
_local16.px = ((_local16.x * 1000) + _local19);
_local16.py = ((_local16.y * 1000) + _local20);
};
_local18 = new Point((_arg3.x * 2), _arg3.y);
_local17 = new Point((_arg2.x + (1 / _local18.x)), _arg2.y);
DisplayTile(_arg1, _arg2, _local18, _arg4, _local15, _arg6, _local16, (_arg8 - 1), (_arg9 + 1), _arg10);
DisplayTile(_arg1, _local17, _local18, _local15, _arg5, _local16, _arg7, (_arg8 - 1), (_arg9 + 1), _arg10);
};
} else {
_local22 = new Matrix();
_local23 = new Matrix();
_local22.a = ((_arg5.px - _arg4.px) * _arg3.x);
_local22.c = ((_arg7.px - _arg5.px) * _arg3.y);
_local22.b = ((_arg5.py - _arg4.py) * _arg3.x);
_local22.d = ((_arg7.py - _arg5.py) * _arg3.y);
_local22.tx = ((_arg4.px - (_arg2.x * _local22.a)) - (_arg2.y * _local22.c));
_local22.ty = ((_arg4.py - (_arg2.x * _local22.b)) - (_arg2.y * _local22.d));
_local23.a = ((_arg7.px - _arg6.px) * _arg3.x);
_local23.c = ((_arg6.px - _arg4.px) * _arg3.y);
_local23.b = ((_arg7.py - _arg6.py) * _arg3.x);
_local23.d = ((_arg6.py - _arg4.py) * _arg3.y);
_local23.tx = ((_arg4.px - (_arg2.x * _local23.a)) - (_arg2.y * _local23.c));
_local23.ty = ((_arg4.py - (_arg2.x * _local23.b)) - (_arg2.y * _local23.d));
canv.graphics.beginBitmapFill(_arg1, _local22, false, bmpSmooth);
canv.graphics.moveTo(_arg4.px, _arg4.py);
canv.graphics.lineTo(_arg5.px, _arg5.py);
canv.graphics.lineTo(_arg7.px, _arg7.py);
canv.graphics.endFill();
canv.graphics.beginBitmapFill(_arg1, _local23, false, bmpSmooth);
canv.graphics.moveTo(_arg4.px, _arg4.py);
canv.graphics.lineTo(_arg6.px, _arg6.py);
canv.graphics.lineTo(_arg7.px, _arg7.py);
canv.graphics.endFill();
if (_arg10 != null){
canvOv.graphics.beginBitmapFill(_arg10, _local22, false, bmpSmooth);
canvOv.graphics.moveTo(_arg4.px, _arg4.py);
canvOv.graphics.lineTo(_arg5.px, _arg5.py);
canvOv.graphics.lineTo(_arg7.px, _arg7.py);
canvOv.graphics.endFill();
canvOv.graphics.beginBitmapFill(_arg10, _local23, false, bmpSmooth);
canvOv.graphics.moveTo(_arg4.px, _arg4.py);
canvOv.graphics.lineTo(_arg6.px, _arg6.py);
canvOv.graphics.lineTo(_arg7.px, _arg7.py);
canvOv.graphics.endFill();
};
};
};
}
public function changeTilt(_arg1:Number, _arg2:Boolean=false, _arg3:Boolean=false):void{
if (!isNaN(_arg1)){
setTilt((tilt.cur + _arg1));
if (_arg2){
dTilt = _arg1;
};
if (_arg3){
resetlastaction();
autoplay = false;
};
};
}
public function doPaint():void{
try {
checkLimits();
if (isCylinder){
paint_cylinder(1);
} else {
setup_cube();
paint_cube(1);
};
} catch(error:Error) {
};
if (dirtyMask){
dirtyMask = false;
updateMask();
};
}
public function setAlphaOverlay(_arg1:Number):void{
alphaOverlay = _arg1;
canvOv.alpha = _arg1;
}
public function doRollOut(_arg1:MouseEvent):void{
isInFocus = false;
if (((useOwnCursor) || (useOwnMoveCursor))){
cursor.visible = false;
Mouse.show();
};
}
private function paint_cylinder(_arg1: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;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Vector3d;
var _local25:Vector3d;
var _local26:Vector3d;
var _local27:Vector3d;
var _local28:Vector3d;
var _local29:Vector3d;
var _local30:Point;
var _local31:Point;
var _local32:Point;
var _local33:Point;
var _local34:Point;
var _local35:Number;
var _local36:Number;
var _local37:Number;
var _local38:Number;
_local14 = 50;
_local15 = 1;
_local16 = 0;
_local17 = -0.15;
_local25 = new Vector3d();
if (cubeTiles < 2){
cubeTiles = 2;
};
transformCorners();
framecnt++;
_local15 = 0;
_local16 = -1;
if (_local16 >= 0){
};
_local18 = rect.width;
_local20 = (_local18 / 2);
_local19 = rect.height;
_local21 = (_local19 / 2);
canv.graphics.clear();
if (hasOverlay){
canvOv.graphics.clear();
canvOv.alpha = alphaOverlay;
};
ed = (_local21 / Math.tan(((fov.cur * Math.PI) / 360)));
_local35 = (fov.cur / 2);
_local36 = ((Math.atan(((rect.width / rect.height) * Math.tan(((_local35 * Math.PI) / 180)))) * 180) / Math.PI);
cylTilesX = (cylTilesXBase / 1);
_local37 = (cylTilesXBase / cylTilesX);
_local11 = 0;
while (_local11 < cylTilesXS) {
_local22 = bmpTile[_local11].width;
_local23 = bmpTile[_local11].height;
_local34 = new Point((cylTilesX / _local22), (1 / _local23));
_local4 = 0;
while (_local4 < cylTilesX) {
_local38 = ((((cylTilesX * _local11) * _local37) + _local4) * 4);
_local26 = vat[_local38];
_local28 = vat[(_local38 + 2)];
_local38 = ((((((cylTilesX * _local11) * _local37) + _local4) + _local37) - 1) * 4);
_local27 = vat[(_local38 + 1)];
_local29 = vat[(_local38 + 3)];
if ((((((((_local26.z < 0)) || ((_local27.z < 0)))) || ((_local28.z < 0)))) || ((_local29.z < 0)))){
_local26.project(ed, _local20, _local21);
_local27.project(ed, _local20, _local21);
_local28.project(ed, _local20, _local21);
_local29.project(ed, _local20, _local21);
DisplayTile(bmpTile[_local11], new Point(((_local4 * _local22) / cylTilesX), 0), _local34, _local26, _local27, _local28, _local29, cylTilesY, 0);
};
_local4++;
};
_local11++;
};
}
private function doRollOverHotspot(_arg1:Event){
var hs:MovieClip;
var i:int;
var e = _arg1;
hs = MovieClip(e.currentTarget);
if (onRollOverHotspot != null){
i = 0;
while (i < hotspots.length) {
if (hotspots[i].clip == hs){
try {
onRollOverHotspot(hotspots[i].id, hotspots[i].clip);
} catch(error:Error) {
};
};
i = (i + 1);
};
} else {
if (hs.hasOwnProperty("hstext")){
hs.hstext.visible = true;
};
};
}
public function doMouseDown(_arg1:MouseEvent):void{
var _local2:Date;
var _local3:Number;
mdown.x = _arg1.stageX;
mdown.y = _arg1.stageY;
mcur.x = _arg1.stageX;
mcur.y = _arg1.stageY;
if (!locked){
if (((!(useOwnCursor)) && (useOwnMoveCursor))){
Mouse.hide();
cursor.visible = true;
redrawCursor(_arg1);
};
_local2 = new Date();
_local3 = _local2.getTime();
if ((_local3 - lastMouseDown) < 500){
};
lastMouseDown = _local3;
if (isInFocus){
this.turn = true;
autoplay = false;
};
if (useOwnCursor){
redrawCursor(_arg1);
};
};
}
public function cleanup():void{
stage.removeChild(cursor);
removeAllListener();
}
function doMouseClick(){
var request:URLRequest;
if (currentHotspot != null){
if (onClickQtHotspot != null){
try {
onClickQtHotspot(currentHotspot.id, currentHotspot.title, currentHotspot.url, currentHotspot.target);
} catch(error:Error) {
};
} else {
if (currentHotspot.onCallback != null){
currentHotspot.onCallback(currentHotspot.id);
} else {
if (currentHotspot.url.length > 0){
request = new URLRequest(currentHotspot.url);
navigateToURL(request, currentHotspot.target);
};
};
};
};
}
public function changePan(_arg1:Number, _arg2:Boolean=false, _arg3:Boolean=false):void{
if (!isNaN(_arg1)){
setPan((pan.cur + _arg1));
if (_arg2){
dPan = _arg1;
};
if (_arg3){
resetlastaction();
autoplay = false;
};
};
}
public function resetlastaction():void{
var _local1:Date;
_local1 = new Date();
lastaction_dt = _local1.getTime();
}
public function addHotspot(_arg1:String, _arg2:Number, _arg3:Number, _arg4:MovieClip, _arg5:String="", _arg6:String=""){
var _local7:Hotspot;
_local7 = new Hotspot();
_local7.id = _arg1;
_local7.posPan = _arg2;
_local7.posTilt = _arg3;
_local7.clip = _arg4;
_local7.url = _arg5;
_local7.target = _arg6;
if (hs_local == 1){
_local7.ofs.x = 0;
_local7.ofs.y = 0;
} else {
_local7.ofs.x = canv.x;
_local7.ofs.y = canv.y;
};
_arg4.visible = false;
if (hasOverlay){
canvOv.addChild(_arg4);
} else {
canv.addChild(_arg4);
};
if (enable_callback){
_arg4.addEventListener(MouseEvent.CLICK, doClickHotspot);
_arg4.addEventListener(MouseEvent.MOUSE_OVER, doRollOverHotspot);
_arg4.addEventListener(MouseEvent.MOUSE_OUT, doRollOutHotspot);
};
hotspots.push(_local7);
}
public function changeFov(_arg1:Number, _arg2:Boolean=false, _arg3:Boolean=false):void{
if (!isNaN(_arg1)){
setFov((fov.cur + _arg1));
if (_arg2){
dFov = _arg1;
};
if (_arg3){
resetlastaction();
autoplay = false;
};
};
}
public function doMouseUp(_arg1:MouseEvent):void{
var _local2:Date;
var _local3:Number;
if (((!(useOwnCursor)) && (useOwnMoveCursor))){
Mouse.show();
cursor.visible = false;
};
if (turn){
turn = false;
dirty = true;
};
_local2 = new Date();
_local3 = _local2.getTime();
if (((((((_local3 - lastMouseDown) < 500)) && ((Math.abs((mdown.x - _arg1.stageX)) < 10)))) && ((Math.abs((mdown.y - _arg1.stageY)) < 10)))){
doMouseClick();
};
if (useOwnCursor){
redrawCursor(_arg1);
};
}
public function getTilt():Number{
return (tilt.cur);
}
public function setTiltLimits(_arg1:Number, _arg2:Number):void{
tilt.min = _arg1;
tilt.max = _arg2;
checkLimits();
}
public function hideCursor(_arg1:Event):void{
if (((useOwnCursor) || (useOwnMoveCursor))){
cursor.visible = false;
Mouse.show();
};
}
private function checkLimits():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;
_local1 = (fov.cur / 2);
if (_local1 > 55){
_local1 = 55;
fov.cur = (_local1 * 2);
};
_local2 = ((Math.atan(((rect.width / rect.height) * Math.tan(((_local1 * Math.PI) / 180)))) * 180) / Math.PI);
if (_local2 > 55){
_local2 = 55;
_local1 = ((Math.atan(((rect.height / rect.width) * Math.tan(((_local2 * Math.PI) / 180)))) * 180) / Math.PI);
fov.cur = (_local1 * 2);
};
if (fov.cur > fov.max){
fov.cur = fov.max;
};
if (fov.cur < fov.min){
fov.cur = fov.min;
};
if (fov.cur > (tilt.max - tilt.min)){
fov.cur = (tilt.max - tilt.min);
};
if (tilt.max < 90){
if ((tilt.cur + _local1) > tilt.max){
tilt.cur = (tilt.max - _local1);
};
} else {
if (tilt.cur > tilt.max){
tilt.cur = tilt.max;
};
};
if (tilt.min > -90){
if ((tilt.cur - _local1) < tilt.min){
tilt.cur = (tilt.min + _local1);
};
} else {
if (tilt.cur < tilt.min){
tilt.cur = tilt.min;
};
};
if ((pan.max - pan.min) < 359.99){
_local3 = 0;
if (tilt.cur != 0){
_local6 = (rect.width / 2);
_local7 = (rect.height / 2);
_local4 = (_local6 * Math.tan(((_local2 * Math.PI) / 180)));
_local5 = (_local7 * Math.tan(((_local1 * Math.PI) / 180)));
_local8 = (_local7 / Math.tan(((Math.abs(tilt.cur) * Math.PI) / 180)));
_local8 = (_local8 - _local5);
if (_local8 > 0){
_local3 = ((Math.atan((1 / (_local8 / _local5))) * 180) / Math.PI);
_local3 = ((_local3 * (pan.max - pan.min)) / 360);
};
};
if ((pan.cur + (_local2 + _local3)) > pan.max){
pan.cur = (pan.max - (_local2 + _local3));
if (autoplay){
autorotate_pan = -(autorotate_pan);
dPan = 0;
};
};
if ((pan.cur - (_local2 + _local3)) < pan.min){
pan.cur = (pan.min + (_local2 + _local3));
if (autoplay){
autorotate_pan = -(autorotate_pan);
dPan = 0;
};
};
if ((tilt.cur + _local1) > 90){
tilt.cur = (90 - _local1);
};
if ((tilt.cur - _local1) < -90){
tilt.cur = (-90 + _local1);
};
};
}
private function updateBytesTotal():void{
var v:int;
var cf:int;
var ldr:Loader;
v = 0;
if (root){
v = root.loaderInfo.bytesTotal;
};
cf = 0;
while (cf < 8) {
if (externalTiles[cf] != null){
ldr = externalTiles[cf];
try {
v = (v + ldr.contentLoaderInfo.bytesTotal);
} catch(e:Error) {
};
};
cf = (cf + 1);
};
intBytesTotal = v;
}
private function updateMask():void{
if (((useMask) && (started))){
panomask.graphics.clear();
panomask.graphics.moveTo(rect.left, rect.top);
panomask.graphics.beginFill(136);
panomask.graphics.lineTo((rect.right + 1), rect.top);
panomask.graphics.lineTo((rect.right + 1), (rect.bottom + 1));
panomask.graphics.lineTo(rect.left, (rect.bottom + 1));
panomask.graphics.endFill();
canv.mask = panomask;
canv.x = rect.x;
canv.y = rect.y;
if (hasOverlay){
canvOv.mask = panomask;
canvOv.x = rect.x;
canvOv.y = rect.y;
};
} else {
canv.mask = null;
if (hasOverlay){
canvOv.mask = null;
};
};
}
public function doDeactivate(_arg1:Event):void{
isInFocus = false;
}
public function reposElements():void{
var _local1:Number;
var _local2:Number;
dirtyMask = true;
}
private function updateHotspots(_arg1:Matrix4d){
var _local2:Number;
var _local3:Vector3d;
var _local4:Vector3d;
var _local5:Hotspot;
var _local6:Number;
_local3 = new Vector3d();
_local6 = ((rect.height / 2) / Math.tan(((fov.cur * Math.PI) / 360)));
_local2 = 0;
while (_local2 < this.hotspots.length) {
_local5 = this.hotspots[_local2];
_local3.init(0, 0, -1);
_local3.rotx(((_local5.posTilt * Math.PI) / 180));
_local3.roty(((-(_local5.posPan) * Math.PI) / 180));
_local4 = new Vector3d();
_arg1.mulVector(_local3, _local4);
_local4.project(_local6, (rect.width / 2), (rect.height / 2));
_local5.clip.visible = (_local4.pz < 0);
_local5.clip.x = (_local5.ofs.x + _local4.px);
_local5.clip.y = (_local5.ofs.y + _local4.py);
_local2++;
};
}
public function setup_cylinder(_arg1:Number, _arg2: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;
_local7 = (pan.max - pan.min);
va = new Array();
_local8 = (_arg1 / (cylTilesX * cylTilesXS));
_local3 = 0;
while (_local3 < (cylTilesX * cylTilesXS)) {
_local9 = Math.cos(((Math.PI / (cylTilesX * cylTilesXS)) * (_local7 / 360)));
_local10 = (((Math.PI / (cylTilesX * cylTilesXS)) * (_local7 / 360)) * 1);
_local11 = ((-(_local10) / _local8) * _arg2);
va.push(new Vector3d(_local10, _local11, _local9, (_local3 * _local8), 0));
va.push(new Vector3d(-(_local10), _local11, _local9, ((_local3 + 1) * _local8), 0));
va.push(new Vector3d(_local10, -(_local11), _local9, (_local3 * _local8), _arg2));
va.push(new Vector3d(-(_local10), -(_local11), _local9, ((_local3 + 1) * _local8), _arg2));
_local5 = 0;
while (_local5 < 4) {
va[((va.length - 4) + _local5)].roty(((((2 * _local3) * _local10) + _local10) + (((-(pan.max) + 180) * Math.PI) / 180)));
_local5++;
};
_local3++;
};
}
private function paint_cube(_arg1:Number):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:int;
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:Vector3d;
var _local23:Vector3d;
var _local24:Vector3d;
var _local25:Vector3d;
var _local26:Vector3d;
var _local27:Vector3d;
var _local28:Vector3d;
var _local29:Vector3d;
var _local30:Vector3d;
var _local31:Vector3d;
var _local32:Vector3d;
var _local33:Vector3d;
var _local34:Point;
var _local35:Point;
var _local36:Point;
var _local37:Point;
var _local38:Point;
var _local39:Number;
var _local40:Number;
var _local41:int;
var _local42:int;
_local12 = 50;
_local13 = 1;
_local14 = 0;
_local15 = -0.15;
_local23 = new Vector3d();
_local24 = new Vector3d();
_local25 = new Vector3d();
_local26 = new Vector3d();
_local27 = new Vector3d();
_local28 = new Vector3d();
_local29 = new Vector3d();
if (cubeTiles < 2){
cubeTiles = 2;
};
transformCorners();
framecnt++;
_local13 = 0;
_local14 = -1;
_local16 = rect.width;
_local18 = (_local16 / 2);
_local17 = rect.height;
_local19 = (_local17 / 2);
canv.graphics.clear();
if (hasOverlay){
canvOv.graphics.clear();
canvOv.alpha = alphaOverlay;
};
ed = (_local19 / Math.tan(((fov.cur * Math.PI) / 360)));
_local9 = 0;
while (_local9 < 6) {
if (bmpVideo == null){
_local20 = bmpTile[_local9].width;
_local38 = new Point((1 / _local20), (1 / _local20));
} else {
_local20 = (bmpVideo.width / 3);
_local38 = new Point((1 / (_local20 - 8)), (1 / (_local20 - 8)));
};
_local21 = (_local20 / 2);
_local30 = vat[((_local9 * 4) + 0)];
_local31 = vat[((_local9 * 4) + 1)];
_local32 = vat[((_local9 * 4) + 2)];
_local33 = vat[((_local9 * 4) + 3)];
_local4 = 0;
_local5 = 0;
if ((((((_local30.z <= _local31.z)) && ((_local30.z <= _local32.z)))) && ((_local30.z <= _local33.z)))){
_local4 = 0;
_local5 = 0;
};
if ((((((_local31.z <= _local30.z)) && ((_local31.z <= _local32.z)))) && ((_local31.z <= _local33.z)))){
_local4 = 1;
_local5 = 0;
};
if ((((((_local32.z <= _local30.z)) && ((_local32.z <= _local31.z)))) && ((_local32.z <= _local33.z)))){
_local4 = 0;
_local5 = 1;
};
if ((((((_local33.z <= _local30.z)) && ((_local33.z <= _local31.z)))) && ((_local33.z <= _local32.z)))){
_local4 = 1;
_local5 = 1;
};
_local25.interpol4(_local30, _local31, _local32, _local33, _local4, _local5);
_local26.interpol4(_local30, _local31, _local32, _local33, (_local4 + 0.01), _local5);
_local27.interpol4(_local30, _local31, _local32, _local33, _local4, (_local5 + 0.01));
_local28.interpol4(_local30, _local31, _local32, _local33, (_local4 + 0.01), (_local5 + 0.01));
_local25.project(ed, _local18, _local19);
_local26.project(ed, _local18, _local19);
_local27.project(ed, _local18, _local19);
_local28.project(ed, _local18, _local19);
_local23.x = (_local25.px - _local26.px);
_local23.y = (_local25.py - _local26.py);
_local24.x = (_local25.px - _local27.px);
_local24.y = (_local25.py - _local27.py);
if (((_local23.x * _local24.y) - (_local23.y * _local24.x)) > 0){
_local30.project(ed, _local18, _local19);
_local31.project(ed, _local18, _local19);
_local32.project(ed, _local18, _local19);
_local33.project(ed, _local18, _local19);
if (bmpVideo == null){
_local40 = ((0.5 * _local20) * (cubeWidth - 1));
_local38 = new Point((1 / (_local20 * cubeWidth)), (1 / (_local20 * cubeWidth)));
if (hasOverlay){
DisplayTile(bmpTile[_local9], new Point(-(_local40), -(_local40)), _local38, _local30, _local31, _local32, _local33, cubeTiles, 0, bmpTileOverlay[_local9]);
} else {
DisplayTile(bmpTile[_local9], new Point(-(_local40), -(_local40)), _local38, _local30, _local31, _local32, _local33, cubeTiles, 0);
};
} else {
_local41 = 0;
_local42 = 0;
_local41 = ((_local20 * (_local9 % 3)) + 4);
_local42 = 4;
if (_local9 >= 3){
_local42 = (_local42 + _local20);
};
DisplayTile(bmpVideo, new Point(_local41, _local42), _local38, _local30, _local31, _local32, _local33, cubeTiles, 0);
};
};
_local9++;
};
}
public function addQtHotspot(_arg1:Number, _arg2:String, _arg3:String, _arg4:String){
var _local5:Hotspot;
_local5 = new Hotspot();
_local5.id = ("" + _arg1);
_local5.url = _arg3;
_local5.title = _arg2;
_local5.target = _arg4;
_local5.ofs.x = 0;
_local5.ofs.y = 0;
qthotspots[_arg1] = _local5;
}
public function doKeyUp(_arg1:KeyboardEvent):void{
key_down = false;
dirty = true;
keyShiftDown = _arg1.shiftKey;
keyCtrlDown = _arg1.ctrlKey;
keyAltDown = _arg1.altKey;
}
function controller(_arg1:String, _arg2:Number):Object{
return (controller_callback(_arg1, _arg2));
}
public function unloadHotspots(){
var _local1:Number;
var _local2:Hotspot;
_local1 = 0;
while (_local1 < this.hotspots.length) {
_local2 = this.hotspots[_local1];
if (hasOverlay){
canvOv.removeChild(_local2.clip);
} else {
canv.removeChild(_local2.clip);
};
_local1++;
};
}
private function transformCorners():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Vector3d;
var _local5:Vector3d;
var _local6:Matrix4d;
var _local7:Matrix4d;
var _local8:Matrix4d;
_local7 = new Matrix4d();
_local8 = new Matrix4d();
_local7.setRotX((((-(tilt.cur) * 2) * Math.PI) / 360));
_local8.setRotY((((pan.cur * 2) * Math.PI) / 360));
_local6 = Matrix4d.multiply(_local7, _local8);
_local3 = ((rect.height / 2) / Math.tan(((fov.cur * Math.PI) / 360)));
vat = new Array();
_local1 = 0;
while (_local1 < this.va.length) {
_local4 = this.va[_local1];
_local5 = new Vector3d();
_local6.mulVector(_local4, _local5);
vat.push(_local5);
_local4.pz = _local5.z;
if (_local4.pz < 0){
_local2 = (_local3 / _local5.z);
if (_local5.z > -1E-5){
_local2 = 10000;
};
_local4.px = (_local5.x * _local2);
_local4.py = (-(_local5.y) * _local2);
_local4.px = (_local4.px + (rect.width / 2));
_local4.py = (_local4.py + (rect.height / 2));
} else {
_local4.px = (_local5.x * 1000);
_local4.py = (-(_local5.y) * 1000);
};
_local1++;
};
updateHotspots(_local6);
if (enable_callback){
if (onRotate != null){
onRotate(pan.cur, tilt.cur, fov.cur);
};
};
}
public function doStageResize(_arg1:Event):void{
if (stage){
if (!windowScaleIgnore){
rect.width = stage.stageWidth;
rect.height = stage.stageHeight;
setup_cube();
dirty = true;
dirtyMask = true;
checkLimits();
reposElements();
};
};
}
private function updateBytesLoaded():void{
var v:int;
var cf:int;
var ldr:Loader;
v = 0;
if (root){
v = root.loaderInfo.bytesLoaded;
};
cf = 0;
while (cf < 8) {
if (externalTiles[cf] != null){
ldr = externalTiles[cf];
try {
v = (v + ldr.contentLoaderInfo.bytesLoaded);
} catch(e:Error) {
};
};
cf = (cf + 1);
};
intBytesLoaded = v;
}
}
}//package
Section 9
//PanoViewLimits (PanoViewLimits)
package {
public class PanoViewLimits {
public var cur:Number;
public var dest:Number;
public var max:Number;
public var def:Number;
public var min:Number;
public function PanoViewLimits(_arg1:Number, _arg2:Number, _arg3:Number){
init(_arg1, _arg2, _arg3);
}
public function init(_arg1:Number, _arg2:Number, _arg3:Number):void{
this.def = _arg1;
this.min = _arg2;
this.max = _arg3;
this.cur = _arg1;
}
}
}//package
Section 10
//ReposBitmapClass (ReposBitmapClass)
package {
import flash.display.*;
import flash.events.*;
public class ReposBitmapClass extends Bitmap {
private var reposId:String;
private static var imageRepos:ImageRepository = new ImageRepository();
public function ReposBitmapClass(_arg1:String){
reposId = _arg1;
addEventListener(Event.ENTER_FRAME, checkLoaded, false, 0, true);
}
private function checkLoaded(_arg1:Event):void{
var bmd:BitmapData;
var e = _arg1;
try {
bmd = imageRepos.getImage(reposId);
bitmapData = bmd;
removeEventListener(Event.ENTER_FRAME, checkLoaded);
} catch(error:Error) {
};
}
}
}//package
Section 11
//ReposImage_img0Class (ReposImage_img0Class)
package {
import flash.display.*;
public dynamic class ReposImage_img0Class extends BitmapData {
public function ReposImage_img0Class(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 12
//ReposImage_img1Class (ReposImage_img1Class)
package {
import flash.display.*;
public dynamic class ReposImage_img1Class extends BitmapData {
public function ReposImage_img1Class(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 13
//ReposImage_img2Class (ReposImage_img2Class)
package {
import flash.display.*;
public dynamic class ReposImage_img2Class extends BitmapData {
public function ReposImage_img2Class(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 14
//ReposImage_img3Class (ReposImage_img3Class)
package {
import flash.display.*;
public dynamic class ReposImage_img3Class extends BitmapData {
public function ReposImage_img3Class(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 15
//ReposImage_img4Class (ReposImage_img4Class)
package {
import flash.display.*;
public dynamic class ReposImage_img4Class extends BitmapData {
public function ReposImage_img4Class(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 16
//ReposImage_img5Class (ReposImage_img5Class)
package {
import flash.display.*;
public dynamic class ReposImage_img5Class extends BitmapData {
public function ReposImage_img5Class(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 17
//ReposImage_pre0Class (ReposImage_pre0Class)
package {
import flash.display.*;
public dynamic class ReposImage_pre0Class extends BitmapData {
public function ReposImage_pre0Class(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 18
//ReposImage_pre1Class (ReposImage_pre1Class)
package {
import flash.display.*;
public dynamic class ReposImage_pre1Class extends BitmapData {
public function ReposImage_pre1Class(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 19
//ReposImage_pre2Class (ReposImage_pre2Class)
package {
import flash.display.*;
public dynamic class ReposImage_pre2Class extends BitmapData {
public function ReposImage_pre2Class(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 20
//ReposImage_pre3Class (ReposImage_pre3Class)
package {
import flash.display.*;
public dynamic class ReposImage_pre3Class extends BitmapData {
public function ReposImage_pre3Class(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 21
//ReposImage_pre4Class (ReposImage_pre4Class)
package {
import flash.display.*;
public dynamic class ReposImage_pre4Class extends BitmapData {
public function ReposImage_pre4Class(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 22
//ReposImage_pre5Class (ReposImage_pre5Class)
package {
import flash.display.*;
public dynamic class ReposImage_pre5Class extends BitmapData {
public function ReposImage_pre5Class(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 23
//SkinActionClass (SkinActionClass)
package {
import flash.geom.*;
import flash.display.*;
import flash.net.*;
public class SkinActionClass {
public var onMouseOver:Function;
public var targetId:String;
public var targetObj:SkinObjectClass;
public var onMouseClick:Function;
public var type:String;
public var onMouseUp:Function;
public var onPressed:Function;
public var speed:Number;// = 0.4
public var onMouseDown:Function;
public var onLoaded:Function;
public var onMouseLeave:Function;
public var value2:String;
public var src:String;
public var value:String;
public var onMouseEnter:Function;
public var obj:SkinObjectClass;
public function SkinActionClass(){
speed = 0.4;
super();
targetId = "";
targetObj = null;
}
public function toogleVisible():void{
if (targetObj == null){
targetObj = getTargetObject();
};
if (targetObj != null){
targetObj.visible = !(targetObj.visible);
};
}
public function gotoUrl():void{
var _local1:URLRequest;
_local1 = new URLRequest(value);
navigateToURL(_local1, value2);
}
public function tooglePosition():void{
var _local1:SkinObjectClass;
var _local2:Array;
var _local3:Number;
var _local4:Number;
_local1 = getTargetObject();
_local2 = value.split("/");
_local3 = Number(_local2[0]);
_local4 = Number(_local2[1]);
if (_local1 != null){
_local1.activeState = !(_local1.activeState);
if (_local1.activeState){
_local1.targetPos = _local1.defaultPos.add(new Point(_local3, _local4));
} else {
_local1.targetPos = _local1.defaultPos;
};
};
}
public function videoRewind():void{
if (obj.skin.video){
obj.skin.video.backward();
};
}
public function panRight():void{
obj.skin.pano.changePan(-(speed), true, true);
}
public function showObject():void{
if (targetObj == null){
targetObj = getTargetObject();
};
if (targetObj != null){
targetObj.visible = true;
};
}
public function changeAlpha():void{
var _local1:Number;
_local1 = Number(value);
if (targetObj == null){
targetObj = getTargetObject();
};
if (((!((targetObj == null))) && (!(isNaN(_local1))))){
targetObj.targetAlpha = _local1;
};
}
public function hideObject():void{
if (targetObj == null){
targetObj = getTargetObject();
};
if (targetObj != null){
targetObj.visible = false;
};
}
public function videoStop():void{
if (obj.skin.video){
obj.skin.video.stop();
};
}
public function toogleFullscreen():void{
if (obj.skin.pano.isComplete()){
switch (obj.stage.displayState){
case StageDisplayState.FULL_SCREEN:
obj.stage.displayState = StageDisplayState.NORMAL;
break;
case StageDisplayState.NORMAL:
default:
obj.stage.displayState = StageDisplayState.FULL_SCREEN;
break;
};
};
}
public function moveToHome():void{
obj.skin.pano.moveTo(obj.skin.pano.pan.def, obj.skin.pano.tilt.def, obj.skin.pano.fov.def, speed);
}
public function moveTo():void{
var _local1:Array;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local1 = value.split("/");
_local2 = Number(_local1[0]);
_local3 = Number(_local1[1]);
_local4 = Number(_local1[2]);
if (isNaN(_local2)){
_local2 = obj.skin.pano.pan.def;
};
if (isNaN(_local3)){
_local3 = obj.skin.pano.tilt.def;
};
if (isNaN(_local4)){
_local4 = obj.skin.pano.fov.def;
};
_local5 = Number(value2);
if ((((_local5 > 0)) && (!(isNaN(_local5))))){
speed = _local5;
};
obj.skin.pano.moveTo(_local2, _local3, _local4, speed);
}
private function getTargetObject():SkinObjectClass{
var _local1:SkinObjectClass;
_local1 = null;
if (targetId == "$self"){
return (obj);
};
if (targetId == "$parent"){
return (SkinObjectClass(obj.parent));
};
if (targetId != ""){
_local1 = obj.skin.findObjectId(targetId);
};
if (_local1 == null){
_local1 = SkinObjectClass(obj.parent);
};
return (_local1);
}
public function toogleAutorotate():void{
obj.skin.pano.autorotate = !(obj.skin.pano.autorotate);
obj.skin.pano.autoplay = obj.skin.pano.autorotate;
}
public function tiltUp():void{
obj.skin.pano.changeTilt(speed, true, true);
}
public function videoPause():void{
if (obj.skin.video){
obj.skin.video.pause();
};
}
public function videoForward():void{
if (obj.skin.video){
obj.skin.video.forward();
};
}
public function panLeft():void{
obj.skin.pano.changePan(speed, true, true);
}
public function videoPlay():void{
if (obj.skin.video){
obj.skin.video.play();
};
}
public function zoomIn():void{
obj.skin.pano.changeFov(-(speed), true, true);
}
public function gotoHome():void{
obj.skin.pano.setPan(obj.skin.pano.pan.def);
obj.skin.pano.setTilt(obj.skin.pano.tilt.def);
obj.skin.pano.setFov(obj.skin.pano.fov.def);
}
public function changePosition():void{
var _local1:SkinObjectClass;
var _local2:Array;
var _local3:Number;
var _local4:Number;
_local1 = getTargetObject();
_local2 = value.split("/");
_local3 = Number(_local2[0]);
_local4 = Number(_local2[1]);
if (_local1 != null){
_local1.targetPos = _local1.defaultPos.add(new Point(_local3, _local4));
};
}
public function changeScale():void{
var _local1:Array;
var _local2:Number;
var _local3:Number;
_local1 = value.split("/");
_local2 = Number(_local1[0]);
_local3 = Number(_local1[1]);
if (isNaN(_local2)){
_local2 = 1;
};
if (isNaN(_local3)){
_local3 = _local2;
};
if (targetObj == null){
targetObj = getTargetObject();
};
if (targetObj != null){
targetObj.targetScale = new Point(_local2, _local3);
};
}
public function zoomOut():void{
obj.skin.pano.changeFov(speed, true, true);
}
public function setup():void{
var _local1:Function;
var _local2:Number;
_local2 = Number(value);
if ((((_local2 > 0)) && (!(isNaN(_local2))))){
speed = _local2;
};
if (type == "panleft"){
_local1 = panLeft;
};
if (type == "panright"){
_local1 = panRight;
};
if (type == "tiltup"){
_local1 = tiltUp;
};
if (type == "tiltdown"){
_local1 = tiltDown;
};
if (type == "zoomin"){
_local1 = zoomIn;
};
if (type == "zoomout"){
_local1 = zoomOut;
};
if (type == "home"){
_local1 = gotoHome;
};
if (type == "movehome"){
_local1 = moveToHome;
};
if (type == "moveto"){
_local1 = moveTo;
};
if (type == "gotourl"){
_local1 = gotoUrl;
};
if (type == "tooglefullscreen"){
_local1 = toogleFullscreen;
};
if (type == "toogleautorotate"){
_local1 = toogleAutorotate;
};
if (type == "changeposition"){
_local1 = changePosition;
};
if (type == "toogleposition"){
_local1 = tooglePosition;
};
if (type == "changescale"){
_local1 = changeScale;
};
if (type == "changealpha"){
_local1 = changeAlpha;
};
if (type == "tooglevisible"){
_local1 = toogleVisible;
};
if (type == "hide"){
_local1 = hideObject;
};
if (type == "show"){
_local1 = showObject;
};
if (type == "play"){
_local1 = videoPlay;
};
if (type == "stop"){
_local1 = videoStop;
};
if (type == "pause"){
_local1 = videoPause;
};
if (type == "forward"){
_local1 = videoForward;
};
if (type == "rewind"){
_local1 = videoRewind;
};
if (_local1 == null){
};
if (src == "click"){
onMouseClick = _local1;
};
if (src == "pressed"){
onPressed = _local1;
};
if (src == "mousedown"){
onMouseDown = _local1;
};
if (src == "mouseup"){
onMouseUp = _local1;
};
if (src == "enter"){
onMouseEnter = _local1;
};
if (src == "leave"){
onMouseLeave = _local1;
};
if (src == "over"){
onMouseOver = _local1;
};
if (src == "loaded"){
onLoaded = _local1;
};
}
public function tiltDown():void{
obj.skin.pano.changeTilt(-(speed), true, true);
}
}
}//package
Section 24
//SkinClass (SkinClass)
package {
import flash.geom.*;
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.net.*;
public class SkinClass extends Sprite {
public var bytesLoaded:int;
private var objs:Array;
private var isInit:Boolean;
public var video:VideoPanoClass;
public var pano:PanoCube;
public var bytesTotal:int;
public var imageRepos:ImageRepository;
public var rootSkinObject:SkinObjectClass;
public function SkinClass(_arg1:PanoCube){
imageRepos = new ImageRepository();
pano = _arg1;
objs = new Array();
addEventListener(Event.ENTER_FRAME, doEnterFrame, false, 0, true);
isInit = false;
visible = false;
}
public function xmlConfig(_arg1:XML):void{
var _local2:XML;
rootSkinObject = new SkinObjectClass();
rootSkinObject.skin = this;
rootSkinObject.defaultPos = new Point(0, 0);
rootSkinObject.currentPos = new Point(0, 0);
addChild(rootSkinObject);
for each (_local2 in _arg1.element) {
xmlConfigElement(rootSkinObject, _local2);
};
rootSkinObject.updatePosition();
}
public function doEnterFrame(_arg1:Event):void{
var _local2:SkinObjectClass;
bytesLoaded = pano.bytesLoaded();
bytesTotal = pano.bytesTotal();
if (!isInit){
isInit = true;
visible = true;
};
for each (_local2 in objs) {
_local2.doEnterFrame();
};
}
public function xmlConfigElement(_arg1:SkinObjectClass, _arg2:XML):void{
var x:int;
var y:int;
var w:int;
var h:int;
var skinObj:SkinObjectClass;
var type:String;
var center:int;
var action:XML;
var modifier:XML;
var ldr:Loader;
var button:SimpleButton;
var v:Number;
var element:XML;
var a:SkinActionClass;
var m:SkinModifierClass;
var rpb:ReposBitmapClass;
var txt:TextField;
var text_fmt:TextFormat;
var bar_bgcolor:Number;
var bar_bgalpha:Number;
var bar_color:Number;
var bar_alpha:Number;
var wd:Number;
var parent = _arg1;
var config = _arg2;
x = 0;
y = 0;
w = 100;
h = 100;
skinObj = new SkinObjectClass();
skinObj.skin = this;
parent.addChild(skinObj);
type = config.@type;
if (config.hasOwnProperty("@id")){
skinObj.id = config.@id;
};
if (config.hasOwnProperty("@x")){
x = config.@x;
};
if (config.hasOwnProperty("@y")){
y = config.@y;
};
if (config.hasOwnProperty("@width")){
w = config.@width;
};
if (config.hasOwnProperty("@height")){
h = config.@height;
};
if (config.hasOwnProperty("@anchor")){
skinObj.anchor = config.@anchor;
};
if (config.hasOwnProperty("@visible")){
skinObj.visible = (config.@visible == 1);
};
if (config.hasOwnProperty("@alpha")){
skinObj.alpha = Number(config.@alpha);
skinObj.targetAlpha = skinObj.alpha;
};
skinObj.x = x;
skinObj.y = y;
skinObj.defaultPos = new Point(x, y);
skinObj.currentPos = skinObj.defaultPos.clone();
center = 4;
if (config.hasOwnProperty("@center")){
center = config.@center;
};
if ((((((center == 0)) || ((center == 3)))) || ((center == 6)))){
skinObj.centerx = 0;
};
if ((((((center == 0)) || ((center == 1)))) || ((center == 2)))){
skinObj.centery = 0;
};
if ((((((center == 1)) || ((center == 4)))) || ((center == 7)))){
skinObj.centerx = (w / 2);
};
if ((((((center == 3)) || ((center == 4)))) || ((center == 5)))){
skinObj.centery = (h / 2);
};
if ((((((center == 2)) || ((center == 5)))) || ((center == 8)))){
skinObj.centerx = w;
};
if ((((((center == 6)) || ((center == 7)))) || ((center == 8)))){
skinObj.centery = h;
};
for each (action in config.action) {
a = new SkinActionClass();
a.obj = skinObj;
if (action.hasOwnProperty("@src")){
a.src = action.attribute("src");
};
if (action.hasOwnProperty("@type")){
a.type = action.attribute("type");
};
if (action.hasOwnProperty("@value")){
a.value = action.attribute("value");
};
if (action.hasOwnProperty("@value2")){
a.value2 = action.attribute("value2");
};
if (action.hasOwnProperty("@target")){
a.targetId = action.attribute("target");
};
a.setup();
skinObj.actions.push(a);
};
for each (modifier in config.modifier) {
m = new SkinModifierClass();
m.obj = skinObj;
if (modifier.hasOwnProperty("@src")){
m.src = modifier.attribute("src");
};
if (modifier.hasOwnProperty("@type")){
m.type = modifier.attribute("type");
};
if (modifier.hasOwnProperty("@offset")){
m.offset = modifier.attribute("offset");
};
if (modifier.hasOwnProperty("@factor")){
m.factor = modifier.attribute("factor");
};
m.setup();
skinObj.modifiers.push(m);
};
if (config.hasOwnProperty("@img")){
rpb = new ReposBitmapClass(config.@img.toString());
skinObj.addChild(rpb);
};
if (config.hasOwnProperty("@imgurl")){
try {
ldr = new Loader();
ldr.load(new URLRequest(config.@imgurl));
skinObj.addChild(ldr);
} catch(error:Error) {
};
};
if (config.hasOwnProperty("@btn")){
button = new SimpleButton();
button.visible = true;
button.upState = new ReposBitmapClass(config.@btn.toString());
button.hitTestState = button.upState;
if (config.hasOwnProperty("@over")){
button.overState = new ReposBitmapClass(config.@over.toString());
} else {
button.overState = button.upState;
};
if (config.hasOwnProperty("@down")){
button.downState = new ReposBitmapClass(config.@down.toString());
} else {
button.downState = button.overState;
};
skinObj.addChild(button);
};
if (config.hasOwnProperty("@btnurl")){
try {
button = new SimpleButton();
button.visible = true;
ldr = new Loader();
ldr.load(new URLRequest(config.@btnurl));
button.upState = ldr;
button.hitTestState = button.upState;
if (config.hasOwnProperty("@overurl")){
ldr = new Loader();
ldr.load(new URLRequest(config.@overurl));
button.overState = ldr;
} else {
button.overState = button.upState;
};
if (config.hasOwnProperty("@downurl")){
ldr = new Loader();
ldr.load(new URLRequest(config.@downurl));
button.downState = ldr;
} else {
button.downState = button.overState;
};
skinObj.addChild(button);
} catch(error:Error) {
};
};
if (type == "text"){
txt = new TextField();
txt.width = w;
txt.height = h;
text_fmt = new TextFormat();
if (config.hasOwnProperty("@font")){
text_fmt.font = config.@font;
} else {
text_fmt.font = "Verdana";
};
if (config.hasOwnProperty("@size")){
text_fmt.size = config.@size;
} else {
text_fmt.size = 12;
};
if (config.hasOwnProperty("@color")){
text_fmt.color = config.@color;
} else {
text_fmt.color = 0;
};
if (config.hasOwnProperty("@align")){
switch (int(config.@align)){
case 0:
text_fmt.align = TextFormatAlign.LEFT;
break;
case 1:
text_fmt.align = TextFormatAlign.CENTER;
break;
case 2:
text_fmt.align = TextFormatAlign.RIGHT;
break;
};
} else {
text_fmt.align = TextFormatAlign.CENTER;
};
txt.defaultTextFormat = text_fmt;
txt.selectable = false;
if (config.hasOwnProperty("@bordercolor")){
txt.borderColor = config.@bordercolor;
} else {
txt.borderColor = 0;
};
if (config.hasOwnProperty("@border")){
txt.border = (config.@border == 1);
} else {
txt.border = true;
};
if (config.hasOwnProperty("@backgroundcolor")){
txt.backgroundColor = config.@backgroundcolor;
} else {
txt.backgroundColor = 0xFFFFFF;
};
if (config.hasOwnProperty("@background")){
txt.background = (config.@background == 1);
} else {
txt.background = true;
};
txt.type = TextFieldType.DYNAMIC;
if (config.hasOwnProperty("@text")){
txt.htmlText = config.@text;
skinObj.textString = config.@text;
skinObj.dynamicText = (skinObj.textString.indexOf("$") >= 0);
} else {
txt.htmlText = "Text";
};
txt.multiline = true;
skinObj.textField = txt;
skinObj.addChild(txt);
};
if (type == "rectangle"){
bar_bgcolor = 0xFFFFFF;
bar_bgalpha = 1;
bar_color = 0;
bar_alpha = 1;
wd = 1;
if (config.hasOwnProperty("@bordercolor")){
bar_color = config.@bordercolor;
};
if (config.hasOwnProperty("@borderalpha")){
bar_alpha = config.@borderalpha;
};
if (config.hasOwnProperty("@backgroundcolor")){
bar_bgcolor = config.@backgroundcolor;
};
if (config.hasOwnProperty("@backgroundalpha")){
bar_bgalpha = config.@backgroundalpha;
};
if (config.hasOwnProperty("@borderwidth")){
wd = config.@borderwidth;
};
skinObj.graphics.clear();
skinObj.graphics.beginFill(bar_bgcolor, bar_bgalpha);
if (wd > 0){
skinObj.graphics.lineStyle(wd, bar_color, bar_alpha);
};
skinObj.graphics.moveTo(0, 0);
skinObj.graphics.lineTo(w, 0);
skinObj.graphics.lineTo(w, h);
skinObj.graphics.lineTo(0, h);
skinObj.graphics.lineTo(0, 0);
skinObj.graphics.endFill();
};
if (config.hasOwnProperty("@width")){
skinObj.default_width = config.@width;
} else {
skinObj.default_height = skinObj.width;
};
if (config.hasOwnProperty("@height")){
skinObj.default_height = config.@height;
} else {
skinObj.default_height = skinObj.height;
};
if (config.hasOwnProperty("@scalex")){
v = config.@scalex;
skinObj.sx = v;
skinObj.orgsx = v;
skinObj.modify = true;
};
if (config.hasOwnProperty("@scaley")){
v = config.@scaley;
skinObj.sy = v;
skinObj.orgsy = v;
skinObj.modify = true;
};
skinObj.updatePosition();
objs.push(skinObj);
for each (element in config.element) {
xmlConfigElement(skinObj, element);
};
}
public function findObjectId(_arg1:String):SkinObjectClass{
var _local2:SkinObjectClass;
for each (_local2 in objs) {
if (((!((_local2.id == ""))) && ((_local2.id == _arg1)))){
return (_local2);
};
};
return (null);
}
}
}//package
Section 25
//SkinModifierClass (SkinModifierClass)
package {
public class SkinModifierClass {
public var src:String;
public var factor:Number;
public var offset:Number;
public var obj:SkinObjectClass;
public var type:String;
public function SkinModifierClass(){
offset = 0;
factor = 1;
}
public function setup():void{
}
}
}//package
Section 26
//SkinObjectClass (SkinObjectClass)
package {
import flash.geom.*;
import flash.display.*;
import flash.events.*;
import flash.text.*;
public class SkinObjectClass extends Sprite {
public var dynamicText:Boolean;
public var currentPos:Point;
public var default_width:int;
public var orgsx:Number;// = 1
public var orgsy:Number;// = 1
public var targetScale:Point;
public var speed:Number;// = 0.4
public var defaultPos:Point;
public var targetAlpha:Number;
public var sy:Number;// = 1
private var lastString:String;
public var sx:Number;// = 1
public var cx:int;
public var cy:int;
public var modifiers:Array;
public var tx:Number;// = 0
public var ty:Number;// = 0
public var anchor:int;
public var didLoadedAction:Boolean;// = false
public var modify:Boolean;// = false
public var centerx:int;
public var centery:int;
public var default_height:int;
public var mouseDown:Boolean;
public var actions:Array;
public var targetPos:Point;
public var id:String;
public var activeState:Boolean;// = false
private var stageInit:Boolean;
public var currentScale:Point;
public var skin:SkinClass;
public var mouseRollIn:Boolean;
public var textString:String;
public var textField:TextField;
public var isLoaded:Boolean;
private var lsx:Number;// = 1
private var lsy:Number;// = 1
public var rot:Number;// = 0
public var mouseMoveIn:Boolean;
private var lrot:Number;// = 0
private var ltx:Number;// = 0
private var lty:Number;// = 0
public function SkinObjectClass(){
speed = 0.4;
actions = new Array();
modifiers = new Array();
didLoadedAction = false;
modify = false;
rot = 0;
orgsx = 1;
orgsy = 1;
sx = 1;
sy = 1;
tx = 0;
ty = 0;
lrot = 0;
lsx = 1;
lsy = 1;
ltx = 0;
lty = 0;
activeState = false;
super();
isLoaded = false;
id = "";
anchor = 0;
default_width = 0;
default_height = 0;
mouseDown = false;
mouseRollIn = false;
defaultPos = new Point(0, 0);
currentPos = new Point(0, 0);
currentScale = new Point(1, 1);
stageInit = true;
dynamicText = false;
targetAlpha = 1;
addEventListener(MouseEvent.CLICK, doClick, false, 0, true);
addEventListener(MouseEvent.MOUSE_DOWN, doMouseDown, false, 0, true);
addEventListener(MouseEvent.MOUSE_OVER, doMouseOver, false, 0, true);
addEventListener(MouseEvent.MOUSE_OUT, doMouseOut, false, 0, true);
addEventListener(MouseEvent.ROLL_OVER, doRollOver, false, 0, true);
addEventListener(MouseEvent.ROLL_OUT, doRollOut, false, 0, true);
}
private function doMouseOut(_arg1:MouseEvent):void{
if (mouseMoveIn){
mouseMoveIn = false;
};
}
public function doEnterFrame():void{
var action:SkinActionClass;
var moved:Boolean;
var diff:Point;
var mspeed:Number;
var l:Number;
var pan:Number;
var tilt:Number;
var fov:Number;
var val:Number;
var sm:SkinModifierClass;
var pr:Number;
var tmpstr:String;
rot = 0;
sx = orgsx;
sy = orgsy;
tx = 0;
ty = 0;
moved = false;
if (((!((stage == null))) && (stageInit))){
stageInit = false;
stage.addEventListener(MouseEvent.MOUSE_UP, doMouseUp, false, 0, true);
if (((((parent) && (skin))) && ((skin.rootSkinObject == parent)))){
doResize(null);
stage.addEventListener(Event.RESIZE, doResize);
};
};
if (!didLoadedAction){
if (skin.bytesLoaded == skin.bytesTotal){
didLoadedAction = true;
for each (action in actions) {
if (action.onLoaded != null){
action.onLoaded();
};
};
};
};
if (visible){
if (mouseMoveIn){
for each (action in actions) {
if (mouseDown){
if (action.onPressed != null){
action.onPressed();
};
};
if (action.onMouseOver != null){
action.onMouseOver();
};
};
};
if (targetPos){
try {
diff = targetPos.subtract(currentPos);
if (((!((diff.x == 0))) || (!((diff.y == 0))))){
mspeed = 10;
l = diff.length;
if (l > 1.5){
if ((l * 0.3) >= mspeed){
diff.normalize(mspeed);
} else {
diff.normalize((l * 0.3));
};
};
currentPos = currentPos.add(diff);
moved = true;
};
} catch(error:Error) {
};
};
if (targetScale){
try {
diff = new Point((targetScale.x - currentScale.x), (targetScale.y - currentScale.y));
if (((!((diff.x == 0))) || (!((diff.y == 0))))){
mspeed = 0.1;
l = diff.length;
if (l > 0.01){
if ((l * 0.3) >= mspeed){
diff.normalize(mspeed);
} else {
diff.normalize((l * 0.5));
};
};
sx = (currentScale.x + diff.x);
sy = (currentScale.y + diff.y);
modify = true;
} else {
sx = targetScale.x;
sy = targetScale.y;
};
} catch(error:Error) {
};
};
if (alpha != targetAlpha){
l = (targetAlpha - alpha);
mspeed = 0.05;
if (Math.abs(l) > 0.01){
if (Math.abs((l * 0.3)) >= mspeed){
l = ((mspeed * l) / Math.abs(l));
} else {
l = (l * 0.5);
};
alpha = (alpha + l);
} else {
alpha = targetAlpha;
};
};
pan = skin.pano.getPan();
while (pan > 180) {
pan = (pan - 360);
};
while (pan < -180) {
pan = (pan + 360);
};
tilt = skin.pano.getTilt();
while (tilt > 180) {
tilt = (tilt - 360);
};
while (tilt < -180) {
tilt = (tilt + 360);
};
fov = skin.pano.getFov();
if (dynamicText){
pr = (skin.bytesLoaded / skin.bytesTotal);
tmpstr = textString;
tmpstr = tmpstr.replace("$p", Math.floor((100 * pr)));
tmpstr = tmpstr.replace("$n", (Math.floor((1000 * pr)) / 1000));
tmpstr = tmpstr.replace("$b", skin.bytesLoaded);
tmpstr = tmpstr.replace("$t", skin.bytesTotal);
tmpstr = tmpstr.replace("$B", Math.floor((skin.bytesLoaded / 1000)));
tmpstr = tmpstr.replace("$T", Math.floor((skin.bytesTotal / 1000)));
tmpstr = tmpstr.replace("$ap", (Math.floor((10 * pan)) / 10));
tmpstr = tmpstr.replace("$at", (Math.floor((10 * tilt)) / 10));
tmpstr = tmpstr.replace("$af", (Math.floor((10 * fov)) / 10));
if (lastString != tmpstr){
lastString = tmpstr;
textField.htmlText = tmpstr;
};
};
for each (sm in modifiers) {
val = 0;
if (sm.src == "pan"){
val = ((sm.factor * pan) + sm.offset);
};
if (sm.src == "cospan"){
val = Math.cos(((((pan * sm.factor) + sm.offset) * Math.PI) / 180));
};
if (sm.src == "tanpan"){
val = ((Math.tan((((pan / 2) * Math.PI) / 180)) * sm.factor) + sm.offset);
};
if (sm.src == "tilt"){
val = ((sm.factor * tilt) + sm.offset);
};
if (sm.src == "costilt"){
val = Math.cos(((((tilt * sm.factor) + sm.offset) * Math.PI) / 180));
};
if (sm.src == "tantilt"){
val = ((Math.tan((((tilt / 2) * Math.PI) / 180)) * sm.factor) + sm.offset);
};
if (sm.src == "fov"){
val = ((sm.factor * fov) + sm.offset);
};
if (sm.src == "tanfov"){
val = ((Math.tan((((fov / 2) * Math.PI) / 180)) * sm.factor) + sm.offset);
};
if (sm.src == "invtanfov"){
val = (((1 / Math.tan((((fov / 2) * Math.PI) / 180))) * sm.factor) + sm.offset);
};
if (sm.src == "loading"){
val = ((sm.factor * (skin.bytesLoaded / skin.bytesTotal)) + sm.offset);
};
if (sm.type == "rotate"){
rot = (rot + -(val));
modify = true;
};
if (sm.type == "scalex"){
sx = (sx * val);
modify = true;
};
if (sm.type == "scaley"){
sy = (sy * val);
modify = true;
};
if (sm.type == "scale"){
sx = (sx * val);
sy = (sy * val);
modify = true;
};
if (sm.type == "movex"){
tx = (tx + val);
modify = true;
};
if (sm.type == "movey"){
ty = (ty + val);
modify = true;
};
};
if (((modify) || (moved))){
if (((((((((((moved) || (!((lrot == rot))))) || (!((lsx == sx))))) || (!((lsy == sy))))) || (!((ltx == tx))))) || (!((lty == ty))))){
updatePosition();
lrot = rot;
lsx = sx;
lsy = sy;
ltx = tx;
lty = ty;
};
};
};
}
private function doRollOut(_arg1:MouseEvent):void{
var _local2:SkinActionClass;
if (mouseRollIn){
mouseRollIn = false;
for each (_local2 in actions) {
if (_local2.onMouseLeave != null){
_local2.onMouseLeave();
};
};
};
}
private function doRollOver(_arg1:MouseEvent):void{
var _local2:SkinActionClass;
if (!mouseRollIn){
mouseRollIn = true;
for each (_local2 in actions) {
if (_local2.onMouseEnter != null){
_local2.onMouseEnter();
};
};
};
}
private function doMouseDown(_arg1:MouseEvent):void{
var _local2:SkinActionClass;
mouseDown = true;
for each (_local2 in actions) {
if (_local2.onMouseDown != null){
_local2.onMouseDown();
};
};
}
private function doMouseOver(_arg1:MouseEvent):void{
if (!mouseMoveIn){
mouseMoveIn = true;
};
}
public function updatePosition():void{
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:Matrix;
if (parent){
_local1 = parent.width;
_local2 = parent.height;
if (((((skin) && ((skin.rootSkinObject == parent)))) && (stage))){
_local1 = stage.stageWidth;
_local2 = stage.stageHeight;
};
_local3 = anchor;
if ((((((_local3 == 0)) || ((_local3 == 3)))) || ((_local3 == 6)))){
cx = currentPos.x;
};
if ((((((_local3 == 0)) || ((_local3 == 1)))) || ((_local3 == 2)))){
cy = currentPos.y;
};
if ((((((_local3 == 1)) || ((_local3 == 4)))) || ((_local3 == 7)))){
cx = (currentPos.x + (_local1 / 2));
};
if ((((((_local3 == 3)) || ((_local3 == 4)))) || ((_local3 == 5)))){
cy = (currentPos.y + (_local2 / 2));
};
if ((((((_local3 == 2)) || ((_local3 == 5)))) || ((_local3 == 8)))){
cx = (currentPos.x + _local1);
};
if ((((((_local3 == 6)) || ((_local3 == 7)))) || ((_local3 == 8)))){
cy = (currentPos.y + _local2);
};
if (modify){
_local4 = new Matrix();
new Matrix().tx = (_local4.tx - centerx);
_local4.ty = (_local4.ty - centery);
_local4.scale(sx, sy);
if (rot != 0){
_local4.rotate((1E-15 + ((rot * Math.PI) / 180)));
};
_local4.tx = (_local4.tx + ((centerx + cx) + tx));
_local4.ty = (_local4.ty + ((centery + cy) + ty));
transform.matrix = _local4;
} else {
x = cx;
y = cy;
};
currentScale.x = sx;
currentScale.y = sy;
};
}
private function doMouseUp(_arg1:MouseEvent):void{
var _local2:SkinActionClass;
if (mouseDown){
mouseDown = false;
for each (_local2 in actions) {
if (_local2.onMouseUp != null){
_local2.onMouseUp();
};
};
};
}
private function doResize(_arg1:Event):void{
updatePosition();
}
private function doClick(_arg1:MouseEvent):void{
var _local2:SkinActionClass;
for each (_local2 in actions) {
if (_local2.onMouseClick != null){
_local2.onMouseClick();
};
};
}
}
}//package
Section 27
//TextHotspotClass (TextHotspotClass)
package {
import flash.display.*;
import flash.text.*;
public dynamic class TextHotspotClass extends MovieClip {
public var hstext:TextField;
}
}//package
Section 28
//UrlHotspotClass (UrlHotspotClass)
package {
import flash.display.*;
import flash.text.*;
public dynamic class UrlHotspotClass extends MovieClip {
public var hstext:TextField;
}
}//package
Section 29
//Vector3d (Vector3d)
package {
import flash.geom.*;
public class Vector3d {
public var px:Number;
public var py:Number;
public var pz:Number;
public var z:Number;
public var u:Number;
public var v:Number;
public var x:Number;
public var y:Number;
public function Vector3d(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0, _arg5:Number=0){
this.x = _arg1;
this.y = _arg2;
this.z = _arg3;
this.u = _arg4;
this.v = _arg5;
}
public function sub(_arg1:Vector3d):Vector3d{
var _local2:Vector3d;
_local2 = new Vector3d();
_local2.x = (x - _arg1.x);
_local2.y = (y - _arg1.y);
_local2.z = (z - _arg1.z);
return (_local2);
}
public function roty(_arg1:Number):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local5 = Math.sin(_arg1);
_local4 = Math.cos(_arg1);
_local2 = ((_local4 * x) - (_local5 * z));
_local3 = ((_local5 * x) + (_local4 * z));
x = _local2;
z = _local3;
}
public function rotz(_arg1:Number):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local5 = Math.sin(_arg1);
_local4 = Math.cos(_arg1);
_local2 = ((_local4 * x) - (_local5 * y));
_local3 = ((_local5 * x) + (_local4 * y));
x = _local2;
y = _local3;
}
public function toString():String{
return ((((((((((("(" + x) + ",") + y) + ",") + z) + ") - (") + px) + ",") + py) + ")"));
}
public function interpol2proj(_arg1:Vector3d, _arg2:Vector3d, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number):void{
var _local7:Number;
var _local8:Number;
_local7 = (1 - _arg3);
x = ((_arg1.x * _arg3) + (_arg2.x * _local7));
y = ((_arg1.y * _arg3) + (_arg2.y * _local7));
z = ((_arg1.z * _arg3) + (_arg2.z * _local7));
pz = z;
if (z < 0){
if (z > -1E-5){
_local8 = 10000;
} else {
_local8 = (-(_arg4) / z);
};
px = ((x * _local8) + _arg5);
py = ((y * _local8) + _arg6);
} else {
px = (x * 1000);
py = (y * 1000);
};
}
public function scale(_arg1:Number, _arg2:Number, _arg3:Number):void{
this.x = (this.x * _arg1);
this.y = (this.y * _arg2);
this.z = (this.z * _arg3);
}
public function rotx(_arg1:Number):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local5 = Math.sin(_arg1);
_local4 = Math.cos(_arg1);
_local2 = ((_local4 * y) + (_local5 * z));
_local3 = ((-(_local5) * y) + (_local4 * z));
y = _local2;
z = _local3;
}
public function move(_arg1:Number, _arg2:Number, _arg3:Number):void{
this.x = (this.x + _arg1);
this.y = (this.y + _arg2);
this.z = (this.z + _arg3);
}
public function interpol4proj(_arg1:Vector3d, _arg2:Vector3d, _arg3:Vector3d, _arg4:Vector3d, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number, _arg9:Number):Point{
var _local10:Number;
var _local11:Number;
var _local12:Number;
_local10 = (1 - _arg5);
_local11 = (1 - _arg6);
x = ((((_arg1.x * _local10) + (_arg2.x * _arg5)) * _local11) + (((_arg3.x * _local10) + (_arg4.x * _arg5)) * _arg6));
y = ((((_arg1.y * _local10) + (_arg2.y * _arg5)) * _local11) + (((_arg3.y * _local10) + (_arg4.y * _arg5)) * _arg6));
z = ((((_arg1.z * _local10) + (_arg2.z * _arg5)) * _local11) + (((_arg3.z * _local10) + (_arg4.z * _arg5)) * _arg6));
pz = z;
if (z < 0){
if (z > -1E-5){
_local12 = 10000;
} else {
_local12 = (-(_arg7) / z);
};
px = ((x * _local12) + _arg8);
py = ((y * _local12) + _arg9);
} else {
px = (x * 1000);
py = (y * 1000);
};
return (new Point(px, py));
}
public function init(_arg1:Number, _arg2:Number, _arg3:Number):void{
this.x = _arg1;
this.y = _arg2;
this.z = _arg3;
}
public function project(_arg1:Number, _arg2:Number, _arg3:Number):void{
var _local4:Number;
pz = z;
if (z < 0){
_local4 = (-(_arg1) / z);
if (Math.abs(z) < 1E-5){
_local4 = ((z > 0)) ? -10000 : 10000;
};
px = (x * _local4);
py = (y * _local4);
px = (px + _arg2);
py = (py + _arg3);
} else {
px = (x * 1000);
py = (y * 1000);
};
}
public function interpol2(_arg1:Vector3d, _arg2:Vector3d, _arg3:Number):void{
x = ((_arg1.x * _arg3) + (_arg2.x * (1 - _arg3)));
y = ((_arg1.y * _arg3) + (_arg2.y * (1 - _arg3)));
z = ((_arg1.z * _arg3) + (_arg2.z * (1 - _arg3)));
}
public function pdist2(_arg1:Vector3d):Number{
return ((((_arg1.px - px) * (_arg1.px - px)) + ((_arg1.py - py) * (_arg1.py - py))));
}
public function cp(_arg1:Vector3d):void{
_arg1.x = x;
_arg1.y = y;
_arg1.z = z;
_arg1.px = px;
_arg1.py = py;
}
public function project3d(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number):void{
pz = z;
if (z < 0){
if (Math.abs(z) < 1E-5){
};
px = ((_arg4 * ((z * _arg1) - (x * _arg3))) / (z - _arg3));
py = ((_arg4 * ((z * _arg2) - (y * _arg3))) / (z - _arg3));
px = (px + _arg5);
py = (py + _arg6);
} else {
px = (x * 1000);
py = (y * 1000);
};
}
public function interpol4(_arg1:Vector3d, _arg2:Vector3d, _arg3:Vector3d, _arg4:Vector3d, _arg5:Number, _arg6:Number):void{
x = ((((_arg1.x * (1 - _arg5)) + (_arg2.x * _arg5)) * (1 - _arg6)) + (((_arg3.x * (1 - _arg5)) + (_arg4.x * _arg5)) * _arg6));
y = ((((_arg1.y * (1 - _arg5)) + (_arg2.y * _arg5)) * (1 - _arg6)) + (((_arg3.y * (1 - _arg5)) + (_arg4.y * _arg5)) * _arg6));
z = ((((_arg1.z * (1 - _arg5)) + (_arg2.z * _arg5)) * (1 - _arg6)) + (((_arg3.z * (1 - _arg5)) + (_arg4.z * _arg5)) * _arg6));
}
public function asPoint():Point{
var _local1:Point;
_local1 = new Point();
_local1.x = px;
_local1.y = py;
return (_local1);
}
}
}//package
Section 30
//VideoPanoClass (VideoPanoClass)
package {
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.net.*;
public class VideoPanoClass extends Sprite {
private var videoURL:String;
public var video:Video;
public var dirSound:Boolean;
private var lastTime:Number;
public var stream:NetStream;
private var pano:PanoCube;
public var bmp:BitmapData;
private var loop:Boolean;// = true
public var connection:NetConnection;
private var hasImage:Boolean;
public function VideoPanoClass(_arg1:PanoCube){
loop = true;
super();
connection = new NetConnection();
connection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
connection.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
connection.connect(null);
hasImage = false;
bmp = null;
pano = _arg1;
lastTime = -1;
dirSound = true;
addEventListener(Event.ENTER_FRAME, copyVideo);
}
public function pause():void{
stream.togglePause();
}
public function stop():void{
stream.pause();
stream.seek(0);
}
private function copyVideo(_arg1:Event):void{
var _local2:Number;
var _local3:SoundTransform;
var _local4:Number;
if (bmp != null){
_local2 = stream.time;
if (lastTime != _local2){
lastTime = _local2;
bmp.draw(video);
pano.bmpVideo = bmp;
pano.update();
};
};
if (dirSound){
_local3 = stream.soundTransform;
_local4 = ((Math.cos(((pano.getPan() * Math.PI) / 180)) * 0.5) + 0.5);
_local3.leftToLeft = _local4;
_local3.rightToRight = _local4;
_local3.leftToRight = (1 - _local4);
_local3.rightToLeft = (1 - _local4);
stream.soundTransform = _local3;
};
}
public function backward():void{
var _local1:Number;
_local1 = (stream.time - 5);
if (_local1 < 0){
_local1 = 0;
};
stream.seek(_local1);
}
public function onCuePoint(_arg1:Object):void{
}
private function connectStream():void{
var _local1:int;
stream = new NetStream(connection);
stream.client = this;
stream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
_local1 = 16;
stream.play(videoURL);
}
public function play():void{
stream.resume();
}
private function netStatusHandler(_arg1:NetStatusEvent):void{
switch (_arg1.info.code){
case "NetConnection.Connect.Success":
connectStream();
break;
case "NetStream.Play.StreamNotFound":
break;
case "NetStream.Play.Complete":
stream.resume();
break;
case "NetStream.Play.Stop":
if (loop){
stream.seek(0);
stream.resume();
};
hasImage = false;
break;
case "NetStream.Buffer.Empty":
hasImage = false;
break;
case "NetStream.Buffer.Full":
hasImage = true;
break;
case "NetStream.Buffer.Flush":
break;
};
}
public function onMetaData(_arg1:Object):void{
bmp = new BitmapData(_arg1.width, _arg1.height);
video = new Video(_arg1.width, _arg1.height);
video.attachNetStream(stream);
}
public function xmlConfig(_arg1:XML):void{
if (_arg1.hasOwnProperty("@url")){
videoURL = _arg1.@url;
};
if (_arg1.hasOwnProperty("@dirsound")){
dirSound = (_arg1.@dirsound == 1);
};
if (videoURL != ""){
connectStream();
};
}
private function securityErrorHandler(_arg1:SecurityErrorEvent):void{
}
public function forward():void{
stream.seek((stream.time + 5));
}
public function time():Number{
return (stream.time);
}
}
}//package