Created
September 17, 2015 22:40
-
-
Save nermolov/7b338a047d89a21884a9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package { | |
import com.vpg.vpage.components.button.*; | |
public dynamic class double_page_btn extends BasicButton { | |
public function double_page_btn(){ | |
addFrameScript(8, this.frame9, 19, this.frame20); | |
} | |
function frame9(){ | |
stop(); | |
} | |
function frame20(){ | |
stop(); | |
} | |
} | |
}//package | |
package { | |
import com.vpg.vpage.components.button.*; | |
public dynamic class page_forward_btn extends BasicButton { | |
} | |
}//package | |
package { | |
import com.vpg.vpage.components.button.*; | |
public dynamic class hand_btn extends BasicButton { | |
public function hand_btn(){ | |
addFrameScript(9, this.frame10, 19, this.frame20); | |
} | |
function frame10(){ | |
stop(); | |
} | |
function frame20(){ | |
stop(); | |
} | |
} | |
}//package | |
package { | |
import com.vpg.vpage.components.button.*; | |
public dynamic class index_btn extends BasicButton { | |
} | |
}//package | |
package { | |
import com.vpg.vpage.components.button.*; | |
public dynamic class page_previous_btn extends BasicButton { | |
} | |
}//package | |
package { | |
import com.vpg.vpage.components.button.*; | |
public dynamic class single_page_btn extends BasicButton { | |
public function single_page_btn(){ | |
addFrameScript(11, this.frame12, 24, this.frame25); | |
} | |
function frame12(){ | |
stop(); | |
} | |
function frame25(){ | |
stop(); | |
} | |
} | |
}//package | |
package { | |
import com.vpg.vpage.components.button.*; | |
public dynamic class highlighter_btn extends BasicButton { | |
public function highlighter_btn(){ | |
addFrameScript(9, this.frame10, 24, this.frame25); | |
} | |
function frame10(){ | |
stop(); | |
} | |
function frame25(){ | |
stop(); | |
} | |
} | |
}//package | |
package { | |
import com.vpg.vpage.components.slider.*; | |
public dynamic class slider extends Slider { | |
} | |
}//package | |
package { | |
import com.vpg.vpage.components.button.*; | |
public dynamic class toc_btn extends BasicButton { | |
} | |
}//package | |
package { | |
import com.vpg.vpage.components.button.*; | |
public dynamic class magnifying_glass_btn extends BasicButton { | |
public function magnifying_glass_btn(){ | |
addFrameScript(10, this.frame11, 24, this.frame25); | |
} | |
function frame11(){ | |
stop(); | |
} | |
function frame25(){ | |
stop(); | |
} | |
} | |
}//package | |
package main_read14_fla { | |
import flash.display.*; | |
public dynamic class audio_thumb_btn_76 extends MovieClip { | |
public function audio_thumb_btn_76(){ | |
addFrameScript(4, this.frame5, 9, this.frame10); | |
} | |
function frame5(){ | |
stop(); | |
} | |
function frame10(){ | |
stop(); | |
} | |
} | |
}//package main_read14_fla | |
package main_read14_fla { | |
import flash.display.*; | |
public dynamic class scroll_btn_down_33 extends MovieClip { | |
public function scroll_btn_down_33(){ | |
addFrameScript(0, this.frame1); | |
} | |
function frame1(){ | |
stop(); | |
} | |
} | |
}//package main_read14_fla | |
package main_read14_fla { | |
import flash.display.*; | |
public dynamic class scroll_btn_up_37 extends MovieClip { | |
public function scroll_btn_up_37(){ | |
addFrameScript(0, this.frame1); | |
} | |
function frame1(){ | |
stop(); | |
} | |
} | |
}//package main_read14_fla | |
package { | |
import com.vpg.vpage.components.button.*; | |
public dynamic class zoom_in_btn extends BasicButton { | |
} | |
}//package | |
package { | |
import flash.display.*; | |
public dynamic class box extends MovieClip { | |
} | |
}//package | |
package { | |
import com.vpg.vpage.components.button.*; | |
public dynamic class note_btn extends BasicButton { | |
public function note_btn(){ | |
addFrameScript(10, this.frame11, 24, this.frame25); | |
} | |
function frame11(){ | |
stop(); | |
} | |
function frame25(){ | |
stop(); | |
} | |
} | |
}//package | |
package { | |
import com.vpg.vpage.components.button.*; | |
public dynamic class zoomto100btn extends BasicButton { | |
} | |
}//package | |
package fl.transitions.easing { | |
public class Regular { | |
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ | |
_arg1 = (_arg1 / _arg4); | |
return ((((_arg3 * _arg1) * _arg1) + _arg2)); | |
} | |
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ | |
_arg1 = (_arg1 / _arg4); | |
return ((((-(_arg3) * _arg1) * (_arg1 - 2)) + _arg2)); | |
} | |
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ | |
_arg1 = (_arg1 / (_arg4 / 2)); | |
if (_arg1 < 1){ | |
return (((((_arg3 / 2) * _arg1) * _arg1) + _arg2)); | |
}; | |
--_arg1; | |
return ((((-(_arg3) / 2) * ((_arg1 * (_arg1 - 2)) - 1)) + _arg2)); | |
} | |
} | |
}//package fl.transitions.easing | |
package fl.transitions { | |
import flash.events.*; | |
public class TweenEvent extends Event { | |
public static const MOTION_START:String = "motionStart"; | |
public static const MOTION_STOP:String = "motionStop"; | |
public static const MOTION_FINISH:String = "motionFinish"; | |
public static const MOTION_CHANGE:String = "motionChange"; | |
public static const MOTION_RESUME:String = "motionResume"; | |
public static const MOTION_LOOP:String = "motionLoop"; | |
public var time:Number = NaN; | |
public var position:Number = NaN; | |
public function TweenEvent(_arg1:String, _arg2:Number, _arg3:Number, _arg4:Boolean=false, _arg5:Boolean=false){ | |
super(_arg1, _arg4, _arg5); | |
this.time = _arg2; | |
this.position = _arg3; | |
} | |
override public function clone():Event{ | |
return (new TweenEvent(this.type, this.time, this.position, this.bubbles, this.cancelable)); | |
} | |
} | |
}//package fl.transitions | |
package fl.transitions { | |
import flash.display.*; | |
import flash.events.*; | |
import flash.utils.*; | |
public class Tween extends EventDispatcher { | |
protected static var _mc:MovieClip = new MovieClip(); | |
public var isPlaying:Boolean = false; | |
public var obj:Object = null; | |
public var prop:String = ""; | |
public var func:Function; | |
public var begin:Number = NaN; | |
public var change:Number = NaN; | |
public var useSeconds:Boolean = false; | |
public var prevTime:Number = NaN; | |
public var prevPos:Number = NaN; | |
public var looping:Boolean = false; | |
private var _duration:Number = NaN; | |
private var _time:Number = NaN; | |
private var _fps:Number = NaN; | |
private var _position:Number = NaN; | |
private var _startTime:Number = NaN; | |
private var _intervalID:uint = 0; | |
private var _finish:Number = NaN; | |
private var _timer:Timer = null; | |
public function Tween(_arg1:Object, _arg2:String, _arg3:Function, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Boolean=false){ | |
this.func = function (_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ | |
return ((((_arg3 * _arg1) / _arg4) + _arg2)); | |
}; | |
super(); | |
if (!arguments.length){ | |
return; | |
}; | |
this.obj = _arg1; | |
this.prop = _arg2; | |
this.begin = _arg4; | |
this.position = _arg4; | |
this.duration = _arg6; | |
this.useSeconds = _arg7; | |
if ((_arg3 is Function)){ | |
this.func = _arg3; | |
}; | |
this.finish = _arg5; | |
this._timer = new Timer(100); | |
this.start(); | |
} | |
public function get time():Number{ | |
return (this._time); | |
} | |
public function set time(_arg1:Number):void{ | |
this.prevTime = this._time; | |
if (_arg1 > this.duration){ | |
if (this.looping){ | |
this.rewind((_arg1 - this._duration)); | |
this.update(); | |
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_LOOP, this._time, this._position)); | |
} else { | |
if (this.useSeconds){ | |
this._time = this._duration; | |
this.update(); | |
}; | |
this.stop(); | |
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_FINISH, this._time, this._position)); | |
}; | |
} else { | |
if (_arg1 < 0){ | |
this.rewind(); | |
this.update(); | |
} else { | |
this._time = _arg1; | |
this.update(); | |
}; | |
}; | |
} | |
public function get duration():Number{ | |
return (this._duration); | |
} | |
public function set duration(_arg1:Number):void{ | |
this._duration = ((_arg1)<=0) ? Infinity : _arg1; | |
} | |
public function get FPS():Number{ | |
return (this._fps); | |
} | |
public function set FPS(_arg1:Number):void{ | |
var _local2:Boolean = this.isPlaying; | |
this.stopEnterFrame(); | |
this._fps = _arg1; | |
if (_local2){ | |
this.startEnterFrame(); | |
}; | |
} | |
public function get position():Number{ | |
return (this.getPosition(this._time)); | |
} | |
public function set position(_arg1:Number):void{ | |
this.setPosition(_arg1); | |
} | |
public function getPosition(_arg1:Number=NaN):Number{ | |
if (isNaN(_arg1)){ | |
_arg1 = this._time; | |
}; | |
return (this.func(_arg1, this.begin, this.change, this._duration)); | |
} | |
public function setPosition(_arg1:Number):void{ | |
this.prevPos = this._position; | |
if (this.prop.length){ | |
this.obj[this.prop] = (this._position = _arg1); | |
}; | |
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_CHANGE, this._time, this._position)); | |
} | |
public function get finish():Number{ | |
return ((this.begin + this.change)); | |
} | |
public function set finish(_arg1:Number):void{ | |
this.change = (_arg1 - this.begin); | |
} | |
public function continueTo(_arg1:Number, _arg2:Number):void{ | |
this.begin = this.position; | |
this.finish = _arg1; | |
if (!isNaN(_arg2)){ | |
this.duration = _arg2; | |
}; | |
this.start(); | |
} | |
public function yoyo():void{ | |
this.continueTo(this.begin, this.time); | |
} | |
protected function startEnterFrame():void{ | |
var _local1:Number; | |
if (isNaN(this._fps)){ | |
_mc.addEventListener(Event.ENTER_FRAME, this.onEnterFrame, false, 0, true); | |
} else { | |
_local1 = (1000 / this._fps); | |
this._timer.delay = _local1; | |
this._timer.addEventListener(TimerEvent.TIMER, this.timerHandler, false, 0, true); | |
this._timer.start(); | |
}; | |
this.isPlaying = true; | |
} | |
protected function stopEnterFrame():void{ | |
if (isNaN(this._fps)){ | |
_mc.removeEventListener(Event.ENTER_FRAME, this.onEnterFrame); | |
} else { | |
this._timer.stop(); | |
}; | |
this.isPlaying = false; | |
} | |
public function start():void{ | |
this.rewind(); | |
this.startEnterFrame(); | |
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_START, this._time, this._position)); | |
} | |
public function stop():void{ | |
this.stopEnterFrame(); | |
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_STOP, this._time, this._position)); | |
} | |
public function resume():void{ | |
this.fixTime(); | |
this.startEnterFrame(); | |
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_RESUME, this._time, this._position)); | |
} | |
public function rewind(_arg1:Number=0):void{ | |
this._time = _arg1; | |
this.fixTime(); | |
this.update(); | |
} | |
public function fforward():void{ | |
this.time = this._duration; | |
this.fixTime(); | |
} | |
public function nextFrame():void{ | |
if (this.useSeconds){ | |
this.time = ((getTimer() - this._startTime) / 1000); | |
} else { | |
this.time = (this._time + 1); | |
}; | |
} | |
protected function onEnterFrame(_arg1:Event):void{ | |
this.nextFrame(); | |
} | |
protected function timerHandler(_arg1:TimerEvent):void{ | |
this.nextFrame(); | |
_arg1.updateAfterEvent(); | |
} | |
public function prevFrame():void{ | |
if (!this.useSeconds){ | |
this.time = (this._time - 1); | |
}; | |
} | |
private function fixTime():void{ | |
if (this.useSeconds){ | |
this._startTime = (getTimer() - (this._time * 1000)); | |
}; | |
} | |
private function update():void{ | |
this.setPosition(this.getPosition(this._time)); | |
} | |
} | |
}//package fl.transitions | |
package fl.motion { | |
import flash.display.*; | |
import flash.geom.*; | |
public class Color extends ColorTransform { | |
private var _tintColor:Number = 0; | |
private var _tintMultiplier:Number = 0; | |
public function Color(_arg1:Number=1, _arg2:Number=1, _arg3:Number=1, _arg4:Number=1, _arg5:Number=0, _arg6:Number=0, _arg7:Number=0, _arg8:Number=0){ | |
super(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8); | |
} | |
public static function fromXML(_arg1:XML):Color{ | |
return (Color(new (Color)().parseXML(_arg1))); | |
} | |
public static function interpolateTransform(_arg1:ColorTransform, _arg2:ColorTransform, _arg3:Number):ColorTransform{ | |
var _local4:Number = (1 - _arg3); | |
var _local5:ColorTransform = new ColorTransform(((_arg1.redMultiplier * _local4) + (_arg2.redMultiplier * _arg3)), ((_arg1.greenMultiplier * _local4) + (_arg2.greenMultiplier * _arg3)), ((_arg1.blueMultiplier * _local4) + (_arg2.blueMultiplier * _arg3)), ((_arg1.alphaMultiplier * _local4) + (_arg2.alphaMultiplier * _arg3)), ((_arg1.redOffset * _local4) + (_arg2.redOffset * _arg3)), ((_arg1.greenOffset * _local4) + (_arg2.greenOffset * _arg3)), ((_arg1.blueOffset * _local4) + (_arg2.blueOffset * _arg3)), ((_arg1.alphaOffset * _local4) + (_arg2.alphaOffset * _arg3))); | |
return (_local5); | |
} | |
public static function interpolateColor(_arg1:uint, _arg2:uint, _arg3:Number):uint{ | |
var _local4:Number = (1 - _arg3); | |
var _local5:uint = ((_arg1 >> 24) & 0xFF); | |
var _local6:uint = ((_arg1 >> 16) & 0xFF); | |
var _local7:uint = ((_arg1 >> 8) & 0xFF); | |
var _local8:uint = (_arg1 & 0xFF); | |
var _local9:uint = ((_arg2 >> 24) & 0xFF); | |
var _local10:uint = ((_arg2 >> 16) & 0xFF); | |
var _local11:uint = ((_arg2 >> 8) & 0xFF); | |
var _local12:uint = (_arg2 & 0xFF); | |
var _local13:uint = ((_local5 * _local4) + (_local9 * _arg3)); | |
var _local14:uint = ((_local6 * _local4) + (_local10 * _arg3)); | |
var _local15:uint = ((_local7 * _local4) + (_local11 * _arg3)); | |
var _local16:uint = ((_local8 * _local4) + (_local12 * _arg3)); | |
var _local17:uint = ((((_local13 << 24) | (_local14 << 16)) | (_local15 << 8)) | _local16); | |
return (_local17); | |
} | |
public function get brightness():Number{ | |
return (((this.redOffset) ? (1 - this.redMultiplier) : (this.redMultiplier - 1))); | |
} | |
public function set brightness(_arg1:Number):void{ | |
if (_arg1 > 1){ | |
_arg1 = 1; | |
} else { | |
if (_arg1 < -1){ | |
_arg1 = -1; | |
}; | |
}; | |
var _local2:Number = (1 - Math.abs(_arg1)); | |
var _local3:Number = 0; | |
if (_arg1 > 0){ | |
_local3 = (_arg1 * 0xFF); | |
}; | |
this.redMultiplier = (this.greenMultiplier = (this.blueMultiplier = _local2)); | |
this.redOffset = (this.greenOffset = (this.blueOffset = _local3)); | |
} | |
public function setTint(_arg1:uint, _arg2:Number):void{ | |
this._tintColor = _arg1; | |
this._tintMultiplier = _arg2; | |
this.redMultiplier = (this.greenMultiplier = (this.blueMultiplier = (1 - _arg2))); | |
var _local3:uint = ((_arg1 >> 16) & 0xFF); | |
var _local4:uint = ((_arg1 >> 8) & 0xFF); | |
var _local5:uint = (_arg1 & 0xFF); | |
this.redOffset = Math.round((_local3 * _arg2)); | |
this.greenOffset = Math.round((_local4 * _arg2)); | |
this.blueOffset = Math.round((_local5 * _arg2)); | |
} | |
public function get tintColor():uint{ | |
return (this._tintColor); | |
} | |
public function set tintColor(_arg1:uint):void{ | |
this.setTint(_arg1, this.tintMultiplier); | |
} | |
private function deriveTintColor():uint{ | |
var _local1:Number = (1 / this.tintMultiplier); | |
var _local2:uint = Math.round((this.redOffset * _local1)); | |
var _local3:uint = Math.round((this.greenOffset * _local1)); | |
var _local4:uint = Math.round((this.blueOffset * _local1)); | |
var _local5:uint = (((_local2 << 16) | (_local3 << 8)) | _local4); | |
return (_local5); | |
} | |
public function get tintMultiplier():Number{ | |
return (this._tintMultiplier); | |
} | |
public function set tintMultiplier(_arg1:Number):void{ | |
this.setTint(this.tintColor, _arg1); | |
} | |
private function parseXML(_arg1:XML=null):Color{ | |
var _local3:XML; | |
var _local4:String; | |
var _local5:uint; | |
if (!_arg1){ | |
return (this); | |
}; | |
var _local2:XML = _arg1.elements()[0]; | |
if (!_local2){ | |
return (this); | |
}; | |
for each (_local3 in _local2.attributes()) { | |
_local4 = _local3.localName(); | |
if (_local4 == "tintColor"){ | |
_local5 = (Number(_local3.toString()) as uint); | |
this.tintColor = _local5; | |
} else { | |
this[_local4] = Number(_local3.toString()); | |
}; | |
}; | |
return (this); | |
} | |
} | |
}//package fl.motion | |
package { | |
import com.vpg.vpage.components.button.*; | |
public dynamic class help_btn extends BasicButton { | |
} | |
}//package | |
package { | |
import com.vpg.vpage.components.button.*; | |
public dynamic class glossary_btn extends BasicButton { | |
} | |
}//package | |
package com.adobe.serialization.json { | |
public class JSONToken { | |
private var _type:int; | |
private var _value:Object; | |
public function JSONToken(_arg1:int=-1, _arg2:Object=null){ | |
this._type = _arg1; | |
this._value = _arg2; | |
} | |
public function get type():int{ | |
return (this._type); | |
} | |
public function set type(_arg1:int):void{ | |
this._type = _arg1; | |
} | |
public function get value():Object{ | |
return (this._value); | |
} | |
public function set value(_arg1:Object):void{ | |
this._value = _arg1; | |
} | |
} | |
}//package com.adobe.serialization.json | |
package com.adobe.serialization.json { | |
import flash.utils.*; | |
public class JSONEncoder { | |
private var jsonString:String; | |
public function JSONEncoder(_arg1){ | |
this.jsonString = this.convertToString(_arg1); | |
} | |
public function getString():String{ | |
return (this.jsonString); | |
} | |
private function convertToString(_arg1):String{ | |
if ((_arg1 is String)){ | |
return (this.escapeString((_arg1 as String))); | |
}; | |
if ((_arg1 is Number)){ | |
return (((isFinite((_arg1 as Number))) ? _arg1.toString() : "null")); | |
}; | |
if ((_arg1 is Boolean)){ | |
return (((_arg1) ? "true" : "false")); | |
}; | |
if ((_arg1 is Array)){ | |
return (this.arrayToString((_arg1 as Array))); | |
}; | |
if ((((_arg1 is Object)) && (!((_arg1 == null))))){ | |
return (this.objectToString(_arg1)); | |
}; | |
return ("null"); | |
} | |
private function escapeString(_arg1:String):String{ | |
var _local3:String; | |
var _local6:String; | |
var _local7:String; | |
var _local2 = ""; | |
var _local4:Number = _arg1.length; | |
var _local5:int; | |
while (_local5 < _local4) { | |
_local3 = _arg1.charAt(_local5); | |
switch (_local3){ | |
case "\"": | |
_local2 = (_local2 + "\\\""); | |
break; | |
case "\\": | |
_local2 = (_local2 + "\\\\"); | |
break; | |
case "\b": | |
_local2 = (_local2 + "\\b"); | |
break; | |
case "\f": | |
_local2 = (_local2 + "\\f"); | |
break; | |
case "\n": | |
_local2 = (_local2 + "\\n"); | |
break; | |
case "\r": | |
_local2 = (_local2 + "\\r"); | |
break; | |
case "\t": | |
_local2 = (_local2 + "\\t"); | |
break; | |
default: | |
if (_local3 < " "){ | |
_local6 = _local3.charCodeAt(0).toString(16); | |
_local7 = (((_local6.length == 2)) ? "00" : "000"); | |
_local2 = (_local2 + (("\\u" + _local7) + _local6)); | |
} else { | |
_local2 = (_local2 + _local3); | |
}; | |
}; | |
_local5++; | |
}; | |
return ((("\"" + _local2) + "\"")); | |
} | |
private function arrayToString(_arg1:Array):String{ | |
var _local2 = ""; | |
var _local3:int; | |
while (_local3 < _arg1.length) { | |
if (_local2.length > 0){ | |
_local2 = (_local2 + ","); | |
}; | |
_local2 = (_local2 + this.convertToString(_arg1[_local3])); | |
_local3++; | |
}; | |
return ((("[" + _local2) + "]")); | |
} | |
private function objectToString(_arg1:Object):String{ | |
var value:* = null; | |
var key:* = null; | |
var v:* = null; | |
var o:* = _arg1; | |
var s:* = ""; | |
var classInfo:* = describeType(o); | |
if ([email protected]() == "Object"){ | |
for (key in o) { | |
value = o[key]; | |
if ((value is Function)){ | |
} else { | |
if (s.length > 0){ | |
s = (s + ","); | |
}; | |
s = (s + ((this.escapeString(key) + ":") + this.convertToString(value))); | |
}; | |
}; | |
} else { | |
for each (v in classInfo..*.(((name() == "variable")) || ((((name() == "accessor")) && ((attribute("access").charAt(0) == "r")))))) { | |
if (((v.metadata) && ((v.metadata.(@name == "Transient").length() > 0)))){ | |
} else { | |
if (s.length > 0){ | |
s = (s + ","); | |
}; | |
s = (s + ((this.escapeString([email protected]()) + ":") + this.convertToString(o[v.@name]))); | |
}; | |
}; | |
}; | |
return ((("{" + s) + "}")); | |
} | |
} | |
}//package com.adobe.serialization.json | |
package com.adobe.serialization.json { | |
public class JSONParseError extends Error { | |
private var _location:int; | |
private var _text:String; | |
public function JSONParseError(_arg1:String="", _arg2:int=0, _arg3:String=""){ | |
super(_arg1); | |
name = "JSONParseError"; | |
this._location = _arg2; | |
this._text = _arg3; | |
} | |
public function get location():int{ | |
return (this._location); | |
} | |
public function get text():String{ | |
return (this._text); | |
} | |
} | |
}//package com.adobe.serialization.json | |
package com.adobe.serialization.json { | |
public class JSONTokenizer { | |
private var strict:Boolean; | |
private var obj:Object; | |
private var jsonString:String; | |
private var loc:int; | |
private var ch:String; | |
private var controlCharsRegExp:RegExp; | |
public function JSONTokenizer(_arg1:String, _arg2:Boolean){ | |
this.controlCharsRegExp = /[\x00-\x1F]/; | |
super(); | |
this.jsonString = _arg1; | |
this.strict = _arg2; | |
this.loc = 0; | |
this.nextChar(); | |
} | |
public function getNextToken():JSONToken{ | |
var _local2:String; | |
var _local3:String; | |
var _local4:String; | |
var _local5:String; | |
var _local1:JSONToken = new JSONToken(); | |
this.skipIgnored(); | |
switch (this.ch){ | |
case "{": | |
_local1.type = JSONTokenType.LEFT_BRACE; | |
_local1.value = "{"; | |
this.nextChar(); | |
break; | |
case "}": | |
_local1.type = JSONTokenType.RIGHT_BRACE; | |
_local1.value = "}"; | |
this.nextChar(); | |
break; | |
case "[": | |
_local1.type = JSONTokenType.LEFT_BRACKET; | |
_local1.value = "["; | |
this.nextChar(); | |
break; | |
case "]": | |
_local1.type = JSONTokenType.RIGHT_BRACKET; | |
_local1.value = "]"; | |
this.nextChar(); | |
break; | |
case ",": | |
_local1.type = JSONTokenType.COMMA; | |
_local1.value = ","; | |
this.nextChar(); | |
break; | |
case ":": | |
_local1.type = JSONTokenType.COLON; | |
_local1.value = ":"; | |
this.nextChar(); | |
break; | |
case "t": | |
_local2 = ((("t" + this.nextChar()) + this.nextChar()) + this.nextChar()); | |
if (_local2 == "true"){ | |
_local1.type = JSONTokenType.TRUE; | |
_local1.value = true; | |
this.nextChar(); | |
} else { | |
this.parseError(("Expecting 'true' but found " + _local2)); | |
}; | |
break; | |
case "f": | |
_local3 = (((("f" + this.nextChar()) + this.nextChar()) + this.nextChar()) + this.nextChar()); | |
if (_local3 == "false"){ | |
_local1.type = JSONTokenType.FALSE; | |
_local1.value = false; | |
this.nextChar(); | |
} else { | |
this.parseError(("Expecting 'false' but found " + _local3)); | |
}; | |
break; | |
case "n": | |
_local4 = ((("n" + this.nextChar()) + this.nextChar()) + this.nextChar()); | |
if (_local4 == "null"){ | |
_local1.type = JSONTokenType.NULL; | |
_local1.value = null; | |
this.nextChar(); | |
} else { | |
this.parseError(("Expecting 'null' but found " + _local4)); | |
}; | |
break; | |
case "N": | |
_local5 = (("N" + this.nextChar()) + this.nextChar()); | |
if (_local5 == "NaN"){ | |
_local1.type = JSONTokenType.NAN; | |
_local1.value = NaN; | |
this.nextChar(); | |
} else { | |
this.parseError(("Expecting 'NaN' but found " + _local5)); | |
}; | |
break; | |
case "\"": | |
_local1 = this.readString(); | |
break; | |
default: | |
if (((this.isDigit(this.ch)) || ((this.ch == "-")))){ | |
_local1 = this.readNumber(); | |
} else { | |
if (this.ch == ""){ | |
return (null); | |
}; | |
this.parseError((("Unexpected " + this.ch) + " encountered")); | |
}; | |
}; | |
return (_local1); | |
} | |
private function readString():JSONToken{ | |
var _local3:int; | |
var _local4:int; | |
var _local1:int = this.loc; | |
do { | |
_local1 = this.jsonString.indexOf("\"", _local1); | |
if (_local1 >= 0){ | |
_local3 = 0; | |
_local4 = (_local1 - 1); | |
while (this.jsonString.charAt(_local4) == "\\") { | |
_local3++; | |
_local4--; | |
}; | |
if ((_local3 % 2) == 0){ | |
break; | |
}; | |
_local1++; | |
} else { | |
this.parseError("Unterminated string literal"); | |
}; | |
} while (true); | |
var _local2:JSONToken = new JSONToken(); | |
_local2.type = JSONTokenType.STRING; | |
_local2.value = this.unescapeString(this.jsonString.substr(this.loc, (_local1 - this.loc))); | |
this.loc = (_local1 + 1); | |
this.nextChar(); | |
return (_local2); | |
} | |
public function unescapeString(_arg1:String):String{ | |
var _local6:int; | |
var _local7:String; | |
var _local8:String; | |
var _local9:int; | |
var _local10:String; | |
if (((this.strict) && (this.controlCharsRegExp.test(_arg1)))){ | |
this.parseError("String contains unescaped control character (0x00-0x1F)"); | |
}; | |
var _local2 = ""; | |
var _local3:int; | |
var _local4:int; | |
var _local5:int = _arg1.length; | |
do { | |
_local3 = _arg1.indexOf("\\", _local4); | |
if (_local3 >= 0){ | |
_local2 = (_local2 + _arg1.substr(_local4, (_local3 - _local4))); | |
_local4 = (_local3 + 2); | |
_local6 = (_local3 + 1); | |
_local7 = _arg1.charAt(_local6); | |
switch (_local7){ | |
case "\"": | |
_local2 = (_local2 + "\""); | |
break; | |
case "\\": | |
_local2 = (_local2 + "\\"); | |
break; | |
case "n": | |
_local2 = (_local2 + "\n"); | |
break; | |
case "r": | |
_local2 = (_local2 + "\r"); | |
break; | |
case "t": | |
_local2 = (_local2 + "\t"); | |
break; | |
case "u": | |
_local8 = ""; | |
if ((_local4 + 4) > _local5){ | |
this.parseError("Unexpected end of input. Expecting 4 hex digits after \\u."); | |
}; | |
_local9 = _local4; | |
while (_local9 < (_local4 + 4)) { | |
_local10 = _arg1.charAt(_local9); | |
if (!this.isHexDigit(_local10)){ | |
this.parseError(("Excepted a hex digit, but found: " + _local10)); | |
}; | |
_local8 = (_local8 + _local10); | |
_local9++; | |
}; | |
_local2 = (_local2 + String.fromCharCode(parseInt(_local8, 16))); | |
_local4 = (_local4 + 4); | |
break; | |
case "f": | |
_local2 = (_local2 + "\f"); | |
break; | |
case "/": | |
_local2 = (_local2 + "/"); | |
break; | |
case "b": | |
_local2 = (_local2 + "\b"); | |
break; | |
default: | |
_local2 = (_local2 + ("\\" + _local7)); | |
}; | |
} else { | |
_local2 = (_local2 + _arg1.substr(_local4)); | |
break; | |
}; | |
} while (_local4 < _local5); | |
return (_local2); | |
} | |
private function readNumber():JSONToken{ | |
var _local3:JSONToken; | |
var _local1 = ""; | |
if (this.ch == "-"){ | |
_local1 = (_local1 + "-"); | |
this.nextChar(); | |
}; | |
if (!this.isDigit(this.ch)){ | |
this.parseError("Expecting a digit"); | |
}; | |
if (this.ch == "0"){ | |
_local1 = (_local1 + this.ch); | |
this.nextChar(); | |
if (this.isDigit(this.ch)){ | |
this.parseError("A digit cannot immediately follow 0"); | |
} else { | |
if (((!(this.strict)) && ((this.ch == "x")))){ | |
_local1 = (_local1 + this.ch); | |
this.nextChar(); | |
if (this.isHexDigit(this.ch)){ | |
_local1 = (_local1 + this.ch); | |
this.nextChar(); | |
} else { | |
this.parseError("Number in hex format require at least one hex digit after \"0x\""); | |
}; | |
while (this.isHexDigit(this.ch)) { | |
_local1 = (_local1 + this.ch); | |
this.nextChar(); | |
}; | |
}; | |
}; | |
} else { | |
while (this.isDigit(this.ch)) { | |
_local1 = (_local1 + this.ch); | |
this.nextChar(); | |
}; | |
}; | |
if (this.ch == "."){ | |
_local1 = (_local1 + "."); | |
this.nextChar(); | |
if (!this.isDigit(this.ch)){ | |
this.parseError("Expecting a digit"); | |
}; | |
while (this.isDigit(this.ch)) { | |
_local1 = (_local1 + this.ch); | |
this.nextChar(); | |
}; | |
}; | |
if ((((this.ch == "e")) || ((this.ch == "E")))){ | |
_local1 = (_local1 + "e"); | |
this.nextChar(); | |
if ((((this.ch == "+")) || ((this.ch == "-")))){ | |
_local1 = (_local1 + this.ch); | |
this.nextChar(); | |
}; | |
if (!this.isDigit(this.ch)){ | |
this.parseError("Scientific notation number needs exponent value"); | |
}; | |
while (this.isDigit(this.ch)) { | |
_local1 = (_local1 + this.ch); | |
this.nextChar(); | |
}; | |
}; | |
var _local2:Number = Number(_local1); | |
if (((isFinite(_local2)) && (!(isNaN(_local2))))){ | |
_local3 = new JSONToken(); | |
_local3.type = JSONTokenType.NUMBER; | |
_local3.value = _local2; | |
return (_local3); | |
}; | |
this.parseError((("Number " + _local2) + " is not valid!")); | |
return (null); | |
} | |
private function nextChar():String{ | |
return ((this.ch = this.jsonString.charAt(this.loc++))); | |
} | |
private function skipIgnored():void{ | |
var _local1:int; | |
do { | |
_local1 = this.loc; | |
this.skipWhite(); | |
this.skipComments(); | |
} while (_local1 != this.loc); | |
} | |
private function skipComments():void{ | |
if (this.ch == "/"){ | |
this.nextChar(); | |
switch (this.ch){ | |
case "/": | |
do { | |
this.nextChar(); | |
} while (((!((this.ch == "\n"))) && (!((this.ch == ""))))); | |
this.nextChar(); | |
break; | |
case "*": | |
this.nextChar(); | |
while (true) { | |
if (this.ch == "*"){ | |
this.nextChar(); | |
if (this.ch == "/"){ | |
this.nextChar(); | |
break; | |
}; | |
} else { | |
this.nextChar(); | |
}; | |
if (this.ch == ""){ | |
this.parseError("Multi-line comment not closed"); | |
}; | |
}; | |
break; | |
default: | |
this.parseError((("Unexpected " + this.ch) + " encountered (expecting '/' or '*' )")); | |
}; | |
}; | |
} | |
private function skipWhite():void{ | |
while (this.isWhiteSpace(this.ch)) { | |
this.nextChar(); | |
}; | |
} | |
private function isWhiteSpace(_arg1:String):Boolean{ | |
if ((((((((_arg1 == " ")) || ((_arg1 == "\t")))) || ((_arg1 == "\n")))) || ((_arg1 == "\r")))){ | |
return (true); | |
}; | |
if (((!(this.strict)) && ((_arg1.charCodeAt(0) == 160)))){ | |
return (true); | |
}; | |
return (false); | |
} | |
private function isDigit(_arg1:String):Boolean{ | |
return ((((_arg1 >= "0")) && ((_arg1 <= "9")))); | |
} | |
private function isHexDigit(_arg1:String):Boolean{ | |
return (((((this.isDigit(_arg1)) || ((((_arg1 >= "A")) && ((_arg1 <= "F")))))) || ((((_arg1 >= "a")) && ((_arg1 <= "f")))))); | |
} | |
public function parseError(_arg1:String):void{ | |
throw (new JSONParseError(_arg1, this.loc, this.jsonString)); | |
} | |
} | |
}//package com.adobe.serialization.json | |
package com.adobe.serialization.json { | |
public class JSONTokenType { | |
public static const UNKNOWN:int = -1; | |
public static const COMMA:int = 0; | |
public static const LEFT_BRACE:int = 1; | |
public static const RIGHT_BRACE:int = 2; | |
public static const LEFT_BRACKET:int = 3; | |
public static const RIGHT_BRACKET:int = 4; | |
public static const COLON:int = 6; | |
public static const TRUE:int = 7; | |
public static const FALSE:int = 8; | |
public static const NULL:int = 9; | |
public static const STRING:int = 10; | |
public static const NUMBER:int = 11; | |
public static const NAN:int = 12; | |
} | |
}//package com.adobe.serialization.json | |
package com.adobe.serialization.json { | |
public class JSONDecoder { | |
private var strict:Boolean; | |
private var value; | |
private var tokenizer:JSONTokenizer; | |
private var token:JSONToken; | |
public function JSONDecoder(_arg1:String, _arg2:Boolean){ | |
this.strict = _arg2; | |
this.tokenizer = new JSONTokenizer(_arg1, _arg2); | |
this.nextToken(); | |
this.value = this.parseValue(); | |
if (((_arg2) && (!((this.nextToken() == null))))){ | |
this.tokenizer.parseError("Unexpected characters left in input stream"); | |
}; | |
} | |
public function getValue(){ | |
return (this.value); | |
} | |
private function nextToken():JSONToken{ | |
return ((this.token = this.tokenizer.getNextToken())); | |
} | |
private function parseArray():Array{ | |
var _local1:Array = new Array(); | |
this.nextToken(); | |
if (this.token.type == JSONTokenType.RIGHT_BRACKET){ | |
return (_local1); | |
}; | |
if (((!(this.strict)) && ((this.token.type == JSONTokenType.COMMA)))){ | |
this.nextToken(); | |
if (this.token.type == JSONTokenType.RIGHT_BRACKET){ | |
return (_local1); | |
}; | |
this.tokenizer.parseError(("Leading commas are not supported. Expecting ']' but found " + this.token.value)); | |
}; | |
_local1.push(this.parseValue()); | |
this.nextToken(); | |
if (this.token.type == JSONTokenType.RIGHT_BRACKET){ | |
return (_local1); | |
}; | |
if (this.token.type == JSONTokenType.COMMA){ | |
this.nextToken(); | |
if (!this.strict){ | |
if (this.token.type == JSONTokenType.RIGHT_BRACKET){ | |
return (_local1); | |
}; | |
}; | |
} else { | |
this.tokenizer.parseError(("Expecting ] or , but found " + this.token.value)); | |
}; | |
//unresolved jump | |
} | |
private function parseObject():Object{ | |
var _local2:String; | |
var _local1:Object = new Object(); | |
this.nextToken(); | |
if (this.token.type == JSONTokenType.RIGHT_BRACE){ | |
return (_local1); | |
}; | |
if (((!(this.strict)) && ((this.token.type == JSONTokenType.COMMA)))){ | |
this.nextToken(); | |
if (this.token.type == JSONTokenType.RIGHT_BRACE){ | |
return (_local1); | |
}; | |
this.tokenizer.parseError(("Leading commas are not supported. Expecting '}' but found " + this.token.value)); | |
}; | |
if (this.token.type == JSONTokenType.STRING){ | |
_local2 = String(this.token.value); | |
this.nextToken(); | |
if (this.token.type == JSONTokenType.COLON){ | |
this.nextToken(); | |
_local1[_local2] = this.parseValue(); | |
this.nextToken(); | |
if (this.token.type == JSONTokenType.RIGHT_BRACE){ | |
return (_local1); | |
}; | |
if (this.token.type == JSONTokenType.COMMA){ | |
this.nextToken(); | |
if (!this.strict){ | |
if (this.token.type == JSONTokenType.RIGHT_BRACE){ | |
return (_local1); | |
}; | |
}; | |
} else { | |
this.tokenizer.parseError(("Expecting } or , but found " + this.token.value)); | |
}; | |
} else { | |
this.tokenizer.parseError(("Expecting : but found " + this.token.value)); | |
}; | |
} else { | |
this.tokenizer.parseError(("Expecting string but found " + this.token.value)); | |
}; | |
//unresolved jump | |
} | |
private function parseValue():Object{ | |
if (this.token == null){ | |
this.tokenizer.parseError("Unexpected end of input"); | |
}; | |
switch (this.token.type){ | |
case JSONTokenType.LEFT_BRACE: | |
return (this.parseObject()); | |
case JSONTokenType.LEFT_BRACKET: | |
return (this.parseArray()); | |
case JSONTokenType.STRING: | |
case JSONTokenType.NUMBER: | |
case JSONTokenType.TRUE: | |
case JSONTokenType.FALSE: | |
case JSONTokenType.NULL: | |
return (this.token.value); | |
case JSONTokenType.NAN: | |
if (!this.strict){ | |
return (this.token.value); | |
}; | |
this.tokenizer.parseError(("Unexpected " + this.token.value)); | |
default: | |
this.tokenizer.parseError(("Unexpected " + this.token.value)); | |
}; | |
return (null); | |
} | |
} | |
}//package com.adobe.serialization.json | |
package com.adobe.serialization.json { | |
public class JSON { | |
public static function encode(_arg1:Object):String{ | |
return (new JSONEncoder(_arg1).getString()); | |
} | |
public static function decode(_arg1:String, _arg2:Boolean=true){ | |
return (new JSONDecoder(_arg1, _arg2).getValue()); | |
} | |
} | |
}//package com.adobe.serialization.json | |
package com.vpg.read14.vpage.shell.search { | |
import flash.display.*; | |
import flash.geom.*; | |
import com.vpg.vpage.shell.search.*; | |
import flash.events.*; | |
import flash.text.*; | |
import com.vpg.vpage.utils.*; | |
import com.vpg.vpage.components.scrollpane.*; | |
public class SearchMain extends MovieClip implements IDraggable { | |
public static const SEARCH_HIT:String = "loadSearchHit"; | |
public var title_tf:TextField; | |
public var tf:TextField; | |
public var bg:MovieClip; | |
public var search_btn:MovieClip; | |
public var close_btn:MovieClip; | |
public var content_area:MovieClip; | |
private var _sp:StandardScrollPane; | |
private var _service:SearchService; | |
private var _resultsField:TextField; | |
private var _results:SearchResults; | |
private var _noResultsMsg:String = "No results found."; | |
private var _errorMsg:String = "An error occurred."; | |
private var _pageText:String = "Page"; | |
public function SearchMain(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:String){ | |
var _local6:Number; | |
super(); | |
this._pageText = _arg5; | |
this.title_tf.htmlText = _arg3; | |
this._service = new SearchService(_arg1, _arg2); | |
this._service.addEventListener(SearchService.RESULTS, this._searchResultsSuccess); | |
this._service.addEventListener(SearchService.ERROR, this._searchResultsError); | |
this._service.setResultsPerPage(50); | |
DisplayU.buttonify(this.search_btn, this._searchButtonEvent); | |
this.search_btn.tf.htmlText = (("<B>" + _arg4) + "</B>"); | |
DisplayU.buttonify(this.close_btn, this._closeButtonEvent); | |
DraggableItem.registerDraggable(this); | |
this._sp = new StandardScrollPane(); | |
_local6 = 8; | |
this._sp.setSize((this.content_area.width - (_local6 * 2)), (this.content_area.height - (_local6 * 2))); | |
this._sp.x = (this.content_area.x + _local6); | |
this._sp.y = (this.content_area.y + _local6); | |
this._sp.turnOffHScroll(); | |
addChild(this._sp); | |
SubmitOnEnterField.registerField(this.tf, this._searchRequestCallback); | |
this._resultsField = TextUtils.createTextField("Myriad Pro", 15, 3); | |
this._resultsField.addEventListener(TextEvent.LINK, this._pageLinkClicked); | |
this._resultsField.width = (this._sp.getWidth() - 30); | |
this._resultsField.height = 0; | |
this._resultsField.condenseWhite = true; | |
this._resultsField.mouseEnabled = true; | |
TextUtils.expandHeight(this._resultsField); | |
this._sp.getContentLayer().addChild(this._resultsField); | |
this._sp.refresh(); | |
} | |
public function setMessages(_arg1:String, _arg2:String):void{ | |
this._noResultsMsg = _arg1; | |
this._errorMsg = _arg2; | |
} | |
override public function getBounds(_arg1:DisplayObject):Rectangle{ | |
return (this.bg.getBounds(_arg1)); | |
} | |
public function hasBeenDragged():Boolean{ | |
return (DraggableItem.hasBeenDragged(this)); | |
} | |
public function doSearch(_arg1:String):void{ | |
this.tf.text = _arg1; | |
this._service.doSearch(_arg1); | |
} | |
public function getDraggableWindow():MovieClip{ | |
return (this); | |
} | |
public function getDragHitArea():MovieClip{ | |
return (this.bg); | |
} | |
public function getDragBounds():Rectangle{ | |
return (new Rectangle(0, 0, (stage.stageWidth - this.bg.width), (stage.stageHeight - this.bg.height))); | |
} | |
private function _searchButtonEvent(_arg1:Event):void{ | |
this.doSearch(this.tf.text); | |
} | |
private function _clearResults():void{ | |
this._resultsField.text = ""; | |
this._sp.refresh(); | |
} | |
private function _searchResultsError(_arg1:Event):void{ | |
this._displayMessage(this._errorMsg); | |
} | |
private function _searchResultsSuccess(_arg1:EventWithParam):void{ | |
var _local2:SearchResults = (_arg1.param as SearchResults); | |
if (_local2.status == "200"){ | |
this._displayMessage(this._noResultsMsg); | |
if (_local2.hits == 0){ | |
} else { | |
this._displayResults(_local2); | |
}; | |
} else { | |
this._displayMessage(_local2.message); | |
}; | |
} | |
private function _displayResults(_arg1:SearchResults):void{ | |
var _local5:XML; | |
var _local6:String; | |
var _local7:String; | |
var _local8:String; | |
this._clearResults(); | |
this._results = _arg1; | |
var _local2 = ""; | |
var _local3:XMLList = _arg1.hitsNode.hit; | |
var _local4:int; | |
while (_local4 < _local3.length()) { | |
_local5 = _local3[_local4]; | |
_local6 = [email protected](/^0*/, ""); | |
_local6 = ((StringU.fixHtmlEntities(this._pageText) + " ") + _local6); | |
_local7 = (((("<a href='event:" + _local5.@pageid) + "'>") + _local6) + "</a>"); | |
_local8 = _local5.snippets.toString(); | |
_local8 = _local8.split("<snippets>").join(""); | |
_local8 = _local8.split("</snippets>").join(""); | |
_local2 = (_local2 + (("<B><U><font color='#0000FF'>" + _local7) + "</font></U></B>")); | |
_local2 = (_local2 + "<br />"); | |
_local2 = (_local2 + _local8); | |
if (_local4 != (_local3.length() - 1)){ | |
_local2 = (_local2 + "<br /><br />"); | |
}; | |
_local4++; | |
}; | |
this._resultsField.htmlText = _local2; | |
this._sp.refresh(); | |
} | |
private function _displayMessage(_arg1:String):void{ | |
this._clearResults(); | |
_arg1 = StringU.fixHtmlEntities(_arg1); | |
this._resultsField.htmlText = _arg1; | |
this._sp.refresh(); | |
} | |
private function _closeButtonEvent(_arg1:Event):void{ | |
parent.removeChild(this); | |
} | |
private function _searchRequestCallback(_arg1:TextField):void{ | |
this.doSearch(_arg1.text); | |
} | |
private function _pageLinkClicked(_arg1:TextEvent):void{ | |
var _local2:String = _arg1.text; | |
var _local3:SearchHit = this._results.getHitByPageId(_local2); | |
dispatchEvent(new EventWithParam(SEARCH_HIT, _local3)); | |
} | |
} | |
}//package com.vpg.read14.vpage.shell.search | |
package com.vpg.read14.vpage.shell.notebook { | |
import flash.display.*; | |
import flash.geom.*; | |
import flash.events.*; | |
import flash.text.*; | |
import com.vpg.vpage.utils.*; | |
import com.vpg.vpage.components.scrollpane.*; | |
import flash.external.*; | |
public class NotebookMain extends MovieClip implements IDraggable { | |
public var close_btn:MovieClip; | |
public var submit_btn:MovieClip; | |
public var input_tf:TextField; | |
public var title_tf:TextField; | |
public var horizontal_rule:MovieClip; | |
public var content_area:MovieClip; | |
public var bg:MovieClip; | |
private var _sp:StandardScrollPane; | |
private var _questionTf:TextField; | |
private var _pg:String; | |
private var _id:String; | |
public function NotebookMain(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:String){ | |
this._pg = _arg3; | |
this._id = _arg2; | |
this._sp = new StandardScrollPane(); | |
addChild(this._sp); | |
this.submit_btn.tf.htmlText = (("<B>" + _arg4) + "</B>"); | |
var _local6:MovieClip = new QuestionField(); | |
this._sp.getContentLayer().addChild(_local6); | |
this._questionTf = _local6.tf; | |
this._sp.x = 59.6; | |
this._sp.y = 62.5; | |
if (_arg1){ | |
this.title_tf.htmlText = (("<B>" + _arg1) + "</B>"); | |
}; | |
DisplayU.buttonify(this.close_btn); | |
this.close_btn.addEventListener(MouseEvent.CLICK, this._closeClickEvent); | |
this.input_tf.text = ""; | |
this._setQuestionText((("<I>" + _arg5) + "</I>")); | |
ExternalInterface.addCallback("notebookQuestionReady", this._notebookQuestionReady); | |
ExternalInterface.addCallback("setNotebookError", this._notebookError); | |
ExternalInterface.call("getNotebookQuestion", _arg2); | |
DraggableItem.registerDraggable(this); | |
this.title_tf.mouseEnabled = false; | |
} | |
public function hasBeenDragged():Boolean{ | |
return (DraggableItem.hasBeenDragged(this)); | |
} | |
public function getDraggableWindow():MovieClip{ | |
return (this); | |
} | |
public function getDragHitArea():MovieClip{ | |
return (this.bg); | |
} | |
public function getDragBounds():Rectangle{ | |
return (new Rectangle(0, 0, (stage.stageWidth - this.bg.width), (stage.stageHeight - this.bg.height))); | |
} | |
private function _notebookQuestionReady(_arg1:String, _arg2:String):void{ | |
this._setQuestionText(_arg1); | |
this._setUserText(_arg2); | |
DisplayU.buttonify(this.submit_btn); | |
this.submit_btn.addEventListener(MouseEvent.CLICK, this._submitButtonClickEvent); | |
} | |
private function _close():void{ | |
parent.removeChild(this); | |
} | |
private function _submit():void{ | |
ExternalInterface.call("setNotebookResponse", this._id, this.input_tf.text, this._pg); | |
this._close(); | |
} | |
private function _setQuestionText(_arg1:String):void{ | |
this._questionTf.autoSize = TextFieldAutoSize.LEFT; | |
this._questionTf.wordWrap = true; | |
this._questionTf.multiline = true; | |
_arg1 = _arg1.split("<STRONG>").join("<strong>"); | |
_arg1 = _arg1.split("</STRONG>").join("</strong>"); | |
_arg1 = _arg1.split("<EM>").join("<em>"); | |
_arg1 = _arg1.split("</EM>").join("</em>"); | |
_arg1 = _arg1.split("<strong>").join("<b>"); | |
_arg1 = _arg1.split("</strong>").join("</b>"); | |
_arg1 = _arg1.split("<em>").join("<i>"); | |
_arg1 = _arg1.split("</em>").join("</i>"); | |
this._questionTf.htmlText = _arg1; | |
var _local2:Number = Math.min(this._questionTf.height, ((this.content_area.height - 20) / 2)); | |
this._sp.setSize((this._questionTf.width + 18), _local2); | |
this.horizontal_rule.y = ((this._sp.y + this._sp.getHeight()) + 8); | |
this.input_tf.y = (this.horizontal_rule.y + 12); | |
this.input_tf.height = (((this.content_area.height - this.input_tf.y) - 12) + this.content_area.y); | |
} | |
private function _notebookError(_arg1:String):void{ | |
this.input_tf.visible = false; | |
this._questionTf.autoSize = TextFieldAutoSize.LEFT; | |
this._questionTf.wordWrap = true; | |
this._questionTf.multiline = true; | |
this._questionTf.htmlText = _arg1; | |
var _local2:Number = Math.min(this._questionTf.height, ((this.content_area.height - 20) / 2)); | |
this._sp.setSize((this._questionTf.width + 18), _local2); | |
this.horizontal_rule.y = ((this._sp.x + this._sp.getHeight()) + 8); | |
} | |
private function _setUserText(_arg1:String):void{ | |
this.input_tf.text = _arg1; | |
} | |
private function _closeClickEvent(_arg1:Event):void{ | |
this._close(); | |
} | |
private function _submitButtonClickEvent(_arg1:Event):void{ | |
this._submit(); | |
} | |
} | |
}//package com.vpg.read14.vpage.shell.notebook | |
package com.vpg.read14.vpage.shell.notebook { | |
import flash.display.*; | |
import flash.text.*; | |
public dynamic class QuestionField extends MovieClip { | |
public var tf:TextField; | |
} | |
}//package com.vpg.read14.vpage.shell.notebook | |
package com.vpg.read14.vpage.shell.pageicons { | |
import com.vpg.vpage.shell.*; | |
import com.vpg.vpage.shell.pageicons.*; | |
import com.vpg.read14.vpage.shell.*; | |
public class Read14IconFunctions extends IconFunctions { | |
public function Read14IconFunctions(_arg1:App){ | |
super(_arg1); | |
} | |
override public function getIconFunction(_arg1:String):Function{ | |
var main:* = null; | |
var icontype:* = _arg1; | |
trace(("getIconFunction: Getting function for icontype " + icontype)); | |
main = (pMainMC as MainRead14); | |
switch (icontype){ | |
case "notebook_popup": | |
return (function (_arg1:Object){ | |
main.openNotebook(_arg1); | |
}); | |
case "mh_music_audio": | |
return (super.getIconFunction("audio")); | |
case "invisible_rect_gotopage": | |
return (super.getIconFunction("goto_page")); | |
case "invisible_rect_wprops": | |
return (super.getIconFunction("open_url_w_jsprops")); | |
case "open_activity": | |
return (function (_arg1:Object){ | |
main.openLanguageSummary(_arg1); | |
}); | |
default: | |
return (super.getIconFunction(icontype)); | |
}; | |
} | |
override public function getIconRollOverFunction(_arg1:String):Function{ | |
var icontype:* = _arg1; | |
var tIconFuncs:* = this; | |
switch (icontype){ | |
default: | |
return (function (){ | |
}); | |
}; | |
} | |
override public function getIconRollOutFunction(_arg1:String):Function{ | |
var icontype:* = _arg1; | |
var tIconFuncs:* = this; | |
switch (icontype){ | |
default: | |
return (function (){ | |
}); | |
}; | |
} | |
} | |
}//package com.vpg.read14.vpage.shell.pageicons | |
package com.vpg.read14.vpage.shell.help { | |
import flash.display.*; | |
import flash.events.*; | |
import flash.text.*; | |
import com.vpg.vpage.utils.*; | |
public class HelpWindow extends MovieClip { | |
public var close_btn:MovieClip; | |
public var content_mask:MovieClip; | |
public var content_holder:MovieClip; | |
public var outline:MovieClip; | |
public var content_area:MovieClip; | |
public var bg:MovieClip; | |
public var title_tf:TextField; | |
private var _art:Loader; | |
private var _artReady:Boolean; | |
public function HelpWindow(_arg1:String, _arg2:String){ | |
this.title_tf.htmlText = _arg2; | |
this._artReady = false; | |
this._art = NetU.doArtLoad(_arg1, this._artLoaded, this._artLoadError); | |
DisplayU.buttonify(this.close_btn, this._close); | |
} | |
public function setScreenSize(_arg1:Number, _arg2:Number):void{ | |
var _local3:Number = this.content_area.x; | |
var _local4:Number = (_local3 + 100); | |
var _local5:Number = (_arg2 - _local4); | |
var _local6:Number = (_arg1 - _local4); | |
trace(((_local6 + " ") + _local5)); | |
var _local7:Number = (800 / 600); | |
var _local8:Number = (_local6 / _local5); | |
if (_local8 > _local7){ | |
_local6 = (_local7 * _local5); | |
} else { | |
if (_local8 < _local7){ | |
_local5 = (_local6 / _local7); | |
}; | |
}; | |
trace(((_local6 + " ") + _local5)); | |
this.content_mask.width = _local6; | |
this.content_mask.height = _local5; | |
this.content_area.width = _local6; | |
this.content_area.height = _local5; | |
this.outline.width = _local6; | |
this.outline.height = _local5; | |
var _local9:Number = (this.bg.width - this.close_btn.x); | |
this.bg.width = (_local6 + (_local3 * 2)); | |
this.bg.height = ((_local5 + _local3) + this.content_area.y); | |
this.close_btn.x = (this.bg.width - _local9); | |
if (this._artReady){ | |
this._art.width = (_local6 + 1); | |
this._art.height = (_local5 + 1); | |
}; | |
} | |
private function _artLoaded(_arg1:Event):void{ | |
this._art.width = (this.content_area.width + 1); | |
this._art.height = (this.content_area.height + 1); | |
this.content_holder.addChild(this._art); | |
this._artReady = true; | |
dispatchEvent(new Event(Event.COMPLETE)); | |
} | |
private function _artLoadError(_arg1:Event):void{ | |
} | |
private function _close(_arg1:Event):void{ | |
visible = false; | |
} | |
} | |
}//package com.vpg.read14.vpage.shell.help | |
package com.vpg.read14.vpage.shell { | |
import flash.display.*; | |
import flash.geom.*; | |
import com.vpg.vpage.shell.search.*; | |
import com.vpg.vpage.shell.pageview.additionallayers.*; | |
import com.vpg.vpage.shell.*; | |
import flash.events.*; | |
import flash.text.*; | |
import com.vpg.vpage.utils.*; | |
import com.vpg.vpage.shell.whiteboard.*; | |
import com.vpg.vpage.shell.tools.*; | |
import com.vpg.vpage.shell.userdata.*; | |
import com.vpg.vpage.shell.pageicons.*; | |
import com.vpg.vpage.utils.mediamgr.*; | |
import com.vpg.read14.vpage.shell.toc.*; | |
import com.vpg.read14.vpage.shell.languagesummary.*; | |
import com.vpg.vpage.utils.print.*; | |
import com.vpg.read14.vpage.shell.pageicons.*; | |
import com.vpg.read14.vpage.shell.audio.*; | |
import com.vpg.read14.vpage.shell.help.*; | |
import com.vpg.read14.vpage.shell.notebook.*; | |
import com.vpg.read14.vpage.shell.search.*; | |
import com.vpg.read14.vpage.shell.srcontrols.*; | |
public class MainRead14 extends Main { | |
private var _footer:Footer; | |
private var _topbar:TopBar; | |
private var _srControls:SrControls; | |
private var _toc:TocMain; | |
private var _helpWindow:HelpWindow; | |
private var _notebook:NotebookMain; | |
private var _searchWindow:SearchMain; | |
private var _langSummary:LanguageSummary; | |
private var _highlighterOn:Boolean; | |
private var _whiteboardTool:AbstractTool; | |
public function MainRead14(){ | |
addEventListener(Event.ADDED_TO_STAGE, this._initFullScreenListener); | |
} | |
override public function initInterface():void{ | |
this._highlighterOn = false; | |
this._footer = new Footer(); | |
var _local1:Number = parseInt(pApp.getOption("nav_text_width", "50")); | |
this._footer.setNavTextWidth(_local1); | |
addChild(this._footer); | |
doStandardButtonHookup(this._footer.prev_btn); | |
doStandardButtonHookup(this._footer.next_btn); | |
doStandardButtonHookup(this._footer.single_page_btn); | |
doStandardButtonHookup(this._footer.double_page_btn); | |
doStandardButtonHookup(this._footer.zoom_in_btn); | |
doStandardButtonHookup(this._footer.zoom_out_btn); | |
doStandardButtonHookup(this._footer.zoom_to_100_btn); | |
doStandardButtonHookup(this._footer.glossary_btn); | |
doStandardButtonHookup(this._footer.index_btn); | |
doStandardTextFieldHookup(this._footer.nav_tf); | |
this._footer.toc_btn.addEventListener(MouseEvent.CLICK, this._tocClicked); | |
this._footer.drag_page_btn.addEventListener(MouseEvent.CLICK, this._dragPageClicked); | |
this._footer.note_btn.addEventListener(MouseEvent.CLICK, this._noteButtonClicked); | |
this._footer.highlight_btn.addEventListener(MouseEvent.CLICK, this._highlightBtnClicked); | |
this._footer.zoom_to_rect_btn.addEventListener(MouseEvent.CLICK, this._zoomToRectBtnClicked); | |
if (pApp.getOption("glossary_enabled", "0") == "0"){ | |
this._footer.hideGlossary(); | |
}; | |
if (pApp.getOption("index_enabled", "0") == "0"){ | |
this._footer.hideIndex(); | |
}; | |
if (pApp.getOption("hide_toc_btn", "0") == "1"){ | |
this._footer.hideToc(); | |
}; | |
if (pApp.getOption("enable_highlight_layer", "1") == "0"){ | |
this._footer.removeHighlighter(); | |
}; | |
if (pApp.getOption("hide_audio_toggle", "0") == "1"){ | |
this._footer.hideAudioToggle(); | |
}; | |
this._topbar = new TopBar(); | |
addChild(this._topbar); | |
doStandardButtonHookup(this._topbar.help_btn); | |
this._topbar.search_tf.text = pApp.getInterfaceText("search_box", "Search"); | |
SubmitOnEnterField.registerField(this._topbar.search_tf, this._searchEntered); | |
SelectOnFocusField.registerField(this._topbar.search_tf, this._topbar.search_tf.text); | |
DisplayU.buttonify(this._topbar.maximize_btn, this._maximizeClicked); | |
DisplayU.buttonify(this._topbar.minimize_btn, this._minimizeClicked); | |
if (pApp.getOption("hide_search_field", "0") == "1"){ | |
this._topbar.hideSearchField(); | |
}; | |
this._footer.audioToggle.addEventListener(AudioSlider.LEFT, this._audioIconsOn); | |
this._footer.audioToggle.addEventListener(AudioSlider.RIGHT, this._audioIconsOff); | |
this._footer.audioToggle.setButtonText(pApp.getInterfaceText("audio_on", "On"), pApp.getInterfaceText("audio_off", "Off")); | |
this._footer.toc_btn.tf.htmlText = pApp.getInterfaceText("toc_btn_text", "Table of Contents"); | |
this._footer.audio_tf.htmlText = pApp.getInterfaceText("audio_icons_label", "AUDIO ICONS:"); | |
this._footer.reflow(); | |
ToolTipBuilder.registerButton(this._footer.prev_btn, pApp.getInterfaceText("prev_btn", "Previous")); | |
ToolTipBuilder.registerButton(this._footer.next_btn, pApp.getInterfaceText("next_btn", "Next")); | |
ToolTipBuilder.registerButton(this._footer.single_page_btn, pApp.getInterfaceText("single_page_btn", "Single Page View")); | |
ToolTipBuilder.registerButton(this._footer.double_page_btn, pApp.getInterfaceText("double_page_btn", "Double Page View")); | |
ToolTipBuilder.registerButton(this._footer.zoom_in_btn, pApp.getInterfaceText("zoom_in_btn", "Zoom In")); | |
ToolTipBuilder.registerButton(this._footer.zoom_out_btn, pApp.getInterfaceText("zoom_out_btn", "Zoom Out")); | |
ToolTipBuilder.registerButton(this._footer.zoom_to_rect_btn, pApp.getInterfaceText("zoom_to_rect_btn", "Zoom to")); | |
ToolTipBuilder.registerButton(this._footer.toc_btn, pApp.getInterfaceText("toc_btn", "Table of Contents")); | |
ToolTipBuilder.registerButton(this._footer.drag_page_btn, pApp.getInterfaceText("drag_page_btn", "Drag Page")); | |
ToolTipBuilder.registerButton(this._footer.note_btn, pApp.getInterfaceText("note_btn", "Notes")); | |
ToolTipBuilder.registerButton(this._footer.highlight_btn, pApp.getInterfaceText("highlight_btn", "Highlighter")); | |
ToolTipBuilder.registerButton(this._topbar.help_btn, pApp.getInterfaceText("help_btn", "Help")); | |
this._srControls = new SrControls(); | |
this._srControls.init(pSP.screenReaderMgr); | |
addChild(this._srControls); | |
this._srControls.visible = false; | |
this._loadToc(); | |
pSP.addEventListener(MouseEvent.MOUSE_DOWN, this._pageAreaClicked); | |
bg.addEventListener(MouseEvent.MOUSE_DOWN, this._pageAreaClicked); | |
mediaMgr.addEventListener(MediaManager.ON_PLAY, this._mediaPlayEvent); | |
} | |
override public function initDone():void{ | |
} | |
override public function getIconFunctions():IIconFunctions{ | |
return (new Read14IconFunctions(pApp)); | |
} | |
override public function resize(_arg1:Number, _arg2:Number):void{ | |
var _local5:Number; | |
var _local3:Number = parseInt(pApp.getOption("nav_text_width", "50")); | |
var _local4:Number = 825; | |
if (_local3 > 50){ | |
_local5 = (_local3 - 50); | |
_local4 = (_local4 + _local5); | |
}; | |
_arg1 = Math.max(_arg1, _local4); | |
_arg2 = Math.max(_arg2, 600); | |
super.resize(_arg1, _arg2); | |
pSP.setBoundingBox(0, 48, _arg1, ((_arg2 - 48) - 32)); | |
this._footer.y = (_arg2 - 32); | |
this._footer.setWidth(_arg1); | |
this._topbar.setWidth(_arg1); | |
this._toc.y = (((_arg2 - 32) - this._toc.getHeight()) + 1); | |
this._srControls.setScreenSize(_arg1, _arg2); | |
this._positionWindows(); | |
} | |
override public function zoomIn(_arg1:Event):void{ | |
var _local2:Number = pSP.getMagnification(); | |
_local2 = (_local2 + 0.2); | |
pSP.setMagnification(_local2); | |
trace(_local2); | |
this.zoomChanged(); | |
} | |
override public function zoomOut(_arg1:Event):void{ | |
var _local2:Number = pSP.getMagnification(); | |
if (_local2 > 0.7){ | |
_local2 = (_local2 - 0.2); | |
}; | |
pSP.setMagnification(_local2); | |
this.zoomChanged(); | |
} | |
override public function zoomChanged():void{ | |
} | |
override public function getAdditionalLayerFactory():IAdditionalLayerFactory{ | |
return (null); | |
} | |
override public function onPageContentLoad():void{ | |
} | |
override public function onPageContentLoadStart():void{ | |
this._turnOffTools(); | |
this._srControls.visible = false; | |
closeMediaPlayers(); | |
} | |
override public function onZoomToRect():void{ | |
pSP.disableRectZoomer(); | |
this._footer.zoom_to_rect_btn.unselect(); | |
} | |
override public function setNavText(_arg1:String):void{ | |
this._footer.setNavText(_arg1); | |
} | |
override public function pageViewChanged():void{ | |
if (pApp.isSinglePageMode()){ | |
this._footer.single_page_btn.select(); | |
this._footer.double_page_btn.unselect(); | |
} else { | |
this._footer.single_page_btn.unselect(); | |
this._footer.double_page_btn.select(); | |
}; | |
zoomTo100(); | |
} | |
override public function printNote(_arg1:EventWithParam):void{ | |
var _local2:TextPrintable = new TextPrintable(_arg1.param, "Open Sans", 12, 0); | |
Printer.print([_local2], false); | |
} | |
public function openLanguageSummary(_arg1:Object):void{ | |
var _local2:String = _arg1.datafile; | |
_local2 = StringU.buildFilePath([pApp.getRootPath(), "data/activities/", pApp.getBookID()], _local2); | |
var _local3:String = StringU.buildFilePath([pApp.getRootPath(), "data/activities/", pApp.getBookID(), "languagesummary"]); | |
if (this._langSummary == null){ | |
this._langSummary = new LanguageSummary(); | |
mediaMgr.registerPlayer(this._langSummary); | |
this._positionWindows(); | |
}; | |
var _local4:String = pApp.getInterfaceText("lang_summary_title", "Language Summary"); | |
var _local5:String = pApp.getInterfaceText("lang_summary_selector", "Language:"); | |
var _local6:String = pApp.getOption("lang_summary_languages", ""); | |
var _local7:Array = []; | |
if (_local6 != ""){ | |
_local7 = _local6.split(","); | |
}; | |
this._langSummary.init(_local2, _local3, _local4, _local5, _local7); | |
if (this._langSummary.parent == null){ | |
addChild(this._langSummary); | |
}; | |
} | |
override public function formatMessageAndCode(_arg1:String, _arg2:String):String{ | |
if (_arg2 == AtlasHandler.CODE_BAD_DATA){ | |
_arg1 = "There was an error loading your data. The saving of notes and highlights is not available at this time"; | |
}; | |
var _local3 = ""; | |
if ((((((_arg2 == "")) || ((_arg2 == null)))) || ((pApp.getOption("show_error_codes", "1") == "0")))){ | |
_local3 = ""; | |
} else { | |
_local3 = (("(Code: " + _arg2) + ")"); | |
}; | |
if (_local3 == ""){ | |
return (_arg1); | |
}; | |
return (((_arg1 + " ") + _local3)); | |
} | |
private function _tocClicked(_arg1:Event):void{ | |
var _local2:String = pApp.getOption("toc_btn_page", ""); | |
if (_local2 == ""){ | |
this._toc.toggleOpenClose(); | |
} else { | |
pApp.gotoPage(_local2); | |
}; | |
} | |
private function _searchEntered(_arg1:TextField):void{ | |
var _local2:String; | |
var _local3:String; | |
var _local4:String; | |
var _local5:String; | |
var _local6:String; | |
var _local7:String; | |
var _local8:String; | |
if (this._searchWindow == null){ | |
_local2 = pApp.getOption("search_servlet", ""); | |
_local3 = pApp.getBookID(); | |
_local4 = pApp.getInterfaceText("search_window_title", "Search"); | |
_local5 = pApp.getInterfaceText("search_window_btn", "Search"); | |
_local6 = pApp.getInterfaceText("search_window_page", "Page"); | |
this._searchWindow = new SearchMain(_local2, _local3, _local4, _local5, _local6); | |
_local7 = pApp.getInterfaceText("search_no_results", "No results found."); | |
_local8 = pApp.getInterfaceText("search_error", "An error occurred."); | |
this._searchWindow.setMessages(_local7, _local8); | |
this._searchWindow.addEventListener(SearchMain.SEARCH_HIT, this._searchPageEvent); | |
this._positionWindows(); | |
}; | |
if (this._searchWindow.parent == null){ | |
addChild(this._searchWindow); | |
}; | |
this._searchWindow.doSearch(_arg1.text); | |
} | |
private function _noteButtonClicked(_arg1:Event):void{ | |
var _local2 = (pSP.drawingOverlayMgr.getCurrentMode() == DrawingOverlay.MODE_NOTE); | |
this._turnOffTools(); | |
if (!_local2){ | |
this._turnOnNotes(); | |
}; | |
} | |
private function _turnOnNotes():void{ | |
pSP.drawingOverlayMgr.setMode(DrawingOverlay.MODE_NOTE); | |
pSP.drawingOverlayMgr.enableDragging(); | |
pSP.drawingOverlayMgr.enablePlacement(); | |
pSP.drawingOverlayMgr.enableClickToOpen(); | |
this._footer.note_btn.select(); | |
} | |
private function _turnOffNotes():void{ | |
pSP.drawingOverlayMgr.setMode(null); | |
pSP.drawingOverlayMgr.enableDragging(); | |
pSP.drawingOverlayMgr.disablePlacement(); | |
pSP.drawingOverlayMgr.enableClickToOpen(); | |
this._footer.note_btn.unselect(); | |
} | |
private function _highlightBtnClicked(_arg1:Event):void{ | |
if (this._highlighterOn){ | |
this._turnOffHighlights(); | |
} else { | |
this._turnOnHighlights(); | |
}; | |
} | |
private function _turnOnHighlights():void{ | |
if (this._useTextHighlighter()){ | |
pSP.pageTextMgr.enable(); | |
} else { | |
if (this._whiteboardTool){ | |
this._whiteboardTool.destroy(); | |
}; | |
this._whiteboardTool = new BitmapPencilTool(15, 0xEFD000, 0.3); | |
pSP.whiteboardMgr.setTool(this._whiteboardTool); | |
}; | |
this._footer.highlight_btn.select(); | |
this._highlighterOn = true; | |
} | |
private function _turnOffHighlights():void{ | |
if (this._useTextHighlighter()){ | |
pSP.pageTextMgr.disable(); | |
} else { | |
pSP.whiteboardMgr.disable(); | |
}; | |
this._footer.highlight_btn.unselect(); | |
this._highlighterOn = false; | |
} | |
private function _dragPageClicked(_arg1:Event):void{ | |
var _local2:Boolean = pSP.isDragPageEnabled(); | |
this._turnOffTools(); | |
if (_local2){ | |
pSP.disableDragPage(); | |
this._footer.drag_page_btn.unselect(); | |
} else { | |
pSP.enableDragPage(); | |
this._footer.drag_page_btn.select(); | |
}; | |
} | |
private function _zoomToRectBtnClicked(_arg1:Event):void{ | |
var _local2:Boolean = pSP.isRectZoomerEnabled(); | |
this._turnOffTools(); | |
if (_local2){ | |
pSP.disableRectZoomer(); | |
this._footer.zoom_to_rect_btn.unselect(); | |
} else { | |
pSP.enableRectZoomer(); | |
this._footer.zoom_to_rect_btn.select(); | |
}; | |
} | |
private function _turnOffTools():void{ | |
pSP.disableDragPage(); | |
pSP.disableRectZoomer(); | |
this._turnOffNotes(); | |
this._turnOffHighlights(); | |
this._footer.zoom_to_rect_btn.unselect(); | |
this._footer.drag_page_btn.unselect(); | |
} | |
private function _audioIconsOn(_arg1:Event):void{ | |
pSP.screenReaderMgr.show(); | |
pSP.iconDrawMgr.setVisibility("mh_music_audio", true); | |
} | |
private function _audioIconsOff(_arg1:Event):void{ | |
pSP.screenReaderMgr.hide(); | |
pSP.iconDrawMgr.setVisibility("mh_music_audio", false); | |
mediaMgr.stopAll(); | |
this._srControls.visible = false; | |
} | |
private function _loadToc():void{ | |
var _local1:String = pApp.getInterfaceText("toc_title", "Table of Contents"); | |
this._toc = new TocMain(_local1); | |
this._toc.addEventListener(Event.COMPLETE, this._tocReady); | |
var _local2:int = getChildIndex(this._footer); | |
addChildAt(this._toc, _local2); | |
var _local3 = (((pApp.getRootPath() + "data/") + pApp.getBookID()) + "_toc.xml"); | |
this._toc.loadFile(_local3); | |
this._toc.addEventListener(TocMain.GOTO_PAGE, this._tocPageEvent); | |
} | |
private function _tocReady(_arg1:Event):void{ | |
this._turnOffNotes(); | |
this._checkForBackendInitError(); | |
dispatchEvent(new Event(Event.COMPLETE)); | |
} | |
override public function doHelp(_arg1:Event):void{ | |
var _local2:String; | |
if (this._helpWindow == null){ | |
_local2 = pApp.getInterfaceText("help_window", "Help"); | |
this._helpWindow = new HelpWindow((pApp.getRootPath() + "help.swf"), _local2); | |
this._helpWindow.addEventListener(Event.COMPLETE, this._helpLoaded); | |
addChild(this._helpWindow); | |
this._positionWindows(); | |
} else { | |
this._helpWindow.visible = true; | |
}; | |
} | |
public function openNotebook(_arg1:Object):void{ | |
var _local2:String = pApp.getInterfaceText("notebook_submit", "Submit"); | |
var _local3:String = _arg1.window_title; | |
if ((((_local3 == null)) || ((_local3 == "")))){ | |
_local3 = pApp.getInterfaceText("notebook_title", "My Binder"); | |
}; | |
var _local4:String = pApp.getInterfaceText("notebook_loading", "Loading..."); | |
this._notebook = new NotebookMain(_local3, _arg1.question_id, pApp.getCurrentPage(), _local2, _local4); | |
addChild(this._notebook); | |
this._positionWindows(); | |
} | |
override public function openNoteEvent(_arg1:OpenItemEvent):void{ | |
super.openNoteEvent(_arg1); | |
var _local2:EditableNotePopup = (_activeNotePopup as EditableNotePopup); | |
var _local3:String = pApp.getInterfaceText("note_title", "Note"); | |
_local2.setTitleText(_local3); | |
var _local4:String = pApp.getInterfaceText("note_save", "Save"); | |
var _local5:String = pApp.getInterfaceText("note_delete", "Delete"); | |
var _local6:String = pApp.getInterfaceText("note_print", "Print"); | |
_local2.setButtonText(_local4, _local5, _local6); | |
} | |
override public function showPrompt(_arg1:String, _arg2:Boolean=true, _arg3:Function=null, _arg4:Function=null, _arg5:String=""):void{ | |
var _local6:String = pApp.getInterfaceText("alert_title", "Alert"); | |
super.showPrompt(_arg1, _arg2, _arg3, _arg4, _local6); | |
} | |
private function _helpLoaded(_arg1:Event):void{ | |
this._positionWindows(); | |
} | |
private function _positionWindows():void{ | |
var _local1:Rectangle; | |
if (this._notebook){ | |
_local1 = this._notebook.getBounds(this); | |
if (this._notebook.hasBeenDragged()){ | |
if ((_local1.x + _local1.width) > getUIWidth()){ | |
this._notebook.x = (getUIWidth() - _local1.width); | |
}; | |
if ((_local1.y + _local1.height) > getUIHeight()){ | |
this._notebook.y = (getUIHeight() - _local1.height); | |
}; | |
} else { | |
this._notebook.x = ((getUIWidth() / 2) - (_local1.width / 2)); | |
this._notebook.y = ((getUIHeight() / 2) - (_local1.height / 2)); | |
}; | |
}; | |
if (this._helpWindow){ | |
this._helpWindow.graphics.clear(); | |
this._helpWindow.setScreenSize(getUIWidth(), getUIHeight()); | |
_local1 = this._helpWindow.getBounds(this); | |
this._helpWindow.x = ((getUIWidth() / 2) - (_local1.width / 2)); | |
this._helpWindow.y = ((getUIHeight() / 2) - (_local1.height / 2)); | |
this._helpWindow.graphics.beginFill(0, 0.4); | |
this._helpWindow.graphics.drawRect(-(this._helpWindow.x), -(this._helpWindow.y), getUIWidth(), getUIHeight()); | |
this._helpWindow.graphics.endFill(); | |
}; | |
if (this._searchWindow){ | |
_local1 = this._searchWindow.getBounds(this); | |
if (this._searchWindow.hasBeenDragged()){ | |
if ((_local1.x + _local1.width) > getUIWidth()){ | |
this._searchWindow.x = (getUIWidth() - _local1.width); | |
}; | |
if ((_local1.y + _local1.height) > getUIHeight()){ | |
this._searchWindow.y = (getUIHeight() - _local1.height); | |
}; | |
} else { | |
this._searchWindow.x = ((getUIWidth() / 2) - (_local1.width / 2)); | |
this._searchWindow.y = ((getUIHeight() / 2) - (_local1.height / 2)); | |
}; | |
}; | |
if (this._langSummary){ | |
_local1 = this._langSummary.getBounds(this); | |
if (this._langSummary.hasBeenDragged()){ | |
if ((_local1.x + _local1.width) > getUIWidth()){ | |
this._langSummary.x = (getUIWidth() - _local1.width); | |
}; | |
if ((_local1.y + _local1.height) > getUIHeight()){ | |
this._langSummary.y = (getUIHeight() - _local1.height); | |
}; | |
} else { | |
this._langSummary.x = ((getUIWidth() / 2) - (_local1.width / 2)); | |
this._langSummary.y = ((getUIHeight() / 2) - (_local1.height / 2)); | |
}; | |
}; | |
} | |
private function _useTextHighlighter():Boolean{ | |
var _local1:String = pApp.getOption("enable_highlight_layer", "0"); | |
if (_local1 == "1"){ | |
return (true); | |
}; | |
return (false); | |
} | |
private function _tocPageEvent(_arg1:EventWithParam):void{ | |
var _local2:String = (_arg1.param as String); | |
pApp.gotoPage(_local2); | |
} | |
private function _searchPageEvent(_arg1:EventWithParam):void{ | |
var _local2:SearchHit = (_arg1.param as SearchHit); | |
var _local3:String = _local2.pageid; | |
pApp.gotoPage(_local3); | |
loadSearchHit(_local2); | |
} | |
private function _pageAreaClicked(_arg1:Event):void{ | |
var _local2:DisplayObject = (_arg1.target as DisplayObject); | |
if ((((_local2 is Loader)) || ((_local2 is Square)))){ | |
this._toc.close(); | |
}; | |
} | |
private function _mediaPlayEvent(_arg1:EventWithParam):void{ | |
if ((_arg1.param is AudioPlayer)){ | |
this._srControls.visible = false; | |
}; | |
} | |
private function _minimizeClicked(_arg1:Event):void{ | |
stage.displayState = StageDisplayState.NORMAL; | |
this._topbar.setMinimized(); | |
} | |
private function _maximizeClicked(_arg1:Event):void{ | |
stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE; | |
this._topbar.setMaximized(); | |
} | |
private function _fullScreenEvent(_arg1:FullScreenEvent):void{ | |
if (stage.displayState == StageDisplayState.NORMAL){ | |
this._topbar.setMinimized(); | |
}; | |
} | |
private function _initFullScreenListener(_arg1:Event):void{ | |
removeEventListener(Event.ADDED_TO_STAGE, this._initFullScreenListener); | |
stage.addEventListener(FullScreenEvent.FULL_SCREEN, this._fullScreenEvent); | |
} | |
private function _checkForBackendInitError():void{ | |
if (!pApp.getDataStore().isReady()){ | |
this.showPrompt("The saving of notes and highlights is not available at this time."); | |
}; | |
} | |
} | |
}//package com.vpg.read14.vpage.shell | |
package com.vpg.read14.vpage.shell.audiocontrols { | |
import flash.display.*; | |
import flash.events.*; | |
import com.vpg.vpage.utils.*; | |
import com.vpg.vpage.components.slider.*; | |
public class AudioControls extends MovieClip { | |
public static const CLOSE:String = "closeEvent;"; | |
public static const PAUSE:String = "pauseEvent"; | |
public static const PLAY:String = "playEvent"; | |
public static const REWIND:String = "rewindEvent"; | |
public static const SLIDE_START:String = "slideStartEvent"; | |
public static const SLIDE_TO:String = "slideToEvent"; | |
public static const SLIDE_END:String = "slideEndEvent"; | |
public static const VOL_SLIDE_START:String = "volSlideStartEvent"; | |
public static const VOL_SLIDE_TO:String = "volSlideToEvent"; | |
public static const VOL_SLIDE_END:String = "volSlideEndEvent"; | |
public var pause_btn:MovieClip; | |
public var rewind_btn:MovieClip; | |
public var play_btn:MovieClip; | |
public var close_btn:MovieClip; | |
public var slider:Slider; | |
public var volume_btn:MovieClip; | |
public var bg:MovieClip; | |
public var vol_slider:Slider; | |
public function AudioControls(){ | |
DisplayU.buttonify(this.rewind_btn, this._rewindClick); | |
DisplayU.buttonify(this.play_btn, this._playClick); | |
DisplayU.buttonify(this.close_btn, this._closeClick); | |
DisplayU.buttonify(this.pause_btn, this._pauseClick); | |
DisplayU.buttonify(this.volume_btn, this._volumeClick); | |
this.slider.addEventListener(Slider.START, this._sliderStartEvent); | |
this.slider.addEventListener(Slider.CHANGE, this._sliderChangeEvent); | |
this.slider.addEventListener(Slider.END, this._sliderEndEvent); | |
this.vol_slider.addEventListener(Slider.START, this._volSliderStartEvent); | |
this.vol_slider.addEventListener(Slider.CHANGE, this._volSliderChangeEvent); | |
this.vol_slider.addEventListener(Slider.END, this._volSliderEndEvent); | |
this.vol_slider.visible = false; | |
this.vol_slider.setLocation(1); | |
} | |
public function hideBG():void{ | |
this.bg.visible = false; | |
} | |
public function hideVolume():void{ | |
this.volume_btn.visible = false; | |
} | |
public function hideClose():void{ | |
this.close_btn.visible = false; | |
} | |
public function setPlaying():void{ | |
this.play_btn.visible = false; | |
this.pause_btn.visible = true; | |
} | |
public function setPaused():void{ | |
this.play_btn.visible = true; | |
this.pause_btn.visible = false; | |
} | |
public function setStopped():void{ | |
this.play_btn.visible = true; | |
this.pause_btn.visible = false; | |
} | |
public function getSliderPosition():Number{ | |
return (this.slider.getCurrentPosition()); | |
} | |
public function getHeight():Number{ | |
return (this.bg.height); | |
} | |
public function setAudioLocation(_arg1:Number):void{ | |
this.slider.setLocation(_arg1); | |
} | |
public function setVolumeLocation(_arg1:Number):void{ | |
this.vol_slider.setLocation(_arg1); | |
} | |
private function _rewindClick(_arg1:Event):void{ | |
dispatchEvent(new Event(REWIND)); | |
} | |
private function _playClick(_arg1:Event):void{ | |
dispatchEvent(new EventWithParam(PLAY, this.slider.getCurrentPosition())); | |
} | |
private function _closeClick(_arg1:Event):void{ | |
dispatchEvent(new Event(CLOSE)); | |
} | |
private function _volumeClick(_arg1:Event):void{ | |
this.vol_slider.visible = !(this.vol_slider.visible); | |
} | |
private function _pauseClick(_arg1:Event):void{ | |
dispatchEvent(new Event(PAUSE)); | |
} | |
private function _sliderStartEvent(_arg1:Event):void{ | |
dispatchEvent(new Event(SLIDE_START)); | |
} | |
private function _sliderChangeEvent(_arg1:EventWithParam):void{ | |
dispatchEvent(new EventWithParam(SLIDE_TO, this.slider.getCurrentPosition())); | |
} | |
private function _sliderEndEvent(_arg1:Event):void{ | |
dispatchEvent(new EventWithParam(SLIDE_END, this.slider.getCurrentPosition())); | |
} | |
private function _volSliderStartEvent(_arg1:Event):void{ | |
dispatchEvent(new Event(VOL_SLIDE_START)); | |
} | |
private function _volSliderChangeEvent(_arg1:EventWithParam):void{ | |
dispatchEvent(new EventWithParam(VOL_SLIDE_TO, this.vol_slider.getCurrentPosition())); | |
} | |
private function _volSliderEndEvent(_arg1:Event):void{ | |
dispatchEvent(new EventWithParam(VOL_SLIDE_END, this.slider.getCurrentPosition())); | |
} | |
} | |
}//package com.vpg.read14.vpage.shell.audiocontrols | |
package com.vpg.read14.vpage.shell { | |
import flash.display.*; | |
import flash.events.*; | |
import com.vpg.vpage.utils.*; | |
public class AudioSlider extends MovieClip { | |
public static const LEFT:String = "slidLeft"; | |
public static const RIGHT:String = "slidRight"; | |
public var left_btn:MovieClip; | |
public var right_btn:MovieClip; | |
public var btn:MovieClip; | |
public var track:MovieClip; | |
public var bg:MovieClip; | |
private var _isLeft:Boolean; | |
public function AudioSlider(){ | |
DisplayU.buttonify(this.btn); | |
this._isLeft = true; | |
this.btn.addEventListener(MouseEvent.MOUSE_DOWN, this.buttonPress); | |
DisplayU.buttonify(this.left_btn, this._leftClicked); | |
DisplayU.buttonify(this.right_btn, this._rightClicked); | |
} | |
public function setButtonText(_arg1:String, _arg2:String):void{ | |
var _local3:Number = this.left_btn.tf.width; | |
this.left_btn.tf.htmlText = (("<B>" + _arg1) + "</B>"); | |
this.right_btn.tf.htmlText = (("<B>" + _arg2) + "</B>"); | |
TextUtils.expandWidth(this.left_btn.tf); | |
var _local4:Number = (this.left_btn.tf.width - _local3); | |
this.bg.x = (this.bg.x + _local4); | |
this.track.x = (this.track.x + _local4); | |
this.btn.x = (this.btn.x + _local4); | |
this.right_btn.x = (this.right_btn.x + _local4); | |
TextUtils.expandWidth(this.right_btn.tf); | |
} | |
private function buttonPress(_arg1:Event):void{ | |
stage.addEventListener(MouseEvent.MOUSE_UP, this.buttonRelease); | |
stage.addEventListener(MouseEvent.MOUSE_MOVE, this.updatePosition); | |
} | |
private function buttonRelease(_arg1:Event):void{ | |
stage.removeEventListener(MouseEvent.MOUSE_UP, this.buttonRelease); | |
stage.removeEventListener(MouseEvent.MOUSE_MOVE, this.updatePosition); | |
} | |
private function updatePosition(_arg1:Event):void{ | |
if (this.mouseX < (this.track.width / 2)){ | |
this._setLeft(); | |
} else { | |
this._setRight(); | |
}; | |
} | |
private function _leftClicked(_arg1:Event):void{ | |
this._setLeft(); | |
} | |
private function _rightClicked(_arg1:Event):void{ | |
this._setRight(); | |
} | |
private function _setLeft():void{ | |
if (!this._isLeft){ | |
this._isLeft = true; | |
this.btn.gotoAndStop("on"); | |
dispatchEvent(new Event(LEFT)); | |
}; | |
} | |
private function _setRight():void{ | |
if (this._isLeft){ | |
this._isLeft = false; | |
this.btn.gotoAndStop("off"); | |
dispatchEvent(new Event(RIGHT)); | |
}; | |
} | |
} | |
}//package com.vpg.read14.vpage.shell | |
package com.vpg.read14.vpage.shell { | |
import flash.display.*; | |
import flash.text.*; | |
public class TopBar extends MovieClip { | |
public var help_btn:MovieClip; | |
public var search_mc:MovieClip; | |
public var maximize_btn:MovieClip; | |
public var minimize_btn:MovieClip; | |
public var search_tf:TextField; | |
private var _width:Number; | |
public function TopBar(){ | |
this.search_tf = this.search_mc.tf; | |
this.setMinimized(); | |
} | |
public function setWidth(_arg1:Number):void{ | |
var _local2:Number = (960 - 690); | |
this.search_mc.x = (_arg1 - _local2); | |
var _local3:Number = (960 - 665); | |
if (!this.search_mc.visible){ | |
_local3 = ((_local2 - this.search_mc.width) + this.help_btn.width); | |
}; | |
this.help_btn.x = (_arg1 - _local3); | |
var _local4:Number = 8; | |
this.maximize_btn.x = ((_arg1 - this.maximize_btn.width) - _local4); | |
this.minimize_btn.x = this.maximize_btn.x; | |
this._width = _arg1; | |
} | |
public function setMaximized():void{ | |
this.maximize_btn.visible = false; | |
this.minimize_btn.visible = true; | |
} | |
public function setMinimized():void{ | |
this.maximize_btn.visible = true; | |
this.minimize_btn.visible = false; | |
} | |
public function hideSearchField():void{ | |
this.search_mc.visible = false; | |
this.setWidth(this._width); | |
} | |
} | |
}//package com.vpg.read14.vpage.shell | |
package com.vpg.read14.vpage.shell.srcontrols { | |
import flash.display.*; | |
import flash.events.*; | |
import com.vpg.vpage.utils.*; | |
import com.vpg.vpage.shell.screenreader.*; | |
import com.vpg.read14.vpage.shell.audiocontrols.*; | |
public class SrControls extends MovieClip { | |
private var _controls:AudioControls; | |
private var _mgr:ScreenReaderManager; | |
public function SrControls(){ | |
this._controls = new AudioControls(); | |
addChild(this._controls); | |
this._controls.addEventListener(AudioControls.CLOSE, this._closeEvent); | |
this._controls.addEventListener(AudioControls.PAUSE, this._pauseEvent); | |
this._controls.addEventListener(AudioControls.PLAY, this._playEvent); | |
this._controls.addEventListener(AudioControls.REWIND, this._rewindEvent); | |
this._controls.addEventListener(AudioControls.SLIDE_START, this._slideStartEvent); | |
this._controls.addEventListener(AudioControls.SLIDE_TO, this._slideToEvent); | |
this._controls.addEventListener(AudioControls.SLIDE_END, this._slideEndEvent); | |
this._controls.addEventListener(AudioControls.VOL_SLIDE_START, this._volSlideStartEvent); | |
this._controls.addEventListener(AudioControls.VOL_SLIDE_TO, this._volSlideToEvent); | |
this._controls.addEventListener(AudioControls.VOL_SLIDE_END, this._volSlideEndEvent); | |
} | |
public function destroy():void{ | |
this._controls.removeEventListener(AudioControls.CLOSE, this._closeEvent); | |
this._controls.removeEventListener(AudioControls.PAUSE, this._pauseEvent); | |
this._controls.removeEventListener(AudioControls.PLAY, this._playEvent); | |
this._controls.removeEventListener(AudioControls.REWIND, this._rewindEvent); | |
this._controls.removeEventListener(AudioControls.SLIDE_START, this._slideStartEvent); | |
this._controls.removeEventListener(AudioControls.SLIDE_TO, this._slideToEvent); | |
this._controls.removeEventListener(AudioControls.SLIDE_START, this._slideEndEvent); | |
this._controls.removeEventListener(AudioControls.VOL_SLIDE_START, this._volSlideStartEvent); | |
this._controls.removeEventListener(AudioControls.VOL_SLIDE_TO, this._volSlideToEvent); | |
this._controls.removeEventListener(AudioControls.VOL_SLIDE_END, this._volSlideEndEvent); | |
this._mgr.removeEventListener(ScreenReaderManager.FLOW_PLAY_COMPLETE, this._srPlayCompleteEvent); | |
this._mgr.removeEventListener(ScreenReaderManager.PAUSED, this._srPausedEvent); | |
this._mgr.removeEventListener(ScreenReaderManager.PLAY_START, this._srPlayStartEvent); | |
this._mgr.removeEventListener(ScreenReaderManager.STOPPED, this._srStopEvent); | |
this._mgr.removeEventListener(ScreenReaderManager.FLOW_PLAY_PROGRESS, this._srProgressEvent); | |
} | |
public function init(_arg1:ScreenReaderManager):void{ | |
this._mgr = _arg1; | |
this._mgr.addEventListener(ScreenReaderManager.FLOW_PLAY_COMPLETE, this._srPlayCompleteEvent); | |
this._mgr.addEventListener(ScreenReaderManager.FLOW_PLAY_PROGRESS, this._srProgressEvent); | |
this._mgr.addEventListener(ScreenReaderManager.PAUSED, this._srPausedEvent); | |
this._mgr.addEventListener(ScreenReaderManager.PLAY_START, this._srPlayStartEvent); | |
this._mgr.addEventListener(ScreenReaderManager.STOPPED, this._srStopEvent); | |
this._controls.setVolumeLocation(this._mgr.getVolume()); | |
} | |
public function setScreenSize(_arg1:Number, _arg2:Number):void{ | |
x = 0; | |
y = ((_arg2 - 32) - this._controls.getHeight()); | |
} | |
private function _closeEvent(_arg1:Event):void{ | |
this._mgr.stop(); | |
visible = false; | |
} | |
private function _pauseEvent(_arg1:Event):void{ | |
this._mgr.pause(); | |
} | |
private function _playEvent(_arg1:Event):void{ | |
this._mgr.playActiveFlowFrom(this._controls.getSliderPosition()); | |
} | |
private function _rewindEvent(_arg1:Event):void{ | |
this._mgr.playActiveFlowFrom(0); | |
} | |
private function _slideStartEvent(_arg1:Event):void{ | |
this._mgr.stop(); | |
} | |
private function _slideToEvent(_arg1:EventWithParam):void{ | |
} | |
private function _slideEndEvent(_arg1:EventWithParam):void{ | |
this._mgr.playActiveFlowFrom((_arg1.param as Number)); | |
} | |
private function _volSlideStartEvent(_arg1:Event):void{ | |
} | |
private function _volSlideToEvent(_arg1:EventWithParam):void{ | |
var _local2:Number = (_arg1.param as Number); | |
this._mgr.setVolume(_local2); | |
} | |
private function _volSlideEndEvent(_arg1:EventWithParam):void{ | |
var _local2:Number = (_arg1.param as Number); | |
this._mgr.setVolume(_local2); | |
} | |
private function _srPlayCompleteEvent(_arg1:Event):void{ | |
this._controls.setStopped(); | |
this._controls.setAudioLocation(0); | |
} | |
private function _srPausedEvent(_arg1:Event):void{ | |
this._controls.setPaused(); | |
} | |
private function _srPlayStartEvent(_arg1:Event):void{ | |
this._controls.setPlaying(); | |
visible = true; | |
} | |
private function _srStopEvent(_arg1:Event):void{ | |
trace("stop"); | |
} | |
private function _srProgressEvent(_arg1:EventWithParam):void{ | |
var _local2:Number = (_arg1.param as Number); | |
this._controls.setAudioLocation(_local2); | |
this._controls.setPlaying(); | |
} | |
} | |
}//package com.vpg.read14.vpage.shell.srcontrols | |
package com.vpg.read14.vpage.shell.languagesummary { | |
public class LanguageSummaryData { | |
private var _items:Array; | |
public function LanguageSummaryData(_arg1:XML){ | |
var _local3:XML; | |
var _local4:ClipData; | |
super(); | |
this._items = new Array(); | |
var _local2:int; | |
while (_local2 < _arg1.clips.clip.length()) { | |
_local3 = (_arg1.clips.clip[_local2] as XML); | |
_local4 = new ClipData(_local3); | |
if (!_local4.isEmpty()){ | |
this._items.push(_local4); | |
}; | |
_local2++; | |
}; | |
} | |
public function getItems():Array{ | |
return (this._items.slice()); | |
} | |
} | |
}//package com.vpg.read14.vpage.shell.languagesummary | |
package com.vpg.read14.vpage.shell.languagesummary { | |
public class ClipData { | |
private var _xml:XML; | |
public function ClipData(_arg1:XML){ | |
this._xml = _arg1; | |
} | |
public function isEmpty():Boolean{ | |
if ((((((this.getAudioFile() == "")) || ((this.getLabel() == "")))) || ((this.getTranscript() == "")))){ | |
return (true); | |
}; | |
return (false); | |
} | |
public function getAudioFile():String{ | |
return (this._xml.filename.toString()); | |
} | |
public function getTranscript():String{ | |
return (this._xml.script.toString()); | |
} | |
public function getLabel():String{ | |
return (this._xml.label.toString()); | |
} | |
} | |
}//package com.vpg.read14.vpage.shell.languagesummary | |
package com.vpg.read14.vpage.shell.languagesummary { | |
import flash.display.*; | |
import flash.geom.*; | |
import flash.events.*; | |
import flash.text.*; | |
import com.vpg.vpage.utils.*; | |
import com.vpg.vpage.utils.mediamgr.*; | |
import com.vpg.read14.vpage.shell.audio.*; | |
import com.vpg.vpage.components.combobox.*; | |
import com.vpg.vpage.components.scrollpane.*; | |
public class LanguageSummary extends MovieClip implements IDraggable, IMediaPlayer { | |
public var bg:MovieClip; | |
public var close_btn:MovieClip; | |
public var content_area:Sprite; | |
public var title_tf:TextField; | |
public var lang_tf:TextField; | |
private var _contentPath:String; | |
private var _selector:ComboBox; | |
private var _player:AudioPlayer; | |
private var _data:LanguageSummaryData; | |
private var _sp:StandardScrollPane; | |
private var _activeLangs:Array; | |
public function LanguageSummary(){ | |
this._initInterface(); | |
} | |
public function init(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:Array):void{ | |
this._activeLangs = _arg5; | |
this.title_tf.htmlText = _arg3; | |
this.lang_tf.htmlText = _arg4; | |
TextUtils.expandWidth(this.lang_tf); | |
this._selector.x = ((this.lang_tf.x + this.lang_tf.width) + 5); | |
this._selector.clear(); | |
this._sp.clearContent(); | |
this._player.stop(); | |
this._contentPath = _arg2; | |
NetU.doFileLoad(_arg1, this._xmlLoaded, this._xmlLoadError); | |
} | |
public function externalHalt():void{ | |
this._player.stop(); | |
} | |
public function hasBeenDragged():Boolean{ | |
return (DraggableItem.hasBeenDragged(this)); | |
} | |
public function getDraggableWindow():MovieClip{ | |
return (this); | |
} | |
public function getDragHitArea():MovieClip{ | |
return (this.bg); | |
} | |
public function getDragBounds():Rectangle{ | |
return (new Rectangle(0, 0, (stage.stageWidth - this.bg.width), (stage.stageHeight - this.bg.height))); | |
} | |
private function _xmlLoaded(_arg1:Event):void{ | |
var _local4:ClipData; | |
var _local5:String; | |
this._data = new LanguageSummaryData(XmlU.eventToXML(_arg1)); | |
var _local2:Array = this._data.getItems(); | |
var _local3:int; | |
while (_local3 < _local2.length) { | |
_local4 = (_local2[_local3] as ClipData); | |
_local5 = _local4.getLabel(); | |
if ((((this._activeLangs.length == 0)) || (!((this._activeLangs.indexOf(_local5) == -1))))){ | |
this._selector.addItem(_local5); | |
}; | |
_local3++; | |
}; | |
this._selector.select(0); | |
} | |
private function _xmlLoadError(_arg1:Event):void{ | |
} | |
private function _initInterface():void{ | |
DisplayU.buttonify(this.close_btn, this._closeClicked); | |
this._player = new AudioPlayer(); | |
this._player.x = 17; | |
this._player.y = 85; | |
this._player.hideBG(); | |
this._player.hideClose(); | |
this._player.hideVolume(); | |
addChild(this._player); | |
var _local1:Number = 7; | |
this._sp = new StandardScrollPane(); | |
this._sp.x = (this.content_area.x + _local1); | |
this._sp.y = (this.content_area.y + _local1); | |
this._sp.setSize((this.content_area.width - (_local1 * 2)), (this.content_area.height - (_local1 * 2))); | |
this._sp.turnOffHScroll(); | |
addChild(this._sp); | |
this._selector = new ComboBox(); | |
addChild(this._selector); | |
this._selector.addEventListener(ComboBox.SELECTION, this._itemSelected); | |
this._selector.y = 49; | |
DraggableItem.registerDraggable(this); | |
} | |
private function _closeClicked(_arg1:Event):void{ | |
this._player.stop(); | |
DisplayU.removeFromDisplayList(this); | |
} | |
private function _itemSelected(_arg1:EventWithParam):void{ | |
var _local2:int = (_arg1.param as int); | |
this._showContent(_local2); | |
} | |
private function _showContent(_arg1:int):void{ | |
var _local2:Array = this._data.getItems(); | |
var _local3:ClipData = _local2[_arg1]; | |
var _local4:String = (this._contentPath + _local3.getAudioFile()); | |
var _local5:String = _local4; | |
_local5 = _local4.split(".mp3").join(".png"); | |
this._sp.clearContent(); | |
NetU.doArtLoad(_local5, this._artLoaded, this._artLoadError); | |
this._player.init(_local4, ""); | |
this._player.stop(); | |
} | |
private function _artLoaded(_arg1:Event):void{ | |
this._sp.getContentLayer().addChild(_arg1.currentTarget.loader); | |
this._sp.refresh(); | |
} | |
private function _artLoadError():void{ | |
var _local1:Array = this._data.getItems(); | |
var _local2:int = this._selector.getSelectedIndex(); | |
var _local3:ClipData = _local1[_local2]; | |
var _local4:TextField = TextUtils.createTextField("Myriad Pro", 15); | |
_local4.width = (this._sp.getWidth() - 25); | |
_local4.htmlText = _local3.getTranscript(); | |
TextUtils.expandHeight(_local4); | |
this._sp.getContentLayer().addChild(_local4); | |
this._sp.refresh(); | |
} | |
} | |
}//package com.vpg.read14.vpage.shell.languagesummary | |
package com.vpg.read14.vpage.shell.glossary { | |
import flash.display.*; | |
import flash.events.*; | |
import com.vpg.vpage.utils.*; | |
import com.vpg.vpage.shell.glossary.*; | |
public class TermList extends Sprite { | |
public static const TERM_REQUEST:String = "termRequested"; | |
private var _terms:Array; | |
private var _buttons:Array; | |
private var _selectedButton:TermButton; | |
public function TermList(_arg1:Array){ | |
var _local4:Term; | |
var _local5:TermButton; | |
super(); | |
this._terms = _arg1.slice(); | |
this._buttons = new Array(); | |
var _local2:Number = 0; | |
var _local3:int; | |
while (_local3 < this._terms.length) { | |
_local4 = this._terms[_local3]; | |
_local5 = new TermButton(_local4.termText); | |
this._buttons.push(_local5); | |
_local5.addEventListener(MouseEvent.CLICK, this._termClicked); | |
_local5.y = _local2; | |
_local2 = (_local2 + _local5.height); | |
_local2 = (_local2 + 5); | |
addChild(_local5); | |
_local3++; | |
}; | |
} | |
public function getYAt(_arg1:int):Number{ | |
return (this._buttons[_arg1].y); | |
} | |
public function selectTermAt(_arg1:int):void{ | |
if (this._selectedButton){ | |
this._selectedButton.unselect(); | |
}; | |
this._selectedButton = this._buttons[_arg1]; | |
this._selectedButton.select(); | |
} | |
private function _termClicked(_arg1:Event):void{ | |
var _local2:TermButton = (_arg1.currentTarget as TermButton); | |
var _local3:int = this._buttons.indexOf(_local2); | |
dispatchEvent(new EventWithParam(TERM_REQUEST, _local3)); | |
} | |
} | |
}//package com.vpg.read14.vpage.shell.glossary | |
package com.vpg.read14.vpage.shell.glossary { | |
import flash.display.*; | |
import flash.geom.*; | |
import flash.events.*; | |
import flash.text.*; | |
import com.vpg.vpage.utils.*; | |
import com.vpg.vpage.shell.glossary.*; | |
import com.vpg.vpage.components.scrollpane.*; | |
public class GlossaryWindow extends MovieClip implements IGlossaryWindow, IDraggable { | |
public var close_btn:MovieClip; | |
public var drag_bar:MovieClip; | |
public var title_tf:TextField; | |
public var left_content_bg:Sprite; | |
public var right_content_bg:Sprite; | |
public var letter_bar:LetterBar; | |
private var _service:GlossaryService; | |
private var _requestedTerm:String; | |
private var _termScroller:StandardScrollPane; | |
private var _termList:TermList; | |
private var _defScroller:StandardScrollPane; | |
private var _defText:TextField; | |
public function init(_arg1:String):void{ | |
DraggableItem.registerDraggable(this); | |
this.title_tf.mouseEnabled = false; | |
this.close_btn.addEventListener(MouseEvent.CLICK, this._closeClicked); | |
DisplayU.buttonify(this.close_btn); | |
var _local2:Number = 8; | |
this._termScroller = new StandardScrollPane(); | |
this._termScroller.x = (this.left_content_bg.x + _local2); | |
this._termScroller.y = (this.left_content_bg.y + _local2); | |
this._termScroller.setSize((this.left_content_bg.width - (_local2 * 2)), (this.left_content_bg.height - (_local2 * 2))); | |
this._termScroller.turnOffHScroll(); | |
addChild(this._termScroller); | |
this._defScroller = new StandardScrollPane(); | |
this._defScroller.x = (this.right_content_bg.x + _local2); | |
this._defScroller.y = (this.right_content_bg.y + _local2); | |
this._defScroller.setSize((this.right_content_bg.width - (_local2 * 2)), (this.right_content_bg.height - (_local2 * 2))); | |
this._defScroller.turnOffHScroll(); | |
addChild(this._defScroller); | |
this._defText = TextUtils.createTextField("Open Sans", 14); | |
this._defText.width = (this._defScroller.getWidth() - 24); | |
this._defScroller.getContentLayer().addChild(this._defText); | |
TextUtils.expandHeight(this._defText); | |
this.letter_bar.addEventListener(LetterBar.LETTER_CLICKED, this._letterClickEvent); | |
this._service = new GlossaryService(); | |
this._service.addEventListener(GlossaryService.READY, this._serviceReady); | |
this._service.addEventListener(GlossaryService.ERROR, this._serviceLoadError); | |
this._service.init(_arg1); | |
} | |
public function goToTerm(_arg1:String):void{ | |
trace("GlossaryWindow: gotoTerm unimplemented"); | |
if (this._service.isReady()){ | |
this._showTermList(); | |
} else { | |
this._requestedTerm = _arg1; | |
}; | |
} | |
public function destroy():void{ | |
this.close_btn.removeEventListener(MouseEvent.CLICK, this._closeClicked); | |
} | |
public function setScreenSize(_arg1:Number, _arg2:Number):void{ | |
if (this.hasBeenDragged()){ | |
if ((this.x + this.width) > _arg1){ | |
this.x = (_arg1 - this.width); | |
}; | |
if ((this.y + this.height) > _arg2){ | |
this.y = (_arg2 - this.height); | |
}; | |
} else { | |
this.x = ((_arg1 / 2) - (this.width / 2)); | |
this.y = ((_arg2 / 2) - (this.height / 2)); | |
}; | |
} | |
public function hasBeenDragged():Boolean{ | |
return (DraggableItem.hasBeenDragged(this)); | |
} | |
public function getDraggableWindow():MovieClip{ | |
return (this); | |
} | |
public function getDragHitArea():MovieClip{ | |
return (this.drag_bar); | |
} | |
public function getDragBounds():Rectangle{ | |
return (new Rectangle(0, 0, (stage.stageWidth - this.drag_bar.width), (stage.stageHeight - this.drag_bar.height))); | |
} | |
private function _serviceReady(_arg1:Event):void{ | |
this._showTermList(); | |
} | |
private function _serviceLoadError(_arg1:Event):void{ | |
} | |
private function _closeClicked(_arg1:Event):void{ | |
dispatchEvent(new Event(Event.CLOSE)); | |
} | |
private function _showTermList():void{ | |
var _local1:Array = this._service.getAllTerms(); | |
this._termList = new TermList(_local1); | |
this._termList.addEventListener(TermList.TERM_REQUEST, this._termRequested); | |
this._termScroller.getContentLayer().addChild(this._termList); | |
this._termScroller.refresh(); | |
} | |
private function _termRequested(_arg1:EventWithParam):void{ | |
var _local2:int = (_arg1.param as int); | |
var _local3:Term = this._service.getTermAtIndex(_local2); | |
this._showTerm(_local3); | |
} | |
private function _showTerm(_arg1:Term):void{ | |
this._termList.selectTermAt(this._service.getIndexOfTerm(_arg1)); | |
this._defText.htmlText = _arg1.defText; | |
this._defScroller.refresh(); | |
} | |
private function _letterClickEvent(_arg1:EventWithParam):void{ | |
var _local4:int; | |
var _local5:Term; | |
var _local6:Number; | |
var _local2:String = (_arg1.param as String); | |
var _local3:int = Alphabet.indexOf(_local2); | |
while (((!(this._service.hasTermsForLetter(_local2))) && ((_local3 < 25)))) { | |
_local3++; | |
_local2 = Alphabet.letterAt(_local3); | |
}; | |
if (this._service.hasTermsForLetter(_local2)){ | |
_local4 = this._service.getIndexOfLetter(_local2); | |
_local5 = this._service.getTermAtIndex(_local4); | |
_local6 = this._termList.getYAt(_local4); | |
this._termScroller.scrollToY(_local6); | |
this._showTerm(_local5); | |
} else { | |
this._termScroller.scrollToYPerc(100); | |
this._showTerm(this._service.getAllTerms()[(this._service.numTerms() - 1)]); | |
}; | |
} | |
} | |
}//package com.vpg.read14.vpage.shell.glossary | |
package com.vpg.read14.vpage.shell.glossary { | |
import flash.display.*; | |
import flash.events.*; | |
import com.vpg.vpage.utils.*; | |
public class LetterBar extends MovieClip { | |
public static const LETTER_CLICKED:String = "letterClicked"; | |
public function LetterBar(){ | |
this.addEventListener(MouseEvent.CLICK, this._barClicked); | |
DisplayU.buttonify(this); | |
} | |
private function _barClicked(_arg1:Event):void{ | |
var _local2:Number = (this.width / 26); | |
var _local3:Number = this.mouseX; | |
var _local4:Number = 0; | |
while (((((_local4 * _local2) < mouseX)) && ((_local4 <= 25)))) { | |
_local4++; | |
}; | |
dispatchEvent(new EventWithParam(LETTER_CLICKED, Alphabet.letterAt((_local4 - 1)))); | |
} | |
} | |
}//package com.vpg.read14.vpage.shell.glossary | |
package com.vpg.read14.vpage.shell.glossary { | |
import flash.display.*; | |
import flash.text.*; | |
import com.vpg.vpage.utils.*; | |
public class TermButton extends MovieClip { | |
private var _tf:TextField; | |
public function TermButton(_arg1:String){ | |
this._tf = TextUtils.createTextField("Open Sans", 14); | |
this._tf.htmlText = _arg1; | |
this._tf.width = 160; | |
TextUtils.expandHeight(this._tf); | |
addChild(this._tf); | |
DisplayU.buttonify(this); | |
} | |
public function select():void{ | |
graphics.beginFill(11591152); | |
graphics.drawRoundRect(0, 0, 160, (this._tf.height + 2), 10, 10); | |
graphics.endFill(); | |
} | |
public function unselect():void{ | |
graphics.clear(); | |
} | |
} | |
}//package com.vpg.read14.vpage.shell.glossary | |
package com.vpg.read14.vpage.shell.toc { | |
import flash.display.*; | |
import flash.geom.*; | |
import flash.net.*; | |
import flash.events.*; | |
import flash.text.*; | |
import com.vpg.vpage.utils.*; | |
import fl.transitions.*; | |
import fl.transitions.easing.*; | |
import com.vpg.vpage.shell.menu.*; | |
import com.vpg.vpage.components.scrollpane.*; | |
public class Toc extends MovieClip { | |
public static const GOTO_PAGE:String = "gotoPageEvent"; | |
public var title_tf:TextField; | |
public var bg:MovieClip; | |
public var content_area:MovieClip; | |
private var _sp:StandardScrollPane; | |
private var _mainContent:Sprite; | |
private var _submenu:Submenu; | |
private var _mgr:MenuManager; | |
private var _items:Array; | |
public function Toc(_arg1:String){ | |
this.title_tf.htmlText = _arg1; | |
this._sp = new StandardScrollPane(); | |
addChild(this._sp); | |
var _local2:Number = 8; | |
this._sp.setSize((this.content_area.width - (_local2 * 2)), (this.content_area.height - (_local2 * 2))); | |
this._sp.x = (this.content_area.x + _local2); | |
this._sp.y = (this.content_area.y + _local2); | |
this._sp.turnOffHScroll(); | |
this._sp.refresh(); | |
this._submenu = new Submenu(); | |
addChildAt(this._submenu, 0); | |
this._submenu.addEventListener(Submenu.GOTO_PAGE, this._submenuGotoPage); | |
this._mgr = new MenuManager(); | |
var _local3:Number = 0; | |
var _local4:Number = (this.bg.width - 2); | |
var _local5:Number = 12; | |
var _local6:Tween = new Tween(this._submenu, "x", Regular.easeOut, _local3, _local4, _local5); | |
var _local7:Tween = new Tween(this._submenu, "x", Regular.easeOut, _local4, _local3, _local5); | |
this._mgr.setOpenTransition(_local6); | |
this._mgr.setCloseTransition(_local7); | |
this._submenu.x = _local3; | |
} | |
public function setSize(_arg1:Number, _arg2:Number):void{ | |
this.bg.height = _arg2; | |
} | |
public function loadFile(_arg1:String):void{ | |
NetU.doFileLoad(_arg1, this._fileLoaded, this._fileLoadError); | |
} | |
public function closeSubmenu():void{ | |
this._mgr.close(); | |
} | |
public function getHeight():Number{ | |
return (this.bg.height); | |
} | |
private function _fileLoaded(_arg1:Event):void{ | |
var _local2:URLLoader = (_arg1.currentTarget as URLLoader); | |
var _local3:XML = new XML(_local2.data); | |
this._buildMenu(_local3); | |
this._initComplete(); | |
} | |
private function _fileLoadError(_arg1:Event):void{ | |
this._initComplete(); | |
} | |
private function _initComplete():void{ | |
dispatchEvent(new Event(Event.COMPLETE)); | |
} | |
private function _buildMenu(_arg1:XML):void{ | |
var _local5:XML; | |
var _local6:String; | |
var _local7:String; | |
var _local8:TocItem; | |
var _local9:int; | |
var _local10:TocItem; | |
this._items = new Array(); | |
this._mainContent = new Sprite(); | |
var _local2:XMLList = _arg1.node; | |
var _local3:Number = 0; | |
var _local4:int; | |
while (_local4 < _local2.length()) { | |
_local5 = _local2[_local4]; | |
_local6 = _local5.@name; | |
_local7 = _local5.@href; | |
_local8 = new TocItem(_local6, _local7, _local5.node); | |
_local8.addEventListener(MouseEvent.CLICK, this._tocItemClicked); | |
this._mainContent.addChild(_local8); | |
_local8.y = _local3; | |
_local3 = (_local3 + (_local8.height + 2)); | |
DisplayU.buttonify(_local8); | |
this._items.push(_local8); | |
_local4++; | |
}; | |
this._sp.getContentLayer().addChild(this._mainContent); | |
this._sp.refresh(); | |
_local3 = 0; | |
if (this._sp.canVScroll()){ | |
_local9 = 0; | |
while (_local9 < this._items.length) { | |
_local10 = (this._items[_local9] as TocItem); | |
_local10.narrowMode(); | |
_local10.y = _local3; | |
_local3 = (_local3 + (_local10.height + 2)); | |
_local9++; | |
}; | |
}; | |
this._sp.refresh(); | |
} | |
private function _tocItemClicked(_arg1:Event):void{ | |
var _local5:Rectangle; | |
var _local6:Number; | |
var _local2:TocItem = (_arg1.currentTarget as TocItem); | |
var _local3:String = _local2.getPage(); | |
var _local4:XMLList = _local2.getData(); | |
if (_local3){ | |
dispatchEvent(new EventWithParam(GOTO_PAGE, _local3)); | |
}; | |
if (((_local4) && ((_local4.length() > 0)))){ | |
_local5 = _local2.getBounds(this); | |
_local6 = (_local5.y - 20); | |
this._showSubmenu(_local4, _local6); | |
} else { | |
this.closeSubmenu(); | |
}; | |
} | |
private function _showSubmenu(_arg1:XMLList, _arg2:Number):void{ | |
this._submenu.setContent(_arg1); | |
var _local3:Number = 10; | |
if ((_arg2 + this._submenu.getHeight()) > this.bg.height){ | |
this._submenu.y = ((this.bg.height - _local3) - this._submenu.getHeight()); | |
} else { | |
this._submenu.y = _arg2; | |
}; | |
this._mgr.open(); | |
} | |
private function _submenuGotoPage(_arg1:EventWithParam):void{ | |
dispatchEvent(new EventWithParam(GOTO_PAGE, _arg1.param)); | |
} | |
} | |
}//package com.vpg.read14.vpage.shell.toc | |
package com.vpg.read14.vpage.shell.toc { | |
import flash.display.*; | |
import flash.events.*; | |
import com.vpg.vpage.utils.*; | |
import com.vpg.vpage.components.scrollpane.*; | |
public class Submenu extends MovieClip { | |
public static const GOTO_PAGE:String = "gotoPage"; | |
public var bg:MovieClip; | |
public var content_area:MovieClip; | |
private var _holder:Sprite; | |
private var _sp:StandardScrollPane; | |
public function Submenu(){ | |
this._sp = new StandardScrollPane(); | |
this._sp.turnOffHScroll(); | |
addChild(this._sp); | |
} | |
public function setContent(_arg1:XMLList):void{ | |
var _local2:Number; | |
var _local8:XML; | |
var _local9:TocItem; | |
var _local10:XMLList; | |
var _local11:int; | |
var _local12:XML; | |
var _local13:TocItem; | |
this._sp.clearContent(); | |
_local2 = 8; | |
var _local3:Number = 2; | |
this._holder = new Sprite(); | |
this._holder.y = (this.content_area.y + _local2); | |
this._holder.x = (this.content_area.x + _local2); | |
var _local4:Number = 0; | |
var _local5:int; | |
while (_local5 < _arg1.length()) { | |
_local8 = _arg1[_local5]; | |
_local9 = this._getItem(_local8); | |
_local4 = this._processTocItem(_local9, _local4); | |
_local4 = (_local4 + _local3); | |
_local10 = _local8.node; | |
if (_local10 != null){ | |
_local11 = 0; | |
while (_local11 < _local10.length()) { | |
_local12 = _local10[_local11]; | |
_local13 = this._getItem(_local12); | |
_local13.indent(15); | |
_local4 = this._processTocItem(_local13, _local4); | |
_local4 = (_local4 + _local3); | |
_local11++; | |
}; | |
}; | |
_local5++; | |
}; | |
this._sp.getContentLayer().addChild(this._holder); | |
var _local6:Number = 480; | |
var _local7:Number = ((this._holder.height + (_local2 * 2)) + (this.content_area.y * 2)); | |
this.bg.height = Math.min(_local6, _local7); | |
this.content_area.height = (this.bg.height - (this.content_area.y * 2)); | |
this._sp.setSize((this.content_area.width - (_local2 * 2)), (this.content_area.height - (_local2 * 2))); | |
this._sp.x = (this.content_area.x + _local2); | |
this._sp.y = (this.content_area.y + _local2); | |
} | |
public function getHeight():Number{ | |
return (this.bg.height); | |
} | |
private function _itemClicked(_arg1:Event):void{ | |
var _local2:TocItem = (_arg1.currentTarget as TocItem); | |
if (_local2.getPage()){ | |
dispatchEvent(new EventWithParam(GOTO_PAGE, _local2.getPage())); | |
}; | |
} | |
private function _getItem(_arg1:XML):TocItem{ | |
var _local2:String = _arg1.@name; | |
var _local3:String = _arg1.@href; | |
var _local4:TocItem = new TocItem(_local2, _local3, null); | |
return (_local4); | |
} | |
private function _processTocItem(_arg1:TocItem, _arg2:Number):Number{ | |
_arg1.y = _arg2; | |
DisplayU.buttonify(_arg1, this._itemClicked); | |
this._holder.addChild(_arg1); | |
return ((_arg2 + _arg1.height)); | |
} | |
} | |
}//package com.vpg.read14.vpage.shell.toc | |
package com.vpg.read14.vpage.shell.toc { | |
import flash.display.*; | |
import flash.text.*; | |
public class TocItem extends MovieClip { | |
public var tf:TextField; | |
public var bg:MovieClip; | |
public var next_btn:MovieClip; | |
private var _page:String; | |
private var _data:XMLList; | |
public function TocItem(_arg1:String, _arg2:String, _arg3:XMLList){ | |
this.tf.htmlText = _arg1; | |
this.tf.wordWrap = true; | |
this.tf.autoSize = TextFieldAutoSize.LEFT; | |
this.bg.height = this.tf.height; | |
this._page = _arg2; | |
this._data = _arg3; | |
if ((((_arg3 == null)) || ((_arg3.length() == 0)))){ | |
this._hideNext(); | |
}; | |
} | |
public function indent(_arg1:Number):void{ | |
this.tf.x = (this.tf.x + _arg1); | |
this.tf.width = (this.tf.width - _arg1); | |
this.bg.height = this.tf.height; | |
} | |
public function wideMode():void{ | |
} | |
public function narrowMode():void{ | |
var _local1:Number; | |
_local1 = 250; | |
var _local2:Number = 25; | |
this.next_btn.x = ((_local1 - this.next_btn.width) - _local2); | |
this.tf.width = (((_local1 - _local2) - this.next_btn.width) - 8); | |
this.bg.height = this.tf.height; | |
} | |
public function getPage():String{ | |
return (this._page); | |
} | |
public function getData():XMLList{ | |
return (this._data); | |
} | |
private function _hideNext():void{ | |
this.next_btn.visible = false; | |
} | |
} | |
}//package com.vpg.read14.vpage.shell.toc | |
package com.vpg.read14.vpage.shell.toc { | |
import flash.display.*; | |
import flash.events.*; | |
import com.vpg.vpage.utils.*; | |
import fl.transitions.*; | |
import fl.transitions.easing.*; | |
import com.vpg.vpage.shell.menu.*; | |
public class TocMain extends MovieClip { | |
public static const GOTO_PAGE:String = "gotoPage"; | |
private var _toc:Toc; | |
private var _mgr:MenuManager; | |
public function TocMain(_arg1:String){ | |
this._toc = new Toc(_arg1); | |
addChild(this._toc); | |
this._toc.addEventListener(Toc.GOTO_PAGE, this._gotoPage); | |
this._mgr = new MenuManager(); | |
var _local2:Number = -310; | |
var _local3:Number = -3; | |
var _local4:Number = 12; | |
var _local5:Tween = new Tween(this._toc, "x", Regular.easeOut, _local2, _local3, _local4); | |
var _local6:Tween = new Tween(this._toc, "x", Regular.easeOut, _local3, _local2, _local4); | |
this._mgr.setOpenTransition(_local5); | |
this._mgr.setCloseTransition(_local6); | |
this._toc.x = _local2; | |
} | |
public function setSize(_arg1:Number, _arg2:Number):void{ | |
this._toc.setSize(_arg1, _arg2); | |
} | |
public function loadFile(_arg1:String):void{ | |
this._toc.addEventListener(Event.COMPLETE, this._tocLoaded); | |
this._toc.loadFile(_arg1); | |
} | |
public function toggleOpenClose():void{ | |
if (this._mgr.isOpen()){ | |
this._toc.closeSubmenu(); | |
}; | |
this._mgr.toggleOpenClose(); | |
} | |
public function getHeight():Number{ | |
return (this._toc.getHeight()); | |
} | |
public function close():void{ | |
this._toc.closeSubmenu(); | |
this._mgr.close(); | |
} | |
private function _tocLoaded(_arg1:Event):void{ | |
dispatchEvent(new Event(Event.COMPLETE)); | |
} | |
private function _gotoPage(_arg1:EventWithParam):void{ | |
dispatchEvent(new EventWithParam(GOTO_PAGE, _arg1.param)); | |
} | |
} | |
}//package com.vpg.read14.vpage.shell.toc | |
package com.vpg.read14.vpage.shell.audio { | |
import flash.display.*; | |
import flash.events.*; | |
import com.vpg.vpage.utils.*; | |
import com.vpg.vpage.utils.mediamgr.*; | |
import com.vpg.vpage.shell.audio.*; | |
import com.vpg.read14.vpage.shell.audiocontrols.*; | |
public class AudioPlayer extends Sprite implements IAudioPlayer { | |
private var _controls:AudioControls; | |
private var _soundPlayer:SoundPlayer; | |
public function AudioPlayer(){ | |
this._soundPlayer = new SoundPlayer(); | |
this._soundPlayer.addEventListener(Event.SOUND_COMPLETE, this._soundFinished); | |
this._soundPlayer.addEventListener(Event.COMPLETE, this._soundLoaded); | |
this._soundPlayer.addEventListener(IOErrorEvent.IO_ERROR, this._soundLoaded); | |
this._soundPlayer.addEventListener(SoundPlayerEvent.POSITION, this._soundPositionUpdate); | |
this._soundPlayer.addEventListener(ProgressEvent.PROGRESS, this._soundDownloadUpdate); | |
this._soundPlayer.addEventListener(SoundPlayerEvent.START, this._soundStarted); | |
this._soundPlayer.addEventListener(MediaManager.ON_PLAY, this._mediaPlayEvent); | |
this._controls = new AudioControls(); | |
addChild(this._controls); | |
this._controls.addEventListener(AudioControls.CLOSE, this._closeEvent); | |
this._controls.addEventListener(AudioControls.PAUSE, this._pauseEvent); | |
this._controls.addEventListener(AudioControls.PLAY, this._playEvent); | |
this._controls.addEventListener(AudioControls.REWIND, this._rewindEvent); | |
this._controls.addEventListener(AudioControls.SLIDE_START, this._slideStartEvent); | |
this._controls.addEventListener(AudioControls.SLIDE_TO, this._slideToEvent); | |
this._controls.addEventListener(AudioControls.SLIDE_END, this._slideEndEvent); | |
this._controls.addEventListener(AudioControls.VOL_SLIDE_START, this._volSlideStartEvent); | |
this._controls.addEventListener(AudioControls.VOL_SLIDE_TO, this._volSlideToEvent); | |
this._controls.addEventListener(AudioControls.VOL_SLIDE_END, this._volSlideEndEvent); | |
} | |
public function init(_arg1:String, _arg2:String):void{ | |
this._soundPlayer.stop(); | |
this._soundPlayer.playSound(_arg1); | |
} | |
public function setScreenSize(_arg1:Number, _arg2:Number):void{ | |
x = 0; | |
y = ((_arg2 - 32) - this._controls.getHeight()); | |
} | |
public function destroy():void{ | |
this._soundPlayer.destroy(); | |
this._soundPlayer.removeEventListener(Event.SOUND_COMPLETE, this._soundFinished); | |
this._soundPlayer.removeEventListener(Event.COMPLETE, this._soundLoaded); | |
this._soundPlayer.removeEventListener(IOErrorEvent.IO_ERROR, this._soundLoaded); | |
this._soundPlayer.removeEventListener(SoundPlayerEvent.POSITION, this._soundPositionUpdate); | |
this._soundPlayer.removeEventListener(ProgressEvent.PROGRESS, this._soundDownloadUpdate); | |
this._soundPlayer.removeEventListener(SoundPlayerEvent.START, this._soundStarted); | |
this._controls.removeEventListener(AudioControls.CLOSE, this._closeEvent); | |
this._controls.removeEventListener(AudioControls.PAUSE, this._pauseEvent); | |
this._controls.removeEventListener(AudioControls.PLAY, this._playEvent); | |
this._controls.removeEventListener(AudioControls.REWIND, this._rewindEvent); | |
this._controls.removeEventListener(AudioControls.SLIDE_START, this._slideStartEvent); | |
this._controls.removeEventListener(AudioControls.SLIDE_TO, this._slideToEvent); | |
this._controls.removeEventListener(AudioControls.SLIDE_START, this._slideEndEvent); | |
this._controls.removeEventListener(AudioControls.VOL_SLIDE_START, this._volSlideStartEvent); | |
this._controls.removeEventListener(AudioControls.VOL_SLIDE_TO, this._volSlideToEvent); | |
this._controls.removeEventListener(AudioControls.VOL_SLIDE_END, this._volSlideEndEvent); | |
} | |
public function hideBG():void{ | |
this._controls.hideBG(); | |
} | |
public function hideClose():void{ | |
this._controls.hideClose(); | |
} | |
public function hideVolume():void{ | |
this._controls.hideVolume(); | |
} | |
public function externalHalt():void{ | |
this._soundPlayer.externalHalt(); | |
this._closeEvent(null); | |
} | |
public function stop():void{ | |
this._soundPlayer.stop(); | |
this._controls.setPaused(); | |
} | |
private function _playEvent(_arg1:EventWithParam):void{ | |
var _local2:Number = (_arg1.param as Number); | |
this._soundPlayer.playFromPerc(_local2); | |
this._controls.setPlaying(); | |
} | |
private function _pauseEvent(_arg1:Event):void{ | |
this._soundPlayer.pauseActiveSound(); | |
this._controls.setPaused(); | |
} | |
private function _rewindEvent(_arg1:Event):void{ | |
this._soundPlayer.rewind(); | |
this._controls.setStopped(); | |
} | |
private function _slideStartEvent(_arg1:Event):void{ | |
this._soundPlayer.pauseActiveSound(); | |
this._controls.setPaused(); | |
} | |
private function _slideToEvent(_arg1:EventWithParam):void{ | |
} | |
private function _slideEndEvent(_arg1:EventWithParam):void{ | |
var _local2:Number = (_arg1.param as Number); | |
this._soundPlayer.playFromPerc(_local2); | |
this._controls.setPlaying(); | |
} | |
private function _volSlideStartEvent(_arg1:Event):void{ | |
} | |
private function _volSlideToEvent(_arg1:EventWithParam):void{ | |
var _local2:Number = (_arg1.param as Number); | |
this._setVolume(_local2); | |
} | |
private function _volSlideEndEvent(_arg1:EventWithParam):void{ | |
var _local2:Number = (_arg1.param as Number); | |
this._setVolume(_local2); | |
} | |
private function _setVolume(_arg1:Number):void{ | |
this._soundPlayer.setVolume(_arg1); | |
} | |
private function _closeEvent(_arg1:Event):void{ | |
this._soundPlayer.stopActiveSound(); | |
dispatchEvent(new Event(Event.CLOSE)); | |
} | |
private function _soundFinished(_arg1:Event):void{ | |
this._controls.setStopped(); | |
this._soundPlayer.rewind(); | |
} | |
private function _soundLoaded(_arg1:Event):void{ | |
} | |
private function _soundPositionUpdate(_arg1:Event):void{ | |
var _local2:Number = (this._soundPlayer.getPosition() / this._soundPlayer.getDuration()); | |
this._controls.setAudioLocation(_local2); | |
} | |
private function _soundDownloadUpdate(_arg1:Event):void{ | |
} | |
private function _soundStarted(_arg1:Event):void{ | |
} | |
private function _mediaPlayEvent(_arg1:Event):void{ | |
dispatchEvent(new Event(MediaManager.ON_PLAY)); | |
} | |
} | |
}//package com.vpg.read14.vpage.shell.audio | |
package com.vpg.read14.vpage.shell { | |
import flash.display.*; | |
import flash.text.*; | |
import com.vpg.vpage.utils.*; | |
import com.vpg.vpage.components.button.*; | |
public class Footer extends MovieClip { | |
public var left_mc:MovieClip; | |
public var right_mc:MovieClip; | |
public var center_mc:MovieClip; | |
public var bg:MovieClip; | |
public var toc_btn:BasicButton; | |
public var prev_btn:BasicButton; | |
public var next_btn:BasicButton; | |
public var double_page_btn:BasicButton; | |
public var single_page_btn:BasicButton; | |
public var drag_page_btn:BasicButton; | |
public var zoom_out_btn:BasicButton; | |
public var zoom_in_btn:BasicButton; | |
public var zoom_to_rect_btn:BasicButton; | |
public var zoom_to_100_btn:BasicButton; | |
public var note_btn:BasicButton; | |
public var highlight_btn:BasicButton; | |
public var nav_tf:TextField; | |
public var zoom_tf:TextField; | |
public var audioToggle:AudioSlider; | |
public var audio_tf:TextField; | |
public var glossary_btn:BasicButton; | |
public var index_btn:BasicButton; | |
public function Footer(){ | |
this.toc_btn = this.center_mc.toc_btn; | |
this.prev_btn = this.center_mc.prev_btn; | |
this.next_btn = this.center_mc.next_btn; | |
this.double_page_btn = this.center_mc.double_page_btn; | |
this.single_page_btn = this.center_mc.single_page_btn; | |
this.nav_tf = this.center_mc.nav_tf; | |
this.drag_page_btn = this.right_mc.drag_page_btn; | |
this.zoom_out_btn = this.right_mc.zoom_out_btn; | |
this.zoom_in_btn = this.right_mc.zoom_in_btn; | |
this.zoom_to_rect_btn = this.right_mc.zoom_to_rect_btn; | |
this.note_btn = this.right_mc.note_btn; | |
this.highlight_btn = this.right_mc.highlight_btn; | |
this.zoom_to_100_btn = this.right_mc.zoom_to_100_btn; | |
this.glossary_btn = this.center_mc.glossary_btn; | |
this.index_btn = this.center_mc.index_btn; | |
this.audioToggle = this.left_mc.audiotoggle; | |
this.audio_tf = this.left_mc.audio_tf; | |
TextUtils.expandWidth(this.audio_tf); | |
} | |
public function hideAudioToggle():void{ | |
this.left_mc.visible = false; | |
} | |
public function hideGlossary():void{ | |
DisplayU.removeFromDisplayList(this.glossary_btn); | |
this._shiftCenterElemsLeft(this.glossary_btn, (this.index_btn.x - this.glossary_btn.x)); | |
} | |
public function hideIndex():void{ | |
DisplayU.removeFromDisplayList(this.index_btn); | |
this._shiftCenterElemsLeft(this.index_btn, (this.toc_btn.x - this.index_btn.x)); | |
} | |
public function hideToc():void{ | |
DisplayU.removeFromDisplayList(this.toc_btn); | |
this._shiftCenterElemsLeft(this.toc_btn, (this.center_mc.sep1.x - this.toc_btn.x)); | |
} | |
public function setNavTextWidth(_arg1:Number):void{ | |
var _local2:Array; | |
var _local3:Number; | |
var _local4:int; | |
var _local5:DisplayObject; | |
if (_arg1 == 50){ | |
} else { | |
this.center_mc.nav_box.width = _arg1; | |
this.center_mc.nav_tf.width = _arg1; | |
_local2 = [this.center_mc.next_btn, this.center_mc.sep2, this.center_mc.double_page_btn, this.center_mc.single_page_btn]; | |
_local3 = (_arg1 - 50); | |
_local4 = 0; | |
while (_local4 < _local2.length) { | |
_local5 = (_local2[_local4] as DisplayObject); | |
(_local2[_local4] as DisplayObject).x = (_local5.x + _local3); | |
_local4++; | |
}; | |
}; | |
} | |
public function reflow():void{ | |
this.audioToggle.x = ((this.audio_tf.x + this.audio_tf.width) + 3); | |
} | |
public function removeHighlighter():void{ | |
this.highlight_btn.visible = false; | |
this.right_mc.x = (this.right_mc.x + (this.highlight_btn.width + 13)); | |
} | |
public function setWidth(_arg1:Number):void{ | |
var _local2:Number = (this.bg.width - this.right_mc.x); | |
this.right_mc.x = (_arg1 - _local2); | |
var _local3:Number = 20; | |
var _local4:Number = ((((_arg1 - _local3) - this.right_mc.width) - this.left_mc.width) - this.center_mc.width); | |
var _local5:Number = (_local4 / 2); | |
this.center_mc.x = ((this.left_mc.x + this.left_mc.width) + _local5); | |
this.bg.width = _arg1; | |
} | |
public function setNavText(_arg1:String):void{ | |
this.center_mc.nav_tf.text = _arg1; | |
} | |
private function _reflow():void{ | |
this.setWidth(this.bg.width); | |
} | |
private function _shiftCenterElemsLeft(_arg1:Sprite, _arg2:Number):void{ | |
var _local3:Array = [this.glossary_btn, this.index_btn, this.toc_btn, this.center_mc.sep1, this.prev_btn, this.nav_tf, this.center_mc.nav_box, this.next_btn, this.center_mc.sep2, this.double_page_btn, this.single_page_btn]; | |
var _local4:Boolean; | |
var _local5:int; | |
while (_local5 < _local3.length) { | |
if (_local3[_local5] == _arg1){ | |
_local4 = true; | |
} else { | |
if (_local4){ | |
_local3[_local5].x = (_local3[_local5].x - _arg2); | |
}; | |
}; | |
_local5++; | |
}; | |
this._reflow(); | |
} | |
} | |
}//package com.vpg.read14.vpage.shell | |
package com.vpg.read14.vpage.shell.index { | |
import flash.display.*; | |
import flash.geom.*; | |
import flash.net.*; | |
import flash.events.*; | |
import flash.text.*; | |
import com.vpg.vpage.utils.*; | |
import com.vpg.vpage.shell.index.*; | |
import com.vpg.vpage.components.scrollpane.*; | |
import com.vpg.read14.vpage.shell.glossary.*; | |
public class IndexWindow extends MovieClip implements IIndexWindow, IDraggable { | |
public var close_btn:MovieClip; | |
public var drag_bar:MovieClip; | |
public var title_tf:TextField; | |
public var content_bg:Sprite; | |
public var letter_bar:LetterBar; | |
private var _contentPath:String; | |
private var _contentField:TextField; | |
private var _contentScroller:StandardScrollPane; | |
public function init(_arg1:String):void{ | |
var _local2:Number; | |
this._contentPath = _arg1; | |
DraggableItem.registerDraggable(this); | |
this.title_tf.mouseEnabled = false; | |
this.close_btn.addEventListener(MouseEvent.CLICK, this._closeClicked); | |
DisplayU.buttonify(this.close_btn); | |
_local2 = 8; | |
this._contentScroller = new StandardScrollPane(); | |
this._contentScroller.x = (this.content_bg.x + _local2); | |
this._contentScroller.y = (this.content_bg.y + _local2); | |
this._contentScroller.setSize((this.content_bg.width - (_local2 * 2)), (this.content_bg.height - (_local2 * 2))); | |
this._contentScroller.turnOffHScroll(); | |
addChild(this._contentScroller); | |
this.letter_bar.addEventListener(LetterBar.LETTER_CLICKED, this._letterClickEvent); | |
this._contentField = TextUtils.createTextField("Open Sans", 14); | |
this._contentField.width = (this.content_bg.width - 24); | |
TextUtils.expandHeight(this._contentField); | |
this._contentField.addEventListener(TextEvent.LINK, this._linkClicked); | |
this._contentScroller.getContentLayer().addChild(this._contentField); | |
this._contentField.mouseEnabled = true; | |
var _local3:StyleSheet = new StyleSheet(); | |
_local3.setStyle("a", { | |
textDecoration:"underline", | |
color:"#0000FF" | |
}); | |
this._contentField.styleSheet = _local3; | |
} | |
public function destroy():void{ | |
this.close_btn.removeEventListener(MouseEvent.CLICK, this._closeClicked); | |
} | |
public function setScreenSize(_arg1:Number, _arg2:Number):void{ | |
if (this.hasBeenDragged()){ | |
if ((this.x + this.width) > _arg1){ | |
this.x = (_arg1 - this.width); | |
}; | |
if ((this.y + this.height) > _arg2){ | |
this.y = (_arg2 - this.height); | |
}; | |
} else { | |
this.x = ((_arg1 / 2) - (this.width / 2)); | |
this.y = ((_arg2 / 2) - (this.height / 2)); | |
}; | |
} | |
public function hasBeenDragged():Boolean{ | |
return (DraggableItem.hasBeenDragged(this)); | |
} | |
public function getDraggableWindow():MovieClip{ | |
return (this); | |
} | |
public function getDragHitArea():MovieClip{ | |
return (this.drag_bar); | |
} | |
public function getDragBounds():Rectangle{ | |
return (new Rectangle(0, 0, (stage.stageWidth - this.drag_bar.width), (stage.stageHeight - this.drag_bar.height))); | |
} | |
private function _closeClicked(_arg1:Event):void{ | |
dispatchEvent(new Event(Event.CLOSE)); | |
} | |
private function _letterClickEvent(_arg1:EventWithParam):void{ | |
var _local2:String = (_arg1.param as String); | |
_local2 = _local2.toLowerCase(); | |
var _local3 = ((this._contentPath + _local2) + ".html"); | |
NetU.doFileLoad(_local3, this._loadSuccess, this._loadFailure); | |
} | |
private function _loadSuccess(_arg1:Event):void{ | |
var _local2:URLLoader = (_arg1.currentTarget as URLLoader); | |
var _local3:String = (_local2.data as String); | |
_local3 = _local3.split("asfunction:onPageClick,").join("event:"); | |
this._setContent(_local3); | |
} | |
private function _loadFailure(_arg1:Event):void{ | |
this._setContent("No entries found."); | |
} | |
private function _setContent(_arg1:String):void{ | |
trace(_arg1); | |
this._contentField.htmlText = _arg1; | |
this._contentScroller.refresh(); | |
} | |
private function _linkClicked(_arg1:TextEvent):void{ | |
var _local2:String = _arg1.text; | |
dispatchEvent(new EventWithParam(IndexEvents.GOTO_PAGE, _local2)); | |
} | |
} | |
}//package com.vpg.read14.vpage.shell.index | |
package com.vpg.r180.vpage.shell { | |
import flash.display.*; | |
public dynamic class Bookmark extends MovieClip { | |
} | |
}//package com.vpg.r180.vpage.shell | |
package com.vpg.vpage.components.scrollbar { | |
import flash.display.*; | |
import flash.geom.*; | |
import flash.events.*; | |
import com.vpg.vpage.utils.*; | |
import flash.utils.*; | |
public class ScrollBar extends Sprite { | |
public static const UP:String = "scrollbarUp"; | |
public static const DOWN:String = "scrollbarDown"; | |
public static const SCROLLTO:String = "scrollbarScrollTo"; | |
public var up_btn:MovieClip; | |
public var down_btn:MovieClip; | |
public var track:MovieClip; | |
public var slider:MovieClip; | |
public var grip:MovieClip; | |
private var _minSliderHeight:Number; | |
private var _viewSize:Number; | |
private var _timer:Timer; | |
public function ScrollBar(){ | |
if (this.slider.grip){ | |
this._minSliderHeight = this.slider.height; | |
}; | |
this._setUpEvents(); | |
} | |
public function destroy():void{ | |
this.up_btn.removeEventListener(MouseEvent.MOUSE_DOWN, this._upPressed); | |
this.down_btn.removeEventListener(MouseEvent.MOUSE_DOWN, this._downPressed); | |
this.slider.removeEventListener(MouseEvent.MOUSE_DOWN, this._sliderPressed); | |
this.track.removeEventListener(MouseEvent.CLICK, this._trackClicked); | |
this.up_btn = null; | |
this.down_btn = null; | |
this.track = null; | |
this.slider = null; | |
this.grip = null; | |
if (this._timer){ | |
this._timer.stop(); | |
this._timer.removeEventListener(TimerEvent.TIMER, this._doUpTick); | |
this._timer.removeEventListener(TimerEvent.TIMER, this._doDownTick); | |
}; | |
this._timer = null; | |
} | |
public function setSize(_arg1:Number):void{ | |
this.track.height = ((_arg1 - this.up_btn.height) - this.down_btn.height); | |
this.down_btn.y = (_arg1 - this.down_btn.height); | |
if (this.up_btn.y > this.track.y){ | |
this.up_btn.y = this.track.height; | |
}; | |
} | |
public function setScroll(_arg1:Number):void{ | |
_arg1 = (_arg1 * 1000); | |
_arg1 = Math.round(_arg1); | |
_arg1 = (_arg1 / 1000); | |
var _local2:* = this._getBottomValidYAsPerc(); | |
if (_arg1 < 0){ | |
this.slider.y = this.track.y; | |
} else { | |
if (_arg1 > _local2){ | |
this.slider.y = ((this.track.y + this.track.height) - this.slider.height); | |
} else { | |
this.slider.y = this._convertPercToY(_arg1); | |
}; | |
}; | |
} | |
public function setViewSize(_arg1:Number):void{ | |
this._viewSize = _arg1; | |
if (_arg1 <= 0){ | |
this._setSliderHeight(0); | |
} else { | |
if (_arg1 >= 1){ | |
this._setSliderHeight(this.track.height); | |
this.setScroll(0); | |
} else { | |
this._setSliderHeight((this.track.height * _arg1)); | |
this.setScroll(this._getCurrentScroll()); | |
}; | |
}; | |
} | |
private function _setSliderHeight(_arg1:Number):void{ | |
if (((this.slider.bg) && (this.slider.grip))){ | |
this.slider.bg.height = Math.max(this._minSliderHeight, _arg1); | |
this.slider.grip.y = Math.round(((this.slider.bg.height / 2) - (this.slider.grip.height / 2))); | |
} else { | |
this.slider.height = _arg1; | |
}; | |
} | |
private function _getCurrentScroll():Number{ | |
var _local1:Number = this._convertSliderYToPerc(); | |
return (_local1); | |
} | |
private function _setUpEvents():void{ | |
this.up_btn.addEventListener(MouseEvent.MOUSE_DOWN, this._upPressed); | |
this.down_btn.addEventListener(MouseEvent.MOUSE_DOWN, this._downPressed); | |
this.slider.addEventListener(MouseEvent.MOUSE_DOWN, this._sliderPressed); | |
this.track.addEventListener(MouseEvent.CLICK, this._trackClicked); | |
DisplayU.buttonify(this.up_btn); | |
DisplayU.buttonify(this.down_btn); | |
DisplayU.buttonify(this.slider); | |
} | |
private function _upPressed(_arg1:Event):void{ | |
if (this.slider.y > this.track.y){ | |
dispatchEvent(new Event(UP)); | |
}; | |
stage.addEventListener(MouseEvent.MOUSE_UP, this._upReleased); | |
this._timer = this._getTimer(); | |
this._timer.addEventListener(TimerEvent.TIMER, this._doUpTick); | |
this._timer.start(); | |
} | |
private function _doUpTick(_arg1:Event):void{ | |
if (this.slider.y > this.track.y){ | |
dispatchEvent(new Event(UP)); | |
}; | |
} | |
private function _downPressed(_arg1:Event):void{ | |
if (this.slider.y < ((this.track.y + this.track.height) - this.slider.height)){ | |
dispatchEvent(new Event(DOWN)); | |
}; | |
stage.addEventListener(MouseEvent.MOUSE_UP, this._downReleased); | |
this._timer = this._getTimer(); | |
this._timer.addEventListener(TimerEvent.TIMER, this._doDownTick); | |
this._timer.start(); | |
} | |
private function _doDownTick(_arg1:Event):void{ | |
if (this.slider.y < ((this.track.y + this.track.height) - this.slider.height)){ | |
dispatchEvent(new Event(DOWN)); | |
}; | |
} | |
private function _upReleased(_arg1:Event):void{ | |
this._timer.stop(); | |
this._timer.removeEventListener(TimerEvent.TIMER, this._doUpTick); | |
stage.removeEventListener(MouseEvent.MOUSE_UP, this._upReleased); | |
} | |
private function _downReleased(_arg1:Event):void{ | |
this._timer.stop(); | |
this._timer.removeEventListener(TimerEvent.TIMER, this._doDownTick); | |
stage.removeEventListener(MouseEvent.MOUSE_UP, this._downReleased); | |
} | |
private function _sliderPressed(_arg1:Event):void{ | |
var _local2:Rectangle = new Rectangle(this.slider.x, this.track.y, 0, ((this.track.y + this.track.height) - this.slider.height)); | |
this.slider.startDrag(false, _local2); | |
addEventListener(Event.ENTER_FRAME, this._updateScroll); | |
stage.addEventListener(MouseEvent.MOUSE_UP, this._sliderReleased); | |
} | |
private function _updateScroll(_arg1:Event=null):void{ | |
var _local2:Number = this._getCurrentScroll(); | |
var _local3:EventWithParam = new EventWithParam(SCROLLTO, _local2); | |
dispatchEvent(_local3); | |
} | |
private function _sliderReleased(_arg1:Event):void{ | |
stage.removeEventListener(MouseEvent.MOUSE_UP, this._sliderReleased); | |
removeEventListener(Event.ENTER_FRAME, this._updateScroll); | |
this.slider.stopDrag(); | |
this._updateScroll(); | |
} | |
private function _trackClicked(_arg1:Event):void{ | |
var _local2:Number = mouseY; | |
var _local3:Number = ((this.track.y + this.track.height) - this.slider.height); | |
this.slider.y = Math.min(_local2, _local3); | |
this._updateScroll(); | |
} | |
private function _getBottomValidYAsPerc():Number{ | |
return ((1 - this._viewSize)); | |
} | |
private function _convertSliderYToPerc():Number{ | |
var _local1:Number = (this.track.height - this.slider.height); | |
var _local2:Number = ((this.slider.y - this.track.y) / _local1); | |
var _local3:Number = (this._getBottomValidYAsPerc() * _local2); | |
return (_local3); | |
} | |
private function _convertPercToY(_arg1:Number):Number{ | |
var _local2:Number = (this.track.height - this.slider.height); | |
var _local3:Number = ((_arg1 / this._getBottomValidYAsPerc()) * _local2); | |
_local3 = (_local3 + this.track.y); | |
return (_local3); | |
} | |
private function _getTimer():Timer{ | |
var _local1:Timer = new Timer(200); | |
return (_local1); | |
} | |
} | |
}//package com.vpg.vpage.components.scrollbar | |
package com.vpg.vpage.components.slider { | |
import flash.display.*; | |
import flash.geom.*; | |
import flash.events.*; | |
import com.vpg.vpage.utils.*; | |
public class Slider extends MovieClip { | |
public static const START:String = "sliderStartEvent"; | |
public static const CHANGE:String = "sliderChangeEvent"; | |
public static const END:String = "sliderEndEvent"; | |
public var slider:MovieClip; | |
public var track:MovieClip; | |
public var fill:MovieClip; | |
private var _isDragging:Boolean; | |
public function Slider(){ | |
DisplayU.buttonify(this.slider); | |
this.slider.addEventListener(MouseEvent.MOUSE_DOWN, this._mouseDownEvent); | |
} | |
public function setWidth(_arg1:Number):void{ | |
var _local2:Number = this.getCurrentPosition(); | |
this.track.width = _arg1; | |
this.setLocation(_local2); | |
} | |
public function setLocation(_arg1:Number):void{ | |
var _local2:Number = (this.track.width - this._getSliderWidth()); | |
var _local3:Number = (_local2 * _arg1); | |
this.slider.x = (this.track.x + _local3); | |
this._positionUpdate(); | |
} | |
public function getCurrentPosition():Number{ | |
var _local1:Number = (this.track.width - this._getSliderWidth()); | |
var _local2:Number = (this.slider.x - this.track.x); | |
var _local3:Number = (_local2 / _local1); | |
if (_local3 > 0.99){ | |
_local3 = 1; | |
}; | |
return (_local3); | |
} | |
public function isDragging():Boolean{ | |
return (this._isDragging); | |
} | |
private function _mouseDownEvent(_arg1:Event):void{ | |
this._isDragging = true; | |
stage.addEventListener(MouseEvent.MOUSE_UP, this._mouseUpEvent); | |
stage.addEventListener(MouseEvent.MOUSE_MOVE, this._mouseMoveEvent); | |
var _local2:Number = (this.track.width - this._getSliderWidth()); | |
var _local3:Rectangle = new Rectangle(this.track.x, this.slider.y, _local2, 0); | |
this.slider.startDrag(false, _local3); | |
dispatchEvent(new EventWithParam(START, this.getCurrentPosition())); | |
} | |
private function _mouseUpEvent(_arg1:Event):void{ | |
this._isDragging = false; | |
stage.removeEventListener(MouseEvent.MOUSE_UP, this._mouseUpEvent); | |
stage.removeEventListener(MouseEvent.MOUSE_MOVE, this._mouseMoveEvent); | |
this.slider.stopDrag(); | |
dispatchEvent(new EventWithParam(END, this.getCurrentPosition())); | |
} | |
private function _mouseMoveEvent(_arg1:Event):void{ | |
this._positionUpdate(); | |
} | |
private function _positionUpdate():void{ | |
var _local1:Number; | |
if (this.fill != null){ | |
_local1 = (this.slider.x + (this._getSliderWidth() / 2)); | |
this.fill.width = (_local1 - this.fill.x); | |
}; | |
if (this.isDragging()){ | |
dispatchEvent(new EventWithParam(CHANGE, this.getCurrentPosition())); | |
}; | |
} | |
private function _getSliderWidth():Number{ | |
if (this.slider.size_mc){ | |
return (this.slider.size_mc.width); | |
}; | |
return (this.slider.width); | |
} | |
} | |
}//package com.vpg.vpage.components.slider | |
package com.vpg.vpage.components.combobox { | |
import flash.display.*; | |
import flash.events.*; | |
import com.vpg.vpage.utils.*; | |
import com.vpg.vpage.components.scrollpane.*; | |
public class DropdownArea extends Sprite { | |
public static const SELECTION:String = "selectEvent"; | |
public var bg:Sprite; | |
public var sp_area:Sprite; | |
private var _sp:StandardScrollPane; | |
private var _selectedIndex; | |
private var _items:Array; | |
public function DropdownArea(){ | |
this._sp = new StandardScrollPane(); | |
addChild(this._sp); | |
this.clear(); | |
this._refresh(); | |
} | |
public function clear():void{ | |
var _local1:int; | |
var _local2:DropdownItem; | |
if (this._items != null){ | |
_local1 = 0; | |
while (_local1 < this._items.length) { | |
_local2 = (this._items[_local1] as DropdownItem); | |
_local2.removeEventListener(MouseEvent.CLICK, this._itemClicked); | |
DisplayU.removeFromDisplayList(_local2); | |
_local1++; | |
}; | |
}; | |
this._items = new Array(); | |
this._selectedIndex = -1; | |
this._sp.refresh(); | |
} | |
public function setMaxHeight(_arg1:Number):void{ | |
trace("combobox.DropdownArea.setHeight: unimplemented"); | |
} | |
public function addItem(_arg1:String):void{ | |
var _local2:DropdownItem = new DropdownItem(_arg1); | |
var _local3:Number = 0; | |
var _local4:DropdownItem = (ArrayU.last(this._items) as DropdownItem); | |
if (_local4){ | |
_local3 = (_local4.y + _local4.getHeight()); | |
}; | |
_local2.y = _local3; | |
_local2.addEventListener(MouseEvent.CLICK, this._itemClicked); | |
this._items.push(_local2); | |
this._sp.getContentLayer().addChild(_local2); | |
var _local5:Number = (this.bg.height - (this.sp_area.height + this.sp_area.y)); | |
this.sp_area.height = this._sp.getContentLayer().height; | |
this.bg.height = ((this.sp_area.y + this.sp_area.height) + _local5); | |
this._refresh(); | |
} | |
public function getWidth():Number{ | |
return (this.bg.width); | |
} | |
public function setWidth(_arg1:Number):void{ | |
trace("combobox.DropdownArea.setWidth: unimplemented"); | |
} | |
public function getSelectedIndex():int{ | |
return (this._selectedIndex); | |
} | |
public function getSelectedText():String{ | |
var _local1:DropdownItem; | |
if (this.hasSelection()){ | |
_local1 = (this._items[this._selectedIndex] as DropdownItem); | |
if (_local1){ | |
return (_local1.getText()); | |
}; | |
}; | |
return (""); | |
} | |
public function hasSelection():Boolean{ | |
if (this.getSelectedIndex() == -1){ | |
return (false); | |
}; | |
return (true); | |
} | |
public function select(_arg1:int):void{ | |
if (ArrayU.containsIndex(this._items, _arg1)){ | |
this._selectedIndex = _arg1; | |
dispatchEvent(new EventWithParam(SELECTION, _arg1)); | |
}; | |
} | |
public function destroy():void{ | |
this.clear(); | |
} | |
private function _refresh():void{ | |
this._sp.x = this.sp_area.x; | |
this._sp.y = this.sp_area.y; | |
this._sp.setSize(this.sp_area.width, this.sp_area.height); | |
} | |
private function _itemClicked(_arg1:Event):void{ | |
var _local2:int = this._items.indexOf(_arg1.currentTarget); | |
this.select(_local2); | |
} | |
} | |
}//package com.vpg.vpage.components.combobox | |
package com.vpg.vpage.components.combobox { | |
import flash.display.*; | |
import flash.text.*; | |
import com.vpg.vpage.utils.*; | |
public class DropdownItem extends MovieClip { | |
public var bg:Sprite; | |
public var tf:TextField; | |
private var _text:String; | |
private var _padding:Number; | |
public function DropdownItem(_arg1:String){ | |
this._text = _arg1; | |
this._padding = (this.bg.height - this.tf.height); | |
TextUtils.expandHeight(this.tf); | |
this.tf.htmlText = _arg1; | |
this._refresh(); | |
DisplayU.buttonify(this); | |
} | |
public function getHeight():Number{ | |
return (this.bg.height); | |
} | |
public function getText():String{ | |
return (this._text); | |
} | |
public function setWidth(_arg1:Number):void{ | |
var _local2:Number = this.tf.x; | |
var _local3:Number = (this.bg.width - (this.tf.x + this.tf.width)); | |
this.bg.width = _arg1; | |
this.tf.width = ((_arg1 - _local2) - _local3); | |
} | |
private function _refresh():void{ | |
this.bg.height = (this.tf.height - this._padding); | |
} | |
} | |
}//package com.vpg.vpage.components.combobox | |
package com.vpg.vpage.components.combobox { | |
import flash.display.*; | |
import flash.events.*; | |
import flash.text.*; | |
import com.vpg.vpage.utils.*; | |
public class ComboBox extends Sprite { | |
public static const SELECTION:String = "selectedEvent"; | |
public var tf:TextField; | |
public var bg:Sprite; | |
public var btn:MovieClip; | |
public var dropdown_holder:Sprite; | |
private var _defaultText:String; | |
private var _dropdownArea:DropdownArea; | |
private var _isOpen:Boolean; | |
public function ComboBox(){ | |
this._isOpen = false; | |
this._defaultText = ""; | |
this._dropdownArea = new DropdownArea(); | |
this._dropdownArea.addEventListener(DropdownArea.SELECTION, this._itemSelected); | |
DisplayU.buttonify(this.btn, this._openCloseClicked); | |
this.close(); | |
} | |
public function setWidth(_arg1:Number):void{ | |
var _local2:Number = this.bg.width; | |
var _local3:Number = (_local2 - this.btn.x); | |
var _local4:Number = (_local2 - this.tf.width); | |
var _local5:Number = (_local2 - this._dropdownArea.getWidth()); | |
this.bg.width = _local2; | |
this.btn.x = (_arg1 - _local3); | |
this.tf.width = (_arg1 - _local4); | |
this._dropdownArea.setWidth((_arg1 - _local5)); | |
} | |
public function clear():void{ | |
this._dropdownArea.clear(); | |
this.tf.htmlText = this._defaultText; | |
} | |
public function setOptions(_arg1:Array):void{ | |
var _local3:String; | |
var _local2:int; | |
while (_local2 < _arg1.length) { | |
_local3 = (_arg1[_local2] as String); | |
this.addItem(_local3); | |
_local2++; | |
}; | |
} | |
public function addItem(_arg1:String):void{ | |
this._dropdownArea.addItem(_arg1); | |
} | |
public function getSelectedIndex():int{ | |
return (this._dropdownArea.getSelectedIndex()); | |
} | |
public function getSelectedText():String{ | |
return (this._dropdownArea.getSelectedText()); | |
} | |
public function setDefaultText(_arg1:String):void{ | |
this._defaultText = _arg1; | |
if (this.getSelectedIndex() == -1){ | |
this.tf.htmlText = this._defaultText; | |
}; | |
} | |
public function destroy():void{ | |
this._dropdownArea.destroy(); | |
} | |
public function select(_arg1:int):void{ | |
this._dropdownArea.select(_arg1); | |
} | |
public function hasSelection():Boolean{ | |
return (this._dropdownArea.hasSelection()); | |
} | |
public function isOpen():Boolean{ | |
return (this._isOpen); | |
} | |
public function close():void{ | |
this._isOpen = false; | |
DisplayU.removeFromDisplayList(this._dropdownArea); | |
} | |
public function open():void{ | |
this._isOpen = true; | |
this.dropdown_holder.addChild(this._dropdownArea); | |
} | |
private function _itemSelected(_arg1:EventWithParam):void{ | |
var _local2:int = (_arg1.param as int); | |
this.tf.htmlText = this.getSelectedText(); | |
this.close(); | |
dispatchEvent(new EventWithParam(SELECTION, _local2)); | |
} | |
private function _openCloseClicked(_arg1:Event):void{ | |
if (this.isOpen()){ | |
this.close(); | |
} else { | |
this.open(); | |
}; | |
} | |
} | |
}//package com.vpg.vpage.components.combobox | |
package com.vpg.vpage.components.button { | |
import flash.display.*; | |
import flash.text.*; | |
public class BasicButton extends AbstractButton implements IButton { | |
public var zoom_tf:TextField; | |
public var tf:TextField; | |
public var disabled:MovieClip; | |
public var selected:MovieClip; | |
private var _isEnabled:Boolean; | |
private var _isSelected:Boolean; | |
private var _disabledAlpha:Number; | |
public function BasicButton(){ | |
this._disabledAlpha = 0.5; | |
} | |
override public function enable():void{ | |
super.enable(); | |
if (this.disabled){ | |
this.disabled.visible = false; | |
} else { | |
alpha = 1; | |
}; | |
} | |
override public function disable():void{ | |
super.disable(); | |
if (this.disabled){ | |
this.disabled.visible = true; | |
} else { | |
alpha = this._disabledAlpha; | |
}; | |
} | |
override public function select():void{ | |
super.select(); | |
if (this.selected){ | |
this.selected.visible = true; | |
}; | |
} | |
override public function unselect():void{ | |
super.unselect(); | |
if (this.selected){ | |
this.selected.visible = false; | |
}; | |
} | |
} | |
}//package com.vpg.vpage.components.button | |
package com.vpg.vpage.components.button { | |
import flash.display.*; | |
import flash.events.*; | |
public interface IButton extends IEventDispatcher { | |
function enable():void; | |
function disable():void; | |
function select():void; | |
function unselect():void; | |
function isEnabled():Boolean; | |
function isSelected():Boolean; | |
function getArt():DisplayObject; | |
} | |
}//package com.vpg.vpage.components.button | |
package com.vpg.vpage.components.button { | |
import flash.display.*; | |
import flash.geom.*; | |
import com.vpg.vpage.utils.*; | |
public class AbstractButton extends MovieClip implements IButton { | |
private var _hit:Square; | |
private var _isEnabled:Boolean; | |
private var _isSelected:Boolean; | |
public function AbstractButton(){ | |
DisplayU.buttonify(this); | |
this.unselect(); | |
this.enable(); | |
} | |
public function select():void{ | |
this._isSelected = true; | |
} | |
public function unselect():void{ | |
this._isSelected = false; | |
} | |
public function isSelected():Boolean{ | |
return (this._isSelected); | |
} | |
public function enable():void{ | |
this._isEnabled = true; | |
enabled = (mouseEnabled = true); | |
} | |
public function disable():void{ | |
this._isEnabled = false; | |
enabled = (mouseEnabled = false); | |
} | |
public function isEnabled():Boolean{ | |
return (this._isEnabled); | |
} | |
public function addHitRect(_arg1:Number=0, _arg2:Number=0):void{ | |
DisplayU.removeFromDisplayList(this._hit); | |
var _local3:Rectangle = getBounds(this); | |
_local3.inflate(_arg1, _arg2); | |
this._hit = new Square(0xFF0000, 0); | |
this._hit.setSize(_local3.width, _local3.height); | |
this._hit.x = _local3.x; | |
this._hit.y = _local3.y; | |
addChild(this._hit); | |
} | |
public function getArt():DisplayObject{ | |
return (this); | |
} | |
} | |
}//package com.vpg.vpage.components.button | |
package com.vpg.vpage.components.scrollpane { | |
import com.vpg.vpage.components.scrollbar.*; | |
import com.vpg.vpage.components.scrollpane.core.*; | |
import com.vpg.vpage.components.scrollpane.controls.*; | |
public class StandardScrollPane extends AbstractScrollPane { | |
private var _vSB:ScrollBar; | |
private var _hSB:ScrollBar; | |
private var _hScrollOn:Boolean = true; | |
private var _vScrollOn:Boolean = true; | |
private var _sbControl:SBControl; | |
private var _pageDragger:PageDragger; | |
private var _w:Number; | |
private var _h:Number; | |
private var _wheelControl:ScrollWheelControl; | |
public function StandardScrollPane(){ | |
this._pageDragger = new PageDragger(); | |
addChild(this._pageDragger); | |
addControl(this._pageDragger); | |
this._vSB = new ScrollBar(); | |
addChild(this._vSB); | |
this._hSB = new ScrollBar(); | |
addChild(this._hSB); | |
this._hSB.rotation = -90; | |
this._sbControl = new SBControl(this._vSB, this._hSB); | |
addControl(this._sbControl); | |
this._wheelControl = new ScrollWheelControl(this); | |
addControl(this._wheelControl); | |
} | |
override public function destroy():void{ | |
this._wheelControl.destroy(); | |
this._sbControl.destroy(); | |
this._hSB.destroy(); | |
this._vSB.destroy(); | |
this._vSB = null; | |
this._hSB = null; | |
this._sbControl = null; | |
this._wheelControl = null; | |
super.destroy(); | |
} | |
public function setSize(_arg1:Number, _arg2:Number):void{ | |
this._w = _arg1; | |
this._h = _arg2; | |
var _local3:Number = this._vSB.width; | |
this._hSB.y = _arg2; | |
this._vSB.x = (_arg1 - _local3); | |
this.refresh(); | |
} | |
override public function getWidth():Number{ | |
return (this._w); | |
} | |
override public function getHeight():Number{ | |
return (this._h); | |
} | |
public function refresh(_arg1:Boolean=false):void{ | |
var _local2:Number = this.getWidth(); | |
var _local3:Number = this.getHeight(); | |
var _local4:Number = this._vSB.width; | |
if (this._hScrollOn){ | |
if (scrollArea.getContentBounds().getWidth() > this.getWidth()){ | |
_local3 = (_local3 - _local4); | |
this._hSB.visible = true; | |
} else { | |
this._hSB.visible = false; | |
}; | |
}; | |
if (this._vScrollOn){ | |
if (scrollArea.getContentBounds().getHeight() > this.getHeight()){ | |
_local2 = (_local2 - _local4); | |
if (this._vScrollOn){ | |
this._vSB.visible = true; | |
}; | |
} else { | |
this._vSB.visible = false; | |
}; | |
}; | |
if (this._hScrollOn){ | |
if ((((this._hSB.visible == false)) && ((scrollArea.getContentBounds().getWidth() > _local2)))){ | |
_local3 = (_local3 - _local4); | |
this._hSB.visible = true; | |
}; | |
}; | |
if (this._vScrollOn){ | |
if ((((this._vSB.visible == false)) && ((scrollArea.getContentBounds().getHeight() > _local3)))){ | |
_local2 = (_local2 - _local4); | |
if (this._vScrollOn){ | |
this._vSB.visible = true; | |
}; | |
}; | |
}; | |
this._vSB.setSize(_local3); | |
this._hSB.setSize(_local2); | |
this._pageDragger.setSize(_local2, _local3); | |
scrollArea.setSize(_local2, _local3); | |
if (!_arg1){ | |
if (canVScroll()){ | |
scrollArea.scrollToY(getCurrentYScroll()); | |
} else { | |
scrollArea.scrollToYPerc(0); | |
}; | |
if (canHScroll()){ | |
scrollArea.scrollToX(getCurrentXScroll()); | |
} else { | |
scrollArea.scrollToXPerc(0); | |
}; | |
}; | |
super.refreshPane(); | |
} | |
override public function refreshPane():void{ | |
this.refresh(false); | |
} | |
public function enableContentDrag():void{ | |
this._pageDragger.enable(); | |
} | |
public function disableContentDrag():void{ | |
this._pageDragger.disable(); | |
} | |
public function isContentDragEnabled():Boolean{ | |
return (this._pageDragger.isEnabled()); | |
} | |
public function hideScrollBars():void{ | |
this._vSB.visible = false; | |
this._hSB.visible = false; | |
} | |
public function turnOffScrollBars():void{ | |
this._vScrollOn = false; | |
this._vSB.visible = false; | |
this.turnOffHScroll(); | |
} | |
public function turnOffHScroll():void{ | |
this._hScrollOn = false; | |
this._hSB.visible = false; | |
} | |
} | |
}//package com.vpg.vpage.components.scrollpane | |
package com.vpg.vpage.components.scrollpane.controls { | |
import flash.display.*; | |
import flash.events.*; | |
import com.vpg.vpage.utils.*; | |
import com.vpg.vpage.components.scrollpane.core.*; | |
import com.vpg.vpage.components.scrollpane.artholders.*; | |
public class PageDragger extends MovieClip implements IScrollControl { | |
private var _bg:MovieClip; | |
private var _lastX:Number; | |
private var _lastY:Number; | |
private var _xPercVisible:Number; | |
private var _yPercVisible:Number; | |
private var _currentXPerc:Number; | |
private var _currentYPerc:Number; | |
private var _enabled:Boolean; | |
private var _cursor:PageDraggerCursor; | |
public function PageDragger(){ | |
this._bg = new Square(0xFF0000, 0); | |
addChild(this._bg); | |
this._cursor = new PageDraggerCursor(); | |
this._cursor.setActiveZone(this._bg); | |
addChild(this._cursor); | |
this.disable(); | |
} | |
public function setSize(_arg1:Number, _arg2:Number):void{ | |
this._bg.width = _arg1; | |
this._bg.height = _arg2; | |
} | |
public function enable():void{ | |
this._bg.addEventListener(MouseEvent.MOUSE_DOWN, this._beginDrag); | |
this._bg.visible = true; | |
this._cursor.enable(); | |
this._enabled = true; | |
} | |
public function disable():void{ | |
this._bg.removeEventListener(MouseEvent.MOUSE_DOWN, this._beginDrag); | |
this._bg.visible = false; | |
this._cursor.disable(); | |
this._enabled = false; | |
} | |
public function setXScroll(_arg1:Number):void{ | |
this._currentXPerc = _arg1; | |
} | |
public function setYScroll(_arg1:Number):void{ | |
this._currentYPerc = _arg1; | |
} | |
public function setXPercVisible(_arg1:Number):void{ | |
this._xPercVisible = _arg1; | |
} | |
public function setYPercVisible(_arg1:Number):void{ | |
this._yPercVisible = _arg1; | |
} | |
public function isEnabled():Boolean{ | |
return (this._enabled); | |
} | |
private function _beginDrag(_arg1:Event):void{ | |
this._lastX = this._cursor.x; | |
this._lastY = this._cursor.y; | |
addEventListener(Event.ENTER_FRAME, this._updateDrag); | |
stage.addEventListener(MouseEvent.MOUSE_UP, this._dragReleased); | |
this._cursor.gotoAndPlay("dragging"); | |
} | |
private function _updateDrag(_arg1:Event):void{ | |
var _local2:Number = (this._lastX - this._cursor.x); | |
var _local3:Number = (this._lastY - this._cursor.y); | |
this._lastX = this._cursor.x; | |
this._lastY = this._cursor.y; | |
var _local4:Number = (this._bg.width + (this._bg.width * (1 - this._xPercVisible))); | |
var _local5:Number = (this._bg.height + (this._bg.height * (1 - this._yPercVisible))); | |
var _local6:Number = (this._currentXPerc + (_local2 / _local4)); | |
var _local7:Number = (this._currentYPerc + (_local3 / _local5)); | |
if (this._xPercVisible < 1){ | |
dispatchEvent(new EventWithParam(ScrollPaneControlEvent.SCROLL_TO_X, _local6)); | |
}; | |
if (this._yPercVisible < 1){ | |
dispatchEvent(new EventWithParam(ScrollPaneControlEvent.SCROLL_TO_Y, _local7)); | |
}; | |
} | |
private function _dragReleased(_arg1:Event):void{ | |
stage.removeEventListener(MouseEvent.MOUSE_UP, this._dragReleased); | |
removeEventListener(Event.ENTER_FRAME, this._updateDrag); | |
this._updateDrag(null); | |
this._cursor.gotoAndPlay("normal"); | |
} | |
} | |
}//package com.vpg.vpage.components.scrollpane.controls | |
package com.vpg.vpage.components.scrollpane.controls { | |
import flash.display.*; | |
import flash.events.*; | |
import com.vpg.vpage.utils.*; | |
import com.vpg.vpage.components.scrollpane.core.*; | |
public class ScrollWheelControl extends EventDispatcher implements IScrollControl { | |
private var _area:Sprite; | |
private var _yPerc:Number; | |
public function ScrollWheelControl(_arg1:Sprite){ | |
this._area = _arg1; | |
this._area.addEventListener(MouseEvent.MOUSE_WHEEL, this._doMouseWheel); | |
} | |
public function destroy():void{ | |
this._area.removeEventListener(MouseEvent.MOUSE_WHEEL, this._doMouseWheel); | |
this._area = null; | |
} | |
public function setXScroll(_arg1:Number):void{ | |
} | |
public function setYScroll(_arg1:Number):void{ | |
this._yPerc = _arg1; | |
} | |
public function setXPercVisible(_arg1:Number):void{ | |
} | |
public function setYPercVisible(_arg1:Number):void{ | |
} | |
private function _doMouseWheel(_arg1:MouseEvent):void{ | |
var _local2:Number; | |
var _local3:Number; | |
var _local4:Number; | |
if (this._area.hitTestPoint(this._area.stage.mouseX, this._area.stage.mouseY)){ | |
_local2 = this._yPerc; | |
_local3 = (0.05 * _arg1.delta); | |
_local4 = (_local2 - _local3); | |
this.dispatchEvent(new EventWithParam(ScrollPaneControlEvent.SCROLL_TO_Y, _local4)); | |
}; | |
} | |
} | |
}//package com.vpg.vpage.components.scrollpane.controls | |
package com.vpg.vpage.components.scrollpane.controls { | |
import flash.events.*; | |
import com.vpg.vpage.utils.*; | |
import com.vpg.vpage.components.scrollbar.*; | |
import com.vpg.vpage.components.scrollpane.core.*; | |
public class SBControl extends EventDispatcher implements IScrollControl { | |
private var _vSB:ScrollBar; | |
private var _hSB:ScrollBar; | |
public function SBControl(_arg1:ScrollBar, _arg2:ScrollBar){ | |
this._vSB = _arg1; | |
this._hSB = _arg2; | |
this._setUpVertListeners(this._vSB); | |
this._setUpHorizListeners(this._hSB); | |
} | |
public function destroy():void{ | |
this._vSB.addEventListener(ScrollBar.UP, this._scrollUpEvent); | |
this._vSB.addEventListener(ScrollBar.DOWN, this._scrollDownEvent); | |
this._vSB.addEventListener(ScrollBar.SCROLLTO, this._scrollToYEvent); | |
this._hSB.addEventListener(ScrollBar.UP, this._scrollLeftEvent); | |
this._hSB.addEventListener(ScrollBar.DOWN, this._scrollRightEvent); | |
this._hSB.addEventListener(ScrollBar.SCROLLTO, this._scrollToXEvent); | |
this._vSB = null; | |
this._hSB = null; | |
} | |
public function setXScroll(_arg1:Number):void{ | |
this._hSB.setScroll(_arg1); | |
} | |
public function setYScroll(_arg1:Number):void{ | |
this._vSB.setScroll(_arg1); | |
} | |
public function setXPercVisible(_arg1:Number):void{ | |
this._hSB.setViewSize(_arg1); | |
} | |
public function setYPercVisible(_arg1:Number):void{ | |
this._vSB.setViewSize(_arg1); | |
} | |
private function _setUpVertListeners(_arg1:ScrollBar):void{ | |
_arg1.addEventListener(ScrollBar.UP, this._scrollUpEvent); | |
_arg1.addEventListener(ScrollBar.DOWN, this._scrollDownEvent); | |
_arg1.addEventListener(ScrollBar.SCROLLTO, this._scrollToYEvent); | |
} | |
private function _setUpHorizListeners(_arg1:ScrollBar):void{ | |
_arg1.addEventListener(ScrollBar.UP, this._scrollLeftEvent); | |
_arg1.addEventListener(ScrollBar.DOWN, this._scrollRightEvent); | |
_arg1.addEventListener(ScrollBar.SCROLLTO, this._scrollToXEvent); | |
} | |
private function _scrollUpEvent(_arg1:Event):void{ | |
dispatchEvent(new Event(ScrollPaneControlEvent.UP)); | |
} | |
private function _scrollDownEvent(_arg1:Event):void{ | |
dispatchEvent(new Event(ScrollPaneControlEvent.DOWN)); | |
} | |
private function _scrollLeftEvent(_arg1:Event):void{ | |
dispatchEvent(new Event(ScrollPaneControlEvent.LEFT)); | |
} | |
private function _scrollRightEvent(_arg1:Event):void{ | |
dispatchEvent(new Event(ScrollPaneControlEvent.RIGHT)); | |
} | |
private function _scrollToYEvent(_arg1:EventWithParam):void{ | |
var _local2:Number = (_arg1.param as Number); | |
dispatchEvent(new EventWithParam(ScrollPaneControlEvent.SCROLL_TO_Y, _local2)); | |
} | |
private function _scrollToXEvent(_arg1:EventWithParam):void{ | |
var _local2:Number = (_arg1.param as Number); | |
dispatchEvent(new EventWithParam(ScrollPaneControlEvent.SCROLL_TO_X, _local2)); | |
} | |
} | |
}//package com.vpg.vpage.components.scrollpane.controls | |
package com.vpg.vpage.components.scrollpane.core { | |
import flash.display.*; | |
import com.vpg.vpage.utils.*; | |
public class ScrollArea extends Sprite { | |
private var _maskArea:Sprite; | |
private var _content:Sprite; | |
private var _innerContent:Sprite; | |
private var _bounds:ContentBounds; | |
private var _w:Number; | |
private var _h:Number; | |
public function ScrollArea(){ | |
this._content = new Sprite(); | |
addChild(this._content); | |
this._maskArea = new Square(); | |
addChild(this._maskArea); | |
this._content.mask = this._maskArea; | |
this.clearContent(); | |
} | |
public function destroy():void{ | |
this._bounds.destroy(); | |
this._bounds = null; | |
this._maskArea = null; | |
this._content = null; | |
this._innerContent = null; | |
} | |
public function getContentBounds():ContentBounds{ | |
return (this._bounds); | |
} | |
public function setSize(_arg1:Number, _arg2:Number):void{ | |
this._maskArea.width = _arg1; | |
this._maskArea.height = _arg2; | |
this._w = _arg1; | |
this._h = _arg2; | |
} | |
public function getWidth():Number{ | |
return (this._w); | |
} | |
public function getHeight():Number{ | |
return (this._h); | |
} | |
public function clearContent():void{ | |
if (this._innerContent){ | |
if (this._innerContent.parent){ | |
this._innerContent.parent.removeChild(this._innerContent); | |
}; | |
}; | |
this._innerContent = new Sprite(); | |
this._content.addChild(this._innerContent); | |
this._bounds = new ContentBounds(this._innerContent, this._content); | |
} | |
public function getContentLayer():Sprite{ | |
return (this._innerContent); | |
} | |
public function scrollToX(_arg1:Number, _arg2:Boolean=false):Number{ | |
var _local4:Number; | |
var _local3:Number = this.getMinXScroll(); | |
if (_arg2){ | |
_local4 = -(_arg1); | |
} else { | |
if (_arg1 <= _local3){ | |
_local4 = -(_local3); | |
} else { | |
if (_arg1 >= this.getMaxXScroll()){ | |
_local4 = -(this.getMaxXScroll()); | |
} else { | |
_local4 = -(_arg1); | |
}; | |
}; | |
}; | |
this._content.x = _local4; | |
return (-(this._content.x)); | |
} | |
public function scrollToY(_arg1:Number, _arg2:Boolean=false):Number{ | |
var _local4:Number; | |
var _local3:Number = this.getMinYScroll(); | |
if (_arg2){ | |
_local4 = -(_arg1); | |
} else { | |
if (_arg1 <= _local3){ | |
_local4 = -(_local3); | |
} else { | |
if (_arg1 >= this.getMaxYScroll()){ | |
_local4 = -(this.getMaxYScroll()); | |
} else { | |
_local4 = -(_arg1); | |
}; | |
}; | |
}; | |
this._content.y = _local4; | |
return (-(this._content.y)); | |
} | |
public function scrollToXPerc(_arg1:Number):Number{ | |
var _local3:Number; | |
var _local2:Number = this._bounds.getWidth(); | |
if (_local2 > 0){ | |
_local3 = (this.getMinXScroll() + (_local2 * _arg1)); | |
_local3 = this.scrollToX(_local3); | |
return (((_local3 - this.getMinXScroll()) / _local2)); | |
}; | |
return (0); | |
} | |
public function scrollToYPerc(_arg1:Number):Number{ | |
var _local3:Number; | |
var _local2:Number = this._bounds.getHeight(); | |
if (_local2 > 0){ | |
_local3 = (this.getMinYScroll() + (_local2 * _arg1)); | |
_local3 = this.scrollToY(_local3); | |
return (((_local3 - this.getMinYScroll()) / _local2)); | |
}; | |
return (0); | |
} | |
public function getXPercentageVisible():Number{ | |
return (Math.min(1, (this._maskArea.width / this._bounds.getWidth()))); | |
} | |
public function getYPercentageVisible():Number{ | |
return (Math.min(1, (this._maskArea.height / this._bounds.getHeight()))); | |
} | |
public function getMaxXScroll():Number{ | |
var _local1:Object = this._bounds.getRectObj(); | |
if ((_local1.xMax - _local1.xMin) > this._maskArea.width){ | |
return ((_local1.xMax - this._maskArea.width)); | |
}; | |
return (_local1.xMin); | |
} | |
public function getMaxYScroll():Number{ | |
var _local1:Object = this._bounds.getRectObj(); | |
if ((_local1.yMax - _local1.yMin) > this._maskArea.height){ | |
return ((_local1.yMax - this._maskArea.height)); | |
}; | |
return (_local1.yMin); | |
} | |
public function getMinXScroll():Number{ | |
return (this._bounds.getXMin()); | |
} | |
public function getMinYScroll():Number{ | |
return (this._bounds.getYMin()); | |
} | |
public function getCurrentXScroll():Number{ | |
return (-(this._content.x)); | |
} | |
public function getCurrentYScroll():Number{ | |
return (-(this._content.y)); | |
} | |
public function getCurrentXScrollPerc():Number{ | |
var _local1:Number = this._bounds.getWidth(); | |
return (((this.getCurrentXScroll() - this.getMinXScroll()) / _local1)); | |
} | |
public function getCurrentYScrollPerc():Number{ | |
var _local1:Number = this._bounds.getHeight(); | |
return (((this.getCurrentYScroll() - this.getMinYScroll()) / _local1)); | |
} | |
} | |
}//package com.vpg.vpage.components.scrollpane.core | |
package com.vpg.vpage.components.scrollpane.core { | |
import flash.display.*; | |
import flash.events.*; | |
import com.vpg.vpage.utils.*; | |
public class AbstractScrollPane extends Sprite { | |
private static const DEFAULT_SCROLL_DELTA:Number = 20; | |
private var _controls:Array; | |
protected var scrollArea:ScrollArea; | |
public function AbstractScrollPane(){ | |
this._controls = new Array(); | |
this.scrollArea = new ScrollArea(); | |
addChild(this.scrollArea); | |
} | |
public function getContentBounds():ContentBounds{ | |
return (this.scrollArea.getContentBounds()); | |
} | |
public function destroy():void{ | |
this.scrollArea.destroy(); | |
var _local1:int; | |
while (_local1 < this._controls.length) { | |
this.removeControl(this._controls[_local1]); | |
this._controls[_local1] = null; | |
_local1++; | |
}; | |
this._controls = null; | |
removeChild(this.scrollArea); | |
this.scrollArea = null; | |
} | |
public function addControl(_arg1:IScrollControl):void{ | |
_arg1.addEventListener(ScrollPaneControlEvent.UP, this._scrollUp); | |
_arg1.addEventListener(ScrollPaneControlEvent.DOWN, this._scrollDown); | |
_arg1.addEventListener(ScrollPaneControlEvent.LEFT, this._scrollLeft); | |
_arg1.addEventListener(ScrollPaneControlEvent.RIGHT, this._scrollRight); | |
_arg1.addEventListener(ScrollPaneControlEvent.SCROLL_TO_X, this._scrollToXEvent); | |
_arg1.addEventListener(ScrollPaneControlEvent.SCROLL_TO_Y, this._scrollToYEvent); | |
this._controls.push(_arg1); | |
} | |
public function removeControl(_arg1:IScrollControl):void{ | |
_arg1.removeEventListener(ScrollPaneControlEvent.UP, this._scrollUp); | |
_arg1.removeEventListener(ScrollPaneControlEvent.DOWN, this._scrollDown); | |
_arg1.removeEventListener(ScrollPaneControlEvent.LEFT, this._scrollLeft); | |
_arg1.removeEventListener(ScrollPaneControlEvent.RIGHT, this._scrollRight); | |
_arg1.removeEventListener(ScrollPaneControlEvent.SCROLL_TO_X, this._scrollToXEvent); | |
_arg1.removeEventListener(ScrollPaneControlEvent.SCROLL_TO_Y, this._scrollToYEvent); | |
var _local2:Number = this._controls.indexOf(_arg1); | |
this._controls.splice(_local2, 1); | |
} | |
public function refreshPane():void{ | |
var _local2:IScrollControl; | |
var _local1:Number = 0; | |
while (_local1 < this._controls.length) { | |
_local2 = IScrollControl(this._controls[_local1]); | |
_local2.setXPercVisible(this.scrollArea.getXPercentageVisible()); | |
_local2.setYPercVisible(this.scrollArea.getYPercentageVisible()); | |
_local1++; | |
}; | |
} | |
public function scrollToX(_arg1:Number, _arg2:Boolean=false):Number{ | |
var _local6:IScrollControl; | |
_arg1 = this.scrollArea.scrollToX(_arg1, _arg2); | |
var _local3:Number = this.scrollArea.getContentBounds().getWidth(); | |
_arg1 = (_arg1 - this.scrollArea.getMinXScroll()); | |
var _local4:Number = (_arg1 / _local3); | |
var _local5:Number = 0; | |
while (_local5 < this._controls.length) { | |
_local6 = IScrollControl(this._controls[_local5]); | |
_local6.setXScroll(_local4); | |
_local5++; | |
}; | |
return (_arg1); | |
} | |
public function scrollToY(_arg1:Number, _arg2:Boolean=false):Number{ | |
var _local6:IScrollControl; | |
_arg1 = this.scrollArea.scrollToY(_arg1, _arg2); | |
var _local3:Number = this.scrollArea.getContentBounds().getHeight(); | |
_arg1 = (_arg1 - this.scrollArea.getMinYScroll()); | |
var _local4:Number = (_arg1 / _local3); | |
var _local5:Number = 0; | |
while (_local5 < this._controls.length) { | |
_local6 = IScrollControl(this._controls[_local5]); | |
_local6.setYScroll(_local4); | |
_local5++; | |
}; | |
return (_arg1); | |
} | |
public function scrollToXPerc(_arg1:Number):Number{ | |
var _local3:IScrollControl; | |
_arg1 = this.scrollArea.scrollToXPerc(_arg1); | |
var _local2:Number = 0; | |
while (_local2 < this._controls.length) { | |
_local3 = IScrollControl(this._controls[_local2]); | |
_local3.setXScroll(_arg1); | |
_local2++; | |
}; | |
return (_arg1); | |
} | |
public function scrollToYPerc(_arg1:Number):Number{ | |
var _local3:IScrollControl; | |
_arg1 = this.scrollArea.scrollToYPerc(_arg1); | |
var _local2:Number = 0; | |
while (_local2 < this._controls.length) { | |
_local3 = IScrollControl(this._controls[_local2]); | |
_local3.setYScroll(_arg1); | |
_local2++; | |
}; | |
return (_arg1); | |
} | |
public function getMinXScroll():Number{ | |
return (this.scrollArea.getMinXScroll()); | |
} | |
public function getMaxXScroll():Number{ | |
return (this.scrollArea.getMaxXScroll()); | |
} | |
public function getMinYScroll():Number{ | |
return (this.scrollArea.getMinYScroll()); | |
} | |
public function getMaxYScroll():Number{ | |
return (this.scrollArea.getMaxYScroll()); | |
} | |
public function getContentLayer():Sprite{ | |
return (this.scrollArea.getContentLayer()); | |
} | |
public function clearContent():void{ | |
this.scrollArea.clearContent(); | |
} | |
public function getCurrentXScroll():Number{ | |
return (this.scrollArea.getCurrentXScroll()); | |
} | |
public function getCurrentYScroll():Number{ | |
return (this.scrollArea.getCurrentYScroll()); | |
} | |
public function getCurrentXScrollPerc():Number{ | |
return (this.scrollArea.getCurrentXScrollPerc()); | |
} | |
public function getCurrentYScrollPerc():Number{ | |
return (this.scrollArea.getCurrentYScrollPerc()); | |
} | |
public function canVScroll():Boolean{ | |
if (this.scrollArea.getYPercentageVisible() < 1){ | |
return (true); | |
}; | |
return (false); | |
} | |
public function canHScroll():Boolean{ | |
if (this.scrollArea.getXPercentageVisible() < 1){ | |
return (true); | |
}; | |
return (false); | |
} | |
public function getScrollAreaWidth():Number{ | |
return (this.scrollArea.getWidth()); | |
} | |
public function getScrollAreaHeight():Number{ | |
return (this.scrollArea.getHeight()); | |
} | |
public function getWidth():Number{ | |
return (this.scrollArea.getWidth()); | |
} | |
public function getHeight():Number{ | |
return (this.scrollArea.getHeight()); | |
} | |
private function _getXScrollDelta():Number{ | |
return (DEFAULT_SCROLL_DELTA); | |
} | |
private function _getYScrollDelta():Number{ | |
return (DEFAULT_SCROLL_DELTA); | |
} | |
private function _scrollUp(_arg1:Event):void{ | |
var _local2:Number = this.scrollArea.getCurrentYScroll(); | |
var _local3:Number = this._getYScrollDelta(); | |
this.scrollToY((_local2 - _local3)); | |
} | |
private function _scrollDown(_arg1:Event):void{ | |
var _local2:Number = this.scrollArea.getCurrentYScroll(); | |
var _local3:Number = this._getYScrollDelta(); | |
this.scrollToY((_local2 + _local3)); | |
} | |
private function _scrollLeft(_arg1:Event):void{ | |
var _local2:Number = this.scrollArea.getCurrentXScroll(); | |
var _local3:Number = this._getXScrollDelta(); | |
this.scrollToX((_local2 - _local3)); | |
} | |
private function _scrollRight(_arg1:Event):void{ | |
var _local2:Number = this.scrollArea.getCurrentXScroll(); | |
var _local3:Number = this._getXScrollDelta(); | |
this.scrollToX((_local2 + _local3)); | |
} | |
private function _scrollToXEvent(_arg1:EventWithParam):void{ | |
this.scrollToXPerc((_arg1.param as Number)); | |
} | |
private function _scrollToYEvent(_arg1:EventWithParam):void{ | |
this.scrollToYPerc((_arg1.param as Number)); | |
} | |
} | |
}//package com.vpg.vpage.components.scrollpane.core | |
package com.vpg.vpage.components.scrollpane.core { | |
import flash.events.*; | |
public interface IScrollControl extends IEventDispatcher { | |
function setXScroll(_arg1:Number):void; | |
function setYScroll(_arg1:Number):void; | |
function setXPercVisible(_arg1:Number):void; | |
function setYPercVisible(_arg1:Number):void; | |
} | |
}//package com.vpg.vpage.components.scrollpane.core | |
package com.vpg.vpage.components.scrollpane.core { | |
public class ScrollPaneControlEvent { | |
public static const UP:String = "scrollUp"; | |
public static const DOWN:String = "scrollDown"; | |
public static const LEFT:String = "scrollLeft"; | |
public static const RIGHT:String = "scrollRight"; | |
public static const SCROLL_TO_X:String = "scrollToX"; | |
public static const SCROLL_TO_Y:String = "scrollToY"; | |
} | |
}//package com.vpg.vpage.components.scrollpane.core | |
package com.vpg.vpage.components.scrollpane.core { | |
import flash.display.*; | |
import flash.geom.*; | |
public class ContentBounds { | |
private var _mc:Sprite; | |
private var _context:Sprite; | |
public function ContentBounds(_arg1:Sprite, _arg2:Sprite){ | |
this._mc = _arg1; | |
this._context = _arg2; | |
} | |
public function destroy():void{ | |
this._mc = null; | |
this._context = null; | |
} | |
public function getWidth(_arg1:Sprite=null):Number{ | |
var _local2:Object = this.getRectObj(_arg1); | |
return ((_local2.xMax - _local2.xMin)); | |
} | |
public function getHeight(_arg1:Sprite=null):Number{ | |
var _local2:Object = this.getRectObj(_arg1); | |
return ((_local2.yMax - _local2.yMin)); | |
} | |
public function getRectObj(_arg1:Sprite=null):Object{ | |
var _local4:Point; | |
var _local5:Point; | |
var _local6:Object; | |
var _local7:Rectangle; | |
var _local8:Object; | |
var _local2:Sprite = this._context; | |
if (_arg1){ | |
_local2 = _arg1; | |
}; | |
var _local3:DisplayObject = this._mc.getChildByName("size_mc"); | |
if (_local3){ | |
_local4 = new Point(_local3.x, _local3.y); | |
_local4 = this._mc.localToGlobal(_local4); | |
_local4 = _local2.globalToLocal(_local4); | |
_local5 = new Point((_local3.x + _local3.width), (_local3.y + _local3.height)); | |
_local5 = this._mc.localToGlobal(_local5); | |
_local5 = _local2.globalToLocal(_local5); | |
_local6 = new Object(); | |
_local6.xMin = _local4.x; | |
_local6.xMax = _local5.x; | |
_local6.yMin = _local4.y; | |
_local6.yMax = _local5.y; | |
return (_local6); | |
}; | |
_local7 = this._mc.getRect(_local2); | |
_local8 = new Object(); | |
_local8.xMin = _local7.left; | |
_local8.xMax = _local7.right; | |
_local8.yMin = _local7.top; | |
_local8.yMax = _local7.bottom; | |
return (_local8); | |
} | |
public function getXMin(_arg1:Sprite=null):Number{ | |
var _local2:Object = this.getRectObj(_arg1); | |
return (_local2.xMin); | |
} | |
public function getXMax(_arg1:Sprite=null):Number{ | |
var _local2:Object = this.getRectObj(_arg1); | |
return (_local2.xMax); | |
} | |
public function getYMin(_arg1:Sprite=null):Number{ | |
var _local2:Object = this.getRectObj(_arg1); | |
return (_local2.yMin); | |
} | |
public function getYMax(_arg1:Sprite=null):Number{ | |
var _local2:Object = this.getRectObj(_arg1); | |
return (_local2.yMax); | |
} | |
public function toString():String{ | |
var _local1:Object = this.getRectObj(); | |
var _local2:Array = new Array(_local1.xMin, _local1.xMax, _local1.yMin, _local1.yMax); | |
return (_local2.join(" ")); | |
} | |
} | |
}//package com.vpg.vpage.components.scrollpane.core | |
package com.vpg.vpage.components.scrollpane.tools.zoom { | |
import flash.display.*; | |
import com.vpg.vpage.components.scrollpane.core.*; | |
public class Zoomer extends Sprite { | |
private var _sp:AbstractScrollPane; | |
private var _rectZoomer:RectZoomer; | |
private var _centerVertically:Boolean; | |
private var _isZoomedToRect:Boolean; | |
private var _isFitToWidth:Boolean; | |
private var _isFitToHeight:Boolean; | |
private var _isFitToScreen:Boolean; | |
public function Zoomer(_arg1:AbstractScrollPane, _arg2:Number, _arg3:Number){ | |
this._rectZoomer = new RectZoomer(_arg2, _arg3); | |
addChild(this._rectZoomer); | |
this._rectZoomer.addEventListener(ZoomToRectEvent.ZOOM, this.onZoomToRect); | |
this._sp = _arg1; | |
this._centerVertically = true; | |
this._isZoomedToRect = false; | |
} | |
public function destroy():void{ | |
this._rectZoomer.removeEventListener(ZoomToRectEvent.ZOOM, this.onZoomToRect); | |
this._rectZoomer.destroy(); | |
this._sp = null; | |
this._rectZoomer = null; | |
} | |
public function setCenterVertically(_arg1:Boolean):void{ | |
this._centerVertically = _arg1; | |
} | |
public function lockZoomBoxDimensions():void{ | |
this._rectZoomer.lockZoomBoxDimensions(); | |
} | |
public function refresh():void{ | |
if (this.isFitToScreen()){ | |
this.fitScreen(); | |
} else { | |
if (this.isFitToWidth()){ | |
this.fitToWidth(); | |
} else { | |
if (this.isFitToHeight()){ | |
this.fitToHeight(); | |
} else { | |
this.setMagnification(this.getMagnification()); | |
}; | |
}; | |
}; | |
} | |
public function setMagnification(_arg1:Number):void{ | |
var _local2:Sprite = this._sp.getContentLayer(); | |
if (this._sp.getContentBounds().getWidth() == 0){ | |
_local2.visible = false; | |
} else { | |
_local2.visible = true; | |
}; | |
var _local3:Number = this._sp.getCurrentXScrollPerc(); | |
var _local4:Number = this._sp.getCurrentYScrollPerc(); | |
_local2.scaleX = (_local2.scaleY = _arg1); | |
_local2.x = (_local2.y = 0); | |
this._sp.refreshPane(); | |
if (this._sp.canHScroll()){ | |
this._sp.scrollToXPerc(_local3); | |
} else { | |
this._sp.scrollToXPerc(0); | |
_local2.x = (_local2.x + ((this._sp.getScrollAreaWidth() / 2) - (this._sp.getContentBounds().getWidth() / 2))); | |
}; | |
if (this._sp.canVScroll()){ | |
this._sp.scrollToYPerc(_local4); | |
} else { | |
this._sp.scrollToYPerc(0); | |
if (this._centerVertically){ | |
_local2.y = (_local2.y + ((this._sp.getScrollAreaHeight() / 2) - (this._sp.getContentBounds().getHeight() / 2))); | |
}; | |
}; | |
this._rectZoomer.setSize(this._sp.getScrollAreaWidth(), this._sp.getScrollAreaHeight()); | |
this._clearZoomFlags(); | |
} | |
public function getMagnification():Number{ | |
return (this._sp.getContentLayer().scaleX); | |
} | |
public function onZoomToRect(_arg1:ZoomToRectEvent):void{ | |
var _local2:Number = (this.getMagnification() / 100); | |
var _local3:Number = ((this._sp.getScrollAreaWidth() / _arg1.w) * _local2); | |
var _local4:Number = ((this._sp.getScrollAreaHeight() / _arg1.h) * _local2); | |
var _local5:Number = Math.min(_local3, _local4); | |
var _local6:Number = this._sp.getCurrentXScrollPerc(); | |
var _local7:Number = this._sp.getCurrentYScrollPerc(); | |
var _local8:Number = (_local6 + (_arg1.x / this._sp.getContentBounds().getWidth())); | |
var _local9:Number = (_local7 + (_arg1.y / this._sp.getContentBounds().getHeight())); | |
this.setMagnification((_local5 * 100)); | |
this._sp.scrollToXPerc(_local8); | |
this._sp.scrollToYPerc(_local9); | |
this._clearZoomFlags(); | |
this._isZoomedToRect = true; | |
dispatchEvent(_arg1); | |
} | |
public function enable():void{ | |
this._rectZoomer.enable(); | |
} | |
public function disable():void{ | |
this._rectZoomer.disable(); | |
} | |
public function isRectZoomerEnabled():Boolean{ | |
return (this._rectZoomer.isEnabled()); | |
} | |
public function fitToHeight():Number{ | |
var _local1:Number = this._sp.getHeight(); | |
var _local2:ContentBounds = this._sp.getContentBounds(); | |
var _local3:Number = (_local2.getHeight() / (this.getMagnification() / 100)); | |
var _local4:Number = ((_local1 / _local3) * 100); | |
_local4 = Math.floor((_local4 * 100)); | |
_local4 = (_local4 / 100); | |
this.setMagnification(_local4); | |
if (this._sp.canHScroll()){ | |
_local4 = ((this._sp.getScrollAreaHeight() / _local3) * 100); | |
_local4 = Math.floor((_local4 * 100)); | |
_local4 = (_local4 / 100); | |
this.setMagnification(_local4); | |
if (!this._sp.canHScroll()){ | |
_local4 = this.fitToWidth(); | |
}; | |
}; | |
this._clearZoomFlags(); | |
this._isFitToHeight = true; | |
return (_local4); | |
} | |
public function fitToWidth():Number{ | |
var _local1:Number = this._sp.getWidth(); | |
var _local2:ContentBounds = this._sp.getContentBounds(); | |
var _local3:Number = (_local2.getWidth() / (this.getMagnification() / 100)); | |
var _local4:Number = ((_local1 / _local3) * 100); | |
_local4 = Math.floor((_local4 * 100)); | |
_local4 = (_local4 / 100); | |
this.setMagnification(_local4); | |
if (this._sp.canVScroll()){ | |
_local4 = ((this._sp.getScrollAreaWidth() / _local3) * 100); | |
_local4 = Math.floor((_local4 * 100)); | |
_local4 = (_local4 / 100); | |
this.setMagnification(_local4); | |
if (!this._sp.canVScroll()){ | |
_local4 = this.fitToHeight(); | |
}; | |
}; | |
this._clearZoomFlags(); | |
this._isFitToWidth = true; | |
return (_local4); | |
} | |
public function fitScreen():Number{ | |
var _local7:Number; | |
var _local8:Number; | |
var _local1:Number = this._sp.getHeight(); | |
var _local2:Number = this._sp.getWidth(); | |
var _local3:ContentBounds = this._sp.getContentBounds(); | |
var _local4:Number = (_local3.getWidth() / (this.getMagnification() / 100)); | |
var _local5:Number = (_local3.getHeight() / (this.getMagnification() / 100)); | |
var _local6:Number = 100; | |
if ((((_local4 > 0)) && ((_local5 > 0)))){ | |
_local7 = (_local2 / _local4); | |
_local8 = (_local1 / _local5); | |
if (_local7 < _local8){ | |
_local6 = this.fitToWidth(); | |
} else { | |
_local6 = this.fitToHeight(); | |
}; | |
} else { | |
_local6 = 100; | |
}; | |
this._clearZoomFlags(); | |
this._isFitToScreen = true; | |
return (_local6); | |
} | |
public function isFitToWidth():Boolean{ | |
return (this._isFitToWidth); | |
} | |
public function isFitToHeight():Boolean{ | |
return (this._isFitToHeight); | |
} | |
public function isFitToScreen():Boolean{ | |
return (this._isFitToScreen); | |
} | |
public function isZoomedToRect():Boolean{ | |
return (this._isZoomedToRect); | |
} | |
public function getFitScreenMagnification():Number{ | |
var _local1:Boolean = this.isFitToWidth(); | |
var _local2:Boolean = this.isFitToHeight(); | |
var _local3:Boolean = this.isFitToScreen(); | |
var _local4:Boolean = this.isZoomedToRect(); | |
var _local5:Number = this.getMagnification(); | |
this.fitScreen(); | |
var _local6:Number = this.getMagnification(); | |
if (_local3){ | |
this.fitScreen(); | |
} else { | |
if (_local1){ | |
this.fitToWidth(); | |
} else { | |
if (_local2){ | |
this.fitToHeight(); | |
} else { | |
this.setMagnification(_local5); | |
if (_local4){ | |
this._isZoomedToRect = true; | |
}; | |
}; | |
}; | |
}; | |
return (_local6); | |
} | |
private function _clearZoomFlags():void{ | |
this._isZoomedToRect = false; | |
this._isFitToScreen = false; | |
this._isFitToHeight = false; | |
this._isFitToWidth = false; | |
} | |
} | |
}//package com.vpg.vpage.components.scrollpane.tools.zoom | |
package com.vpg.vpage.components.scrollpane.tools.zoom { | |
import flash.events.*; | |
public class ZoomToRectEvent extends Event { | |
public static const ZOOM:String = "zoomToRectEvent"; | |
public var x:Number; | |
public var y:Number; | |
public var w:Number; | |
public var h:Number; | |
public function ZoomToRectEvent(_arg1:String, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Boolean=false, _arg7:Boolean=false){ | |
this.x = _arg2; | |
this.y = _arg3; | |
this.w = _arg4; | |
this.h = _arg5; | |
super(_arg1, _arg6, _arg7); | |
} | |
override public function clone():Event{ | |
return (new ZoomToRectEvent(type, this.x, this.y, this.w, this.h, bubbles, cancelable)); | |
} | |
} | |
}//package com.vpg.vpage.components.scrollpane.tools.zoom | |
package com.vpg.vpage.components.scrollpane.tools.zoom { | |
import flash.display.*; | |
import flash.events.*; | |
import com.vpg.vpage.utils.*; | |
public class RectZoomer extends Sprite { | |
private var _bg:Sprite; | |
private var _cursor:RectZoomerCursor; | |
private var _rectColor:Number; | |
private var _rectAlpha:Number; | |
private var _boxBaseX:Number; | |
private var _boxBaseY:Number; | |
private var _currentBox:Sprite; | |
private var _lockBoxDimensions:Boolean; | |
public function RectZoomer(_arg1:Number=0xFFFF00, _arg2:Number=0.5){ | |
this._rectColor = _arg1; | |
this._rectAlpha = _arg2; | |
this._lockBoxDimensions = false; | |
this._bg = new Square(); | |
this._bg.alpha = 0; | |
this._bg.visible = false; | |
addChild(this._bg); | |
this._cursor = new RectZoomerCursor(); | |
addChild(this._cursor); | |
this._cursor.setActiveZone(this._bg); | |
this.disable(); | |
} | |
public function destroy():void{ | |
this.disable(); | |
this._cursor.destroy(); | |
this._bg = null; | |
this._cursor = null; | |
this._currentBox = null; | |
} | |
public function lockZoomBoxDimensions():void{ | |
this._lockBoxDimensions = true; | |
} | |
public function setSize(_arg1:Number, _arg2:Number):void{ | |
this._bg.width = _arg1; | |
this._bg.height = _arg2; | |
} | |
public function isEnabled():Boolean{ | |
return (this._bg.visible); | |
} | |
public function enable():void{ | |
this._bg.addEventListener(MouseEvent.MOUSE_DOWN, this._startRect); | |
this._bg.visible = true; | |
this._cursor.enable(); | |
} | |
public function disable():void{ | |
this._bg.visible = false; | |
this._bg.removeEventListener(MouseEvent.MOUSE_DOWN, this._startRect); | |
if (stage){ | |
stage.removeEventListener(MouseEvent.MOUSE_UP, this._stopRect); | |
}; | |
removeEventListener(Event.ENTER_FRAME, this._updateBoxFree); | |
removeEventListener(Event.ENTER_FRAME, this._updateBox); | |
this._cursor.disable(); | |
} | |
private function _startRect(_arg1:Event):void{ | |
this._boxBaseX = mouseX; | |
this._boxBaseY = mouseY; | |
this._currentBox = new Square(this._rectColor); | |
this._currentBox.width = 1; | |
this._currentBox.height = 1; | |
this._currentBox.x = mouseX; | |
this._currentBox.y = mouseY; | |
this._currentBox.alpha = this._rectAlpha; | |
this._currentBox.mouseEnabled = false; | |
addChildAt(this._currentBox, (numChildren - 1)); | |
if (this._lockBoxDimensions){ | |
addEventListener(Event.ENTER_FRAME, this._updateBox); | |
} else { | |
addEventListener(Event.ENTER_FRAME, this._updateBoxFree); | |
}; | |
stage.addEventListener(MouseEvent.MOUSE_UP, this._stopRect); | |
} | |
private function _stopRect(_arg1:Event):void{ | |
var _local2:ZoomToRectEvent; | |
removeEventListener(Event.ENTER_FRAME, this._updateBoxFree); | |
removeEventListener(Event.ENTER_FRAME, this._updateBox); | |
if (((this._bg.hitTestPoint(stage.mouseX, stage.mouseY)) && (this._currentBox))){ | |
if ((((this._currentBox.width > 1)) && ((this._currentBox.height > 1)))){ | |
_local2 = new ZoomToRectEvent(ZoomToRectEvent.ZOOM, this._currentBox.x, this._currentBox.y, this._currentBox.width, this._currentBox.height); | |
dispatchEvent(_local2); | |
}; | |
}; | |
if (!this._bg.hitTestPoint(stage.mouseX, stage.mouseY)){ | |
this._cursor.hide(); | |
}; | |
if (this._currentBox){ | |
if (this._currentBox.parent){ | |
removeChild(this._currentBox); | |
}; | |
this._currentBox = null; | |
}; | |
} | |
private function _updateBoxFree(_arg1:Event):void{ | |
if ((mouseX - this._boxBaseX) < 0){ | |
this._currentBox.x = mouseX; | |
}; | |
if ((mouseY - this._boxBaseY) < 0){ | |
this._currentBox.y = mouseY; | |
}; | |
this._currentBox.width = Math.abs((mouseX - this._boxBaseX)); | |
this._currentBox.height = Math.abs((mouseY - this._boxBaseY)); | |
this._fixBox(); | |
} | |
private function _updateBox(_arg1:Event):void{ | |
var _local2:Number = this._currentBox.x; | |
var _local3:Number = this._currentBox.y; | |
var _local4:Number = this._currentBox.width; | |
var _local5:Number = this._currentBox.height; | |
var _local6:Number = (this._bg.width / this._bg.height); | |
var _local7:Number = Math.abs((mouseX - this._boxBaseX)); | |
var _local8:Number = Math.abs((mouseY - this._boxBaseY)); | |
var _local9:Number = (_local7 / _local8); | |
if (_local9 < _local6){ | |
this._currentBox.width = (_local6 * _local8); | |
this._currentBox.height = _local8; | |
} else { | |
if (_local9 > _local6){ | |
this._currentBox.width = _local7; | |
this._currentBox.height = (_local7 / _local6); | |
} else { | |
this._currentBox.width = _local7; | |
this._currentBox.height = _local8; | |
}; | |
}; | |
this._fixBox(); | |
} | |
private function _fixBox():void{ | |
this._fixBoxIteration(); | |
this._fixBoxIteration(); | |
} | |
private function _fixBoxIteration():void{ | |
var _local1:Number; | |
var _local2:Number; | |
var _local3:Number; | |
var _local4:Number; | |
if ((mouseX - this._boxBaseX) < 0){ | |
this._currentBox.x = (this._boxBaseX - this._currentBox.width); | |
if (this._currentBox.x < 0){ | |
_local1 = ((this._currentBox.width + this._currentBox.x) / this._currentBox.width); | |
this._currentBox.width = (this._currentBox.width * _local1); | |
this._currentBox.height = (this._currentBox.height * _local1); | |
this._currentBox.x = 0; | |
}; | |
} else { | |
this._currentBox.x = this._boxBaseX; | |
if ((this._currentBox.x + this._currentBox.width) > this._bg.width){ | |
_local2 = ((this._bg.width - this._currentBox.x) / this._currentBox.width); | |
this._currentBox.width = (this._currentBox.width * _local2); | |
this._currentBox.height = (this._currentBox.height * _local2); | |
}; | |
}; | |
if ((mouseY - this._boxBaseY) < 0){ | |
this._currentBox.y = (this._boxBaseY - this._currentBox.height); | |
if (this._currentBox.y < 0){ | |
_local3 = ((this._currentBox.height + this._currentBox.y) / this._currentBox.height); | |
this._currentBox.width = (this._currentBox.width * _local3); | |
this._currentBox.height = (this._currentBox.height * _local3); | |
this._currentBox.y = 0; | |
}; | |
} else { | |
this._currentBox.y = this._boxBaseY; | |
if ((this._currentBox.y + this._currentBox.height) > this._bg.height){ | |
_local4 = ((this._bg.height - this._currentBox.y) / this._currentBox.height); | |
this._currentBox.width = (this._currentBox.width * _local4); | |
this._currentBox.height = (this._currentBox.height * _local4); | |
}; | |
}; | |
} | |
} | |
}//package com.vpg.vpage.components.scrollpane.tools.zoom | |
package com.vpg.vpage.components.scrollpane.tools.zoom { | |
import com.vpg.vpage.utils.cursor.*; | |
public class RectZoomerCursor extends BasicCursor { | |
} | |
}//package com.vpg.vpage.components.scrollpane.tools.zoom | |
package com.vpg.vpage.components.scrollpane.artholders { | |
import com.vpg.vpage.utils.cursor.*; | |
public class PageDraggerCursor extends BasicCursor { | |
public function PageDraggerCursor(){ | |
addFrameScript(4, this.frame5, 9, this.frame10); | |
} | |
function frame5(){ | |
stop(); | |
} | |
function frame10(){ | |
stop(); | |
} | |
} | |
}//package com.vpg.vpage.components.scrollpane.artholders | |
package com.vpg.vpage.components.textfieldscrollbar { | |
import flash.display.*; | |
import flash.events.*; | |
import flash.text.*; | |
import com.vpg.vpage.utils.*; | |
import com.vpg.vpage.components.scrollbar.*; | |
public class TextFieldScrollBar extends Sprite { | |
private var _tf:TextField; | |
private var _sb:ScrollBar; | |
public function TextFieldScrollBar(_arg1:TextField){ | |
this._tf = _arg1; | |
this._sb = new ScrollBar(); | |
this._sb.addEventListener(ScrollBar.UP, this._scrollUp); | |
this._sb.addEventListener(ScrollBar.DOWN, this._scrollDown); | |
this._sb.addEventListener(ScrollBar.SCROLLTO, this._scrollTo); | |
addChild(this._sb); | |
this._tf.addEventListener(Event.CHANGE, this._updateScrollBar); | |
} | |
public function destroy():void{ | |
this._sb.removeEventListener(ScrollBar.UP, this._scrollUp); | |
this._sb.removeEventListener(ScrollBar.DOWN, this._scrollDown); | |
this._sb.removeEventListener(ScrollBar.SCROLLTO, this._scrollTo); | |
this._tf.removeEventListener(Event.CHANGE, this._updateScrollBar); | |
} | |
public function setSize(_arg1:Number):void{ | |
this._sb.setSize(_arg1); | |
this.refresh(); | |
} | |
public function refresh():void{ | |
if (this._tf.maxScrollV > 1){ | |
this._sb.visible = true; | |
} else { | |
this._sb.visible = false; | |
}; | |
var _local1:Number = (this._tf.maxScrollV + this._tf.numLines); | |
var _local2:Number = (this._tf.numLines / _local1); | |
_local2 = Math.min(1, _local2); | |
this._sb.setViewSize(_local2); | |
} | |
private function _updateScrollBar(_arg1:Event):void{ | |
this.refresh(); | |
} | |
private function _scrollUp(_arg1:Event):void{ | |
var _local2:int = this._tf.scrollV; | |
var _local3:int = (_local2 - 1); | |
_local3 = Math.max(1, _local3); | |
this._tf.scrollV = _local3; | |
} | |
private function _scrollDown(_arg1:Event):void{ | |
var _local2:int = this._tf.scrollV; | |
var _local3:int = (_local2 + 1); | |
_local3 = Math.min(this._tf.maxScrollV, _local3); | |
this._tf.scrollV = _local3; | |
} | |
private function _scrollTo(_arg1:EventWithParam):void{ | |
var _local2:Number = (_arg1.param as Number); | |
var _local3:int = (this._tf.maxScrollV + this._tf.numLines); | |
var _local4:Number = (_local3 * _local2); | |
_local4 = Math.round(_local4); | |
this._tf.scrollV = _local4; | |
} | |
} | |
}//package com.vpg.vpage.components.textfieldscrollbar | |
package com.vpg.vpage.shell.search { | |
public class SearchResults { | |
private var _xmlNode:XML; | |
public function SearchResults(_arg1:XML){ | |
this._xmlNode = _arg1; | |
} | |
public function get status():String{ | |
return (this._xmlNode.@status); | |
} | |
public function get startat():Number{ | |
return (parseInt(this._xmlNode.@startat, 10)); | |
} | |
public function get endat():Number{ | |
return (parseInt(this._xmlNode.@endat, 10)); | |
} | |
public function get hits():Number{ | |
return (parseInt(this._xmlNode.@hits, 10)); | |
} | |
public function get maxresults():Number{ | |
return (parseInt(this._xmlNode.@maxresults, 10)); | |
} | |
public function get bookids():Array{ | |
return ([email protected](",")); | |
} | |
public function get query():String{ | |
return (this._xmlNode.query.text()); | |
} | |
public function get hitsNode():XMLList{ | |
return (this._xmlNode.hits); | |
} | |
public function get message():String{ | |
return (this._xmlNode.message.text()); | |
} | |
public function getHitByPageId(_arg1:String):SearchHit{ | |
var node:* = null; | |
var s:* = _arg1; | |
node = this.hitsNode.hit.(@pageid == s)[0]; | |
return (new SearchHit(node)); | |
} | |
} | |
}//package com.vpg.vpage.shell.search | |
package com.vpg.vpage.shell.search { | |
import flash.events.*; | |
public interface ISearchWindow extends IEventDispatcher { | |
function init(_arg1:String, _arg2:String):void; | |
function searchFor(_arg1:String):void; | |
function setScreenSize(_arg1:Number, _arg2:Number):void; | |
function destroy():void; | |
} | |
}//package com.vpg.vpage.shell.search | |
package com.vpg.vpage.shell.search { | |
import flash.system.*; | |
public class SearchHit { | |
private var _xmlNode:XML; | |
public function SearchHit(_arg1:XML){ | |
this._xmlNode = _arg1; | |
} | |
public function destroy():void{ | |
System.disposeXML(this._xmlNode); | |
this._xmlNode = null; | |
} | |
public function get bookid():String{ | |
return (this._xmlNode.@bookid); | |
} | |
public function get pageid():String{ | |
return (this._xmlNode.@pageid); | |
} | |
public function get title():String{ | |
return (this._xmlNode.title.text()); | |
} | |
public function get snippets():String{ | |
return (this._xmlNode.snippets.text); | |
} | |
public function get snipNode():XML{ | |
return (this._xmlNode.snippets); | |
} | |
public function get snippetTerms():Array{ | |
var _local4:String; | |
var _local1:XMLList = this._xmlNode.snippets; | |
var _local2:XMLList = _local1.B; | |
var _local3:Array = []; | |
var _local5:int; | |
while (_local5 < _local2.length()) { | |
_local4 = String(_local2[_local5]).toLowerCase(); | |
if (_local3.indexOf(_local4) == -1){ | |
_local3.push(_local4); | |
}; | |
_local5++; | |
}; | |
return (_local3); | |
} | |
public function toString():String{ | |
return (this._xmlNode.toString()); | |
} | |
} | |
}//package com.vpg.vpage.shell.search | |
package com.vpg.vpage.shell.search { | |
public class SearchLayerManager { | |
private var _layers:Array; | |
private var _currentHit:SearchHit; | |
public function SearchLayerManager(){ | |
this._layers = new Array(); | |
} | |
public function destroy():void{ | |
this._layers = null; | |
this._currentHit = null; | |
} | |
public function addLayer(_arg1:SearchHiliter):void{ | |
this._layers.push(_arg1); | |
if (this._currentHit){ | |
_arg1.highlightHits(this._currentHit); | |
}; | |
} | |
public function highlightHits(_arg1:SearchHit):void{ | |
var _local2:int; | |
while (_local2 < this._layers.length) { | |
this._layers[_local2].highlightHits(_arg1); | |
_local2++; | |
}; | |
this._currentHit = _arg1; | |
} | |
public function removeAllLayers():void{ | |
var _local1:int; | |
while (_local1 < this._layers.length) { | |
this._layers[_local1].destroy(); | |
_local1++; | |
}; | |
this._layers = new Array(); | |
} | |
public function show():void{ | |
var _local1:int; | |
while (_local1 < this._layers.length) { | |
this._layers[_local1].show(); | |
_local1++; | |
}; | |
} | |
public function hide():void{ | |
var _local1:int; | |
while (_local1 < this._layers.length) { | |
this._layers[_local1].hide(); | |
_local1++; | |
}; | |
} | |
} | |
}//package com.vpg.vpage.shell.search | |
package com.vpg.vpage.shell.search { | |
import flash.events.*; | |
public class SearchHitEvent extends Event { | |
public static const LOAD_SEARCH_HIT:String = "loadSearchHitEvent"; | |
public var hit:SearchHit; | |
public function SearchHitEvent(_arg1:String, _arg2:SearchHit, _arg3:Boolean=false, _arg4:Boolean=false){ | |
this.hit = _arg2; | |
super(_arg1, _arg3, _arg4); | |
} | |
override public function clone():Event{ | |
return (new SearchHitEvent(type, this.hit, bubbles, cancelable)); | |
} | |
override public function toString():String{ | |
return (formatToString("SearchHitEvent", "type", "hit", "bubbles", "cancelable", "eventPhase")); | |
} | |
} | |
}//package com.vpg.vpage.shell.search | |
package com.vpg.vpage.shell.search { | |
import flash.display.*; | |
import flash.geom.*; | |
import flash.net.*; | |
import flash.events.*; | |
import com.vpg.vpage.utils.*; | |
import flash.system.*; | |
public class SearchHiliter extends MovieClip { | |
private var _highlightColor:Number; | |
private var _data:XML; | |
private var _currentHit:SearchHit; | |
public function SearchHiliter(){ | |
mouseChildren = false; | |
} | |
public function destroy():void{ | |
if (this._data){ | |
System.disposeXML(this._data); | |
this._data = null; | |
}; | |
if (this._currentHit){ | |
this._currentHit.destroy(); | |
this._currentHit = null; | |
}; | |
} | |
public function init(_arg1:String, _arg2:Number):void{ | |
this._highlightColor = _arg2; | |
NetU.doFileLoad(_arg1, this._onPageDataLoaded, this._pageDataLoadError); | |
} | |
public function highlightHits(_arg1:SearchHit):void{ | |
this._currentHit = _arg1; | |
graphics.clear(); | |
if (((_arg1) && (this._data))){ | |
this._drawHighlights(); | |
}; | |
} | |
private function _drawHighlights():void{ | |
var _local2:Rectangle; | |
blendMode = BlendMode.DARKEN; | |
var _local1:Array = this._getHiliteRects(); | |
var _local3:* = 0; | |
while (_local3 < _local1.length) { | |
_local2 = _local1[_local3]; | |
graphics.beginFill(this._highlightColor, 1); | |
graphics.drawRect(_local2.x, _local2.y, _local2.width, _local2.height); | |
graphics.endFill(); | |
_local3++; | |
}; | |
} | |
private function _pageDataLoadError(_arg1:Event):void{ | |
dispatchEvent(new Event(Event.COMPLETE)); | |
} | |
private function _onPageDataLoaded(_arg1:Event):void{ | |
var _local2:URLLoader = (_arg1.currentTarget as URLLoader); | |
this._data = new XML(_local2.data); | |
dispatchEvent(new Event(Event.COMPLETE)); | |
if (this._currentHit){ | |
this.highlightHits(this._currentHit); | |
}; | |
} | |
private function _getHiliteRects():Array{ | |
var _local3:Number; | |
var _local4:Number; | |
var _local5:Array; | |
var _local6:Rectangle; | |
var _local7:Boolean; | |
var _local10:XML; | |
var _local1:Array = this._currentHit.snippetTerms; | |
var _local2:Array = []; | |
var _local8:XMLList = this._data.w; | |
var _local9:int; | |
while (_local9 < _local8.length()) { | |
_local10 = _local8[_local9]; | |
_local7 = false; | |
_local3 = 0; | |
while (_local3 < _local1.length) { | |
if (!_local7){ | |
if (_local10.text().toLowerCase().indexOf(_local1[_local3]) != -1){ | |
_local5 = [email protected](" "); | |
_local4 = 0; | |
while (_local4 < 4) { | |
_local5[_local4] = parseFloat(_local5[_local4]); | |
_local4++; | |
}; | |
_local6 = new Rectangle(_local5[0], _local5[1], (_local5[2] - _local5[0]), (_local5[3] - _local5[1])); | |
_local2.push(_local6); | |
_local7 = true; | |
}; | |
}; | |
_local3++; | |
}; | |
_local9++; | |
}; | |
return (_local2); | |
} | |
} | |
}//package com.vpg.vpage.shell.search | |
package com.vpg.vpage.shell.search { | |
import flash.net.*; | |
import flash.events.*; | |
import com.vpg.vpage.utils.*; | |
public class SearchService extends EventDispatcher { | |
public static const RESULTS:String = "searchResultsReady"; | |
public static const ERROR:String = "searchResultsError"; | |
public static const SORT_INDEXORDER:String = "indexorder"; | |
private var _servlet:String; | |
private var _bookid:String; | |
private var _resultsPerPage:int; | |
private var _lastQuery:String; | |
private var _lastStartAt:int; | |
private var _sort:String; | |
public function SearchService(_arg1:String, _arg2:String){ | |
this._servlet = _arg1; | |
this._bookid = _arg2; | |
this._resultsPerPage = 10; | |
this._sort = null; | |
} | |
public function doSearch(_arg1:String):void{ | |
this._execSearch(_arg1, 0); | |
} | |
public function nextPage():void{ | |
var _local1:int; | |
if (this._lastQuery){ | |
_local1 = (this._lastStartAt + this._resultsPerPage); | |
this._execSearch(this._lastQuery, _local1); | |
}; | |
} | |
public function prevPage():void{ | |
var _local1:int; | |
if (this._lastQuery){ | |
_local1 = (this._lastStartAt - this._resultsPerPage); | |
_local1 = Math.max(0, _local1); | |
this._execSearch(this._lastQuery, _local1); | |
}; | |
} | |
public function setResultsPerPage(_arg1:int):void{ | |
this._resultsPerPage = _arg1; | |
} | |
public function setSort(_arg1:String):void{ | |
this._sort = _arg1; | |
} | |
private function _execSearch(_arg1:String, _arg2:int):void{ | |
var _local3:URLRequest = new URLRequest(this._servlet); | |
var _local4:URLLoader = new URLLoader(); | |
var _local5:URLVariables = new URLVariables(); | |
_local4.addEventListener(Event.COMPLETE, this._searchLoadSuccess); | |
_local4.addEventListener(IOErrorEvent.IO_ERROR, this._searchLoadError); | |
_local5.bookids = this._bookid; | |
_local5.query = _arg1; | |
_local5.startat = _arg2; | |
_local5.maxresults = this._resultsPerPage; | |
if (this._sort != null){ | |
_local5.sort = this._sort; | |
}; | |
this._lastQuery = _arg1; | |
this._lastStartAt = _arg2; | |
_local3.data = _local5; | |
_local3.method = URLRequestMethod.POST; | |
_local4.load(_local3); | |
} | |
private function _searchLoadSuccess(_arg1:Event):void{ | |
var _local2:URLLoader = (_arg1.currentTarget as URLLoader); | |
var _local3:XML = new XML(_local2.data); | |
var _local4:SearchResults = new SearchResults(_local3); | |
this._cleanLoader(_local2); | |
dispatchEvent(new EventWithParam(RESULTS, _local4)); | |
} | |
private function _searchLoadError(_arg1:Event):void{ | |
var _local2:URLLoader = (_arg1.currentTarget as URLLoader); | |
this._cleanLoader(_local2); | |
dispatchEvent(new Event(ERROR)); | |
} | |
private function _cleanLoader(_arg1:URLLoader):void{ | |
_arg1.addEventListener(Event.COMPLETE, this._searchLoadSuccess); | |
_arg1.addEventListener(IOErrorEvent.IO_ERROR, this._searchLoadError); | |
} | |
} | |
}//package com.vpg.vpage.shell.search | |
package com.vpg.vpage.shell.savedata { | |
import flash.events.*; | |
public class SaveLoadEvent extends Event { | |
public static const SAVE_SUCCESS:String = "saveSuccessEvent"; | |
public static const SAVE_ERROR:String = "saveErrorEvent"; | |
public static const LOAD_SUCCESS:String = "loadSuccessEvent"; | |
public static const LOAD_ERROR:String = "loadErrorEvent"; | |
public static const GENERIC_ERROR:String = "genericErrorEvent"; | |
public var message:String; | |
public function SaveLoadEvent(_arg1:String, _arg2:String="", _arg3:Boolean=false, _arg4:Boolean=false){ | |
this.message = _arg2; | |
super(_arg1, _arg3, _arg4); | |
} | |
override public function clone():Event{ | |
return (new SaveLoadEvent(type, this.message, bubbles, cancelable)); | |
} | |
override public function toString():String{ | |
return (formatToString("SaveLoadEvent", "type", "message", "bubbles", "cancelable", "eventPhase")); | |
} | |
} | |
}//package com.vpg.vpage.shell.savedata | |
package com.vpg.vpage.shell.savedata { | |
import com.vpg.vpage.shell.*; | |
import flash.events.*; | |
import com.vpg.vpage.shell.datastore.*; | |
public class AbstractBackendConnector extends EventDispatcher implements IBackendConnector { | |
private static const DEFAULT_LOAD_ERROR_MSG:String = "An error occurred when loading your data. Future modifications will not be saved."; | |
private static const DEFAULT_SAVE_ERROR_MSG:String = "An error occurred when saving your data. Your changes were not saved."; | |
private static const DEFAULT_GENERIC_ERROR_MSG:String = "An unexpected error occurred releated to user data saving and loading."; | |
protected var _app:App; | |
public function init(_arg1:App):void{ | |
this._app = _arg1; | |
this._loadUserData(); | |
} | |
public function disconnect():void{ | |
this._app.getDataStore().removeEventListener(GenericDataStoreChangeEvent.CHANGE, this._userDataChanged); | |
} | |
protected function _loadUserData():void{ | |
} | |
protected function _handleDataChange(_arg1:String, _arg2:String, _arg3:String):void{ | |
} | |
protected function _monitorDataStore():void{ | |
this._app.getDataStore().addEventListener(GenericDataStoreChangeEvent.CHANGE, this._userDataChanged); | |
} | |
protected function _userDataChanged(_arg1:GenericDataStoreChangeEvent):void{ | |
if (_arg1.bookid == this._app.getBookID()){ | |
this._handleDataChange(_arg1.page, _arg1.dataType, _arg1.content); | |
}; | |
} | |
protected function _onLoadError(_arg1:String=""):void{ | |
if ((((_arg1 == "")) || ((_arg1 == null)))){ | |
_arg1 = this._getDefaultLoadErrorMessage(); | |
}; | |
dispatchEvent(new SaveLoadEvent(SaveLoadEvent.LOAD_ERROR, _arg1)); | |
} | |
protected function _onSaveError(_arg1:String=""):void{ | |
if ((((_arg1 == "")) || ((_arg1 == null)))){ | |
_arg1 = this._getDefaultSaveErrorMessage(); | |
}; | |
dispatchEvent(new SaveLoadEvent(SaveLoadEvent.SAVE_ERROR, _arg1)); | |
} | |
protected function _onLoadSuccess():void{ | |
dispatchEvent(new SaveLoadEvent(SaveLoadEvent.LOAD_SUCCESS)); | |
this._monitorDataStore(); | |
} | |
protected function _onSaveSuccess():void{ | |
dispatchEvent(new SaveLoadEvent(SaveLoadEvent.SAVE_SUCCESS)); | |
} | |
protected function _onGenericError(_arg1:String=""){ | |
if ((((_arg1 == "")) || ((_arg1 == null)))){ | |
_arg1 = this._getDefaultGenericErrorMessage(); | |
}; | |
dispatchEvent(new SaveLoadEvent(SaveLoadEvent.GENERIC_ERROR, _arg1)); | |
} | |
protected function _restoreContent(_arg1:String, _arg2:XML, _arg3:String):void{ | |
var _local4:GenericDataStore = (this._app.getDataStore() as GenericDataStore); | |
_local4.setContent(_arg1, _arg2.toXMLString(), _arg3); | |
} | |
protected function _getDefaultSaveErrorMessage():String{ | |
var _local1:String = this._app.getOption("default_save_error_msg", DEFAULT_SAVE_ERROR_MSG); | |
return (_local1); | |
} | |
protected function _getDefaultLoadErrorMessage():String{ | |
var _local1:String = this._app.getOption("default_load_error_msg", DEFAULT_LOAD_ERROR_MSG); | |
return (_local1); | |
} | |
protected function _getDefaultGenericErrorMessage():String{ | |
var _local1:String = this._app.getOption("default_saveload_generic_error_msg", DEFAULT_GENERIC_ERROR_MSG); | |
return (_local1); | |
} | |
protected function _handleLoadErrorCode(_arg1:String):void{ | |
var _local2:String = this._formatMessageAndCode(this._getDefaultLoadErrorMessage(), _arg1); | |
this._onLoadError(_local2); | |
} | |
protected function _handleSaveErrorCode(_arg1:String):void{ | |
var _local2:String = this._formatMessageAndCode(this._getDefaultSaveErrorMessage(), _arg1); | |
this._onSaveError(_local2); | |
} | |
protected function _handleGenericErrorCode(_arg1:String):void{ | |
var _local2:String = this._formatMessageAndCode(this._getDefaultGenericErrorMessage(), _arg1); | |
this._onGenericError(_local2); | |
} | |
protected function _formatMessageAndCode(_arg1:String, _arg2:String):String{ | |
var _local3:String = this._app.getMain().formatMessageAndCode(_arg1, _arg2); | |
return (_local3); | |
} | |
} | |
}//package com.vpg.vpage.shell.savedata | |
package com.vpg.vpage.shell.savedata { | |
import com.vpg.vpage.shell.*; | |
import com.vpg.vpage.utils.*; | |
import com.vpg.vpage.shell.datastore.*; | |
import flash.external.*; | |
public class ConnectEdConnector extends JavascriptConnector { | |
private static const NO_URL_ERROR:String = "VST00020"; | |
private static const NO_DATA_TYPE_ERROR:String = "VST00021"; | |
private static const INVALID_BOOKID_ERROR:String = "VST00022"; | |
private static const DEFAULT_KEEP_ALIVE_SEC:String = "300"; | |
private static const DEFAULT_KEEP_ALIVE_FUNCT:String = "doKeepAlive"; | |
private static const TYPE_NOTE:String = "NOTE"; | |
private static const TYPE_HIGHLIGHT:String = "HIGHL"; | |
private static const TYPE_BOOKMARK:String = "BOOKM"; | |
private static const TYPE_GENERIC:String = "GENER"; | |
private var _keepAlive:JavascriptKeepAlive; | |
override public function init(_arg1:App):void{ | |
super.init(_arg1); | |
var _local2:String = _arg1.getOption("keep_alive_sec", DEFAULT_KEEP_ALIVE_SEC); | |
var _local3:String = _arg1.getOption("keep_alive_function", DEFAULT_KEEP_ALIVE_FUNCT); | |
this._keepAlive = new JavascriptKeepAlive(); | |
this._keepAlive.addEventListener(JavascriptKeepAlive.ERROR, this._keepAliveError); | |
this._keepAlive.start(Number(_local2), _local3, _arg1.getMain()); | |
} | |
override protected function _handleDataChange(_arg1:String, _arg2:String, _arg3:String):void{ | |
var pg:* = _arg1; | |
var type:* = _arg2; | |
var content:* = _arg3; | |
var typeToSend:* = this._getPrettyTypeName(type); | |
var url:* = this._getDataSaveLoadURL(); | |
var formattedContent:* = this._formatContent(pg, type, content); | |
if (!this._isValidBookID()){ | |
_handleSaveErrorCode(INVALID_BOOKID_ERROR); | |
} else { | |
if (typeToSend == ""){ | |
_handleSaveErrorCode(NO_DATA_TYPE_ERROR); | |
} else { | |
if (url == ""){ | |
_handleSaveErrorCode(NO_URL_ERROR); | |
} else { | |
try { | |
pg = pg.split("_").join("$"); | |
ExternalInterface.call(_saveFunction, url, this._getBookID(), typeToSend, pg, formattedContent); | |
} catch(e:Error) { | |
_processExternalError(TYPE_SAVE, e); | |
}; | |
}; | |
}; | |
}; | |
} | |
override protected function _callLoadFunction():void{ | |
var url:* = this._getDataSaveLoadURL(); | |
if (!this._isValidBookID()){ | |
_handleLoadErrorCode(INVALID_BOOKID_ERROR); | |
} else { | |
if (url == ""){ | |
_handleLoadErrorCode(NO_URL_ERROR); | |
} else { | |
try { | |
ExternalInterface.call(_loadFunction, url, this._getBookID()); | |
} catch(e:Error) { | |
_processExternalError(TYPE_LOAD, e); | |
}; | |
}; | |
}; | |
} | |
override protected function _processLoadedXML(_arg1:XML):Boolean{ | |
var _local2:String = _arg1.error.text(); | |
if (_local2 != ""){ | |
return (false); | |
}; | |
this._handleLoadedXML(_arg1); | |
return (true); | |
} | |
private function _handleLoadedXML(_arg1:XML):void{ | |
var _local4:XML; | |
var _local5:Array; | |
var _local6:String; | |
var _local7:String; | |
var _local8:String; | |
var _local9:String; | |
var _local10:GenericDataStore; | |
var _local2:XMLList = _arg1.result.data; | |
var _local3:int; | |
while (_local3 < _local2.length()) { | |
_local4 = (_local2[_local3] as XML); | |
_local5 = [email protected]("_"); | |
_local6 = _local5[1]; | |
_local6 = _local6.split("$").join("_"); | |
_local7 = _local5[2]; | |
_local8 = this._getInternalTypeName(_local7); | |
_local9 = _local4.toString(); | |
if (_local7 == TYPE_NOTE){ | |
_local9 = StringU.makeXMLNodeString("artobjs", _local9, false); | |
} else { | |
if (_local7 == TYPE_HIGHLIGHT){ | |
_local9 = StringU.makeXMLNodeString("markups", _local9, false); | |
}; | |
}; | |
_local10 = (_app.getDataStore() as GenericDataStore); | |
_local10.setContent(_local8, _local9, _local6); | |
_local3++; | |
}; | |
} | |
private function _getPrettyTypeName(_arg1:String):String{ | |
if (_arg1 == GenericDataStoreTypes.TYPE_NOTE){ | |
return (TYPE_NOTE); | |
}; | |
if (_arg1 == GenericDataStoreTypes.TYPE_HIGHLIGHT){ | |
return (TYPE_HIGHLIGHT); | |
}; | |
return (""); | |
} | |
private function _getInternalTypeName(_arg1:String):String{ | |
if (_arg1 == TYPE_NOTE){ | |
return (GenericDataStoreTypes.TYPE_NOTE); | |
}; | |
if (_arg1 == TYPE_HIGHLIGHT){ | |
return (GenericDataStoreTypes.TYPE_HIGHLIGHT); | |
}; | |
return (""); | |
} | |
private function _keepAliveError(_arg1:EventWithParam):void{ | |
_handleGenericErrorCode(_arg1.param); | |
} | |
private function _getDataSaveLoadURL():String{ | |
return (_app.getOption("data_save_load_url", "")); | |
} | |
private function _formatContent(_arg1:String, _arg2:String, _arg3:String):String{ | |
_arg2 = this._getPrettyTypeName(_arg2); | |
if (_arg2 == TYPE_HIGHLIGHT){ | |
_arg3 = this._reformatHighlights(_arg3); | |
} else { | |
if (_arg2 == TYPE_NOTE){ | |
_arg3 = this._reformatNotes(_arg3); | |
}; | |
}; | |
return (_arg3); | |
} | |
private function _getBookID():String{ | |
var _local1:String = _app.getBookID(); | |
_local1 = _local1.split("_").join("-"); | |
return (_local1); | |
} | |
private function _isValidBookID():Boolean{ | |
var _local1:String = this._getBookID(); | |
if (_local1.length > 16){ | |
return (false); | |
}; | |
return (true); | |
} | |
private function _reformatNotes(_arg1:String):String{ | |
var _local5:XML; | |
var _local2:XML = new XML(_arg1); | |
var _local3 = ""; | |
var _local4:int; | |
while (_local4 < _local2.art.length()) { | |
_local5 = _local2.art[_local4]; | |
_local3 = (_local3 + "<art>"); | |
_local3 = (_local3 + StringU.makeXMLNodeString("type", _local5.type.toString(), false)); | |
_local3 = (_local3 + StringU.makeXMLNodeString("coords", _local5.coords.toString(), false)); | |
_local3 = (_local3 + StringU.makeXMLNodeString("pText", _local5.pText.toString(), false)); | |
_local3 = (_local3 + StringU.makeXMLNodeString("pURL", _local5.pURL.toString(), false)); | |
_local3 = (_local3 + StringU.makeXMLNodeString("date", _local5.date.toString(), false)); | |
_local3 = (_local3 + "</art>"); | |
_local4++; | |
}; | |
return (_local3); | |
} | |
private function _reformatHighlights(_arg1:String):String{ | |
var _local5:XML; | |
var _local2:XML = new XML(_arg1); | |
var _local3 = ""; | |
var _local4:int; | |
while (_local4 < _local2.markup.length()) { | |
_local5 = _local2.markup[_local4]; | |
_local3 = (_local3 + "<markup>"); | |
_local3 = (_local3 + StringU.makeXMLNodeString("type", _local5.type.toString(), false)); | |
_local3 = (_local3 + StringU.makeXMLNodeString("color", _local5.color.toString(), false)); | |
_local3 = (_local3 + StringU.makeXMLNodeString("range", _local5.range.toString(), false)); | |
_local3 = (_local3 + StringU.makeXMLNodeString("text", _local5.text.toString(), false)); | |
_local3 = (_local3 + "</markup>"); | |
_local4++; | |
}; | |
return (_local3); | |
} | |
} | |
}//package com.vpg.vpage.shell.savedata | |
package com.vpg.vpage.shell.savedata { | |
import flash.display.*; | |
import flash.events.*; | |
import com.vpg.vpage.utils.*; | |
import flash.utils.*; | |
import flash.external.*; | |
public class JavascriptKeepAlive extends EventDispatcher { | |
private static const KEEP_ALIVE_EXTERNAL_ERROR:String = "VST00050"; | |
private static const KEEP_ALIVE_EXTERNAL_SEC_ERROR:String = "VST00051"; | |
private static const KEEP_ALIVE_TIMER_ERROR:String = "VST00052"; | |
public static const ERROR:String = "keepAliveError"; | |
private var _timer:Timer; | |
private var _mc:DisplayObject; | |
private var _funct:String; | |
private var _needsDispatch:Boolean; | |
public function start(_arg1:Number, _arg2:String, _arg3:DisplayObject=null):void{ | |
var sec:* = _arg1; | |
var funct:* = _arg2; | |
var mc = _arg3; | |
if (this.isActive()){ | |
this.stop(); | |
}; | |
this._funct = funct; | |
this._mc = mc; | |
if (this._mc){ | |
this._mc.addEventListener(MouseEvent.MOUSE_DOWN, this._mouseEvent); | |
this._needsDispatch = false; | |
} else { | |
this._needsDispatch = true; | |
}; | |
try { | |
this._timer = new Timer((sec * 1000)); | |
this._timer.addEventListener(TimerEvent.TIMER, this._timerTick); | |
this._timer.start(); | |
} catch(e:Error) { | |
dispatchEvent(new EventWithParam(ERROR, KEEP_ALIVE_TIMER_ERROR)); | |
}; | |
} | |
public function stop():void{ | |
if (this._timer){ | |
this._timer.stop(); | |
this._timer.removeEventListener(TimerEvent.TIMER, this._timerTick); | |
this._timer = null; | |
}; | |
if (this._mc){ | |
this._mc.removeEventListener(MouseEvent.MOUSE_DOWN, this._mouseEvent); | |
}; | |
} | |
public function isActive():Boolean{ | |
if (this._timer){ | |
return (true); | |
}; | |
return (false); | |
} | |
private function _timerTick(_arg1:Event):void{ | |
var e:* = _arg1; | |
if (this._needsDispatch){ | |
try { | |
ExternalInterface.call(this._funct); | |
} catch(e:Error) { | |
if ((e is SecurityError)){ | |
dispatchEvent(new EventWithParam(ERROR, KEEP_ALIVE_EXTERNAL_SEC_ERROR)); | |
} else { | |
dispatchEvent(new EventWithParam(ERROR, KEEP_ALIVE_EXTERNAL_ERROR)); | |
}; | |
}; | |
this._updateNeedsDispatchProp(); | |
}; | |
} | |
private function _mouseEvent(_arg1:Event):void{ | |
this._needsDispatch = true; | |
} | |
private function _updateNeedsDispatchProp():void{ | |
if (this._mc){ | |
this._needsDispatch = false; | |
}; | |
} | |
} | |
}//package com.vpg.vpage.shell.savedata | |
package com.vpg.vpage.shell.savedata { | |
import com.vpg.vpage.shell.*; | |
import flash.events.*; | |
public interface IBackendConnector extends IEventDispatcher { | |
function init(_arg1:App):void; | |
function disconnect():void; | |
} | |
}//package com.vpg.vpage.shell.savedata | |
package com.vpg.vpage.shell.savedata { | |
import com.vpg.vpage.shell.*; | |
import com.vpg.vpage.utils.*; | |
import com.adobe.serialization.json.*; | |
import flash.external.*; | |
public class JavascriptConnector extends AbstractBackendConnector { | |
private static const JS_RETURNED_SAVE_ERROR:String = "VST00000"; | |
private static const JS_RETURNED_LOAD_ERROR:String = "VST00001"; | |
private static const RESTORE_EXCEPTION_THROWN:String = "VST00002"; | |
private static const PROCESS_RESPONSE_FAILED:String = "VST00003"; | |
private static const EXTERNAL_SAVE_CALL_THREW_ERROR:String = "VST00004"; | |
private static const EXTERNAL_LOAD_CALL_THREW_ERROR:String = "VST00005"; | |
private static const EXTERNAL_SAVE_CALL_THREW_SEC_ERROR:String = "VST00006"; | |
private static const EXTERNAL_LOAD_CALL_THREW_SEC_ERROR:String = "VST00007"; | |
private static const EXTERNAL_ADD_CALLBACK_THREW_SEC_ERROR:String = "VST00008"; | |
private static const EXTERNAL_ADD_CALLBACK_THREW_ERROR:String = "VST00009"; | |
private static const UNKNOWN_RESPONSE_TYPE:String = "VST00010"; | |
protected static const FORMAT_XML:String = "xmlFormatData"; | |
protected static const FORMAT_JSON:String = "jsonFormatData"; | |
protected static const TYPE_SAVE:String = "saveActivity"; | |
protected static const TYPE_LOAD:String = "loadActivity"; | |
protected static const TYPE_GENERIC:String = "genericActivity"; | |
protected static const TYPE_ADD_CALLBACK:String = "addCallback"; | |
protected var _saveFunction:String; | |
protected var _loadFunction:String; | |
override public function init(_arg1:App):void{ | |
var app:* = _arg1; | |
_app = app; | |
this._saveFunction = app.getOption("js_save_function", "saveUserData"); | |
this._loadFunction = app.getOption("js_load_function", "loadUserData"); | |
var saveError:* = app.getOption("js_save_error_function", "saveUserDataError"); | |
var loadError:* = app.getOption("js_load_error_function", "loadUserDataError"); | |
var saveSuccess:* = app.getOption("js_save_success_function", "saveUserDataSuccess"); | |
var loadSuccess:* = app.getOption("js_load_success_function", "loadUserDataSuccess"); | |
var errorOccurred:* = false; | |
try { | |
ExternalInterface.addCallback(saveError, this._handleSaveError); | |
ExternalInterface.addCallback(loadError, this._handleLoadError); | |
ExternalInterface.addCallback(saveSuccess, this._handleSaveSucccess); | |
ExternalInterface.addCallback(loadSuccess, this._handleLoadSucccess); | |
} catch(e:Error) { | |
errorOccurred = true; | |
_processExternalError(TYPE_ADD_CALLBACK, e); | |
}; | |
if (!errorOccurred){ | |
this._loadUserData(); | |
}; | |
} | |
override protected function _loadUserData():void{ | |
if (MiscUtils.isDevMode()){ | |
this._handleLoadSucccess(""); | |
} else { | |
try { | |
this._callLoadFunction(); | |
} catch(e:Error) { | |
_processExternalError(TYPE_LOAD, e); | |
}; | |
}; | |
} | |
protected function _callLoadFunction():void{ | |
} | |
protected function _processLoadedXML(_arg1:XML):Boolean{ | |
return (true); | |
} | |
protected function _processLoadedJSON(_arg1:Object):Boolean{ | |
return (true); | |
} | |
protected function _handleSaveError(_arg1:String=""):void{ | |
_handleSaveErrorCode(JS_RETURNED_SAVE_ERROR); | |
} | |
protected function _handleLoadError(_arg1:String=""):void{ | |
_handleLoadErrorCode(JS_RETURNED_LOAD_ERROR); | |
} | |
protected function _handleSaveSucccess(_arg1:String=""):void{ | |
_onSaveSuccess(); | |
} | |
protected function _handleLoadSucccess(_arg1:String=""):void{ | |
var processResult:* = false; | |
var xml:* = null; | |
var json:* = null; | |
var result:String = _arg1; | |
try { | |
processResult = false; | |
if (this._getResponseFormat() == FORMAT_XML){ | |
xml = new XML(result); | |
processResult = this._processLoadedXML(xml); | |
} else { | |
if (this._getResponseFormat() == FORMAT_JSON){ | |
json = JSON.decode(result); | |
processResult = this._processLoadedJSON(json); | |
} else { | |
_handleLoadErrorCode(UNKNOWN_RESPONSE_TYPE); | |
return; | |
}; | |
}; | |
if (processResult){ | |
_onLoadSuccess(); | |
} else { | |
_handleLoadErrorCode(PROCESS_RESPONSE_FAILED); | |
}; | |
} catch(e:Error) { | |
_handleLoadErrorCode(RESTORE_EXCEPTION_THROWN); | |
}; | |
} | |
protected function _processExternalError(_arg1:String, _arg2:Error):void{ | |
if (_arg1 == TYPE_SAVE){ | |
if ((_arg2 is SecurityError)){ | |
_handleSaveErrorCode(EXTERNAL_SAVE_CALL_THREW_SEC_ERROR); | |
} else { | |
_handleSaveErrorCode(EXTERNAL_SAVE_CALL_THREW_ERROR); | |
}; | |
} else { | |
if (_arg1 == TYPE_LOAD){ | |
if ((_arg2 is SecurityError)){ | |
_handleLoadErrorCode(EXTERNAL_LOAD_CALL_THREW_SEC_ERROR); | |
} else { | |
_handleLoadErrorCode(EXTERNAL_LOAD_CALL_THREW_ERROR); | |
}; | |
} else { | |
if (_arg1 == TYPE_ADD_CALLBACK){ | |
if ((_arg2 is SecurityError)){ | |
_handleLoadErrorCode(EXTERNAL_ADD_CALLBACK_THREW_SEC_ERROR); | |
} else { | |
_handleLoadErrorCode(EXTERNAL_ADD_CALLBACK_THREW_ERROR); | |
}; | |
}; | |
}; | |
}; | |
} | |
protected function _getResponseFormat():String{ | |
return (FORMAT_XML); | |
} | |
} | |
}//package com.vpg.vpage.shell.savedata | |
package com.vpg.vpage.shell.savedata { | |
import com.vpg.vpage.shell.*; | |
import flash.events.*; | |
public class NullConnector extends EventDispatcher implements IBackendConnector { | |
public function init(_arg1:App):void{ | |
dispatchEvent(new SaveLoadEvent(SaveLoadEvent.LOAD_SUCCESS)); | |
} | |
public function disconnect():void{ | |
} | |
} | |
}//package com.vpg.vpage.shell.savedata | |
package com.vpg.vpage.shell { | |
import com.vpg.vpage.utils.*; | |
public class InterfaceText { | |
private var _textMap:HashMap; | |
public function InterfaceText(_arg1:XML){ | |
this._textMap = this._makeMap(_arg1); | |
} | |
public function getInterfaceText(_arg1:String, _arg2:String):String{ | |
var _local3:String = (this._textMap.get(_arg1) as String); | |
if (_local3 != null){ | |
return (_local3); | |
}; | |
return (_arg2); | |
} | |
private function _makeMap(_arg1):HashMap{ | |
var _local5:XML; | |
var _local6:String; | |
var _local7:String; | |
var _local2:HashMap = new HashMap(); | |
var _local3:XMLList = _arg1.interface_text.element; | |
var _local4:* = 0; | |
while (_local4 < _local3.length()) { | |
_local5 = (_local3[_local4] as XML); | |
_local6 = _local5.@name; | |
_local7 = _local5.text(); | |
_local2.put(_local6, _local7); | |
_local4++; | |
}; | |
return (_local2); | |
} | |
} | |
}//package com.vpg.vpage.shell | |
package com.vpg.vpage.shell.pageicons { | |
import flash.display.*; | |
import flash.events.*; | |
public class Icon extends MovieClip { | |
private var _loader:Loader; | |
public function Icon(_arg1:Loader){ | |
mouseChildren = false; | |
this._loader = _arg1; | |
addChild(this._loader); | |
addEventListener(MouseEvent.MOUSE_OVER, this._doOver); | |
addEventListener(MouseEvent.MOUSE_DOWN, this._doDown); | |
addEventListener(MouseEvent.MOUSE_OUT, this._doOut); | |
addEventListener(MouseEvent.MOUSE_UP, this._doOver); | |
} | |
public function destroy():void{ | |
removeEventListener(MouseEvent.MOUSE_OVER, this._doOver); | |
removeEventListener(MouseEvent.MOUSE_DOWN, this._doDown); | |
removeEventListener(MouseEvent.MOUSE_OUT, this._doOut); | |
removeEventListener(MouseEvent.MOUSE_UP, this._doOver); | |
this._loader.unloadAndStop(); | |
this._loader = null; | |
} | |
private function _doOver(_arg1:Event):void{ | |
this._doLabel("_over"); | |
} | |
private function _doOut(_arg1:Event):void{ | |
this._doLabel("_up"); | |
} | |
private function _doDown(_arg1:Event):void{ | |
this._doLabel("_down"); | |
} | |
private function _doLabel(_arg1:String):void{ | |
if (((this._hasLabel(_arg1)) && (!((this._getContent().currentLabel == _arg1))))){ | |
this._getContent().gotoAndPlay(_arg1); | |
}; | |
} | |
private function _getContent():MovieClip{ | |
return ((this._loader.content as MovieClip)); | |
} | |
private function _hasLabel(_arg1:String):Boolean{ | |
var _local4:FrameLabel; | |
var _local2:MovieClip = this._getContent(); | |
var _local3:int; | |
while (_local3 < _local2.currentLabels.length) { | |
_local4 = _local2.currentLabels[_local3]; | |
if (_local4.name == _arg1){ | |
return (true); | |
}; | |
_local3++; | |
}; | |
return (false); | |
} | |
} | |
}//package com.vpg.vpage.shell.pageicons | |
package com.vpg.vpage.shell.pageicons { | |
import flash.display.*; | |
import com.vpg.vpage.shell.*; | |
import flash.net.*; | |
import flash.events.*; | |
import com.vpg.vpage.utils.*; | |
import flash.system.*; | |
public class IconDraw extends Sprite { | |
private var _iconsOnStage:Array; | |
private var _iconCount:int; | |
private var _iconFunctions:IIconFunctions; | |
private var _loadMap:HashMap; | |
private var _functionMap:HashMap; | |
private var _colorMap:KeyValueFile; | |
private var _visibilityMap:HashMap; | |
private var _destroyed:Boolean; | |
private var _rootPath:String; | |
public function IconDraw(_arg1:IIconFunctions, _arg2:KeyValueFile, _arg3:String=""){ | |
this._iconsOnStage = new Array(); | |
this._iconFunctions = _arg1; | |
this._loadMap = new HashMap(); | |
this._functionMap = new HashMap(); | |
this._colorMap = _arg2; | |
this._visibilityMap = new HashMap(); | |
this._rootPath = _arg3; | |
mouseEnabled = false; | |
this._destroyed = false; | |
} | |
public function loadXML(_arg1:String){ | |
NetU.doFileLoad(_arg1, this._xmlLoaded, this._xmlLoadError); | |
} | |
public function destroy():void{ | |
var _local3:int; | |
var _local4:IconArtObj; | |
var _local5:IconFunctionObj; | |
if (this._iconsOnStage){ | |
_local3 = 0; | |
while (_local3 < this._iconsOnStage.length) { | |
_local4 = (this._iconsOnStage[_local3] as IconArtObj); | |
if (_local4.pMc){ | |
_local4.pMc.removeEventListener(MouseEvent.CLICK, this._iconClicked); | |
_local4.pMc.removeEventListener(MouseEvent.ROLL_OVER, this._iconOver); | |
_local4.pMc.removeEventListener(MouseEvent.ROLL_OUT, this._iconOut); | |
ToolTipBuilder.unRegisterButton(_local4.pMc); | |
_local4.pMc.destroy(); | |
}; | |
this._iconsOnStage[_local3] = null; | |
_local3++; | |
}; | |
}; | |
this._iconsOnStage = null; | |
this._iconFunctions = null; | |
this._loadMap.clear(); | |
this._loadMap = null; | |
var _local1:Array = this._functionMap.values(); | |
var _local2:int; | |
while (_local2 < _local1.length) { | |
_local5 = (_local1[_local2] as IconFunctionObj); | |
_local5.destroy(); | |
_local2++; | |
}; | |
this._functionMap.clear(); | |
this._functionMap = null; | |
this._colorMap = null; | |
this._visibilityMap.clear(); | |
this._visibilityMap = null; | |
this._destroyed = true; | |
} | |
public function setVisibility(_arg1:String, _arg2:Boolean):void{ | |
var _local4:IconArtObj; | |
var _local3:int; | |
while (_local3 < this._iconsOnStage.length) { | |
_local4 = (this._iconsOnStage[_local3] as IconArtObj); | |
if (_local4.visibility_id == _arg1){ | |
_local4.pMc.visible = _arg2; | |
}; | |
_local3++; | |
}; | |
this._visibilityMap.put(_arg1, _arg2); | |
} | |
public function animateAllIcons():void{ | |
var _local1:IconArtObj; | |
var _local2:Number = 0; | |
while (_local2 < this._iconsOnStage.length) { | |
_local1 = this._iconsOnStage[_local2]; | |
switch (_local1.type){ | |
case "icon": | |
break; | |
case "rect": | |
break; | |
}; | |
_local2++; | |
}; | |
} | |
public function getAllIconsOnStage():Array{ | |
return (this._iconsOnStage.slice()); | |
} | |
private function _xmlLoaded(_arg1:Event):void{ | |
if (this._destroyed){ | |
return; | |
}; | |
var _local2:URLLoader = (_arg1.currentTarget as URLLoader); | |
var _local3:XML = new XML(_local2.data); | |
this._drawIcons(_local3); | |
} | |
private function _xmlLoadError(_arg1:Event):void{ | |
dispatchEvent(new Event(Event.COMPLETE)); | |
} | |
private function _drawIcons(_arg1:XML):void{ | |
var _local3:IconArtObj; | |
if (this._destroyed){ | |
return; | |
}; | |
var _local2:XMLList = _arg1.map.art; | |
this._iconCount = _local2.length(); | |
if (_local2.length() == 0){ | |
this._iconFinishedDrawing(-1); | |
}; | |
var _local4:Number = 0; | |
while (_local4 < _local2.length()) { | |
_local3 = new IconArtObj(_local2[_local4]); | |
this._iconsOnStage.push(_local3); | |
switch (_local3.type){ | |
case "icon": | |
this._attachIcon(_local3, _local4); | |
break; | |
case "rect": | |
default: | |
this._attachRect(_local3, _local4); | |
}; | |
_local4++; | |
}; | |
System.disposeXML(_arg1); | |
} | |
private function _iconFinishedDrawing(_arg1:Number):void{ | |
var _local7:IconFunctionObj; | |
if (this._destroyed){ | |
return; | |
}; | |
if (_arg1 == -1){ | |
dispatchEvent(new Event(Event.COMPLETE)); | |
return; | |
}; | |
var _local2:IconArtObj = this._iconsOnStage[_arg1]; | |
_local2.isloaded = true; | |
if (_local2.title){ | |
ToolTipBuilder.registerButton(_local2.pMc, _local2.title); | |
}; | |
if (_local2.nolink != "true"){ | |
_local2.pMc.buttonMode = true; | |
_local2.pMc.useHandCursor = true; | |
_local7 = new IconFunctionObj(); | |
_local7.click = this._getIconFunction(_local2.pFunction); | |
_local7.over = this._getIconRollOverFunction(_local2.pFunction); | |
_local7.out = this._getIconRollOutFunction(_local2.pFunction); | |
_local7.obj = _local2; | |
this._functionMap.put(_local2.pMc, _local7); | |
_local2.pMc.addEventListener(MouseEvent.CLICK, this._iconClicked); | |
_local2.pMc.addEventListener(MouseEvent.ROLL_OVER, this._iconOver); | |
_local2.pMc.addEventListener(MouseEvent.ROLL_OUT, this._iconOut); | |
}; | |
var _local3:String = _local2.visibility_id; | |
var _local4:* = this._visibilityMap.get(_local3); | |
if (_local4 != null){ | |
if (_local4 == false){ | |
_local2.pMc.visible = false; | |
}; | |
}; | |
var _local5:Boolean; | |
var _local6:Number = 0; | |
while (_local6 < this._iconsOnStage.length) { | |
if (((!(this._iconsOnStage[_local6].isloaded)) || (!((this._iconCount == this._iconsOnStage.length))))){ | |
_local5 = false; | |
break; | |
}; | |
_local6++; | |
}; | |
if (_local5){ | |
dispatchEvent(new Event(Event.COMPLETE)); | |
}; | |
} | |
private function _iconLoaded(_arg1:Event):void{ | |
if (this._destroyed){ | |
return; | |
}; | |
var _local2:LoaderInfo = (_arg1.currentTarget as LoaderInfo); | |
var _local3:Loader = _local2.loader; | |
var _local4:int = this._loadMap.get(_local3); | |
var _local5:IconArtObj = this._iconsOnStage[_local4]; | |
var _local6:Icon = new Icon(_local3); | |
_local5.pMc = _local6; | |
_local5.pMc.scaleX = (_local5.pMc.scaleY = (_local5.scale / 100)); | |
_local5.pMc.x = _local5.coords.split(",")[0]; | |
_local5.pMc.y = _local5.coords.split(",")[1]; | |
addChild(_local5.pMc); | |
_local5.pMcContent = _local3.content; | |
this._iconFinishedDrawing(_local4); | |
} | |
private function _getIconFunction(_arg1:String):Function{ | |
return (this._iconFunctions.getIconFunction(_arg1)); | |
} | |
private function _getIconRollOverFunction(_arg1:String):Function{ | |
return (this._iconFunctions.getIconRollOverFunction(_arg1)); | |
} | |
private function _getIconRollOutFunction(_arg1:String):Function{ | |
return (this._iconFunctions.getIconRollOutFunction(_arg1)); | |
} | |
private function _attachIcon(_arg1:IconArtObj, _arg2:Number):void{ | |
var _local4:Loader; | |
var _local3 = (((this._rootPath + "data/icons/") + _arg1.icon) + "_as3.swf"); | |
this._loadMap.put(_local4, _arg2); | |
_local4 = NetU.doArtLoad(_local3, this._iconLoaded, this._iconLoaded); | |
this._loadMap.put(_local4, _arg2); | |
} | |
private function _attachRect(_arg1:IconArtObj, _arg2:Number):MovieClip{ | |
var _local3:Array = _arg1.coords.split(","); | |
var _local4:Rect = new Rect(_local3[2], _local3[3]); | |
var _local5:Number = this._getNumber(_arg1, "color"); | |
var _local6:Number = this._getNumber(_arg1, "alpha"); | |
var _local7:Number = this._getNumber(_arg1, "over_color"); | |
var _local8:Number = this._getNumber(_arg1, "over_alpha"); | |
var _local9:Number = this._getNumber(_arg1, "down_color"); | |
var _local10:Number = this._getNumber(_arg1, "down_alpha"); | |
var _local11:Number = this._getNumber(_arg1, "underline_color"); | |
var _local12:Number = this._getNumber(_arg1, "underline_alpha"); | |
var _local13:Number = this._getNumber(_arg1, "underline_over_color"); | |
var _local14:Number = this._getNumber(_arg1, "underline_over_alpha"); | |
var _local15:Number = this._getNumber(_arg1, "underline_down_color"); | |
var _local16:Number = this._getNumber(_arg1, "underline_down_alpha"); | |
var _local17:String = this._getString(_arg1, "blendmode", BlendMode.DARKEN); | |
var _local18:String = this._getString(_arg1, "over_blendmode", BlendMode.DARKEN); | |
var _local19:String = this._getString(_arg1, "down_blendmode", BlendMode.DARKEN); | |
var _local20:String = this._getString(_arg1, "underline_blendmode", BlendMode.NORMAL); | |
var _local21:String = this._getString(_arg1, "underline_over_blendmode", BlendMode.NORMAL); | |
var _local22:String = this._getString(_arg1, "underline_down_blendmode", BlendMode.NORMAL); | |
_local4.buildBasicRect(_local5, _local6, _local17, _local7, _local8, _local18, _local9, _local10, _local19); | |
_local4.addUnderline(_local11, _local12, _local20, _local13, _local14, _local21, _local15, _local16, _local22); | |
_local4.x = _arg1.coords.split(",")[0]; | |
_local4.y = _arg1.coords.split(",")[1]; | |
addChild(_local4); | |
_arg1.pMc = _local4; | |
this._iconFinishedDrawing(_arg2); | |
return (_local4); | |
} | |
private function _getNumber(_arg1:IconArtObj, _arg2:String):Number{ | |
var _local3:Number = this._colorMap.getNumber(((_arg1.pFunction + "_") + _arg2)); | |
if (!isNaN(_arg1[_arg2])){ | |
_local3 = _arg1[_arg2]; | |
}; | |
return (_local3); | |
} | |
private function _getString(_arg1:IconArtObj, _arg2:String, _arg3:String):String{ | |
var _local4:String = this._colorMap.get(((_arg1.pFunction + "_") + _arg2)); | |
if (((!((_arg1[_arg2] == ""))) && (!((_arg1[_arg2] == null))))){ | |
_local4 = _arg1[_arg2]; | |
}; | |
if (_local4 == null){ | |
_local4 = _arg3; | |
}; | |
return (_local4); | |
} | |
private function _iconClicked(_arg1:Event):void{ | |
var _local2:IconFunctionObj = (this._functionMap.get(_arg1.currentTarget) as IconFunctionObj); | |
_local2.doClick(); | |
} | |
private function _iconOver(_arg1:Event):void{ | |
var _local2:DisplayObject = (_arg1.currentTarget as DisplayObject); | |
DisplayU.moveToTop(_local2); | |
var _local3:IconFunctionObj = (this._functionMap.get(_arg1.currentTarget) as IconFunctionObj); | |
_local3.doOver(); | |
} | |
private function _iconOut(_arg1:Event):void{ | |
var _local2:IconFunctionObj = (this._functionMap.get(_arg1.currentTarget) as IconFunctionObj); | |
_local2.doOut(); | |
} | |
} | |
}//package com.vpg.vpage.shell.pageicons | |
package com.vpg.vpage.shell.pageicons { | |
import flash.display.*; | |
import com.vpg.vpage.utils.*; | |
public dynamic class IconArtObj { | |
private var _xmlNode:XML; | |
public var isloaded:Boolean; | |
public var type:String; | |
public var pFunction:String; | |
public var pMc:MovieClip; | |
public var pMcContent:DisplayObject; | |
public var pContent_mc:MovieClip; | |
public var icon:String; | |
public var coords:String; | |
public var scale:Number = 100; | |
public var title:String; | |
public var color:Number; | |
public var alpha:Number; | |
public var subtype:String; | |
public var visibility_id:String; | |
public var width:Number; | |
public var height:Number; | |
public var iconwidth:Number; | |
public var iconheight:Number; | |
public var iconcolor:Number; | |
public var underline_color:Number; | |
public var outline_color:Number; | |
public var nolink:String; | |
public function IconArtObj(_arg1:XML){ | |
var _local4:XML; | |
var _local5:String; | |
var _local6:String; | |
super(); | |
this._xmlNode = _arg1; | |
this.isloaded = false; | |
this.type = _arg1.@type; | |
this.pFunction = this.type; | |
if (((((!((_arg1.@pfunction == null))) && (!((_arg1.@pfunction == undefined))))) && (!((_arg1.@pfunction == ""))))){ | |
this.pFunction = _arg1.@pfunction; | |
}; | |
var _local2:XMLList = _arg1.children(); | |
var _local3:int; | |
while (_local3 < _local2.length()) { | |
_local4 = _local2[_local3]; | |
_local5 = _local4.name(); | |
_local6 = _local4.text().toString(); | |
if (this._isNumeric(_local5)){ | |
if (_local6 == ""){ | |
this[_local5] = Number.NaN; | |
} else { | |
this[_local5] = parseInt(StringU.trim(_local6)); | |
}; | |
} else { | |
if (_local5 == "pfunction"){ | |
this.pFunction = StringU.trim(_local6); | |
} else { | |
this[_local5] = StringU.trim(_local6); | |
}; | |
}; | |
_local3++; | |
}; | |
if ((((this.visibility_id == "")) || ((this.visibility_id == null)))){ | |
this.visibility_id = this.pFunction; | |
}; | |
} | |
private function _isNumeric(_arg1:String):Boolean{ | |
var _local2:Array = ["scale", "alpha", "color", "over_color", "over_alpha", "down_color", "down_alpha", "underline_color", "underline_alpha", "underline_over_color", "underline_over_alpha", "underline_down_color", "underline_down_alpha"]; | |
if (_local2.indexOf(_arg1) >= 0){ | |
return (true); | |
}; | |
return (false); | |
} | |
} | |
}//package com.vpg.vpage.shell.pageicons | |
package com.vpg.vpage.shell.pageicons { | |
import flash.events.*; | |
import com.vpg.vpage.utils.*; | |
public class IconDrawManager extends EventDispatcher { | |
private var _layers:Array; | |
private var _visibilityMap:HashMap; | |
public function IconDrawManager(){ | |
this._layers = new Array(); | |
this._visibilityMap = new HashMap(); | |
} | |
public function destroy():void{ | |
this._layers = null; | |
this._visibilityMap.clear(); | |
this._visibilityMap = null; | |
} | |
public function addLayer(_arg1:IconDraw):void{ | |
var _local4:Boolean; | |
this._layers.push(_arg1); | |
var _local2:Array = this._visibilityMap.keys(); | |
var _local3:int; | |
while (_local3 < _local2.length) { | |
_local4 = (this._visibilityMap.get(_local2[_local3]) as Boolean); | |
_arg1.setVisibility(_local2[_local3], _local4); | |
_local3++; | |
}; | |
} | |
public function getAllIconsOnStage(_arg1:Boolean):Array{ | |
var _local4:Array; | |
var _local2:Array = new Array(); | |
var _local3:int; | |
while (_local3 < this._layers.length) { | |
if (((!(_arg1)) || (this._layers[_local3].stage))){ | |
_local4 = this._layers[_local3].getAllIconsOnStage(); | |
_local2 = _local2.concat(_local4); | |
}; | |
_local3++; | |
}; | |
return (_local2); | |
} | |
public function removeAllLayers():void{ | |
var _local1:int; | |
while (_local1 < this._layers.length) { | |
this._layers[_local1].destroy(); | |
_local1++; | |
}; | |
this._layers = new Array(); | |
} | |
public function setVisibility(_arg1:String, _arg2:Boolean):void{ | |
var _local3:int; | |
while (_local3 < this._layers.length) { | |
this._layers[_local3].setVisibility(_arg1, _arg2); | |
_local3++; | |
}; | |
this._visibilityMap.put(_arg1, _arg2); | |
} | |
} | |
}//package com.vpg.vpage.shell.pageicons | |
package com.vpg.vpage.shell.pageicons { | |
import com.vpg.vpage.shell.*; | |
public class IconFunctions implements IIconFunctions { | |
public var pApp:App; | |
public var pMainMC:Main; | |
public var pObj:Object; | |
public function IconFunctions(_arg1:App){ | |
this.pApp = _arg1; | |
this.pMainMC = this.pApp.getMain(); | |
} | |
public function getIconFunction(_arg1:String):Function{ | |
var main:* = null; | |
var app:* = null; | |
var icontype:* = _arg1; | |
main = this.pMainMC; | |
app = this.pApp; | |
switch (icontype){ | |
case "video": | |
return (function (_arg1:Object){ | |
main.loadVideo(_arg1); | |
}); | |
case "audio": | |
return (function (_arg1:Object){ | |
main.loadAudio(_arg1); | |
}); | |
case "audio_noplayer": | |
return (function (_arg1:Object){ | |
main.playAudioNoPlayer(_arg1); | |
}); | |
case "goto_page": | |
return (function (_arg1:Object){ | |
app.gotoPage(_arg1.page); | |
}); | |
case "open_url_w_jsprops": | |
return (function (_arg1:Object){ | |
main.openURL(_arg1); | |
}); | |
default: | |
trace(("The following icon does not have any functionality associated with it: " + icontype)); | |
return (function (){ | |
}); | |
}; | |
} | |
public function getIconRollOverFunction(_arg1:String):Function{ | |
var icontype:* = _arg1; | |
var tIconFuncs:* = this; | |
switch (icontype){ | |
default: | |
return (function (){ | |
}); | |
}; | |
} | |
public function getIconRollOutFunction(_arg1:String):Function{ | |
var icontype:* = _arg1; | |
var tIconFuncs:* = this; | |
switch (icontype){ | |
default: | |
return (function (){ | |
}); | |
}; | |
} | |
} | |
}//package com.vpg.vpage.shell.pageicons | |
package com.vpg.vpage.shell.pageicons { | |
public class IconFunctionObj { | |
public var click:Function; | |
public var over:Function; | |
public var out:Function; | |
public var obj:Object; | |
public function IconFunctionObject(){ | |
} | |
public function destroy():void{ | |
this.click = null; | |
this.over = null; | |
this.out = null; | |
this.obj = null; | |
} | |
public function doClick():void{ | |
this.click(this.obj); | |
} | |
public function doOver():void{ | |
this.over(this.obj); | |
} | |
public function doOut():void{ | |
this.out(this.obj); | |
} | |
} | |
}//package com.vpg.vpage.shell.pageicons | |
package com.vpg.vpage.shell.pageicons { | |
import flash.display.*; | |
import flash.events.*; | |
import com.vpg.vpage.utils.*; | |
public class Rect extends MovieClip { | |
private var _hit:MovieClip; | |
private var _up:MovieClip; | |
private var _over:MovieClip; | |
private var _down:MovieClip; | |
private var _w:Number; | |
private var _h:Number; | |
public function Rect(_arg1:Number, _arg2:Number){ | |
this._w = _arg1; | |
this._h = _arg2; | |
this._hit = new Square(); | |
this._hit.alpha = 0; | |
addChild(this._hit); | |
this._hit.width = this._w; | |
this._hit.height = this._h; | |
this._up = new MovieClip(); | |
addChild(this._up); | |
this._over = new MovieClip(); | |
addChild(this._over); | |
this._down = new MovieClip(); | |
addChild(this._down); | |
mouseChildren = false; | |
addEventListener(MouseEvent.MOUSE_OVER, this._doOver); | |
addEventListener(MouseEvent.MOUSE_OUT, this._doOut); | |
addEventListener(MouseEvent.MOUSE_DOWN, this._doDown); | |
this._doOut(null); | |
} | |
public function destroy():void{ | |
removeEventListener(MouseEvent.MOUSE_OVER, this._doOver); | |
removeEventListener(MouseEvent.MOUSE_OUT, this._doOut); | |
removeEventListener(MouseEvent.MOUSE_DOWN, this._doDown); | |
this._hit = null; | |
this._up = null; | |
this._over = null; | |
this._down = null; | |
} | |
public function buildBasicRect(_arg1:Number, _arg2:Number, _arg3:String, _arg4:Number, _arg5:Number, _arg6:String, _arg7:Number, _arg8:Number, _arg9:String):void{ | |
var _local10:MovieClip = this._addRect(_arg1, _arg2, _arg3); | |
var _local11:MovieClip = this._addRect(_arg4, _arg5, _arg6); | |
var _local12:MovieClip = this._addRect(_arg7, _arg8, _arg9); | |
this._up.addChild(_local10); | |
this._over.addChild(_local11); | |
this._down.addChild(_local12); | |
} | |
public function addUnderline(_arg1:Number, _arg2:Number, _arg3:String, _arg4:Number, _arg5:Number, _arg6:String, _arg7:Number, _arg8:Number, _arg9:String):void{ | |
var _local10:MovieClip = this._addUnderline(_arg1, _arg2, _arg3, 1); | |
var _local11:MovieClip = this._addUnderline(_arg4, _arg5, _arg6, 1); | |
var _local12:MovieClip = this._addUnderline(_arg7, _arg8, _arg9, 1); | |
this._up.addChild(_local10); | |
this._over.addChild(_local11); | |
this._down.addChild(_local12); | |
} | |
private function _addUnderline(_arg1:Number, _arg2:Number, _arg3:String, _arg4:Number):MovieClip{ | |
var _local5:MovieClip = new Square(_arg1); | |
_local5.alpha = _arg2; | |
_local5.blendMode = _arg3; | |
_local5.height = _arg4; | |
_local5.y = (this._h - _local5.height); | |
_local5.width = this._w; | |
return (_local5); | |
} | |
private function _addRect(_arg1:Number, _arg2:Number, _arg3:String):MovieClip{ | |
var _local4:MovieClip = new Square(_arg1); | |
_local4.alpha = _arg2; | |
_local4.blendMode = _arg3; | |
_local4.width = this._w; | |
_local4.height = this._h; | |
return (_local4); | |
} | |
private function _doOver(_arg1:Event):void{ | |
this._hideAll(); | |
this._over.visible = true; | |
} | |
private function _doOut(_arg1:Event):void{ | |
this._hideAll(); | |
this._up.visible = true; | |
} | |
private function _doDown(_arg1:Event):void{ | |
this._hideAll(); | |
this._down.visible = true; | |
} | |
private function _hideAll():void{ | |
this._up.visible = false; | |
this._down.visible = false; | |
this._over.visible = false; | |
} | |
} | |
}//package com.vpg.vpage.shell.pageicons | |
package com.vpg.vpage.shell.pageicons { | |
public interface IIconFunctions { | |
function getIconFunction(_arg1:String):Function; | |
function getIconRollOverFunction(_arg1:String):Function; | |
function getIconRollOutFunction(_arg1:String):Function; | |
} | |
}//package com.vpg.vpage.shell.pageicons | |
package com.vpg.vpage.shell { | |
import flash.display.*; | |
import flash.geom.*; | |
import com.vpg.vpage.shell.search.*; | |
import com.vpg.vpage.shell.pageview.additionallayers.*; | |
import flash.events.*; | |
import flash.text.*; | |
import com.vpg.vpage.utils.*; | |
import com.vpg.vpage.shell.tools.*; | |
import com.vpg.vpage.shell.multibook.*; | |
import com.vpg.vpage.shell.pageicons.*; | |
import com.vpg.vpage.utils.mediamgr.*; | |
import com.vpg.vpage.shell.glossary.*; | |
import com.vpg.vpage.shell.pageview.*; | |
import com.vpg.vpage.components.scrollpane.tools.zoom.*; | |
import com.vpg.vpage.shell.index.*; | |
import com.vpg.vpage.shell.prompt.*; | |
import com.vpg.vpage.shell.audio.*; | |
import com.vpg.vpage.shell.video.*; | |
import flash.external.*; | |
public class Main extends Sprite { | |
private var _banner:Banner; | |
protected var _activeNotePopup:IEditableNotePopup; | |
private var _activeLinkPopup:IEditableLinkPopup; | |
private var _audioPlayer:IAudioPlayer; | |
private var _videoPlayer:IVideoPlayer; | |
private var _searchWindow:ISearchWindow; | |
private var _glossaryWindow:IGlossaryWindow; | |
private var _indexWindow:IIndexWindow; | |
private var _confirmationPrompt:IConfirmationPrompt; | |
private var _promptBlocker:Square; | |
private var _uiWidth:Number; | |
private var _uiHeight:Number; | |
private var _firstPageLoaded:Boolean; | |
private var _isPageCurrentlyLoading:Boolean; | |
public var pApp:App; | |
public var pSP; | |
public var bg:Square; | |
public var mediaMgr:MediaManager; | |
public var soundPlayer:SoundPlayer; | |
public function Main(){ | |
this._isPageCurrentlyLoading = false; | |
} | |
public function setApp(_arg1:App):void{ | |
this.pApp = _arg1; | |
} | |
public function destroy():void{ | |
this.pSP.removeEventListener(PreloadedPageView.LOADED, this._pagesLoaded); | |
this.pSP.removeEventListener(PreloadedPageView.START, this._pageContentLoadStartEvent); | |
this.pSP.removeEventListener(AbstractPageView.START, this._pageContentLoadStartEvent); | |
this.pSP.removeEventListener(Event.COMPLETE, this._pageContentLoadEvent); | |
this.pSP.removeEventListener(ZoomToRectEvent.ZOOM, this._rectZoomEvent); | |
this.pSP.drawingOverlayMgr.removeEventListener(DrawingOverlay.OPEN_NOTE, this.openNoteEvent); | |
this.pSP.drawingOverlayMgr.removeEventListener(DrawingOverlay.OPEN_LINK, this.openLinkEvent); | |
this.pSP.destroy(); | |
this.mediaMgr.destroy(); | |
this.soundPlayer.destroy(); | |
this.closeOpenNote(); | |
this.closeOpenLink(); | |
this.closeAudio(); | |
this.closeVideo(); | |
this.closeSearch(); | |
this.closeGlossary(); | |
this.closeIndex(); | |
this.pSP = null; | |
this.mediaMgr = null; | |
this.soundPlayer = null; | |
this.bg = null; | |
this._banner = null; | |
} | |
public function init():void{ | |
var _local1:Number = this.pApp.getStyleMgr().getNumber("page_background"); | |
this.bg = new Square(_local1); | |
addChild(this.bg); | |
this.mediaMgr = new MediaManager(); | |
this.soundPlayer = new SoundPlayer(); | |
this.mediaMgr.registerPlayer(this.soundPlayer); | |
this._attachScrollPane(); | |
} | |
public function initInterface():void{ | |
} | |
public function initComplete():void{ | |
this.resize(960, 720); | |
this.pageViewChanged(); | |
this.zoomTo100(null); | |
this.initDone(); | |
} | |
public function initDone():void{ | |
} | |
public function getIconFunctions():IIconFunctions{ | |
return (new IconFunctions(this.pApp)); | |
} | |
public function getUIWidth():Number{ | |
return (this._uiWidth); | |
} | |
public function getUIHeight():Number{ | |
return (this._uiHeight); | |
} | |
public function loadSearchHit(_arg1:SearchHit):void{ | |
this.pApp.gotoPage(_arg1.pageid); | |
this.pSP.searchLayerMgr.highlightHits(_arg1); | |
} | |
public function multibookSwitchTo(_arg1:MultibookInitObj):void{ | |
} | |
public function getAdditionalLayerFactory():IAdditionalLayerFactory{ | |
return (null); | |
} | |
public function openNoteEvent(_arg1:OpenItemEvent):void{ | |
this.closeOpenNote(); | |
this.closeOpenLink(); | |
var _local2:String = this.pApp.getOption("note_popup_class", "com.vpg.vpage.shell.tools.EditableNotePopup"); | |
var _local3:IEditableNotePopup = ClassUtils.createClass(_local2); | |
_local3.setIcon(_arg1.icon, _arg1.isNew); | |
_local3.addEventListener(Event.CLOSE, this.closeOpenNote); | |
_local3.addEventListener(PopupEvents.PRINT, this.printNote); | |
this._positionPopup((_local3 as DisplayObject), _arg1.icon.pMc); | |
addChild((_local3 as DisplayObject)); | |
this._activeNotePopup = _local3; | |
this.refreshFlow(); | |
} | |
public function openLinkEvent(_arg1:OpenItemEvent):void{ | |
this.closeOpenLink(); | |
this.closeOpenNote(); | |
var _local2:String = this.pApp.getOption("link_popup_class", "com.vpg.vpage.shell.tools.ModalEditableLinkPopup"); | |
var _local3:IEditableLinkPopup = ClassUtils.createClass(_local2); | |
_local3.addEventListener(Event.CLOSE, this.closeOpenLink); | |
_local3.setIcon(_arg1.icon, _arg1.isNew); | |
_local3.addEventListener(LinkEvent.LAUNCH, this._launchLink); | |
this._positionPopup((_local3 as DisplayObject), _arg1.icon.pMc); | |
addChild((_local3 as DisplayObject)); | |
this._activeLinkPopup = _local3; | |
this.refreshFlow(); | |
} | |
public function closeOpenLink(_arg1:Event=null):void{ | |
var _local2:DisplayObject; | |
if (this._activeLinkPopup != null){ | |
this._activeLinkPopup.removeEventListener(Event.CLOSE, this.closeOpenLink); | |
this._activeLinkPopup.destroy(); | |
_local2 = (this._activeLinkPopup as DisplayObject); | |
removeChild(_local2); | |
this._activeLinkPopup = null; | |
}; | |
} | |
public function closeOpenNote(_arg1:Event=null):void{ | |
var _local2:DisplayObject; | |
if (this._activeNotePopup != null){ | |
this._activeNotePopup.removeEventListener(Event.CLOSE, this.closeOpenNote); | |
this._activeNotePopup.removeEventListener(PopupEvents.PRINT, this.printNote); | |
this._activeNotePopup.destroy(); | |
_local2 = (this._activeNotePopup as DisplayObject); | |
removeChild(_local2); | |
this._activeNotePopup = null; | |
}; | |
} | |
public function closeMediaPlayers():void{ | |
if (this._audioPlayer){ | |
this.closeAudio(); | |
}; | |
if (this._videoPlayer){ | |
this.closeVideo(); | |
}; | |
} | |
public function setSinglePage(_arg1:String):void{ | |
this._loadPageCleanup(); | |
var _local2:String = this._getSwfName(_arg1); | |
this.pSP.loadPage(_local2, _arg1); | |
this.setNavText(this.pApp.unPadPage(_arg1)); | |
if (this._backgroundLoadNext()){ | |
this._preload(1); | |
}; | |
} | |
public function setDoublePage(_arg1:String, _arg2:String):void{ | |
this._loadPageCleanup(); | |
var _local3:String = this._getSwfName(_arg1); | |
this.pSP.loadPageLeft(_local3, _arg1); | |
var _local4:String = this._getSwfName(_arg2); | |
this.pSP.loadPageRight(_local4, _arg2); | |
this.setNavText(((this.pApp.unPadPage(_arg1) + "-") + this.pApp.unPadPage(_arg2))); | |
if (this._backgroundLoadNext()){ | |
this._preload(2); | |
}; | |
} | |
public function onPageContentLoad():void{ | |
} | |
public function onPageContentLoadStart():void{ | |
} | |
public function onZoomToRect():void{ | |
} | |
public function setNavText(_arg1:String):void{ | |
} | |
public function playAudioNoPlayer(_arg1:Object):void{ | |
var _local3:String; | |
var _local4:Number; | |
var _local5:Number; | |
var _local2:String = _arg1.file; | |
if (((!((_arg1.file.indexOf("http") == 0))) && (!((_arg1.noprefix == "1"))))){ | |
_local3 = this.pApp.getOption("audio_path", ""); | |
_local2 = (_local3 + _local2); | |
}; | |
if (((_arg1.start) && (_arg1.end))){ | |
_local4 = Number(_arg1.start); | |
_local5 = Number(_arg1.end); | |
this.soundPlayer.playSnippet(_local2, _local4, _local5); | |
} else { | |
this.soundPlayer.playSound(_local2); | |
}; | |
} | |
public function loadAudio(_arg1:Object):void{ | |
var _local4:String; | |
this.closeAudio(); | |
var _local2:String = this.pApp.getOption("audio_player_class", ""); | |
var _local3:String = _arg1.file; | |
if (_local3.indexOf("http") != 0){ | |
_local4 = this.pApp.getOption("audio_path", ""); | |
_local3 = (_local4 + _local3); | |
}; | |
if (!this._audioPlayer){ | |
this._audioPlayer = (ClassUtils.createClass(_local2) as IAudioPlayer); | |
this.mediaMgr.registerPlayer(this._audioPlayer); | |
this._audioPlayer.addEventListener(Event.CLOSE, this.closeAudio); | |
}; | |
this._audioPlayer.init(_local3, _arg1.playertitle); | |
addChild((this._audioPlayer as DisplayObject)); | |
this.refreshFlow(); | |
} | |
public function closeAudio(_arg1:Event=null):void{ | |
if (this._audioPlayer){ | |
this.mediaMgr.deregisterPlayer(this._audioPlayer); | |
this._audioPlayer.destroy(); | |
removeChild((this._audioPlayer as DisplayObject)); | |
this._audioPlayer.removeEventListener(Event.CLOSE, this.closeAudio); | |
this._audioPlayer = null; | |
}; | |
} | |
public function loadVideo(_arg1:Object):void{ | |
var _local4:String; | |
this.closeVideo(); | |
var _local2:String = this.pApp.getOption("video_player_class", ""); | |
var _local3:String = _arg1.file; | |
if (_local3.indexOf("http") != 0){ | |
_local4 = this.pApp.getOption("video_path", ""); | |
_local3 = ((this.pApp.getRootPath() + _local4) + _local3); | |
}; | |
if (!this._videoPlayer){ | |
this._videoPlayer = (ClassUtils.createClass(_local2) as IVideoPlayer); | |
this.mediaMgr.registerPlayer(this._videoPlayer); | |
this._videoPlayer.addEventListener(Event.CLOSE, this.closeVideo); | |
}; | |
this._videoPlayer.init(_local3, _arg1.playertitle); | |
addChild((this._videoPlayer as DisplayObject)); | |
this.refreshFlow(); | |
} | |
public function closeVideo(_arg1:Event=null):void{ | |
if (this._videoPlayer){ | |
this.mediaMgr.deregisterPlayer(this._videoPlayer); | |
this._videoPlayer.destroy(); | |
this._videoPlayer.removeEventListener(Event.CLOSE, this.closeVideo); | |
removeChild((this._videoPlayer as DisplayObject)); | |
this._videoPlayer = null; | |
}; | |
} | |
public function loadSearch(_arg1:String=""):void{ | |
var _local2:String; | |
this.closeSearch(); | |
if (!this._searchWindow){ | |
_local2 = this.pApp.getOption("search_window_class", ""); | |
this._searchWindow = (ClassUtils.createClass(_local2) as ISearchWindow); | |
this._searchWindow.addEventListener(Event.CLOSE, this.closeSearch); | |
this._searchWindow.addEventListener(SearchHitEvent.LOAD_SEARCH_HIT, this._loadSearchHitEvent); | |
this._searchWindow.init(this.pApp.getOption("search_servlet", ""), this.pApp.getBookID()); | |
}; | |
if (_arg1){ | |
this._searchWindow.searchFor(_arg1); | |
}; | |
addChild((this._searchWindow as DisplayObject)); | |
this.refreshFlow(); | |
} | |
public function closeSearch(_arg1:Event=null):void{ | |
if (this._searchWindow){ | |
this._searchWindow.destroy(); | |
this._searchWindow.removeEventListener(Event.CLOSE, this.closeSearch); | |
removeChild((this._searchWindow as DisplayObject)); | |
this._searchWindow = null; | |
}; | |
} | |
public function loadGlossary(_arg1:String=""):void{ | |
var _local2:String; | |
var _local3:String; | |
this.closeGlossary(); | |
this.closeIndex(); | |
if (!this._glossaryWindow){ | |
_local2 = this.pApp.getOption("glossary_window_class", ""); | |
this._glossaryWindow = (ClassUtils.createClass(_local2) as IGlossaryWindow); | |
this._glossaryWindow.addEventListener(Event.CLOSE, this.closeGlossary); | |
_local3 = (((this.pApp.getRootPath() + "data/") + this.pApp.getBookID()) + "_glossary.xml"); | |
this._glossaryWindow.init(_local3); | |
}; | |
if (_arg1){ | |
this._glossaryWindow.goToTerm(_arg1); | |
}; | |
addChild((this._glossaryWindow as DisplayObject)); | |
this.refreshFlow(); | |
} | |
public function closeGlossary(_arg1:Event=null):void{ | |
if (this._glossaryWindow){ | |
this._glossaryWindow.destroy(); | |
this._glossaryWindow.removeEventListener(Event.CLOSE, this.closeGlossary); | |
removeChild((this._glossaryWindow as DisplayObject)); | |
this._glossaryWindow = null; | |
}; | |
} | |
public function loadIndex(_arg1:String=""):void{ | |
var _local2:String; | |
this.closeIndex(); | |
this.closeGlossary(); | |
if (!this._indexWindow){ | |
_local2 = this.pApp.getOption("index_window_class", ""); | |
this._indexWindow = (ClassUtils.createClass(_local2) as IIndexWindow); | |
this._indexWindow.addEventListener(Event.CLOSE, this.closeIndex); | |
this._indexWindow.addEventListener(IndexEvents.GOTO_PAGE, this._indexGotoPageEvent); | |
this._indexWindow.init((this.pApp.getRootPath() + "data/index/")); | |
}; | |
addChild((this._indexWindow as DisplayObject)); | |
this.refreshFlow(); | |
} | |
public function closeIndex(_arg1:Event=null):void{ | |
if (this._indexWindow){ | |
this._indexWindow.destroy(); | |
this._indexWindow.removeEventListener(Event.CLOSE, this.closeGlossary); | |
removeChild((this._indexWindow as DisplayObject)); | |
this._indexWindow = null; | |
}; | |
} | |
public function openURL(_arg1:Object):void{ | |
var _local2:int = parseInt(this.pApp.getOption("default_url_popup_width", "960")); | |
var _local3:int = parseInt(this.pApp.getOption("default_url_popup_height", "720")); | |
if (_arg1.width){ | |
_local2 = _arg1.width; | |
}; | |
if (_arg1.height){ | |
_local3 = _arg1.height; | |
}; | |
var _local4:String = _arg1.href; | |
if (_local4.indexOf("http") != 0){ | |
_local4 = (this.pApp.getRootPath() + _local4); | |
}; | |
if (ExternalInterface.available){ | |
NetU.openJSWindow(_local4, _local2, _local3); | |
} else { | |
NetU.openURL(_local4, "_blank"); | |
}; | |
} | |
public function resize(_arg1:Number, _arg2:Number):void{ | |
if (this.bg){ | |
this.bg.width = _arg1; | |
this.bg.height = _arg2; | |
}; | |
if (this._banner){ | |
this._banner.resize(_arg1, _arg2); | |
}; | |
if (this._activeNotePopup){ | |
this._activeNotePopup.setScreenSize(_arg1, _arg2); | |
}; | |
if ((this._audioPlayer is IAudioPlayer)){ | |
this._audioPlayer.setScreenSize(_arg1, _arg2); | |
}; | |
if ((this._videoPlayer is IVideoPlayer)){ | |
this._videoPlayer.setScreenSize(_arg1, _arg2); | |
}; | |
if ((this._promptBlocker is Square)){ | |
this._promptBlocker.setSize(_arg1, _arg2); | |
}; | |
if ((this._confirmationPrompt is IConfirmationPrompt)){ | |
this._confirmationPrompt.setScreenSize(_arg1, _arg2); | |
}; | |
if ((this._searchWindow is ISearchWindow)){ | |
this._searchWindow.setScreenSize(_arg1, _arg2); | |
}; | |
if ((this._glossaryWindow is IGlossaryWindow)){ | |
this._glossaryWindow.setScreenSize(_arg1, _arg2); | |
}; | |
if ((this._indexWindow is IIndexWindow)){ | |
this._indexWindow.setScreenSize(_arg1, _arg2); | |
}; | |
this._uiWidth = _arg1; | |
this._uiHeight = _arg2; | |
} | |
public function refreshFlow():void{ | |
if (((!(isNaN(this.getUIWidth()))) && (!(isNaN(this.getUIHeight()))))){ | |
this.resize(this.getUIWidth(), this.getUIHeight()); | |
}; | |
} | |
public function doStandardButtonHookup(_arg1:MovieClip, _arg2:String=""):void{ | |
if ((((_arg1 == null)) || ((_arg1 == undefined)))){ | |
trace("Main.doStandardButtonHookup: button is undefined or null."); | |
return; | |
}; | |
DisplayU.buttonify(_arg1); | |
if (_arg1.name == "prev_btn"){ | |
_arg1.addEventListener(MouseEvent.CLICK, this.prevPage); | |
} else { | |
if (_arg1.name == "next_btn"){ | |
_arg1.addEventListener(MouseEvent.CLICK, this.nextPage); | |
} else { | |
if (_arg1.name == "help_btn"){ | |
_arg1.addEventListener(MouseEvent.CLICK, this.doHelp); | |
} else { | |
if (_arg1.name == "zoom_in_btn"){ | |
_arg1.addEventListener(MouseEvent.CLICK, this.zoomIn); | |
} else { | |
if (_arg1.name == "zoom_out_btn"){ | |
_arg1.addEventListener(MouseEvent.CLICK, this.zoomOut); | |
} else { | |
if (_arg1.name == "single_page_btn"){ | |
_arg1.addEventListener(MouseEvent.CLICK, this.singlePageMode); | |
} else { | |
if (_arg1.name == "double_page_btn"){ | |
_arg1.addEventListener(MouseEvent.CLICK, this.doublePageMode); | |
} else { | |
if (_arg1.name == "zoom_to_100_btn"){ | |
_arg1.addEventListener(MouseEvent.CLICK, this.zoomTo100); | |
} else { | |
if (_arg1.name == "back_btn"){ | |
_arg1.addEventListener(MouseEvent.CLICK, this.historyBack); | |
} else { | |
if (_arg1.name == "forward_btn"){ | |
_arg1.addEventListener(MouseEvent.CLICK, this.historyForward); | |
} else { | |
if (_arg1.name == "glossary_btn"){ | |
_arg1.addEventListener(MouseEvent.CLICK, this.loadGlossary); | |
} else { | |
if (_arg1.name == "index_btn"){ | |
_arg1.addEventListener(MouseEvent.CLICK, this.loadIndex); | |
} else { | |
trace((("Main.doStandardButtonHookup: Button " + _arg1.name) + " not found.")); | |
}; | |
}; | |
}; | |
}; | |
}; | |
}; | |
}; | |
}; | |
}; | |
}; | |
}; | |
}; | |
if (_arg2 != ""){ | |
ToolTipBuilder.registerButton(_arg1, _arg2); | |
}; | |
} | |
public function doStandardTextFieldHookup(_arg1:TextField):void{ | |
if (_arg1.name == "nav_tf"){ | |
SubmitOnEnterField.registerField(_arg1, this.gotoPageEntered); | |
SelectOnFocusField.registerField(_arg1, null); | |
} else { | |
trace((("Main.doStandardTextFieldHookup: Text Field " + _arg1.name) + " not found.")); | |
}; | |
} | |
public function gotoPageEntered(_arg1:TextField):void{ | |
this.pApp.gotoPage(_arg1.text); | |
} | |
public function prevPage(_arg1:Event):void{ | |
this.pApp.prevPage(); | |
} | |
public function nextPage(_arg1:Event):void{ | |
this.pApp.nextPage(); | |
} | |
public function doHelp(_arg1:Event):void{ | |
var _local2:String = this.pApp.getOption("help_file", "help.html"); | |
var _local3:Object = new Object(); | |
_local3.href = _local2; | |
this.openURL(_local3); | |
} | |
public function zoomIn(_arg1:Event):void{ | |
} | |
public function zoomOut(_arg1:Event):void{ | |
} | |
public function zoomTo100(_arg1:Event=null):void{ | |
this.pSP.fitScreen(); | |
this.zoomChanged(); | |
} | |
public function singlePageMode(_arg1:Event):void{ | |
this.pApp.setSinglePageMode(); | |
this.pageViewChanged(); | |
} | |
public function doublePageMode(_arg1:Event):void{ | |
this.pApp.setDoublePageMode(); | |
this.pageViewChanged(); | |
} | |
public function pageViewChanged():void{ | |
} | |
public function zoomChanged():void{ | |
} | |
public function printNote(_arg1:EventWithParam):void{ | |
} | |
public function showPrompt(_arg1:String, _arg2:Boolean=true, _arg3:Function=null, _arg4:Function=null, _arg5:String=""):void{ | |
this._removePrompt(); | |
var _local6:String = this.pApp.getOption("confirmation_prompt_class", "com.vpg.vpage.shell.prompt.BasicPrompt"); | |
this._confirmationPrompt = ClassUtils.createClass(_local6); | |
if (this._confirmationPrompt == null){ | |
return; | |
}; | |
this._confirmationPrompt.addEventListener(PromptEvent.YES, this._promptYesEvent); | |
this._confirmationPrompt.addEventListener(PromptEvent.NO, this._promptNoEvent); | |
this._confirmationPrompt.setCallbacks(_arg3, _arg4); | |
this._confirmationPrompt.setMessage(_arg1); | |
this._confirmationPrompt.setTitle(_arg5); | |
if (_arg2){ | |
this._confirmationPrompt.useOkButton(); | |
} else { | |
this._confirmationPrompt.useYesNoButtons(); | |
}; | |
var _local7:Number = 0; | |
var _local8:Number = 0.3; | |
if (this.pApp.getStyleMgr().containsKey("confirmation_blocker_color")){ | |
_local7 = this.pApp.getStyleMgr().getNumber("confirmation_blocker_color"); | |
}; | |
if (this.pApp.getStyleMgr().containsKey("confirmation_blocker_alpha")){ | |
_local8 = this.pApp.getStyleMgr().getNumber("confirmation_blocker_alpha"); | |
}; | |
this._promptBlocker = new Square(_local7, _local8); | |
this.refreshFlow(); | |
addChild(this._promptBlocker); | |
addChild(this._confirmationPrompt.getArt()); | |
} | |
public function formatMessageAndCode(_arg1:String, _arg2:String):String{ | |
var _local3 = ""; | |
if ((((((_arg2 == "")) || ((_arg2 == null)))) || ((this.pApp.getOption("show_error_codes", "1") == "0")))){ | |
_local3 = ""; | |
} else { | |
_local3 = (("(Code: " + _arg2) + ")"); | |
}; | |
if (_local3 == ""){ | |
return (_arg1); | |
}; | |
return (((_arg1 + " ") + _local3)); | |
} | |
public function historyBack(_arg1:Event):void{ | |
this.pApp.historyBack(); | |
} | |
public function historyForward(_arg1:Event):void{ | |
this.pApp.historyForward(); | |
} | |
public function isPageCurrentlyLoading():Boolean{ | |
return (this._isPageCurrentlyLoading); | |
} | |
public function doBackendHookups():void{ | |
this.pSP.drawingOverlayMgr.setDataStore(this.pApp.getDataStore()); | |
this.pSP.pageTextMgr.setDataStore(this.pApp.getDataStore()); | |
} | |
private function _loadBanner():void{ | |
var _local1:String; | |
if (this.pApp.getOption("load_banner", "1") == "1"){ | |
_local1 = (((this.pApp.getRootPath() + "data/swf/") + this.pApp.getBookID()) + "_banner.swf"); | |
NetU.doArtLoad(_local1, this._bannerLoaded, this._bannerLoaded); | |
} else { | |
this._bannerLoaded(null); | |
}; | |
} | |
private function _bannerLoaded(_arg1:Event):void{ | |
var _local2:LoaderInfo; | |
if ((_arg1 is IOErrorEvent)){ | |
} else { | |
if (_arg1 != null){ | |
_local2 = (_arg1.currentTarget as LoaderInfo); | |
this._banner = new Banner(_local2.content); | |
addChild(this._banner); | |
}; | |
}; | |
this._sharedComponentsDone(); | |
} | |
private function _sharedComponentsDone():void{ | |
this.initInterface(); | |
} | |
private function _attachScrollPane():void{ | |
var _local1:Array; | |
var _local2:Array; | |
var _local3:Array; | |
var _local4:int; | |
var _local5:int; | |
if (this.pApp.getOption("preload_pages", "0") == "1"){ | |
this.pSP = new PreloadedPageView(this.pApp, this.getAdditionalLayerFactory()); | |
_local1 = this.pApp.getPages(); | |
_local2 = new Array(); | |
_local3 = new Array(); | |
_local4 = 0; | |
while (_local4 < _local1.length) { | |
if (_local1[_local4] != ""){ | |
_local3.push(this.pApp.padPage(_local1[_local4])); | |
_local2.push(this._getSwfName(_local1[_local4])); | |
}; | |
_local4++; | |
}; | |
this.pSP.setOrder(_local3); | |
_local5 = parseInt(this.pApp.getOption("initial_pages_to_preload", "-1")); | |
if (_local5 != -1){ | |
_local3 = _local3.slice(0, _local5); | |
_local2 = _local2.slice(0, _local5); | |
}; | |
this.pSP.addEventListener(PreloadedPageView.LOADED, this._pagesLoaded); | |
this.pSP.addEventListener(PreloadedPageView.START, this._pageContentLoadStartEvent); | |
this.pSP.screenReaderMgr.setPageOrder(this.pApp.getPageIDs()); | |
this.doBackendHookups(); | |
this.pSP.load(_local2, _local3); | |
} else { | |
this.pSP = new GenericPageView(this.pApp); | |
this.doBackendHookups(); | |
this.pSP.setAdditionalLayerFactory(this.getAdditionalLayerFactory()); | |
this.pSP.addEventListener(AbstractPageView.START, this._pageContentLoadStartEvent); | |
this.pSP.screenReaderMgr.setPageOrder(this.pApp.getPageIDs()); | |
}; | |
this.pSP.addEventListener(Event.COMPLETE, this._pageContentLoadEvent); | |
this.pSP.addEventListener(ZoomToRectEvent.ZOOM, this._rectZoomEvent); | |
this.pSP.drawingOverlayMgr.addEventListener(DrawingOverlay.OPEN_NOTE, this.openNoteEvent); | |
this.pSP.drawingOverlayMgr.addEventListener(DrawingOverlay.OPEN_LINK, this.openLinkEvent); | |
this.pSP.screenReaderMgr.setMediaManager(this.mediaMgr); | |
addChild(this.pSP); | |
if ((this.pSP is GenericPageView)){ | |
this._pagesLoaded(null); | |
}; | |
} | |
private function _rectZoomEvent(_arg1:Event):void{ | |
this.zoomChanged(); | |
this.onZoomToRect(); | |
} | |
protected function _getSwfName(_arg1:String):String{ | |
_arg1 = this.pApp.padPage(_arg1); | |
return ((((((this.pApp.getRootPath() + "data/swf/") + this.pApp.getBookID()) + "/") + _arg1) + ".swf")); | |
} | |
private function _pageContentLoadEvent(_arg1:Event):void{ | |
if (!this._firstPageLoaded){ | |
this.zoomTo100(); | |
this._firstPageLoaded = true; | |
}; | |
this._isPageCurrentlyLoading = false; | |
this.onPageContentLoad(); | |
} | |
private function _pageContentLoadStartEvent(_arg1:Event):void{ | |
this._isPageCurrentlyLoading = true; | |
this.onPageContentLoadStart(); | |
} | |
private function _launchLink(_arg1:LinkEvent):void{ | |
var _local2:String = _arg1.url; | |
var _local3:Object = new Object(); | |
_local3.href = _local2; | |
this.openURL(_local3); | |
} | |
private function _positionPopup(_arg1:DisplayObject, _arg2:DisplayObject):void{ | |
var _local3:Rectangle = _arg2.getBounds(this); | |
_arg1.y = (_local3.bottom + 5); | |
_arg1.x = ((_local3.x + (_local3.width / 2)) - (_arg1.width / 2)); | |
if (_arg1.y < 0){ | |
_arg1.y = 0; | |
} else { | |
if ((_arg1.y + _arg1.height) > this.getUIHeight()){ | |
_arg1.y = (this.getUIHeight() - _arg1.height); | |
}; | |
}; | |
if (_arg1.x < 0){ | |
_arg1.x = 0; | |
} else { | |
if ((_arg1.x + _arg1.width) > this.getUIWidth()){ | |
_arg1.x = (this.getUIWidth() - _arg1.width); | |
}; | |
}; | |
} | |
private function _pagesLoaded(_arg1:Event):void{ | |
this.pSP.removeEventListener(PreloadedPageView.LOADED, this._pagesLoaded); | |
this._loadBanner(); | |
} | |
private function _backgroundLoadNext():Boolean{ | |
var _local1:String = this.pApp.getOption("background_page_load", "none"); | |
if (_local1 == "next"){ | |
return (true); | |
}; | |
return (false); | |
} | |
private function _preload(_arg1:int=1):void{ | |
var _local8:String; | |
var _local9:String; | |
var _local2:Array = new Array(); | |
var _local3:int = this.pApp.getCurrentPageListIndex(); | |
var _local4:int = (_local3 + 1); | |
if (!this.pApp.isSinglePageMode()){ | |
_local4++; | |
}; | |
var _local5:Array = this.pApp.getPartialPages(_local4, _arg1); | |
var _local6:Array = new Array(); | |
var _local7:int; | |
while (_local7 < _local5.length) { | |
_local8 = (_local5[_local7] as String); | |
_local8 = this.pApp.padPage(_local8); | |
_local6.push(_local8); | |
_local9 = this._getSwfName(_local8); | |
_local2.push(_local9); | |
_local7++; | |
}; | |
this.pSP.load(_local2, _local6); | |
} | |
private function _promptYesEvent(_arg1:Event):void{ | |
this._removePrompt(); | |
} | |
private function _promptNoEvent(_arg1:Event):void{ | |
this._removePrompt(); | |
} | |
private function _removePrompt():void{ | |
if (this._confirmationPrompt){ | |
DisplayU.removeFromDisplayList(this._promptBlocker); | |
DisplayU.removeFromDisplayList(this._confirmationPrompt.getArt()); | |
this._confirmationPrompt.removeEventListener(PromptEvent.YES, this._promptYesEvent); | |
this._confirmationPrompt.removeEventListener(PromptEvent.NO, this._promptNoEvent); | |
this._confirmationPrompt = null; | |
this._promptBlocker = null; | |
}; | |
} | |
private function _loadPageCleanup():void{ | |
this.closeOpenNote(); | |
this.closeOpenLink(); | |
this.pSP.searchLayerMgr.highlightHits(null); | |
this.mediaMgr.stopAll(); | |
this.pSP.screenReaderMgr.clearActiveLayer(); | |
} | |
private function _loadSearchHitEvent(_arg1:SearchHitEvent):void{ | |
this.loadSearchHit(_arg1.hit); | |
} | |
private function _indexGotoPageEvent(_arg1:EventWithParam):void{ | |
this.pApp.gotoPage((_arg1.param as String)); | |
} | |
} | |
}//package com.vpg.vpage.shell | |
package com.vpg.vpage.shell { | |
import flash.display.*; | |
public class Banner extends Sprite { | |
private var _art:DisplayObject; | |
public function Banner(_arg1:DisplayObject){ | |
this._art = _arg1; | |
addChild(this._art); | |
} | |
public function resize(_arg1:Number, _arg2:Number):void{ | |
var _local3 = this._art; | |
_local3["setBoundingBox"](0, 0, _arg1, _arg2); | |
} | |
} | |
}//package com.vpg.vpage.shell | |
package com.vpg.vpage.shell.screenreader { | |
import com.vpg.vpage.utils.iterator.*; | |
public class Sentence { | |
private var _words:Array; | |
public function Sentence(){ | |
this._words = new Array(); | |
} | |
public function addWord(_arg1:WordInfo){ | |
this._words.push(_arg1); | |
} | |
public function getStartTime():Number{ | |
return (this._words[0].getStartTime()); | |
} | |
public function getWordIterator():IIterator{ | |
return (new ArrayIterator(this._words)); | |
} | |
public function getWord(_arg1:Number):WordInfo{ | |
return (this._words[_arg1]); | |
} | |
public function getWords():Array{ | |
return (this._words.slice()); | |
} | |
public function toString():String{ | |
var _local1 = ""; | |
var _local2:int; | |
while (_local2 < this._words.length) { | |
_local1 = ((_local1 + this._words[_local2].toString()) + " "); | |
_local2++; | |
}; | |
return (_local1); | |
} | |
public function enableClickableWords():void{ | |
var _local1:int; | |
while (_local1 < this._words.length) { | |
this._words[_local1].enableClickableWords(); | |
_local1++; | |
}; | |
} | |
public function disableClickableWords():void{ | |
var _local1:int; | |
while (_local1 < this._words.length) { | |
this._words[_local1].disableClickableWords(); | |
_local1++; | |
}; | |
} | |
} | |
}//package com.vpg.vpage.shell.screenreader | |
package com.vpg.vpage.shell.screenreader { | |
public class LibraryIconCallbacks implements IIconCallbacks { | |
private var _sr:ScreenReader; | |
public function LibraryIconCallbacks(_arg1:ScreenReader){ | |
this._sr = _arg1; | |
} | |
public function playClicked(_arg1:Flow):void{ | |
this._sr.startFlowPlay(_arg1); | |
} | |
public function stopClicked(_arg1:Flow):void{ | |
this._sr.externalHalt(); | |
} | |
} | |
}//package com.vpg.vpage.shell.screenreader | |
package com.vpg.vpage.shell.screenreader { | |
import flash.display.*; | |
import com.vpg.vpage.shell.*; | |
import flash.events.*; | |
import com.vpg.vpage.utils.*; | |
import com.vpg.vpage.utils.mediamgr.*; | |
public class ScreenReaderMulti extends Sprite implements IMediaPlayer { | |
public static const LAYER_PLAY_COMPLETE:String = "layerPlayComplete"; | |
public static const LAYER_PLAY_PROGRESS:String = "layerPlayProgress"; | |
public static const FLOW_PLAY_COMPLETE:String = "flowPlayComplete"; | |
public static const FLOW_PLAY_PROGRESS:String = "flowPlayProgress"; | |
public static const PLAY_START:String = "playStart"; | |
public static const PAUSE:String = "pauseEvent"; | |
public static const READY:String = "readerReady"; | |
private static const MODE_NORMAL:String = "normal"; | |
private var _currentMode:String; | |
private var _app:App; | |
private var _readerMap:HashMap; | |
private var _contentPath:String; | |
private var _pg:String; | |
private var _activeLayer:ScreenReader; | |
private var _modesToLoad:Array; | |
private var _modesLoaded:int; | |
public function ScreenReaderMulti(_arg1:App){ | |
this._app = _arg1; | |
this._readerMap = new HashMap(); | |
this._currentMode = MODE_NORMAL; | |
} | |
public function init(_arg1:String, _arg2:String):void{ | |
this._contentPath = _arg1; | |
this._pg = _arg2; | |
var _local3:String = this._app.getOption("screen_reader_modes", MODE_NORMAL); | |
this._modesToLoad = _local3.split(","); | |
this._modesLoaded = 0; | |
this._tryLoadNextMode(null); | |
} | |
public function getPage():String{ | |
return (this._pg); | |
} | |
public function isReaderPlaying():Boolean{ | |
var _local3:ScreenReader; | |
var _local1:Array = this.getLayers(); | |
var _local2:int; | |
while (_local2 < _local1.length) { | |
_local3 = (_local1[_local2] as ScreenReader); | |
if (_local3.isReaderPlaying()){ | |
return (true); | |
}; | |
_local2++; | |
}; | |
return (false); | |
} | |
public function setMode(_arg1:String):void{ | |
this._currentMode = _arg1; | |
var _local2:Boolean; | |
var _local3:LocationInfo; | |
if (this._activeLayer){ | |
_local2 = this._activeLayer.isReaderPlaying(); | |
if (this._app.getOption("sr_seamless_modes", "1") == "1"){ | |
_local3 = this._activeLayer.getLocationInfo(); | |
}; | |
this._activeLayer.stopAudioAndClearHighlights(); | |
this._activeLayer.hide(); | |
}; | |
this._activeLayer = this._readerMap.get(_arg1); | |
if (this._activeLayer){ | |
this._activeLayer.show(); | |
if (_local2){ | |
this._activeLayer.beginPlay(_local3); | |
}; | |
}; | |
} | |
public function externalHalt():void{ | |
if (this._activeLayer){ | |
this._activeLayer.externalHalt(); | |
}; | |
} | |
public function playActiveFlowFrom(_arg1:Number):void{ | |
if (this._activeLayer){ | |
this._activeLayer.playActiveFlowFrom(_arg1); | |
}; | |
} | |
public function setWordDelay(_arg1:Number):void{ | |
var _local2:Array = this.getLayers(); | |
var _local3:int; | |
while (_local3 < _local2.length) { | |
_local2[_local3].setWordDelay(_arg1); | |
_local3++; | |
}; | |
} | |
public function setSentenceDelay(_arg1:Number):void{ | |
var _local2:Array = this.getLayers(); | |
var _local3:int; | |
while (_local3 < _local2.length) { | |
_local2[_local3].setSentenceDelay(_arg1); | |
_local3++; | |
}; | |
} | |
public function setVolume(_arg1:Number):void{ | |
var _local2:Array = this.getLayers(); | |
var _local3:int; | |
while (_local3 < _local2.length) { | |
_local2[_local3].setVolume(_arg1); | |
_local3++; | |
}; | |
} | |
public function changeSyncColors(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number):void{ | |
var _local7:Array = this.getLayers(); | |
var _local8:int; | |
while (_local8 < _local7.length) { | |
_local7[_local8].changeSyncColors(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6); | |
_local8++; | |
}; | |
} | |
public function enableWordSwf(_arg1:Boolean, _arg2:Boolean):void{ | |
var _local3:Array = this.getLayers(); | |
var _local4:int; | |
while (_local4 < _local3.length) { | |
_local3[_local4].enableWordSwf(_arg1, _arg2); | |
_local4++; | |
}; | |
} | |
public function hide():void{ | |
visible = false; | |
} | |
public function show():void{ | |
visible = true; | |
} | |
public function destroy():void{ | |
var _local1:Array = this.getLayers(); | |
var _local2:int; | |
while (_local2 < _local1.length) { | |
_local1[_local2].destroy(); | |
_local2++; | |
}; | |
} | |
public function beginPlay():void{ | |
if (this._activeLayer){ | |
this._activeLayer.beginPlay(); | |
}; | |
} | |
public function pause():void{ | |
if (this._activeLayer){ | |
this._activeLayer.pause(); | |
}; | |
} | |
public function stopAudioAndClearHighlights():void{ | |
if (this._activeLayer){ | |
this._activeLayer.stopAudioAndClearHighlights(); | |
}; | |
} | |
public function isReady():Boolean{ | |
var _local1:Array = this.getLayers(); | |
var _local2:int; | |
while (_local2 < _local1.length) { | |
if (!_local1[_local2].isReady()){ | |
return (false); | |
}; | |
_local2++; | |
}; | |
return (true); | |
} | |
public function hasContent():Boolean{ | |
var _local1:Array = this.getLayers(); | |
var _local2:int; | |
while (_local2 < _local1.length) { | |
if (!_local1[_local2].hasContent()){ | |
return (false); | |
}; | |
_local2++; | |
}; | |
return (true); | |
} | |
public function getTotalTime():Number{ | |
return (this._activeLayer.getTotalTime()); | |
} | |
public function getActiveFlowTotalTime():Number{ | |
return (this._activeLayer.getActiveFlowTotalTime()); | |
} | |
public function getCurrentTime():Number{ | |
return (this._activeLayer.getCurrentTime()); | |
} | |
public function goToTime(_arg1:Number):void{ | |
this._activeLayer.goToTime(_arg1); | |
} | |
override public function toString():String{ | |
return (("ScreenReaderMulti: pg " + this.getPage())); | |
} | |
private function getLayers():Array{ | |
return (this._readerMap.values()); | |
} | |
private function _layerPlayComplete(_arg1:Event):void{ | |
dispatchEvent(new Event(LAYER_PLAY_COMPLETE)); | |
} | |
private function _flowPlayStart(_arg1:Event):void{ | |
dispatchEvent(new Event(PLAY_START)); | |
dispatchEvent(new Event(MediaManager.ON_PLAY)); | |
} | |
private function _layerPlayProgress(_arg1:EventWithParam):void{ | |
dispatchEvent(new EventWithParam(LAYER_PLAY_PROGRESS, _arg1.param)); | |
} | |
private function _flowPlayComplete(_arg1:Event):void{ | |
dispatchEvent(new Event(FLOW_PLAY_COMPLETE)); | |
} | |
private function _flowPlayProgress(_arg1:EventWithParam):void{ | |
dispatchEvent(new EventWithParam(FLOW_PLAY_PROGRESS, _arg1.param)); | |
} | |
private function _readerPauseEvent(_arg1:Event):void{ | |
dispatchEvent(new Event(PAUSE)); | |
} | |
private function _tryLoadNextMode(_arg1:Event):void{ | |
var _local2:ScreenReader; | |
var _local3:String; | |
var _local4:ScreenReader; | |
var _local5:String; | |
var _local6:String; | |
var _local7:String; | |
var _local8:String; | |
if (_arg1 != null){ | |
_local2 = (_arg1.currentTarget as ScreenReader); | |
_local2.removeEventListener(Event.COMPLETE, this._tryLoadNextMode); | |
this._modesLoaded++; | |
}; | |
if (this._modesLoaded == this._modesToLoad.length){ | |
this.setMode(this._currentMode); | |
dispatchEvent(new Event(Event.COMPLETE)); | |
} else { | |
_local3 = this._modesToLoad[this._modesLoaded]; | |
_local4 = new ScreenReader(this._app); | |
_local4.addEventListener(ScreenReader.LAYER_PLAY_COMPLETE, this._layerPlayComplete); | |
_local4.addEventListener(ScreenReader.LAYER_PLAY_PROGRESS, this._layerPlayProgress); | |
_local4.addEventListener(ScreenReader.FLOW_PLAY_COMPLETE, this._flowPlayComplete); | |
_local4.addEventListener(ScreenReader.FLOW_PLAY_PROGRESS, this._flowPlayProgress); | |
_local4.addEventListener(ScreenReader.PLAY_START, this._flowPlayStart); | |
_local4.addEventListener(ScreenReader.PAUSE, this._readerPauseEvent); | |
_local4.addEventListener(ScreenReader.READY, this._readerReadyEvent); | |
addChild(_local4); | |
_local4.visible = false; | |
this._readerMap.put(_local3, _local4); | |
_local4.addEventListener(Event.COMPLETE, this._tryLoadNextMode); | |
_local5 = ("_" + _local3); | |
if (_local3 == MODE_NORMAL){ | |
_local5 = ""; | |
}; | |
_local6 = ((((this._contentPath + "xml/") + this._pg) + _local5) + ".xml"); | |
_local7 = (this._contentPath + "audio/"); | |
if (this._app.getOption("use_word_swfs", "0") == "1"){ | |
_local8 = (((this._contentPath + "swf/") + this._pg) + ".swf"); | |
}; | |
_local4.init(_local6, _local7, _local8); | |
}; | |
} | |
private function _readerReadyEvent(_arg1:Event):void{ | |
dispatchEvent(new Event(READY)); | |
} | |
} | |
}//package com.vpg.vpage.shell.screenreader | |
package com.vpg.vpage.shell.screenreader { | |
import flash.display.*; | |
import com.vpg.vpage.shell.*; | |
import flash.net.*; | |
import flash.events.*; | |
import com.vpg.vpage.utils.*; | |
import com.vpg.vpage.utils.iterator.*; | |
import com.vpg.vpage.utils.mediamgr.*; | |
public class ScreenReader extends MovieClip implements IMediaPlayer { | |
public static const LAYER_PLAY_PROGRESS:String = "playProgress"; | |
public static const LAYER_PLAY_COMPLETE:String = "playComplete"; | |
public static const FLOW_PLAY_PROGRESS:String = "flowPlayProgress"; | |
public static const FLOW_PLAY_COMPLETE:String = "flowPlayComplete"; | |
public static const PLAY_START:String = "playStart"; | |
public static const READY:String = "readerReady"; | |
public static const PAUSE:String = "pauseEvent"; | |
private var _file:String; | |
private var _wordHolder:MovieClip; | |
private var _buttonHolder:MovieClip; | |
private var _xmlAdapter:StandardXMLAdapter; | |
private var _highlighter:Highlighter; | |
private var _swfFile:String; | |
private var _iconMgr:IIconManager; | |
private var _audioPath:String; | |
private var _activeflow:Flow; | |
private var _lastActiveFlow:Flow; | |
private var _clickableWordMap:HashMap; | |
private var _delayTime:Number = 0; | |
private var _sentenceDelayTime:Number = 0; | |
private var _volume:Number = 1; | |
private var _app:App; | |
private var _pauseTime:Number = 0; | |
private var _flowsLoaded:int = 0; | |
private var _loadError:Boolean = false; | |
public function ScreenReader(_arg1:App){ | |
this._app = _arg1; | |
this._clickableWordMap = new HashMap(); | |
this._highlighter = new Highlighter(); | |
this._highlighter.setWordColor(this._app.getStyleMgr().getNumber("screen_reader_word"), this._app.getStyleMgr().getNumber("screen_reader_word_alpha")); | |
this._highlighter.setSentenceColor(this._app.getStyleMgr().getNumber("screen_reader_sentence"), this._app.getStyleMgr().getNumber("screen_reader_sentence_alpha")); | |
this._highlighter.setPlayObjColor(this._app.getStyleMgr().getNumber("screen_reader_playobj"), this._app.getStyleMgr().getNumber("screen_reader_playobj_alpha")); | |
this._highlighter.enableWordSwf((this._app.getOption("enable_word_swf_for_words", "0") == "1"), (this._app.getOption("enable_word_swf_for_sentences", "0") == "1")); | |
addChild(this._highlighter); | |
this._wordHolder = new MovieClip(); | |
addChild(this._wordHolder); | |
this._buttonHolder = new MovieClip(); | |
addChild(this._buttonHolder); | |
mouseEnabled = false; | |
} | |
public function isReaderPlaying():Boolean{ | |
if (this._activeflow){ | |
if (this._activeflow.isActive()){ | |
return (true); | |
}; | |
}; | |
return (false); | |
} | |
public function changeSyncColors(_arg1:uint, _arg2:int, _arg3:uint, _arg4:int, _arg5:uint, _arg6:int):void{ | |
this._highlighter.setWordColor(_arg1, _arg2); | |
this._highlighter.setSentenceColor(_arg3, _arg4); | |
this._highlighter.setPlayObjColor(_arg5, _arg6); | |
} | |
public function enableWordSwf(_arg1:Boolean, _arg2:Boolean):void{ | |
this._highlighter.enableWordSwf(_arg1, _arg2); | |
} | |
public function setWordDelay(_arg1:int):void{ | |
var _local2:Array; | |
var _local3:int; | |
if (this._xmlAdapter){ | |
_local2 = this._xmlAdapter.getFlows(); | |
_local3 = 0; | |
while (_local3 < _local2.length) { | |
_local2[_local3].setWordDelay(_arg1); | |
_local3++; | |
}; | |
}; | |
this._delayTime = _arg1; | |
} | |
public function setSentenceDelay(_arg1:int):void{ | |
var _local2:Array; | |
var _local3:int; | |
if (this._xmlAdapter){ | |
_local2 = this._xmlAdapter.getFlows(); | |
_local3 = 0; | |
while (_local3 < _local2.length) { | |
_local2[_local3].setSentenceDelay(_arg1); | |
_local3++; | |
}; | |
}; | |
this._sentenceDelayTime = _arg1; | |
} | |
public function setVolume(_arg1:Number):void{ | |
var _local2:Array; | |
var _local3:int; | |
if (this._xmlAdapter){ | |
_local2 = this._xmlAdapter.getFlows(); | |
_local3 = 0; | |
while (_local3 < _local2.length) { | |
_local2[_local3].setVolume(_arg1); | |
_local3++; | |
}; | |
}; | |
this._volume = _arg1; | |
} | |
public function externalHalt():void{ | |
var _local1:String = this._app.getOption("sr_external_halt_behavior", "stopandclear"); | |
if (_local1 == "stopandclear"){ | |
this.stopAudioAndClearHighlights(); | |
} else { | |
if (_local1 == "pause"){ | |
this.pause(); | |
}; | |
}; | |
dispatchEvent(new Event(PAUSE)); | |
} | |
public function stopAudioAndClearHighlights():void{ | |
if (this._xmlAdapter == null){ | |
return; | |
}; | |
var _local1:Array = this._xmlAdapter.getFlows(); | |
var _local2:int; | |
while (_local2 < _local1.length) { | |
_local1[_local2].stopAndClear(); | |
if (this._app.getOption("sr_words_unclickable", "0") == "2"){ | |
_local1[_local2].disableClickableWords(); | |
}; | |
_local2++; | |
}; | |
this._setActiveFlow(null); | |
this._pauseTime = 0; | |
} | |
public function pause(){ | |
if (this._xmlAdapter == null){ | |
return; | |
}; | |
if (this._activeflow){ | |
this._pauseTime = this._activeflow.getCurrentLoc(); | |
} else { | |
this._pauseTime = 0; | |
}; | |
var _local1:Array = this._xmlAdapter.getFlows(); | |
var _local2:int; | |
while (_local2 < _local1.length) { | |
_local1[_local2].pause(); | |
if (this._app.getOption("sr_words_unclickable", "0") == "2"){ | |
_local1[_local2].disableClickableWords(); | |
}; | |
_local2++; | |
}; | |
if (this._iconMgr){ | |
this._iconMgr.setAllIconsToPlay(); | |
}; | |
dispatchEvent(new Event(PAUSE)); | |
} | |
public function iconsAreLoaded():Boolean{ | |
if (((this._iconMgr) && (this._iconMgr.isLoaded()))){ | |
return (true); | |
}; | |
return (false); | |
} | |
public function destroy():void{ | |
var _local3:MovieClip; | |
var _local4:Array; | |
var _local5:int; | |
this.stopAudioAndClearHighlights(); | |
if (this._iconMgr != null){ | |
this._iconMgr.removeEventListener(Event.COMPLETE, this._iconLoadComplete); | |
}; | |
var _local1:Array = this._clickableWordMap.keys(); | |
var _local2:int; | |
while (_local2 < _local1.length) { | |
_local3 = (_local1[_local2] as MovieClip); | |
_local3.removeEventListener(MouseEvent.CLICK, this._wordClicked); | |
_local2++; | |
}; | |
if (this._xmlAdapter){ | |
_local4 = this._xmlAdapter.getFlows(); | |
_local5 = 0; | |
while (_local5 < _local4.length) { | |
_local4[_local5].destroy(); | |
_local5++; | |
}; | |
}; | |
} | |
public function show():void{ | |
visible = true; | |
} | |
public function hide():void{ | |
var _local1:Number = this._pauseTime; | |
this.stopAudioAndClearHighlights(); | |
this._pauseTime = _local1; | |
visible = false; | |
} | |
public function enableHighlighting():void{ | |
this._highlighter.showHighlights(); | |
} | |
public function disableHighlighting():void{ | |
this._highlighter.hideHighlights(); | |
} | |
public function startFlowPlay(_arg1:Flow, _arg2:PlayableObject=null, _arg3:Sentence=null, _arg4:WordInfo=null, _arg5:Number=0){ | |
this.stopAudioAndClearHighlights(); | |
this._setActiveFlow(_arg1); | |
_arg1.play(_arg2, _arg3, _arg4, _arg5); | |
this._tryEnableClickableWords(); | |
} | |
public function init(_arg1:String, _arg2:String, _arg3:String):void{ | |
this._swfFile = _arg3; | |
this._audioPath = _arg2; | |
NetU.doFileLoad(_arg1, this._xmlLoaded, this._xmlLoadError); | |
} | |
public function goToTime(_arg1:Number):void{ | |
var _local5:Flow; | |
var _local6:Number; | |
var _local7:Number; | |
var _local8:Number; | |
this.pause(); | |
var _local2:Array = this.getFlows(); | |
var _local3:Number = 0; | |
var _local4:int; | |
while (_local4 < _local2.length) { | |
_local5 = (_local2[_local4] as Flow); | |
_local6 = _local5.getTotalTime(); | |
if ((_local3 + _local6) > _arg1){ | |
_local7 = (_arg1 - _local3); | |
this._setActiveFlow(_local5); | |
_local8 = (_local7 / _local6); | |
_local5.playFromTime(_local8); | |
this.pause(); | |
break; | |
}; | |
_local3 = (_local3 + _local5.getTotalTime()); | |
_local4++; | |
}; | |
} | |
public function isReady():Boolean{ | |
if (this._loadError){ | |
return (true); | |
}; | |
if (this._xmlAdapter == null){ | |
return (false); | |
}; | |
if (this._flowsLoaded == this._xmlAdapter.numFlows()){ | |
return (true); | |
}; | |
return (false); | |
} | |
public function hasContent():Boolean{ | |
if (this._xmlAdapter == null){ | |
return (false); | |
}; | |
return (true); | |
} | |
public function playActiveFlowFrom(_arg1:Number):void{ | |
var _local2:Flow = this._activeflow; | |
if (_local2 == null){ | |
_local2 = this._lastActiveFlow; | |
}; | |
if (_local2){ | |
this._setActiveFlow(_local2); | |
_local2.playFromTime(_arg1); | |
this._tryEnableClickableWords(); | |
}; | |
} | |
public function getFirstFlow():Flow{ | |
var _local1:Array = this._xmlAdapter.getFlows(); | |
return ((_local1[0] as Flow)); | |
} | |
public function getFlows():Array{ | |
if (this._xmlAdapter){ | |
return (this._xmlAdapter.getFlows()); | |
}; | |
return (new Array()); | |
} | |
public function getLocationInfo():LocationInfo{ | |
if (!this._activeflow){ | |
return (null); | |
}; | |
var _local1:LocationInfo = new LocationInfo(); | |
_local1.flowIndex = this.getFlows().indexOf(this._activeflow); | |
_local1.objIndex = this._activeflow.getActiveObjectIndex(); | |
_local1.sentenceIndex = this._activeflow.getActiveSentenceIndex(); | |
_local1.wordIndex = this._activeflow.getActiveWordIndex(); | |
_local1.percentagePlayed = this._activeflow.getActivePercentageTime(); | |
return (_local1); | |
} | |
public function beginPlay(_arg1:LocationInfo=null):void{ | |
var _local2:Flow; | |
var _local3:PlayableObject; | |
var _local4:Sentence; | |
var _local5:WordInfo; | |
var _local6:Number; | |
var _local7:Number; | |
if (_arg1){ | |
_local2 = this.getFlows()[_arg1.flowIndex]; | |
_local3 = _local2.getPlayableObjects()[_arg1.objIndex]; | |
_local4 = _local3.getSentence(_arg1.sentenceIndex); | |
_local5 = _local4.getWord(_arg1.wordIndex); | |
_local6 = _arg1.percentagePlayed; | |
_local7 = ((_local5.getEndTime() - _local5.getStartTime()) * _local6); | |
this.startFlowPlay(_local2, _local3, _local4, _local5, (_local5.getStartTime() + _local7)); | |
this._setActiveFlow(_local2); | |
} else { | |
if (this._activeflow == null){ | |
this.startFlowPlay(this.getFirstFlow()); | |
} else { | |
if (this._activeflow){ | |
this._activeflow.playFromTime(this._pauseTime); | |
this._pauseTime = 0; | |
}; | |
}; | |
}; | |
} | |
public function getTotalTime():Number{ | |
var _local3:int; | |
var _local1:Number = 0; | |
var _local2:Array = this.getFlows(); | |
if (_local2){ | |
_local3 = 0; | |
while (_local3 < _local2.length) { | |
_local1 = (_local1 + _local2[_local3].getTotalTime()); | |
_local3++; | |
}; | |
}; | |
return (_local1); | |
} | |
public function getActiveFlowTotalTime():Number{ | |
if (this._activeflow){ | |
return (this._activeflow.getTotalTime()); | |
}; | |
return (0); | |
} | |
public function getCurrentTime():Number{ | |
if (this._activeflow){ | |
return (this._activeflow.getCurrentLoc()); | |
}; | |
return (0); | |
} | |
private function _tryEnableClickableWords():void{ | |
if (this._app.getOption("sr_words_unclickable", "0") == "2"){ | |
if (this._activeflow){ | |
this._activeflow.enableClickableWords(); | |
}; | |
}; | |
} | |
private function _xmlLoaded(_arg1:Event):void{ | |
var _local4:Array; | |
var _local5:int; | |
var _local2:URLLoader = (_arg1.currentTarget as URLLoader); | |
var _local3:XML = new XML(_local2.data); | |
this._xmlAdapter = new StandardXMLAdapter(_local3, this._audioPath); | |
if (this._app.getOption("sr_words_unclickable", "0") == "1"){ | |
this._setUpWords(false); | |
} else { | |
this._setUpWords(true); | |
}; | |
this._buildFlowIcons(); | |
this.setWordDelay(this._delayTime); | |
this.setSentenceDelay(this._sentenceDelayTime); | |
if (this._app.getOption("sr_words_unclickable", "0") == "2"){ | |
_local4 = this.getFlows(); | |
_local5 = 0; | |
while (_local5 < _local4.length) { | |
_local4[_local5].disableClickableWords(); | |
_local5++; | |
}; | |
}; | |
} | |
private function _xmlLoadError(_arg1:Event):void{ | |
this._loadError = true; | |
dispatchEvent(new Event(Event.COMPLETE)); | |
} | |
private function _setUpWords(_arg1:Boolean):void{ | |
var _local4:Flow; | |
var _local5:Array; | |
var _local6:int; | |
var _local7:PlayableObject; | |
var _local8:IIterator; | |
var _local9:Sentence; | |
var _local10:IIterator; | |
var _local11:WordInfo; | |
var _local12:MovieClip; | |
var _local13:Object; | |
if (!_arg1){ | |
this._wordHolder.mouseEnabled = false; | |
this._wordHolder.mouseChildren = false; | |
this._wordHolder.enabled = false; | |
}; | |
var _local2:int = this._xmlAdapter.numFlows(); | |
var _local3:int; | |
while (_local3 < _local2) { | |
_local4 = this._xmlAdapter.getFlows()[_local3]; | |
_local4.addEventListener(Flow.PLAY_COMPLETE, this._flowAudioPlayingComplete); | |
_local4.addEventListener(Flow.PLAY, this._flowPlayStart); | |
_local4.addEventListener(Flow.PLAY_PROGRESS, this._flowPlayProgress); | |
_local5 = this._xmlAdapter.getPlayableObjects(_local3); | |
_local6 = 0; | |
while (_local6 < _local5.length) { | |
_local7 = _local5[_local6]; | |
_local7.setHighlighter(this._highlighter); | |
_local8 = _local7.getSentenceIterator(); | |
while (_local8.hasNext()) { | |
_local9 = _local8.next(); | |
_local10 = _local9.getWordIterator(); | |
while (_local10.hasNext()) { | |
_local11 = _local10.next(); | |
_local12 = this._highlighter.drawHighlight(_local11, this._wordHolder); | |
_local12.mouseChildren = false; | |
if (_arg1){ | |
_local13 = new Object(); | |
_local13.flow = this._xmlAdapter.getFlows()[_local3]; | |
_local13.playObj = _local7; | |
_local13.sent = _local9; | |
_local13.word = _local11; | |
this._clickableWordMap.put(_local12, _local13); | |
_local12.addEventListener(MouseEvent.CLICK, this._wordClicked); | |
_local12.buttonMode = true; | |
_local12.useHandCursor = true; | |
} else { | |
_local12.mouseEnabled = false; | |
_local12.enabled = false; | |
}; | |
}; | |
}; | |
_local6++; | |
}; | |
_local3++; | |
}; | |
} | |
private function _wordClicked(_arg1:Event):void{ | |
var _local2:MovieClip = (_arg1.currentTarget as MovieClip); | |
var _local3:Object = this._clickableWordMap.get(_local2); | |
this.startFlowPlay(_local3.flow, _local3.playObj, _local3.sent, _local3.word); | |
} | |
private function _buildFlowIcons(){ | |
var _local3:Number; | |
var _local1:Array = this._xmlAdapter.getFlows(); | |
if (_local1.length == 0){ | |
dispatchEvent(new Event(Event.COMPLETE)); | |
return; | |
}; | |
var _local2:LibraryIconCallbacks = new LibraryIconCallbacks(this); | |
if (this._app.getOption("external_sr_icon", "") != ""){ | |
_local3 = Number(this._app.getOption("sr_icon_scale", "100")); | |
_local3 = (_local3 / 100); | |
this._iconMgr = new ExternalIconManager(this._buttonHolder, _local1, _local2, this._app.getOption("external_sr_icon"), _local3); | |
this._iconMgr.addEventListener(Event.COMPLETE, this._iconLoadComplete); | |
} else { | |
this._iconLoadComplete(null); | |
}; | |
} | |
private function _iconLoadComplete(_arg1:Event){ | |
dispatchEvent(new Event(Event.COMPLETE)); | |
this._loadWordSwf(); | |
} | |
private function _startAudioLoad():void{ | |
var _local1:Array = this._xmlAdapter.getFlows(); | |
var _local2:int; | |
while (_local2 < _local1.length) { | |
_local1[_local2].addEventListener(Flow.AUDIO_LOADED, this._flowAudioLoaded); | |
_local1[_local2].startAudioLoad(); | |
_local2++; | |
}; | |
} | |
private function _flowAudioLoaded(_arg1:Event):void{ | |
this._flowsLoaded++; | |
if (this.isReady()){ | |
dispatchEvent(new Event(READY)); | |
}; | |
} | |
private function _flowPlayStart(_arg1:Event):void{ | |
dispatchEvent(new Event(PLAY_START)); | |
dispatchEvent(new Event(MediaManager.ON_PLAY)); | |
} | |
private function _loadWordSwf():void{ | |
var _local1:Loader; | |
var _local2:URLRequest; | |
if (this._swfFile){ | |
_local1 = new Loader(); | |
_local2 = new URLRequest(this._swfFile); | |
addChild(_local1); | |
this._highlighter.setWordSwf(_local1); | |
_local1.contentLoaderInfo.addEventListener(Event.COMPLETE, this._wordSwfLoaded); | |
_local1.load(_local2); | |
} else { | |
this._wordSwfLoaded(null); | |
}; | |
} | |
private function _wordSwfLoaded(_arg1:Event):void{ | |
this._startAudioLoad(); | |
} | |
private function _flowPlayProgress(_arg1:EventWithParam):void{ | |
var _local6:Flow; | |
var _local2:Array = this._xmlAdapter.getFlows(); | |
var _local3:Number = (_arg1.param as Number); | |
var _local4:Number = 0; | |
var _local5:int; | |
while (_local5 < _local2.length) { | |
_local6 = _local2[_local5]; | |
if (_local6 == _arg1.currentTarget){ | |
_local4 = (_local4 + _local3); | |
break; | |
}; | |
_local4 = (_local4 + _local6.getTotalTime()); | |
_local5++; | |
}; | |
dispatchEvent(new EventWithParam(FLOW_PLAY_PROGRESS, _local3)); | |
dispatchEvent(new EventWithParam(LAYER_PLAY_PROGRESS, _local4)); | |
} | |
private function _setActiveFlow(_arg1:Flow):void{ | |
if (this._activeflow != null){ | |
this._lastActiveFlow = this._activeflow; | |
}; | |
this._activeflow = _arg1; | |
} | |
private function _isLastFlow(_arg1:Flow):Boolean{ | |
var _local2:Array = this._xmlAdapter.getFlows(); | |
var _local3:int = _local2.indexOf(_arg1); | |
if (_local3 == (_local2.length - 1)){ | |
return (true); | |
}; | |
return (false); | |
} | |
private function _playNextFlow(_arg1:Flow):Boolean{ | |
var _local2:Array = this._xmlAdapter.getFlows(); | |
var _local3:int = _local2.length; | |
var _local4:int; | |
while (_local4 < _local3) { | |
if ((((_local2[_local4] == _arg1)) && ((_local4 < (_local3 - 1))))){ | |
this.startFlowPlay(_local2[(_local4 + 1)]); | |
return (true); | |
}; | |
_local4++; | |
}; | |
return (false); | |
} | |
private function _flowAudioPlayingComplete(_arg1:Event):void{ | |
dispatchEvent(new Event(ScreenReader.FLOW_PLAY_COMPLETE)); | |
var _local2:Flow = this._activeflow; | |
this.stopAudioAndClearHighlights(); | |
var _local3:Boolean = this._isLastFlow(_local2); | |
if (_local3){ | |
dispatchEvent(new Event(ScreenReader.LAYER_PLAY_COMPLETE)); | |
} else { | |
if (this._app.getOption("sr_autoplay_next_flow", "0") == "1"){ | |
this._playNextFlow(_local2); | |
}; | |
}; | |
} | |
} | |
}//package com.vpg.vpage.shell.screenreader | |
package com.vpg.vpage.shell.screenreader { | |
public class LocationInfo { | |
public var flowIndex:int; | |
public var objIndex:int; | |
public var sentenceIndex:int; | |
public var wordIndex:int; | |
public var percentagePlayed:Number; | |
public function toString():String{ | |
return (((((((((("LocationInfo: " + this.flowIndex) + " ") + this.objIndex) + " ") + this.sentenceIndex) + " ") + this.wordIndex) + " ") + this.percentagePlayed)); | |
} | |
} | |
}//package com.vpg.vpage.shell.screenreader | |
package com.vpg.vpage.shell.screenreader { | |
import flash.geom.*; | |
import flash.events.*; | |
import com.vpg.vpage.utils.*; | |
import com.vpg.vpage.utils.iterator.*; | |
public class Flow extends EventDispatcher { | |
public static const PLAY_PROGRESS:String = "playProgress"; | |
public static const PLAY_COMPLETE:String = "playComplete"; | |
public static const STOP:String = "stopEvent"; | |
public static const PLAY:String = "playEvent"; | |
public static const AUDIO_LOADED:String = "audioLoaded"; | |
private var _playableObjects:Array; | |
private var _iconLoc:Point; | |
private var _currentPlayObj:PlayableObject; | |
public function Flow(_arg1:Number, _arg2:Number){ | |
this._playableObjects = new Array(); | |
if ((((_arg1 is Number)) && ((_arg2 is Number)))){ | |
this._iconLoc = new Point(_arg1, _arg2); | |
}; | |
} | |
public function setWordDelay(_arg1:int):void{ | |
var _local2:int; | |
while (_local2 < this._playableObjects.length) { | |
this._playableObjects[_local2].setWordDelay(_arg1); | |
_local2++; | |
}; | |
} | |
public function setSentenceDelay(_arg1:int):void{ | |
var _local2:int; | |
while (_local2 < this._playableObjects.length) { | |
this._playableObjects[_local2].setSentenceDelay(_arg1); | |
_local2++; | |
}; | |
} | |
public function destroy():void{ | |
var _local1:* = 0; | |
while (_local1 < this._playableObjects.length) { | |
this._playableObjects[_local1].removeEventListener(PlayableObject.AUDIO_LOADED, this._audioLoaded); | |
this._playableObjects[_local1].removeEventListener(PlayableObject.PLAY_COMPLETE, this._playableObjectDone); | |
this._playableObjects[_local1].destroy(); | |
_local1++; | |
}; | |
} | |
public function startAudioLoad():void{ | |
var _local1:* = 0; | |
while (_local1 < this._playableObjects.length) { | |
this._playableObjects[_local1].startAudioLoad(); | |
this._playableObjects[_local1].addEventListener(PlayableObject.AUDIO_LOADED, this._audioLoaded); | |
_local1++; | |
}; | |
} | |
public function addPlayableObject(_arg1:PlayableObject):void{ | |
this._playableObjects.push(_arg1); | |
_arg1.addEventListener(PlayableObject.PLAY_COMPLETE, this._playableObjectDone); | |
_arg1.addEventListener(PlayableObject.PLAY_PROGRESS, this._playableObjectProgress); | |
} | |
public function getPlayableObjects():Array{ | |
return (this._playableObjects); | |
} | |
public function getIconLoc():Point{ | |
if (this._iconLoc){ | |
return (new Point(this._iconLoc.x, this._iconLoc.y)); | |
}; | |
return (null); | |
} | |
public function setBrightness(_arg1:Number):void{ | |
var _local2:Array = this.getPlayableObjects(); | |
var _local3:Number = 0; | |
while (_local3 < _local2.length) { | |
_local2[_local3].setBrightness(_arg1); | |
_local3++; | |
}; | |
} | |
public function play(_arg1:PlayableObject, _arg2:Sentence, _arg3:WordInfo, _arg4:Number=0):void{ | |
var _local7:PlayableObject; | |
var _local8:Flow; | |
this.stopAndClear(); | |
var _local5:Array = this.getPlayableObjects(); | |
var _local6:* = 0; | |
while (_local6 < _local5.length) { | |
_local7 = _local5[_local6]; | |
_local8 = this; | |
_local7.nextObj = _local5[(_local6 + 1)]; | |
_local6++; | |
}; | |
if (_arg1 == null){ | |
_arg1 = _local5[0]; | |
}; | |
this._currentPlayObj = _arg1; | |
_arg1.startPlaying(_arg2, _arg3, _arg4); | |
dispatchEvent(new Event(PLAY)); | |
} | |
public function pause():void{ | |
if (this._currentPlayObj != null){ | |
this._currentPlayObj.pause(); | |
dispatchEvent(new Event(STOP)); | |
}; | |
} | |
public function getCurrentLoc():Number{ | |
return ((this._getCurrentPosition() / this.getTotalTime())); | |
} | |
public function getPlaybackTime():Number{ | |
return (this._getCurrentPosition()); | |
} | |
public function playFromTime(_arg1:Number):void{ | |
var _local9:Sentence; | |
var _local10:WordInfo; | |
if (_arg1 < 0){ | |
_arg1 = 0; | |
}; | |
var _local2:PlayableObject = this._getPlayableObjectAt(_arg1); | |
var _local3:Number = (_arg1 * this.getTotalTime()); | |
var _local4:Number = (_local3 - this._getStartingTime(_local2)); | |
var _local5:IIterator = _local2.getSentenceIterator(); | |
var _local6:Sentence; | |
while (_local5.hasNext()) { | |
_local9 = _local5.next(); | |
if (_local9.getStartTime() <= _local4){ | |
_local6 = _local9; | |
} else { | |
break; | |
}; | |
}; | |
var _local7:IIterator = _local6.getWordIterator(); | |
var _local8:WordInfo; | |
while (_local7.hasNext()) { | |
_local10 = _local7.next(); | |
if (_local10.getStartTime() <= _local4){ | |
_local8 = _local10; | |
} else { | |
break; | |
}; | |
}; | |
this.play(_local2, _local6, _local8, _local4); | |
} | |
public function stopAndClear():void{ | |
var _local1:int; | |
while (_local1 < this._playableObjects.length) { | |
this._playableObjects[_local1].stopAndClear(); | |
_local1++; | |
}; | |
dispatchEvent(new Event(STOP)); | |
} | |
public function getActivePercentageTime():Number{ | |
return (this._currentPlayObj.getActivePercentageTime()); | |
} | |
public function getActiveObjectIndex():int{ | |
return (this._playableObjects.indexOf(this._currentPlayObj)); | |
} | |
public function getActiveSentenceIndex():int{ | |
return (this._currentPlayObj.getActiveSentenceIndex()); | |
} | |
public function getActiveWordIndex():int{ | |
return (this._currentPlayObj.getActiveWordIndex()); | |
} | |
public function isActive():Boolean{ | |
if (this._currentPlayObj.isActive()){ | |
return (true); | |
}; | |
return (false); | |
} | |
public function enableClickableWords():void{ | |
var _local1:Array = this.getPlayableObjects(); | |
var _local2:int; | |
while (_local2 < _local1.length) { | |
_local1[_local2].enableClickableWords(); | |
_local2++; | |
}; | |
} | |
public function disableClickableWords():void{ | |
var _local1:Array = this.getPlayableObjects(); | |
var _local2:int; | |
while (_local2 < _local1.length) { | |
_local1[_local2].disableClickableWords(); | |
_local2++; | |
}; | |
} | |
public function isAudioLoaded():Boolean{ | |
var _local1:Array = this.getPlayableObjects(); | |
var _local2:int; | |
while (_local2 < _local1.length) { | |
if (!_local1[_local2].isAudioLoaded()){ | |
return (false); | |
}; | |
_local2++; | |
}; | |
return (true); | |
} | |
public function setVolume(_arg1:Number):void{ | |
var _local2:int; | |
while (_local2 < this._playableObjects.length) { | |
this._playableObjects[_local2].setVolume(_arg1); | |
_local2++; | |
}; | |
} | |
public function getTotalTime():Number{ | |
var _local1:Number = 0; | |
var _local2:int; | |
while (_local2 < this._playableObjects.length) { | |
_local1 = (_local1 + this._playableObjects[_local2].getAudioDuration()); | |
_local2++; | |
}; | |
return (_local1); | |
} | |
private function _audioLoaded(_arg1:Event):void{ | |
var _local2:Array = this.getPlayableObjects(); | |
var _local3:* = 0; | |
while (_local3 < _local2.length) { | |
if (!_local2[_local3].isAudioLoaded()){ | |
return; | |
}; | |
_local3++; | |
}; | |
dispatchEvent(new Event(AUDIO_LOADED)); | |
} | |
private function _playableObjectDone(_arg1:Event):void{ | |
var _local2:PlayableObject = (_arg1.currentTarget as PlayableObject); | |
if (_local2.nextObj == null){ | |
this._currentPlayObj = null; | |
dispatchEvent(new Event(PLAY_COMPLETE)); | |
} else { | |
_local2.nextObj.startPlaying(); | |
this._currentPlayObj = _local2.nextObj; | |
}; | |
} | |
private function _getCurrentPosition():Number{ | |
var _local3:PlayableObject; | |
var _local1:Number = 0; | |
var _local2:int; | |
while (_local2 < this._playableObjects.length) { | |
_local3 = this._playableObjects[_local2]; | |
if (_local3 != this._currentPlayObj){ | |
_local1 = (_local1 + _local3.getAudioDuration()); | |
} else { | |
if (_local3 == this._currentPlayObj){ | |
_local1 = (_local1 + _local3.getAudioPosition()); | |
return (_local1); | |
}; | |
}; | |
_local2++; | |
}; | |
return (_local1); | |
} | |
private function _getPlayableObjectAt(_arg1:Number):PlayableObject{ | |
var _local2:*; | |
var _local4:Number; | |
if (_arg1 == 0){ | |
return (this._playableObjects[0]); | |
}; | |
var _local3:int; | |
while (_local3 < this._playableObjects.length) { | |
_local4 = this._getStartingLoc(this._playableObjects[_local3]); | |
if (_local4 < _arg1){ | |
_local2 = this._playableObjects[_local3]; | |
} else { | |
return (_local2); | |
}; | |
_local3++; | |
}; | |
return (_local2); | |
} | |
private function _getStartingLoc(_arg1:PlayableObject):Number{ | |
var _local5:Number; | |
var _local2:Number = 0; | |
var _local3:int; | |
while (_local3 < this._playableObjects.length) { | |
if (this._playableObjects[_local3] != _arg1){ | |
_local2 = (_local2 + this._playableObjects[_local3].getAudioDuration()); | |
} else { | |
_local5 = (_local2 / this.getTotalTime()); | |
return (_local5); | |
}; | |
_local3++; | |
}; | |
var _local4:Number = (_local2 / this.getTotalTime()); | |
return (_local4); | |
} | |
private function _getStartingTime(_arg1:PlayableObject):Number{ | |
var _local2:Number = 0; | |
var _local3:int; | |
while (_local3 < this._playableObjects.length) { | |
if (this._playableObjects[_local3] != _arg1){ | |
_local2 = (_local2 + this._playableObjects[_local3].getAudioDuration()); | |
} else { | |
return (_local2); | |
}; | |
_local3++; | |
}; | |
return (_local2); | |
} | |
private function _playableObjectProgress(_arg1:EventWithParam):void{ | |
var _local5:PlayableObject; | |
var _local2:Number = (_arg1.param as Number); | |
var _local3:Number = 0; | |
var _local4:int; | |
while (_local4 < this._playableObjects.length) { | |
_local5 = this._playableObjects[_local4]; | |
if (_local5 == _arg1.currentTarget){ | |
_local3 = (_local3 + _local2); | |
break; | |
}; | |
_local3 = (_local3 + _local5.getAudioDuration()); | |
_local4++; | |
}; | |
dispatchEvent(new EventWithParam(PLAY_PROGRESS, _local3)); | |
} | |
} | |
}//package com.vpg.vpage.shell.screenreader | |
package com.vpg.vpage.shell.screenreader { | |
import flash.events.*; | |
import com.vpg.vpage.utils.*; | |
import flash.utils.*; | |
import com.vpg.vpage.utils.iterator.*; | |
public class PlayableObject extends EventDispatcher { | |
public static const PLAY_PROGRESS:String = "playProgress"; | |
public static const PLAY_COMPLETE:String = "playComplete"; | |
public static const AUDIO_LOADED:String = "audioLoaded"; | |
public var nextObj:PlayableObject; | |
private var _sentences:Array; | |
private var _audioLoaded:Boolean; | |
private var _soundPlayer:SoundPlayer; | |
private var _highlighter:Highlighter; | |
private var _timer:Timer; | |
private var _playing:Boolean; | |
private var _mp3:String; | |
private var _syncState:SyncState; | |
private var _startTime:Number = -1; | |
private var _wordDelay:Number = 0; | |
private var _sentenceDelay:Number = 0; | |
private var _delayTimer:Timer; | |
private var _hasBeenDelayed:Boolean; | |
private var _inFinalPause:Boolean; | |
private var _destroyed:Boolean; | |
public function PlayableObject(_arg1:String){ | |
this._sentences = new Array(); | |
this._audioLoaded = false; | |
this._playing = false; | |
this._mp3 = _arg1; | |
this._destroyed = false; | |
} | |
public function getActivePercentageTime():Number{ | |
var _local1:WordInfo; | |
var _local2:Number; | |
var _local3:Number; | |
var _local4:Number; | |
var _local5:Number; | |
if (this._syncState){ | |
_local1 = this._syncState.getActiveWord(); | |
_local2 = _local1.getStartTime(); | |
_local3 = _local1.getEndTime(); | |
_local4 = this.getAudioPosition(); | |
_local3 = (_local3 - _local2); | |
_local4 = (_local4 - _local2); | |
_local5 = (_local4 / _local3); | |
_local5 = Math.max(0, _local5); | |
_local5 = Math.min(_local5, 1); | |
return (_local5); | |
}; | |
return (0); | |
} | |
public function getActiveSentenceIndex():int{ | |
var _local1:Sentence = this._syncState.getActiveSentence(); | |
return (this._sentences.indexOf(_local1)); | |
} | |
public function getActiveWordIndex():int{ | |
var _local1:Sentence = this._syncState.getActiveSentence(); | |
var _local2:Array = _local1.getWords(); | |
var _local3:WordInfo = this._syncState.getActiveWord(); | |
return (_local2.indexOf(_local3)); | |
} | |
public function setWordDelay(_arg1:int):void{ | |
this._wordDelay = _arg1; | |
} | |
public function setSentenceDelay(_arg1:int):void{ | |
this._sentenceDelay = _arg1; | |
} | |
public function destroy():void{ | |
if (this._timer){ | |
this._timer.stop(); | |
this._timer.removeEventListener(TimerEvent.TIMER, this._syncIntervalFunction); | |
}; | |
if (this._soundPlayer){ | |
this._soundPlayer.removeEventListener(Event.COMPLETE, this._soundLoaded); | |
this._soundPlayer.removeEventListener(IOErrorEvent.IO_ERROR, this._soundLoadError); | |
this._soundPlayer.removeEventListener(Event.SOUND_COMPLETE, this._soundPlayComplete); | |
}; | |
this._destroyed = true; | |
} | |
public function startAudioLoad():void{ | |
if (this._destroyed){ | |
return; | |
}; | |
this._loadAudio(this._mp3); | |
} | |
public function getAudioDuration():Number{ | |
return (this._soundPlayer.getDuration()); | |
} | |
public function getAudioPosition():Number{ | |
if (this._inFinalPause){ | |
return (this.getAudioDuration()); | |
}; | |
return (this._soundPlayer.getPosition()); | |
} | |
public function setHighlighter(_arg1:Highlighter):void{ | |
this._highlighter = _arg1; | |
} | |
public function addSentence(_arg1:Sentence):void{ | |
this._sentences.push(_arg1); | |
} | |
public function getSentenceIterator():IIterator{ | |
return (new ArrayIterator(this._sentences)); | |
} | |
public function getSentence(_arg1:Number):Sentence{ | |
return (this._sentences[_arg1]); | |
} | |
public function isAudioLoaded():Boolean{ | |
return (this._audioLoaded); | |
} | |
public function isActive():Boolean{ | |
if (this._playing){ | |
return (true); | |
}; | |
return (false); | |
} | |
public function startPlaying(_arg1:Sentence=null, _arg2:WordInfo=null, _arg3:Number=0):void{ | |
var _local6:IIterator; | |
var _local7:Sentence; | |
var _local8:WordInfo; | |
if (_arg3 >= this.getAudioDuration()){ | |
this._doPlayComplete(null); | |
return; | |
}; | |
this.stopAndClear(); | |
var _local4:Number = 0; | |
if (((((!((_arg3 == 0))) && (_arg1))) && (_arg2))){ | |
_local4 = _arg3; | |
} else { | |
if (((_arg1) && (_arg2))){ | |
_local4 = _arg2.getStartTime(); | |
} else { | |
_arg1 = this._sentences[0]; | |
_arg2 = this._sentences[0].getWord(0); | |
}; | |
}; | |
var _local5:IIterator = this.getSentenceIterator(); | |
while (_local5.hasNext()) { | |
_local7 = Sentence(_local5.next()); | |
if (_local7 == _arg1){ | |
_local6 = _local7.getWordIterator(); | |
while (_local6.hasNext()) { | |
_local8 = WordInfo(_local6.next()); | |
if (_arg2 == _local8){ | |
break; | |
}; | |
}; | |
break; | |
}; | |
}; | |
this._syncState = new SyncState(_local5, _local6, _local7, _local8); | |
if (this.isAudioLoaded()){ | |
this._highlighter.setPlaying(this, _arg1, _arg2); | |
this._playing = true; | |
this._soundPlayer.playFromTime(_local4); | |
this._startTime = _local4; | |
if (this._timer){ | |
this._timer.removeEventListener(TimerEvent.TIMER, this._syncIntervalFunction); | |
this._timer.stop(); | |
}; | |
this._timer = new Timer(16.6); | |
this._timer.addEventListener(TimerEvent.TIMER, this._syncIntervalFunction); | |
this._timer.start(); | |
} else { | |
trace("PlayableObject.startPlaying failed. Audio not yet loaded."); | |
}; | |
} | |
public function enableClickableWords():void{ | |
var _local1:int; | |
while (_local1 < this._sentences.length) { | |
this._sentences[_local1].enableClickableWords(); | |
_local1++; | |
}; | |
} | |
public function disableClickableWords():void{ | |
var _local1:int; | |
while (_local1 < this._sentences.length) { | |
this._sentences[_local1].disableClickableWords(); | |
_local1++; | |
}; | |
} | |
public function stopAndClear():void{ | |
if (this._timer){ | |
this._timer.stop(); | |
}; | |
if (this._delayTimer){ | |
this._delayTimer.stop(); | |
}; | |
if (this._soundPlayer){ | |
this._soundPlayer.stop(); | |
this._soundPlayer.rewind(); | |
}; | |
this._playing = false; | |
this._inFinalPause = false; | |
this._highlighter.clearAll(); | |
} | |
public function pause():void{ | |
if (((this._delayTimer) && (this._delayTimer.running))){ | |
if (!this._inFinalPause){ | |
this._doResume(null); | |
} else { | |
this._delayTimer.stop(); | |
}; | |
}; | |
this._inFinalPause = false; | |
this._soundPlayer.stop(); | |
this._playing = false; | |
if (this._timer){ | |
this._timer.stop(); | |
}; | |
} | |
public function setVolume(_arg1:Number):void{ | |
if (this._soundPlayer){ | |
this._soundPlayer.setVolume(_arg1); | |
}; | |
} | |
private function _syncIntervalFunction(_arg1:Event):void{ | |
var _local3:Sentence; | |
var _local4:WordInfo; | |
var _local5:int; | |
var _local6:Sentence; | |
var _local7:WordInfo; | |
var _local2:Number = this._soundPlayer.getPosition(); | |
if (this._startTime != -1){ | |
_local2 = this._startTime; | |
this._startTime = -1; | |
}; | |
if ((((_local2 > 0)) && (!((this._syncState.getNextChangeTime() == -1))))){ | |
if ((((_local2 > this._syncState.getNextChangeTime())) && ((_local2 < this._soundPlayer.getDuration())))){ | |
_local3 = this._syncState.getActiveSentence(); | |
_local4 = this._syncState.getActiveWord(); | |
_local5 = this._wordDelay; | |
if (this._syncState.getNextChangeType() == SyncState.TYPE_SENTENCE){ | |
if (this._sentenceDelay > 0){ | |
_local5 = this._sentenceDelay; | |
}; | |
}; | |
if ((((((_local5 > 0)) && (this._hasBeenDelayed))) || ((_local5 == 0)))){ | |
this._hasBeenDelayed = false; | |
this._syncState.moveToNext(); | |
_local6 = this._syncState.getActiveSentence(); | |
_local7 = this._syncState.getActiveWord(); | |
this._highlighter.setPlaying(this, _local6, _local7); | |
} else { | |
if (_local5 > 0){ | |
this._tryPauseAndResume(_local5); | |
}; | |
}; | |
}; | |
}; | |
dispatchEvent(new EventWithParam(PLAY_PROGRESS, this._soundPlayer.getPosition())); | |
} | |
private function _loadAudio(_arg1:String):void{ | |
if (this._destroyed){ | |
return; | |
}; | |
this._soundPlayer = new SoundPlayer(); | |
this._soundPlayer.addEventListener(Event.COMPLETE, this._soundLoaded); | |
this._soundPlayer.addEventListener(IOErrorEvent.IO_ERROR, this._soundLoadError); | |
this._soundPlayer.addEventListener(Event.SOUND_COMPLETE, this._soundPlayComplete); | |
this._soundPlayer.playSound(_arg1); | |
this._soundPlayer.stop(); | |
} | |
private function _soundLoaded(_arg1:Event):void{ | |
if (this._destroyed){ | |
return; | |
}; | |
this._audioLoaded = true; | |
if (!this.isActive()){ | |
this.stopAndClear(); | |
}; | |
dispatchEvent(new Event(AUDIO_LOADED)); | |
} | |
private function _soundLoadError(_arg1:Event):void{ | |
trace("PlayableObject.soundLoadError"); | |
} | |
private function _soundPlayComplete(_arg1:Event):void{ | |
var _local2:uint = this._wordDelay; | |
if (this._sentenceDelay > 0){ | |
_local2 = this._sentenceDelay; | |
}; | |
this._timer.stop(); | |
if (_local2 > 0){ | |
this._inFinalPause = true; | |
if (this._delayTimer){ | |
this._delayTimer.stop(); | |
}; | |
this._delayTimer = new Timer(_local2, 1); | |
this._delayTimer.addEventListener(TimerEvent.TIMER_COMPLETE, this._doPlayComplete); | |
this._delayTimer.start(); | |
} else { | |
this._doPlayComplete(null); | |
}; | |
} | |
private function _doPlayComplete(_arg1:Event):void{ | |
if (this._delayTimer){ | |
this._delayTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, this._doPlayComplete); | |
}; | |
this._inFinalPause = false; | |
this.stopAndClear(); | |
dispatchEvent(new Event(PLAY_COMPLETE)); | |
} | |
private function _tryPauseAndResume(_arg1:uint):void{ | |
if (_arg1 > 0){ | |
this._hasBeenDelayed = false; | |
this._timer.stop(); | |
this._soundPlayer.pauseActiveSound(); | |
this._delayTimer = new Timer(_arg1, 1); | |
this._delayTimer.addEventListener(TimerEvent.TIMER_COMPLETE, this._doResume); | |
this._delayTimer.start(); | |
}; | |
} | |
private function _doResume(_arg1:Event):void{ | |
this._hasBeenDelayed = true; | |
this._delayTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, this._doResume); | |
this._timer.start(); | |
this._soundPlayer.unPauseSound(); | |
} | |
} | |
}//package com.vpg.vpage.shell.screenreader | |
package com.vpg.vpage.shell.screenreader { | |
import flash.display.*; | |
public class WordInfo { | |
private var _x:Number; | |
private var _y:Number; | |
private var _w:Number; | |
private var _h:Number; | |
private var _startTime:Number; | |
private var _endTime:Number; | |
private var _word:String; | |
private var _mc:MovieClip; | |
private var _wordColorOverride:Number; | |
private var _sentenceColorOverride:Number; | |
public function WordInfo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:String){ | |
this._x = _arg1; | |
this._y = _arg2; | |
this._w = _arg3; | |
this._h = _arg4; | |
this._startTime = _arg5; | |
this._endTime = _arg6; | |
this._word = _arg7; | |
} | |
public function getX():Number{ | |
return (this._x); | |
} | |
public function getWord():String{ | |
return (this._word); | |
} | |
public function getY():Number{ | |
return (this._y); | |
} | |
public function getHeight():Number{ | |
return (this._h); | |
} | |
public function getWidth():Number{ | |
return (this._w); | |
} | |
public function getStartTime():Number{ | |
return (this._startTime); | |
} | |
public function getEndTime():Number{ | |
return (this._endTime); | |
} | |
public function setClip(_arg1:MovieClip){ | |
this._mc = _arg1; | |
} | |
public function getClip():MovieClip{ | |
return (this._mc); | |
} | |
public function toString():String{ | |
return (this._word); | |
} | |
public function enableClickableWords():void{ | |
this.getClip().mouseEnabled = true; | |
this.getClip().enabled = true; | |
} | |
public function disableClickableWords():void{ | |
this.getClip().mouseEnabled = false; | |
this.getClip().enabled = false; | |
} | |
public function setSentenceColorOverride(_arg1:Number):void{ | |
this._sentenceColorOverride = _arg1; | |
} | |
public function setWordColorOverride(_arg1:Number):void{ | |
this._wordColorOverride = _arg1; | |
} | |
public function getSentenceColorOverride():Number{ | |
return (this._sentenceColorOverride); | |
} | |
public function getWordColorOverride():Number{ | |
return (this._wordColorOverride); | |
} | |
} | |
}//package com.vpg.vpage.shell.screenreader | |
package com.vpg.vpage.shell.screenreader { | |
import flash.display.*; | |
import com.vpg.vpage.utils.*; | |
import com.vpg.vpage.utils.iterator.*; | |
public class Highlighter extends Sprite { | |
private static const WORD:String = "word"; | |
private static const SENT:String = "sentence"; | |
private static const PLAYOBJ:String = "playableObject"; | |
private var _activePlayObj:PlayableObject; | |
private var _activeSentence:Sentence; | |
private var _activeWord:WordInfo; | |
private var _sentenceColor:uint; | |
private var _sentenceAlpha:int; | |
private var _wordColor:uint; | |
private var _wordAlpha:int; | |
private var _playObjColor:uint; | |
private var _playObjAlpha:int; | |
private var _holder:Sprite; | |
private var _wordSwf:DisplayObject; | |
private var _wordSwfMask:Sprite; | |
private var _useWordSwfForWords:Boolean; | |
private var _useWordSwfForSentences:Boolean; | |
public function Highlighter(){ | |
mouseEnabled = false; | |
mouseChildren = false; | |
} | |
public function setWordColor(_arg1:uint, _arg2:int):void{ | |
this._wordColor = _arg1; | |
this._wordAlpha = _arg2; | |
this.refresh(); | |
} | |
public function setSentenceColor(_arg1:uint, _arg2:int):void{ | |
this._sentenceColor = _arg1; | |
this._sentenceAlpha = _arg2; | |
this.refresh(); | |
} | |
public function setPlayObjColor(_arg1:uint, _arg2:int):void{ | |
this._playObjColor = _arg1; | |
this._playObjAlpha = _arg2; | |
this.refresh(); | |
} | |
public function setWordSwf(_arg1:DisplayObject):void{ | |
this._wordSwf = _arg1; | |
this._wordSwfMask = new Sprite(); | |
this._wordSwf.mask = this._wordSwfMask; | |
addChild(this._wordSwf); | |
addChild(this._wordSwfMask); | |
} | |
public function enableWordSwf(_arg1:Boolean, _arg2:Boolean):void{ | |
this._useWordSwfForWords = _arg1; | |
this._useWordSwfForSentences = _arg2; | |
this.refresh(); | |
} | |
public function clearAll():void{ | |
this._activePlayObj = null; | |
this._activeSentence = null; | |
this._activeWord = null; | |
this._clearContent(); | |
} | |
public function setPlaying(_arg1:PlayableObject, _arg2:Sentence, _arg3:WordInfo):void{ | |
this._activePlayObj = _arg1; | |
this._activeSentence = _arg2; | |
this._activeWord = _arg3; | |
this.refresh(); | |
} | |
public function showHighlights():void{ | |
} | |
public function hideHighlights():void{ | |
} | |
public function refresh():void{ | |
var _local2:Sentence; | |
var _local3:IIterator; | |
var _local4:WordInfo; | |
this._clearContent(); | |
if (!this._activePlayObj){ | |
return; | |
}; | |
var _local1:IIterator = this._activePlayObj.getSentenceIterator(); | |
while (_local1.hasNext()) { | |
_local2 = (_local1.next() as Sentence); | |
_local3 = _local2.getWordIterator(); | |
while (_local3.hasNext()) { | |
_local4 = _local3.next(); | |
if (_local4 == this._activeWord){ | |
this._doHighlight(_local4, WORD); | |
} else { | |
if (_local2 == this._activeSentence){ | |
this._doHighlight(_local4, SENT); | |
} else { | |
this._doHighlight(_local4, PLAYOBJ); | |
}; | |
}; | |
}; | |
}; | |
} | |
public function drawHighlight(_arg1:WordInfo, _arg2:MovieClip):MovieClip{ | |
var _local3:Square = new Square(); | |
_local3.x = _arg1.getX(); | |
_local3.y = _arg1.getY(); | |
_local3.width = _arg1.getWidth(); | |
_local3.height = _arg1.getHeight(); | |
_local3.alpha = 0; | |
_arg2.addChild(_local3); | |
_arg1.setClip(_local3); | |
return (_local3); | |
} | |
private function _clearContent():void{ | |
if (this._holder){ | |
removeChild(this._holder); | |
}; | |
this._holder = new Sprite(); | |
addChild(this._holder); | |
if (this._wordSwfMask){ | |
this._wordSwfMask.graphics.clear(); | |
}; | |
} | |
private function _doHighlight(_arg1:WordInfo, _arg2:String):void{ | |
var _local3:uint = this._playObjColor; | |
var _local4:int = this._playObjAlpha; | |
if (_arg2 == SENT){ | |
_local3 = this._sentenceColor; | |
_local4 = this._sentenceAlpha; | |
} else { | |
if (_arg2 == WORD){ | |
_local3 = this._wordColor; | |
_local4 = this._wordAlpha; | |
}; | |
}; | |
var _local5:Square = new Square(_local3, _local4); | |
_local5.x = _arg1.getX(); | |
_local5.y = _arg1.getY(); | |
_local5.width = _arg1.getWidth(); | |
_local5.height = _arg1.getHeight(); | |
_local5.blendMode = BlendMode.DARKEN; | |
this._holder.addChild(_local5); | |
if (((this._useWordSwfForWords) && ((_arg2 == WORD)))){ | |
this._addMask(_arg1); | |
} else { | |
if (((this._useWordSwfForSentences) && ((_arg2 == SENT)))){ | |
this._addMask(_arg1); | |
}; | |
}; | |
} | |
private function _addMask(_arg1:WordInfo):void{ | |
this._wordSwfMask.graphics.beginFill(0xFF0000); | |
this._wordSwfMask.graphics.drawRect(_arg1.getX(), _arg1.getY(), _arg1.getWidth(), _arg1.getHeight()); | |
this._wordSwfMask.graphics.endFill(); | |
} | |
} | |
}//package com.vpg.vpage.shell.screenreader | |
package com.vpg.vpage.shell.screenreader { | |
public class StandardXMLAdapter { | |
private var _flows:Array; | |
public function StandardXMLAdapter(_arg1:XML, _arg2:String){ | |
this._flows = this._buildData(_arg1, _arg2); | |
} | |
public function numFlows():Number{ | |
return (this._flows.length); | |
} | |
public function getPlayableObjects(_arg1:Number):Array{ | |
return (this._flows[_arg1].getPlayableObjects()); | |
} | |
public function getFlows():Array{ | |
return (this._flows); | |
} | |
private function _buildData(_arg1:XML, _arg2:String):Array{ | |
var _local6:String; | |
var _local7:Array; | |
var _local8:Flow; | |
var _local9:Number; | |
var _local10:Number; | |
var _local11:XMLList; | |
var _local12:int; | |
var _local13:String; | |
var _local14:PlayableObject; | |
var _local15:XMLList; | |
var _local16:int; | |
var _local17:XMLList; | |
var _local18:Sentence; | |
var _local19:int; | |
var _local20:WordInfo; | |
var _local3:XMLList = _arg1.flow; | |
var _local4:Array = new Array(); | |
var _local5:int; | |
while (_local5 < _local3.length()) { | |
_local6 = _local3[_local5].@iconxy; | |
_local7 = _local6.split(","); | |
_local8 = new Flow(new Number(_local7[0]), new Number(_local7[1])); | |
_local9 = _local3[_local5].@sentence_color_override; | |
_local10 = _local3[_local5].@word_color_override; | |
_local11 = _local3[_local5].clip; | |
_local12 = 0; | |
while (_local12 < _local11.length()) { | |
_local13 = (_arg2 + _local11[_local12].@src); | |
_local14 = new PlayableObject(_local13); | |
_local8.addPlayableObject(_local14); | |
_local15 = _local11[_local12].block; | |
_local16 = 0; | |
while (_local16 < _local15.length()) { | |
_local17 = _local15[_local16].word; | |
_local18 = new Sentence(); | |
_local19 = 0; | |
while (_local19 < _local17.length()) { | |
_local20 = this._getWord(_local17[_local19]); | |
_local20.setSentenceColorOverride(_local9); | |
_local20.setWordColorOverride(_local10); | |
_local18.addWord(_local20); | |
_local19++; | |
}; | |
if (_local17.length() > 0){ | |
_local14.addSentence(_local18); | |
}; | |
_local16++; | |
}; | |
_local12++; | |
}; | |
_local4.push(_local8); | |
_local5++; | |
}; | |
return (_local4); | |
} | |
private function _getWord(_arg1:XML):WordInfo{ | |
var _local2:Number = Number(_arg1.@xMin); | |
var _local3:Number = Number(_arg1.@xMax); | |
var _local4:Number = Number(_arg1.@yMin); | |
var _local5:Number = Number(_arg1.@yMax); | |
var _local6:Number = Number(_arg1.@start); | |
var _local7:Number = Number(_arg1.@end); | |
var _local8:String = _arg1.text(); | |
var _local9:Number = (_local3 - _local2); | |
var _local10:Number = (_local5 - _local4); | |
var _local11:WordInfo = new WordInfo(_local2, _local4, _local9, _local10, _local6, _local7, _local8); | |
return (_local11); | |
} | |
} | |
}//package com.vpg.vpage.shell.screenreader | |
package com.vpg.vpage.shell.screenreader { | |
import com.vpg.vpage.utils.iterator.*; | |
public class SyncState { | |
public static const TYPE_SENTENCE:String = "sentence"; | |
public static const TYPE_WORD:String = "word"; | |
public static const TYPE_NONE:String = "none"; | |
private var _sentIter:IIterator; | |
private var _currentSent:Sentence; | |
private var _nextSent:Sentence; | |
private var _wordIter:IIterator; | |
private var _currentWord:WordInfo; | |
private var _nextWord:WordInfo; | |
public function SyncState(_arg1:IIterator, _arg2:IIterator, _arg3:Sentence, _arg4:WordInfo){ | |
this._sentIter = _arg1; | |
this._wordIter = _arg2; | |
this._currentSent = _arg3; | |
this._currentWord = _arg4; | |
this._nextSent = Sentence(_arg1.next()); | |
this._nextWord = WordInfo(_arg2.next()); | |
} | |
public function getNextChangeTime():Number{ | |
if (((!((this._nextWord == null))) && (!((this._nextWord == null))))){ | |
return (this._nextWord.getStartTime()); | |
}; | |
if (((!((this._nextSent == null))) && (!((this._nextSent == null))))){ | |
return (this._nextSent.getWord(0).getStartTime()); | |
}; | |
return (-1); | |
} | |
public function getNextChangeType():String{ | |
if (this._nextWord == null){ | |
if (this._nextSent == null){ | |
return (TYPE_NONE); | |
}; | |
return (TYPE_SENTENCE); | |
}; | |
return (TYPE_WORD); | |
} | |
public function moveToNext():void{ | |
if (((!((this._nextWord == null))) && (!((this._nextWord == null))))){ | |
this._currentWord = this._nextWord; | |
this._nextWord = (this._wordIter.next() as WordInfo); | |
} else { | |
this._currentSent = this._nextSent; | |
this._nextSent = (this._sentIter.next() as Sentence); | |
this._wordIter = this._currentSent.getWordIterator(); | |
this._currentWord = (this._wordIter.next() as WordInfo); | |
this._nextWord = (this._wordIter.next() as WordInfo); | |
}; | |
} | |
public function getActiveWord():WordInfo{ | |
return (this._currentWord); | |
} | |
public function getActiveSentence():Sentence{ | |
return (this._currentSent); | |
} | |
} | |
}//package com.vpg.vpage.shell.screenreader | |
package com.vpg.vpage.shell.screenreader { | |
import flash.events.*; | |
import com.vpg.vpage.utils.*; | |
import flash.utils.*; | |
import com.vpg.vpage.utils.mediamgr.*; | |
public class ScreenReaderManager extends EventDispatcher { | |
public static const LAYER_PLAY_COMPLETE:String = "layerPlayComplete"; | |
public static const LAYER_PLAY_PROGRESS:String = "layerProgressEvent"; | |
public static const FLOW_PLAY_COMPLETE:String = "flowPlayComplete"; | |
public static const FLOW_PLAY_PROGRESS:String = "flowProgressEvent"; | |
public static const SEQUENCE_PLAY_COMPLETE:String = "sequencePlayComplete"; | |
public static const SEQUENCE_PLAY_PROGRESS:String = "sequencePlayProgress"; | |
public static const PAUSED:String = "readerPaused"; | |
public static const PLAY_START:String = "playStart"; | |
public static const STOPPED:String = "readerStopped"; | |
public static const READY:String = "readersReady"; | |
private var _layers:Array; | |
private var _activeLayer:ScreenReaderMulti; | |
private var _lastLayer:ScreenReaderMulti; | |
private var _currentMode:String; | |
private var _hidden:Boolean; | |
private var _wordDelay:uint; | |
private var _sentenceDelay:uint; | |
private var _layerDelay:uint; | |
private var _volume:Number; | |
private var _autoplay:Boolean; | |
private var _delayTimer:Timer; | |
private var _mgr:MediaManager; | |
private var _pageOrder:Array; | |
private var _layerListModified:Boolean; | |
public function ScreenReaderManager(){ | |
this._layers = new Array(); | |
this._hidden = false; | |
this._wordDelay = 0; | |
this._sentenceDelay = 0; | |
this._layerDelay = 0; | |
this._volume = 1; | |
this._autoplay = false; | |
this._layerListModified = false; | |
} | |
public function destroy():void{ | |
this._layers = null; | |
this._activeLayer = null; | |
this._lastLayer = null; | |
this._mgr = null; | |
this._delayTimer = null; | |
} | |
public function setMode(_arg1:String):void{ | |
var _local2:int; | |
while (_local2 < this._layers.length) { | |
if (_arg1 != this._currentMode){ | |
this._layers[_local2].setMode(_arg1); | |
}; | |
_local2++; | |
}; | |
this._currentMode = _arg1; | |
} | |
public function setPageOrder(_arg1:Array):void{ | |
this._pageOrder = _arg1.slice(); | |
} | |
public function setMediaManager(_arg1:MediaManager):void{ | |
var _local3:int; | |
if (this._mgr){ | |
_local3 = 0; | |
while (_local3 < this._layers.length) { | |
this._mgr.deregisterPlayer(this._layers[_local3]); | |
_local3++; | |
}; | |
}; | |
this._mgr = _arg1; | |
var _local2:int; | |
while (_local2 < this._layers.length) { | |
this._mgr.registerPlayer(this._layers[_local2]); | |
_local2++; | |
}; | |
} | |
public function setAutoplayNextLayer(_arg1:Boolean):void{ | |
this._autoplay = _arg1; | |
} | |
public function addLayer(_arg1:ScreenReaderMulti):void{ | |
this._layerListModified = true; | |
this._layers.push(_arg1); | |
if (this._hidden){ | |
_arg1.hide(); | |
} else { | |
_arg1.show(); | |
}; | |
_arg1.setWordDelay(this._wordDelay); | |
_arg1.setSentenceDelay(this._sentenceDelay); | |
_arg1.setVolume(this._volume); | |
_arg1.addEventListener(ScreenReaderMulti.LAYER_PLAY_COMPLETE, this._layerPlayComplete); | |
_arg1.addEventListener(ScreenReaderMulti.LAYER_PLAY_PROGRESS, this._layerPlayProgress); | |
_arg1.addEventListener(ScreenReaderMulti.FLOW_PLAY_COMPLETE, this._flowPlayComplete); | |
_arg1.addEventListener(ScreenReaderMulti.FLOW_PLAY_PROGRESS, this._flowPlayProgress); | |
_arg1.addEventListener(ScreenReaderMulti.PLAY_START, this._flowPlayStart); | |
_arg1.addEventListener(ScreenReaderMulti.PAUSE, this._readerPauseEvent); | |
_arg1.addEventListener(ScreenReaderMulti.READY, this._readerReadyEvent); | |
if (this._mgr){ | |
this._mgr.registerPlayer(_arg1); | |
}; | |
} | |
public function changeSyncColors(_arg1:uint, _arg2:int, _arg3:uint, _arg4:int, _arg5:uint, _arg6:int):void{ | |
var _local7:int; | |
while (_local7 < this._layers.length) { | |
this._layers[_local7].changeSyncColors(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6); | |
_local7++; | |
}; | |
} | |
public function enableWordSwf(_arg1:Boolean, _arg2:Boolean):void{ | |
var _local4:ScreenReaderMulti; | |
var _local3:int; | |
while (_local3 < this._layers.length) { | |
_local4 = (this._layers[_local3] as ScreenReaderMulti); | |
_local4.enableWordSwf(_arg1, _arg2); | |
_local3++; | |
}; | |
} | |
public function removeAllLayers():void{ | |
var _local2:ScreenReaderMulti; | |
var _local1:int; | |
while (_local1 < this._layers.length) { | |
_local2 = (this._layers[_local1] as ScreenReaderMulti); | |
_local2.destroy(); | |
_local2.removeEventListener(ScreenReaderMulti.LAYER_PLAY_COMPLETE, this._layerPlayComplete); | |
_local2.removeEventListener(ScreenReaderMulti.LAYER_PLAY_PROGRESS, this._layerPlayProgress); | |
_local2.removeEventListener(ScreenReaderMulti.FLOW_PLAY_COMPLETE, this._flowPlayComplete); | |
_local2.removeEventListener(ScreenReaderMulti.FLOW_PLAY_PROGRESS, this._flowPlayProgress); | |
_local2.removeEventListener(ScreenReaderMulti.PLAY_START, this._flowPlayStart); | |
_local2.removeEventListener(ScreenReaderMulti.PAUSE, this._readerPauseEvent); | |
_local1++; | |
}; | |
this._layers = new Array(); | |
} | |
public function setWordDelay(_arg1:uint):void{ | |
var _local2:int; | |
while (_local2 < this._layers.length) { | |
this._layers[_local2].setWordDelay(_arg1); | |
_local2++; | |
}; | |
this._wordDelay = _arg1; | |
} | |
public function setSentenceDelay(_arg1:uint):void{ | |
var _local2:int; | |
while (_local2 < this._layers.length) { | |
this._layers[_local2].setSentenceDelay(_arg1); | |
_local2++; | |
}; | |
this._sentenceDelay = _arg1; | |
} | |
public function setLayerDelay(_arg1:uint):void{ | |
this._layerDelay = _arg1; | |
} | |
public function show():void{ | |
this._stopTimer(); | |
var _local1:int; | |
while (_local1 < this._layers.length) { | |
this._layers[_local1].show(); | |
_local1++; | |
}; | |
this._hidden = false; | |
} | |
public function hide():void{ | |
this._stopTimer(); | |
var _local1:int; | |
while (_local1 < this._layers.length) { | |
this._layers[_local1].hide(); | |
_local1++; | |
}; | |
this._hidden = true; | |
} | |
public function setVolume(_arg1:Number):void{ | |
var _local2:int; | |
while (_local2 < this._layers.length) { | |
this._layers[_local2].setVolume(_arg1); | |
_local2++; | |
}; | |
this._volume = _arg1; | |
} | |
public function getVolume():Number{ | |
return (this._volume); | |
} | |
public function play():void{ | |
var _local1:Array; | |
var _local2:int; | |
var _local3:ScreenReaderMulti; | |
this._stopTimer(); | |
this._reorderLayers(); | |
if (this._activeLayer){ | |
this._activeLayer.beginPlay(); | |
} else { | |
_local1 = this._getActiveLayers(); | |
_local2 = 0; | |
while (_local2 < _local1.length) { | |
_local3 = _local1[_local2]; | |
if (_local3.hasContent()){ | |
this._setActiveLayer(_local3); | |
this._activeLayer.beginPlay(); | |
break; | |
}; | |
_local2++; | |
}; | |
}; | |
} | |
public function pause():void{ | |
this._stopTimer(); | |
if (this._activeLayer){ | |
this._activeLayer.pause(); | |
}; | |
} | |
public function stop():void{ | |
this._stopTimer(); | |
if (this._activeLayer){ | |
this._activeLayer.stopAudioAndClearHighlights(); | |
}; | |
} | |
public function isLoaded(_arg1:Array):Boolean{ | |
var _local2:Array; | |
var _local3:int; | |
var _local4:int; | |
var _local5:String; | |
var _local6:ScreenReaderMulti; | |
if (_arg1 == null){ | |
_local2 = this._getActiveLayers(); | |
_local3 = 0; | |
while (_local3 < _local2.length) { | |
if (((_local2[_local3].hasContent()) && (!(_local2[_local3].isReady())))){ | |
return (false); | |
}; | |
_local3++; | |
}; | |
} else { | |
_local4 = 0; | |
while (_local4 < _arg1.length) { | |
_local5 = _arg1[_local4]; | |
_local6 = this._getLayerForPage(_local5); | |
if (_local6){ | |
if (((_local6.hasContent()) && (!(_local6.isReady())))){ | |
return (false); | |
}; | |
}; | |
_local4++; | |
}; | |
}; | |
return (true); | |
} | |
public function clearActiveLayer():void{ | |
this._setActiveLayer(null); | |
} | |
public function isReaderPlaying():Boolean{ | |
var _local3:ScreenReaderMulti; | |
var _local1:Array = this._getActiveLayers(); | |
var _local2:int; | |
while (_local2 < _local1.length) { | |
_local3 = (_local1[_local2] as ScreenReaderMulti); | |
if (_local3.isReaderPlaying()){ | |
return (true); | |
}; | |
_local2++; | |
}; | |
return (false); | |
} | |
public function goToSequencePerc(_arg1:Number):void{ | |
var _local6:ScreenReaderMulti; | |
var _local7:Number; | |
var _local8:Number; | |
this._stopTimer(); | |
var _local2:Number = (this._getTotalActiveTime() * _arg1); | |
var _local3:Array = this._getActiveLayers(); | |
var _local4:Number = 0; | |
var _local5:int; | |
while (_local5 < _local3.length) { | |
_local6 = _local3[_local5]; | |
_local7 = _local6.getTotalTime(); | |
if ((_local4 + _local7) > _local2){ | |
_local8 = (_local2 - _local4); | |
if (((this._activeLayer) && (!((this._activeLayer == _local6))))){ | |
this._activeLayer.stopAudioAndClearHighlights(); | |
}; | |
this._activeLayer = _local6; | |
this._activeLayer.goToTime(_local8); | |
break; | |
}; | |
_local4 = (_local4 + _local7); | |
_local5++; | |
}; | |
} | |
public function playActiveFlowFrom(_arg1:Number):void{ | |
this._stopTimer(); | |
var _local2:ScreenReaderMulti = this._activeLayer; | |
if (_local2 == null){ | |
_local2 = this._lastLayer; | |
}; | |
if (_local2 != null){ | |
_local2.playActiveFlowFrom(_arg1); | |
}; | |
} | |
public function numLayersWithContent():int{ | |
var _local1:int; | |
var _local2:Array = this._getActiveLayers(); | |
var _local3:int; | |
while (_local3 < _local2.length) { | |
if (_local2[_local3].hasContent()){ | |
_local1++; | |
}; | |
_local3++; | |
}; | |
return (_local1); | |
} | |
private function _layerPlayComplete(_arg1:Event):void{ | |
var _local2:ScreenReaderMulti; | |
var _local3:Array; | |
var _local4:int; | |
var _local5:int; | |
var _local6:ScreenReaderMulti; | |
dispatchEvent(new Event(LAYER_PLAY_COMPLETE)); | |
if (this._autoplay){ | |
_local2 = (_arg1.currentTarget as ScreenReaderMulti); | |
_local3 = this._getActiveLayers(); | |
_local4 = _local3.indexOf(_local2); | |
if (_local4 < (_local3.length - 1)){ | |
_local5 = (_local4 + 1); | |
while (_local5 < _local3.length) { | |
_local6 = _local3[_local5]; | |
if (_local6.hasContent()){ | |
this._setActiveLayer(_local6); | |
if (this._layerDelay == 0){ | |
_local6.beginPlay(); | |
} else { | |
this._delayTimer = new Timer(this._layerDelay, 1); | |
this._delayTimer.addEventListener(TimerEvent.TIMER_COMPLETE, this._layerPlayDelayed); | |
this._delayTimer.start(); | |
}; | |
return; | |
}; | |
_local5++; | |
}; | |
}; | |
this._setActiveLayer(null); | |
dispatchEvent(new Event(SEQUENCE_PLAY_COMPLETE)); | |
} else { | |
this._setActiveLayer(null); | |
}; | |
} | |
private function _layerPlayDelayed(_arg1:Event):void{ | |
this._delayTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, this._layerPlayDelayed); | |
this._activeLayer.beginPlay(); | |
} | |
private function _stopTimer():void{ | |
if (this._delayTimer){ | |
this._delayTimer.stop(); | |
}; | |
} | |
private function _getActiveLayers():Array{ | |
var _local1:Array = new Array(); | |
var _local2:int; | |
while (_local2 < this._layers.length) { | |
if (this._layers[_local2].stage){ | |
_local1.push(this._layers[_local2]); | |
}; | |
_local2++; | |
}; | |
return (_local1); | |
} | |
private function _flowPlayStart(_arg1:Event):void{ | |
var _local2:ScreenReaderMulti = (_arg1.currentTarget as ScreenReaderMulti); | |
this._setActiveLayer(_local2); | |
dispatchEvent(new Event(PLAY_START)); | |
} | |
private function _getTotalActiveTime():Number{ | |
var _local4:ScreenReaderMulti; | |
var _local1:Number = 0; | |
var _local2:Array = this._getActiveLayers(); | |
var _local3:int; | |
while (_local3 < _local2.length) { | |
_local4 = _local2[_local3]; | |
_local1 = (_local1 + _local4.getTotalTime()); | |
_local3++; | |
}; | |
return (_local1); | |
} | |
private function _layerPlayProgress(_arg1:EventWithParam):void{ | |
var _local6:ScreenReaderMulti; | |
var _local2:Number = 0; | |
var _local3:Array = this._getActiveLayers(); | |
var _local4:int; | |
while (_local4 < _local3.length) { | |
_local6 = _local3[_local4]; | |
if (_arg1.currentTarget == _local6){ | |
_local2 = (_local2 + (_arg1.param as Number)); | |
break; | |
}; | |
_local2 = (_local2 + _local6.getTotalTime()); | |
_local4++; | |
}; | |
var _local5:Number = (_local2 / this._getTotalActiveTime()); | |
dispatchEvent(new EventWithParam(SEQUENCE_PLAY_PROGRESS, _local5)); | |
} | |
private function _flowPlayComplete(_arg1:Event):void{ | |
dispatchEvent(new Event(FLOW_PLAY_COMPLETE)); | |
} | |
private function _flowPlayProgress(_arg1:EventWithParam):void{ | |
var _local2:ScreenReaderMulti = (_arg1.currentTarget as ScreenReaderMulti); | |
var _local3:Number = _local2.getActiveFlowTotalTime(); | |
var _local4:Number = (_arg1.param as Number); | |
var _local5:Number = (_local4 / _local3); | |
dispatchEvent(new EventWithParam(FLOW_PLAY_PROGRESS, _local5)); | |
} | |
private function _setActiveLayer(_arg1:ScreenReaderMulti):void{ | |
if (this._activeLayer != null){ | |
this._lastLayer = this._activeLayer; | |
}; | |
this._activeLayer = _arg1; | |
} | |
private function _readerPauseEvent(_arg1:Event):void{ | |
dispatchEvent(new Event(PAUSED)); | |
} | |
private function _readerReadyEvent(_arg1:Event):void{ | |
dispatchEvent(new Event(READY)); | |
} | |
private function _reorderLayers():void{ | |
var _local3:String; | |
var _local4:int; | |
if (!this._layerListModified){ | |
return; | |
}; | |
var _local1:Array = new Array(); | |
var _local2:int; | |
while (_local2 < this._layers.length) { | |
_local3 = this._layers[_local2].getPage(); | |
_local4 = this._pageOrder.indexOf(_local3); | |
_local1[_local4] = this._layers[_local2]; | |
_local2++; | |
}; | |
this._layers = new Array(); | |
_local2 = 0; | |
while (_local2 < _local1.length) { | |
if ((_local1[_local2] is ScreenReaderMulti)){ | |
this._layers.push(_local1[_local2]); | |
}; | |
_local2++; | |
}; | |
} | |
private function _getLayerForPage(_arg1:String):ScreenReaderMulti{ | |
var _local3:ScreenReaderMulti; | |
var _local2:int; | |
while (_local2 < this._layers.length) { | |
_local3 = (this._layers[_local2] as ScreenReaderMulti); | |
if (_local3.getPage() == _arg1){ | |
return (_local3); | |
}; | |
_local2++; | |
}; | |
return (null); | |
} | |
} | |
}//package com.vpg.vpage.shell.screenreader | |
package com.vpg.vpage.shell.screenreader { | |
public interface IIconCallbacks { | |
function playClicked(_arg1:Flow):void; | |
function stopClicked(_arg1:Flow):void; | |
} | |
}//package com.vpg.vpage.shell.screenreader | |
package com.vpg.vpage.shell.screenreader { | |
import flash.events.*; | |
public interface IIconManager extends IEventDispatcher { | |
function setIconToPlay(_arg1:Flow):void; | |
function setIconToStop(_arg1:Flow):void; | |
function setAllIconsToPlay():void; | |
function isLoaded():Boolean; | |
} | |
}//package com.vpg.vpage.shell.screenreader | |
package com.vpg.vpage.shell.screenreader { | |
import flash.display.*; | |
import flash.geom.*; | |
import flash.events.*; | |
import com.vpg.vpage.utils.*; | |
import flash.utils.*; | |
public class ExternalIconManager extends EventDispatcher implements IIconManager { | |
private static const PLAY_STATE = new Object(); | |
private static const STOP_STATE = new Object(); | |
private var _flowMap:HashMap; | |
private var _stateMap:HashMap; | |
private var _callbacks:IIconCallbacks; | |
private var _iconsToLoad:int; | |
private var _iconsLoaded:int; | |
private var _iconsAnimated:int; | |
private var _flowsLoaded:int; | |
private var _iconState:Object; | |
private var _timer:Timer; | |
public function ExternalIconManager(_arg1:MovieClip, _arg2:Array, _arg3:IIconCallbacks, _arg4:String, _arg5:Number){ | |
this._flowMap = new HashMap(); | |
this._stateMap = new HashMap(); | |
this._callbacks = _arg3; | |
this._setUpIcons(_arg1, _arg2, _arg4, _arg5); | |
} | |
public function setIconToPlay(_arg1:Flow):void{ | |
var _local2:MovieClip = (this._flowMap.get(_arg1) as MovieClip); | |
var _local3:Loader = (_local2.getChildAt(0) as Loader); | |
var _local4:MovieClip = (_local3.content as MovieClip); | |
DisplayU.tryGotoAndPlay(_local4, "play_up"); | |
this._stateMap.put(_local2, ExternalIconManager.PLAY_STATE); | |
} | |
public function setIconToStop(_arg1:Flow):void{ | |
var _local2:MovieClip = (this._flowMap.get(_arg1) as MovieClip); | |
var _local3:Loader = (_local2.getChildAt(0) as Loader); | |
var _local4:MovieClip = (_local3.content as MovieClip); | |
DisplayU.tryGotoAndPlay(_local4, "stop_up"); | |
this._stateMap.put(_local2, ExternalIconManager.STOP_STATE); | |
} | |
public function setAllIconsToPlay():void{ | |
var _local1:Array = this._flowMap.keys(); | |
var _local2:int; | |
while (_local2 < _local1.length) { | |
this.setIconToPlay(_local1[_local2]); | |
_local2++; | |
}; | |
} | |
public function isLoaded():Boolean{ | |
if (this._iconsLoaded == this._iconsToLoad){ | |
return (true); | |
}; | |
return (false); | |
} | |
private function _setUpIcons(_arg1:MovieClip, _arg2:Array, _arg3:String, _arg4:Number):void{ | |
var _local6:Flow; | |
var _local7:MovieClip; | |
var _local8:Point; | |
var _local9:String; | |
this._iconsToLoad = _arg2.length; | |
this._iconsLoaded = 0; | |
this._iconsAnimated = 0; | |
this._flowsLoaded = 0; | |
var _local5:int; | |
while (_local5 < _arg2.length) { | |
_local6 = _arg2[_local5]; | |
_local6.addEventListener(Flow.AUDIO_LOADED, this._flowAudioLoaded); | |
_local6.addEventListener(Flow.PLAY, this._flowPlayEvent); | |
_local6.addEventListener(Flow.STOP, this._flowStopEvent); | |
_local7 = new MovieClip(); | |
_arg1.addChild(_local7); | |
_local8 = _local6.getIconLoc(); | |
_local7.x = _local8.x; | |
_local7.y = _local8.y; | |
this._flowMap.put(_local6, _local7); | |
_local9 = ("data/icons/" + _arg3); | |
this._loadIcon(_local9, _local7, _local6, _arg4); | |
_local5++; | |
}; | |
} | |
private function _flowAudioLoaded(_arg1:Event):void{ | |
this._flowsLoaded++; | |
this._checkState(); | |
} | |
private function _isSetToPlayState(_arg1:MovieClip):Boolean{ | |
if (this._stateMap.get(_arg1) == ExternalIconManager.PLAY_STATE){ | |
return (true); | |
}; | |
return (false); | |
} | |
private function _loadIcon(_arg1:String, _arg2:MovieClip, _arg3:Flow, _arg4:Number){ | |
var _local5:Loader = NetU.doArtLoad(_arg1, this._iconLoaded, this._iconLoadError); | |
NetU.doArtLoad(_arg1, this._iconLoaded, this._iconLoadError).scaleX = (_local5.scaleY = _arg4); | |
_arg2.addChild(_local5); | |
} | |
private function _iconLoaded(_arg1:Event):void{ | |
var _local2:LoaderInfo = (_arg1.currentTarget as LoaderInfo); | |
var _local3:Loader = _local2.loader; | |
var _local4:MovieClip = (_local2.loader.content as MovieClip); | |
var _local5:MovieClip = (_local3.parent as MovieClip); | |
_local5.buttonMode = true; | |
_local5.useHandCursor = true; | |
_local5.mouseChildren = false; | |
_local5.addEventListener(MouseEvent.CLICK, this._buttonClicked); | |
_local4.addEventListener(Event.COMPLETE, this._iconAnimated); | |
_local4.gotoAndPlay(1); | |
this._finishIconLoad(_local3); | |
} | |
private function _iconAnimated(_arg1:Event):void{ | |
this._iconsAnimated++; | |
this._checkState(); | |
} | |
private function _checkState():void{ | |
if ((((this._iconsAnimated == this._iconsToLoad)) && ((this._flowsLoaded == this._iconsToLoad)))){ | |
this.setAllIconsToPlay(); | |
}; | |
} | |
private function _buttonClicked(_arg1:Event):void{ | |
var _local2:MovieClip = (_arg1.currentTarget as MovieClip); | |
var _local3:Flow = this._flowMap.getByValue(_local2); | |
if (this._isSetToPlayState(_local2) == true){ | |
this._callbacks.playClicked(_local3); | |
} else { | |
this._callbacks.stopClicked(_local3); | |
}; | |
} | |
private function _iconLoadError(_arg1:Event):void{ | |
var _local2:LoaderInfo = (_arg1.currentTarget as LoaderInfo); | |
var _local3:Loader = _local2.loader; | |
this._finishIconLoad(_local3); | |
} | |
private function _finishIconLoad(_arg1:Loader):void{ | |
this._iconsLoaded++; | |
if (this._iconsLoaded == this._iconsToLoad){ | |
dispatchEvent(new Event(Event.COMPLETE)); | |
}; | |
} | |
private function _doOver(_arg1:Event):void{ | |
} | |
private function _doOut(_arg1:Event):void{ | |
} | |
private function _doClick(_arg1:Event):void{ | |
} | |
private function _flowPlayEvent(_arg1:Event):void{ | |
var _local2:Flow = (_arg1.currentTarget as Flow); | |
this.setIconToStop(_local2); | |
} | |
private function _flowStopEvent(_arg1:Event):void{ | |
var _local2:Flow = (_arg1.currentTarget as Flow); | |
this.setIconToPlay(_local2); | |
} | |
} | |
}//package com.vpg.vpage.shell.screenreader | |
package com.vpg.vpage.shell.history { | |
public class History { | |
private var _items:Array; | |
private var _currentIndex:int; | |
public function History(){ | |
this.clear(); | |
} | |
public function goBack():void{ | |
var _local1:IHistoryItem; | |
if (this.hasBackItems()){ | |
_local1 = this._getCurrentItem(); | |
this._currentIndex--; | |
_local1.undo(); | |
}; | |
} | |
public function goForward():void{ | |
var _local1:IHistoryItem; | |
if (this.hasForwardItems()){ | |
this._currentIndex++; | |
_local1 = this._getCurrentItem(); | |
_local1.redo(); | |
}; | |
} | |
public function addItem(_arg1:IHistoryItem):void{ | |
if (this._currentIndex < (this._items.length - 1)){ | |
this._items = this._items.slice(0, (this._currentIndex + 1)); | |
}; | |
this._items.push(_arg1); | |
this._currentIndex = (this._items.length - 1); | |
} | |
public function hasForwardItems():Boolean{ | |
if ((((this._items.length > 0)) && (!((this._currentIndex == (this._items.length - 1)))))){ | |
return (true); | |
}; | |
return (false); | |
} | |
public function hasBackItems():Boolean{ | |
if (this._currentIndex > 0){ | |
return (true); | |
}; | |
return (false); | |
} | |
public function clear():void{ | |
this._items = new Array(); | |
this._currentIndex = -1; | |
} | |
private function _getCurrentItem():IHistoryItem{ | |
var _local1:IHistoryItem = this._items[this._currentIndex]; | |
return (_local1); | |
} | |
} | |
}//package com.vpg.vpage.shell.history | |
package com.vpg.vpage.shell.history { | |
public interface IHistoryItem { | |
function undo():void; | |
function redo():void; | |
function toString():String; | |
} | |
}//package com.vpg.vpage.shell.history | |
package com.vpg.vpage.shell.history { | |
import com.vpg.vpage.shell.*; | |
public class HistoryPage implements IHistoryItem { | |
private var _app:App; | |
private var _prevPage:String; | |
private var _myPage:String; | |
public function HistoryPage(_arg1:App, _arg2:String, _arg3:String):void{ | |
this._app = _arg1; | |
this._prevPage = _arg3; | |
this._myPage = _arg2; | |
} | |
public function undo():void{ | |
this._app.gotoPage(this._prevPage, false); | |
} | |
public function redo():void{ | |
this._app.gotoPage(this._myPage, false); | |
} | |
public function toString():String{ | |
return ((((("[" + this._prevPage) + " to ") + this._myPage) + "]")); | |
} | |
} | |
}//package com.vpg.vpage.shell.history | |
package com.vpg.vpage.shell { | |
import flash.display.*; | |
import flash.net.*; | |
import flash.events.*; | |
import com.vpg.vpage.utils.*; | |
import com.vpg.vpage.shell.history.*; | |
import com.vpg.vpage.shell.userdata.*; | |
import com.vpg.vpage.shell.multibook.*; | |
import com.vpg.vpage.shell.pageicons.*; | |
import com.vpg.vpage.shell.savedata.*; | |
import com.vpg.vpage.shell.datastore.*; | |
import flash.system.*; | |
public class App extends EventDispatcher { | |
private static const SINGLE:String = "single"; | |
private static const DOUBLE:String = "double"; | |
private var _bookID:String; | |
private var _root:Sprite; | |
private var _loaderInfo:LoaderInfo; | |
private var _pathPrefix:String; | |
private var _mainMC:Main; | |
private var _pageList:Array; | |
private var _pageListIndex:Number; | |
private var _options:HashMap; | |
private var _functionLoadList:Array; | |
private var _functionLoadIndex:Number; | |
private var _styleMgr:KeyValueFile; | |
private var _interfaceText:InterfaceText; | |
private var _multibookMain:MultibookMain; | |
private var _pageViewMode:String; | |
private var _datastore:IUserDataStorage; | |
private var _backendConnector:IBackendConnector; | |
private var _history:History; | |
private var _paramMgr:ParamManager; | |
public function App(_arg1:Sprite, _arg2:String, _arg3:LoaderInfo=null, _arg4:String=""){ | |
trace(((("App: initializating " + _arg2) + " with path ") + _arg4)); | |
this._bookID = _arg2; | |
this._root = _arg1; | |
this._pathPrefix = _arg4; | |
this._loaderInfo = _arg3; | |
} | |
public function destroy():void{ | |
this._mainMC.destroy(); | |
if (this._mainMC.parent){ | |
this._mainMC.parent.removeChild(this._mainMC); | |
}; | |
this._styleMgr.destroy(); | |
this._options.clear(); | |
this._datastore.destroy(); | |
ArrayU.clear(this._pageList); | |
ArrayU.clear(this._functionLoadList); | |
this._paramMgr.destroy(); | |
this._pageList = null; | |
this._root = null; | |
this._mainMC = null; | |
this._options = null; | |
this._functionLoadList = null; | |
this._styleMgr = null; | |
this._interfaceText = null; | |
this._multibookMain = null; | |
this._datastore = null; | |
this._bookID = null; | |
this._pathPrefix = null; | |
this._pageViewMode = null; | |
this._paramMgr = null; | |
} | |
public function setMultibookMain(_arg1:MultibookMain):void{ | |
this._multibookMain = _arg1; | |
} | |
public function getMultibookMain():MultibookMain{ | |
return (this._multibookMain); | |
} | |
public function getNewBook(_arg1:Sprite, _arg2:String):App{ | |
var _local3:App = new App(_arg1, _arg2); | |
return (_local3); | |
} | |
public function multibookSwitchTo(_arg1):void{ | |
this._mainMC.multibookSwitchTo(_arg1); | |
} | |
public function getOption(_arg1:String, _arg2:String=""):String{ | |
var _local3:String = this._options.get(_arg1); | |
if (_local3 == null){ | |
return (_arg2); | |
}; | |
return (_local3); | |
} | |
public function getBookID():String{ | |
return (this._bookID); | |
} | |
public function getMain():Main{ | |
return (this._mainMC); | |
} | |
public function getStyleMgr():KeyValueFile{ | |
return (this._styleMgr); | |
} | |
public function init():void{ | |
this._functionLoadIndex = -1; | |
this._history = new History(); | |
this._paramMgr = new ParamManager(this._loaderInfo); | |
var _local1 = "_initStyles,_initConfig,_initPageList,_initBackend,_initMainMc,_initFirstPage"; | |
this._functionLoadList = _local1.split(","); | |
this._doNextInit(); | |
} | |
public function nextPage():Boolean{ | |
var _local1:int = this._pageListIndex; | |
if (this.isSinglePageMode()){ | |
if (_local1 == (this._pageList.length - 1)){ | |
return (false); | |
}; | |
return (this.gotoPage(this._pageList[(this._pageListIndex + 1)])); | |
}; | |
if ((((_local1 == 0)) && (this.firstPageIsSingle()))){ | |
return (this.gotoPage(this._pageList[(this._pageListIndex + 1)])); | |
}; | |
return (this.gotoPage(this._pageList[(this._pageListIndex + 2)])); | |
} | |
public function isOnFirstPage():Boolean{ | |
if (this._pageListIndex == 0){ | |
return (true); | |
}; | |
return (false); | |
} | |
public function isOnLastPage():Boolean{ | |
if (this.isSinglePageMode()){ | |
if (this._pageListIndex == (this._pageList.length - 1)){ | |
return (true); | |
}; | |
return (false); | |
}; | |
if (this._pageListIndex == (this._pageList.length - 1)){ | |
return (true); | |
}; | |
if ((((this._pageListIndex == (this._pageList.length - 2))) && (!(this.lastPageIsSingle())))){ | |
return (true); | |
}; | |
return (false); | |
} | |
public function prevPage():Boolean{ | |
var _local2:String; | |
var _local3:String; | |
var _local1:int = this._pageListIndex; | |
if (_local1 == 0){ | |
return (false); | |
}; | |
if (this.isSinglePageMode()){ | |
_local2 = this._pageList[(this._pageListIndex - 1)]; | |
return (this.gotoPage(_local2)); | |
}; | |
_local3 = this._pageList[(this._pageListIndex - 2)]; | |
if (((this.firstPageIsSingle()) && ((_local1 == 1)))){ | |
_local3 = this._pageList[0]; | |
}; | |
return (this.gotoPage(_local3)); | |
} | |
public function firstPage():Boolean{ | |
var _local1:String = this._pageList[0]; | |
return (this.gotoPage(_local1)); | |
} | |
public function lastPage():Boolean{ | |
var _local1:String = this._pageList[(this._pageList.length - 1)]; | |
return (this.gotoPage(_local1)); | |
} | |
public function unPadPage(_arg1:String):String{ | |
return (StringU.unpad(_arg1, "0", 1)); | |
} | |
public function padPage(_arg1:Object):String{ | |
if (!this._pageIsNaN(_arg1)){ | |
return (StringU.pad(String(_arg1), "0", 4)); | |
}; | |
return (String(_arg1)); | |
} | |
public function getPartialPages(_arg1:int, _arg2:int):Array{ | |
var _local3:int = Math.min((_arg1 + _arg2), this._pageList.length); | |
return (this._pageList.slice(_arg1, _local3)); | |
} | |
public function historyForward():void{ | |
this._history.goForward(); | |
} | |
public function hasHistoryForward():Boolean{ | |
return (this._history.hasForwardItems()); | |
} | |
public function historyBack():void{ | |
this._history.goBack(); | |
} | |
public function hasHistoryBack():Boolean{ | |
return (this._history.hasBackItems()); | |
} | |
public function getRootPath():String{ | |
return (this._pathPrefix); | |
} | |
public function getCurrentPage():String{ | |
return (this._pageList[this._pageListIndex]); | |
} | |
public function getFacingPage():String{ | |
if (this.isSinglePageMode()){ | |
return (""); | |
}; | |
if (((this.isOnFirstPage()) && (this.firstPageIsSingle()))){ | |
return (""); | |
}; | |
if (((this.isOnLastPage()) && (this.lastPageIsSingle()))){ | |
return (""); | |
}; | |
return (this._pageList[(this._pageListIndex + 1)]); | |
} | |
public function hasFacingPage():Boolean{ | |
if (this.getFacingPage() == ""){ | |
return (false); | |
}; | |
return (true); | |
} | |
public function getParam(_arg1:String):String{ | |
return (this._paramMgr.getVal(_arg1)); | |
} | |
public function setParam(_arg1:String, _arg2:String):void{ | |
this._paramMgr.setVal(_arg1, _arg2); | |
} | |
public function isValidPage(_arg1:String):Boolean{ | |
var _local2:Number = 0; | |
while (_local2 < this._pageList.length) { | |
if (this._pageList[_local2].toLowerCase() == _arg1.toLowerCase()){ | |
return (true); | |
}; | |
_local2++; | |
}; | |
return (false); | |
} | |
public function gotoPage(_arg1:String, _arg2:Boolean=true):Boolean{ | |
var _local3:String; | |
var _local4:String; | |
var _local5:String; | |
var _local6:String; | |
trace(("App.gotoPage: " + _arg1)); | |
if ((((((this.getOption("preload_pages", "0") == "1")) && (this._mainMC.isPageCurrentlyLoading()))) && (!(this.isSinglePageMode())))){ | |
return (false); | |
}; | |
if ((((_arg1 == null)) || ((_arg1 == "")))){ | |
return (false); | |
}; | |
_arg1 = StringU.trim(_arg1); | |
_arg1 = this.unPadPage(_arg1); | |
if (this.isValidPage(_arg1)){ | |
_local3 = this.getCurrentPage(); | |
_arg1 = this._getPageListPage(_arg1); | |
_local4 = _arg1; | |
this._pageListIndex = this.getPageListIndex(_arg1); | |
_arg1 = this.padPage(_arg1); | |
if (_arg2){ | |
this._history.addItem(new HistoryPage(this, _local4, _local3)); | |
}; | |
if (this.isSinglePageMode()){ | |
this._mainMC.setSinglePage(_arg1); | |
} else { | |
if ((((this._pageListIndex == 0)) && (this.firstPageIsSingle()))){ | |
this._mainMC.setSinglePage(_arg1); | |
} else { | |
if ((((this._pageListIndex == (this._pageList.length - 1))) && (this.lastPageIsSingle()))){ | |
this._mainMC.setSinglePage(_arg1); | |
} else { | |
if (this.isLeftPage(_arg1)){ | |
_local5 = this._pageList[(this._pageListIndex + 1)]; | |
_local5 = this.padPage(_local5); | |
this._mainMC.setDoublePage(_arg1, _local5); | |
} else { | |
_local6 = this._pageList[(this._pageListIndex - 1)]; | |
_local6 = this.padPage(_local6); | |
this._pageListIndex--; | |
this._mainMC.setDoublePage(_local6, _arg1); | |
}; | |
}; | |
}; | |
}; | |
return (true); | |
}; | |
this._mainMC.setNavText(this.getCurrentPage()); | |
return (false); | |
} | |
public function isLeftPage(_arg1:String):Boolean{ | |
_arg1 = this.unPadPage(_arg1); | |
_arg1 = this._getPageListPage(_arg1); | |
var _local2:int = this.getPageListIndex(_arg1); | |
if (((this.firstPageIsSingle()) && ((_local2 > 0)))){ | |
_local2++; | |
}; | |
if ((_local2 % 2) == 0){ | |
return (true); | |
}; | |
return (false); | |
} | |
public function getCurrentPageListIndex():int{ | |
return (this.getPageListIndex(this.getCurrentPage())); | |
} | |
public function getPageListIndex(_arg1:String):int{ | |
var _local3:String; | |
var _local2:Number = 0; | |
while (_local2 < this._pageList.length) { | |
_local3 = this._pageList[_local2]; | |
if (this.unPadPage(_local3.toLowerCase()) == this.unPadPage(_arg1.toLowerCase())){ | |
return (_local2); | |
}; | |
_local2++; | |
}; | |
return (-1); | |
} | |
public function getInterfaceText(_arg1:String, _arg2:String=""):String{ | |
return (this._interfaceText.getInterfaceText(_arg1, _arg2)); | |
} | |
public function getIconFunctions():IIconFunctions{ | |
return (this._mainMC.getIconFunctions()); | |
} | |
public function setDoublePageMode():void{ | |
this._pageViewMode = DOUBLE; | |
if (!this.isLeftPage(this.getCurrentPage())){ | |
this._pageListIndex--; | |
}; | |
this.refreshPage(); | |
} | |
public function setSinglePageMode():void{ | |
this._pageViewMode = SINGLE; | |
this.refreshPage(); | |
} | |
public function refreshPage():void{ | |
var _local1:String = this.getCurrentPage(); | |
this.gotoPage(_local1, false); | |
} | |
public function isSinglePageMode():Boolean{ | |
if (this._pageViewMode == SINGLE){ | |
return (true); | |
}; | |
return (false); | |
} | |
public function getDataStore():IUserDataStorage{ | |
return (this._datastore); | |
} | |
public function getPages():Array{ | |
return (this._pageList.slice()); | |
} | |
public function getPageIDs():Array{ | |
var _local1:Array = this.getPages(); | |
var _local2:Array = new Array(); | |
var _local3:int; | |
while (_local3 < _local1.length) { | |
if (_local1[_local3] != ""){ | |
_local2.push(this.padPage(_local1[_local3])); | |
}; | |
_local3++; | |
}; | |
return (_local2); | |
} | |
public function firstPageIsSingle():Boolean{ | |
if (this.getOption("first_page_is_single", "0") == "1"){ | |
return (true); | |
}; | |
return (false); | |
} | |
public function lastPageIsSingle():Boolean{ | |
var _local1:int = this._pageList.length; | |
if (this.firstPageIsSingle()){ | |
_local1--; | |
}; | |
if ((_local1 % 2) == 0){ | |
return (false); | |
}; | |
return (true); | |
} | |
public function hasParam(_arg1:String):Boolean{ | |
return (this._paramMgr.hasParam(_arg1)); | |
} | |
private function _pageIsNaN(_arg1:Object):Boolean{ | |
var _local2:String = _arg1.toString(); | |
if (_local2.substring((_local2.length - 1)).toLowerCase() == "e"){ | |
return (true); | |
}; | |
return (isNaN(Number(_local2))); | |
} | |
private function _getPageListPage(_arg1:String):String{ | |
var _local3:String; | |
var _local2:Number = 0; | |
while (_local2 < this._pageList.length) { | |
_local3 = this._pageList[_local2]; | |
if (_local3.toLowerCase() == _arg1.toLowerCase()){ | |
return (_local3); | |
}; | |
_local2++; | |
}; | |
return (""); | |
} | |
private function _initStyles():void{ | |
this._styleMgr = new KeyValueFile("="); | |
this._styleMgr.addEventListener(Event.COMPLETE, this._stylesReady); | |
this._styleMgr.load((((this.getRootPath() + "data/") + this._bookID) + "_styles.txt")); | |
} | |
private function _stylesReady(_arg1:Event):void{ | |
this._styleMgr.removeEventListener(Event.COMPLETE, this._stylesReady); | |
this._doNextInit(); | |
} | |
private function _initConfig():void{ | |
var _local1 = (((this.getRootPath() + "data/") + this._bookID) + "_config.xml"); | |
NetU.doFileLoad(_local1, this._configLoaded, this._configLoadError); | |
} | |
private function _configLoaded(_arg1:Event):void{ | |
var _local6:XML; | |
this._options = new HashMap(); | |
var _local2:URLLoader = (_arg1.currentTarget as URLLoader); | |
var _local3:XML = new XML(_local2.data); | |
var _local4:XMLList = _local3.options.option; | |
var _local5:Number = 0; | |
while (_local5 < _local4.length()) { | |
_local6 = _local4[_local5]; | |
this._options.put(String(_local6.@type), String(_local6.text())); | |
_local5++; | |
}; | |
this._interfaceText = new InterfaceText(_local3); | |
this._pageViewMode = this.getOption("default_page_view", "single"); | |
System.disposeXML(_local3); | |
this._doNextInit(); | |
} | |
private function _initBackend():void{ | |
var _local2:String; | |
var _local3:IRequestProcessor; | |
var _local4:UserDataStorage; | |
var _local5:String; | |
var _local1:String = this.getOption("backend_version", "1"); | |
if (_local1 == "2"){ | |
this._datastore = new UserDataStorage(); | |
this._datastore.addEventListener(UserDataStorageEvent.SAVE_ERROR, this._userDataStorageSaveError); | |
this._datastore.addEventListener(UserDataStorageEvent.LOAD_ERROR, this._userDataStorageLoadError); | |
_local2 = this.getOption("user_data_request_processor", "com.vpg.vpage.shell.userdata.LocalMemory"); | |
_local3 = (ClassUtils.createClass(_local2) as IRequestProcessor); | |
_local4 = (this._datastore as UserDataStorage); | |
_local4.setRequestProcessor(_local3); | |
_local3.addEventListener(RequestProcessorEvent.INIT_SUCCESS, this._backendReady); | |
_local3.addEventListener(RequestProcessorEvent.INIT_ERROR, this._backendNotReady); | |
_local3.init(this); | |
if (MiscUtils.isDevMode()){ | |
this._backendReady(null); | |
}; | |
} else { | |
this._datastore = new GenericDataStore(this.getBookID()); | |
_local5 = this.getOption("backend_connector_class", "com.vpg.vpage.shell.savedata.NullConnector"); | |
this._backendConnector = (ClassUtils.createClass(_local5) as IBackendConnector); | |
if (this._backendConnector){ | |
this._backendConnector.addEventListener(SaveLoadEvent.LOAD_SUCCESS, this._backendLoadSuccess); | |
this._backendConnector.addEventListener(SaveLoadEvent.LOAD_ERROR, this._backendLoadError); | |
this._backendConnector.addEventListener(SaveLoadEvent.SAVE_SUCCESS, this._backendSaveSuccess); | |
this._backendConnector.addEventListener(SaveLoadEvent.SAVE_ERROR, this._backendSaveError); | |
this._backendConnector.addEventListener(SaveLoadEvent.GENERIC_ERROR, this._backendGenericError); | |
this._backendConnector.init(this); | |
} else { | |
this._userDataInited(); | |
this._mainMC.showPrompt("The selected backend connector was not found. Your data will not be saved."); | |
}; | |
}; | |
} | |
private function _backendLoadError(_arg1:SaveLoadEvent):void{ | |
var _local2:String = _arg1.message; | |
this._mainMC.showPrompt(_local2); | |
this._userDataInited(); | |
} | |
private function _backendSaveError(_arg1:SaveLoadEvent):void{ | |
var _local2:String = _arg1.message; | |
this._mainMC.showPrompt(_local2); | |
} | |
private function _backendLoadSuccess(_arg1:SaveLoadEvent):void{ | |
this._userDataInited(); | |
} | |
private function _backendSaveSuccess(_arg1:SaveLoadEvent):void{ | |
} | |
private function _backendGenericError(_arg1:SaveLoadEvent):void{ | |
var _local2:String = _arg1.message; | |
this._mainMC.showPrompt(_local2); | |
} | |
private function _backendReady(_arg1:Event):void{ | |
this._userDataInited(); | |
} | |
private function _backendNotReady(_arg1:RequestProcessorEvent):void{ | |
this._userDataInited(); | |
} | |
private function _userDataInited():void{ | |
this._doNextInit(); | |
} | |
private function _configLoadError(_arg1:Event):void{ | |
trace("Configuration file failed to load."); | |
} | |
private function _initPageList():void{ | |
var _local1:KeyValueFile = new KeyValueFile(); | |
_local1.addEventListener(Event.COMPLETE, this._pageListLoaded); | |
var _local2 = (((this.getRootPath() + "data/") + this._bookID) + "_pagelist.txt"); | |
_local1.load(_local2); | |
} | |
private function _pageListLoaded(_arg1:Event):void{ | |
var _local2:KeyValueFile = (_arg1.currentTarget as KeyValueFile); | |
_local2.removeEventListener(Event.COMPLETE, this._pageListLoaded); | |
this._pageList = _local2.getOrderedKeys(); | |
_local2.destroy(); | |
this._doNextInit(); | |
} | |
private function _initMainMc():void{ | |
this._mainMC = ClassUtils.createClass(this.getOption("main_class", "com.vpg.vpage.shell.Main")); | |
this._mainMC.setApp(this); | |
this._root.addChildAt(this._mainMC, 0); | |
this._mainMC.addEventListener(Event.COMPLETE, this._mainDone); | |
this._mainMC.init(); | |
} | |
private function _mainDone(_arg1:Event):void{ | |
this._mainMC.removeEventListener(Event.COMPLETE, this._mainDone); | |
this._doNextInit(); | |
} | |
private function _initFirstPage():void{ | |
if (this.hasParam("page")){ | |
this.gotoPage(this.getParam("page")); | |
} else { | |
this.gotoPage(this._pageList[0]); | |
}; | |
this._doNextInit(); | |
} | |
private function _initDone():void{ | |
this._mainMC.initComplete(); | |
dispatchEvent(new Event(Event.COMPLETE)); | |
} | |
private function _doNextInit(){ | |
if (this._functionLoadIndex < (this._functionLoadList.length - 1)){ | |
this._functionLoadIndex++; | |
trace(((((("_doNextInit [" + (this._functionLoadIndex + 1)) + " of ") + this._functionLoadList.length) + "]: running init function ") + String(this._functionLoadList[this._functionLoadIndex]))); | |
var _local1 = this; | |
_local1[this._functionLoadList[this._functionLoadIndex]](); | |
} else { | |
if (this._functionLoadIndex == (this._functionLoadList.length - 1)){ | |
this._functionLoadIndex++; | |
this._initDone(); | |
}; | |
}; | |
} | |
private function _userDataStorageSaveError(_arg1:UserDataStorageEvent):void{ | |
var _local2:String = this.getInterfaceText("save_error_message", "An error occurred when saving your data."); | |
_local2 = this._mainMC.formatMessageAndCode(_local2, _arg1.code); | |
this._mainMC.showPrompt(_local2); | |
} | |
private function _userDataStorageLoadError(_arg1:UserDataStorageEvent):void{ | |
var _local2:String = this.getInterfaceText("load_error_message", "An error occurred when loading your data."); | |
_local2 = this._mainMC.formatMessageAndCode(_local2, _arg1.code); | |
this._mainMC.showPrompt(_local2); | |
} | |
private function _initPreloadPages():void{ | |
} | |
} | |
}//package com.vpg.vpage.shell | |
package com.vpg.vpage.shell { | |
import flash.display.*; | |
import flash.geom.*; | |
import flash.events.*; | |
import com.vpg.vpage.utils.*; | |
public class ToolTipBuilder { | |
public static var PADDING:Number = 3; | |
public static var OFFSET:Number = 8; | |
private static var _currentTip:Sprite; | |
private static var _labelMap:HashMap = new HashMap(); | |
private static var _currentTipObj:Object; | |
public static function registerButton(_arg1:InteractiveObject, _arg2:String):void{ | |
_arg1.addEventListener(MouseEvent.MOUSE_OVER, _doOver); | |
_arg1.addEventListener(MouseEvent.MOUSE_OUT, _doOut); | |
_arg1.addEventListener(MouseEvent.MOUSE_DOWN, _doDown); | |
_labelMap.put(_arg1, _arg2); | |
} | |
public static function unRegisterButton(_arg1:InteractiveObject):void{ | |
_arg1.removeEventListener(MouseEvent.MOUSE_OVER, _doOver); | |
_arg1.removeEventListener(MouseEvent.MOUSE_OUT, _doOut); | |
_arg1.removeEventListener(MouseEvent.MOUSE_DOWN, _doDown); | |
_labelMap.remove(_arg1); | |
} | |
public static function changeToolTip(_arg1:InteractiveObject, _arg2:String):void{ | |
_labelMap.put(_arg1, _arg2); | |
} | |
public static function killCurrentTip():void{ | |
if (_currentTip){ | |
_currentTip.parent.removeChild(_currentTip); | |
_currentTip = null; | |
_currentTipObj = null; | |
}; | |
} | |
private static function _doOver(_arg1:Event):void{ | |
var _local2:InteractiveObject = (_arg1.currentTarget as InteractiveObject); | |
if (_currentTipObj != _local2){ | |
_drawToolTip(_local2); | |
}; | |
} | |
private static function _doDown(_arg1:Event):void{ | |
killCurrentTip(); | |
} | |
private static function _doOut(_arg1:Event):void{ | |
killCurrentTip(); | |
} | |
private static function _drawToolTip(_arg1:InteractiveObject):void{ | |
var _local3:Sprite; | |
var _local4:Rectangle; | |
var _local5:DisplayObjectContainer; | |
killCurrentTip(); | |
var _local2:String = _labelMap.get(_arg1); | |
if (_local2){ | |
_local3 = new ToolTip(_local2, (_arg1.stage.width / 2)); | |
_local3.mouseEnabled = false; | |
_local3.mouseChildren = false; | |
_local4 = _arg1.getBounds(_arg1.root); | |
_local5 = (_arg1.root as DisplayObjectContainer); | |
_local3.x = (_local5.mouseX + OFFSET); | |
_local3.y = (_local5.mouseY + OFFSET); | |
if ((_local3.x + _local3.width) > _arg1.stage.stageWidth){ | |
_local3.x = ((_arg1.stage.stageWidth - _local3.width) - PADDING); | |
}; | |
if (_local3.x < PADDING){ | |
_local3.x = PADDING; | |
}; | |
if ((_local3.y + _local3.height) > _arg1.stage.stageHeight){ | |
_local3.y = ((_local5.mouseY - OFFSET) - _local3.height); | |
}; | |
if (_local3.y < PADDING){ | |
_local3.y = PADDING; | |
}; | |
_local5.addChild(_local3); | |
_currentTip = _local3; | |
_currentTipObj = _arg1; | |
}; | |
} | |
} | |
}//package com.vpg.vpage.shell | |
package com.vpg.vpage.shell.activepagetext { | |
import flash.display.*; | |
import com.vpg.vpage.utils.*; | |
import com.vpg.vpage.utils.cursor.*; | |
public class HighlightCursor extends BasicCursor { | |
public var tint:MovieClip; | |
public function HighlightCursor(_arg1:Number){ | |
this.setColor(_arg1); | |
} | |
public function setColor(_arg1:Number):void{ | |
if (this.tint){ | |
DisplayU.tint(this.tint, _arg1); | |
}; | |
} | |
} | |
}//package com.vpg.vpage.shell.activepagetext | |
package com.vpg.vpage.shell.activepagetext { | |
import com.vpg.vpage.utils.*; | |
import com.vpg.vpage.shell.activepagetext.textinfo.*; | |
public class Markup { | |
private var _range:TextRange; | |
private var _rangeStr:String; | |
public var color:Number; | |
public var type:String; | |
public var text:String; | |
public var date:Date; | |
public function Markup(_arg1:TextRange, _arg2:Number, _arg3:String, _arg4:Date){ | |
this._range = _arg1; | |
this.color = _arg2; | |
this.type = _arg3; | |
if (_arg4){ | |
this.date = _arg4; | |
} else { | |
this.date = new Date(); | |
}; | |
} | |
public static function initFromXML(_arg1:XML):Markup{ | |
var _local2:Number = Number(_arg1.color.toString()); | |
var _local3:String = _arg1.type.toString(); | |
var _local4:Number = Number(_arg1.date.toString()); | |
var _local5:Date = new Date(_local4); | |
var _local6:String = _arg1.range.toString(); | |
var _local7:Markup = new Markup(null, _local2, _local3, _local5); | |
_local7.rangeStr = _local6; | |
return (_local7); | |
} | |
public function set range(_arg1:TextRange):void{ | |
this._range = _arg1; | |
this._rangeStr = undefined; | |
} | |
public function get range():TextRange{ | |
return (this._range); | |
} | |
public function set rangeStr(_arg1:String):void{ | |
this._rangeStr = _arg1; | |
this._range = undefined; | |
} | |
public function get rangeStr():String{ | |
return (this._rangeStr); | |
} | |
public function toXMLString():String{ | |
var _local1 = "<markup>"; | |
_local1 = (_local1 + StringU.makeXMLNodeString("color", String(this.color))); | |
_local1 = (_local1 + StringU.makeXMLNodeString("type", this.type)); | |
if (this.range){ | |
_local1 = (_local1 + StringU.makeXMLNodeString("range", this.range.toString())); | |
} else { | |
if (this.rangeStr){ | |
_local1 = (_local1 + StringU.makeXMLNodeString("range", this.rangeStr)); | |
}; | |
}; | |
if (this.date){ | |
_local1 = (_local1 + StringU.makeXMLNodeString("date", String(this.date.valueOf()))); | |
}; | |
if (this.text){ | |
_local1 = (_local1 + StringU.makeXMLNodeString("text", this.text)); | |
}; | |
_local1 = (_local1 + "</markup>"); | |
return (_local1); | |
} | |
public function toString():String{ | |
return (this.toXMLString()); | |
} | |
} | |
}//package com.vpg.vpage.shell.activepagetext | |
package com.vpg.vpage.shell.activepagetext.textinfo { | |
import flash.events.*; | |
import com.vpg.vpage.utils.*; | |
public class TextRangeSelector extends EventDispatcher { | |
public static const BEGIN_SEL:String = "beginSel"; | |
public static const END_SEL:String = "endSel"; | |
public static const CHANGE_SEL:String = "changeSel"; | |
private var _service:XpdfLayer; | |
private var _mode:Number; | |
private var _range:TextRange; | |
private var _isDragging:Boolean; | |
private var _sel:TextRange; | |
public function TextRangeSelector(_arg1:Object){ | |
var _local2:*; | |
super(); | |
for (_local2 in _arg1) { | |
this[("_" + _local2)] = _arg1[_local2]; | |
}; | |
switch (this._mode){ | |
case XpdfLayer.WORDMODE: | |
this._service.addEventListener(XpdfLayer.ENTER_WORD, this._enterWord); | |
break; | |
case XpdfLayer.CHARMODE: | |
this._service.addEventListener(XpdfLayer.ENTER_CHAR, this._enterChar); | |
break; | |
case XpdfLayer.EDGEMODE: | |
this._service.addEventListener(XpdfLayer.ENTER_EDGE, this._enterEdge); | |
break; | |
}; | |
this._service.addEventListener(XpdfLayer.PRESS, this._press); | |
this._service.addEventListener(XpdfLayer.RELEASE, this._release); | |
this._service.addEventListener(XpdfLayer.RELEASE_OUTSIDE, this._releaseOutside); | |
} | |
public function onBeforeUnload():void{ | |
switch (this._mode){ | |
case XpdfLayer.WORDMODE: | |
this._service.removeEventListener(XpdfLayer.ENTER_WORD, this._enterWord); | |
break; | |
case XpdfLayer.CHARMODE: | |
this._service.removeEventListener(XpdfLayer.ENTER_CHAR, this._enterChar); | |
break; | |
case XpdfLayer.EDGEMODE: | |
this._service.removeEventListener(XpdfLayer.ENTER_EDGE, this._enterEdge); | |
break; | |
}; | |
this._service.removeEventListener(XpdfLayer.PRESS, this._press); | |
this._service.removeEventListener(XpdfLayer.RELEASE, this._release); | |
this._service.removeEventListener(XpdfLayer.RELEASE_OUTSIDE, this._releaseOutside); | |
} | |
private function _press(_arg1:EventWithParam):void{ | |
if (((this._range) && (!(this._range.contains(_arg1.target))))){ | |
return; | |
}; | |
this._isDragging = true; | |
var _local2:CharInfo = (_arg1.param as CharInfo); | |
this._sel = new TextRange(_local2, _local2, this._mode); | |
dispatchEvent(new EventWithParam(BEGIN_SEL, this._sel)); | |
} | |
private function _release(_arg1:EventWithParam):void{ | |
if (this._isDragging){ | |
this._isDragging = false; | |
dispatchEvent(new EventWithParam(END_SEL, this._sel)); | |
this._sel = undefined; | |
}; | |
} | |
private function _releaseOutside(_arg1:EventWithParam):void{ | |
if (this._isDragging){ | |
this._isDragging = false; | |
dispatchEvent(new EventWithParam(END_SEL, this._sel)); | |
this._sel = undefined; | |
}; | |
} | |
private function _enterWord(_arg1:EventWithParam):void{ | |
var _local2:CharInfo; | |
if (this._isDragging){ | |
_local2 = this._service.getCharUnderMouse(); | |
if (((this._range) && (!(this._range.contains(_local2))))){ | |
return; | |
}; | |
this._sel.endChar = _local2; | |
dispatchEvent(new EventWithParam(CHANGE_SEL, this._sel)); | |
}; | |
} | |
private function _enterChar(_arg1:EventWithParam):void{ | |
var _local2:CharInfo; | |
if (this._isDragging){ | |
_local2 = (_arg1.param as CharInfo); | |
if (((this._range) && (!(this._range.contains(_local2))))){ | |
return; | |
}; | |
this._sel.endChar = _local2; | |
dispatchEvent(new EventWithParam(CHANGE_SEL, this._sel)); | |
}; | |
} | |
private function _enterEdge(_arg1:EventWithParam):void{ | |
var _local2:CharInfo; | |
if (this._isDragging){ | |
_local2 = (_arg1.param as CharInfo); | |
if (((this._range) && (!(this._range.contains(_local2))))){ | |
return; | |
}; | |
this._sel.endChar = _local2; | |
dispatchEvent(new EventWithParam(CHANGE_SEL, this._sel)); | |
}; | |
} | |
} | |
}//package com.vpg.vpage.shell.activepagetext.textinfo | |
package com.vpg.vpage.shell.activepagetext.textinfo { | |
public class TextRange { | |
public var startChar:CharInfo; | |
public var endChar:CharInfo; | |
public var mode:Number; | |
public function TextRange(_arg1:CharInfo, _arg2:CharInfo, _arg3:Number){ | |
this.startChar = _arg1; | |
this.endChar = _arg2; | |
this.mode = _arg3; | |
} | |
public function minChar():CharInfo{ | |
return (((this.startChar.edgeIndex)<=this.endChar.edgeIndex) ? this.startChar : this.endChar); | |
} | |
public function maxChar():CharInfo{ | |
return (((this.endChar.edgeIndex)>=this.startChar.edgeIndex) ? this.endChar : this.startChar); | |
} | |
public function contains(_arg1:Object):Boolean{ | |
var _local2:CharInfo; | |
var _local3:TextRange; | |
if ((_arg1 is CharInfo)){ | |
_local2 = CharInfo(_arg1); | |
switch (this.mode){ | |
case XpdfLayer.WORDMODE: | |
return ((((this.minChar().word.index <= _local2.word.index)) && ((_local2.word.index <= this.maxChar().word.index)))); | |
case XpdfLayer.CHARMODE: | |
return ((((this.minChar().index <= _local2.index)) && ((_local2.index <= this.maxChar().index)))); | |
case XpdfLayer.EDGEMODE: | |
return ((((this.minChar().edgeIndex <= _local2.edgeIndex)) && ((_local2.edgeIndex <= this.maxChar().edgeIndex)))); | |
}; | |
} else { | |
if ((_arg1 is TextRange)){ | |
_local3 = TextRange(_arg1); | |
switch (this.mode){ | |
case XpdfLayer.WORDMODE: | |
return ((((this.minChar().word.index <= _local3.minChar().word.index)) && ((_local3.maxChar().word.index <= this.maxChar().word.index)))); | |
case XpdfLayer.CHARMODE: | |
return ((((this.minChar().index <= _local3.minChar().index)) && ((_local3.maxChar().index <= this.maxChar().index)))); | |
case XpdfLayer.EDGEMODE: | |
return ((((this.minChar().edgeIndex <= _local3.minChar().edgeIndex)) && ((_local3.maxChar().edgeIndex <= this.maxChar().edgeIndex)))); | |
}; | |
}; | |
}; | |
return (false); | |
} | |
public function intersects(_arg1:TextRange):Boolean{ | |
return (((((this.contains(_arg1)) || (_arg1.contains(this.minChar())))) || (_arg1.contains(this.maxChar())))); | |
} | |
public function isAdjacentTo(_arg1:TextRange):Boolean{ | |
switch (this.mode){ | |
case XpdfLayer.WORDMODE: | |
return ((((((((this.minChar().word.index == (_arg1.maxChar().word.index + 2))) || ((this.maxChar().word.index == (_arg1.minChar().word.index - 2))))) || ((this.minChar().word.index == (_arg1.maxChar().word.index + 1))))) || ((this.maxChar().word.index == (_arg1.minChar().word.index - 1))))); | |
case XpdfLayer.CHARMODE: | |
return ((((this.minChar().index == (_arg1.maxChar().index + 1))) || ((this.maxChar().index == (_arg1.minChar().index - 1))))); | |
case XpdfLayer.EDGEMODE: | |
return ((((this.minChar().edgeIndex == _arg1.maxChar().edgeIndex)) || ((this.maxChar().edgeIndex == _arg1.minChar().edgeIndex)))); | |
}; | |
return (false); | |
} | |
public function merge(_arg1:TextRange):void{ | |
var _local2:CharInfo = ((this.minChar().edgeIndex)<=_arg1.minChar().edgeIndex) ? this.minChar() : _arg1.minChar(); | |
var _local3:CharInfo = ((this.maxChar().edgeIndex)>=_arg1.maxChar().edgeIndex) ? this.maxChar() : _arg1.maxChar(); | |
this.startChar = _local2; | |
this.endChar = _local3; | |
} | |
public function toString(_arg1:Number=1, _arg2:Boolean=false):String{ | |
var _local3:String; | |
var _local6:Number; | |
if (_arg1 == 1){ | |
_arg1 = this.mode; | |
}; | |
var _local4:CharInfo = this.startChar; | |
var _local5:CharInfo = this.endChar; | |
if (_local4.index > _local5.index){ | |
_local5 = this.startChar; | |
_local4 = this.endChar; | |
}; | |
switch (_arg1){ | |
case XpdfLayer.WORDMODE: | |
if (!_arg2){ | |
_local3 = ("w" + _local4.word.index); | |
if (_local5.word.index != _local4.word.index){ | |
_local3 = (_local3 + (":" + _local5.word.index)); | |
}; | |
} else { | |
_local3 = (":" + _local5.word.index); | |
}; | |
break; | |
case XpdfLayer.CHARMODE: | |
if (!_arg2){ | |
_local3 = ("c" + _local4.index); | |
if (_local5.index != _local4.index){ | |
_local3 = (_local3 + (":" + _local5.index)); | |
}; | |
} else { | |
_local3 = (":" + _local5.index); | |
}; | |
break; | |
case XpdfLayer.EDGEMODE: | |
if (!_arg2){ | |
_local6 = (_local4.word.charPos + _local4.edge); | |
_local3 = ("e" + _local6); | |
if (((!((_local5.index == _local4.index))) || (!((_local5.edge == _local4.edge))))){ | |
_local6 = (_local5.word.charPos + _local5.edge); | |
_local3 = (_local3 + (":" + _local6)); | |
}; | |
} else { | |
_local6 = (_local5.word.charPos + _local5.edge); | |
_local3 = (_local3 + (":" + _local6)); | |
}; | |
break; | |
default: | |
_local3 = ""; | |
}; | |
return (_local3); | |
} | |
} | |
}//package com.vpg.vpage.shell.activepagetext.textinfo | |
package com.vpg.vpage.shell.activepagetext.textinfo { | |
import flash.geom.*; | |
public class CharInfo { | |
public var word:WordInfo; | |
public var pos:Number; | |
public var index:Number; | |
public var edge:Number; | |
public var text:String; | |
public var bbox:Object; | |
public function CharInfo(_arg1:WordInfo, _arg2:Number, _arg3:Number){ | |
var _local4:*; | |
var _local5:*; | |
var _local6:*; | |
var _local7:*; | |
super(); | |
this.word = _arg1; | |
this.edge = _arg3; | |
this.pos = _arg2; | |
this.index = (_arg1.charPos + _arg2); | |
this.text = _arg1.text.charAt(_arg2); | |
switch (_arg1.rot){ | |
case 0: | |
_local4 = ((_arg1.charEdges[(_arg2 + 1)])!=null) ? _arg1.charEdges[(_arg2 + 1)] : _arg1.bbox.xMax; | |
this.bbox = { | |
xMin:_arg1.charEdges[_arg2], | |
xMax:_local4, | |
yMin:_arg1.bbox.yMin, | |
yMax:_arg1.bbox.yMax | |
}; | |
break; | |
case 1: | |
_local5 = ((_arg1.charEdges[(_arg2 + 1)])!=null) ? _arg1.charEdges[(_arg2 + 1)] : _arg1.bbox.yMax; | |
this.bbox = { | |
xMin:_arg1.bbox.xMin, | |
xMax:_arg1.bbox.xMax, | |
yMin:_arg1.charEdges[_arg2], | |
yMax:_local5 | |
}; | |
break; | |
case 2: | |
_local6 = ((_arg1.charEdges[(_arg2 + 1)])!=null) ? _arg1.charEdges[(_arg2 + 1)] : _arg1.bbox.xMin; | |
this.bbox = { | |
xMin:_local6, | |
xMax:_arg1.charEdges[_arg2], | |
yMin:_arg1.bbox.yMin, | |
yMax:_arg1.bbox.yMax | |
}; | |
break; | |
case 3: | |
_local7 = ((_arg1.charEdges[(_arg2 + 1)])!=null) ? _arg1.charEdges[(_arg2 + 1)] : _arg1.bbox.yMin; | |
this.bbox = { | |
xMin:_arg1.bbox.xMin, | |
xMax:_arg1.bbox.xMax, | |
yMin:_local7, | |
yMax:_arg1.charEdges[_arg2] | |
}; | |
break; | |
}; | |
} | |
public function get edgeIndex():Number{ | |
return ((this.word.charPos + this.edge)); | |
} | |
public function getRect():Rectangle{ | |
return (new Rectangle(this.bbox.xMin, this.bbox.yMin, (this.bbox.xMax - this.bbox.xMin), (this.bbox.yMax - this.bbox.yMin))); | |
} | |
public function getEdgeRect():Rectangle{ | |
var _local1:Number; | |
switch (this.word.rot){ | |
case 0: | |
_local1 = ((this.edge)==this.pos) ? this.bbox.xMin : this.bbox.xMax; | |
return (new Rectangle(_local1, this.bbox.yMin, 1, (this.bbox.yMax - this.bbox.yMin))); | |
case 1: | |
_local1 = ((this.edge)==this.pos) ? this.bbox.yMin : this.bbox.yMax; | |
return (new Rectangle(this.bbox.xMin, _local1, (this.bbox.xMax - this.bbox.xMin), 1)); | |
case 2: | |
_local1 = ((this.edge)==this.pos) ? this.bbox.xMax : this.bbox.xMin; | |
return (new Rectangle(_local1, this.bbox.yMin, 1, (this.bbox.yMax - this.bbox.yMin))); | |
case 3: | |
_local1 = ((this.edge)==this.pos) ? this.bbox.yMax : this.bbox.yMin; | |
return (new Rectangle(this.bbox.xMin, _local1, (this.bbox.xMax - this.bbox.xMin), 1)); | |
}; | |
return (new Rectangle()); | |
} | |
public function getEdgeValue():Number{ | |
switch (this.word.rot){ | |
case 0: | |
return (((this.edge)==this.pos) ? this.bbox.xMin : this.bbox.xMax); | |
case 1: | |
return (((this.edge)==this.pos) ? this.bbox.yMin : this.bbox.yMax); | |
case 2: | |
return (((this.edge)==this.pos) ? this.bbox.xMax : this.bbox.xMin); | |
case 3: | |
return (((this.edge)==this.pos) ? this.bbox.yMax : this.bbox.yMin); | |
}; | |
return (0); | |
} | |
public function toString():String{ | |
var _local1 = ""; | |
var _local2:int = this.word.text.length; | |
var _local3:int; | |
while (_local3 < _local2) { | |
if (_local3 != this.pos){ | |
_local1 = (_local1 + this.word.text.charAt(_local3)); | |
} else { | |
_local1 = (_local1 + ((this.edge)==this.pos) ? "|" : "("); | |
_local1 = (_local1 + this.word.text.charAt(_local3)); | |
_local1 = (_local1 + ((this.edge)==this.pos) ? ")" : "|"); | |
}; | |
_local3++; | |
}; | |
return (_local1); | |
} | |
} | |
}//package com.vpg.vpage.shell.activepagetext.textinfo | |
package com.vpg.vpage.shell.activepagetext.textinfo { | |
import flash.geom.*; | |
public class WordInfo { | |
public var ref:Object; | |
public var index:Number; | |
public var rot:Number; | |
public var charPos:Number; | |
public var charEdges:Array; | |
public var text:String; | |
public var base:Number; | |
public var bbox:Object; | |
public function WordInfo(_arg1:Object){ | |
var _local2:*; | |
super(); | |
for (_local2 in _arg1) { | |
this[_local2] = _arg1[_local2]; | |
}; | |
this.ref = _arg1; | |
} | |
public function getRect():Rectangle{ | |
return (new Rectangle(this.bbox.xMin, this.bbox.yMin, (this.bbox.xMax - this.bbox.xMin), (this.bbox.yMax - this.bbox.yMin))); | |
} | |
} | |
}//package com.vpg.vpage.shell.activepagetext.textinfo | |
package com.vpg.vpage.shell.activepagetext.textinfo { | |
import flash.display.*; | |
import flash.geom.*; | |
import flash.net.*; | |
import flash.events.*; | |
import com.vpg.vpage.utils.*; | |
import com.adobe.serialization.json.*; | |
public class XpdfLayer extends Sprite { | |
public static const LEAVE_WORD:String = "leaveWord"; | |
public static const ENTER_WORD:String = "enterWord"; | |
public static const LEAVE_CHAR:String = "leaveChar"; | |
public static const ENTER_CHAR:String = "enterChar"; | |
public static const LEAVE_EDGE:String = "leaveEdge"; | |
public static const ENTER_EDGE:String = "enterEdge"; | |
public static const PRESS:String = "press"; | |
public static const RELEASE:String = "release"; | |
public static const RELEASE_OUTSIDE:String = "releaseOutside"; | |
public static const WORDMODE:Number = 0; | |
public static const CHARMODE:Number = 1; | |
public static const EDGEMODE:Number = 2; | |
private var _actLayer:MovieClip; | |
private var _swf:MovieClip; | |
private var _words:Array; | |
private var _wordTree:Object; | |
private var _curWord:WordInfo; | |
private var _curChar:CharInfo; | |
private var _curMouse:Point; | |
private var _curPress:CharInfo; | |
private var _monitorWords:Boolean; | |
private var _monitorChars:Boolean; | |
private var _monitorEdges:Boolean; | |
private var _listenClicks:Boolean; | |
private var _mouseDownPressed:Boolean; | |
private var _mouseDownWaited:Boolean; | |
private var _mouseDownFired:Boolean; | |
private var _mouseUpOccurred:Boolean; | |
public function XpdfLayer(){ | |
this._swf = new MovieClip(); | |
addChild(this._swf); | |
super(); | |
} | |
public function setSize(_arg1:Number, _arg2:Number):void{ | |
this._swf.graphics.clear(); | |
this._swf.graphics.beginFill(0xFF00, 0); | |
this._swf.graphics.drawRect(0, 0, _arg1, _arg2); | |
this._swf.graphics.endFill(); | |
} | |
public function getCharUnderMouse():CharInfo{ | |
var _local2:Number; | |
var _local3:Number; | |
var _local4:Number; | |
var _local5:Number; | |
if (!this._monitorWords){ | |
this._curWord = this._getWordUnderMouse(this._wordTree); | |
}; | |
if (this._curWord == null){ | |
return (null); | |
}; | |
var _local1:Array = this._curWord.charEdges; | |
switch (this._curWord.rot){ | |
case 0: | |
_local3 = this._curMouse.x; | |
_local4 = this._curWord.bbox.xMax; | |
_local2 = (_local1.length - 1); | |
while (_local2 >= 0) { | |
if (_local3 > _local1[_local2]){ | |
_local5 = (((_local3 - _local1[_local2]))>(_local4 - _local3)) ? (_local2 + 1) : _local2; | |
return (new CharInfo(this._curWord, _local2, _local5)); | |
}; | |
_local4 = _local1[_local2]; | |
_local2--; | |
}; | |
break; | |
case 1: | |
_local3 = this._curMouse.y; | |
_local4 = this._curWord.bbox.yMax; | |
_local2 = (_local1.length - 1); | |
while (_local2 >= 0) { | |
if (_local3 > _local1[_local2]){ | |
_local5 = (((_local3 - _local1[_local2]))>(_local4 - _local3)) ? (_local2 + 1) : _local2; | |
return (new CharInfo(this._curWord, _local2, _local5)); | |
}; | |
_local4 = _local1[_local2]; | |
_local2--; | |
}; | |
break; | |
case 2: | |
_local3 = this._curMouse.x; | |
_local4 = this._curWord.bbox.xMin; | |
_local2 = (_local1.length - 1); | |
while (_local2 >= 0) { | |
if (_local3 < _local1[_local2]){ | |
_local5 = (((_local3 - _local4))<(_local1[_local2] - _local3)) ? (_local2 + 1) : _local2; | |
return (new CharInfo(this._curWord, _local2, _local5)); | |
}; | |
_local4 = _local1[_local2]; | |
_local2--; | |
}; | |
break; | |
case 3: | |
_local3 = this._curMouse.y; | |
_local4 = this._curWord.bbox.yMin; | |
_local2 = (_local1.length - 1); | |
while (_local2 >= 0) { | |
if (_local3 < _local1[_local2]){ | |
_local5 = (((_local3 - _local4))<(_local1[_local2] - _local3)) ? (_local2 + 1) : _local2; | |
return (new CharInfo(this._curWord, _local2, _local5)); | |
}; | |
_local4 = _local1[_local2]; | |
_local2--; | |
}; | |
break; | |
}; | |
return (null); | |
} | |
public function getRects(_arg1:TextRange):Array{ | |
var _local5:Number; | |
var _local6:Number; | |
var _local7:Object; | |
var _local8:Number; | |
var _local9:Array; | |
var _local10:String; | |
var _local11:String; | |
var _local12:String; | |
var _local13:String; | |
var _local14:Array; | |
var _local15:Object; | |
var _local16:Number; | |
var _local17:int; | |
var _local18:CharInfo; | |
var _local2:CharInfo = _arg1.startChar; | |
var _local3:CharInfo = _arg1.endChar; | |
var _local4:Number = _arg1.mode; | |
if (_local2.index != _local3.index){ | |
if (_local2.index > _local3.index){ | |
_local18 = _local2; | |
_local2 = _local3; | |
_local3 = _local18; | |
}; | |
_local5 = _local2.word.index; | |
_local6 = _local3.word.index; | |
_local8 = _local2.word.rot; | |
_local9 = ["xMin", "yMin", "xMax", "yMax"]; | |
_local10 = _local9[_local8]; | |
_local11 = _local9[((_local8 + 2) % 4)]; | |
_local12 = _local9[((_local8 + 1) % 4)]; | |
_local13 = _local9[((_local8 + 3) % 4)]; | |
_local14 = []; | |
_local17 = _local5; | |
while (_local17 <= _local6) { | |
_local7 = this._words[_local17]; | |
if (_local7.rot != _local8){ | |
} else { | |
if (_local15 != null){ | |
if (_local7.base == _local16){ | |
_local15[_local11] = _local7.bbox[_local11]; | |
_local15[_local12] = (((_local8 % 3)) ? Math.max(_local15[_local12], _local7.bbox[_local12]) : Math.min(_local15[_local12], _local7.bbox[_local12])); | |
_local15[_local13] = (((_local8 % 3)) ? Math.min(_local15[_local13], _local7.bbox[_local13]) : Math.max(_local15[_local13], _local7.bbox[_local13])); | |
} else { | |
_local16 = _local7.base; | |
_local15 = this._bboxCopy(_local7.bbox); | |
_local14.push(_local15); | |
}; | |
} else { | |
_local16 = _local7.base; | |
_local15 = this._bboxCopy(_local7.bbox); | |
_local14.push(_local15); | |
}; | |
}; | |
_local17++; | |
}; | |
switch (_local4){ | |
case CHARMODE: | |
_local14[0][_local10] = _local2.bbox[_local10]; | |
_local14[(_local14.length - 1)][_local11] = _local3.bbox[_local11]; | |
break; | |
case EDGEMODE: | |
_local14[0][_local10] = _local2.getEdgeValue(); | |
_local14[(_local14.length - 1)][_local11] = _local3.getEdgeValue(); | |
break; | |
case WORDMODE: | |
break; | |
}; | |
return (this._bboxesToRects(_local14)); | |
}; | |
switch (_local4){ | |
case CHARMODE: | |
return ([_local2.getRect()]); | |
case EDGEMODE: | |
return ([_local2.getEdgeRect()]); | |
case WORDMODE: | |
return ([_local2.word.getRect()]); | |
}; | |
return (new Array()); | |
} | |
public function specsToRanges(_arg1:Array):Array{ | |
var _local5:TextRange; | |
var _local2:Array = []; | |
var _local3:Number = _arg1.length; | |
var _local4:int; | |
while (_local4 < _local3) { | |
_local5 = this.specToRange(_arg1[_local4]); | |
if (_local5 != null){ | |
_local2.push(_local5); | |
}; | |
_local4++; | |
}; | |
return (_local2); | |
} | |
public function specToRange(_arg1:String):TextRange{ | |
var _local3:Array; | |
var _local4:Number; | |
var _local5:CharInfo; | |
var _local6:TextRange; | |
var _local2:Number = "wce".indexOf(_arg1.charAt(0)); | |
if (_local2 > -1){ | |
_local3 = _arg1.slice(1).split(":"); | |
_local4 = parseInt(_local3[0], 10); | |
if (!isNaN(_local4)){ | |
_local5 = this._getCharInfoByIndex(_local4, _local2); | |
_local6 = new TextRange(_local5, _local5, _local2); | |
_local4 = parseInt(_local3[1], 10); | |
if (!isNaN(_local4)){ | |
_local5 = this._getCharInfoByIndex(_local4, _local2, true); | |
if ((((_local5 == null)) || ((_local5.index < _local6.startChar.index)))){ | |
return (null); | |
}; | |
_local6.endChar = _local5; | |
}; | |
return (_local6); | |
}; | |
}; | |
return (null); | |
} | |
public function getTextString(_arg1:TextRange):String{ | |
var _local2:Array; | |
var _local3:Array; | |
var _local4:int; | |
var _local5:WordInfo; | |
switch (_arg1.mode){ | |
case WORDMODE: | |
if (_arg1.startChar.word.index < _arg1.endChar.word.index){ | |
_local2 = this._words.slice(_arg1.startChar.word.index, (_arg1.endChar.word.index + 1)); | |
} else { | |
_local2 = this._words.slice(_arg1.endChar.word.index, (_arg1.startChar.word.index + 1)); | |
}; | |
_local3 = new Array(); | |
_local4 = 0; | |
while (_local4 < _local2.length) { | |
_local5 = new WordInfo(_local2[_local4]); | |
if (((_local5.text) && (!((_local5.text == " "))))){ | |
_local3.push(_local5.text); | |
}; | |
_local4++; | |
}; | |
return (_local3.join(" ")); | |
case CHARMODE: | |
return (""); | |
case EDGEMODE: | |
return (""); | |
default: | |
return (""); | |
}; | |
} | |
override public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{ | |
super.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5); | |
if (((!((_arg1.indexOf("Word") == -1))) && (!(this._monitorWords)))){ | |
this._monitorWords = true; | |
} else { | |
if (((!((_arg1.indexOf("Char") == -1))) && (!(this._monitorChars)))){ | |
this._monitorChars = true; | |
} else { | |
if (((!((_arg1.indexOf("Edge") == -1))) && (!(this._monitorEdges)))){ | |
this._monitorEdges = true; | |
} else { | |
if ((((((_arg1 == "press")) || ((_arg1 == "release")))) && (!(this._listenClicks)))){ | |
this._listenClicks = true; | |
this._swf.addEventListener(MouseEvent.MOUSE_DOWN, this._mouseDownEventHandler); | |
if (this._swf.stage){ | |
this._addStageListener(null); | |
} else { | |
super.addEventListener(Event.ADDED_TO_STAGE, this._addStageListener); | |
}; | |
}; | |
}; | |
}; | |
}; | |
} | |
override public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{ | |
super.removeEventListener(_arg1, _arg2, _arg3); | |
if (_arg1.indexOf("Word") != -1){ | |
if (((((this._monitorWords) && (!(this._hasListeners("enterWord"))))) && (!(this._hasListeners("leaveWord"))))){ | |
this._monitorWords = false; | |
}; | |
} else { | |
if (_arg1.indexOf("Char") != -1){ | |
if (((((this._monitorChars) && (!(this._hasListeners("enterChar"))))) && (!(this._hasListeners("leaveChar"))))){ | |
this._monitorChars = false; | |
}; | |
} else { | |
if (_arg1.indexOf("Edge") != -1){ | |
if (((((this._monitorEdges) && (!(this._hasListeners("enterEdge"))))) && (!(this._hasListeners("leaveEdge"))))){ | |
this._monitorEdges = false; | |
}; | |
} else { | |
if ((((_arg1 == "press")) || ((_arg1.indexOf("release") == 0)))){ | |
if (((((((this._listenClicks) && (!(this._hasListeners("press"))))) && (!(this._hasListeners("release"))))) && (!(this._hasListeners("releaseOutside"))))){ | |
this._listenClicks = false; | |
this._swf.removeEventListener(MouseEvent.MOUSE_DOWN, this._mouseDownEventHandler); | |
this._swf.stage.removeEventListener(MouseEvent.MOUSE_UP, this._mouseUpEventHandler); | |
}; | |
}; | |
}; | |
}; | |
}; | |
} | |
public function loadJSON(_arg1:String):void{ | |
var _local2:URLLoader = new URLLoader(); | |
_local2.addEventListener(Event.COMPLETE, this._onLoadInit); | |
_local2.addEventListener(IOErrorEvent.IO_ERROR, this._onLoadError); | |
var _local3:URLRequest = new URLRequest(_arg1); | |
_local2.load(_local3); | |
} | |
private function _doFrameEvents(_arg1:Event):void{ | |
this._monitorTree(); | |
this._checkMouseDown(); | |
} | |
private function _monitorTree():void{ | |
var _local1:WordInfo; | |
var _local2:Object; | |
var _local3:Object; | |
if (this._curMouse == null){ | |
this._curMouse = new Point(-1000, -1000); | |
}; | |
if (((!((this._swf.mouseX == this._curMouse.x))) || (!((this._swf.mouseY == this._curMouse.y))))){ | |
this._curMouse = new Point(this._swf.mouseX, this._swf.mouseY); | |
if (this._monitorWords){ | |
_local1 = this._getWordUnderMouse(this._wordTree); | |
_local2 = null; | |
_local3 = null; | |
if (_local1 != null){ | |
_local2 = _local1.ref; | |
}; | |
if (this._curWord != null){ | |
_local3 = this._curWord.ref; | |
}; | |
if (_local2 != _local3){ | |
if (this._curWord != null){ | |
dispatchEvent(new EventWithParam(LEAVE_WORD, this._curWord)); | |
}; | |
this._curWord = _local1; | |
if (this._curWord != null){ | |
dispatchEvent(new EventWithParam(ENTER_WORD, this._curWord)); | |
}; | |
}; | |
}; | |
}; | |
} | |
private function _mouseDownEventHandler(_arg1:Event):void{ | |
this._cleanUpMouseStates(); | |
this._mouseDownPressed = true; | |
} | |
private function _checkMouseDown():void{ | |
if (this._mouseDownPressed){ | |
this._mouseDownPressed = false; | |
this._mouseDownWaited = true; | |
} else { | |
if (this._mouseDownWaited){ | |
this._mouseDownEvent(); | |
this._mouseDownFired = true; | |
if (this._mouseUpOccurred){ | |
this._mouseUpEvent(); | |
}; | |
this._mouseDownWaited = false; | |
}; | |
}; | |
} | |
private function _mouseDownEvent(){ | |
if (this._listenClicks){ | |
if (!this._monitorChars){ | |
this._curChar = this.getCharUnderMouse(); | |
}; | |
if (this._curChar != null){ | |
this._curPress = this._curChar; | |
dispatchEvent(new EventWithParam(PRESS, this._curChar)); | |
}; | |
}; | |
} | |
private function _mouseUpEventHandler(_arg1:Event){ | |
if (this._mouseDownFired){ | |
this._mouseUpEvent(); | |
} else { | |
this._mouseUpOccurred = true; | |
}; | |
} | |
private function _mouseUpEvent(){ | |
if (this._listenClicks){ | |
if (!this._monitorChars){ | |
this._curChar = this.getCharUnderMouse(); | |
}; | |
if (this._curPress != null){ | |
if (this._curChar != null){ | |
dispatchEvent(new EventWithParam(RELEASE, this._curChar)); | |
} else { | |
dispatchEvent(new EventWithParam(RELEASE_OUTSIDE, this._curChar)); | |
}; | |
}; | |
this._curPress = null; | |
}; | |
} | |
private function _cleanUpMouseStates():void{ | |
this._mouseDownFired = false; | |
this._mouseUpOccurred = false; | |
this._mouseDownWaited = false; | |
this._mouseDownPressed = false; | |
} | |
private function _getWordUnderMouse(_arg1:Object):WordInfo{ | |
var _local3:Object; | |
var _local4:Object; | |
var _local5:WordInfo; | |
var _local8:Array; | |
var _local9:int; | |
var _local10:int; | |
var _local11:Object; | |
if (!this._bboxContains(_arg1.bbox, this._curMouse)){ | |
return (null); | |
}; | |
var _local2:Array = _arg1.nodes; | |
var _local6:int = _local2.length; | |
var _local7:int; | |
while (_local7 < _local6) { | |
_local3 = _local2[_local7]; | |
_local4 = _local3.bbox; | |
if (this._bboxContains(_local3.bbox, this._curMouse)){ | |
_local8 = _local3.nodes; | |
_local9 = 0; | |
while (_local9 < _local8.length) { | |
_local10 = _local8[_local9]; | |
_local11 = this._words[_local10]; | |
if (this._bboxContains(_local11.bbox, this._curMouse)){ | |
return (new WordInfo(_local11)); | |
}; | |
_local9++; | |
}; | |
}; | |
_local7++; | |
}; | |
return (null); | |
} | |
private function _bboxContains(_arg1:Object, _arg2:Point):Boolean{ | |
return ((((((((_arg2.x >= Number(_arg1.xMin))) && ((_arg2.x <= Number(_arg1.xMax))))) && ((_arg2.y >= Number(_arg1.yMin))))) && ((_arg2.y <= Number(_arg1.yMax))))); | |
} | |
private function _bboxCopy(_arg1:Object):Object{ | |
var _local3:*; | |
var _local2:Object = {}; | |
for (_local3 in _arg1) { | |
_local2[_local3] = _arg1[_local3]; | |
}; | |
return (_local2); | |
} | |
private function _bboxesToRects(_arg1:Array):Array{ | |
var _local2:Number = _arg1.length; | |
var _local3:Array = new Array(_local2); | |
var _local4:int; | |
while (_local4 < _local2) { | |
_local3[_local4] = new Rectangle(_arg1[_local4].xMin, _arg1[_local4].yMin, (_arg1[_local4].xMax - _arg1[_local4].xMin), (_arg1[_local4].yMax - _arg1[_local4].yMin)); | |
_local4++; | |
}; | |
return (_local3); | |
} | |
private function _getCharInfoByIndex(_arg1:Number, _arg2:Number, _arg3:Boolean=false):CharInfo{ | |
var _local4:WordInfo; | |
var _local5:CharInfo; | |
var _local6:Number; | |
var _local7:Number; | |
var _local8:Number; | |
var _local10:Number; | |
var _local9:Number = this._words.length; | |
if (_arg1 > (this._words.length - 1)){ | |
_arg1 = (this._words.length - 1); | |
}; | |
switch (_arg2){ | |
case WORDMODE: | |
if (_arg1 >= _local9){ | |
return (null); | |
}; | |
_local4 = new WordInfo(this._words[_arg1]); | |
_local7 = ((_arg3) ? (_local4.text.length - 1) : 0); | |
_local8 = ((_arg3) ? _local4.text.length : 0); | |
_local5 = new CharInfo(_local4, _local7, _local8); | |
break; | |
case CHARMODE: | |
_local10 = (this._words[(_local9 - 1)].charPos + this._words[(_local9 - 1)].text.length); | |
if (_arg1 >= _local10){ | |
return (null); | |
}; | |
_local6 = ArrayU.binarySearchOn(this._words, "charPos", _arg1, true); | |
while (this._words[_local6].charPos > _arg1) { | |
_local6--; | |
}; | |
_local4 = new WordInfo(this._words[_local6]); | |
_local7 = (_arg1 - _local4.charPos); | |
_local5 = new CharInfo(_local4, _local7, _local7); | |
break; | |
case EDGEMODE: | |
_local10 = (this._words[(_local9 - 1)].charPos + this._words[(_local9 - 1)].text.length); | |
if (_arg1 > _local10){ | |
return (null); | |
}; | |
_local6 = ArrayU.binarySearchOn(this._words, "charPos", _arg1, true); | |
while (this._words[_local6].charPos > _arg1) { | |
_local6--; | |
}; | |
_local4 = new WordInfo(this._words[_local6]); | |
_local8 = (_arg1 - _local4.charPos); | |
_local7 = ((_local8)==_local4.text.length) ? (_local8 - 1) : _local8; | |
_local5 = new CharInfo(_local4, _local7, _local8); | |
break; | |
}; | |
return (_local5); | |
} | |
private function _hasListeners(_arg1:String):Boolean{ | |
return (hasEventListener(_arg1)); | |
} | |
private function _onLoadInit(_arg1:Event):void{ | |
var _local2:URLLoader = (_arg1.currentTarget as URLLoader); | |
var _local3:Object = JSON.decode(_local2.data); | |
this._words = _local3.words; | |
this._wordTree = _local3.wordTree; | |
this.addEventListener(Event.ENTER_FRAME, this._doFrameEvents); | |
dispatchEvent(new Event(Event.COMPLETE)); | |
} | |
private function _onLoadError(_arg1:Event):void{ | |
dispatchEvent(new Event(Event.COMPLETE)); | |
} | |
private function _addStageListener(_arg1:Event):void{ | |
super.removeEventListener(Event.ADDED_TO_STAGE, this._addStageListener); | |
this._swf.stage.addEventListener(MouseEvent.MOUSE_UP, this._mouseUpEventHandler); | |
} | |
} | |
}//package com.vpg.vpage.shell.activepagetext.textinfo | |
package com.vpg.vpage.shell.activepagetext { | |
import flash.display.*; | |
import flash.geom.*; | |
import flash.events.*; | |
import com.vpg.vpage.utils.*; | |
import com.vpg.vpage.shell.activepagetext.textinfo.*; | |
public class PageTextLayer extends MovieClip { | |
public static const CONTENT_CHANGED:String = "contentChanged"; | |
public static const CIRCLE:String = "circle"; | |
public static const CIRCLEFILL:String = "circlefill"; | |
public static const OUTLINE:String = "outline"; | |
public static const CROSSOUT:String = "crossout"; | |
public static const HIGHLIGHT:String = "highlight"; | |
public static const UNDERLINE:String = "underline"; | |
public static const UNDERLINE2:String = "underline2"; | |
public static const UNDERLINE3:String = "underline3"; | |
private var _textrangeStr:String; | |
private var _textrangeObj:TextRange; | |
private var _unit:String; | |
private var _groupsStr:String; | |
private var _groupsArray:Array; | |
private var _mergeAdjacent:Boolean; | |
private var _markups:Array; | |
private var _canvas:MovieClip; | |
private var _scratch:MovieClip; | |
private var _curRange:TextRange; | |
private var _book:String; | |
private var _page:String; | |
private var _selector:TextRangeSelector; | |
private var _xpdfLayer:XpdfLayer; | |
private var _color:Number; | |
private var _type:String; | |
private var _bg:MovieClip; | |
private var _cursor:HighlightCursor; | |
public function init(_arg1:String, _arg2:String):void{ | |
this._type = HIGHLIGHT; | |
this._color = 0xFF0000; | |
this._unit = "word"; | |
this._textrangeStr = ""; | |
this._mergeAdjacent = false; | |
this._page = _arg2; | |
this._markups = new Array(); | |
this._canvas = new MovieClip(); | |
addChild(this._canvas); | |
this._scratch = new MovieClip(); | |
addChild(this._scratch); | |
this._cursor = new HighlightCursor(this._color); | |
addChild(this._cursor); | |
this._cursor.disable(); | |
this._buildRectSwf(_arg1); | |
} | |
public function activate(_arg1:Boolean):void{ | |
var _local2:*; | |
if (_arg1){ | |
_local2 = { | |
service:this._xpdfLayer, | |
mode:this._getMode() | |
}; | |
this._selector = new TextRangeSelector(_local2); | |
this._selector.addEventListener(TextRangeSelector.BEGIN_SEL, this._beginSel); | |
this._selector.addEventListener(TextRangeSelector.END_SEL, this._endSel); | |
this._selector.addEventListener(TextRangeSelector.CHANGE_SEL, this._changeSel); | |
mouseEnabled = true; | |
mouseChildren = true; | |
this._cursor.setActiveZone(this._xpdfLayer); | |
this._cursor.enable(); | |
} else { | |
this._cursor.disable(); | |
mouseEnabled = false; | |
mouseChildren = false; | |
if (this._selector){ | |
this._selector.removeEventListener(TextRangeSelector.BEGIN_SEL, this._beginSel); | |
this._selector.removeEventListener(TextRangeSelector.END_SEL, this._endSel); | |
this._selector.removeEventListener(TextRangeSelector.CHANGE_SEL, this._changeSel); | |
this._selector = null; | |
}; | |
}; | |
} | |
public function set toolcolor(_arg1:Number):void{ | |
this._color = _arg1; | |
if (this._cursor){ | |
this._cursor.setColor(_arg1); | |
}; | |
} | |
public function set tooltype(_arg1:String):void{ | |
this._type = _arg1; | |
} | |
public function get tooltype():String{ | |
return (this._type); | |
} | |
public function destroy():void{ | |
} | |
public function clear():void{ | |
this._markups = new Array(); | |
this._validate(); | |
dispatchEvent(new Event(CONTENT_CHANGED)); | |
} | |
public function getMarkupColor(_arg1:Markup):Number{ | |
if (_arg1.color != -1){ | |
return (_arg1.color); | |
}; | |
return (this._color); | |
} | |
public function setSize(_arg1:Number, _arg2:Number):void{ | |
if (!this._bg){ | |
this._bg = new Square(); | |
this._bg.alpha = 0; | |
addChild(this._bg); | |
}; | |
this._bg.width = _arg1; | |
this._bg.height = _arg2; | |
if (this._xpdfLayer){ | |
this._xpdfLayer.setSize(_arg1, _arg2); | |
}; | |
} | |
public function redraw():void{ | |
this._validate(true); | |
} | |
public function getPage():String{ | |
return (this._page); | |
} | |
public function getSaveString():String{ | |
var _local3:String; | |
var _local1 = "<markups>"; | |
var _local2:int; | |
while (_local2 < this._markups.length) { | |
_local3 = this._xpdfLayer.getTextString(this._markups[_local2].range); | |
this._markups[_local2].text = _local3; | |
_local1 = (_local1 + this._markups[_local2].toXMLString()); | |
_local2++; | |
}; | |
_local1 = (_local1 + "</markups>"); | |
return (_local1); | |
} | |
public function initContent(_arg1:String):void{ | |
var _local4:XML; | |
var _local5:Markup; | |
var _local2:XML = new XML(_arg1); | |
if (_local2 == null){ | |
return; | |
}; | |
this._markups = []; | |
var _local3:int; | |
while (_local3 < _local2.markup.length()) { | |
_local4 = (_local2.markup[_local3] as XML); | |
_local5 = Markup.initFromXML(_local4); | |
this._markups.push(_local5); | |
_local3++; | |
}; | |
this._validate(true); | |
dispatchEvent(new Event(Event.INIT)); | |
} | |
public function deleteHighlightByRange(_arg1:String):void{ | |
var _local3:Markup; | |
var _local4:TextRange; | |
if (this._markups == null){ | |
return; | |
}; | |
var _local2:int; | |
while (_local2 < this._markups.length) { | |
_local3 = (this._markups[_local2] as Markup); | |
_local4 = _local3.range; | |
if (_local4.toString() == _arg1){ | |
this._markups.splice(_local2, 1); | |
this._validate(false); | |
return; | |
}; | |
_local2++; | |
}; | |
} | |
private function _buildRectSwf(_arg1:String):void{ | |
this._xpdfLayer = new XpdfLayer(); | |
if (this._bg){ | |
this._xpdfLayer.setSize(this._bg.width, this._bg.height); | |
}; | |
addChild(this._xpdfLayer); | |
this._xpdfLayer.addEventListener(Event.COMPLETE, this._onXpdfLayerInit); | |
this._xpdfLayer.addEventListener(IOErrorEvent.IO_ERROR, this._onXpdfLayerInitError); | |
this._xpdfLayer.loadJSON(_arg1); | |
} | |
private function _onXpdfLayerInit(_arg1:Event):void{ | |
this.activate(false); | |
this._validate(true); | |
dispatchEvent(new Event(Event.COMPLETE)); | |
} | |
private function _onXpdfLayerInitError(_arg1:Event):void{ | |
dispatchEvent(new Event(Event.COMPLETE)); | |
} | |
private function _beginSel(_arg1:EventWithParam):void{ | |
var _local2:TextRange = (_arg1.param as TextRange); | |
var _local3:int = this._getContainingSelIdx(_local2); | |
if (_local3 != -1){ | |
this._markups.splice(_local3, 1); | |
this._validate(false); | |
this._curRange = null; | |
} else { | |
this._setCurRange(_local2); | |
}; | |
} | |
private function _changeSel(_arg1:EventWithParam):void{ | |
var _local2:TextRange = (_arg1.param as TextRange); | |
if ((((this._curRange == null)) || ((this._getGroups().length > 0)))){ | |
return; | |
}; | |
this._setCurRange(_local2); | |
} | |
private function _endSel(_arg1:EventWithParam):void{ | |
if ((((this._curRange == null)) || ((this._getGroups().length > 0)))){ | |
return; | |
}; | |
this._setCurRange(null); | |
var _local2:TextRange = (_arg1.param as TextRange); | |
this._addMarkup(_local2); | |
this._validate(); | |
} | |
private function _addMarkup(_arg1:TextRange):void{ | |
var _local3:TextRange; | |
var _local4:Markup; | |
var _local5:int; | |
var _local2:Number = this._markups.length; | |
_local5 = (_local2 - 1); | |
while (_local5 >= 0) { | |
_local3 = Markup(this._markups[_local5]).range; | |
if (((((this._mergeAdjacent) && (_arg1.isAdjacentTo(_local3)))) || (_arg1.intersects(_local3)))){ | |
}; | |
_local5--; | |
}; | |
var _local6:Date = new Date(); | |
this._markups.push(new Markup(_arg1, this._color, this._type, _local6)); | |
} | |
private function _getMode():Number{ | |
switch (this._unit){ | |
case "char": | |
case "chargroup": | |
return (XpdfLayer.CHARMODE); | |
case "word": | |
case "wordgroup": | |
return (XpdfLayer.WORDMODE); | |
}; | |
return (-1); | |
} | |
private function _getGroups():Array{ | |
if (this._groupsArray == null){ | |
if (this._groupsStr != null){ | |
this._groupsArray = this._xpdfLayer.specsToRanges(this._groupsStr.split("[,]")); | |
} else { | |
this._groupsArray = this._xpdfLayer.specsToRanges(new Array()); | |
}; | |
}; | |
return (this._groupsArray); | |
} | |
private function _getContainingSelIdx(_arg1:TextRange):int{ | |
var _local2:Number = this._markups.length; | |
var _local3:int; | |
while (_local3 < _local2) { | |
if (Markup(this._markups[_local3]).range.contains(_arg1)){ | |
return (_local3); | |
}; | |
_local3++; | |
}; | |
return (-1); | |
} | |
private function _getContainingGroup(_arg1:TextRange):TextRange{ | |
var _local2:Array = this._getGroups(); | |
var _local3:Number = _local2.length; | |
var _local4:int; | |
while (_local4 < _local3) { | |
if (TextRange(_local2[_local4]).contains(_arg1)){ | |
return (_local2[_local4]); | |
}; | |
_local4++; | |
}; | |
return (null); | |
} | |
private function _drawSelections():void{ | |
var _local3:TextRange; | |
this._canvas.graphics.clear(); | |
var _local1:Number = this._markups.length; | |
var _local2:int; | |
while (_local2 < _local1) { | |
if (this._markups[_local2].range == null){ | |
_local3 = this._xpdfLayer.specToRange(this._markups[_local2].rangeStr); | |
this._markups[_local2].range = _local3; | |
}; | |
this._drawSelection(this._canvas, this._markups[_local2]); | |
_local2++; | |
}; | |
} | |
private function _setCurRange(_arg1:TextRange):void{ | |
this._curRange = _arg1; | |
this._scratch.graphics.clear(); | |
var _local2:Date = new Date(); | |
if (_arg1 != null){ | |
this._drawSelection(this._scratch, new Markup(_arg1, this._color, this._type, _local2)); | |
}; | |
} | |
private function _drawSelection(_arg1:MovieClip, _arg2:Markup):void{ | |
var _local3:Array = this._xpdfLayer.getRects(_arg2.range); | |
var _local4:Number = this.getMarkupColor(_arg2); | |
var _local5:Number = _local3.length; | |
var _local6:int; | |
while (_local6 < _local5) { | |
this._drawRect(_arg1, _local3[_local6], _local4, _arg2.type); | |
_local6++; | |
}; | |
} | |
private function _drawRect(_arg1:MovieClip, _arg2:Rectangle, _arg3:Number, _arg4:String):void{ | |
_arg4 = ((_arg4)==null) ? this._type : _arg4; | |
var _local5:Graphics = _arg1.graphics; | |
_local5.lineStyle(); | |
_local5.beginFill(_arg3, 1); | |
switch (_arg4){ | |
case CIRCLE: | |
_local5.lineStyle(1, _arg3, 1); | |
_local5.endFill(); | |
_local5.beginFill(_arg3, 0); | |
_local5.drawRoundRect((_arg2.x - 1), _arg2.y, (_arg2.height / 2), (_arg2.width + 2), _arg2.height); | |
break; | |
case CIRCLEFILL: | |
_arg1.blendMode = BlendMode.DARKEN; | |
_local5.lineStyle(1, _arg3, 1); | |
_local5.endFill(); | |
_local5.beginFill(_arg3, 1); | |
_local5.drawRoundRect((_arg2.x - 1), _arg2.y, (_arg2.height / 2), (_arg2.width + 2), _arg2.height); | |
break; | |
case OUTLINE: | |
_local5.lineStyle(1, _arg3, 1); | |
_local5.endFill(); | |
_local5.beginFill(_arg3, 0); | |
_local5.drawRect((_arg2.x - 1), _arg2.y, (_arg2.width + 2), _arg2.height); | |
break; | |
case CROSSOUT: | |
_local5.drawRect((_arg2.x - 1), (_arg2.y + (_arg2.height / 2)), (_arg2.width + 2), 1); | |
break; | |
case HIGHLIGHT: | |
_arg1.blendMode = BlendMode.DARKEN; | |
_local5.drawRect(_arg2.x, _arg2.y, _arg2.width, _arg2.height); | |
break; | |
case UNDERLINE: | |
_local5.drawRect(_arg2.x, (_arg2.bottom - 1), _arg2.width, 1); | |
break; | |
case UNDERLINE2: | |
_local5.drawRect(_arg2.x, (_arg2.bottom - 1), _arg2.width, 1); | |
_local5.drawRect(_arg2.x, (_arg2.bottom + 1), _arg2.width, 1); | |
break; | |
case UNDERLINE3: | |
_local5.drawRect(_arg2.x, (_arg2.bottom - 1), _arg2.width, 1); | |
_local5.drawRect(_arg2.x, (_arg2.bottom + 1), _arg2.width, 1); | |
_local5.drawRect(_arg2.x, (_arg2.bottom + 3), _arg2.width, 1); | |
break; | |
default: | |
trace("PageTextLayer._drawRect error"); | |
}; | |
_local5.endFill(); | |
} | |
private function _validate(_arg1:Boolean=false):void{ | |
this._drawSelections(); | |
if (!_arg1){ | |
dispatchEvent(new Event(CONTENT_CHANGED)); | |
}; | |
} | |
private function _getRange():TextRange{ | |
if (this._textrangeObj == null){ | |
this._textrangeObj = this._xpdfLayer.specToRange(this._textrangeStr); | |
}; | |
return (this._textrangeObj); | |
} | |
} | |
}//package com.vpg.vpage.shell.activepagetext | |
package com.vpg.vpage.shell.activepagetext { | |
import flash.events.*; | |
import com.vpg.vpage.shell.userdata.*; | |
import com.vpg.vpage.shell.datastore.*; | |
public class PageTextManager extends EventDispatcher { | |
private var _layers:Array; | |
private var _ds:IUserDataStorage; | |
private var _currentColor:Number; | |
private var _enabled:Boolean; | |
public function PageTextManager(){ | |
this._currentColor = 0xFFFF00; | |
this._layers = new Array(); | |
this._enabled = false; | |
} | |
public function clearHighlights():void{ | |
var _local2:PageTextLayer; | |
var _local1:int; | |
while (_local1 < this._layers.length) { | |
_local2 = (this._layers[_local1] as PageTextLayer); | |
_local2.clear(); | |
_local1++; | |
}; | |
} | |
public function destroy():void{ | |
this._layers = null; | |
this._ds = null; | |
} | |
public function refreshLayers():void{ | |
var _local2:PageTextLayer; | |
var _local3:UserDataRequest; | |
var _local1:int; | |
while (_local1 < this._layers.length) { | |
_local2 = (this._layers[_local1] as PageTextLayer); | |
_local3 = new UserDataRequest(UserDataRequest.METHOD_GET, _local2.getPage(), GenericDataStoreTypes.TYPE_HIGHLIGHT); | |
_local3.addEventListener(UserDataRequestEvent.ERROR, this._getContentFail); | |
_local3.addEventListener(UserDataRequestEvent.SUCCESS, this._getContentSuccess); | |
this._ds.handleRequest(_local3); | |
_local1++; | |
}; | |
} | |
public function setDataStore(_arg1:IUserDataStorage):void{ | |
this._ds = _arg1; | |
} | |
public function addLayer(_arg1:PageTextLayer):void{ | |
_arg1.toolcolor = this._currentColor; | |
_arg1.addEventListener(PageTextLayer.CONTENT_CHANGED, this._contentChangedEvent); | |
this._layers.push(_arg1); | |
var _local2:UserDataRequest = new UserDataRequest(UserDataRequest.METHOD_GET, _arg1.getPage(), GenericDataStoreTypes.TYPE_HIGHLIGHT); | |
_local2.addEventListener(UserDataRequestEvent.ERROR, this._getContentFail); | |
_local2.addEventListener(UserDataRequestEvent.SUCCESS, this._getContentSuccess); | |
this._ds.handleRequest(_local2); | |
} | |
public function setColor(_arg1:Number):void{ | |
this._currentColor = _arg1; | |
var _local2:int; | |
while (_local2 < this._layers.length) { | |
this._layers[_local2].toolcolor = this._currentColor; | |
_local2++; | |
}; | |
} | |
public function removeAllLayers():void{ | |
var _local1:int; | |
while (_local1 < this._layers.length) { | |
this._layers[_local1].removeEventListener(PageTextLayer.CONTENT_CHANGED, this._contentChangedEvent); | |
this._layers[_local1].destroy(); | |
_local1++; | |
}; | |
this._layers = new Array(); | |
} | |
public function enable():void{ | |
var _local1:int; | |
while (_local1 < this._layers.length) { | |
this._layers[_local1].activate(true); | |
_local1++; | |
}; | |
this._enabled = true; | |
} | |
public function disable():void{ | |
var _local1:int; | |
while (_local1 < this._layers.length) { | |
this._layers[_local1].activate(false); | |
_local1++; | |
}; | |
this._enabled = false; | |
} | |
public function isEnabled():Boolean{ | |
return (this._enabled); | |
} | |
public function deleteHighlightByRange(_arg1:String, _arg2:String):void{ | |
var _local4:PageTextLayer; | |
var _local3:int; | |
while (_local3 < this._layers.length) { | |
_local4 = (this._layers[_local3] as PageTextLayer); | |
if (_local4.getPage() == _arg1){ | |
_local4.deleteHighlightByRange(_arg2); | |
}; | |
_local3++; | |
}; | |
} | |
private function _contentChangedEvent(_arg1:Event):void{ | |
var _local2:PageTextLayer = (_arg1.currentTarget as PageTextLayer); | |
var _local3:String = _local2.getPage(); | |
var _local4:String = _local2.getSaveString(); | |
var _local5:UserDataRequest = new UserDataRequest(UserDataRequest.METHOD_SET, _local2.getPage(), GenericDataStoreTypes.TYPE_HIGHLIGHT, _local4); | |
this._ds.handleRequest(_local5); | |
dispatchEvent(_arg1); | |
} | |
private function _getContentSuccess(_arg1:UserDataRequestEvent):void{ | |
var _local4:PageTextLayer; | |
var _local2:UserDataRequest = (_arg1.currentTarget as UserDataRequest); | |
var _local3:int; | |
while (_local3 < this._layers.length) { | |
_local4 = (this._layers[_local3] as PageTextLayer); | |
if (_local4.getPage() == _local2.getPage()){ | |
_local4.initContent(_local2.getContent()); | |
return; | |
}; | |
_local3++; | |
}; | |
} | |
private function _getContentFail(_arg1:UserDataRequestEvent):void{ | |
this._getContentSuccess(_arg1); | |
} | |
} | |
}//package com.vpg.vpage.shell.activepagetext | |
package com.vpg.vpage.shell.video { | |
import com.vpg.vpage.utils.mediamgr.*; | |
public interface IVideoPlayer extends IMediaPlayer { | |
function init(_arg1:String, _arg2:String):void; | |
function destroy():void; | |
function setScreenSize(_arg1:Number, _arg2:Number):void; | |
} | |
}//package com.vpg.vpage.shell.video | |
package com.vpg.vpage.shell.pageview { | |
import flash.display.*; | |
import com.vpg.vpage.shell.search.*; | |
import com.vpg.vpage.shell.pageview.additionallayers.*; | |
import com.vpg.vpage.shell.*; | |
import flash.events.*; | |
import com.vpg.vpage.utils.*; | |
import com.vpg.vpage.shell.whiteboard.*; | |
import com.vpg.vpage.shell.activepagetext.*; | |
import com.vpg.vpage.shell.screenreader.*; | |
import com.vpg.vpage.shell.tools.*; | |
import com.vpg.vpage.shell.pageicons.*; | |
import com.vpg.vpage.components.scrollpane.tools.zoom.*; | |
import com.vpg.vpage.components.scrollpane.*; | |
public class AbstractPageView extends Sprite { | |
public static const START:String = "pageLoadStart"; | |
protected var sp:StandardScrollPane; | |
protected var pageLayout; | |
private var _zoomer:Zoomer; | |
private var _app:App; | |
private var _sizeMc:Sprite; | |
public var drawingOverlayMgr:DrawingOverlayMgr; | |
public var pageTextMgr:PageTextManager; | |
public var screenReaderMgr:ScreenReaderManager; | |
public var whiteboardMgr:WhiteboardManager; | |
public var searchLayerMgr:SearchLayerManager; | |
public var iconDrawMgr:IconDrawManager; | |
public function AbstractPageView(_arg1:App){ | |
this._app = _arg1; | |
this.sp = new StandardScrollPane(); | |
addChild(this.sp); | |
this._zoomer = new Zoomer(this.sp, this._app.getStyleMgr().getNumber("zoom_to_rect_color"), this._app.getStyleMgr().getNumber("zoom_to_rect_alpha")); | |
this._zoomer.addEventListener(ZoomToRectEvent.ZOOM, this._onZoomToRect); | |
addChild(this._zoomer); | |
this.drawingOverlayMgr = new DrawingOverlayMgr(); | |
this.screenReaderMgr = new ScreenReaderManager(); | |
this.whiteboardMgr = new WhiteboardManager(); | |
this.pageTextMgr = new PageTextManager(); | |
this.searchLayerMgr = new SearchLayerManager(); | |
this.iconDrawMgr = new IconDrawManager(); | |
} | |
public function setAdditionalLayerFactory(_arg1:IAdditionalLayerFactory):void{ | |
this.pageLayout.setAdditionalLayerFactory(_arg1); | |
} | |
public function lockZoomBoxDimensions():void{ | |
this._zoomer.lockZoomBoxDimensions(); | |
} | |
public function setCenterPagesVertically(_arg1:Boolean):void{ | |
this._zoomer.setCenterVertically(_arg1); | |
} | |
public function setSize(_arg1:Number, _arg2:Number):void{ | |
this.sp.setSize(_arg1, _arg2); | |
this._zoomer.refresh(); | |
} | |
public function setLayoutClass(_arg1:String):void{ | |
this.pageLayout = (ClassUtils.createClass(_arg1) as Sprite); | |
this.pageLayout.addEventListener(Event.COMPLETE, this.pageContentLoaded); | |
this.pageLayout.setApp(this._app); | |
this.pageLayout.setManagers(this.drawingOverlayMgr, this.screenReaderMgr, this.whiteboardMgr, this.pageTextMgr, this.searchLayerMgr, this.iconDrawMgr); | |
this.sp.getContentLayer().addChild(this.pageLayout); | |
this.sp.refresh(); | |
} | |
public function setMagnification(_arg1:Number):void{ | |
this._zoomer.setMagnification(_arg1); | |
} | |
public function getMagnification():Number{ | |
return (this._zoomer.getMagnification()); | |
} | |
public function loadPage(_arg1:String, _arg2:String):void{ | |
this._clearLayerManagers(); | |
this.pageLayout.loadPage(_arg1, _arg2); | |
dispatchEvent(new Event(START)); | |
} | |
public function loadPageLeft(_arg1:String, _arg2:String):void{ | |
this._clearLayerManagers(); | |
this.pageLayout.loadPageLeft(_arg1, _arg2); | |
dispatchEvent(new Event(START)); | |
} | |
public function loadPageRight(_arg1:String, _arg2:String):void{ | |
this.pageLayout.loadPageRight(_arg1, _arg2); | |
} | |
public function destroy():void{ | |
this.pageLayout.destroy(); | |
} | |
public function enableDragPage():void{ | |
this.sp.enableContentDrag(); | |
} | |
public function disableDragPage():void{ | |
this.sp.disableContentDrag(); | |
} | |
public function isDragPageEnabled():Boolean{ | |
return (this.sp.isContentDragEnabled()); | |
} | |
public function canVScroll():Boolean{ | |
return (this.sp.canVScroll()); | |
} | |
public function canHScroll():Boolean{ | |
return (this.sp.canHScroll()); | |
} | |
public function enableRectZoomer():void{ | |
this._zoomer.enable(); | |
} | |
public function disableRectZoomer():void{ | |
this._zoomer.disable(); | |
} | |
public function setBoundingBox(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):void{ | |
this.x = _arg1; | |
this.y = _arg2; | |
this.setSize(_arg3, _arg4); | |
} | |
public function fitWidth():Number{ | |
return (this._zoomer.fitToWidth()); | |
} | |
public function fitHeight():Number{ | |
return (this._zoomer.fitToHeight()); | |
} | |
public function fitScreen():Number{ | |
return (this._zoomer.fitScreen()); | |
} | |
public function scrollToX(_arg1:Number):Number{ | |
return (this.sp.scrollToX(_arg1)); | |
} | |
public function scrollToY(_arg1:Number):Number{ | |
return (this.sp.scrollToY(_arg1)); | |
} | |
public function scrollToXPerc(_arg1:Number):Number{ | |
return (this.sp.scrollToXPerc(_arg1)); | |
} | |
public function scrollToYPerc(_arg1:Number):Number{ | |
return (this.sp.scrollToYPerc(_arg1)); | |
} | |
public function isFitWidth():Boolean{ | |
return (this._zoomer.isFitToWidth()); | |
} | |
public function isFitHeight():Boolean{ | |
return (this._zoomer.isFitToHeight()); | |
} | |
public function isFitScreen():Boolean{ | |
return (this._zoomer.isFitToScreen()); | |
} | |
public function isZoomedToRect():Boolean{ | |
return (this._zoomer.isZoomedToRect()); | |
} | |
public function isRectZoomerEnabled():Boolean{ | |
return (this._zoomer.isRectZoomerEnabled()); | |
} | |
public function getFitScreenMagnification():Number{ | |
return (this._zoomer.getFitScreenMagnification()); | |
} | |
protected function pageContentLoaded(_arg1:Event):void{ | |
if (!this._sizeMc){ | |
this._sizeMc = new Square(0xFF0000); | |
this._sizeMc.alpha = 0; | |
this._sizeMc.mouseEnabled = false; | |
this._sizeMc.mouseChildren = false; | |
this._sizeMc.name = "size_mc"; | |
this.sp.getContentLayer().addChild(this._sizeMc); | |
}; | |
this._sizeMc.width = this.pageLayout.getWidth(); | |
this._sizeMc.height = this.pageLayout.getHeight(); | |
this.sp.refresh(); | |
this._zoomer.refresh(); | |
dispatchEvent(new Event(Event.COMPLETE)); | |
} | |
private function _clearLayerManagers():void{ | |
this.drawingOverlayMgr.removeAllLayers(); | |
this.pageTextMgr.removeAllLayers(); | |
this.screenReaderMgr.removeAllLayers(); | |
this.whiteboardMgr.removeAllLayers(); | |
this.searchLayerMgr.removeAllLayers(); | |
this.iconDrawMgr.removeAllLayers(); | |
} | |
private function _onZoomToRect(_arg1:Event):void{ | |
this.sp.refresh(); | |
this._zoomer.refresh(); | |
dispatchEvent(_arg1); | |
} | |
} | |
}//package com.vpg.vpage.shell.pageview | |
package com.vpg.vpage.shell.pageview { | |
import flash.display.*; | |
import com.vpg.vpage.shell.*; | |
import com.vpg.vpage.utils.*; | |
public class LoadBlocker extends Sprite { | |
private var _bg:Sprite; | |
private var _loadBar:LoadingBar; | |
public function LoadBlocker(_arg1:App){ | |
var _local2:Number = _arg1.getStyleMgr().getNumber("page_load_background"); | |
this._bg = new Square(_local2); | |
addChild(this._bg); | |
var _local3:String = _arg1.getInterfaceText("loading_page", "Loading Page"); | |
this._loadBar = new LoadingBar(_local3, false); | |
this._loadBar.scaleX = (this._loadBar.scaleY = 0.75); | |
var _local4:Number = _arg1.getStyleMgr().getNumber("loading_mc_bg"); | |
var _local5:Number = _arg1.getStyleMgr().getNumber("loading_mc_bar"); | |
var _local6:Number = _arg1.getStyleMgr().getNumber("loading_mc_border"); | |
this._loadBar.skin(_local4, _local5, _local6); | |
addChild(this._loadBar); | |
this._updateLoadingBarLocation(); | |
} | |
public function setProgress(_arg1:Number):void{ | |
this._loadBar.setProgress(_arg1); | |
} | |
public function setSize(_arg1:Number, _arg2:Number):void{ | |
this._bg.width = _arg1; | |
this._bg.height = _arg2; | |
this._updateLoadingBarLocation(); | |
} | |
private function _updateLoadingBarLocation():void{ | |
this._loadBar.x = (this._bg.width / 2); | |
this._loadBar.y = (this._bg.height / 2); | |
} | |
} | |
}//package com.vpg.vpage.shell.pageview | |
package com.vpg.vpage.shell.pageview { | |
import flash.display.*; | |
import com.vpg.vpage.shell.search.*; | |
import com.vpg.vpage.shell.pageview.additionallayers.*; | |
import com.vpg.vpage.shell.*; | |
import flash.events.*; | |
import com.vpg.vpage.utils.*; | |
import com.vpg.vpage.shell.whiteboard.*; | |
import com.vpg.vpage.shell.activepagetext.*; | |
import com.vpg.vpage.shell.screenreader.*; | |
import com.vpg.vpage.shell.tools.*; | |
import com.vpg.vpage.shell.pageicons.*; | |
import com.vpg.vpage.components.scrollpane.tools.zoom.*; | |
import com.vpg.lib.effects.pageflip.*; | |
public class PreloadedPageView extends Sprite implements IPageView { | |
public static const LOADED:String = "pageContentLoaded"; | |
public static const START:String = "pageContentLoadStart"; | |
public var drawingOverlayMgr:DrawingOverlayMgr; | |
public var pageTextMgr:PageTextManager; | |
public var screenReaderMgr:ScreenReaderManager; | |
public var whiteboardMgr:WhiteboardManager; | |
public var searchLayerMgr:SearchLayerManager; | |
public var iconDrawMgr:IconDrawManager; | |
private var _sp; | |
private var _pageLayout; | |
private var _zoomer:Zoomer; | |
private var _app:App; | |
private var _sizeMc:Sprite; | |
private var _preloader:PagePreloader; | |
private var _lastPageId:String; | |
private var _leftPageToShow:String; | |
private var _leftPageToShowURL:String; | |
private var _lastContent:DisplayObject; | |
private var _nextContent:Sprite; | |
private var _hasBeenSized:Boolean; | |
private var _w:Number; | |
private var _h:Number; | |
public function PreloadedPageView(_arg1:App, _arg2:IAdditionalLayerFactory){ | |
this._app = _arg1; | |
this._preloader = new PagePreloader(this._app, _arg2); | |
this.drawingOverlayMgr = this._preloader.drawingOverlayMgr; | |
this.pageTextMgr = this._preloader.pageTextMgr; | |
this.screenReaderMgr = this._preloader.screenReaderMgr; | |
this.whiteboardMgr = this._preloader.whiteboardMgr; | |
this.searchLayerMgr = this._preloader.searchLayerMgr; | |
this.iconDrawMgr = this._preloader.iconDrawMgr; | |
this._preloader.addEventListener(Event.COMPLETE, this._preloadComplete); | |
var _local3:String = this._app.getOption("pageview_scrollpane_class", "com.vpg.vpage.components.scrollpane.StandardScrollPane"); | |
this._sp = ClassUtils.createClass(_local3); | |
addChild(this._sp); | |
this._zoomer = new Zoomer(this._sp, this._app.getStyleMgr().getNumber("zoom_to_rect_color"), this._app.getStyleMgr().getNumber("zoom_to_rect_alpha")); | |
this._zoomer.addEventListener(ZoomToRectEvent.ZOOM, this._onZoomToRect); | |
addChild(this._zoomer); | |
this._sp.visible = false; | |
} | |
public function destroy():void{ | |
this._zoomer.removeEventListener(ZoomToRectEvent.ZOOM, this._onZoomToRect); | |
this._preloader.removeEventListener(Event.COMPLETE, this._preloadComplete); | |
this._preloader.destroy(); | |
this._sp.destroy(); | |
this._zoomer.destroy(); | |
this._sp = null; | |
this._pageLayout = null; | |
this._zoomer = null; | |
this._app = null; | |
this._sizeMc = null; | |
this.drawingOverlayMgr.destroy(); | |
this.pageTextMgr.destroy(); | |
this.screenReaderMgr.destroy(); | |
this.whiteboardMgr.destroy(); | |
this.searchLayerMgr.destroy(); | |
this.iconDrawMgr.destroy(); | |
this.drawingOverlayMgr = null; | |
this.pageTextMgr = null; | |
this.screenReaderMgr = null; | |
this.whiteboardMgr = null; | |
this.searchLayerMgr = null; | |
this.iconDrawMgr = null; | |
this._preloader = null; | |
this._lastPageId = null; | |
this._leftPageToShow = null; | |
this._leftPageToShowURL = null; | |
this._lastContent = null; | |
this._nextContent = null; | |
} | |
public function enableRectZoomer():void{ | |
this._zoomer.enable(); | |
} | |
public function disableRectZoomer():void{ | |
this._zoomer.disable(); | |
} | |
public function turnOffScrollBars():void{ | |
this._sp.turnOffScrollBars(); | |
} | |
public function loadPage(_arg1:String, _arg2:String):void{ | |
dispatchEvent(new Event(START)); | |
this._setContentAsBitmap(); | |
var _local3:PageLayout = this._preloader.getPageLayout(_arg2, _arg1); | |
this._sp.getContentLayer().addChildAt(_local3, 0); | |
this._nextContent = _local3; | |
this._lastPageId = null; | |
this._pageFlipDone(null); | |
} | |
public function loadPageLeft(_arg1:String, _arg2:String):void{ | |
dispatchEvent(new Event(START)); | |
this._leftPageToShow = _arg2; | |
this._leftPageToShowURL = _arg1; | |
} | |
public function loadPageRight(_arg1:String, _arg2:String):void{ | |
if (this._lastPageId == null){ | |
this._setContentAsBitmap(); | |
}; | |
var _local3:PageLayout = this._preloader.getPageLayout(this._leftPageToShow, this._leftPageToShowURL); | |
var _local4:PageLayout = this._preloader.getPageLayout(_arg2, _arg1); | |
var _local5:Sprite = new Sprite(); | |
_local5.addChild(_local3); | |
_local4.x = _local3.width; | |
_local5.addChild(_local4); | |
this._sp.getContentLayer().addChildAt(_local5, 0); | |
this._nextContent = _local5; | |
if (this._lastContent){ | |
if (this._lastContent.width == _local5.width){ | |
this._doFlip(this._lastContent, _local5, this._isForward(_arg2)); | |
} else { | |
this._pageFlipDone(null); | |
}; | |
} else { | |
this._pageFlipDone(null); | |
}; | |
this._lastPageId = _arg2; | |
} | |
public function enableDragPage():void{ | |
this._sp.enableContentDrag(); | |
} | |
public function disableDragPage():void{ | |
this._sp.disableContentDrag(); | |
} | |
public function isDragPageEnabled():Boolean{ | |
return (this._sp.isContentDragEnabled()); | |
} | |
public function fitWidth():Number{ | |
return (this._zoomer.fitToWidth()); | |
} | |
public function fitHeight():Number{ | |
return (this._zoomer.fitToHeight()); | |
} | |
public function fitScreen():Number{ | |
return (this._zoomer.fitScreen()); | |
} | |
public function setBoundingBox(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):void{ | |
this.x = _arg1; | |
this.y = _arg2; | |
this.setSize(_arg3, _arg4); | |
} | |
public function setSize(_arg1:Number, _arg2:Number):void{ | |
var _local3:String; | |
var _local4:Number; | |
var _local5:Number; | |
var _local6:Number; | |
var _local7:Number; | |
var _local8:String; | |
this._sp.setSize(_arg1, _arg2); | |
if (((this._hasBeenSized) && (!((this._app.getOption("zoom_on_reflow", "") == ""))))){ | |
if (this._zoomer.isFitToWidth()){ | |
this.fitWidth(); | |
} else { | |
if (this._zoomer.isFitToHeight()){ | |
this.fitHeight(); | |
} else { | |
if (this._zoomer.isFitToScreen()){ | |
this.fitScreen(); | |
} else { | |
_local3 = this._app.getOption("zoom_on_reflow", ""); | |
_local4 = (_arg1 / this._w); | |
_local5 = (_arg2 / this._h); | |
if (_local3 == "width"){ | |
_local5 = _local4; | |
}; | |
if (_local3 == "height"){ | |
_local4 = _local5; | |
}; | |
_local6 = this.getMagnification(); | |
_local7 = 1; | |
if ((((_local4 > 1)) && ((_local5 > 1)))){ | |
_local7 = Math.min(_local4, _local5); | |
} else { | |
if ((((_local5 < 1)) && ((_local4 < 1)))){ | |
_local7 = Math.max(_local4, _local5); | |
} else { | |
if ((((_local4 > 1)) && ((_local5 < 1)))){ | |
} else { | |
if ((((_local4 < 1)) && ((_local5 > 1)))){ | |
}; | |
}; | |
}; | |
}; | |
_local7 = (_local7 * _local6); | |
this.setMagnification(_local7); | |
}; | |
}; | |
}; | |
} else { | |
if (((this._hasBeenSized) && (!((this._app.getOption("invisible_zoom_on_reflow", "") == ""))))){ | |
_local8 = this._app.getOption("invisible_zoom_on_reflow", ""); | |
} else { | |
this._zoomer.refresh(); | |
}; | |
}; | |
this._w = _arg1; | |
this._h = _arg2; | |
this._hasBeenSized = true; | |
} | |
public function setOrder(_arg1:Array):void{ | |
this._preloader.setOrder(_arg1); | |
} | |
public function setMagnification(_arg1:Number):void{ | |
this._zoomer.setMagnification(_arg1); | |
} | |
public function getMagnification():Number{ | |
return (this._zoomer.getMagnification()); | |
} | |
public function load(_arg1:Array, _arg2:Array):void{ | |
this._preloader.load(_arg1, _arg2); | |
} | |
public function isRectZoomerEnabled():Boolean{ | |
return (this._zoomer.isRectZoomerEnabled()); | |
} | |
public function scrollToX(_arg1:Number):Number{ | |
return (this._sp.scrollToX(_arg1)); | |
} | |
public function scrollToY(_arg1:Number):Number{ | |
return (this._sp.scrollToY(_arg1)); | |
} | |
public function scrollToXPerc(_arg1:Number):Number{ | |
return (this._sp.scrollToXPerc(_arg1)); | |
} | |
public function scrollToYPerc(_arg1:Number):Number{ | |
return (this._sp.scrollToYPerc(_arg1)); | |
} | |
public function isZoomedToRect():Boolean{ | |
return (this._zoomer.isZoomedToRect()); | |
} | |
public function lockZoomBoxDimensions():void{ | |
} | |
public function isFitWidth():Boolean{ | |
return (this._zoomer.isFitToWidth()); | |
} | |
public function isFitHeight():Boolean{ | |
return (this._zoomer.isFitToHeight()); | |
} | |
public function isFitScreen():Boolean{ | |
return (this._zoomer.isFitToScreen()); | |
} | |
private function _setContentAsBitmap():void{ | |
var _local1:BitmapData; | |
var _local2:Bitmap; | |
if (this._lastContent){ | |
_local1 = new BitmapData(this._lastContent.width, this._lastContent.height); | |
_local2 = new Bitmap(_local1); | |
_local2.smoothing = true; | |
_local1.draw(this._lastContent); | |
_local1.dispose(); | |
this._lastContent.parent.addChild(_local2); | |
this._lastContent.parent.removeChild(this._lastContent); | |
this._lastContent = _local2; | |
}; | |
} | |
private function _isForward(_arg1:String):Boolean{ | |
var _local2:int = this._preloader.getIndexOf(this._lastPageId); | |
var _local3:int = this._preloader.getIndexOf(_arg1); | |
if (_local3 > _local2){ | |
return (true); | |
}; | |
return (false); | |
} | |
private function _doFlip(_arg1:DisplayObject, _arg2:DisplayObject, _arg3:Boolean):void{ | |
var _local4:PageSpreadFlip; | |
var _local5:PageSpreadBottomLeftFlip; | |
if (_arg3){ | |
_local4 = new PageSpreadFlip(_arg1, _arg2); | |
_local4.addEventListener(PageFlipEvent.END, this._pageFlipDone); | |
_local4.startFlip(); | |
} else { | |
_local5 = new PageSpreadBottomLeftFlip(_arg1, _arg2); | |
_local5.addEventListener(PageFlipEvent.END, this._pageFlipDone); | |
_local5.startFlip(); | |
}; | |
} | |
private function _pageFlipDone(_arg1:Event):void{ | |
DisplayU.removeFromDisplayList(this._lastContent); | |
if (_arg1){ | |
_arg1.currentTarget.destroy(); | |
_arg1.currentTarget.removeEventListener(PageFlipEvent.END, this._pageFlipDone); | |
}; | |
this._lastContent = this._nextContent; | |
this._nextContent = null; | |
this._sp.refresh(); | |
this._zoomer.refresh(); | |
dispatchEvent(new Event(Event.COMPLETE)); | |
} | |
private function _preloadComplete(_arg1:Event):void{ | |
this._sp.visible = true; | |
dispatchEvent(new Event(LOADED)); | |
} | |
private function _onZoomToRect(_arg1:Event):void{ | |
this._sp.refresh(); | |
this._zoomer.refresh(); | |
dispatchEvent(_arg1); | |
} | |
} | |
}//package com.vpg.vpage.shell.pageview | |
package com.vpg.vpage.shell.pageview.additionallayers { | |
import flash.events.*; | |
public interface IOnPageContent extends IEventDispatcher { | |
function load():void; | |
function destroy():void; | |
function getDisplayObjects():Array; | |
} | |
}//package com.vpg.vpage.shell.pageview.additionallayers | |
package com.vpg.vpage.shell.pageview.additionallayers { | |
import com.vpg.vpage.shell.*; | |
public interface IAdditionalLayerFactory { | |
function createOnPageContent(_arg1:String, _arg2:Number, _arg3:Number, _arg4:App):IOnPageContent; | |
} | |
}//package com.vpg.vpage.shell.pageview.additionallayers | |
package com.vpg.vpage.shell.pageview { | |
import flash.events.*; | |
public interface IPageView extends IEventDispatcher { | |
function destroy():void; | |
function enableRectZoomer():void; | |
function disableRectZoomer():void; | |
function isRectZoomerEnabled():Boolean; | |
function lockZoomBoxDimensions():void; | |
function enableDragPage():void; | |
function disableDragPage():void; | |
function isDragPageEnabled():Boolean; | |
function setMagnification(_arg1:Number):void; | |
function getMagnification():Number; | |
function fitWidth():Number; | |
function isFitWidth():Boolean; | |
function fitHeight():Number; | |
function isFitHeight():Boolean; | |
function fitScreen():Number; | |
function isFitScreen():Boolean; | |
function setBoundingBox(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):void; | |
function setSize(_arg1:Number, _arg2:Number):void; | |
function scrollToX(_arg1:Number):Number; | |
function scrollToY(_arg1:Number):Number; | |
function scrollToXPerc(_arg1:Number):Number; | |
function scrollToYPerc(_arg1:Number):Number; | |
function loadPage(_arg1:String, _arg2:String):void; | |
function loadPageLeft(_arg1:String, _arg2:String):void; | |
function loadPageRight(_arg1:String, _arg2:String):void; | |
} | |
}//package com.vpg.vpage.shell.pageview | |
package com.vpg.vpage.shell.pageview { | |
import com.vpg.vpage.shell.search.*; | |
import com.vpg.vpage.shell.pageview.additionallayers.*; | |
import com.vpg.vpage.shell.*; | |
import flash.events.*; | |
import com.vpg.vpage.utils.*; | |
import com.vpg.vpage.shell.whiteboard.*; | |
import com.vpg.vpage.shell.activepagetext.*; | |
import com.vpg.vpage.shell.screenreader.*; | |
import com.vpg.vpage.shell.tools.*; | |
import com.vpg.vpage.shell.pageicons.*; | |
public class PagePreloader extends EventDispatcher { | |
private var _pageMap:HashMap; | |
private var _urlList:Array; | |
private var _idList:Array; | |
private var _currentLoadIndex:int; | |
private var _app:App; | |
private var _orderedPages:Array; | |
private var _defaultPageWidth:Number = -1; | |
private var _defaultPageHeight:Number = -1; | |
public var drawingOverlayMgr:DrawingOverlayMgr; | |
public var screenReaderMgr:ScreenReaderManager; | |
public var whiteboardMgr:WhiteboardManager; | |
public var pageTextMgr:PageTextManager; | |
public var searchLayerMgr:SearchLayerManager; | |
public var iconDrawMgr:IconDrawManager; | |
public var addtl:IAdditionalLayerFactory; | |
public function PagePreloader(_arg1:App, _arg2:IAdditionalLayerFactory){ | |
this.addtl = _arg2; | |
this.drawingOverlayMgr = new DrawingOverlayMgr(); | |
this.screenReaderMgr = new ScreenReaderManager(); | |
this.whiteboardMgr = new WhiteboardManager(); | |
this.pageTextMgr = new PageTextManager(); | |
this.searchLayerMgr = new SearchLayerManager(); | |
this.iconDrawMgr = new IconDrawManager(); | |
this._app = _arg1; | |
this._pageMap = new HashMap(); | |
this._currentLoadIndex = -1; | |
} | |
public function destroy():void{ | |
var _local3:PageLayout; | |
this.drawingOverlayMgr = null; | |
this.screenReaderMgr = null; | |
this.whiteboardMgr = null; | |
this.pageTextMgr = null; | |
this.searchLayerMgr = null; | |
this.iconDrawMgr = null; | |
this._app = null; | |
var _local1:Array = this._pageMap.values(); | |
var _local2:int; | |
while (_local2 < _local1.length) { | |
_local3 = (_local1[_local2] as PageLayout); | |
_local3.destroy(); | |
_local2++; | |
}; | |
this._pageMap.clear(); | |
this._pageMap = null; | |
ArrayU.clear(this._urlList); | |
ArrayU.clear(this._idList); | |
this._urlList = null; | |
this._idList = null; | |
} | |
public function getIndexOf(_arg1:String):int{ | |
var _local2:int; | |
while (_local2 < this._orderedPages.length) { | |
if (this._orderedPages[_local2] == _arg1){ | |
return (_local2); | |
}; | |
_local2++; | |
}; | |
return (-1); | |
} | |
public function setOrder(_arg1:Array):void{ | |
this._orderedPages = _arg1; | |
} | |
public function load(_arg1:Array, _arg2:Array):void{ | |
if (this._urlList == null){ | |
this._urlList = _arg1; | |
this._idList = _arg2; | |
this._loadNext(); | |
} else { | |
this._urlList = this._urlList.concat(_arg1); | |
this._idList = this._idList.concat(_arg2); | |
}; | |
} | |
public function getPageLayout(_arg1:String, _arg2:String):PageLayout{ | |
var _local3:PageLayout = this._pageMap.get(_arg1); | |
if (_local3 == null){ | |
_local3 = this._addPageLayout(_arg1, _arg2, null); | |
}; | |
return (_local3); | |
} | |
private function _loadNext(_arg1:Event=null):void{ | |
var _local2:PageLayout; | |
var _local3:String; | |
var _local4:String; | |
var _local5:PageLayout; | |
if (_arg1 != null){ | |
_local2 = (_arg1.currentTarget as PageLayout); | |
_local2.removeEventListener(Event.COMPLETE, this._loadNext); | |
if (this._defaultPageHeight == -1){ | |
this._defaultPageHeight = _local2.height; | |
this._defaultPageWidth = _local2.width; | |
}; | |
}; | |
this._currentLoadIndex++; | |
if (this._currentLoadIndex > (this._urlList.length - 1)){ | |
this._urlList = null; | |
this._idList = null; | |
this._currentLoadIndex = -1; | |
dispatchEvent(new Event(Event.COMPLETE)); | |
} else { | |
_local3 = this._urlList[this._currentLoadIndex]; | |
_local4 = this._idList[this._currentLoadIndex]; | |
_local5 = this._pageMap.get(_local4); | |
if (_local5 == null){ | |
this._addPageLayout(_local4, _local3, this._loadNext); | |
} else { | |
this._loadNext(null); | |
}; | |
}; | |
} | |
private function _addPageLayout(_arg1:String, _arg2:String, _arg3:Function):PageLayout{ | |
var _local4:PageLayout = new PageLayout(this._app, this.addtl); | |
_local4.setBaseSize(this._defaultPageWidth, this._defaultPageHeight); | |
_local4.setManagers(this.drawingOverlayMgr, this.screenReaderMgr, this.whiteboardMgr, this.pageTextMgr, this.searchLayerMgr, this.iconDrawMgr); | |
this._pageMap.put(_arg1, _local4); | |
if (_arg3 != null){ | |
_local4.addEventListener(Event.COMPLETE, _arg3); | |
}; | |
_local4.loadPage(_arg2, _arg1); | |
return (_local4); | |
} | |
} | |
}//package com.vpg.vpage.shell.pageview | |
package com.vpg.vpage.shell.pageview { | |
import flash.display.*; | |
import com.vpg.vpage.shell.*; | |
import flash.events.*; | |
import com.vpg.vpage.utils.*; | |
public class GenericPageView extends AbstractPageView implements IPageView { | |
private var _app:App; | |
private var _bg:Sprite; | |
private var _loader:LoadBlocker; | |
private var _hasBeenSized:Boolean; | |
public function GenericPageView(_arg1:App){ | |
super(_arg1); | |
this._app = _arg1; | |
setLayoutClass("com.vpg.vpage.shell.pageview.GenericPageLayout"); | |
this._bg = new Square(0xFF0000); | |
this._bg.alpha = 0; | |
addChildAt(this._bg, 0); | |
pageLayout.addEventListener(ProgressEvent.PROGRESS, this._updateProgress); | |
this.setSize(this._bg.width, this._bg.height); | |
this._hasBeenSized = false; | |
} | |
override public function setSize(_arg1:Number, _arg2:Number):void{ | |
var _local5:String; | |
var _local6:Number; | |
var _local7:Number; | |
var _local8:Number; | |
var _local9:Number; | |
var _local10:String; | |
var _local3:Number = this._bg.width; | |
var _local4:Number = this._bg.height; | |
this._bg.width = _arg1; | |
this._bg.height = _arg2; | |
if (this._loader){ | |
this._loader.setSize(_arg1, _arg2); | |
}; | |
super.setSize(_arg1, _arg2); | |
if (((this._hasBeenSized) && (!((this._app.getOption("zoom_on_reflow", "") == ""))))){ | |
if (isFitWidth()){ | |
fitWidth(); | |
} else { | |
if (isFitHeight()){ | |
fitHeight(); | |
} else { | |
if (isFitScreen()){ | |
fitScreen(); | |
} else { | |
_local5 = this._app.getOption("zoom_on_reflow", ""); | |
_local6 = (_arg1 / _local3); | |
_local7 = (_arg2 / _local4); | |
if (_local5 == "width"){ | |
_local7 = _local6; | |
}; | |
if (_local5 == "height"){ | |
_local6 = _local7; | |
}; | |
_local8 = getMagnification(); | |
_local9 = 1; | |
if ((((_local6 > 1)) && ((_local7 > 1)))){ | |
_local9 = Math.min(_local6, _local7); | |
} else { | |
if ((((_local7 < 1)) && ((_local6 < 1)))){ | |
_local9 = Math.max(_local6, _local7); | |
} else { | |
if ((((_local6 > 1)) && ((_local7 < 1)))){ | |
} else { | |
if ((((_local6 < 1)) && ((_local7 > 1)))){ | |
}; | |
}; | |
}; | |
}; | |
_local9 = (_local9 * _local8); | |
setMagnification(_local9); | |
}; | |
}; | |
}; | |
} else { | |
if (((this._hasBeenSized) && (!((this._app.getOption("invisible_zoom_on_reflow", "") == ""))))){ | |
_local10 = this._app.getOption("invisible_zoom_on_reflow", ""); | |
}; | |
}; | |
this._hasBeenSized = true; | |
} | |
override protected function pageContentLoaded(_arg1:Event):void{ | |
this._tryRemoveLoader(); | |
super.pageContentLoaded(null); | |
} | |
override public function loadPage(_arg1:String, _arg2:String):void{ | |
this._drawLoader(); | |
super.loadPage(_arg1, _arg2); | |
} | |
override public function loadPageLeft(_arg1:String, _arg2:String):void{ | |
this._drawLoader(); | |
super.loadPageLeft(_arg1, _arg2); | |
} | |
override public function loadPageRight(_arg1:String, _arg2:String):void{ | |
super.loadPageRight(_arg1, _arg2); | |
} | |
private function _drawLoader():void{ | |
this._tryRemoveLoader(); | |
this._loader = new LoadBlocker(this._app); | |
this._loader.setSize(this._bg.width, this._bg.height); | |
addChild(this._loader); | |
} | |
private function _tryRemoveLoader():void{ | |
DisplayU.removeFromDisplayList(this._loader); | |
this._loader = null; | |
} | |
private function _updateProgress(_arg1:ProgressEvent):void{ | |
var _local2:Number = (_arg1.bytesLoaded / _arg1.bytesTotal); | |
this._loader.setProgress(_local2); | |
} | |
} | |
}//package com.vpg.vpage.shell.pageview | |
package com.vpg.vpage.shell.pageview { | |
import flash.display.*; | |
import com.vpg.vpage.shell.search.*; | |
import com.vpg.vpage.shell.pageview.additionallayers.*; | |
import com.vpg.vpage.shell.*; | |
import flash.events.*; | |
import com.vpg.vpage.shell.whiteboard.*; | |
import com.vpg.vpage.shell.activepagetext.*; | |
import com.vpg.vpage.shell.screenreader.*; | |
import com.vpg.vpage.shell.tools.*; | |
import com.vpg.vpage.shell.pageicons.*; | |
public class GenericPageLayout extends Sprite { | |
private var _app:App; | |
private var _pageHolders:Array; | |
private var _loadCount:Number; | |
private var _drawingOverlayMgr:DrawingOverlayMgr; | |
private var _screenReaderMgr:ScreenReaderManager; | |
private var _whiteboardMgr:WhiteboardManager; | |
private var _pageTextMgr:PageTextManager; | |
private var _searchLayerMgr:SearchLayerManager; | |
private var _iconDrawMgr:IconDrawManager; | |
private var _additionalLayerFactory:IAdditionalLayerFactory; | |
public function GenericPageLayout(){ | |
this._pageHolders = new Array(); | |
} | |
public function setApp(_arg1:App):void{ | |
this._app = _arg1; | |
} | |
public function setAdditionalLayerFactory(_arg1:IAdditionalLayerFactory):void{ | |
this._additionalLayerFactory = _arg1; | |
} | |
public function setManagers(_arg1:DrawingOverlayMgr, _arg2:ScreenReaderManager, _arg3:WhiteboardManager, _arg4:PageTextManager, _arg5:SearchLayerManager, _arg6:IconDrawManager):void{ | |
this._drawingOverlayMgr = _arg1; | |
this._screenReaderMgr = _arg2; | |
this._whiteboardMgr = _arg3; | |
this._pageTextMgr = _arg4; | |
this._searchLayerMgr = _arg5; | |
this._iconDrawMgr = _arg6; | |
} | |
public function loadPage(_arg1:String, _arg2:String):void{ | |
this.clearAll(); | |
var _local3:PageLayout = this._addPage(); | |
_local3.loadPage(_arg1, _arg2); | |
} | |
public function loadPageLeft(_arg1:String, _arg2:String):void{ | |
this.clearAll(); | |
var _local3:PageLayout = this._addPage(); | |
var _local4:PageLayout = this._addPage(); | |
_local3.loadPage(_arg1, _arg2); | |
} | |
public function loadPageRight(_arg1:String, _arg2:String):void{ | |
this._pageHolders[1].loadPage(_arg1, _arg2); | |
} | |
public function clearAll():void{ | |
var _local1:int; | |
while (_local1 < this._pageHolders.length) { | |
this._pageHolders[_local1].removeEventListener(Event.COMPLETE, this._pageLoaded); | |
this._pageHolders[_local1].removeEventListener(ProgressEvent.PROGRESS, this._progressUpdate); | |
this._pageHolders[_local1].destroy(); | |
this._pageHolders[_local1].parent.removeChild(this._pageHolders[_local1]); | |
_local1++; | |
}; | |
this._pageHolders = new Array(); | |
this._loadCount = 0; | |
} | |
public function getWidth():Number{ | |
var _local1:Number = 0; | |
var _local2:int; | |
while (_local2 < this._pageHolders.length) { | |
_local1 = (_local1 + this._pageHolders[_local2].getWidth()); | |
_local2++; | |
}; | |
return (_local1); | |
} | |
public function getHeight():Number{ | |
var _local1:Number = 0; | |
var _local2:int; | |
while (_local2 < this._pageHolders.length) { | |
_local1 = Math.max(this._pageHolders[_local2].getHeight(), _local1); | |
_local2++; | |
}; | |
return (_local1); | |
} | |
private function _addPage():PageLayout{ | |
var _local1:PageLayout = new PageLayout(this._app, this._additionalLayerFactory); | |
_local1.setManagers(this._drawingOverlayMgr, this._screenReaderMgr, this._whiteboardMgr, this._pageTextMgr, this._searchLayerMgr, this._iconDrawMgr); | |
addChild(_local1); | |
_local1.addEventListener(Event.COMPLETE, this._pageLoaded); | |
_local1.addEventListener(ProgressEvent.PROGRESS, this._progressUpdate); | |
this._pageHolders.push(_local1); | |
return (_local1); | |
} | |
private function _pageLoaded(_arg1:Event):void{ | |
this._loadCount++; | |
if (this._loadCount == this._pageHolders.length){ | |
if (this._pageHolders.length == 1){ | |
dispatchEvent(new Event(Event.COMPLETE)); | |
} else { | |
this._pageHolders[1].x = this._pageHolders[0].getWidth(); | |
dispatchEvent(new Event(Event.COMPLETE)); | |
}; | |
}; | |
} | |
private function _progressUpdate(_arg1:ProgressEvent):void{ | |
var _local2:Number = 0; | |
var _local3:Number = 0; | |
var _local4:int; | |
while (_local4 < this._pageHolders.length) { | |
_local2 = (_local2 + this._pageHolders[_local4].getBytesTotal()); | |
_local3 = (_local3 + this._pageHolders[_local4].getBytesLoaded()); | |
_local4++; | |
}; | |
var _local5:ProgressEvent = new ProgressEvent(ProgressEvent.PROGRESS, false, false, _local3, _local2); | |
dispatchEvent(_local5); | |
} | |
} | |
}//package com.vpg.vpage.shell.pageview | |
package com.vpg.vpage.shell.pageview { | |
import flash.display.*; | |
import com.vpg.vpage.shell.search.*; | |
import com.vpg.vpage.shell.pageview.additionallayers.*; | |
import com.vpg.vpage.shell.*; | |
import flash.net.*; | |
import flash.events.*; | |
import com.vpg.vpage.shell.whiteboard.*; | |
import com.vpg.vpage.shell.activepagetext.*; | |
import com.vpg.vpage.shell.screenreader.*; | |
import com.vpg.vpage.shell.tools.*; | |
import com.vpg.vpage.shell.pageicons.*; | |
public class PageLayout extends Sprite { | |
private static const GET_VALUE:String = "vpgGetValue"; | |
private var _contentMc:Sprite; | |
private var _swfFile:String; | |
private var _swfUrl:String; | |
private var _app:App; | |
private var _bg:Sprite; | |
private var _bytesTotal:Number; | |
private var _bytesLoaded:Number; | |
private var _drawingOverlayMgr:DrawingOverlayMgr; | |
private var _screenReaderMgr:ScreenReaderManager; | |
private var _whiteboardMgr:WhiteboardManager; | |
private var _pageTextMgr:PageTextManager; | |
private var _searchLayerMgr:SearchLayerManager; | |
private var _iconDrawMgr:IconDrawManager; | |
private var _addtl:IAdditionalLayerFactory; | |
private var _layers:Array; | |
private var _loadBlocker:LoadBlocker; | |
private var _destroyed:Boolean; | |
public function PageLayout(_arg1:App, _arg2:IAdditionalLayerFactory=null){ | |
this._app = _arg1; | |
this._addtl = _arg2; | |
this._loadBlocker = new LoadBlocker(this._app); | |
this._destroyed = false; | |
} | |
public function destroy():void{ | |
var _local1:Loader = (this._contentMc.getChildAt(0) as Loader); | |
if (_local1 != null){ | |
_local1.unloadAndStop(); | |
}; | |
this._drawingOverlayMgr = null; | |
this._screenReaderMgr = null; | |
this._whiteboardMgr = null; | |
this._pageTextMgr = null; | |
this._searchLayerMgr = null; | |
this._iconDrawMgr = null; | |
this._app = null; | |
this._bg = null; | |
this._contentMc = null; | |
this._swfFile = null; | |
this._swfUrl = null; | |
this._destroyed = true; | |
} | |
public function getWidth():Number{ | |
var _local1:Loader = (this._contentMc.getChildAt(0) as Loader); | |
if (_local1 == null){ | |
return (width); | |
}; | |
var _local2:MovieClip = (_local1.content as MovieClip); | |
if (_local2 == null){ | |
return (_local1.width); | |
}; | |
var _local3:MovieClip = (_local2.getChildByName("size_mc") as MovieClip); | |
if (_local3){ | |
return (_local3.width); | |
}; | |
return (_local1.width); | |
} | |
public function getHeight():Number{ | |
var _local1:Loader = (this._contentMc.getChildAt(0) as Loader); | |
if (_local1 == null){ | |
return (height); | |
}; | |
var _local2:MovieClip = (_local1.content as MovieClip); | |
if (_local2 == null){ | |
return (_local1.height); | |
}; | |
var _local3:MovieClip = (_local2.getChildByName("size_mc") as MovieClip); | |
if (_local3){ | |
return (_local3.height); | |
}; | |
return (_local1.height); | |
} | |
public function loadPage(_arg1:String, _arg2:String):void{ | |
this._layers = new Array(); | |
if (this._contentMc){ | |
if (this._contentMc.parent){ | |
this._contentMc.parent.removeChild(this._contentMc); | |
}; | |
}; | |
this._swfUrl = _arg1; | |
this._swfFile = _arg2; | |
this._runLoadProcess(); | |
} | |
public function setManagers(_arg1:DrawingOverlayMgr, _arg2:ScreenReaderManager, _arg3:WhiteboardManager, _arg4:PageTextManager, _arg5:SearchLayerManager, _arg6:IconDrawManager):void{ | |
this._drawingOverlayMgr = _arg1; | |
this._screenReaderMgr = _arg2; | |
this._whiteboardMgr = _arg3; | |
this._pageTextMgr = _arg4; | |
this._searchLayerMgr = _arg5; | |
this._iconDrawMgr = _arg6; | |
} | |
public function setBaseSize(_arg1:Number, _arg2:Number):void{ | |
this._loadBlocker.setSize(_arg1, _arg2); | |
} | |
public function getBytesLoaded():Number{ | |
return (this._bytesLoaded); | |
} | |
public function getBytesTotal():Number{ | |
return (this._bytesTotal); | |
} | |
private function _runLoadProcess():void{ | |
if (this._destroyed){ | |
return; | |
}; | |
this._contentMc = new Sprite(); | |
addChild(this._contentMc); | |
this._loadPageContent(); | |
} | |
private function _loadComplete():void{ | |
if (this._destroyed){ | |
return; | |
}; | |
this._orderLayers(); | |
removeChild(this._loadBlocker); | |
dispatchEvent(new Event(Event.COMPLETE)); | |
} | |
private function _orderLayers():void{ | |
var _local3:String; | |
var _local4:int; | |
var _local1:Array = this._app.getOption("page_layer_order", "").split(","); | |
var _local2:int; | |
while (_local2 < _local1.length) { | |
_local3 = _local1[_local2]; | |
_local4 = 0; | |
while (_local4 < this._layers.length) { | |
if (this._layers[_local4].name == _local3){ | |
setChildIndex(this._layers[_local4], (this._layers.length - 1)); | |
}; | |
_local4++; | |
}; | |
_local2++; | |
}; | |
} | |
private function _loadPageContent():void{ | |
if (this._destroyed){ | |
return; | |
}; | |
this._bytesLoaded = 0; | |
this._bytesTotal = 0; | |
var _local1:Loader = new Loader(); | |
this._contentMc.name = "page"; | |
var _local2:URLRequest = new URLRequest(this._swfUrl); | |
_local1.contentLoaderInfo.sharedEvents.addEventListener(GET_VALUE, this._getValueEvent); | |
_local1.contentLoaderInfo.addEventListener(Event.COMPLETE, this._pageContentLoaded); | |
_local1.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, this._pageContentProgress); | |
this._contentMc.addChild(_local1); | |
addChild(this._loadBlocker); | |
_local1.load(_local2); | |
this._layers.push(_local1); | |
} | |
private function _pageContentLoaded(_arg1:Event):void{ | |
if (this._destroyed){ | |
return; | |
}; | |
var _local2:LoaderInfo = (_arg1.currentTarget as LoaderInfo); | |
_local2.removeEventListener(Event.COMPLETE, this._pageContentLoaded); | |
_local2.removeEventListener(ProgressEvent.PROGRESS, this._pageContentProgress); | |
this._loadSearch(); | |
} | |
private function _pageContentProgress(_arg1:ProgressEvent):void{ | |
if (this._destroyed){ | |
return; | |
}; | |
this._bytesLoaded = _arg1.bytesLoaded; | |
this._bytesTotal = _arg1.bytesTotal; | |
this._loadBlocker.setProgress((this.getBytesLoaded() / this.getBytesTotal())); | |
dispatchEvent(_arg1); | |
} | |
private function _loadSearch():void{ | |
var _local1:SearchHiliter; | |
var _local2:Number; | |
if (this._destroyed){ | |
return; | |
}; | |
if (this._app.getOption("enable_search_layer", "1") == "1"){ | |
_local1 = new SearchHiliter(); | |
_local1.name = "search"; | |
_local1.addEventListener(Event.COMPLETE, this._searchLoaded); | |
addChild(_local1); | |
addChild(this._loadBlocker); | |
this._searchLayerMgr.addLayer(_local1); | |
_local2 = this._app.getStyleMgr().getNumber("search_highlights"); | |
_local1.init((((((this._app.getRootPath() + "data/search/") + this._app.getBookID()) + "/") + this._swfFile) + ".xml"), _local2); | |
this._layers.push(_local1); | |
} else { | |
this._searchLoaded(null); | |
}; | |
} | |
private function _searchLoaded(_arg1:Event):void{ | |
var _local2:SearchHiliter; | |
if (this._destroyed){ | |
return; | |
}; | |
if (_arg1){ | |
_local2 = (_arg1.currentTarget as SearchHiliter); | |
_local2.removeEventListener(Event.COMPLETE, this._searchLoaded); | |
}; | |
this._loadScreenReader(); | |
} | |
private function _loadScreenReader():void{ | |
var _local1:ScreenReaderMulti; | |
if (this._destroyed){ | |
return; | |
}; | |
if (this._app.getOption("enable_voice_sync", "1") == "1"){ | |
_local1 = new ScreenReaderMulti(this._app); | |
_local1.name = "voicesync"; | |
_local1.addEventListener(Event.COMPLETE, this._screenReaderLoadComplete); | |
addChild(_local1); | |
addChild(this._loadBlocker); | |
this._screenReaderMgr.addLayer(_local1); | |
_local1.init((((this._app.getRootPath() + "data/screen_reader/") + this._app.getBookID()) + "/"), this._swfFile); | |
this._layers.push(_local1); | |
} else { | |
this._screenReaderLoadComplete(null); | |
}; | |
} | |
private function _screenReaderLoadComplete(_arg1:Event):void{ | |
var _local2:ScreenReaderMulti; | |
if (this._destroyed){ | |
return; | |
}; | |
if (_arg1 != null){ | |
_local2 = (_arg1.currentTarget as ScreenReaderMulti); | |
_local2.removeEventListener(Event.COMPLETE, this._screenReaderLoadComplete); | |
}; | |
this._loadIconDraw(); | |
} | |
private function _loadIconDraw():void{ | |
var _local1:IconDraw; | |
var _local2:String; | |
if (this._destroyed){ | |
return; | |
}; | |
if (this._app.getOption("enable_hyperlink_layer", "1") == "1"){ | |
_local1 = new IconDraw(this._app.getIconFunctions(), this._app.getStyleMgr(), this._app.getRootPath()); | |
_local1.name = "hyperlink"; | |
this._iconDrawMgr.addLayer(_local1); | |
_local1.addEventListener(Event.COMPLETE, this._iconDrawLoaded); | |
addChild(_local1); | |
addChild(this._loadBlocker); | |
_local2 = (((((this._app.getRootPath() + "data/xml/") + this._app.getBookID()) + "/") + this._swfFile) + ".xml"); | |
_local1.loadXML(_local2); | |
this._layers.push(_local1); | |
} else { | |
this._iconDrawLoaded(null); | |
}; | |
} | |
private function _iconDrawLoaded(_arg1:Event):void{ | |
var _local2:IconDraw; | |
if (this._destroyed){ | |
return; | |
}; | |
if (_arg1 != null){ | |
_local2 = (_arg1.currentTarget as IconDraw); | |
_local2.removeEventListener(Event.COMPLETE, this._iconDrawLoaded); | |
}; | |
this._loadDrawingOverlay(); | |
} | |
private function _loadDrawingOverlay():void{ | |
var _local1:DrawingOverlay; | |
if (this._destroyed){ | |
return; | |
}; | |
if (this._app.getOption("enable_notes_layer", "1") == "1"){ | |
_local1 = new DrawingOverlay(); | |
_local1.addEventListener(Event.COMPLETE, this._drawingOverlayLoaded); | |
_local1.name = "notes"; | |
_local1.init(this._swfFile, this.getWidth(), this.getHeight()); | |
addChild(_local1); | |
addChild(this._loadBlocker); | |
this._drawingOverlayMgr.addLayer(_local1); | |
this._layers.push(_local1); | |
} else { | |
this._drawingOverlayLoaded(null); | |
}; | |
} | |
private function _drawingOverlayLoaded(_arg1:Event):void{ | |
var _local2:DrawingOverlay; | |
if (this._destroyed){ | |
return; | |
}; | |
if (_arg1 != null){ | |
_local2 = (_arg1.currentTarget as DrawingOverlay); | |
_local2.removeEventListener(Event.COMPLETE, this._drawingOverlayLoaded); | |
}; | |
this._setUpTextSelectLayer(); | |
} | |
private function _setUpTextSelectLayer():void{ | |
var _local1:PageTextLayer; | |
var _local2:String; | |
if (this._destroyed){ | |
return; | |
}; | |
if (this._app.getOption("enable_highlight_layer", "1") == "1"){ | |
_local1 = new PageTextLayer(); | |
_local1.name = "highlights"; | |
_local1.setSize(this.getWidth(), this.getHeight()); | |
_local1.addEventListener(Event.COMPLETE, this._textSelectLayerLoaded); | |
_local2 = (((((this._app.getRootPath() + "data/json/") + this._app.getBookID()) + "/") + this._swfFile) + ".txt"); | |
_local1.init(_local2, this._swfFile); | |
addChild(_local1); | |
addChild(this._loadBlocker); | |
this._layers.push(_local1); | |
} else { | |
this._textSelectLayerLoaded(null); | |
}; | |
} | |
private function _textSelectLayerLoaded(_arg1:Event):void{ | |
var _local2:PageTextLayer; | |
if (this._destroyed){ | |
return; | |
}; | |
if (_arg1 != null){ | |
_local2 = (_arg1.currentTarget as PageTextLayer); | |
_local2.removeEventListener(Event.COMPLETE, this._textSelectLayerLoaded); | |
_local2.addEventListener(Event.INIT, this._textSelectLayerReady); | |
this._pageTextMgr.addLayer(_local2); | |
} else { | |
this._textSelectLayerReady(null); | |
}; | |
} | |
private function _textSelectLayerReady(_arg1:Event):void{ | |
var _local2:PageTextLayer; | |
if (this._destroyed){ | |
return; | |
}; | |
if (_arg1 != null){ | |
_local2 = (_arg1.currentTarget as PageTextLayer); | |
_local2.removeEventListener(Event.INIT, this._textSelectLayerReady); | |
}; | |
this._initWhiteboard(); | |
} | |
private function _initWhiteboard():void{ | |
var _local1:WhiteboardLayer; | |
if (this._destroyed){ | |
return; | |
}; | |
if (this._app.getOption("enable_whiteboard_layer", "1") == "1"){ | |
_local1 = new WhiteboardLayer(this._swfFile); | |
_local1.name = "whiteboard"; | |
_local1.setSize(this.getWidth(), this.getHeight()); | |
addChild(_local1); | |
addChild(this._loadBlocker); | |
this._whiteboardMgr.addLayer(_local1); | |
this._layers.push(_local1); | |
}; | |
this._initAdditionalLayers(); | |
} | |
private function _initAdditionalLayers():void{ | |
var _local1:IOnPageContent; | |
if (this._destroyed){ | |
return; | |
}; | |
if (this._addtl){ | |
_local1 = this._addtl.createOnPageContent(this._swfFile, this.getWidth(), this.getHeight(), this._app); | |
_local1.addEventListener(Event.COMPLETE, this._additionalLayersLoaded); | |
_local1.load(); | |
} else { | |
this._additionalLayersLoaded(null); | |
}; | |
} | |
private function _additionalLayersLoaded(_arg1:Event):void{ | |
var _local2:IOnPageContent; | |
var _local3:Array; | |
var _local4:int; | |
var _local5:DisplayObject; | |
if (this._destroyed){ | |
return; | |
}; | |
if (_arg1){ | |
_local2 = (_arg1.currentTarget as IOnPageContent); | |
_local2.removeEventListener(Event.COMPLETE, this._additionalLayersLoaded); | |
_local3 = _local2.getDisplayObjects(); | |
_local4 = 0; | |
while (_local4 < _local3.length) { | |
_local5 = (_local3[_local4] as DisplayObject); | |
_local5.name = ("additional" + _local4); | |
this._layers.push(_local5); | |
addChild(_local5); | |
addChild(this._loadBlocker); | |
_local4++; | |
}; | |
}; | |
this._loadComplete(); | |
} | |
private function _getValueEvent(_arg1:Event):void{ | |
} | |
} | |
}//package com.vpg.vpage.shell.pageview | |
package com.vpg.vpage.shell.menu { | |
import flash.display.*; | |
import flash.events.*; | |
import com.vpg.vpage.utils.*; | |
import fl.transitions.*; | |
public class MenuManager extends EventDispatcher { | |
public static const OPEN_START:String = "menuOpenStart"; | |
public static const CLOSE_START:String = "menuCloseStart"; | |
public static const OPEN_END:String = "menuOpenEnd"; | |
public static const CLOSE_END:String = "menuCloseEnd"; | |
public static const MENU_SELECT:String = "menuSelected"; | |
private var _isOpen:Boolean; | |
private var _menuMap:HashMap; | |
private var _openTween:Tween; | |
private var _closeTween:Tween; | |
private var _isTweening:Boolean; | |
public function MenuManager(){ | |
this._menuMap = new HashMap(); | |
this._isOpen = false; | |
this._isTweening = false; | |
} | |
public function open(_arg1:Boolean=false):Boolean{ | |
if (!this._isOpen){ | |
if (!this._isTweening){ | |
this._isOpen = true; | |
this._isTweening = true; | |
this._openTween.start(); | |
dispatchEvent(new Event(OPEN_START)); | |
if (_arg1){ | |
this._openTween.fforward(); | |
}; | |
return (true); | |
}; | |
}; | |
return (false); | |
} | |
public function close(_arg1:Boolean=false):Boolean{ | |
if (this._isOpen){ | |
if (!this._isTweening){ | |
this._isTweening = true; | |
this._isOpen = false; | |
this._closeTween.start(); | |
dispatchEvent(new Event(CLOSE_START)); | |
if (_arg1){ | |
this._closeTween.fforward(); | |
}; | |
return (true); | |
}; | |
}; | |
return (false); | |
} | |
public function finishCurrentMotion():void{ | |
if (this._openTween.isPlaying){ | |
this._openTween.fforward(); | |
this._isTweening = false; | |
}; | |
if (this._closeTween.isPlaying){ | |
this._closeTween.fforward(); | |
this._isTweening = false; | |
}; | |
} | |
public function isOpen():Boolean{ | |
return (this._isOpen); | |
} | |
public function showMenu(_arg1:DisplayObject):void{ | |
var _local4:DisplayObject; | |
var _local2:Array = this._menuMap.values(); | |
var _local3:int; | |
while (_local3 < _local2.length) { | |
_local4 = _local2[_local3]; | |
_local4.visible = false; | |
_local3++; | |
}; | |
_arg1.visible = true; | |
this.open(); | |
} | |
public function registerMenu(_arg1:MovieClip, _arg2:DisplayObject):void{ | |
DisplayU.buttonify(_arg1, this._menuButtonClicked); | |
this._menuMap.put(_arg1, _arg2); | |
} | |
public function setOpenTransition(_arg1:Tween):void{ | |
this._openTween = _arg1; | |
this._openTween.addEventListener(TweenEvent.MOTION_FINISH, this._menuOpened); | |
this._openTween.stop(); | |
} | |
public function setCloseTransition(_arg1:Tween):void{ | |
this._closeTween = _arg1; | |
this._closeTween.addEventListener(TweenEvent.MOTION_FINISH, this._menuClosed); | |
this._closeTween.stop(); | |
} | |
public function toggleOpenClose():void{ | |
if (this.isOpen()){ | |
this.close(); | |
} else { | |
this.open(); | |
}; | |
} | |
private function _menuButtonClicked(_arg1:Event):void{ | |
var _local2:MovieClip = (_arg1.currentTarget as MovieClip); | |
var _local3:DisplayObject = this._menuMap.get(_local2); | |
if (((_local3.visible) && (this.isOpen()))){ | |
this.close(); | |
} else { | |
this.showMenu(_local3); | |
}; | |
} | |
private function _menuOpened(_arg1:Event):void{ | |
this._isTweening = false; | |
dispatchEvent(new Event(OPEN_END)); | |
} | |
private function _menuClosed(_arg1:Event):void{ | |
this._isTweening = false; | |
dispatchEvent(new Event(CLOSE_END)); | |
} | |
} | |
}//package com.vpg.vpage.shell.menu | |
package com.vpg.vpage.shell { | |
import flash.display.*; | |
import flash.text.*; | |
import com.vpg.vpage.utils.*; | |
public class LoadingBar extends Sprite { | |
public var display_text:TextField; | |
public var bar_mc:Sprite; | |
public var bg:Sprite; | |
public var border:Sprite; | |
public function LoadingBar(_arg1:String, _arg2:Boolean=false){ | |
if (_arg1 != null){ | |
this.setStatus(_arg1); | |
}; | |
if (_arg2){ | |
this.bg.visible = true; | |
} else { | |
this.bg.visible = false; | |
}; | |
this.bar_mc.width = 0; | |
} | |
public function setStatus(_arg1:String):void{ | |
_arg1 = StringU.fixHtmlEntities(_arg1); | |
this.display_text.text = _arg1; | |
} | |
public function setProgress(_arg1:Number):void{ | |
_arg1 = Math.max(0, Math.min(1, _arg1)); | |
this.bar_mc.width = Math.floor((341 * _arg1)); | |
} | |
public function skin(_arg1:Number, _arg2:Number, _arg3:Number):void{ | |
DisplayU.tint(this.bg, _arg1); | |
DisplayU.tint(this.bar_mc, _arg2); | |
DisplayU.tint(this.border, _arg3); | |
} | |
} | |
}//package com.vpg.vpage.shell | |
package com.vpg.vpage.shell { | |
import flash.display.*; | |
import flash.text.*; | |
import com.vpg.vpage.utils.*; | |
public class ToolTip extends Sprite { | |
public var bgnd_mc:Sprite; | |
public var outline_mc:Sprite; | |
public var shadow_mc:Sprite; | |
public var label_txt:TextField; | |
public function ToolTip(_arg1:String, _arg2:Number){ | |
_arg1 = StringU.fixHtmlEntities(_arg1); | |
this.label_txt.htmlText = _arg1; | |
this.label_txt.autoSize = TextFieldAutoSize.LEFT; | |
var _local3:Number = ((this.label_txt.x + this.label_txt.width) + 3); | |
if (_local3 >= _arg2){ | |
_local3 = _arg2; | |
}; | |
this.label_txt.wordWrap = true; | |
this.label_txt.multiline = true; | |
this.label_txt.width = _local3; | |
this.bgnd_mc.width = _local3; | |
this.outline_mc.width = _local3; | |
this.shadow_mc.width = _local3; | |
var _local4:Number = this.label_txt.height; | |
this.bgnd_mc.height = (this.shadow_mc.height = (this.outline_mc.height = _local4)); | |
mouseEnabled = false; | |
mouseChildren = false; | |
} | |
} | |
}//package com.vpg.vpage.shell | |
package com.vpg.vpage.shell.datastore { | |
public class GenericDataStoreTypes { | |
public static const TYPE_NOTE:String = "typeNote"; | |
public static const TYPE_HIGHLIGHT:String = "typeHighlight"; | |
public static const TYPE_WHITEBOARD:String = "typeWhiteboard"; | |
public static const TYPE_BOOKMARK:String = "typeBookmark"; | |
} | |
}//package com.vpg.vpage.shell.datastore | |
package com.vpg.vpage.shell.datastore { | |
import flash.events.*; | |
import com.vpg.vpage.utils.*; | |
import com.vpg.vpage.shell.userdata.*; | |
public class GenericDataStore extends EventDispatcher implements IUserDataStorage { | |
private var _bookid:String; | |
private var _contentMap:HashMap; | |
public function GenericDataStore(_arg1:String){ | |
this._bookid = _arg1; | |
this._contentMap = new HashMap(); | |
} | |
public function handleRequest(_arg1:UserDataRequest):void{ | |
var _local2:*; | |
if (_arg1.getMethod() == UserDataRequest.METHOD_GET){ | |
_local2 = this.getContent(_arg1.getType(), _arg1.getPage()); | |
_arg1.setContent(_local2); | |
_arg1.notifySuccess(); | |
} else { | |
if (_arg1.getMethod() == UserDataRequest.METHOD_SET){ | |
this.setContent(_arg1.getType(), _arg1.getContent(), _arg1.getPage()); | |
_arg1.notifySuccess(); | |
} else { | |
_arg1.notifyFail(); | |
}; | |
}; | |
} | |
public function isReady():Boolean{ | |
return (true); | |
} | |
public function destroy():void{ | |
this._contentMap.clear(); | |
this._bookid = null; | |
this._contentMap = null; | |
} | |
public function setContent(_arg1:String, _arg2, _arg3:String=""):void{ | |
var _local5:HashMap; | |
if (!this._contentMap.containsKey(_arg1)){ | |
_local5 = new HashMap(); | |
this._contentMap.put(_arg1, _local5); | |
}; | |
var _local4:HashMap = this._contentMap.get(_arg1); | |
_local4.put(_arg3, _arg2); | |
dispatchEvent(new GenericDataStoreChangeEvent(GenericDataStoreChangeEvent.CHANGE, this._bookid, _arg3, _arg1, _arg2)); | |
} | |
public function getContent(_arg1:String, _arg2:String=""){ | |
var _local4:*; | |
var _local3:HashMap = this._contentMap.get(_arg1); | |
if (_local3 == null){ | |
return (null); | |
}; | |
_local4 = _local3.get(_arg2); | |
return (_local4); | |
} | |
public function extractAllStringData(_arg1:String):String{ | |
var _local3:HashMap; | |
var _local4:Array; | |
var _local5:int; | |
var _local2 = ""; | |
if (this._contentMap.containsKey(_arg1)){ | |
_local3 = this._contentMap.get(_arg1); | |
_local4 = _local3.keys(); | |
_local5 = 0; | |
while (_local5 < _local4.length) { | |
_local2 = (_local2 + this.extractPageStringDataByType(_arg1, _local4[_local5])); | |
_local5++; | |
}; | |
_local2 = (((("<data type=\"" + _arg1) + "\">") + _local2) + "</data>"); | |
}; | |
return (_local2); | |
} | |
public function setAllStringData(_arg1:String):void{ | |
var _local7:String; | |
var _local8:XMLList; | |
var _local9:String; | |
var _local2:XML = new XML(_arg1); | |
var _local3:String = _local2.@type; | |
var _local4:HashMap = this._contentMap.get(_local3); | |
if (_local4){ | |
_local4.clear(); | |
}; | |
if ((((_arg1 == "")) || ((_arg1 == null)))){ | |
return; | |
}; | |
var _local5:XMLList = _local2.page; | |
var _local6:int; | |
while (_local6 < _local5.length()) { | |
_local7 = _local5[_local6].@id; | |
_local8 = _local5[_local6].children(); | |
_local9 = _local8.toString(); | |
this.setContent(_local3, _local9, _local7); | |
_local6++; | |
}; | |
} | |
public function extractPageStringDataByType(_arg1:String, _arg2:String, _arg3:Boolean=true):String{ | |
var _local6:ISaveableObject; | |
var _local4 = ""; | |
var _local5:* = this.getContent(_arg1, _arg2); | |
if ((_local5 is String)){ | |
_local4 = _local5; | |
} else { | |
if ((_local5 is ISaveableObject)){ | |
_local6 = (_local5 as ISaveableObject); | |
_local4 = _local6.getSaveString(); | |
}; | |
}; | |
if (((!((_local4 == ""))) && (_arg3))){ | |
_local4 = (((("<page id=\"" + _arg2) + "\">") + _local4) + "</page>"); | |
}; | |
return (_local4); | |
} | |
public function extractAllPageStringData(_arg1:String, _arg2:Boolean=true, _arg3:Boolean=true):String{ | |
var _local7:String; | |
var _local8:String; | |
var _local4 = ""; | |
var _local5:Array = this._contentMap.keys(); | |
var _local6:int; | |
while (_local6 < _local5.length) { | |
_local7 = _local5[_local6]; | |
_local8 = this.extractPageStringDataByType(_local7, _arg1, false); | |
if (((!((_local8 == ""))) && (_arg3))){ | |
_local4 = (_local4 + (((("<data type=\"" + _local7) + "\">") + _local8) + "</data>")); | |
} else { | |
_local4 = (_local4 + _local8); | |
}; | |
_local6++; | |
}; | |
if (((!((_local4 == ""))) && (_arg2))){ | |
_local4 = (((("<page id=\"" + _arg1) + "\">") + _local4) + "</page>"); | |
}; | |
return (_local4); | |
} | |
} | |
}//package com.vpg.vpage.shell.datastore | |
package com.vpg.vpage.shell.datastore { | |
import flash.events.*; | |
public class GenericDataStoreChangeEvent extends Event { | |
public static const CHANGE:String = "changeEvent"; | |
public var bookid:String; | |
public var page:String; | |
public var dataType:String; | |
public var content; | |
public function GenericDataStoreChangeEvent(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5, _arg6:Boolean=false, _arg7:Boolean=false){ | |
this.bookid = _arg2; | |
this.page = _arg3; | |
this.dataType = _arg4; | |
this.content = _arg5; | |
super(_arg1, _arg6, _arg7); | |
} | |
override public function clone():Event{ | |
return (new GenericDataStoreChangeEvent(type, this.bookid, this.page, this.dataType, this.content, bubbles, cancelable)); | |
} | |
override public function toString():String{ | |
return (formatToString("GenericDataStoreChangeEvent", "type", "bookid", "page", "dataType", "bubbles", "cancelable", "eventPhase")); | |
} | |
} | |
}//package com.vpg.vpage.shell.datastore | |
package com.vpg.vpage.shell.datastore { | |
public interface ISaveableObject { | |
function getSaveString():String; | |
} | |
}//package com.vpg.vpage.shell.datastore | |
package com.vpg.vpage.shell { | |
import flash.display.*; | |
import flash.events.*; | |
import com.vpg.vpage.utils.*; | |
import com.vpg.vpage.flashprojector.*; | |
import flash.system.*; | |
public class ShellSwf extends MovieClip { | |
private var _loader:LoadingScreen; | |
private var _holder:Sprite; | |
private var _app:App; | |
private var _contentPath:String; | |
public function ShellSwf(){ | |
this._setup(); | |
} | |
protected function _setup():void{ | |
this._holder = new Sprite(); | |
var _local1 = "Loading..."; | |
if (loaderInfo.parameters.loadMessage){ | |
_local1 = loaderInfo.parameters.loadMessage; | |
}; | |
this._loader = new LoadingScreen(960, 720, _local1); | |
if (stage){ | |
this._setUpStageProps(); | |
} else { | |
addEventListener(Event.ADDED_TO_STAGE, this._addedToStage); | |
}; | |
addChild(this._loader); | |
this._loadContentPath(); | |
} | |
private function _addedToStage(_arg1:Event):void{ | |
removeEventListener(Event.ADDED_TO_STAGE, this._addedToStage); | |
this._setUpStageProps(); | |
} | |
private function _setUpStageProps():void{ | |
stage.scaleMode = StageScaleMode.NO_SCALE; | |
stage.align = StageAlign.TOP_LEFT; | |
stage.addEventListener(Event.RESIZE, this._resizeLoader); | |
this._loader.resize(stage.stageWidth, stage.stageHeight); | |
} | |
private function _loadContentPath():void{ | |
var _local1:Event; | |
var _local2:String; | |
var _local3:String; | |
if (loaderInfo.sharedEvents.hasEventListener(ProjectorEvents.GET_PATH)){ | |
loaderInfo.sharedEvents.addEventListener(ProjectorEvents.SET_PATH, this._setPathRequest); | |
_local1 = new Event(ProjectorEvents.GET_PATH); | |
loaderInfo.sharedEvents.dispatchEvent(_local1); | |
} else { | |
this._contentPath = ""; | |
_local2 = loaderInfo.parameters.contentPath; | |
_local3 = "LOAD_FROM_FILE"; | |
if (((((!((_local2 == null))) && (!((_local2 == ""))))) && (!((_local2 == _local3))))){ | |
this._contentPath = _local2; | |
} else { | |
if ((((Capabilities.playerType == "External")) || ((_local2 == _local3)))){ | |
NetU.doFileLoad("data/contentpath.txt", this._contentPathLoaded, this._contentPathLoadError); | |
} else { | |
this._loadBookId(); | |
}; | |
}; | |
}; | |
} | |
private function _setPathRequest(_arg1:EventWithParam):void{ | |
this._contentPath = _arg1.param; | |
this._loadBookId(); | |
} | |
private function _contentPathLoaded(_arg1:Event):void{ | |
var _local2:String = _arg1.target.data; | |
this._contentPath = StringU.trim(_local2); | |
this._loadBookId(); | |
} | |
private function _contentPathLoadError(_arg1:Event):void{ | |
trace("No content path found"); | |
this._loadBookId(); | |
} | |
private function _loadBookId():void{ | |
NetU.doFileLoad((this._contentPath + "data/bookid.txt"), this._bookIdLoaded, this._bookIdLoadError); | |
} | |
private function _bookIdLoaded(_arg1:Event):void{ | |
var _local2:String = _arg1.target.data; | |
_local2 = StringU.trim(_local2); | |
this._app = new App(this._holder, _local2, loaderInfo, this._contentPath); | |
this._app.addEventListener(Event.COMPLETE, this._appInited); | |
this._app.init(); | |
} | |
private function _bookIdLoadError(_arg1:Event):void{ | |
trace("error loading data/bookid.txt"); | |
} | |
private function _appInited(_arg1:Event):void{ | |
this._resizeMain(null); | |
stage.removeEventListener(Event.RESIZE, this._resizeLoader); | |
stage.addEventListener(Event.RESIZE, this._resizeMain); | |
addChild(this._holder); | |
removeChild(this._loader); | |
} | |
private function _resizeLoader(_arg1:Event):void{ | |
this._loader.resize(stage.stageWidth, stage.stageHeight); | |
} | |
private function _resizeMain(_arg1:Event):void{ | |
this._app.getMain().resize(stage.stageWidth, stage.stageHeight); | |
} | |
} | |
}//package com.vpg.vpage.shell | |
package com.vpg.vpage.shell.prompt { | |
import flash.events.*; | |
public class PromptEvent extends Event { | |
public static const YES:String = "yesPromptEvent"; | |
public static const NO:String = "noPromptEvent"; | |
public function PromptEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false){ | |
super(_arg1, _arg2, _arg3); | |
} | |
} | |
}//package com.vpg.vpage.shell.prompt | |
package com.vpg.vpage.shell.prompt { | |
import flash.display.*; | |
import flash.events.*; | |
import flash.text.*; | |
import com.vpg.vpage.utils.*; | |
public class BasicPrompt extends Sprite implements IConfirmationPrompt { | |
public var content_area:MovieClip; | |
public var bg:MovieClip; | |
public var title_tf:TextField; | |
public var yes_btn:MovieClip; | |
public var no_btn:MovieClip; | |
public var ok_btn:MovieClip; | |
public var tf:TextField; | |
private var _yesCB:Function; | |
private var _noCB:Function; | |
public function BasicPrompt(){ | |
DisplayU.buttonify(this.yes_btn, this._yesClicked); | |
DisplayU.buttonify(this.no_btn, this._noClicked); | |
DisplayU.buttonify(this.ok_btn, this._okClicked); | |
} | |
public function setMessage(_arg1:String):void{ | |
if (_arg1 == null){ | |
_arg1 = ""; | |
}; | |
this.tf.htmlText = _arg1; | |
} | |
public function useOkButton():void{ | |
if (this.yes_btn){ | |
this.yes_btn.visible = false; | |
this.no_btn.visible = false; | |
}; | |
this.ok_btn.visible = true; | |
} | |
public function setTitle(_arg1:String):void{ | |
if (this.title_tf){ | |
this.title_tf.htmlText = _arg1; | |
}; | |
} | |
public function useYesNoButtons():void{ | |
if (this.ok_btn){ | |
this.ok_btn.visible = false; | |
}; | |
this.yes_btn.visible = true; | |
this.no_btn.visible = true; | |
} | |
public function getArt():DisplayObject{ | |
return (this); | |
} | |
public function destroy():void{ | |
if (this.yes_btn){ | |
this.yes_btn.removeEventListener(MouseEvent.CLICK, this._yesClicked); | |
}; | |
if (this.no_btn){ | |
this.no_btn.removeEventListener(MouseEvent.CLICK, this._noClicked); | |
}; | |
if (this.ok_btn){ | |
this.ok_btn.removeEventListener(MouseEvent.CLICK, this._okClicked); | |
}; | |
} | |
public function setScreenSize(_arg1:Number, _arg2:Number):void{ | |
x = ((_arg1 / 2) - (width / 2)); | |
y = ((_arg2 / 2) - (height / 2)); | |
} | |
public function setCallbacks(_arg1:Function, _arg2:Function):void{ | |
this._yesCB = _arg1; | |
this._noCB = _arg2; | |
} | |
private function _yesClicked(_arg1:Event):void{ | |
if (this._yesCB != null){ | |
this._yesCB(); | |
}; | |
dispatchEvent(new PromptEvent(PromptEvent.YES)); | |
} | |
private function _noClicked(_arg1:Event):void{ | |
if (this._noCB != null){ | |
this._noCB(); | |
}; | |
dispatchEvent(new PromptEvent(PromptEvent.NO)); | |
} | |
private function _okClicked(_arg1:Event):void{ | |
if (this._yesCB != null){ | |
this._yesCB(); | |
}; | |
dispatchEvent(new PromptEvent(PromptEvent.YES)); | |
} | |
} | |
}//package com.vpg.vpage.shell.prompt | |
package com.vpg.vpage.shell.prompt { | |
import flash.display.*; | |
import flash.events.*; | |
public interface IConfirmationPrompt extends IEventDispatcher { | |
function setMessage(_arg1:String):void; | |
function useOkButton():void; | |
function useYesNoButtons():void; | |
function getArt():DisplayObject; | |
function destroy():void; | |
function setScreenSize(_arg1:Number, _arg2:Number):void; | |
function setCallbacks(_arg1:Function, _arg2:Function):void; | |
function setTitle(_arg1:String):void; | |
} | |
}//package com.vpg.vpage.shell.prompt | |
package com.vpg.vpage.shell.glossary { | |
public class Term { | |
public var termText:String; | |
public var defText:String; | |
public function getFirstLetter():String{ | |
var _local1:String = this.termText.charAt(0); | |
return (_local1.toUpperCase()); | |
} | |
public function toString():String{ | |
return (("glossary.Term: " + this.termText)); | |
} | |
} | |
}//package com.vpg.vpage.shell.glossary | |
package com.vpg.vpage.shell.glossary { | |
import flash.net.*; | |
import flash.events.*; | |
import com.vpg.vpage.utils.*; | |
public class GlossaryService extends EventDispatcher { | |
public static const READY:String = "glossaryReady"; | |
public static const ERROR:String = "glossaryLoadError"; | |
private var _allTerms:Array; | |
private var _letterToTerms:HashMap; | |
private var _letterToStartIndex:HashMap; | |
private var _ready:Boolean; | |
public function GlossaryService(){ | |
this._ready = false; | |
} | |
public function init(_arg1:String):void{ | |
this._allTerms = new Array(); | |
this._letterToStartIndex = new HashMap(); | |
this._letterToTerms = new HashMap(); | |
NetU.doFileLoad(_arg1, this._xmlLoaded, this._xmlLoadError); | |
} | |
public function getAllTerms():Array{ | |
return (this._allTerms.slice()); | |
} | |
public function numTerms():int{ | |
return (this._allTerms.length); | |
} | |
public function getTermAtIndex(_arg1:int):Term{ | |
return (this._allTerms[_arg1]); | |
} | |
public function isReady():Boolean{ | |
return (this._ready); | |
} | |
public function hasTermsForLetter(_arg1:String):Boolean{ | |
if (this.getIndexOfLetter(_arg1) == -1){ | |
return (false); | |
}; | |
return (true); | |
} | |
public function getIndexOfLetter(_arg1:String):int{ | |
_arg1 = _arg1.toUpperCase(); | |
if (this._letterToStartIndex.containsKey(_arg1)){ | |
return (this._letterToStartIndex.get(_arg1)); | |
}; | |
return (-1); | |
} | |
public function getIndexOfTerm(_arg1:Term):int{ | |
return (this._allTerms.indexOf(_arg1)); | |
} | |
public function getActiveLetters():Array{ | |
var _local1:Array = this._letterToStartIndex.keys(); | |
return (_local1.slice()); | |
} | |
private function _xmlLoaded(_arg1:Event):void{ | |
var _local6:XML; | |
var _local7:Term; | |
var _local8:String; | |
var _local9:Array; | |
var _local2:URLLoader = (_arg1.currentTarget as URLLoader); | |
var _local3:XML = new XML(_local2.data); | |
var _local4:XMLList = _local3.entry.word; | |
var _local5:int; | |
while (_local5 < _local4.length()) { | |
_local6 = _local4[_local5]; | |
_local7 = new Term(); | |
_local7.termText = _local6.@id; | |
_local7.defText = _local6.def.text(); | |
this._allTerms.push(_local7); | |
_local8 = _local7.getFirstLetter(); | |
if (!this._letterToStartIndex.containsKey(_local8)){ | |
this._letterToStartIndex.put(_local8, _local5); | |
if (!this._letterToTerms.containsKey(_local8)){ | |
this._letterToTerms.put(_local8, new Array()); | |
}; | |
_local9 = this._letterToTerms.get(_local8); | |
_local9.push(_local7); | |
}; | |
_local5++; | |
}; | |
this._ready = true; | |
dispatchEvent(new Event(READY)); | |
} | |
private function _xmlLoadError(_arg1:Event):void{ | |
dispatchEvent(new Event(ERROR)); | |
} | |
} | |
}//package com.vpg.vpage.shell.glossary | |
package com.vpg.vpage.shell.glossary { | |
import flash.events.*; | |
public interface IGlossaryWindow extends IEventDispatcher { | |
function init(_arg1:String):void; | |
function goToTerm(_arg1:String):void; | |
function destroy():void; | |
function setScreenSize(_arg1:Number, _arg2:Number):void; | |
} | |
}//package com.vpg.vpage.shell.glossary | |
package com.vpg.vpage.shell.tools { | |
import flash.events.*; | |
public interface IEditableNotePopup extends IEventDispatcher { | |
function setIcon(_arg1:IconOnStage, _arg2:Boolean):void; | |
function destroy():void; | |
function setScreenSize(_arg1:Number, _arg2:Number):void; | |
} | |
}//package com.vpg.vpage.shell.tools | |
package com.vpg.vpage.shell.tools { | |
public class PopupEvents { | |
public static const PRINT:String = "printContent"; | |
} | |
}//package com.vpg.vpage.shell.tools | |
package com.vpg.vpage.shell.tools { | |
import flash.display.*; | |
import flash.events.*; | |
import com.vpg.vpage.utils.*; | |
import flash.system.*; | |
public class IconOnStage extends EventDispatcher { | |
public var type:String; | |
public var pMc:MovieClip; | |
private var date:Number; | |
private var _coords:String; | |
private var _pText:String; | |
private var _pURL:String; | |
private var _deleted:Boolean; | |
public function IconOnStage(){ | |
this._pText = ""; | |
this._pURL = ""; | |
this._deleted = false; | |
this.date = new Date().valueOf(); | |
} | |
public function set pText(_arg1:String):void{ | |
this._pText = _arg1; | |
dispatchEvent(new Event(Event.CHANGE)); | |
} | |
public function get pText():String{ | |
return (this._pText); | |
} | |
public function set pURL(_arg1:String):void{ | |
this._pURL = _arg1; | |
dispatchEvent(new Event(Event.CHANGE)); | |
} | |
public function get pURL():String{ | |
return (this._pURL); | |
} | |
public function set coords(_arg1:String):void{ | |
this._coords = _arg1; | |
dispatchEvent(new Event(Event.CHANGE)); | |
} | |
public function get coords():String{ | |
return (this._coords); | |
} | |
public function isDeleted():Boolean{ | |
return (this._deleted); | |
} | |
public function destroy():void{ | |
this.type = null; | |
this.pMc = null; | |
this._coords = null; | |
this._pText = null; | |
this._pURL = null; | |
} | |
public function toXMLString():String{ | |
var _local1 = ""; | |
_local1 = (_local1 + "<art>"); | |
_local1 = (_local1 + StringU.makeXMLNodeString("type", this.type)); | |
_local1 = (_local1 + StringU.makeXMLNodeString("coords", this.coords)); | |
_local1 = (_local1 + StringU.makeXMLNodeString("pText", this.pText)); | |
_local1 = (_local1 + StringU.makeXMLNodeString("pURL", this.pURL)); | |
_local1 = (_local1 + StringU.makeXMLNodeString("date", String(this.date))); | |
_local1 = (_local1 + "</art>"); | |
return (_local1); | |
} | |
public function setDeleted():void{ | |
this._deleted = true; | |
dispatchEvent(new Event(Event.CHANGE)); | |
} | |
public function setContentFromXMLString(_arg1:String):void{ | |
var _local2:XML = new XML(_arg1); | |
this.type = _local2.type.text(); | |
this.coords = _local2.coords.text(); | |
this.pText = _local2.pText.text(); | |
this.pURL = _local2.pURL.text(); | |
this.date = _local2.date.text(); | |
System.disposeXML(_local2); | |
} | |
} | |
}//package com.vpg.vpage.shell.tools | |
package com.vpg.vpage.shell.tools { | |
import flash.display.*; | |
public class OnPageNoteIcon extends MovieClip { | |
} | |
}//package com.vpg.vpage.shell.tools | |
package com.vpg.vpage.shell.tools { | |
import flash.events.*; | |
public interface IEditableLinkPopup extends IEventDispatcher { | |
function setIcon(_arg1:IconOnStage, _arg2:Boolean):void; | |
function destroy():void; | |
} | |
}//package com.vpg.vpage.shell.tools | |
package com.vpg.vpage.shell.tools { | |
import com.vpg.vpage.utils.cursor.*; | |
public class ShadeCursor extends BasicCursor { | |
} | |
}//package com.vpg.vpage.shell.tools | |
package com.vpg.vpage.shell.tools { | |
import com.vpg.vpage.utils.cursor.*; | |
public class LinkCursor extends BasicCursor { | |
} | |
}//package com.vpg.vpage.shell.tools | |
package com.vpg.vpage.shell.tools { | |
import flash.events.*; | |
import com.vpg.vpage.utils.*; | |
import com.vpg.vpage.shell.userdata.*; | |
import com.vpg.vpage.shell.datastore.*; | |
public class DrawingOverlayMgr extends EventDispatcher { | |
private var _layers:Array; | |
private var _ds:IUserDataStorage; | |
private var _currentMode:String; | |
private var _dragEnabled:Boolean; | |
private var _placementEnabled:Boolean; | |
private var _clickToOpenEnabled:Boolean; | |
private var _editEnabled:Boolean; | |
public function DrawingOverlayMgr(){ | |
this._layers = new Array(); | |
this._currentMode = null; | |
this._dragEnabled = false; | |
this._placementEnabled = false; | |
this._clickToOpenEnabled = false; | |
this._editEnabled = false; | |
} | |
public function destroy():void{ | |
this._layers = null; | |
this._ds = null; | |
this._currentMode = null; | |
} | |
public function setDataStore(_arg1:IUserDataStorage):void{ | |
this._ds = _arg1; | |
} | |
public function getCurrentMode():String{ | |
return (this._currentMode); | |
} | |
public function setMode(_arg1:String):void{ | |
this._currentMode = _arg1; | |
var _local2:int; | |
while (_local2 < this._layers.length) { | |
this._layers[_local2].setMode(_arg1); | |
_local2++; | |
}; | |
} | |
public function addLayer(_arg1:DrawingOverlay):void{ | |
_arg1.addEventListener(DrawingOverlay.OPEN_NOTE, this._openNoteEvent); | |
_arg1.addEventListener(DrawingOverlay.OPEN_LINK, this._openLinkEvent); | |
_arg1.addEventListener(DrawingOverlay.CONTENT_CHANGED, this._contentChangedEvent); | |
_arg1.addEventListener(DrawingOverlay.SHADE_CREATED, this._shadeCreatedEvent); | |
_arg1.addEventListener(DrawingOverlay.SHADE_SELECTED, this._shadeSelectedEvent); | |
this._layers.push(_arg1); | |
_arg1.setMode(this._currentMode); | |
if (this._dragEnabled){ | |
_arg1.enableDragging(); | |
} else { | |
_arg1.disableDragging(); | |
}; | |
if (this._placementEnabled){ | |
_arg1.enablePlacement(); | |
} else { | |
_arg1.disablePlacement(); | |
}; | |
if (this._clickToOpenEnabled){ | |
_arg1.enableClickToOpen(); | |
} else { | |
_arg1.disableClickToOpen(); | |
}; | |
if (this._editEnabled){ | |
_arg1.enableEditing(); | |
} else { | |
_arg1.disableEditing(); | |
}; | |
var _local2:UserDataRequest = new UserDataRequest(UserDataRequest.METHOD_GET, _arg1.getPage(), GenericDataStoreTypes.TYPE_NOTE); | |
_local2.addEventListener(UserDataRequestEvent.ERROR, this._getContentFail); | |
_local2.addEventListener(UserDataRequestEvent.SUCCESS, this._getContentSuccess); | |
this._ds.handleRequest(_local2); | |
} | |
public function removeAllLayers():void{ | |
var _local1:int; | |
while (_local1 < this._layers.length) { | |
this._layers[_local1].destroy(); | |
this._layers[_local1].removeEventListener(DrawingOverlay.OPEN_NOTE, this._openNoteEvent); | |
this._layers[_local1].removeEventListener(DrawingOverlay.OPEN_LINK, this._openLinkEvent); | |
this._layers[_local1].removeEventListener(DrawingOverlay.CONTENT_CHANGED, this._contentChangedEvent); | |
this._layers[_local1].removeEventListener(DrawingOverlay.SHADE_CREATED, this._shadeCreatedEvent); | |
this._layers[_local1].removeEventListener(DrawingOverlay.SHADE_SELECTED, this._shadeSelectedEvent); | |
_local1++; | |
}; | |
this._layers = new Array(); | |
} | |
public function refreshLayers():void{ | |
var _local2:DrawingOverlay; | |
var _local3:UserDataRequest; | |
var _local1:int; | |
while (_local1 < this._layers.length) { | |
_local2 = (this._layers[_local1] as DrawingOverlay); | |
_local3 = new UserDataRequest(UserDataRequest.METHOD_GET, _local2.getPage(), GenericDataStoreTypes.TYPE_NOTE); | |
_local3.addEventListener(UserDataRequestEvent.ERROR, this._getContentFail); | |
_local3.addEventListener(UserDataRequestEvent.SUCCESS, this._getContentSuccess); | |
this._ds.handleRequest(_local3); | |
_local1++; | |
}; | |
} | |
public function enableDragging():void{ | |
var _local2:DrawingOverlay; | |
var _local1:int; | |
while (_local1 < this._layers.length) { | |
_local2 = (this._layers[_local1] as DrawingOverlay); | |
_local2.enableDragging(); | |
_local1++; | |
}; | |
this._dragEnabled = true; | |
} | |
public function disableDragging():void{ | |
var _local2:DrawingOverlay; | |
var _local1:int; | |
while (_local1 < this._layers.length) { | |
_local2 = (this._layers[_local1] as DrawingOverlay); | |
_local2.disableDragging(); | |
_local1++; | |
}; | |
this._dragEnabled = false; | |
} | |
public function enablePlacement():void{ | |
var _local2:DrawingOverlay; | |
var _local1:int; | |
while (_local1 < this._layers.length) { | |
_local2 = (this._layers[_local1] as DrawingOverlay); | |
_local2.enablePlacement(); | |
_local1++; | |
}; | |
this._placementEnabled = true; | |
} | |
public function disablePlacement():void{ | |
var _local2:DrawingOverlay; | |
var _local1:int; | |
while (_local1 < this._layers.length) { | |
_local2 = (this._layers[_local1] as DrawingOverlay); | |
_local2.disablePlacement(); | |
_local1++; | |
}; | |
this._placementEnabled = false; | |
} | |
public function enableClickToOpen():void{ | |
var _local2:DrawingOverlay; | |
var _local1:int; | |
while (_local1 < this._layers.length) { | |
_local2 = (this._layers[_local1] as DrawingOverlay); | |
_local2.enableClickToOpen(); | |
_local1++; | |
}; | |
this._clickToOpenEnabled = true; | |
} | |
public function disableClickToOpen():void{ | |
var _local2:DrawingOverlay; | |
var _local1:int; | |
while (_local1 < this._layers.length) { | |
_local2 = (this._layers[_local1] as DrawingOverlay); | |
_local2.disableClickToOpen(); | |
_local1++; | |
}; | |
this._clickToOpenEnabled = false; | |
} | |
public function enableEditing():void{ | |
var _local2:DrawingOverlay; | |
var _local1:int; | |
while (_local1 < this._layers.length) { | |
_local2 = (this._layers[_local1] as DrawingOverlay); | |
_local2.enableEditing(); | |
_local1++; | |
}; | |
this._editEnabled = true; | |
} | |
public function disableEditing():void{ | |
var _local2:DrawingOverlay; | |
var _local1:int; | |
while (_local1 < this._layers.length) { | |
_local2 = (this._layers[_local1] as DrawingOverlay); | |
_local2.disableEditing(); | |
_local1++; | |
}; | |
this._editEnabled = false; | |
} | |
public function deleteUserMarks():void{ | |
var _local2:DrawingOverlay; | |
var _local1:int; | |
while (_local1 < this._layers.length) { | |
_local2 = (this._layers[_local1] as DrawingOverlay); | |
_local2.deleteUserMarks(); | |
_local1++; | |
}; | |
} | |
private function _openNoteEvent(_arg1:OpenItemEvent):void{ | |
dispatchEvent(_arg1); | |
} | |
private function _openLinkEvent(_arg1:OpenItemEvent):void{ | |
dispatchEvent(_arg1); | |
} | |
private function _contentChangedEvent(_arg1:Event):void{ | |
var _local2:DrawingOverlay = (_arg1.currentTarget as DrawingOverlay); | |
var _local3:String = _local2.getPage(); | |
var _local4:String = _local2.getSaveState(); | |
var _local5:UserDataRequest = new UserDataRequest(UserDataRequest.METHOD_SET, _local2.getPage(), GenericDataStoreTypes.TYPE_NOTE, _local4); | |
this._ds.handleRequest(_local5); | |
dispatchEvent(_arg1); | |
} | |
private function _shadeCreatedEvent(_arg1:Event):void{ | |
this.disablePlacement(); | |
} | |
private function _shadeSelectedEvent(_arg1:EventWithParam):void{ | |
dispatchEvent(_arg1); | |
} | |
private function _getContentSuccess(_arg1:UserDataRequestEvent):void{ | |
var _local4:DrawingOverlay; | |
var _local2:UserDataRequest = (_arg1.currentTarget as UserDataRequest); | |
var _local3:int; | |
while (_local3 < this._layers.length) { | |
_local4 = (this._layers[_local3] as DrawingOverlay); | |
if (_local4.getPage() == _local2.getPage()){ | |
_local4.initContent(_local2.getContent()); | |
return; | |
}; | |
_local3++; | |
}; | |
} | |
private function _getContentFail(_arg1:UserDataRequestEvent):void{ | |
this._getContentSuccess(_arg1); | |
} | |
} | |
}//package com.vpg.vpage.shell.tools | |
package com.vpg.vpage.shell.tools { | |
import flash.events.*; | |
public class OpenItemEvent extends Event { | |
public var isNew:Boolean; | |
public var icon:IconOnStage; | |
public function OpenItemEvent(_arg1:String, _arg2:IconOnStage, _arg3:Boolean, _arg4:Boolean=false, _arg5:Boolean=false){ | |
this.icon = _arg2; | |
this.isNew = _arg3; | |
super(_arg1, _arg4, _arg5); | |
} | |
override public function clone():Event{ | |
return (new OpenItemEvent(type, this.icon, this.isNew, bubbles, cancelable)); | |
} | |
override public function toString():String{ | |
return (formatToString("OpenItemEvent", "type", "icon", "isNew", "bubbles", "cancelable", "eventPhase")); | |
} | |
} | |
}//package com.vpg.vpage.shell.tools | |
package com.vpg.vpage.shell.tools { | |
import com.vpg.vpage.utils.cursor.*; | |
public class NoteCursor extends BasicCursor { | |
} | |
}//package com.vpg.vpage.shell.tools | |
package com.vpg.vpage.shell.tools { | |
import flash.display.*; | |
import flash.geom.*; | |
import com.vpg.vpage.shell.*; | |
import flash.events.*; | |
import com.vpg.vpage.utils.*; | |
import com.vpg.vpage.utils.cursor.*; | |
public class DrawingOverlay extends Sprite { | |
public static const MODE_NOTE:String = "note"; | |
public static const MODE_LINK:String = "link"; | |
public static const MODE_SHADE:String = "shade"; | |
public static const OPEN_LINK:String = "openLink"; | |
public static const OPEN_NOTE:String = "openNote"; | |
public static const CONTENT_CHANGED:String = "contentChanged"; | |
public static const SHADE_CREATED:String = "shadeCreated"; | |
public static const SHADE_SELECTED:String = "shadeSelected"; | |
private var _iconsOnStage:Array; | |
private var _cursor:BasicCursor; | |
private var _draggingEnabled:Boolean; | |
private var _placementEnabled:Boolean; | |
private var _clickEnabled:Boolean; | |
private var _editEnabled:Boolean; | |
private var _bg:MovieClip; | |
private var _iconBeingDragged:MovieClip; | |
private var _page:String; | |
private var _currentMode:String; | |
private var _newlyCreatedIcon:IconOnStage; | |
public function DrawingOverlay(){ | |
this._currentMode = MODE_NOTE; | |
} | |
public function deleteUserMarks():void{ | |
var _local1:IconOnStage; | |
while (this._iconsOnStage.length > 0) { | |
_local1 = this._iconsOnStage[0]; | |
_local1.setDeleted(); | |
}; | |
} | |
public function setMode(_arg1:String):void{ | |
this._currentMode = _arg1; | |
this._refreshCursorSettings(); | |
} | |
public function destroy():void{ | |
this.disableDragging(); | |
this.disableClickToOpen(); | |
this.disablePlacement(); | |
this.disableEditing(); | |
this._cursor.disable(); | |
this._cursor.destroy(); | |
this._removeIcons(); | |
this._iconsOnStage = null; | |
this._cursor = null; | |
this._bg = null; | |
this._iconBeingDragged = null; | |
this._page = null; | |
this._currentMode = null; | |
} | |
public function init(_arg1:String, _arg2:Number, _arg3:Number):void{ | |
this._page = _arg1; | |
this._iconsOnStage = new Array(); | |
this._bg = new Square(); | |
this._bg.width = _arg2; | |
this._bg.height = _arg3; | |
this._bg.alpha = 0; | |
addChild(this._bg); | |
this._refreshCursorSettings(); | |
this.disableDragging(); | |
this.disablePlacement(); | |
this.disableClickToOpen(); | |
this.disableEditing(); | |
} | |
public function initContent(_arg1:String):void{ | |
var _local5:XML; | |
var _local6:IconOnStage; | |
var _local7:String; | |
if (_arg1 == null){ | |
dispatchEvent(new Event(Event.COMPLETE)); | |
return; | |
}; | |
this._removeIcons(); | |
this._iconsOnStage = new Array(); | |
var _local2:XML = new XML(_arg1); | |
var _local3:XMLList = _local2.art; | |
var _local4:int; | |
while (_local4 < _local3.length()) { | |
_local5 = _local3[_local4]; | |
_local6 = new IconOnStage(); | |
_local7 = _local5.toString(); | |
_local6.setContentFromXMLString(_local7); | |
this._iconsOnStage.push(_local6); | |
if (_local6.type == MODE_SHADE){ | |
this._initShade(_local6); | |
} else { | |
this._initIcon(_local6); | |
}; | |
_local4++; | |
}; | |
this._newlyCreatedIcon = null; | |
dispatchEvent(new Event(Event.COMPLETE)); | |
} | |
public function getPage():String{ | |
return (this._page); | |
} | |
public function getSaveState():String{ | |
return (this.getIconsAsXMLString()); | |
} | |
public function enablePlacement():void{ | |
this._bg.addEventListener(MouseEvent.MOUSE_DOWN, this._pageClicked); | |
this._bg.visible = true; | |
this._cursor.enable(); | |
this._placementEnabled = true; | |
} | |
public function disablePlacement():void{ | |
this._bg.visible = false; | |
this._bg.removeEventListener(MouseEvent.MOUSE_DOWN, this._pageClicked); | |
this._cursor.disable(); | |
this._placementEnabled = false; | |
} | |
public function enableDragging():void{ | |
var _local1:IconOnStage; | |
var _local2:Number = 0; | |
while (_local2 < this._iconsOnStage.length) { | |
_local1 = this._iconsOnStage[_local2]; | |
if ((((_local1.type == MODE_LINK)) || ((_local1.type == MODE_NOTE)))){ | |
this._enableIconDrag(_local1.pMc); | |
}; | |
_local2++; | |
}; | |
this._draggingEnabled = true; | |
} | |
public function disableDragging():void{ | |
var _local1:IconOnStage; | |
var _local2:Number = 0; | |
while (_local2 < this._iconsOnStage.length) { | |
_local1 = this._iconsOnStage[_local2]; | |
if ((((_local1.type == MODE_LINK)) || ((_local1.type == MODE_NOTE)))){ | |
this._disableIconDrag(_local1.pMc); | |
}; | |
_local2++; | |
}; | |
this._draggingEnabled = false; | |
} | |
public function enableClickToOpen():void{ | |
var _local1:IconOnStage; | |
var _local2:Number = 0; | |
while (_local2 < this._iconsOnStage.length) { | |
_local1 = this._iconsOnStage[_local2]; | |
if ((((_local1.type == MODE_LINK)) || ((_local1.type == MODE_NOTE)))){ | |
this._enableIconClick(_local1.pMc); | |
}; | |
_local2++; | |
}; | |
this._clickEnabled = true; | |
} | |
public function disableClickToOpen():void{ | |
var _local1:IconOnStage; | |
var _local2:Number = 0; | |
while (_local2 < this._iconsOnStage.length) { | |
_local1 = this._iconsOnStage[_local2]; | |
if ((((_local1.type == MODE_LINK)) || ((_local1.type == MODE_NOTE)))){ | |
this._disableIconClick(_local1.pMc); | |
}; | |
_local2++; | |
}; | |
this._clickEnabled = false; | |
} | |
public function enableEditing():void{ | |
var _local1:IconOnStage; | |
var _local2:Boolean; | |
var _local3:Number = 0; | |
while (_local3 < this._iconsOnStage.length) { | |
_local1 = this._iconsOnStage[_local3]; | |
if (_local1.type == MODE_SHADE){ | |
_local1.pMc.turnEditingOn(); | |
if (!_local2){ | |
_local1.pMc.select(); | |
_local2 = true; | |
}; | |
}; | |
_local3++; | |
}; | |
this._editEnabled = true; | |
} | |
public function disableEditing():void{ | |
var _local1:IconOnStage; | |
var _local2:Number = 0; | |
while (_local2 < this._iconsOnStage.length) { | |
_local1 = this._iconsOnStage[_local2]; | |
if (_local1.type == MODE_SHADE){ | |
_local1.pMc.turnEditingOff(); | |
}; | |
_local2++; | |
}; | |
this._editEnabled = false; | |
} | |
public function getIconsAsXMLString():String{ | |
if (this._iconsOnStage == null){ | |
return (""); | |
}; | |
var _local1 = "<artobjs>"; | |
var _local2:int; | |
while (_local2 < this._iconsOnStage.length) { | |
_local1 = (_local1 + this._iconsOnStage[_local2].toXMLString()); | |
_local2++; | |
}; | |
_local1 = (_local1 + "</artobjs>"); | |
return (_local1); | |
} | |
private function _disableIconDrag(_arg1:MovieClip):void{ | |
if (!this._clickEnabled){ | |
_arg1.buttonMode = false; | |
_arg1.useHandCursor = false; | |
}; | |
_arg1.removeEventListener(MouseEvent.MOUSE_DOWN, this._beginIconDrag); | |
} | |
private function _enableIconDrag(_arg1:MovieClip):void{ | |
_arg1.mouseChildren = false; | |
_arg1.buttonMode = true; | |
_arg1.useHandCursor = true; | |
_arg1.addEventListener(MouseEvent.MOUSE_DOWN, this._beginIconDrag); | |
} | |
private function _disableIconClick(_arg1:MovieClip):void{ | |
if (!this._draggingEnabled){ | |
_arg1.buttonMode = false; | |
_arg1.useHandCursor = false; | |
}; | |
_arg1.removeEventListener(MouseEvent.CLICK, this._iconClicked); | |
} | |
private function _removeIcons():void{ | |
var _local2:IconOnStage; | |
if (this._iconsOnStage == null){ | |
return; | |
}; | |
var _local1:int; | |
while (_local1 < this._iconsOnStage.length) { | |
_local2 = this._iconsOnStage[_local1]; | |
ToolTipBuilder.unRegisterButton(_local2.pMc); | |
removeChild(_local2.pMc); | |
_local2.removeEventListener(Event.CHANGE, this._iconContentChanged); | |
_local2.removeEventListener(ShadeBox.SELECTED, this._shadeSelected); | |
_local2.destroy(); | |
_local1++; | |
}; | |
} | |
private function _enableIconClick(_arg1:MovieClip):void{ | |
_arg1.mouseChildren = false; | |
_arg1.buttonMode = true; | |
_arg1.useHandCursor = true; | |
_arg1.addEventListener(MouseEvent.CLICK, this._iconClicked); | |
} | |
private function _iconClicked(_arg1:Event):void{ | |
var _local2:MovieClip = (_arg1.currentTarget as MovieClip); | |
var _local3:IconOnStage = this._getIconFromBtn(_local2); | |
if (_local3.type == MODE_NOTE){ | |
dispatchEvent(new OpenItemEvent(OPEN_NOTE, _local3, false)); | |
} else { | |
if (_local3.type == MODE_LINK){ | |
dispatchEvent(new OpenItemEvent(OPEN_LINK, _local3, false)); | |
}; | |
}; | |
} | |
private function _beginIconDrag(_arg1:Event):void{ | |
var _local2:MovieClip = (_arg1.currentTarget as MovieClip); | |
this._iconBeingDragged = _local2; | |
_local2.stage.addEventListener(MouseEvent.MOUSE_UP, this._endIconDrag); | |
var _local3:Rectangle = new Rectangle(0, 0, (this._bg.width - _local2.width), (this._bg.height - _local2.height)); | |
_local2.startDrag(false, _local3); | |
this._cursor.disable(); | |
} | |
private function _endIconDrag(_arg1:Event):void{ | |
var _local2:MovieClip = this._iconBeingDragged; | |
_local2.stopDrag(); | |
var _local3:String = ((_local2.x + ",") + _local2.y); | |
var _local4:IconOnStage = this._getIconFromBtn(_local2); | |
_local4.coords = _local3; | |
_local2.stage.removeEventListener(MouseEvent.MOUSE_UP, this._endIconDrag); | |
this._cursor.enable(); | |
this._iconBeingDragged = null; | |
} | |
private function _pageClicked(_arg1:Event):void{ | |
if (this._currentMode == MODE_NOTE){ | |
this._pageClickedNote(); | |
} else { | |
if (this._currentMode == MODE_LINK){ | |
this._pageClickedLink(); | |
} else { | |
if (this._currentMode == MODE_SHADE){ | |
this._pageClickedShade(); | |
}; | |
}; | |
}; | |
} | |
private function _checkLastCreatedIcon():void{ | |
if (this._newlyCreatedIcon){ | |
this._newlyCreatedIcon.setDeleted(); | |
this._newlyCreatedIcon = null; | |
}; | |
} | |
private function _pageClickedNote():void{ | |
this._checkLastCreatedIcon(); | |
var _local1:Number = mouseX; | |
var _local2:Number = mouseY; | |
var _local3:OnPageNoteIcon = new OnPageNoteIcon(); | |
var _local4:IconOnStage = new IconOnStage(); | |
_local4.type = this._currentMode; | |
_local4.coords = ((_local1 + ",") + _local2); | |
this._initIcon(_local4); | |
this._iconsOnStage.push(_local4); | |
if (this._draggingEnabled){ | |
this._enableIconDrag(_local3); | |
}; | |
if (this._clickEnabled){ | |
this._enableIconClick(_local3); | |
}; | |
dispatchEvent(new OpenItemEvent(OPEN_NOTE, _local4, true)); | |
dispatchEvent(new Event(CONTENT_CHANGED)); | |
} | |
private function _pageClickedLink():void{ | |
this._checkLastCreatedIcon(); | |
var _local1:Number = mouseX; | |
var _local2:Number = mouseY; | |
var _local3:OnPageLinkIcon = new OnPageLinkIcon(); | |
var _local4:IconOnStage = new IconOnStage(); | |
_local4.type = this._currentMode; | |
_local4.coords = ((_local1 + ",") + _local2); | |
this._initIcon(_local4); | |
this._iconsOnStage.push(_local4); | |
if (this._draggingEnabled){ | |
this._enableIconDrag(_local3); | |
}; | |
if (this._clickEnabled){ | |
this._enableIconClick(_local3); | |
}; | |
dispatchEvent(new OpenItemEvent(OPEN_LINK, _local4, true)); | |
dispatchEvent(new Event(CONTENT_CHANGED)); | |
} | |
private function _pageClickedShade():void{ | |
var _local1:Number = mouseX; | |
var _local2:Number = mouseY; | |
var _local3:ShadeBox = new ShadeBox(this._bg.getBounds(this)); | |
_local3.x = (_local1 - (_local3.getWidth() / 2)); | |
_local3.y = (_local2 - (_local3.getHeight() / 2)); | |
_local3.x = Math.max(0, _local3.x); | |
_local3.x = Math.min((this._bg.width - _local3.getWidth()), _local3.x); | |
_local3.y = Math.max(0, _local3.y); | |
_local3.y = Math.min((this._bg.height - _local3.getHeight()), _local3.y); | |
var _local4:IconOnStage = new IconOnStage(); | |
_local4.type = this._currentMode; | |
_local4.coords = ((((((_local3.x + ",") + _local3.y) + ",") + _local3.getWidth()) + ",") + _local3.getHeight()); | |
this._iconsOnStage.push(_local4); | |
this._initShade(_local4); | |
_local4.pMc.select(); | |
dispatchEvent(new Event(SHADE_CREATED)); | |
dispatchEvent(new Event(CONTENT_CHANGED)); | |
} | |
private function _initShade(_arg1:IconOnStage):void{ | |
var _local2:ShadeBox = new ShadeBox(this._bg.getBounds(this)); | |
var _local3:Array = _arg1.coords.split(","); | |
_arg1.pMc = _local2; | |
_arg1.pMc.x = _local3[0]; | |
_arg1.pMc.y = _local3[1]; | |
_local2.setSize(_local3[2], _local3[3]); | |
_local2.setIconInstance(_arg1); | |
if (this._editEnabled){ | |
_local2.turnEditingOn(); | |
} else { | |
_local2.turnEditingOff(); | |
}; | |
_local2.addEventListener(ShadeBox.SELECTED, this._shadeSelected); | |
addChild(_local2); | |
_arg1.removeEventListener(Event.CHANGE, this._iconContentChanged); | |
_arg1.addEventListener(Event.CHANGE, this._iconContentChanged); | |
} | |
private function _shadeSelected(_arg1:Event):void{ | |
var _local3:IconOnStage; | |
var _local2:ShadeBox = (_arg1.currentTarget as ShadeBox); | |
var _local4:Number = 0; | |
while (_local4 < this._iconsOnStage.length) { | |
_local3 = this._iconsOnStage[_local4]; | |
if (_local3.type == MODE_SHADE){ | |
if (_local3.pMc != _local2){ | |
_local3.pMc.deselect(); | |
} else { | |
dispatchEvent(new EventWithParam(SHADE_SELECTED, _local3)); | |
}; | |
}; | |
_local4++; | |
}; | |
} | |
private function _getIconFromBtn(_arg1:MovieClip):IconOnStage{ | |
var _local2:int; | |
while (_local2 < this._iconsOnStage.length) { | |
if (this._iconsOnStage[_local2].pMc == _arg1){ | |
return (this._iconsOnStage[_local2]); | |
}; | |
_local2++; | |
}; | |
return (null); | |
} | |
private function _iconContentChanged(_arg1:Event):void{ | |
var _local3:int; | |
var _local2:IconOnStage = (_arg1.currentTarget as IconOnStage); | |
if (_local2 == this._newlyCreatedIcon){ | |
this._newlyCreatedIcon = null; | |
} else { | |
if (this._newlyCreatedIcon != null){ | |
this._newlyCreatedIcon.setDeleted(); | |
}; | |
}; | |
if (_local2.isDeleted()){ | |
_local3 = this._iconsOnStage.indexOf(_local2); | |
removeChild(_local2.pMc); | |
ToolTipBuilder.unRegisterButton(_local2.pMc); | |
this._iconsOnStage.splice(_local3, 1); | |
if (_local2.type == MODE_SHADE){ | |
dispatchEvent(new EventWithParam(SHADE_SELECTED, null)); | |
}; | |
_local2.removeEventListener(Event.CHANGE, this._iconContentChanged); | |
} else { | |
ToolTipBuilder.changeToolTip(_local2.pMc, _local2.pText); | |
}; | |
dispatchEvent(new Event(CONTENT_CHANGED)); | |
} | |
private function _initIcon(_arg1:IconOnStage):void{ | |
var _local2:MovieClip = new OnPageNoteIcon(); | |
if (_arg1.type == MODE_LINK){ | |
_local2 = new OnPageLinkIcon(); | |
}; | |
_arg1.pMc = _local2; | |
_arg1.pMc.x = _arg1.coords.split(",")[0]; | |
_arg1.pMc.y = _arg1.coords.split(",")[1]; | |
addChild(_local2); | |
ToolTipBuilder.unRegisterButton(_local2); | |
ToolTipBuilder.registerButton(_local2, _arg1.pText); | |
if (this._draggingEnabled){ | |
this._enableIconDrag(_local2); | |
}; | |
if (this._clickEnabled){ | |
this._enableIconClick(_local2); | |
}; | |
this._newlyCreatedIcon = _arg1; | |
_arg1.removeEventListener(Event.CHANGE, this._iconContentChanged); | |
_arg1.addEventListener(Event.CHANGE, this._iconContentChanged); | |
} | |
private function _refreshCursorSettings():void{ | |
var _local1:Boolean; | |
if (this._cursor){ | |
_local1 = this._cursor.isEnabled(); | |
this._cursor.disable(); | |
}; | |
if (this._currentMode == MODE_NOTE){ | |
this._cursor = new NoteCursor(); | |
} else { | |
if (this._currentMode == MODE_LINK){ | |
this._cursor = new LinkCursor(); | |
} else { | |
if (this._currentMode == MODE_SHADE){ | |
this._cursor = new ShadeCursor(); | |
}; | |
}; | |
}; | |
addChild(this._cursor); | |
if (this._bg){ | |
this._cursor.setActiveZone(this._bg); | |
}; | |
if (_local1){ | |
this._cursor.enable(); | |
} else { | |
this._cursor.disable(); | |
}; | |
} | |
} | |
}//package com.vpg.vpage.shell.tools | |
package com.vpg.vpage.shell.tools { | |
import flash.display.*; | |
import flash.geom.*; | |
import flash.events.*; | |
import com.vpg.vpage.utils.*; | |
import fl.transitions.*; | |
import fl.transitions.easing.*; | |
public class ShadeBox extends MovieClip { | |
public static const SELECTED:String = "selected"; | |
public var outer_border:MovieClip; | |
public var inner_border:MovieClip; | |
public var bg:MovieClip; | |
public var my_mask:MovieClip; | |
public var hotspot:MovieClip; | |
public var resizer_top_left:MovieClip; | |
public var resizer_top:MovieClip; | |
public var resizer_top_right:MovieClip; | |
public var resizer_right:MovieClip; | |
public var resizer_bottom_right:MovieClip; | |
public var resizer_bottom:MovieClip; | |
public var resizer_bottom_left:MovieClip; | |
public var resizer_left:MovieClip; | |
private var _resizers:Array; | |
private var _icon:IconOnStage; | |
private var _maskTween:Tween; | |
private var _currentResizer:MovieClip; | |
private var _bounds:Rectangle; | |
public function ShadeBox(_arg1:Rectangle){ | |
this._bounds = _arg1; | |
this.select(); | |
this.turnEditingOn(); | |
mouseEnabled = false; | |
} | |
public function destroy():void{ | |
this._cleanEvents(); | |
this._icon = null; | |
this._maskTween = null; | |
this._resizers = null; | |
} | |
public function turnEditingOff():void{ | |
this._cleanEvents(); | |
if (this.currentFrameLabel != "default"){ | |
gotoAndStop("default"); | |
this.my_mask.y = this.outer_border.y; | |
}; | |
this.bg.alpha = 1; | |
this.inner_border.visible = false; | |
this.hotspot.addEventListener(MouseEvent.CLICK, this._hotspotClickedNoEdit); | |
} | |
public function turnEditingOn():void{ | |
this._cleanEvents(); | |
this._showBg(); | |
DisplayU.buttonify(this.hotspot); | |
this.hotspot.addEventListener(MouseEvent.MOUSE_DOWN, this._hotspotPressedEdit); | |
} | |
public function select():void{ | |
gotoAndStop("selected"); | |
this.inner_border.visible = true; | |
this.resizer_top.x = (this.resizer_bottom.x = (this.outer_border.x + (this.outer_border.width / 2))); | |
this.resizer_top_left.x = (this.resizer_left.x = (this.resizer_bottom_left.x = this.outer_border.x)); | |
this.resizer_top_right.x = (this.resizer_right.x = (this.resizer_bottom_right.x = (this.outer_border.x + this.outer_border.width))); | |
this.resizer_left.y = (this.resizer_right.y = (this.outer_border.y + (this.outer_border.height / 2))); | |
this.resizer_top_left.y = (this.resizer_top.y = (this.resizer_top_right.y = this.outer_border.y)); | |
this.resizer_bottom_left.y = (this.resizer_bottom.y = (this.resizer_bottom_right.y = (this.outer_border.y + this.outer_border.height))); | |
this.bg.alpha = 0.5; | |
this._setupResizing(); | |
dispatchEvent(new Event(SELECTED)); | |
} | |
public function deselect():void{ | |
gotoAndStop("default"); | |
this.bg.alpha = 1; | |
this.inner_border.visible = false; | |
} | |
public function getWidth():Number{ | |
return (this.outer_border.width); | |
} | |
public function getHeight():Number{ | |
return (this.outer_border.height); | |
} | |
public function setSize(_arg1:Number, _arg2:Number):void{ | |
this.outer_border.width = (this.my_mask.width = (this.hotspot.width = _arg1)); | |
this.outer_border.height = (this.my_mask.height = (this.hotspot.height = _arg2)); | |
this.inner_border.width = (this.outer_border.width - 2); | |
this.inner_border.height = (this.outer_border.height - 2); | |
this.bg.width = (this.inner_border.width - 2); | |
this.bg.height = (this.inner_border.height - 2); | |
this.resizer_top.x = (this.resizer_bottom.x = (this.outer_border.x + (this.outer_border.width / 2))); | |
this.resizer_top_left.x = (this.resizer_left.x = (this.resizer_bottom_left.x = this.outer_border.x)); | |
this.resizer_top_right.x = (this.resizer_right.x = (this.resizer_bottom_right.x = (this.outer_border.x + this.outer_border.width))); | |
this.resizer_left.y = (this.resizer_right.y = (this.outer_border.y + (this.outer_border.height / 2))); | |
this.resizer_top_left.y = (this.resizer_top.y = (this.resizer_top_right.y = this.outer_border.y)); | |
this.resizer_bottom_left.y = (this.resizer_bottom.y = (this.resizer_bottom_right.y = (this.outer_border.y + this.outer_border.height))); | |
} | |
public function setIconInstance(_arg1:IconOnStage):void{ | |
this._icon = _arg1; | |
} | |
private function _cleanEvents():void{ | |
var _local1:int; | |
var _local2:MovieClip; | |
this.hotspot.removeEventListener(MouseEvent.CLICK, this._hotspotClickedNoEdit); | |
this.hotspot.removeEventListener(MouseEvent.MOUSE_DOWN, this._hotspotPressedEdit); | |
if (this._resizers){ | |
_local1 = 0; | |
while (_local1 < this._resizers.length) { | |
_local2 = this._resizers[_local1]; | |
_local2.removeEventListener(MouseEvent.MOUSE_DOWN, this._resizerPressEvent); | |
_local1++; | |
}; | |
}; | |
} | |
private function _hotspotClickedNoEdit(_arg1:Event):void{ | |
if (this.my_mask.y == this.outer_border.y){ | |
this._hideBg(); | |
} else { | |
this._showBg(); | |
}; | |
} | |
private function _hotspotPressedEdit(_arg1:Event):void{ | |
var _local2:Rectangle = new Rectangle(0, 0, (this._bounds.width - this.hotspot.width), (this._bounds.height - this.hotspot.height)); | |
startDrag(false, _local2); | |
this.select(); | |
stage.addEventListener(MouseEvent.MOUSE_UP, this._hotspotReleasedEdit); | |
} | |
private function _hotspotReleasedEdit(_arg1:Event):void{ | |
stage.removeEventListener(MouseEvent.MOUSE_UP, this._hotspotReleasedEdit); | |
stopDrag(); | |
} | |
private function _showBg():void{ | |
if (this._maskTween){ | |
this._maskTween.stop(); | |
}; | |
this.my_mask.y = this.outer_border.y; | |
} | |
private function _hideBg():void{ | |
if (this._maskTween){ | |
this._maskTween.stop(); | |
}; | |
this._maskTween = new Tween(this.my_mask, "y", Regular.easeOut, this.my_mask.y, (this.outer_border.y - this.my_mask.height), 0.3, true); | |
} | |
private function _setupResizing():void{ | |
var _local2:MovieClip; | |
this._resizers = new Array(this.resizer_top_left, this.resizer_top, this.resizer_top_right, this.resizer_right, this.resizer_bottom_right, this.resizer_bottom, this.resizer_bottom_left, this.resizer_left); | |
var _local1:int; | |
while (_local1 < this._resizers.length) { | |
_local2 = this._resizers[_local1]; | |
DisplayU.buttonify(_local2); | |
_local2.addEventListener(MouseEvent.MOUSE_DOWN, this._resizerPressEvent); | |
_local1++; | |
}; | |
} | |
private function _resizerPressEvent(_arg1:Event):void{ | |
var _local2:MovieClip = (_arg1.currentTarget as MovieClip); | |
var _local3:Boolean; | |
var _local4:Boolean; | |
var _local5:Boolean; | |
var _local6:Boolean; | |
if (_local2 == this.resizer_top_left){ | |
_local3 = true; | |
_local5 = true; | |
} else { | |
if (_local2 == this.resizer_top_right){ | |
_local4 = true; | |
_local5 = true; | |
} else { | |
if (_local2 == this.resizer_top){ | |
_local5 = true; | |
} else { | |
if (_local2 == this.resizer_left){ | |
_local3 = true; | |
} else { | |
if (_local2 == this.resizer_right){ | |
_local4 = true; | |
} else { | |
if (_local2 == this.resizer_bottom_left){ | |
_local6 = true; | |
_local3 = true; | |
} else { | |
if (_local2 == this.resizer_bottom_right){ | |
_local6 = true; | |
_local4 = true; | |
} else { | |
if (_local2 == this.resizer_bottom){ | |
_local6 = true; | |
}; | |
}; | |
}; | |
}; | |
}; | |
}; | |
}; | |
}; | |
this._resizerPress(_local2, _local3, _local5, _local4, _local6); | |
} | |
private function _resizerPress(_arg1:MovieClip, _arg2:Boolean, _arg3:Boolean, _arg4:Boolean, _arg5:Boolean):void{ | |
this.select(); | |
var _local6:Number = _arg1.x; | |
var _local7:Number = _arg1.y; | |
var _local8:Number = _arg1.x; | |
var _local9:Number = _arg1.y; | |
if (_arg2){ | |
_local6 = (0 - x); | |
_local8 = (this.resizer_right.x - 10); | |
} else { | |
if (_arg4){ | |
_local6 = (this.resizer_left.x + 10); | |
_local8 = (this._bounds.width - x); | |
}; | |
}; | |
if (_arg3){ | |
_local7 = (0 - y); | |
_local9 = (this.resizer_bottom.y - 10); | |
} else { | |
if (_arg5){ | |
_local7 = (this.resizer_top.y + 10); | |
_local9 = (this._bounds.height - y); | |
}; | |
}; | |
var _local10:Rectangle = new Rectangle(_local6, _local7, (_local8 - _local6), (_local9 - _local7)); | |
_arg1.startDrag(false, _local10); | |
_arg1.addEventListener(Event.ENTER_FRAME, this._resizeUpdateEvent); | |
this._currentResizer = _arg1; | |
_arg1.stage.addEventListener(MouseEvent.MOUSE_UP, this._resizerRelease); | |
} | |
private function _resizeUpdateEvent(_arg1:Event):void{ | |
var _local2:MovieClip = (_arg1.currentTarget as MovieClip); | |
var _local3:Boolean; | |
var _local4:Boolean; | |
var _local5:Boolean; | |
var _local6:Boolean; | |
if (_local2 == this.resizer_top_left){ | |
_local3 = true; | |
_local5 = true; | |
} else { | |
if (_local2 == this.resizer_top_right){ | |
_local4 = true; | |
_local5 = true; | |
} else { | |
if (_local2 == this.resizer_top){ | |
_local5 = true; | |
} else { | |
if (_local2 == this.resizer_left){ | |
_local3 = true; | |
} else { | |
if (_local2 == this.resizer_right){ | |
_local4 = true; | |
} else { | |
if (_local2 == this.resizer_bottom_left){ | |
_local6 = true; | |
_local3 = true; | |
} else { | |
if (_local2 == this.resizer_bottom_right){ | |
_local6 = true; | |
_local4 = true; | |
} else { | |
if (_local2 == this.resizer_bottom){ | |
_local6 = true; | |
}; | |
}; | |
}; | |
}; | |
}; | |
}; | |
}; | |
}; | |
this._doResize(_local3, _local5, _local4, _local6); | |
} | |
private function _doResize(_arg1:Boolean, _arg2:Boolean, _arg3:Boolean, _arg4:Boolean):void{ | |
var _local5:MovieClip = this.resizer_left; | |
var _local6:MovieClip = this.resizer_top; | |
var _local7:MovieClip = this.resizer_right; | |
var _local8:MovieClip = this.resizer_bottom; | |
if (((_arg2) && (_arg1))){ | |
_local5 = this.resizer_top_left; | |
_local6 = this.resizer_top_left; | |
} else { | |
if (((_arg2) && (_arg3))){ | |
_local6 = this.resizer_top_right; | |
_local7 = this.resizer_top_right; | |
} else { | |
if (((_arg4) && (_arg3))){ | |
_local7 = this.resizer_bottom_right; | |
_local8 = this.resizer_bottom_right; | |
} else { | |
if (((_arg4) && (_arg1))){ | |
_local8 = this.resizer_bottom_left; | |
_local5 = this.resizer_bottom_left; | |
}; | |
}; | |
}; | |
}; | |
this.outer_border.x = (this.my_mask.x = (this.hotspot.x = _local5.x)); | |
this.outer_border.y = (this.my_mask.y = (this.hotspot.y = _local6.y)); | |
this.outer_border.width = (this.my_mask.width = (this.hotspot.width = (_local7.x - _local5.x))); | |
this.outer_border.height = (this.my_mask.height = (this.hotspot.height = (_local8.y - _local6.y))); | |
this.inner_border.x = (this.outer_border.x + 1); | |
this.inner_border.y = (this.outer_border.y + 1); | |
this.inner_border.width = (this.outer_border.width - 2); | |
this.inner_border.height = (this.outer_border.height - 2); | |
this.bg.x = (this.inner_border.x + 1); | |
this.bg.y = (this.inner_border.y + 1); | |
this.bg.width = (this.inner_border.width - 2); | |
this.bg.height = (this.inner_border.height - 2); | |
this.resizer_top.x = (this.resizer_bottom.x = (_local5.x + ((_local7.x - _local5.x) / 2))); | |
this.resizer_top_left.x = (this.resizer_left.x = (this.resizer_bottom_left.x = _local5.x)); | |
this.resizer_top_right.x = (this.resizer_right.x = (this.resizer_bottom_right.x = _local7.x)); | |
this.resizer_left.y = (this.resizer_right.y = (_local6.y + ((_local8.y - _local6.y) / 2))); | |
this.resizer_top_left.y = (this.resizer_top.y = (this.resizer_top_right.y = _local6.y)); | |
this.resizer_bottom_left.y = (this.resizer_bottom.y = (this.resizer_bottom_right.y = _local8.y)); | |
} | |
private function _adjust():void{ | |
var _local1:Number = this.outer_border.x; | |
var _local2:Number = this.outer_border.y; | |
this.outer_border.x = (this.outer_border.x - _local1); | |
this.outer_border.y = (this.outer_border.y - _local2); | |
this.my_mask.x = (this.my_mask.x - _local1); | |
this.my_mask.y = (this.my_mask.y - _local2); | |
this.hotspot.x = (this.hotspot.x - _local1); | |
this.hotspot.y = (this.hotspot.y - _local2); | |
this.inner_border.x = (this.inner_border.x - _local1); | |
this.inner_border.y = (this.inner_border.y - _local2); | |
this.bg.x = (this.bg.x - _local1); | |
this.bg.y = (this.bg.y - _local2); | |
this.resizer_top.x = (this.resizer_top.x - _local1); | |
this.resizer_top.y = (this.resizer_top.y - _local2); | |
this.resizer_bottom.x = (this.resizer_bottom.x - _local1); | |
this.resizer_bottom.y = (this.resizer_bottom.y - _local2); | |
this.resizer_top_left.x = (this.resizer_top_left.x - _local1); | |
this.resizer_top_left.y = (this.resizer_top_left.y - _local2); | |
this.resizer_left.x = (this.resizer_left.x - _local1); | |
this.resizer_left.y = (this.resizer_left.y - _local2); | |
this.resizer_bottom_left.x = (this.resizer_bottom_left.x - _local1); | |
this.resizer_bottom_left.y = (this.resizer_bottom_left.y - _local2); | |
this.resizer_top_right.x = (this.resizer_top_right.x - _local1); | |
this.resizer_top_right.y = (this.resizer_top_right.y - _local2); | |
this.resizer_right.x = (this.resizer_right.x - _local1); | |
this.resizer_right.y = (this.resizer_right.y - _local2); | |
this.resizer_bottom_right.x = (this.resizer_bottom_right.x - _local1); | |
this.resizer_bottom_right.y = (this.resizer_bottom_right.y - _local2); | |
x = (x + _local1); | |
y = (y + _local2); | |
} | |
private function _resizerRelease(_arg1:Event):void{ | |
var _local2:MovieClip = this._currentResizer; | |
_local2.stopDrag(); | |
_local2.stage.removeEventListener(MouseEvent.MOUSE_UP, this._resizerRelease); | |
_local2.removeEventListener(Event.ENTER_FRAME, this._resizeUpdateEvent); | |
this._adjust(); | |
this._icon.coords = ((((((x + ",") + y) + ",") + this.getWidth()) + ",") + this.getHeight()); | |
} | |
} | |
}//package com.vpg.vpage.shell.tools | |
package com.vpg.vpage.shell.tools { | |
import flash.display.*; | |
public class OnPageLinkIcon extends MovieClip { | |
} | |
}//package com.vpg.vpage.shell.tools | |
package com.vpg.vpage.shell.tools { | |
import flash.events.*; | |
public class LinkEvent extends Event { | |
public static const LAUNCH:String = "launchLink"; | |
public var url:String; | |
public function LinkEvent(_arg1:String, _arg2:String, _arg3:Boolean=false, _arg4:Boolean=false){ | |
this.url = _arg2; | |
super(_arg1, _arg3, _arg4); | |
} | |
override public function clone():Event{ | |
return (new LinkEvent(type, this.url, bubbles, cancelable)); | |
} | |
override public function toString():String{ | |
return (formatToString("EventWithParam", "type", "url", "bubbles", "cancelable", "eventPhase")); | |
} | |
} | |
}//package com.vpg.vpage.shell.tools | |
package com.vpg.vpage.shell.tools { | |
import flash.display.*; | |
import flash.geom.*; | |
import flash.events.*; | |
import flash.text.*; | |
import com.vpg.vpage.utils.*; | |
import com.vpg.vpage.components.textfieldscrollbar.*; | |
public class EditableNotePopup extends MovieClip implements IEditableNotePopup { | |
public var content_area:MovieClip; | |
public var title_tf:TextField; | |
public var tf:TextField; | |
public var delete_btn:MovieClip; | |
public var save_btn:MovieClip; | |
public var cancel_btn:MovieClip; | |
public var close_btn:MovieClip; | |
public var drag_bar:MovieClip; | |
public var print_btn:MovieClip; | |
public var sb_area:MovieClip; | |
private var _icon:IconOnStage; | |
private var _defaultText:String; | |
private var _lastW:Number; | |
private var _lastH:Number; | |
private var _sb:TextFieldScrollBar; | |
public function EditableNotePopup(){ | |
DisplayU.buttonify(this.save_btn); | |
DisplayU.buttonify(this.cancel_btn); | |
DisplayU.buttonify(this.close_btn); | |
DisplayU.buttonify(this.drag_bar); | |
DisplayU.buttonify(this.print_btn); | |
this.save_btn.addEventListener(MouseEvent.CLICK, this._doSave); | |
if (this.print_btn){ | |
this.print_btn.addEventListener(MouseEvent.CLICK, this._doPrint); | |
}; | |
this._defaultText = this.tf.text; | |
if (this._defaultText.length <= 1){ | |
this.tf.text = ""; | |
}; | |
SelectOnFocusField.registerField(this.tf, this._defaultText); | |
ChangeColorOnEditField.registerField(this.tf, this._defaultText, 0); | |
this.drag_bar.addEventListener(MouseEvent.MOUSE_DOWN, this._beginDragging); | |
if (this.sb_area){ | |
this._sb = new TextFieldScrollBar(this.tf); | |
this._sb.x = this.sb_area.x; | |
this._sb.y = this.sb_area.y; | |
this._sb.setSize(this.sb_area.height); | |
addChild(this._sb); | |
}; | |
} | |
public function setTitleText(_arg1:String):void{ | |
if (this.title_tf){ | |
this.title_tf.text = _arg1; | |
}; | |
} | |
public function setButtonText(_arg1:String, _arg2:String, _arg3:String):void{ | |
if (((this.save_btn) && (this.save_btn.tf))){ | |
this.save_btn.tf.text = _arg1; | |
}; | |
if (((this.delete_btn) && (this.delete_btn.tf))){ | |
this.delete_btn.tf.text = _arg2; | |
}; | |
if (((this.print_btn) && (this.print_btn.tf))){ | |
this.print_btn.tf.text = _arg3; | |
}; | |
} | |
public function setScreenSize(_arg1:Number, _arg2:Number):void{ | |
if ((x + width) > _arg1){ | |
x = (_arg1 - width); | |
}; | |
if ((y + height) > _arg2){ | |
y = (_arg2 - height); | |
}; | |
this._lastW = _arg1; | |
this._lastH = _arg2; | |
} | |
public function destroy():void{ | |
this.drag_bar.removeEventListener(MouseEvent.MOUSE_DOWN, this._beginDragging); | |
this.save_btn.removeEventListener(MouseEvent.CLICK, this._doSave); | |
if (this.close_btn){ | |
this.close_btn.removeEventListener(MouseEvent.CLICK, this._doDelete); | |
this.close_btn.removeEventListener(MouseEvent.CLICK, this._doCancel); | |
}; | |
this.delete_btn.removeEventListener(MouseEvent.CLICK, this._doDelete); | |
if (this.cancel_btn){ | |
this.cancel_btn.removeEventListener(MouseEvent.CLICK, this._doCancel); | |
this.cancel_btn.removeEventListener(MouseEvent.CLICK, this._doDelete); | |
}; | |
if (this._sb){ | |
this._sb.destroy(); | |
}; | |
this._icon = null; | |
SelectOnFocusField.deregisterField(this.tf); | |
ChangeColorOnEditField.deregisterField(this.tf); | |
} | |
public function setIcon(_arg1:IconOnStage, _arg2:Boolean):void{ | |
this._icon = _arg1; | |
if (this._icon.pText != ""){ | |
this.tf.text = this._icon.pText; | |
this.tf.textColor = 0; | |
if (this._sb){ | |
this._sb.refresh(); | |
}; | |
}; | |
if (_arg2){ | |
this.delete_btn.alpha = 0.5; | |
if (this.close_btn){ | |
this.close_btn.addEventListener(MouseEvent.CLICK, this._doDelete); | |
}; | |
if (this.cancel_btn){ | |
this.cancel_btn.addEventListener(MouseEvent.CLICK, this._doDelete); | |
}; | |
} else { | |
DisplayU.buttonify(this.delete_btn); | |
this.delete_btn.addEventListener(MouseEvent.CLICK, this._doDelete); | |
if (this.cancel_btn){ | |
this.cancel_btn.addEventListener(MouseEvent.CLICK, this._doCancel); | |
}; | |
if (this.close_btn){ | |
this.close_btn.addEventListener(MouseEvent.CLICK, this._doCancel); | |
}; | |
}; | |
} | |
public function save():void{ | |
if (this._icon != null){ | |
if (this.tf.text != this._defaultText){ | |
this._icon.pText = this.tf.text; | |
}; | |
}; | |
} | |
private function _close():void{ | |
dispatchEvent(new Event(Event.CLOSE)); | |
} | |
private function _doCancel(_arg1:Event):void{ | |
this._close(); | |
} | |
private function _doSave(_arg1:Event):void{ | |
this.save(); | |
this._close(); | |
} | |
private function _doDelete(_arg1:Event):void{ | |
this._icon.setDeleted(); | |
this._close(); | |
} | |
private function _beginDragging(_arg1:Event):void{ | |
var _local2:Rectangle = new Rectangle(0, 0, (this._lastW - width), (this._lastH - height)); | |
stage.addEventListener(MouseEvent.MOUSE_UP, this._endDragging); | |
startDrag(false, _local2); | |
} | |
private function _endDragging(_arg1:Event):void{ | |
stage.removeEventListener(MouseEvent.MOUSE_UP, this._endDragging); | |
stopDrag(); | |
} | |
private function _doPrint(_arg1:Event):void{ | |
dispatchEvent(new EventWithParam(PopupEvents.PRINT, this.tf.text)); | |
} | |
} | |
}//package com.vpg.vpage.shell.tools | |
package com.vpg.vpage.shell { | |
import flash.display.*; | |
public class LoadingScreen extends MovieClip { | |
public var bg:MovieClip; | |
public var content:MovieClip; | |
public function LoadingScreen(_arg1:Number, _arg2:Number, _arg3:String=""){ | |
if (((_arg3) && (this.content.tf))){ | |
this.content.tf.htmlText = _arg3; | |
}; | |
this.resize(_arg1, _arg2); | |
} | |
public function resize(_arg1:Number, _arg2:Number):void{ | |
if (this.bg){ | |
this.bg.width = _arg1; | |
this.bg.height = _arg2; | |
}; | |
if (this.content){ | |
this.content.x = (this.bg.width / 2); | |
this.content.y = (this.bg.height / 2); | |
}; | |
} | |
} | |
}//package com.vpg.vpage.shell | |
package com.vpg.vpage.shell.userdata { | |
import flash.events.*; | |
public class UserDataRequestEvent extends Event { | |
public static const ERROR:String = "error"; | |
public static const SUCCESS:String = "success"; | |
public var code:String; | |
public function UserDataRequestEvent(_arg1:String, _arg2:String="", _arg3:Boolean=false, _arg4:Boolean=false){ | |
this.code = _arg2; | |
super(_arg1, _arg3, _arg4); | |
} | |
override public function clone():Event{ | |
return (new UserDataRequestEvent(type, this.code, bubbles, cancelable)); | |
} | |
override public function toString():String{ | |
return (formatToString("UserDataRequestEvent", "type", "code", "bubbles", "cancelable", "eventPhase")); | |
} | |
} | |
}//package com.vpg.vpage.shell.userdata | |
package com.vpg.vpage.shell.userdata { | |
import flash.events.*; | |
public interface IUserDataStorage extends IEventDispatcher { | |
function handleRequest(_arg1:UserDataRequest):void; | |
function destroy():void; | |
function isReady():Boolean; | |
} | |
}//package com.vpg.vpage.shell.userdata | |
package com.vpg.vpage.shell.userdata { | |
import com.vpg.vpage.shell.*; | |
import flash.events.*; | |
import com.vpg.vpage.utils.*; | |
public class LocalMemory extends EventDispatcher implements IRequestProcessor { | |
private var _contentMap:HashMap; | |
public function LocalMemory(){ | |
this._contentMap = new HashMap(); | |
} | |
public function init(_arg1:App):void{ | |
dispatchEvent(new RequestProcessorEvent(RequestProcessorEvent.INIT_SUCCESS)); | |
} | |
public function process(_arg1:UserDataRequest):void{ | |
if (_arg1.getMethod() == UserDataRequest.METHOD_SET){ | |
this._handleSet(_arg1); | |
} else { | |
if (_arg1.getMethod() == UserDataRequest.METHOD_GET){ | |
this._handleGet(_arg1); | |
} else { | |
_arg1.notifyFail(); | |
}; | |
}; | |
} | |
public function isReady():Boolean{ | |
return (true); | |
} | |
private function _handleGet(_arg1:UserDataRequest):void{ | |
var _local2:HashMap = this._contentMap.get(_arg1.getType()); | |
var _local3:* = null; | |
if (_local2 != null){ | |
_local3 = _local2.get(_arg1.getPage()); | |
}; | |
_arg1.setContent(_local3); | |
_arg1.notifySuccess(); | |
} | |
private function _handleSet(_arg1:UserDataRequest):void{ | |
var _local4:HashMap; | |
var _local2:String = _arg1.getType(); | |
if (!this._contentMap.containsKey(_local2)){ | |
_local4 = new HashMap(); | |
this._contentMap.put(_local2, _local4); | |
}; | |
var _local3:HashMap = this._contentMap.get(_local2); | |
_local3.put(_arg1.getPage(), _arg1.getContent()); | |
_arg1.notifySuccess(); | |
} | |
} | |
}//package com.vpg.vpage.shell.userdata | |
package com.vpg.vpage.shell.userdata { | |
import com.vpg.vpage.shell.*; | |
import flash.events.*; | |
import com.vpg.vpage.utils.*; | |
import com.adobe.serialization.json.*; | |
import com.vpg.vpage.shell.datastore.*; | |
import flash.system.*; | |
import flash.external.*; | |
public class AtlasHandler extends EventDispatcher implements IRequestProcessor { | |
private static const SAVE_FUNCT:String = "saveUserData"; | |
private static const LOAD_FUNCT:String = "loadUserData"; | |
private static const SAVE_CB:String = "saveUserDataSuccess"; | |
private static const SAVE_CB_ERROR:String = "saveUserDataError"; | |
private static const LOAD_CB:String = "loadUserDataSuccess"; | |
private static const LOAD_CB_ERROR:String = "loadUserDataError"; | |
private static const SESSION_START:String = "sessionStartSuccess"; | |
private static const SESSION_START_ERROR:String = "sessionStartFail"; | |
public static const CODE_INIT_ERROR:String = "VST00100"; | |
public static const CODE_BAD_DATA:String = "VST00101"; | |
private var _requests:HashMap; | |
private var _bookid:String; | |
private var _cache:HashMap; | |
private var _sessionStarted:Boolean; | |
public function AtlasHandler(){ | |
this._requests = new HashMap(); | |
this._cache = new HashMap(); | |
this._sessionStarted = false; | |
ExternalInterface.addCallback(SAVE_CB, this._userDataSaved); | |
ExternalInterface.addCallback(SAVE_CB_ERROR, this._userDataSaveError); | |
ExternalInterface.addCallback(LOAD_CB, this._userDataLoaded); | |
ExternalInterface.addCallback(LOAD_CB_ERROR, this._userDataLoadError); | |
ExternalInterface.addCallback(SESSION_START, this._sessonStart); | |
ExternalInterface.addCallback(SESSION_START_ERROR, this._sessionStartError); | |
} | |
public function init(_arg1:App):void{ | |
this._bookid = _arg1.getBookID(); | |
var _local2:String = _arg1.getOption("iatlas_servertype", "uat"); | |
ExternalInterface.call("initBackend", _local2); | |
} | |
public function isReady():Boolean{ | |
return (this._sessionStarted); | |
} | |
public function process(_arg1:UserDataRequest):void{ | |
var _local2:String; | |
var _local3:String; | |
this._requests.put(_arg1.getRequestID(), _arg1); | |
if (_arg1.getMethod() == UserDataRequest.METHOD_SET){ | |
_local2 = this._getAndUpdateSaveContent(_arg1); | |
if (this._sessionStarted){ | |
ExternalInterface.call(SAVE_FUNCT, this._bookid, _arg1.getRequestID(), _arg1.getPage(), _local2); | |
}; | |
} else { | |
if (_arg1.getMethod() == UserDataRequest.METHOD_GET){ | |
_local3 = this._cache.get(_arg1.getPage()); | |
if (_local3){ | |
this._doDataFromCache(_arg1); | |
} else { | |
if (this._sessionStarted){ | |
ExternalInterface.call(LOAD_FUNCT, this._bookid, _arg1.getRequestID(), _arg1.getPage()); | |
} else { | |
if (MiscUtils.isDevMode()){ | |
this._allDone(_arg1.getRequestID(), true); | |
} else { | |
this._allDone(_arg1.getRequestID(), true); | |
}; | |
}; | |
}; | |
} else { | |
this._allDone(_arg1.getRequestID(), false); | |
}; | |
}; | |
} | |
public function setBookID(_arg1:String):void{ | |
this._bookid = _arg1; | |
} | |
private function _userDataSaved(_arg1:String):void{ | |
this._allDone(_arg1, true); | |
} | |
private function _userDataLoaded(_arg1:String, _arg2:String):void{ | |
var id:* = _arg1; | |
var data:* = _arg2; | |
var req:* = this._requests.get(id); | |
var dataObj:* = this._getEmptyObject(req.getPage()); | |
var success:* = true; | |
if (((!((data == ""))) && (!((data == null))))){ | |
try { | |
dataObj = JSON.decode(data); | |
} catch(e) { | |
success = false; | |
}; | |
}; | |
this._cache.put(req.getPage(), dataObj); | |
this._doDataFromCache(req, success); | |
if (!success){ | |
req.notifyFail(CODE_BAD_DATA); | |
}; | |
} | |
private function _userDataSaveError(_arg1:String):void{ | |
this._allDone(_arg1, false); | |
} | |
private function _userDataLoadError(_arg1:String):void{ | |
this._allDone(_arg1, false); | |
} | |
private function _allDone(_arg1:String, _arg2:Boolean):void{ | |
var _local3:UserDataRequest = this._requests.get(_arg1); | |
if (_arg2){ | |
_local3.notifySuccess(); | |
} else { | |
_local3.notifyFail(); | |
}; | |
} | |
private function _doDataFromCache(_arg1:UserDataRequest, _arg2:Boolean=true):void{ | |
var _local3:Object = this._cache.get(_arg1.getPage()); | |
var _local4 = ""; | |
if (_arg1.getType() == GenericDataStoreTypes.TYPE_NOTE){ | |
_local4 = this._notesToXML(_local3.notes); | |
} else { | |
if (_arg1.getType() == GenericDataStoreTypes.TYPE_HIGHLIGHT){ | |
_local4 = this._highlightsToXML(_local3.markup); | |
}; | |
}; | |
_arg1.setContent(_local4); | |
if (_arg2){ | |
this._allDone(_arg1.getRequestID(), true); | |
}; | |
} | |
private function _getAndUpdateSaveContent(_arg1:UserDataRequest):String{ | |
var _local3:Array; | |
var _local4:Array; | |
var _local2:Object = this._cache.get(_arg1.getPage()); | |
if (_local2 == null){ | |
_local2 = this._getEmptyObject(_arg1.getPage()); | |
this._cache.put(_arg1.getPage(), _local2); | |
}; | |
if (_arg1.getType() == GenericDataStoreTypes.TYPE_NOTE){ | |
_local3 = this._notesToJson(_arg1.getContent()); | |
_local2.notes = _local3; | |
} else { | |
if (_arg1.getType() == GenericDataStoreTypes.TYPE_HIGHLIGHT){ | |
_local4 = this._highlightsToJson(_arg1.getContent()); | |
_local2.markup = _local4; | |
}; | |
}; | |
return (JSON.encode(_local2)); | |
} | |
private function _notesToJson(_arg1:String):Array{ | |
var _local6:Object; | |
var _local7:XML; | |
var _local8:Array; | |
var _local2:XML = new XML(_arg1); | |
var _local3:Array = []; | |
var _local4:XMLList = _local2.art; | |
var _local5:int; | |
while (_local5 < _local4.length()) { | |
_local6 = new Object(); | |
_local7 = (_local4[_local5] as XML); | |
_local6.text = _local7.pText.toString(); | |
_local6.date = Number(_local7.date.toString()); | |
_local6.coords = new Object(); | |
_local8 = _local7.coords.toString().split(","); | |
_local6.coords.x = Number(_local8[0]); | |
_local6.coords.y = Number(_local8[1]); | |
_local3.push(_local6); | |
_local5++; | |
}; | |
System.disposeXML(_local2); | |
return (_local3); | |
} | |
private function _highlightsToJson(_arg1:String):Array{ | |
var _local6:XML; | |
var _local7:Object; | |
var _local8:String; | |
var _local2:XML = new XML(_arg1); | |
var _local3:Array = []; | |
var _local4:XMLList = _local2.markup; | |
var _local5:int; | |
while (_local5 < _local4.length()) { | |
_local6 = (_local4[_local5] as XML); | |
_local7 = new Object(); | |
_local7.type = _local6.type.toString(); | |
_local7.range = _local6.range.toString(); | |
_local8 = Number(_local6.color).toString(16); | |
_local7.color = ("0x" + _local8); | |
_local7.text = _local6.text.toString(); | |
_local7.date = Number(_local6.date.toString()); | |
_local3.push(_local7); | |
_local5++; | |
}; | |
System.disposeXML(_local2); | |
return (_local3); | |
} | |
private function _notesToXML(_arg1:Array):String{ | |
var _local4:Object; | |
var _local5:String; | |
var _local2 = "<artobjs>"; | |
var _local3:int; | |
while (_local3 < _arg1.length) { | |
_local4 = _arg1[_local3]; | |
_local2 = (_local2 + "<art>"); | |
_local2 = (_local2 + StringU.makeXMLNodeString("type", "note")); | |
_local5 = ((_local4.coords.x + ",") + _local4.coords.y); | |
_local2 = (_local2 + StringU.makeXMLNodeString("coords", _local5)); | |
_local2 = (_local2 + StringU.makeXMLNodeString("pText", _local4.text)); | |
_local2 = (_local2 + StringU.makeXMLNodeString("date", String(_local4.date))); | |
_local2 = (_local2 + "</art>"); | |
_local3++; | |
}; | |
_local2 = (_local2 + "</artobjs>"); | |
return (_local2); | |
} | |
private function _highlightsToXML(_arg1:Array):String{ | |
var _local4:Object; | |
var _local2 = "<markups>"; | |
var _local3:int; | |
while (_local3 < _arg1.length) { | |
_local4 = _arg1[_local3]; | |
_local2 = (_local2 + "<markup>"); | |
_local2 = (_local2 + StringU.makeXMLNodeString("type", _local4.type)); | |
_local2 = (_local2 + StringU.makeXMLNodeString("range", _local4.range)); | |
_local2 = (_local2 + StringU.makeXMLNodeString("color", String(_local4.color))); | |
_local2 = (_local2 + StringU.makeXMLNodeString("text", _local4.text)); | |
_local2 = (_local2 + StringU.makeXMLNodeString("date", String(_local4.date))); | |
_local2 = (_local2 + "</markup>"); | |
_local3++; | |
}; | |
_local2 = (_local2 + "</markups>"); | |
return (_local2); | |
} | |
private function _getEmptyObject(_arg1:String):Object{ | |
var _local2:Object = new Object(); | |
_local2.id = _arg1; | |
_local2.notes = []; | |
_local2.markup = []; | |
return (_local2); | |
} | |
private function _sessonStart():void{ | |
this._sessionStarted = true; | |
dispatchEvent(new RequestProcessorEvent(RequestProcessorEvent.INIT_SUCCESS)); | |
} | |
private function _sessionStartError():void{ | |
this._sessionStarted = false; | |
dispatchEvent(new RequestProcessorEvent(RequestProcessorEvent.INIT_ERROR, CODE_INIT_ERROR)); | |
} | |
} | |
}//package com.vpg.vpage.shell.userdata | |
package com.vpg.vpage.shell.userdata { | |
import com.vpg.vpage.shell.*; | |
import flash.events.*; | |
public interface IRequestProcessor extends IEventDispatcher { | |
function process(_arg1:UserDataRequest):void; | |
function init(_arg1:App):void; | |
function isReady():Boolean; | |
} | |
}//package com.vpg.vpage.shell.userdata | |
package com.vpg.vpage.shell.userdata { | |
import flash.events.*; | |
public class UserDataStorageEvent extends Event { | |
public static const SAVE_ERROR:String = "saveError"; | |
public static const SAVE_SUCCESS:String = "saveSuccess"; | |
public static const LOAD_ERROR:String = "loadError"; | |
public static const LOAD_SUCCESS:String = "loadSuccess"; | |
public var code:String; | |
public function UserDataStorageEvent(_arg1:String, _arg2:String="", _arg3:Boolean=false, _arg4:Boolean=false){ | |
this.code = _arg2; | |
super(_arg1, _arg3, _arg4); | |
} | |
override public function clone():Event{ | |
return (new UserDataStorageEvent(type, this.code, bubbles, cancelable)); | |
} | |
override public function toString():String{ | |
return (formatToString("UserDataStorageEvent", "type", "code", "bubbles", "cancelable", "eventPhase")); | |
} | |
} | |
}//package com.vpg.vpage.shell.userdata | |
package com.vpg.vpage.shell.userdata { | |
import flash.events.*; | |
public class UserDataStorage extends EventDispatcher implements IUserDataStorage { | |
private static const LOAD_ERROR_CODE:String = "VST00060"; | |
private static const SAVE_ERROR_CODE:String = "VST00061"; | |
private var _processor:IRequestProcessor; | |
public function UserDataStorage(){ | |
this._processor = new LocalMemory(); | |
} | |
public function handleRequest(_arg1:UserDataRequest):void{ | |
_arg1.addEventListener(UserDataRequestEvent.SUCCESS, this._requestSuccess, false, 0, true); | |
_arg1.addEventListener(UserDataRequestEvent.ERROR, this._requestError, false, 0, true); | |
this._processor.process(_arg1); | |
} | |
public function destroy():void{ | |
} | |
public function isReady():Boolean{ | |
if (this._processor){ | |
return (this._processor.isReady()); | |
}; | |
return (false); | |
} | |
public function setRequestProcessor(_arg1:IRequestProcessor):void{ | |
this._processor = _arg1; | |
} | |
private function _requestSuccess(_arg1:Event):void{ | |
var _local2:UserDataRequest = (_arg1.currentTarget as UserDataRequest); | |
if (_local2.getMethod() == UserDataRequest.METHOD_GET){ | |
dispatchEvent(new UserDataStorageEvent(UserDataStorageEvent.LOAD_SUCCESS)); | |
} else { | |
dispatchEvent(new UserDataStorageEvent(UserDataStorageEvent.SAVE_SUCCESS)); | |
}; | |
} | |
private function _requestError(_arg1:UserDataRequestEvent):void{ | |
var _local2:UserDataRequest = (_arg1.currentTarget as UserDataRequest); | |
if (_local2.getMethod() == UserDataRequest.METHOD_GET){ | |
dispatchEvent(new UserDataStorageEvent(UserDataStorageEvent.LOAD_ERROR, _arg1.code)); | |
} else { | |
dispatchEvent(new UserDataStorageEvent(UserDataStorageEvent.SAVE_ERROR, _arg1.code)); | |
}; | |
} | |
} | |
}//package com.vpg.vpage.shell.userdata | |
package com.vpg.vpage.shell.userdata { | |
import flash.events.*; | |
public class UserDataRequest extends EventDispatcher { | |
public static const METHOD_GET:String = "get"; | |
public static const METHOD_SET:String = "set"; | |
private var _method:String; | |
private var _pg:String; | |
private var _type:String; | |
private var _content; | |
private var _id:String; | |
public function UserDataRequest(_arg1:String, _arg2:String, _arg3:String="", _arg4=null){ | |
this._method = _arg1; | |
this._pg = _arg2; | |
this._type = _arg3; | |
this._content = _arg4; | |
this._id = String(new Date().valueOf()); | |
} | |
public function getRequestID():String{ | |
return (this._id); | |
} | |
public function getMethod():String{ | |
return (this._method); | |
} | |
public function getPage():String{ | |
return (this._pg); | |
} | |
public function getType():String{ | |
return (this._type); | |
} | |
public function getContent(){ | |
return (this._content); | |
} | |
public function setContent(_arg1):void{ | |
this._content = _arg1; | |
} | |
public function notifySuccess():void{ | |
dispatchEvent(new UserDataRequestEvent(UserDataRequestEvent.SUCCESS)); | |
} | |
public function notifyFail(_arg1:String=""):void{ | |
dispatchEvent(new UserDataRequestEvent(UserDataRequestEvent.ERROR, _arg1)); | |
} | |
override public function toString():String{ | |
return (((((((("UserDataRequest: " + this._method) + " ") + this._pg) + " ") + this._type) + " ") + this._content)); | |
} | |
} | |
}//package com.vpg.vpage.shell.userdata | |
package com.vpg.vpage.shell.userdata { | |
import flash.events.*; | |
public class RequestProcessorEvent extends Event { | |
public static const INIT_ERROR:String = "initError"; | |
public static const INIT_SUCCESS:String = "initSuccess"; | |
public var code:String; | |
public function RequestProcessorEvent(_arg1:String, _arg2:String="", _arg3:Boolean=false, _arg4:Boolean=false){ | |
this.code = _arg2; | |
super(_arg1, _arg3, _arg4); | |
} | |
override public function clone():Event{ | |
return (new RequestProcessorEvent(type, this.code, bubbles, cancelable)); | |
} | |
override public function toString():String{ | |
return (formatToString("RequestProcessorEvent", "type", "code", "bubbles", "cancelable", "eventPhase")); | |
} | |
} | |
}//package com.vpg.vpage.shell.userdata | |
package com.vpg.vpage.shell.whiteboard { | |
import com.vpg.vpage.utils.*; | |
public class WhiteboardLayerBackground extends Square { | |
public function WhiteboardLayerBackground(_arg1:Number):void{ | |
super(_arg1); | |
} | |
} | |
}//package com.vpg.vpage.shell.whiteboard | |
package com.vpg.vpage.shell.whiteboard { | |
import flash.display.*; | |
import flash.geom.*; | |
import flash.events.*; | |
import com.vpg.vpage.shell.whiteboard.save.*; | |
import com.motiondraw.geometry.*; | |
import com.motiondraw.*; | |
import com.vpg.vpage.utils.cursor.*; | |
public class BitmapPencilTool extends AbstractTool { | |
private var points:Array; | |
private var pointIndex:Number; | |
private var lastLine:Array; | |
private var thickness:Number; | |
private var color:Number; | |
private var alpha:Number; | |
private var cursor:BasicCursor; | |
private var waiting:Boolean; | |
private var isActivelyDrawing:Boolean; | |
private var myBlendMode:String; | |
public function BitmapPencilTool(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:String=null){ | |
this.myBlendMode = _arg4; | |
this.thickness = _arg1; | |
if (_arg1 == -1){ | |
this.thickness = 1; | |
}; | |
this.color = _arg2; | |
if (_arg2 == -1){ | |
this.color = 0; | |
}; | |
this.alpha = _arg3; | |
if (_arg3 == -1){ | |
this.alpha = 1; | |
}; | |
} | |
override public function setup(_arg1:MovieClip, _arg2:MovieClip, _arg3:WhiteboardLayerBackground, _arg4:PageData):void{ | |
super.setup(_arg1, _arg2, _arg3, _arg4); | |
if ((((this.myBlendMode == BlendMode.ERASE)) || ((this.myBlendMode == BlendMode.ALPHA)))){ | |
this.cursor = new EraserCursor(); | |
} else { | |
if (this.alpha == 1){ | |
this.cursor = new PencilCursor(this.color); | |
} else { | |
this.cursor = new HighlighterCursor(this.color); | |
}; | |
}; | |
_arg1.addChild(this.cursor); | |
this.cursor.setActiveZone(_arg3); | |
this.cursor.disable(); | |
this.init(); | |
} | |
override public function destroy():void{ | |
if (bg){ | |
bg.stage.removeEventListener(MouseEvent.MOUSE_DOWN, this.doMouseDown); | |
}; | |
this.mouseUpEvent(); | |
this.points = null; | |
this.lastLine = null; | |
if (this.cursor){ | |
this.cursor.disable(); | |
this.cursor.destroy(); | |
this.cursor = null; | |
}; | |
super.destroy(); | |
} | |
override public function duplicate():ITool{ | |
return (new BitmapPencilTool(this.thickness, this.color, this.alpha, this.myBlendMode)); | |
} | |
public function restore(_arg1:BitmapSave):void{ | |
bitmapData.copyPixels(_arg1.bitmapData, new Rectangle(0, 0, bg.width, bg.height), new Point(0, 0), null, null, true); | |
} | |
public function mouseUpEvent():void{ | |
if (this.isActivelyDrawing){ | |
this.endLine(); | |
this.isActivelyDrawing = false; | |
}; | |
if (bg){ | |
bg.stage.removeEventListener(MouseEvent.MOUSE_UP, this.doMouseUp); | |
bg.stage.removeEventListener(MouseEvent.MOUSE_MOVE, this.doMouseMove); | |
}; | |
} | |
private function init():void{ | |
bg.stage.addEventListener(MouseEvent.MOUSE_DOWN, this.doMouseDown); | |
this.cursor.enable(); | |
} | |
private function startLine():void{ | |
if (this.isValidHit()){ | |
this.getTemp().parent.setChildIndex(this.getTemp(), (this.getTemp().parent.numChildren - 1)); | |
this.pointIndex = 0; | |
this.points = new Array(); | |
this.getTemp().graphics.moveTo(holder.mouseX, holder.mouseY); | |
this.getTemp().graphics.lineStyle(this.thickness, this.color, this.alpha); | |
var _local1 = this.pointIndex++; | |
this.points[_local1] = { | |
x:holder.mouseX, | |
y:holder.mouseY | |
}; | |
this.isActivelyDrawing = true; | |
}; | |
} | |
private function drawLine():void{ | |
this.getTemp().graphics.lineTo(holder.mouseX, holder.mouseY); | |
var _local1 = this.pointIndex++; | |
this.points[_local1] = { | |
x:holder.mouseX, | |
y:holder.mouseY | |
}; | |
if (this.pointIndex == 3){ | |
if (this.points[2].x > this.points[1].x){ | |
this.points[0].x = (this.points[1].x - Math.min((this.points[2].x - this.points[1].x), 10)); | |
} else { | |
this.points[0].x = (this.points[1].x + Math.min((this.points[1].x - this.points[2].x), 10)); | |
}; | |
if (this.points[2].y > this.points[1].y){ | |
this.points[0].y = (this.points[1].y - Math.min((this.points[2].y - this.points[1].y), 10)); | |
} else { | |
this.points[0].y = (this.points[1].y + Math.min((this.points[1].y - this.points[2].y), 10)); | |
}; | |
this.getTemp().graphics.moveTo(this.points[0].x, this.points[0].y); | |
this.getTemp().graphics.lineTo(this.points[1].x, this.points[1].y); | |
this.getTemp().graphics.moveTo(this.points[2].x, this.points[2].y); | |
}; | |
} | |
private function endLine():void{ | |
this.isActivelyDrawing = false; | |
this.getTemp().graphics.clear(); | |
this.lastLine = this.points; | |
if (((this.lastLine) && (!((this.lastLine.length == 1))))){ | |
this.compressLine(); | |
this.smoothLine(); | |
}; | |
} | |
private function compressLine():void{ | |
var _local1:LineGeneralization = new LineGeneralization(); | |
var _local2:Number = 10; | |
var _local3:Number = 2; | |
var _local4:Array = _local1.simplifyLang(_local2, _local3, this.lastLine); | |
this.lastLine = _local4; | |
} | |
function smoothLine():void{ | |
var _local5:Number; | |
var _local1:CatmullRomSpline = new CatmullRomSpline(this.lastLine); | |
var _local2:Number = 5; | |
this.points = _local1.getAllPoints(_local2); | |
var _local3:MovieClip = new MovieClip(); | |
drawingOverlay.addChild(_local3); | |
if (this.points.length == 1){ | |
_local3.graphics.beginFill(this.color, this.alpha); | |
_local3.graphics.drawCircle(this.points[0].x, this.points[0].y, (this.thickness / 2)); | |
_local3.graphics.endFill(); | |
} else { | |
_local3.graphics.lineStyle(this.thickness, this.color, this.alpha); | |
_local3.graphics.moveTo(this.points[0].x, this.points[0].y); | |
_local5 = 1; | |
while (_local5 < this.points.length) { | |
_local3.graphics.lineTo(this.points[_local5].x, this.points[_local5].y); | |
_local5++; | |
}; | |
}; | |
bitmapData.draw(_local3, new Matrix(), new ColorTransform(), this.myBlendMode, null, true); | |
var _local4:BitmapSave = new BitmapSave(bitmapData); | |
this.pageData.updateBitmapCanvas(_local4); | |
updateBitmapCanvas(); | |
this.restore(_local4); | |
_local3.parent.removeChild(_local3); | |
} | |
private function loadLine(_arg1:XML):void{ | |
var _local3:Array; | |
var _local4:XML; | |
var _local5:Number; | |
var _local2:Number = 0; | |
while (_local2 < _arg1.firstChild.childNodes.length) { | |
_local3 = new Array(); | |
_local4 = _arg1.firstChild.childNodes[_local2]; | |
_local5 = 0; | |
while (_local5 < _local4.childNodes.length) { | |
_local3[_local5] = { | |
x:Number(_local4.childNodes[_local5].firstChild.toString().split(",")[0]), | |
y:Number(_local4.childNodes[_local5].firstChild.toString().split(",")[1]) | |
}; | |
_local5++; | |
}; | |
this.lastLine = _local3; | |
if (this.lastLine.length != 1){ | |
this.smoothLine(); | |
}; | |
_local2++; | |
}; | |
} | |
private function doMouseDown(_arg1:Event):void{ | |
if ((_arg1.target is WhiteboardLayerBackground)){ | |
this.waiting = true; | |
bg.addEventListener(Event.ENTER_FRAME, this.mouseDownFrameCheck); | |
bg.stage.addEventListener(MouseEvent.MOUSE_UP, this.doMouseUp); | |
bg.stage.addEventListener(MouseEvent.MOUSE_MOVE, this.doMouseMove); | |
}; | |
} | |
private function mouseDownFrameCheck(_arg1:Event):void{ | |
bg.removeEventListener(Event.ENTER_FRAME, this.mouseDownFrameCheck); | |
this.waiting = false; | |
} | |
private function doMouseUp(_arg1:Event):void{ | |
this.waiting = false; | |
this.mouseUpEvent(); | |
} | |
private function doMouseMove(_arg1:Event):void{ | |
if (!this.waiting){ | |
if (this.isValidHit()){ | |
if (this.isActivelyDrawing){ | |
this.drawLine(); | |
} else { | |
this.startLine(); | |
}; | |
} else { | |
if (this.isActivelyDrawing){ | |
this.endLine(); | |
}; | |
}; | |
}; | |
} | |
private function getTemp():MovieClip{ | |
var _local2:MovieClip; | |
var _local1:MovieClip = (drawingOverlay.getChildByName("temp") as MovieClip); | |
if (_local1){ | |
return (_local1); | |
}; | |
_local2 = new MovieClip(); | |
_local2.name = "temp"; | |
drawingOverlay.addChild(_local2); | |
return (_local2); | |
} | |
} | |
}//package com.vpg.vpage.shell.whiteboard | |
package com.vpg.vpage.shell.whiteboard { | |
import flash.display.*; | |
import com.vpg.vpage.shell.whiteboard.save.*; | |
public interface ITool { | |
function setup(_arg1:MovieClip, _arg2:MovieClip, _arg3:WhiteboardLayerBackground, _arg4:PageData):void; | |
function destroy():void; | |
function duplicate():ITool; | |
} | |
}//package com.vpg.vpage.shell.whiteboard | |
package com.vpg.vpage.shell.whiteboard { | |
import flash.display.*; | |
import com.vpg.vpage.utils.*; | |
import com.vpg.vpage.utils.cursor.*; | |
public class HighlighterCursor extends BasicCursor { | |
public var tint:MovieClip; | |
public function HighlighterCursor(_arg1:Number){ | |
if (this.tint){ | |
DisplayU.tint(this.tint, _arg1); | |
}; | |
} | |
} | |
}//package com.vpg.vpage.shell.whiteboard | |
package com.vpg.vpage.shell.whiteboard { | |
import flash.events.*; | |
import com.vpg.vpage.utils.*; | |
import com.vpg.vpage.shell.whiteboard.save.*; | |
import com.vpg.vpage.shell.datastore.*; | |
public class WhiteboardManager extends EventDispatcher { | |
public static const CHANGE:String = "whiteboardDataChanged"; | |
private var layers:Array; | |
private var ds:GenericDataStore; | |
public function WhiteboardManager(){ | |
this.layers = new Array(); | |
} | |
public function setDataStore(_arg1:GenericDataStore):void{ | |
this.ds = _arg1; | |
} | |
public function clearDrawings(_arg1:String=""):void{ | |
var _local3:WhiteboardLayer; | |
var _local4:String; | |
_arg1 = _arg1.split(/^0*/).join(""); | |
var _local2:int; | |
while (_local2 < this.layers.length) { | |
_local3 = (this.layers[_local2] as WhiteboardLayer); | |
_local4 = _local3.getPage(); | |
_local4 = _local4.split(/^0*/).join(""); | |
if ((((_arg1 == "")) || ((_local4 == _arg1)))){ | |
_local3.clear(); | |
}; | |
_local2++; | |
}; | |
} | |
public function destroy():void{ | |
this.layers = null; | |
this.ds = null; | |
} | |
public function addLayer(_arg1:WhiteboardLayer):void{ | |
var _local3:BitmapSave; | |
var _local4:PageData; | |
var _local2:* = this.ds.getContent(GenericDataStoreTypes.TYPE_WHITEBOARD, _arg1.getPage()); | |
if (_local2 == null){ | |
_local2 = new PageData(); | |
_local2.addEventListener(PageData.CHANGE, this.pageDataChanged); | |
this.ds.setContent(GenericDataStoreTypes.TYPE_WHITEBOARD, _local2, _arg1.getPage()); | |
} else { | |
if ((_local2 is String)){ | |
_local3 = new BitmapSave(null); | |
_local3.restoreFromXMLString(_local2); | |
_local4 = new PageData(); | |
_local4.addItem(_local3, false); | |
_local2 = _local4; | |
_local4.addEventListener(PageData.CHANGE, this.pageDataChanged); | |
this.ds.setContent(GenericDataStoreTypes.TYPE_WHITEBOARD, _local2, _arg1.getPage()); | |
}; | |
}; | |
_arg1.init(_local2); | |
this.layers.push(_arg1); | |
} | |
public function removeAllLayers():void{ | |
var _local1:int; | |
while (_local1 < this.layers.length) { | |
this.layers[_local1].destroy(); | |
_local1++; | |
}; | |
this.layers = new Array(); | |
} | |
public function isEnabled():Boolean{ | |
return (this.layers[0].isEnabled()); | |
} | |
public function setTool(_arg1:ITool):void{ | |
var _local2:int; | |
while (_local2 < this.layers.length) { | |
if (this.layers[_local2].stage){ | |
this.layers[_local2].disable(); | |
this.layers[_local2].enable(_arg1.duplicate()); | |
}; | |
_local2++; | |
}; | |
} | |
public function disable():void{ | |
var _local1:int; | |
while (_local1 < this.layers.length) { | |
this.layers[_local1].disable(); | |
_local1++; | |
}; | |
} | |
private function pageDataChanged(_arg1:Event):void{ | |
var _local4:WhiteboardLayer; | |
var _local5:PageData; | |
var _local2:PageData = (_arg1.currentTarget as PageData); | |
var _local3:int; | |
while (_local3 < this.layers.length) { | |
_local4 = this.layers[_local3]; | |
_local5 = this.ds.getContent(GenericDataStoreTypes.TYPE_WHITEBOARD, _local4.getPage()); | |
if (_local5 == _local2){ | |
dispatchEvent(new EventWithParam(CHANGE, _local4.getPage())); | |
return; | |
}; | |
_local3++; | |
}; | |
} | |
} | |
}//package com.vpg.vpage.shell.whiteboard | |
package com.vpg.vpage.shell.whiteboard { | |
import com.vpg.vpage.utils.cursor.*; | |
public class EraserCursor extends BasicCursor { | |
} | |
}//package com.vpg.vpage.shell.whiteboard | |
package com.vpg.vpage.shell.whiteboard { | |
import flash.display.*; | |
import com.vpg.vpage.shell.whiteboard.save.*; | |
public class AbstractTool implements ITool { | |
public var holder:MovieClip; | |
public var drawingOverlay:MovieClip; | |
public var bitmapData:BitmapData; | |
public var bg:WhiteboardLayerBackground; | |
public var pageData:PageData; | |
public function setup(_arg1:MovieClip, _arg2:MovieClip, _arg3:WhiteboardLayerBackground, _arg4:PageData):void{ | |
var _local5:MovieClip; | |
var _local6:Bitmap; | |
if (_arg1 == null){ | |
trace("ERROR: toolHolder null"); | |
}; | |
this.holder = _arg1; | |
this.drawingOverlay = _arg2; | |
if (this.drawingOverlay.objectList == null){ | |
this.drawingOverlay.objectList = new Array(); | |
}; | |
if (this.drawingOverlay.bitmapData == null){ | |
this.bitmapData = (this.drawingOverlay.bitmapData = new BitmapData(_arg3.width, _arg3.height, true, 0xFFFFFF)); | |
_local5 = new MovieClip(); | |
_local5.name = "bitmapCanvas"; | |
this.drawingOverlay.addChild(_local5); | |
this.drawingOverlay.bitmapCanvas = _local5; | |
_local6 = new Bitmap(this.bitmapData); | |
_local5.addChild(_local6); | |
} else { | |
this.bitmapData = this.drawingOverlay.bitmapData; | |
}; | |
this.bg = _arg3; | |
this.pageData = _arg4; | |
} | |
public function updateBitmapCanvas():void{ | |
this.bitmapData = (this.drawingOverlay.bitmapData = new BitmapData(this.bg.width, this.bg.height, true, 0xFFFFFF)); | |
var _local1:MovieClip = (this.drawingOverlay.getChildByName("bitmapCanvas") as MovieClip); | |
if (_local1){ | |
_local1.parent.removeChild(_local1); | |
}; | |
var _local2:MovieClip = new MovieClip(); | |
_local2.name = "bitmapCanvas"; | |
this.drawingOverlay.bitmapCanvas = _local2; | |
this.drawingOverlay.addChild(_local2); | |
var _local3:Bitmap = new Bitmap(this.drawingOverlay.bitmapData); | |
_local2.addChild(_local3); | |
} | |
public function destroy():void{ | |
} | |
function isValidHit():Boolean{ | |
var _local1:Boolean = this.bg.hitTestPoint(this.bg.stage.mouseX, this.bg.stage.mouseY, true); | |
return (_local1); | |
} | |
public function duplicate():ITool{ | |
return (null); | |
} | |
} | |
}//package com.vpg.vpage.shell.whiteboard | |
package com.vpg.vpage.shell.whiteboard.save { | |
import flash.display.*; | |
import flash.events.*; | |
import com.vpg.vpage.shell.whiteboard.*; | |
public class PageData extends EventDispatcher implements ITool { | |
public static const CHANGE:String = "pageDataChanged"; | |
private var items:Array; | |
private var lastBitmapCanvasState:BitmapSave; | |
private var date:Date; | |
public function PageData(){ | |
this.items = new Array(); | |
this.items[0] = "bitmapCanvasPlaceholder"; | |
} | |
public function addItem(_arg1:ITool, _arg2:Boolean):void{ | |
if (this.items.indexOf(_arg1) == -1){ | |
this.items.push(_arg1); | |
}; | |
} | |
public function removeItem(_arg1:ITool):void{ | |
var _local2:Number = this.items.indexOf(_arg1); | |
if (_local2 != -1){ | |
this.items.splice(_local2, 1); | |
}; | |
} | |
public function getDate():Date{ | |
return (this.date); | |
} | |
public function updateBitmapCanvas(_arg1:BitmapSave):void{ | |
if (!this.date){ | |
this.date = new Date(); | |
}; | |
if ((this.items[0] is ITool)){ | |
this.lastBitmapCanvasState = new BitmapSave(this.items[0].bitmapData); | |
}; | |
this.items[0] = _arg1; | |
dispatchEvent(new Event(CHANGE)); | |
} | |
public function getLastBitmapCanvasState():BitmapSave{ | |
return (this.lastBitmapCanvasState); | |
} | |
public function getItems():Array{ | |
return (this.items.slice()); | |
} | |
public function setup(_arg1:MovieClip, _arg2:MovieClip, _arg3:WhiteboardLayerBackground, _arg4:PageData):void{ | |
var _local6:ITool; | |
var _local5:Number = 0; | |
while (_local5 < this.items.length) { | |
if ((this.items[_local5] is ITool)){ | |
_local6 = this.items[_local5]; | |
_local6.setup(_arg1, _arg2, _arg3, null); | |
_local6.destroy(); | |
}; | |
_local5++; | |
}; | |
} | |
public function destroy():void{ | |
this.lastBitmapCanvasState = null; | |
this.items = new Array(); | |
this.items[0] = "bitmapCanvasPlaceholder"; | |
dispatchEvent(new Event(CHANGE)); | |
} | |
public function duplicate():ITool{ | |
return (null); | |
} | |
public function toXMLString():String{ | |
var _local1:String; | |
if ((this.items[0] is BitmapSave)){ | |
_local1 = "<pagedata>"; | |
_local1 = (_local1 + (("<date>" + this.date.valueOf()) + "</date>")); | |
_local1 = (_local1 + this.items[0].toXMLString()); | |
_local1 = (_local1 + "</pagedata>"); | |
return (_local1); | |
}; | |
return (""); | |
} | |
} | |
}//package com.vpg.vpage.shell.whiteboard.save | |
package com.vpg.vpage.shell.whiteboard.save { | |
import flash.display.*; | |
public interface ISaveData { | |
function setMC(_arg1:MovieClip):void; | |
function getMC():MovieClip; | |
} | |
}//package com.vpg.vpage.shell.whiteboard.save | |
package com.vpg.vpage.shell.whiteboard.save { | |
import flash.display.*; | |
import flash.geom.*; | |
import com.vpg.vpage.shell.whiteboard.*; | |
import flash.utils.*; | |
import com.sociodox.utils.*; | |
import flash.system.*; | |
public class BitmapSave implements ITool, ISaveData { | |
public var bitmapData:BitmapData; | |
public var color:Number; | |
public var thickness:Number; | |
public var alpha:Number; | |
public var mc:MovieClip; | |
public function BitmapSave(_arg1:BitmapData){ | |
this.bitmapData = _arg1; | |
this.thickness = this.thickness; | |
this.color = this.color; | |
this.alpha = this.alpha; | |
} | |
public function setMC(_arg1:MovieClip):void{ | |
} | |
public function getMC():MovieClip{ | |
return (this.mc); | |
} | |
public function setup(_arg1:MovieClip, _arg2:MovieClip, _arg3:WhiteboardLayerBackground, _arg4:PageData):void{ | |
var _local5:BitmapPencilTool = new BitmapPencilTool(this.thickness, this.color, this.alpha); | |
_local5.setup(_arg1, _arg2, _arg3, _arg4); | |
_local5.restore(this); | |
_local5.destroy(); | |
} | |
public function destroy():void{ | |
} | |
public function duplicate():ITool{ | |
return (null); | |
} | |
public function bitmapDataToBase64():String{ | |
var _local2:ByteArray; | |
var _local1 = ""; | |
if (this.bitmapData){ | |
_local2 = new ByteArray(); | |
_local2.writeBytes(this.bitmapData.getPixels(this.bitmapData.rect)); | |
_local2.compress(); | |
_local1 = Base64.encode(_local2); | |
}; | |
return (_local1); | |
} | |
public function getImageWidth():Number{ | |
if (this.bitmapData){ | |
return (this.bitmapData.rect.width); | |
}; | |
return (0); | |
} | |
public function getImageHeight():Number{ | |
if (this.bitmapData){ | |
return (this.bitmapData.rect.height); | |
}; | |
return (0); | |
} | |
public function restoreFromBase64(_arg1:String, _arg2:Number, _arg3:Number):void{ | |
if (this.bitmapData){ | |
this.bitmapData.dispose(); | |
}; | |
var _local4:ByteArray = Base64.decode(_arg1); | |
_local4.uncompress(); | |
this.bitmapData = new BitmapData(_arg2, _arg3); | |
var _local5:Rectangle = new Rectangle(0, 0, _arg2, _arg3); | |
this.bitmapData.setPixels(_local5, _local4); | |
} | |
public function toXMLString():String{ | |
var _local1 = ""; | |
if (this.bitmapData){ | |
_local1 = "<drawing>"; | |
_local1 = (_local1 + (("<w>" + this.getImageWidth()) + "</w>")); | |
_local1 = (_local1 + (("<h>" + this.getImageHeight()) + "</h>")); | |
_local1 = (_local1 + (("<data><![CDATA[" + this.bitmapDataToBase64()) + "]]></data>")); | |
_local1 = (_local1 + "</drawing>"); | |
}; | |
return (_local1); | |
} | |
public function restoreFromXMLString(_arg1:String):void{ | |
var _local2:XML = new XML(_arg1); | |
var _local3:String = _local2.data.text(); | |
var _local4:Number = Number(_local2.w.text()); | |
var _local5:Number = Number(_local2.h.text()); | |
System.disposeXML(_local2); | |
this.restoreFromBase64(_local3, _local4, _local5); | |
} | |
} | |
}//package com.vpg.vpage.shell.whiteboard.save | |
package com.vpg.vpage.shell.whiteboard { | |
import flash.display.*; | |
import com.vpg.vpage.shell.whiteboard.save.*; | |
public class WhiteboardLayer extends MovieClip { | |
private var drawArea:MovieClip; | |
private var bg:WhiteboardLayerBackground; | |
private var toolHolder:MovieClip; | |
private var currentTool:ITool; | |
private var pageData:PageData; | |
private var pg:String; | |
public function WhiteboardLayer(_arg1:String){ | |
this.pg = _arg1; | |
this.bg = new WhiteboardLayerBackground(0xFF0000); | |
this.bg.alpha = 0; | |
this.addChild(this.bg); | |
this.drawArea = new MovieClip(); | |
addChild(this.drawArea); | |
this.toolHolder = new MovieClip(); | |
addChild(this.toolHolder); | |
this.toolHolder.mouseEnabled = false; | |
this.toolHolder.mouseChildren = false; | |
this.drawArea.mouseEnabled = false; | |
this.drawArea.mouseChildren = false; | |
this.mouseEnabled = false; | |
this.disable(); | |
} | |
public function getPage():String{ | |
return (this.pg); | |
} | |
public function destroy():void{ | |
this.disable(); | |
this.currentTool = null; | |
this.bg = null; | |
this.drawArea = null; | |
this.toolHolder = null; | |
} | |
public function init(_arg1:PageData):void{ | |
this.pageData = _arg1; | |
this.pageData.setup(this.toolHolder, this.drawArea, this.bg, null); | |
} | |
public function enable(_arg1:ITool):void{ | |
_arg1.setup(this.toolHolder, this.drawArea, this.bg, this.pageData); | |
this.currentTool = _arg1; | |
this.bg.visible = true; | |
} | |
public function isEnabled():Boolean{ | |
return (this.bg.visible); | |
} | |
public function disable():void{ | |
if (this.currentTool != null){ | |
this.currentTool.destroy(); | |
this.currentTool = null; | |
}; | |
this.bg.visible = false; | |
} | |
public function setSize(_arg1:Number, _arg2:Number):void{ | |
this.bg.width = _arg1; | |
this.bg.height = _arg2; | |
} | |
public function clear():void{ | |
var _local2:ITool; | |
var _local1:MovieClip = this.drawArea; | |
while (_local1.numChildren > 0) { | |
_local1.removeChild(_local1.getChildAt(0)); | |
}; | |
this.pageData.destroy(); | |
this.drawArea.bitmapData = new BitmapData(1000, 1000, true, 0xFFFFFF); | |
if (this.currentTool){ | |
_local2 = this.currentTool.duplicate(); | |
this.disable(); | |
this.enable(_local2); | |
}; | |
} | |
public function undo():void{ | |
} | |
public function getActiveArea():MovieClip{ | |
return (this.bg); | |
} | |
} | |
}//package com.vpg.vpage.shell.whiteboard | |
package com.vpg.vpage.shell.whiteboard { | |
import flash.display.*; | |
import com.vpg.vpage.utils.*; | |
import com.vpg.vpage.utils.cursor.*; | |
public class PencilCursor extends BasicCursor { | |
public var tint:MovieClip; | |
public function PencilCursor(_arg1:Number){ | |
if (this.tint){ | |
DisplayU.tint(this.tint, _arg1); | |
}; | |
} | |
} | |
}//package com.vpg.vpage.shell.whiteboard | |
package com.vpg.vpage.shell.audio { | |
import com.vpg.vpage.utils.mediamgr.*; | |
public interface IAudioPlayer extends IMediaPlayer { | |
function init(_arg1:String, _arg2:String):void; | |
function destroy():void; | |
function setScreenSize(_arg1:Number, _arg2:Number):void; | |
} | |
}//package com.vpg.vpage.shell.audio | |
package com.vpg.vpage.shell.index { | |
import flash.events.*; | |
public interface IIndexWindow extends IEventDispatcher { | |
function init(_arg1:String):void; | |
function destroy():void; | |
function setScreenSize(_arg1:Number, _arg2:Number):void; | |
} | |
}//package com.vpg.vpage.shell.index | |
package com.vpg.vpage.shell.index { | |
public class IndexEvents { | |
public static const GOTO_PAGE:String = "gotoPage"; | |
} | |
}//package com.vpg.vpage.shell.index | |
package com.vpg.vpage.shell.multibook { | |
import flash.display.*; | |
import com.vpg.vpage.shell.*; | |
import flash.events.*; | |
import com.vpg.vpage.utils.*; | |
public class MultibookMain extends EventDispatcher { | |
private var _appMap:HashMap; | |
private var _holderMap:HashMap; | |
private var _holder:Sprite; | |
private var _appsLoaded:int; | |
private var _appsToLoad:int; | |
private var _activeBookId:String; | |
public function MultibookMain(_arg1:Sprite){ | |
this._appMap = new HashMap(); | |
this._holderMap = new HashMap(); | |
this._holder = _arg1; | |
} | |
public function getBookIDs():Array{ | |
return (this._appMap.keys().slice()); | |
} | |
public function get_activeBookId():String{ | |
return (this._activeBookId); | |
} | |
public function switchTo(_arg1:String, _arg2:String=null, _arg3:MultibookInitObj=null):void{ | |
var _local6:String; | |
var _local7:App; | |
var _local8:Sprite; | |
var _local4:Array = this._appMap.keys(); | |
var _local5:int; | |
while (_local5 < _local4.length) { | |
_local6 = (_local4[_local5] as String); | |
_local7 = this._appMap.get(_local6); | |
_local8 = this._holderMap.get(_local6); | |
if (_arg1 == _local6){ | |
if (_arg2){ | |
_local7.gotoPage(_arg2); | |
}; | |
if (_arg3){ | |
_local7.multibookSwitchTo(_arg3); | |
}; | |
if (!_local8.parent){ | |
this._holder.addChild(_local8); | |
}; | |
this._activeBookId = _arg1; | |
} else { | |
if (_local8.parent){ | |
_local8.parent.removeChild(_local8); | |
}; | |
}; | |
_local5++; | |
}; | |
} | |
public function getActiveApp():App{ | |
return (this._appMap.get(this._activeBookId)); | |
} | |
public function getApp(_arg1:String):App{ | |
var _local2:App = this._appMap.get(_arg1); | |
return (_local2); | |
} | |
public function setBookIDs(_arg1:Array):void{ | |
var _local3:String; | |
var _local4:Sprite; | |
var _local5:App; | |
this._appsLoaded = 0; | |
this._appsToLoad = _arg1.length; | |
var _local2:int; | |
while (_local2 < _arg1.length) { | |
_local3 = (_arg1[_local2] as String); | |
_local4 = new Sprite(); | |
_local5 = new App(_local4, _arg1[_local2]); | |
_local5.setMultibookMain(this); | |
_local5.addEventListener(Event.COMPLETE, this._appLoadedEvent); | |
_local5.init(); | |
this._appMap.put(_local3, _local5); | |
this._holderMap.put(_local3, _local4); | |
_local2++; | |
}; | |
} | |
private function _appLoadedEvent(_arg1:Event):void{ | |
this._appsLoaded++; | |
if (this._appsLoaded == this._appsToLoad){ | |
dispatchEvent(new Event(Event.COMPLETE)); | |
}; | |
} | |
} | |
}//package com.vpg.vpage.shell.multibook | |
package com.vpg.vpage.shell.multibook { | |
public dynamic class MultibookInitObj { | |
} | |
}//package com.vpg.vpage.shell.multibook | |
package com.vpg.vpage.flashprojector { | |
public class ProjectorEvents { | |
public static const GET_PATH:String = "getPathEvent"; | |
public static const SET_PATH:String = "setPathEvent"; | |
} | |
}//package com.vpg.vpage.flashprojector | |
package com.vpg.vpage.utils { | |
public class StringTokenizer { | |
private var _tokens:Array; | |
private var _nextTokenIndex:Number; | |
public function StringTokenizer(_arg1:String, _arg2:String){ | |
this._tokens = _arg1.split(_arg2); | |
this._nextTokenIndex = 0; | |
} | |
public function destroy():void{ | |
this._tokens = null; | |
} | |
public function countTokens():Number{ | |
return (this._tokens.length); | |
} | |
public function hasMoreTokens():Boolean{ | |
if (this._nextTokenIndex < this._tokens.length){ | |
return (true); | |
}; | |
return (false); | |
} | |
public function nextToken():String{ | |
var _local1:String = this._tokens[this._nextTokenIndex]; | |
this._nextTokenIndex++; | |
return (_local1); | |
} | |
} | |
}//package com.vpg.vpage.utils | |
package com.vpg.vpage.utils { | |
import flash.net.*; | |
import flash.events.*; | |
import flash.utils.*; | |
import com.vpg.vpage.utils.mediamgr.*; | |
import flash.media.*; | |
public class SoundPlayer extends EventDispatcher implements IMediaPlayer { | |
private var _sound:Sound; | |
private var _soundChannel:SoundChannel; | |
private var _soundQueue:Array; | |
private var _isPlaying:Boolean; | |
private var _volume:Number; | |
private var _pausedPosition:Number; | |
private var _lastDispatchedPerc:Number; | |
private var _timer:Timer; | |
private var _startAtTime:Number; | |
private var _stopAtTime:Number; | |
private var _lastPosition:Number; | |
public function SoundPlayer(){ | |
this._sound = new Sound(); | |
this._soundQueue = new Array(); | |
this._isPlaying = false; | |
this._volume = 1; | |
this._startAtTime = -1; | |
this._stopAtTime = -1; | |
this._pausedPosition = -1; | |
this._timer = new Timer(16.6); | |
this._timer.addEventListener(TimerEvent.TIMER, this._tryPositionEvent); | |
this._timer.start(); | |
} | |
public function destroy():void{ | |
if (this._timer){ | |
this._timer.stop(); | |
this._timer.removeEventListener(TimerEvent.TIMER, this._tryPositionEvent); | |
}; | |
this.stopActiveSound(); | |
this._cleanOldSoundChannel(); | |
this._cleanOldSound(); | |
this._sound = null; | |
this._soundChannel = null; | |
this._soundQueue = null; | |
this._timer = null; | |
} | |
public function playSound(_arg1:String=""):void{ | |
this.stopActiveSound(); | |
this._pausedPosition = -1; | |
this._startAtTime = -1; | |
this._stopAtTime = -1; | |
this._playSoundInternal(_arg1); | |
} | |
public function externalHalt():void{ | |
this.stopActiveSound(); | |
} | |
public function stop():void{ | |
this.stopActiveSound(); | |
} | |
public function stopActiveSound():void{ | |
if (this._soundChannel){ | |
this._cleanOldSoundChannel(); | |
this._soundChannel.stop(); | |
this._isPlaying = false; | |
}; | |
} | |
public function pauseActiveSound():void{ | |
if (this._soundChannel){ | |
this._pausedPosition = this.getPosition(); | |
this.stopActiveSound(); | |
}; | |
} | |
public function unPauseSound():void{ | |
this._soundChannel = this._sound.play(this._pausedPosition); | |
this._newSoundChannelBuilt(); | |
this._pausedPosition = -1; | |
} | |
public function queueSound(_arg1:String):void{ | |
this._soundQueue.push(_arg1); | |
if ((((this._soundQueue.length == 1)) && (!(this._isPlaying)))){ | |
this.playNextSound(null); | |
}; | |
} | |
public function isSoundPlaying():Boolean{ | |
return (this._isPlaying); | |
} | |
public function playNextSound(_arg1:Event):void{ | |
var _local2:String; | |
this._isPlaying = false; | |
this._cleanOldSoundChannel(); | |
if (this._soundQueue.length >= 1){ | |
_local2 = this._soundQueue.shift(); | |
this.playSound(_local2); | |
}; | |
} | |
public function playFromPerc(_arg1:Number, _arg2:Boolean=true):void{ | |
var _local3:Number; | |
if (this._soundChannel){ | |
this._pausedPosition = -1; | |
this.stopActiveSound(); | |
_local3 = this._getTimeFromPerc(_arg1); | |
this._soundChannel = this._sound.play(_local3); | |
this._newSoundChannelBuilt(); | |
if (_arg2){ | |
this._playStart(); | |
}; | |
}; | |
} | |
public function playFromTime(_arg1:Number, _arg2:Boolean=true):void{ | |
if (this._soundChannel){ | |
this._pausedPosition = -1; | |
this.stopActiveSound(); | |
_arg1 = Math.min(_arg1, this.getDuration()); | |
this._soundChannel = this._sound.play(_arg1); | |
this._newSoundChannelBuilt(); | |
if (_arg2){ | |
this._playStart(); | |
}; | |
}; | |
} | |
public function mute():void{ | |
this._volume = 0; | |
this._updateVolume(); | |
} | |
public function unmute():void{ | |
this._volume = 1; | |
this._updateVolume(); | |
} | |
public function setVolume(_arg1:Number):void{ | |
this._volume = _arg1; | |
this._updateVolume(); | |
} | |
public function getVolume():Number{ | |
return (this._volume); | |
} | |
public function getDuration():Number{ | |
var _local1:Number; | |
if (this._sound){ | |
_local1 = (this._sound.bytesTotal / (this._sound.bytesLoaded / this._sound.length)); | |
return (((isNaN(_local1)) ? 0 : _local1)); | |
}; | |
return (0); | |
} | |
public function getPosition():Number{ | |
if (this._pausedPosition > 0){ | |
return (this._pausedPosition); | |
}; | |
if (this._soundChannel){ | |
return (this._soundChannel.position); | |
}; | |
return (0); | |
} | |
public function getPositionPercentage():Number{ | |
var _local1:Number = (this.getPosition() / this.getDuration()); | |
if (isNaN(_local1)){ | |
return (0); | |
}; | |
return (_local1); | |
} | |
public function rewind():void{ | |
this.playFromPerc(0, false); | |
this.stopActiveSound(); | |
} | |
public function playSnippet(_arg1:String, _arg2:Number, _arg3:Number):void{ | |
this._startAtTime = _arg2; | |
this._stopAtTime = _arg3; | |
this._pausedPosition = -1; | |
this._playSoundInternal(_arg1); | |
this.stopActiveSound(); | |
} | |
private function _getTimeFromPerc(_arg1:Number):Number{ | |
if (_arg1 < 0){ | |
_arg1 = 0; | |
}; | |
if (_arg1 > 1){ | |
_arg1 = 1; | |
}; | |
return ((_arg1 * this.getDuration())); | |
} | |
private function _updateVolume():void{ | |
var _local1:SoundTransform; | |
if (this._soundChannel){ | |
_local1 = this._soundChannel.soundTransform; | |
_local1.volume = this._volume; | |
this._soundChannel.soundTransform = _local1; | |
}; | |
} | |
private function _soundLoadError(_arg1:IOErrorEvent):void{ | |
this._soundChannel = null; | |
this._forwardEvent(_arg1); | |
} | |
private function _forwardEvent(_arg1:Event):void{ | |
dispatchEvent(_arg1); | |
} | |
private function _newSoundChannelBuilt():void{ | |
this._updateVolume(); | |
if (this._soundChannel){ | |
this._soundChannel.addEventListener(Event.SOUND_COMPLETE, this.playNextSound); | |
this._soundChannel.addEventListener(Event.SOUND_COMPLETE, this._forwardEvent); | |
}; | |
} | |
private function _cleanOldSoundChannel():void{ | |
if (this._soundChannel){ | |
this._soundChannel.removeEventListener(Event.SOUND_COMPLETE, this.playNextSound); | |
this._soundChannel.removeEventListener(Event.SOUND_COMPLETE, this._forwardEvent); | |
}; | |
} | |
private function _tryPositionEvent(_arg1:Event):void{ | |
var _local5:SoundPlayerEvent; | |
var _local2:Number = this.getPositionPercentage(); | |
if (_local2 != this._lastDispatchedPerc){ | |
_local5 = new SoundPlayerEvent(SoundPlayerEvent.POSITION, _local2); | |
this._lastDispatchedPerc = _local2; | |
dispatchEvent(_local5); | |
}; | |
var _local3:Number = this.getPosition(); | |
var _local4:Number = 0; | |
if (this._lastPosition != -1){ | |
_local4 = (_local3 - this._lastPosition); | |
}; | |
if (((!((this._stopAtTime == -1))) && (((this.getPosition() + _local4) >= this._stopAtTime)))){ | |
this._startAtTime = -1; | |
this._stopAtTime = -1; | |
this._lastPosition = -1; | |
this.stopActiveSound(); | |
} else { | |
this._lastPosition = _local3; | |
}; | |
} | |
private function _playStart():void{ | |
var _local1:SoundPlayerEvent = new SoundPlayerEvent(SoundPlayerEvent.START, 0); | |
dispatchEvent(_local1); | |
var _local2:Event = new Event(MediaManager.ON_PLAY); | |
dispatchEvent(_local2); | |
} | |
private function _cleanOldSound():void{ | |
if (this._sound){ | |
this._sound.removeEventListener(IOErrorEvent.IO_ERROR, this._soundLoadError); | |
this._sound.removeEventListener(ProgressEvent.PROGRESS, this._forwardEvent); | |
this._sound.removeEventListener(Event.COMPLETE, this._forwardEvent); | |
}; | |
} | |
private function _soundLoaded(_arg1:Event):void{ | |
if (this._startAtTime != -1){ | |
this._lastPosition = -1; | |
this.playFromTime(this._startAtTime); | |
}; | |
} | |
private function _playSoundInternal(_arg1:String=""):void{ | |
this.stopActiveSound(); | |
if (_arg1){ | |
this._cleanOldSound(); | |
this._sound = new Sound(); | |
this._sound.addEventListener(IOErrorEvent.IO_ERROR, this._soundLoadError); | |
this._sound.addEventListener(ProgressEvent.PROGRESS, this._forwardEvent); | |
this._sound.addEventListener(Event.COMPLETE, this._forwardEvent); | |
this._sound.addEventListener(Event.COMPLETE, this._soundLoaded); | |
this._sound.load(new URLRequest(_arg1)); | |
this._isPlaying = true; | |
this._soundChannel = this._sound.play(); | |
this._newSoundChannelBuilt(); | |
} else { | |
if (this._pausedPosition > -1){ | |
this.unPauseSound(); | |
} else { | |
this.playFromPerc(0); | |
}; | |
}; | |
this._playStart(); | |
} | |
} | |
}//package com.vpg.vpage.utils | |
package com.vpg.vpage.utils { | |
public class ArrayU { | |
public static function binarySearchOn(_arg1:Array, _arg2:String, _arg3, _arg4):Number{ | |
var _local8:Number; | |
var _local9:*; | |
var _local5:Number = _arg1.length; | |
var _local6:Number = 0; | |
var _local7:Number = (_local5 - 1); | |
while (_local6 <= _local7) { | |
_local8 = ((_local6 + _local7) >>> 1); | |
_local9 = _arg1[_local8][_arg2]; | |
if (_local9 < _arg3){ | |
_local6 = (_local8 + 1); | |
} else { | |
if (_local9 > _arg3){ | |
_local7 = (_local8 - 1); | |
} else { | |
return (_local8); | |
}; | |
}; | |
}; | |
if (_arg4){ | |
return (_local8); | |
}; | |
return (-1); | |
} | |
public static function clear(_arg1:Array):void{ | |
var _local2:int; | |
while (_local2 < _arg1.length) { | |
_arg1[_local2] = null; | |
_local2++; | |
}; | |
} | |
public static function addUnique(_arg1:Array, _arg2:Array):void{ | |
var _local4:Object; | |
var _local3:int; | |
while (_local3 < _arg2.length) { | |
_local4 = _arg2[_local3]; | |
if (_arg1.indexOf(_local4) == -1){ | |
_arg1.push(_local4); | |
}; | |
_local3++; | |
}; | |
} | |
public static function shuffle(_arg1:Array):Array{ | |
var _local4:*; | |
var _local5:*; | |
var _local2:Array = _arg1.slice(); | |
var _local3:int; | |
while (_local3 < _local2.length) { | |
_local4 = _local2[_local3]; | |
_local5 = Math.floor((Math.random() * _local2.length)); | |
_local2[_local3] = _local2[_local5]; | |
_local2[_local5] = _local4; | |
_local3++; | |
}; | |
return (_local2); | |
} | |
public static function createRandomIndexes(_arg1:uint):Array{ | |
return (shuffle(createIndexes(_arg1))); | |
} | |
public static function createIndexes(_arg1:uint):Array{ | |
var _local2:Array = new Array(); | |
var _local3:int; | |
while (_local3 < _arg1) { | |
_local2[_local3] = _local3; | |
_local3++; | |
}; | |
return (_local2); | |
} | |
public static function last(_arg1:Array){ | |
if ((((_arg1 == null)) || ((_arg1.length == 0)))){ | |
return (null); | |
}; | |
return (_arg1[(_arg1.length - 1)]); | |
} | |
public static function containsIndex(_arg1:Array, _arg2:int):Boolean{ | |
if ((((_arg2 >= 0)) && ((_arg2 <= (_arg1.length - 1))))){ | |
return (true); | |
}; | |
return (false); | |
} | |
} | |
}//package com.vpg.vpage.utils | |
package com.vpg.vpage.utils { | |
import flash.events.*; | |
import flash.text.*; | |
public class SelectOnFocusField { | |
private static var _fieldMap:HashMap = new HashMap(); | |
public static function registerField(_arg1:TextField, _arg2:String):void{ | |
_arg1.type = TextFieldType.INPUT; | |
_arg1.selectable = true; | |
_arg1.addEventListener(FocusEvent.FOCUS_IN, _fieldFocused); | |
_fieldMap.put(_arg1, _arg2); | |
} | |
public static function deregisterField(_arg1:TextField):void{ | |
_arg1.removeEventListener(FocusEvent.FOCUS_IN, _fieldFocused); | |
_fieldMap.remove(_arg1); | |
} | |
private static function _fieldFocused(_arg1:Event):void{ | |
var _local2:TextField = (_arg1.currentTarget as TextField); | |
var _local3:String = _fieldMap.get(_local2); | |
if ((((((_local2.text == _local3)) || ((_local3 == "")))) || ((_local3 == null)))){ | |
_local2.addEventListener(Event.ENTER_FRAME, _selectAll); | |
}; | |
} | |
private static function _selectAll(_arg1:Event):void{ | |
var _local2:TextField = (_arg1.currentTarget as TextField); | |
_local2.removeEventListener(Event.ENTER_FRAME, _selectAll); | |
var _local3:String = _fieldMap.get(_local2); | |
_local2.setSelection(0, _local2.text.length); | |
} | |
} | |
}//package com.vpg.vpage.utils | |
package com.vpg.vpage.utils { | |
import flash.net.*; | |
import flash.events.*; | |
public class KeyValueFile extends EventDispatcher { | |
private var _loader:URLLoader; | |
private var _results:HashMap; | |
private var _separator:String; | |
private var _keys:Array; | |
public function KeyValueFile(_arg1:String="\t"){ | |
this._separator = _arg1; | |
this._results = new HashMap(); | |
this._keys = new Array(); | |
} | |
public function destroy():void{ | |
this._loader = null; | |
this._results.clear(); | |
this._results = null; | |
ArrayU.clear(this._keys); | |
this._keys = null; | |
} | |
public function getOrderedKeys():Array{ | |
return (this._keys.slice()); | |
} | |
public function load(_arg1:String):void{ | |
this._loader = NetU.doFileLoad(_arg1, this._textLoaded, this._textLoadError); | |
} | |
public function get(_arg1:String, _arg2:int=0):String{ | |
var _local3:Array = this._results.get(_arg1); | |
var _local4:String; | |
if (_local3){ | |
_local4 = _local3[_arg2]; | |
if (!_local4){ | |
_local4 = ""; | |
}; | |
}; | |
return (_local4); | |
} | |
public function getAllValues(_arg1:String):Array{ | |
var _local2:Array = this._results.get(_arg1); | |
if (_local2){ | |
return (_local2.slice()); | |
}; | |
return (new Array()); | |
} | |
public function getNumber(_arg1:String, _arg2:int=0):Number{ | |
var _local3:String = this.get(_arg1, _arg2); | |
return (Number(_local3)); | |
} | |
public function containsKey(_arg1:String):Boolean{ | |
var _local2:String = this.get(_arg1); | |
if (_local2 == null){ | |
return (false); | |
}; | |
return (true); | |
} | |
private function _textLoaded(_arg1:Event):void{ | |
var _local4:String; | |
var _local5:Array; | |
var _local6:String; | |
var _local7:Array; | |
this._results = new HashMap(); | |
var _local2:String = _arg1.target.data; | |
_local2 = StringU.fixLineEndings(_local2); | |
var _local3:StringTokenizer = new StringTokenizer(_local2, "\n"); | |
while (_local3.hasMoreTokens()) { | |
_local4 = _local3.nextToken(); | |
_local5 = _local4.split(this._separator); | |
_local6 = _local5[0]; | |
_local7 = _local5.slice(1); | |
if (_local6){ | |
this._results.put(_local6, _local7); | |
this._keys.push(_local6); | |
}; | |
}; | |
_local3.destroy(); | |
dispatchEvent(new Event(Event.COMPLETE)); | |
} | |
private function _textLoadError(_arg1:Event):void{ | |
this._results = new HashMap(); | |
dispatchEvent(new Event(Event.COMPLETE)); | |
} | |
} | |
}//package com.vpg.vpage.utils | |
package com.vpg.vpage.utils { | |
import flash.events.*; | |
import flash.text.*; | |
public class ChangeColorOnEditField { | |
private static var _colorMap:HashMap = new HashMap(); | |
private static var _textMap:HashMap = new HashMap(); | |
public static function registerField(_arg1:TextField, _arg2:String, _arg3:Number):void{ | |
_arg1.addEventListener(KeyboardEvent.KEY_UP, _fieldChanged); | |
_arg1.addEventListener(KeyboardEvent.KEY_DOWN, _fieldChanged); | |
_textMap.put(_arg1, _arg2); | |
_colorMap.put(_arg1, _arg3); | |
} | |
public static function deregisterField(_arg1:TextField):void{ | |
_arg1.removeEventListener(KeyboardEvent.KEY_UP, _fieldChanged); | |
_arg1.removeEventListener(KeyboardEvent.KEY_DOWN, _fieldChanged); | |
_colorMap.remove(_arg1); | |
_textMap.remove(_arg1); | |
} | |
private static function _fieldChanged(_arg1:Event):void{ | |
var _local4:Number; | |
var _local2:TextField = (_arg1.currentTarget as TextField); | |
var _local3:String = _textMap.get(_local2); | |
if (_local2.text != _local3){ | |
_local4 = _colorMap.get(_local2); | |
_local2.textColor = _local4; | |
}; | |
} | |
} | |
}//package com.vpg.vpage.utils | |
package com.vpg.vpage.utils { | |
import flash.system.*; | |
public class MiscUtils { | |
public static function isDevMode():Boolean{ | |
var _local1:String = Capabilities.playerType; | |
if ((((_local1 == "External")) || ((_local1 == "StandAlone")))){ | |
return (true); | |
}; | |
return (false); | |
} | |
public static function concatAndTrace(_arg1:Array):void{ | |
var _local4:*; | |
var _local2 = ""; | |
var _local3:int; | |
while (_local3 < _arg1.length) { | |
_local4 = _arg1[_local3]; | |
_local2 = (_local2 + (_local4 + " ")); | |
_local3++; | |
}; | |
trace(_local2); | |
} | |
public static function getRandomInt(_arg1:int, _arg2:int):int{ | |
return (Math.floor(((Math.random() * ((1 + _arg2) - _arg1)) + _arg1))); | |
} | |
} | |
}//package com.vpg.vpage.utils | |
package com.vpg.vpage.utils { | |
import flash.display.*; | |
import flash.geom.*; | |
public interface IDraggable { | |
function getDraggableWindow():MovieClip; | |
function getDragHitArea():MovieClip; | |
function getDragBounds():Rectangle; | |
} | |
}//package com.vpg.vpage.utils | |
package com.vpg.vpage.utils { | |
import flash.net.*; | |
import flash.events.*; | |
public class XmlU { | |
public static function nodeExists(_arg1:XMLList):Boolean{ | |
if (_arg1.length() > 0){ | |
return (true); | |
}; | |
return (false); | |
} | |
public static function eventToXML(_arg1:Event):XML{ | |
var _local3:XML; | |
if (_arg1 == null){ | |
return (new XML()); | |
}; | |
var _local2:URLLoader = (_arg1.currentTarget as URLLoader); | |
if ((_local2 is URLLoader)){ | |
_local3 = new XML(_local2.data); | |
return (_local3); | |
}; | |
return (new XML()); | |
} | |
} | |
}//package com.vpg.vpage.utils | |
package com.vpg.vpage.utils { | |
import flash.display.*; | |
import flash.events.*; | |
public class DraggableItem { | |
private static var _activeDraggable:IDraggable; | |
private static var _map:HashMap = new HashMap(); | |
private static var _dragFlags:HashMap = new HashMap(); | |
private static var _bringToTopFlags:HashMap = new HashMap(); | |
public static function registerDraggable(_arg1:IDraggable, _arg2:Boolean=true):void{ | |
var _local3:MovieClip = _arg1.getDragHitArea(); | |
DisplayU.buttonify(_local3); | |
_local3.addEventListener(MouseEvent.MOUSE_DOWN, _beginDragging); | |
_map.put(_local3, _arg1); | |
_dragFlags.put(_arg1, false); | |
_bringToTopFlags.put(_arg1, _arg2); | |
} | |
public static function unregisterDraggable(_arg1:IDraggable):void{ | |
var _local2:MovieClip = _arg1.getDragHitArea(); | |
_local2.removeEventListener(MouseEvent.MOUSE_DOWN, _beginDragging); | |
_map.remove(_arg1); | |
_dragFlags.remove(_arg1); | |
_bringToTopFlags.remove(_arg1); | |
} | |
public static function hasBeenDragged(_arg1:IDraggable):Boolean{ | |
var _local2:Boolean = _dragFlags.get(_arg1); | |
return (_local2); | |
} | |
public static function clearDragFlag(_arg1:IDraggable):void{ | |
_dragFlags.put(_arg1, false); | |
} | |
private static function _beginDragging(_arg1:Event):void{ | |
var _local2:MovieClip = (_arg1.currentTarget as MovieClip); | |
var _local3:IDraggable = _map.get(_local2); | |
_local2.stage.addEventListener(MouseEvent.MOUSE_UP, _endDragging); | |
_activeDraggable = _local3; | |
_local3.getDraggableWindow().startDrag(false, _local3.getDragBounds()); | |
_dragFlags.put(_local3, true); | |
var _local4:Boolean = _bringToTopFlags.get(_local3); | |
if (_local4){ | |
DisplayU.moveToTop(_local3.getDraggableWindow()); | |
}; | |
} | |
private static function _endDragging(_arg1:Event):void{ | |
_activeDraggable.getDraggableWindow().stopDrag(); | |
_activeDraggable.getDraggableWindow().stage.removeEventListener(MouseEvent.MOUSE_UP, _endDragging); | |
_activeDraggable = null; | |
} | |
} | |
}//package com.vpg.vpage.utils | |
package com.vpg.vpage.utils { | |
import flash.events.*; | |
public class EventWithParam extends Event { | |
public var param; | |
public function EventWithParam(_arg1:String, _arg2, _arg3:Boolean=false, _arg4:Boolean=false){ | |
this.param = _arg2; | |
super(_arg1, _arg3, _arg4); | |
} | |
override public function clone():Event{ | |
return (new EventWithParam(type, this.param, bubbles, cancelable)); | |
} | |
override public function toString():String{ | |
return (formatToString("EventWithParam", "type", "param", "bubbles", "cancelable", "eventPhase")); | |
} | |
} | |
}//package com.vpg.vpage.utils | |
package com.vpg.vpage.utils { | |
import flash.utils.*; | |
public class ClassUtils { | |
public static function createClass(_arg1:String){ | |
var ClassReference:* = null; | |
var instance:* = undefined; | |
var className:* = _arg1; | |
try { | |
ClassReference = (getDefinitionByName(className) as Class); | |
instance = new (ClassReference)(); | |
return (instance); | |
} catch(e:Error) { | |
return (null); | |
}; | |
} | |
} | |
}//package com.vpg.vpage.utils | |
package com.vpg.vpage.utils { | |
import flash.text.*; | |
public class StringU { | |
public static function compressWhite(_arg1:String):String{ | |
var _local2:RegExp = /\s+/g; | |
_arg1 = _arg1.replace(_local2, " "); | |
return (_arg1); | |
} | |
public static function trim(_arg1:String):String{ | |
var _local2:RegExp = /^\s*/; | |
_arg1 = _arg1.replace(_local2, ""); | |
_local2 = /\s*$/; | |
_arg1 = _arg1.replace(_local2, ""); | |
return (_arg1); | |
} | |
public static function upcaseCharAt(_arg1:int, _arg2:String):String{ | |
var _local3:String = _arg2.substr(_arg1, 1); | |
_local3 = _local3.toUpperCase(); | |
return ((_local3 + _arg2.substr((_arg1 + 1)))); | |
} | |
public static function convertSpaceEntitiesToLiterals(_arg1:String):String{ | |
var _local2:RegExp = / /g; | |
_arg1 = _arg1.replace(_local2, " "); | |
return (_arg1); | |
} | |
public static function toTimeString(_arg1:Number, _arg2:Boolean=false):String{ | |
var _local3:Number = Math.floor(_arg1); | |
var _local4:Number = Math.floor((_local3 / 60)); | |
_local3 = (_local3 % 60); | |
var _local5 = ""; | |
if (_arg2){ | |
if (_local4 < 10){ | |
_local5 = "0"; | |
}; | |
}; | |
var _local6:String = String(_local3); | |
if (_local3 < 10){ | |
_local6 = ("0" + _local6); | |
}; | |
return ((((_local5 + _local4) + ":") + _local6)); | |
} | |
public static function stripHTMLTags(_arg1:String):String{ | |
var _local2:TextField = new TextField(); | |
_local2.htmlText = _arg1; | |
return (_local2.text); | |
} | |
public static function makeXMLNodeString(_arg1:String, _arg2:String, _arg3:Boolean=true, _arg4:Boolean=false, _arg5:String=""):String{ | |
var _local6 = (("<" + _arg1) + ">"); | |
if (_arg5 != ""){ | |
_local6 = (((("<" + _arg1) + " ") + _arg5) + ">"); | |
}; | |
var _local7 = (("</" + _arg1) + ">"); | |
if (_arg4){ | |
_arg2 = escapeXmlEntities(_arg2); | |
}; | |
if (_arg3){ | |
_arg2 = (("<![CDATA[" + _arg2) + "]]>"); | |
}; | |
return (((_local6 + _arg2) + _local7)); | |
} | |
public static function buildAttribString(_arg1:Array, _arg2:Array):String{ | |
var _local5:String; | |
var _local6:String; | |
var _local3 = ""; | |
var _local4:int; | |
while (_local4 < _arg1.length) { | |
_local5 = _arg1[_local4]; | |
_local6 = _arg2[_local4]; | |
_local3 = (_local3 + (((_local5 + "=\"") + _local6) + "\"")); | |
if (_local4 != (_arg1.length - 1)){ | |
_local3 = (_local3 + " "); | |
}; | |
_local4++; | |
}; | |
return (_local3); | |
} | |
public static function pad(_arg1:String, _arg2:String, _arg3:int):String{ | |
while (_arg1.length < _arg3) { | |
_arg1 = (_arg2 + _arg1); | |
}; | |
return (_arg1); | |
} | |
public static function unpad(_arg1:String, _arg2:String, _arg3:int):String{ | |
while ((((_arg1.charAt(0) == _arg2)) && ((_arg1.length > _arg3)))) { | |
_arg1 = _arg1.substring(1); | |
}; | |
return (_arg1); | |
} | |
public static function removeFileExtension(_arg1:String):String{ | |
var _local2:int = _arg1.lastIndexOf("."); | |
if (_local2 == -1){ | |
return (_arg1); | |
}; | |
return (_arg1.substring(0, _local2)); | |
} | |
public static function getFileExtension(_arg1:String):String{ | |
var _local2:int = _arg1.lastIndexOf("."); | |
if (_local2 == -1){ | |
return (null); | |
}; | |
return (_arg1.substring((_local2 + 1))); | |
} | |
public static function getBasePath(_arg1:String):String{ | |
var _local2:int = _arg1.lastIndexOf("/"); | |
if (_local2 == -1){ | |
return (null); | |
}; | |
return (_arg1.substring(0, (_local2 + 1))); | |
} | |
public static function removeBasePath(_arg1:String):String{ | |
var _local2:int = _arg1.lastIndexOf("/"); | |
if (_local2 == -1){ | |
return (null); | |
}; | |
return (_arg1.substring((_local2 + 1))); | |
} | |
public static function buildFilePath(_arg1:Array, _arg2:String=""):String{ | |
var _local5:String; | |
var _local3 = ""; | |
var _local4:int; | |
while (_local4 < _arg1.length) { | |
_local5 = _arg1[_local4]; | |
_local5 = fixFinalSlash(_local5); | |
_local3 = (_local3 + _local5); | |
_local4++; | |
}; | |
_local3 = (_local3 + _arg2); | |
return (_local3); | |
} | |
public static function fixFinalSlash(_arg1:String):String{ | |
var _local2:int = (_arg1.length - 1); | |
if (((!((_arg1.charAt(_local2) == "/"))) && (!((_arg1 == ""))))){ | |
_arg1 = (_arg1 + "/"); | |
}; | |
return (_arg1); | |
} | |
public static function fixLineEndings(_arg1:String):String{ | |
_arg1 = _arg1.split("\r").join(""); | |
return (_arg1); | |
} | |
public static function escapeXmlEntities(_arg1:String):String{ | |
_arg1 = _arg1.split("&").join("&"); | |
_arg1 = _arg1.split("<").join("<"); | |
_arg1 = _arg1.split(">").join(">"); | |
_arg1 = _arg1.split("\"").join("""); | |
_arg1 = _arg1.split("'").join("'"); | |
return (_arg1); | |
} | |
public static function unescapeXmlEntities(_arg1:String):String{ | |
_arg1 = _arg1.split("&").join("&"); | |
_arg1 = _arg1.split("<").join("<"); | |
_arg1 = _arg1.split(">").join(">"); | |
_arg1 = _arg1.split(""").join("\""); | |
_arg1 = _arg1.split("'").join("'"); | |
return (_arg1); | |
} | |
public static function fixHtmlEntities(_arg1:String):String{ | |
_arg1 = _arg1.split("á").join("á"); | |
_arg1 = _arg1.split("ó").join("ó"); | |
_arg1 = _arg1.split("ñ").join("ñ"); | |
return (_arg1); | |
} | |
} | |
}//package com.vpg.vpage.utils | |
package com.vpg.vpage.utils { | |
import flash.display.*; | |
import flash.geom.*; | |
import flash.events.*; | |
import fl.motion.*; | |
import flash.media.*; | |
public class DisplayU { | |
public static function tint(_arg1:DisplayObject, _arg2:Number):void{ | |
var _local3:ColorTransform = _arg1.transform.colorTransform; | |
_local3.color = _arg2; | |
_arg1.transform.colorTransform = _local3; | |
} | |
public static function setBrightness(_arg1:DisplayObject, _arg2:Number):void{ | |
var _local3:Color = new Color(); | |
_local3.brightness = _arg2; | |
_arg1.transform.colorTransform = _local3; | |
} | |
public static function getVisibleBounds(_arg1:DisplayObject):Rectangle{ | |
var _local2:Matrix = new Matrix(); | |
_local2.tx = -(_arg1.getBounds(null).x); | |
_local2.ty = -(_arg1.getBounds(null).y); | |
var _local3:BitmapData = new BitmapData(_arg1.width, _arg1.height, true, 0); | |
_local3.draw(_arg1, _local2); | |
var _local4:Rectangle = _local3.getColorBoundsRect(0xFFFFFFFF, 0, false); | |
_local3.dispose(); | |
return (_local4); | |
} | |
public static function buttonify(_arg1:MovieClip, _arg2:Function=null):void{ | |
if ((_arg1 is MovieClip)){ | |
_arg1.buttonMode = true; | |
_arg1.useHandCursor = true; | |
_arg1.mouseChildren = false; | |
if (_arg2 != null){ | |
_arg1.addEventListener(MouseEvent.CLICK, _arg2); | |
}; | |
}; | |
} | |
public static function moveToTop(_arg1:DisplayObject):void{ | |
if ((_arg1 is DisplayObject)){ | |
if ((_arg1.parent is DisplayObjectContainer)){ | |
_arg1.parent.setChildIndex(_arg1, (_arg1.parent.numChildren - 1)); | |
}; | |
}; | |
} | |
public static function createVerticalItemList(_arg1:Array, _arg2:Number, _arg3:Number=0, _arg4:Number=0, _arg5:Number=0):Sprite{ | |
var _local10:DisplayObject; | |
var _local6:Sprite = new Sprite(); | |
var _local7:Square = new Square(0xFF0000, 0); | |
_local6.addChild(_local7); | |
var _local8:Number = _arg3; | |
var _local9:int; | |
while (_local9 < _arg1.length) { | |
_local10 = (_arg1[_local9] as DisplayObject); | |
_local10.y = _local8; | |
_local10.x = _arg5; | |
_local8 = (_local8 + (_local10.height + _arg2)); | |
_local6.addChild(_local10); | |
_local9++; | |
}; | |
_local7.setSize(_local7.width, ((_local8 - _arg2) + _arg4)); | |
return (_local6); | |
} | |
public static function scaleToFit(_arg1:DisplayObject, _arg2:Number, _arg3:Number, _arg4:Boolean=true):void{ | |
_arg1.scaleX = (_arg1.scaleY = getScale(_arg1, _arg2, _arg3)); | |
if (_arg4){ | |
trySmooth(_arg1); | |
}; | |
} | |
public static function getScale(_arg1:DisplayObject, _arg2:Number, _arg3:Number):Number{ | |
var _local4:Number = (_arg2 / _arg1.width); | |
var _local5:Number = (_arg3 / _arg1.height); | |
var _local6:Number = Math.min(_local4, _local5); | |
return (_local6); | |
} | |
public static function trySmooth(_arg1:DisplayObject):void{ | |
var _local2:Bitmap; | |
var _local3:Loader; | |
var _local4:Video; | |
if ((_arg1 is Bitmap)){ | |
_local2 = (_arg1 as Bitmap); | |
} else { | |
if ((_arg1 is Loader)){ | |
_local3 = (_arg1 as Loader); | |
if ((_local3.content is Bitmap)){ | |
_local2 = (_local3.content as Bitmap); | |
}; | |
}; | |
}; | |
if (_local2){ | |
_local2.smoothing = true; | |
}; | |
if ((_arg1 is Video)){ | |
_local4 = (_arg1 as Video); | |
_local4.smoothing = true; | |
}; | |
} | |
public static function removeFromDisplayList(_arg1:DisplayObject):void{ | |
if (((_arg1) && (_arg1.parent))){ | |
_arg1.parent.removeChild(_arg1); | |
}; | |
} | |
public static function removeAllFromDisplayList(_arg1:Array):void{ | |
var _local3:DisplayObject; | |
if (_arg1 == null){ | |
return; | |
}; | |
var _local2:int; | |
while (_local2 < _arg1.length) { | |
_local3 = (_arg1[_local2] as DisplayObject); | |
if (_local3){ | |
removeFromDisplayList(_local3); | |
}; | |
_local2++; | |
}; | |
} | |
public static function tryGotoAndPlay(_arg1:MovieClip, _arg2:String):void{ | |
if (((_arg1) && (hasFrameLabel(_arg1, _arg2)))){ | |
_arg1.gotoAndPlay(_arg2); | |
}; | |
} | |
public static function hasFrameLabel(_arg1:MovieClip, _arg2:String):Boolean{ | |
var _local5:FrameLabel; | |
var _local3:Array = _arg1.currentLabels; | |
var _local4:int; | |
while (_local4 < _local3.length) { | |
_local5 = (_local3[_local4] as FrameLabel); | |
if (_local5.name == _arg2){ | |
return (true); | |
}; | |
_local4++; | |
}; | |
return (false); | |
} | |
} | |
}//package com.vpg.vpage.utils | |
package com.vpg.vpage.utils { | |
import flash.display.*; | |
public class ParamManager { | |
private var _overrides:HashMap; | |
private var _context:LoaderInfo; | |
public function ParamManager(_arg1:LoaderInfo){ | |
this._context = _arg1; | |
this._overrides = new HashMap(); | |
} | |
public function getVal(_arg1:String):String{ | |
var _local2:String = this._overrides.get(_arg1); | |
if (_local2){ | |
return (_local2); | |
}; | |
return (this._getLoaderParam(_arg1)); | |
} | |
public function setVal(_arg1:String, _arg2:String):void{ | |
this._overrides.put(_arg1, _arg2); | |
} | |
public function hasParam(_arg1:String):Boolean{ | |
if (this._overrides.containsKey(_arg1)){ | |
return (true); | |
}; | |
if (this._getLoaderParam(_arg1)){ | |
return (true); | |
}; | |
return (false); | |
} | |
public function destroy():void{ | |
this._overrides.clear(); | |
this._overrides = null; | |
this._context = null; | |
} | |
private function _getLoaderParam(_arg1:String):String{ | |
var _local2:Object; | |
var _local3:String; | |
if (((this._context) && (this._context.parameters))){ | |
_local2 = this._context.parameters; | |
_local3 = _local2[_arg1]; | |
if (_local3 == null){ | |
_local3 = ""; | |
}; | |
_local3 = StringU.trim(_local3); | |
if ((((((_local3 == "undefined")) || ((_local3 == "null")))) || ((_local3 == null)))){ | |
return (""); | |
}; | |
return (_local3); | |
}; | |
return (""); | |
} | |
} | |
}//package com.vpg.vpage.utils | |
package com.vpg.vpage.utils { | |
public class Alphabet { | |
private static const LETTER_LIST = "abcdefghijklmnopqrstuvwxyz"; | |
private var _letters:String; | |
private var _letterIndex:int; | |
public function Alphabet(_arg1:Boolean){ | |
this._letterIndex = -1; | |
if (_arg1){ | |
this._letters = LETTER_LIST.toUpperCase(); | |
} else { | |
this._letters = LETTER_LIST; | |
}; | |
} | |
public static function letterAt(_arg1:int, _arg2:Boolean=true){ | |
var _local3:* = LETTER_LIST.charAt(_arg1); | |
if (_arg2){ | |
_local3 = _local3.toUpperCase(); | |
}; | |
return (_local3); | |
} | |
public static function indexOf(_arg1:String){ | |
_arg1 = _arg1.toLowerCase(); | |
var _local2:* = LETTER_LIST.indexOf(_arg1); | |
return (_local2); | |
} | |
public function hasMoreLetters():Boolean{ | |
if (this._letterIndex < (this._letters.length - 1)){ | |
return (true); | |
}; | |
return (false); | |
} | |
public function getNextLetter():String{ | |
this._letterIndex++; | |
var _local1:* = this._letters.charAt(this._letterIndex); | |
return (_local1); | |
} | |
} | |
}//package com.vpg.vpage.utils | |
package com.vpg.vpage.utils { | |
import flash.text.*; | |
public class TextUtils { | |
public static function createTextField(_arg1:String, _arg2:Number, _arg3:Number=0, _arg4:String=null):TextField{ | |
var _local5:TextField = new TextField(); | |
var _local6:TextFormat = new TextFormat(); | |
_local6.font = _arg1; | |
_local6.size = _arg2; | |
_local6.leading = Object((((_arg3 > 0)) ? _arg3 : null)); | |
_local6.align = _arg4; | |
_local5.multiline = true; | |
_local5.setTextFormat(_local6); | |
_local5.selectable = false; | |
_local5.defaultTextFormat = _local6; | |
_local5.embedFonts = true; | |
_local5.antiAliasType = AntiAliasType.ADVANCED; | |
_local5.gridFitType = GridFitType.SUBPIXEL; | |
_local5.mouseWheelEnabled = (_local5.mouseEnabled = false); | |
return (_local5); | |
} | |
public static function setAlignment(_arg1:TextField, _arg2:String):void{ | |
var _local3:TextFormat = new TextFormat(); | |
_local3.align = _arg2; | |
_arg1.setTextFormat(_local3); | |
} | |
public static function changeFontPointSize(_arg1:TextField, _arg2:Number):void{ | |
var _local3:TextFormat = new TextFormat(); | |
_local3.size = _arg2; | |
_arg1.setTextFormat(_local3); | |
_arg1.defaultTextFormat = _local3; | |
} | |
public static function colorLinks(_arg1:TextField, _arg2:Number, _arg3:Boolean):void{ | |
var _local6:TextFormat; | |
var _local4:TextFormat = new TextFormat(null, null, _arg2, null, null, _arg3); | |
var _local5:int; | |
while (_local5 < _arg1.text.length) { | |
_local6 = _arg1.getTextFormat(_local5); | |
if (((!((_local6.url == null))) && (_local6.url.length))){ | |
_arg1.setTextFormat(_local4, _local5, (_local5 + 1)); | |
}; | |
_local5++; | |
}; | |
} | |
public static function expandHeight(_arg1:TextField):void{ | |
_arg1.autoSize = TextFieldAutoSize.LEFT; | |
_arg1.wordWrap = true; | |
_arg1.multiline = true; | |
} | |
public static function expandWidth(_arg1:TextField):void{ | |
_arg1.autoSize = TextFieldAutoSize.LEFT; | |
_arg1.wordWrap = false; | |
_arg1.multiline = false; | |
} | |
public static function shrinkToFit(_arg1:TextField, _arg2:String, _arg3:Boolean=true, _arg4:Number=1):Number{ | |
_arg1.wordWrap = true; | |
_arg1.text = " "; | |
var _local5:TextFormat = _arg1.getTextFormat(); | |
var _local6:Array = _arg2.split(" "); | |
var _local7:int; | |
while (_local7 < _local6.length) { | |
_arg1.htmlText = _local6[_local7]; | |
while (((!((_arg1.numLines == 1))) && ((_local5.size > _arg4)))) { | |
_local5.size = (Number(_local5.size) - 1); | |
_arg1.setTextFormat(_local5); | |
}; | |
_local7++; | |
}; | |
_arg1.htmlText = _arg2; | |
if (_arg3){ | |
while (((!((_arg1.maxScrollV == 1))) && ((_local5.size > _arg4)))) { | |
_local5.size = (Number(_local5.size) - 1); | |
_arg1.setTextFormat(_local5); | |
}; | |
}; | |
_arg1.setTextFormat(_local5); | |
return (Number(_local5.size)); | |
} | |
public static function changeLeading(_arg1:TextField, _arg2:Number):void{ | |
var _local3:TextFormat = new TextFormat(); | |
_local3.leading = _arg2; | |
_arg1.setTextFormat(_local3); | |
_arg1.defaultTextFormat = _local3; | |
} | |
} | |
}//package com.vpg.vpage.utils | |
package com.vpg.vpage.utils.print { | |
import flash.display.*; | |
public interface IPrintable { | |
function getDisplayObject():DisplayObject; | |
function setPageSize(_arg1:int, _arg2:int):void; | |
} | |
}//package com.vpg.vpage.utils.print | |
package com.vpg.vpage.utils.print { | |
import flash.display.*; | |
import flash.printing.*; | |
public class Printer { | |
public static function print(_arg1:Array, _arg2:Boolean):void{ | |
var _local4:int; | |
var _local5:IPrintable; | |
var _local3:PrintJob = new PrintJob(); | |
if (_local3.start()){ | |
_local4 = 0; | |
while (_local4 < _arg1.length) { | |
_local5 = (_arg1[_local4] as IPrintable); | |
_local5.setPageSize(_local3.pageWidth, _local3.pageHeight); | |
_local4++; | |
}; | |
_runPrintJob(_local3, _arg1, _arg2); | |
}; | |
} | |
public static function simplePrint(_arg1:Array, _arg2:Boolean):void{ | |
var _local4:Number; | |
var _local5:Number; | |
var _local6:int; | |
var _local7:DisplayObject; | |
var _local8:Number; | |
var _local9:Number; | |
var _local10:Number; | |
var _local11:Number; | |
var _local12:Number; | |
var _local3:PrintJob = new PrintJob(); | |
if (_local3.start()){ | |
_local4 = _local3.pageWidth; | |
_local5 = _local3.pageHeight; | |
_local6 = 0; | |
while (_local6 < _arg1.length) { | |
_local7 = (_arg1[_local6] as DisplayObject); | |
_local8 = _local7.width; | |
_local9 = _local7.height; | |
_local10 = (_local4 / _local8); | |
_local11 = (_local5 / _local9); | |
_local12 = Math.min(_local10, _local11); | |
_local7.scaleX = (_local7.scaleY = _local12); | |
_local6++; | |
}; | |
_runPrintJob(_local3, _arg1, _arg2); | |
}; | |
} | |
private static function _runPrintJob(_arg1:PrintJob, _arg2:Array, _arg3:Boolean):void{ | |
var _local4:PrintJobOptions = new PrintJobOptions(_arg3); | |
var _local5:int; | |
var _local6:int; | |
while (_local6 < _arg2.length) { | |
try { | |
_arg1.addPage(_arg2[_local6], null, _local4); | |
_local5++; | |
} catch(e:Error) { | |
}; | |
_local6++; | |
}; | |
if (_local5 > 0){ | |
_arg1.send(); | |
}; | |
} | |
} | |
}//package com.vpg.vpage.utils.print | |
package com.vpg.vpage.utils.print { | |
import flash.display.*; | |
import flash.text.*; | |
import com.vpg.vpage.utils.*; | |
public class TextPrintable extends Sprite implements IPrintable { | |
private var _bg:Square; | |
private var _tf:TextField; | |
public function TextPrintable(_arg1:String, _arg2:String, _arg3:Number, _arg4:Number){ | |
this._bg = new Square(0xFFFFFF); | |
addChild(this._bg); | |
this._tf = TextUtils.createTextField(_arg2, _arg3, _arg4); | |
addChild(this._tf); | |
this._tf.wordWrap = true; | |
this._tf.multiline = true; | |
this._tf.htmlText = _arg1; | |
} | |
public function getDisplayObject():DisplayObject{ | |
return (this); | |
} | |
public function setPageSize(_arg1:int, _arg2:int):void{ | |
this._bg.setSize(_arg1, _arg2); | |
this._tf.width = _arg1; | |
this._tf.height = _arg2; | |
} | |
} | |
}//package com.vpg.vpage.utils.print | |
package com.vpg.vpage.utils { | |
import flash.events.*; | |
public class SoundPlayerEvent extends Event { | |
public static const POSITION:String = "positionUpdate"; | |
public static const START:String = "playStart"; | |
public var perc:Number; | |
public function SoundPlayerEvent(_arg1:String, _arg2:Number, _arg3:Boolean=false, _arg4:Boolean=false){ | |
this.perc = _arg2; | |
super(_arg1, _arg3, _arg4); | |
} | |
override public function clone():Event{ | |
return (new SoundPlayerEvent(type, this.perc, bubbles, cancelable)); | |
} | |
override public function toString():String{ | |
return (formatToString("SoundPlayerEvent", "type", "perc", "bubbles", "cancelable", "eventPhase")); | |
} | |
} | |
}//package com.vpg.vpage.utils | |
package com.vpg.vpage.utils.mediamgr { | |
import flash.events.*; | |
public interface IMediaPlayer extends IEventDispatcher { | |
function externalHalt():void; | |
} | |
}//package com.vpg.vpage.utils.mediamgr | |
package com.vpg.vpage.utils.mediamgr { | |
import flash.events.*; | |
import com.vpg.vpage.utils.*; | |
public class MediaManager extends EventDispatcher { | |
public static const ON_PLAY:String = "onMediaPlay"; | |
private var _players:Array; | |
public function MediaManager(){ | |
this._players = new Array(); | |
} | |
public function destroy():void{ | |
var _local1:int; | |
while (_local1 < this._players.length) { | |
this.deregisterPlayer(this._players[_local1]); | |
this._players[_local1] = null; | |
_local1++; | |
}; | |
this._players = null; | |
} | |
public function registerPlayer(_arg1:IMediaPlayer):void{ | |
_arg1.addEventListener(MediaManager.ON_PLAY, this._stopOtherPlayers); | |
this._players.push(_arg1); | |
} | |
public function deregisterPlayer(_arg1:IMediaPlayer):void{ | |
_arg1.removeEventListener(MediaManager.ON_PLAY, this._stopOtherPlayers); | |
var _local2:int = this._players.indexOf(_arg1); | |
if (_local2 != -1){ | |
this._players.splice(_local2, 1); | |
}; | |
} | |
public function stopAll():void{ | |
var _local2:IMediaPlayer; | |
var _local1:int; | |
while (_local1 < this._players.length) { | |
_local2 = (this._players[_local1] as IMediaPlayer); | |
_local2.externalHalt(); | |
_local1++; | |
}; | |
} | |
private function _stopOtherPlayers(_arg1:Event):void{ | |
var _local4:IMediaPlayer; | |
var _local2:IMediaPlayer = (_arg1.currentTarget as IMediaPlayer); | |
var _local3:int; | |
while (_local3 < this._players.length) { | |
_local4 = (this._players[_local3] as IMediaPlayer); | |
if (_local2 != _local4){ | |
_local4.externalHalt(); | |
}; | |
_local3++; | |
}; | |
dispatchEvent(new EventWithParam(ON_PLAY, _local2)); | |
} | |
} | |
}//package com.vpg.vpage.utils.mediamgr | |
package com.vpg.vpage.utils { | |
import flash.display.*; | |
import flash.net.*; | |
import flash.events.*; | |
import flash.external.*; | |
public class NetU { | |
private static var _completeFunctions:HashMap = new HashMap(); | |
private static var _errorFunctions:HashMap = new HashMap(); | |
public static function openJSWindow(_arg1:String, _arg2:int, _arg3:int):void{ | |
var _local4 = (((((("window.open('" + _arg1) + "','_blank','height=") + _arg3) + ",width=") + _arg2) + ",toolbar=no,scrollbars=yes');"); | |
var _local5 = (("javascript:" + _local4) + " void(0);"); | |
var _local6:URLRequest = new URLRequest(_local5); | |
navigateToURL(_local6, "_self"); | |
} | |
public static function openURL(_arg1:String, _arg2:String="_blank"):void{ | |
var _local3:URLRequest = new URLRequest(_arg1); | |
navigateToURL(_local3, _arg2); | |
} | |
public static function doFileLoad(_arg1:String, _arg2:Function, _arg3:Function, _arg4:Boolean=true):URLLoader{ | |
var _local5:URLLoader = new URLLoader(); | |
var _local6:URLRequest = new URLRequest(_arg1); | |
_local5.addEventListener(Event.COMPLETE, _arg2); | |
_local5.addEventListener(IOErrorEvent.IO_ERROR, _arg3); | |
if (_arg4){ | |
_completeFunctions.put(_local5, _arg2); | |
_errorFunctions.put(_local5, _arg3); | |
_local5.addEventListener(Event.COMPLETE, _autoCleanEvents); | |
_local5.addEventListener(IOErrorEvent.IO_ERROR, _autoCleanEvents); | |
}; | |
_local5.load(_local6); | |
return (_local5); | |
} | |
public static function cleanFileLoadEvents(_arg1:URLLoader, _arg2:Function, _arg3:Function):void{ | |
_arg1.removeEventListener(Event.COMPLETE, _arg2); | |
_arg1.removeEventListener(IOErrorEvent.IO_ERROR, _arg3); | |
} | |
public static function doArtLoad(_arg1:String, _arg2:Function, _arg3:Function, _arg4:Boolean=true):Loader{ | |
var _local5:Loader = new Loader(); | |
_local5.contentLoaderInfo.addEventListener(Event.COMPLETE, _arg2); | |
_local5.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, _arg3); | |
var _local6:URLRequest = new URLRequest(_arg1); | |
if (_arg4){ | |
_completeFunctions.put(_local5.contentLoaderInfo, _arg2); | |
_errorFunctions.put(_local5.contentLoaderInfo, _arg3); | |
_local5.contentLoaderInfo.addEventListener(Event.COMPLETE, _autoCleanEvents); | |
_local5.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, _autoCleanEvents); | |
}; | |
_local5.load(_local6); | |
return (_local5); | |
} | |
public static function cleanArtLoadEvents(_arg1:Loader, _arg2:Function, _arg3:Function):void{ | |
cleanArtLoadEventsInfo(_arg1.contentLoaderInfo, _arg2, _arg3); | |
} | |
public static function cleanArtLoadEventsInfo(_arg1:LoaderInfo, _arg2:Function, _arg3:Function):void{ | |
_arg1.removeEventListener(Event.COMPLETE, _arg2); | |
_arg1.removeEventListener(IOErrorEvent.IO_ERROR, _arg3); | |
} | |
public static function consoleLog(_arg1):void{ | |
ExternalInterface.call("consoleLog", _arg1); | |
} | |
private static function _autoCleanEvents(_arg1:Event):void{ | |
var _local2:IEventDispatcher = (_arg1.currentTarget as IEventDispatcher); | |
var _local3:Function = _completeFunctions.get(_local2); | |
var _local4:Function = _errorFunctions.get(_local2); | |
_local2.removeEventListener(Event.COMPLETE, _local3); | |
_local2.removeEventListener(IOErrorEvent.IO_ERROR, _local4); | |
_local2.removeEventListener(Event.COMPLETE, _autoCleanEvents); | |
_local2.removeEventListener(IOErrorEvent.IO_ERROR, _autoCleanEvents); | |
_completeFunctions.remove(_local2); | |
_errorFunctions.remove(_local2); | |
} | |
} | |
}//package com.vpg.vpage.utils | |
package com.vpg.vpage.utils { | |
import flash.display.*; | |
public class Square extends MovieClip { | |
private var _color:uint; | |
private var _alphaVal:Number; | |
private var _w:Number; | |
private var _h:Number; | |
public function Square(_arg1:uint=0, _arg2:Number=1){ | |
this._w = 100; | |
this._h = 100; | |
this._color = _arg1; | |
this._alphaVal = _arg2; | |
this._redraw(); | |
} | |
public function changeColor(_arg1:uint):void{ | |
this._color = _arg1; | |
this._redraw(); | |
} | |
public function setSize(_arg1:Number, _arg2:Number):void{ | |
this._w = _arg1; | |
this._h = _arg2; | |
this._redraw(); | |
} | |
private function _redraw():void{ | |
graphics.clear(); | |
graphics.beginFill(this._color, this._alphaVal); | |
graphics.drawRect(0, 0, this._w, this._h); | |
graphics.endFill(); | |
} | |
} | |
}//package com.vpg.vpage.utils | |
package com.vpg.vpage.utils.iterator { | |
public class ArrayIterator implements IIterator { | |
private var _nextIndex:Number; | |
private var _elements:Array; | |
public function ArrayIterator(_arg1:Array){ | |
this._elements = _arg1; | |
this._nextIndex = 0; | |
} | |
public function hasNext():Boolean{ | |
if ((((this._elements.length == 0)) || ((this._elements == null)))){ | |
return (false); | |
}; | |
if (this._nextIndex < this._elements.length){ | |
return (true); | |
}; | |
return (false); | |
} | |
public function next(){ | |
var _local1:*; | |
if (this.hasNext()){ | |
_local1 = this._elements[this._nextIndex]; | |
this._nextIndex++; | |
return (_local1); | |
}; | |
return (undefined); | |
} | |
public function remove():void{ | |
this._elements.splice((this._nextIndex - 1), 1); | |
} | |
} | |
}//package com.vpg.vpage.utils.iterator | |
package com.vpg.vpage.utils.iterator { | |
public interface IIterator { | |
function hasNext():Boolean; | |
function next(); | |
function remove():void; | |
} | |
}//package com.vpg.vpage.utils.iterator | |
package com.vpg.vpage.utils { | |
import flash.utils.*; | |
public class HashMap { | |
private var _dict:Dictionary; | |
public function HashMap(){ | |
this._dict = new Dictionary(); | |
} | |
public function put(_arg1, _arg2):void{ | |
this._dict[_arg1] = _arg2; | |
} | |
public function get(_arg1){ | |
return (this._dict[_arg1]); | |
} | |
public function remove(_arg1):void{ | |
delete this._dict[_arg1]; | |
} | |
public function clear():void{ | |
var _local1:Array = this.keys(); | |
var _local2:int; | |
while (_local2 < _local1.length) { | |
this.remove(_local1[_local2]); | |
_local2++; | |
}; | |
this._dict = new Dictionary(); | |
} | |
public function keys():Array{ | |
var _local2:*; | |
var _local1:Array = new Array(); | |
for (_local2 in this._dict) { | |
_local1.push(_local2); | |
}; | |
return (_local1); | |
} | |
public function values():Array{ | |
var _local2:*; | |
var _local1:Array = new Array(); | |
for (_local2 in this._dict) { | |
_local1.push(this._dict[_local2]); | |
}; | |
return (_local1); | |
} | |
public function containsKey(_arg1):Boolean{ | |
return (this._dict.hasOwnProperty(_arg1)); | |
} | |
public function containsValue(_arg1):Boolean{ | |
var _local2:*; | |
for (_local2 in this._dict) { | |
if (this._dict[_local2] == _arg1){ | |
return (true); | |
}; | |
}; | |
return (false); | |
} | |
public function getByValue(_arg1){ | |
var _local4:*; | |
var _local2:Array = this.keys(); | |
var _local3:int; | |
while (_local3 < _local2.length) { | |
_local4 = this.get(_local2[_local3]); | |
if (_local4 == _arg1){ | |
return (_local2[_local3]); | |
}; | |
_local3++; | |
}; | |
return (null); | |
} | |
public function toString():String{ | |
var _local1:Array = this.keys(); | |
var _local2:Array = new Array(); | |
var _local3:int; | |
while (_local3 < _local1.length) { | |
_local2.push(((_local1[_local3] + "->") + this.get(_local1[_local3]))); | |
_local3++; | |
}; | |
return (_local2.join(",")); | |
} | |
} | |
}//package com.vpg.vpage.utils | |
package com.vpg.vpage.utils.cursor { | |
import flash.display.*; | |
import flash.geom.*; | |
import flash.events.*; | |
import flash.ui.*; | |
public class BasicCursor extends MovieClip { | |
public static const SHOW:String = "onCursorShow"; | |
public static const HIDE:String = "onCursorHide"; | |
private var _activeZone:Sprite; | |
private var _enabled:Boolean; | |
public function BasicCursor(){ | |
mouseEnabled = false; | |
mouseChildren = false; | |
this._enabled = false; | |
} | |
public function destroy():void{ | |
this.disable(); | |
this._activeZone = null; | |
} | |
public function setActiveZone(_arg1:Sprite):void{ | |
this._activeZone = _arg1; | |
} | |
public function enable():void{ | |
this._activeZone.addEventListener(MouseEvent.MOUSE_OVER, this.show); | |
this._activeZone.addEventListener(MouseEvent.MOUSE_OUT, this.hide); | |
addEventListener(Event.ENTER_FRAME, this.updateCursor); | |
this._enabled = true; | |
} | |
public function disable():void{ | |
if (this._activeZone){ | |
this._activeZone.removeEventListener(MouseEvent.MOUSE_OVER, this.show); | |
this._activeZone.removeEventListener(MouseEvent.MOUSE_OUT, this.hide); | |
}; | |
removeEventListener(Event.ENTER_FRAME, this.updateCursor); | |
this.hide(); | |
this._enabled = false; | |
} | |
public function isEnabled():Boolean{ | |
return (this._enabled); | |
} | |
public function show(_arg1:Event=null):void{ | |
visible = true; | |
Mouse.hide(); | |
dispatchEvent(new Event(SHOW)); | |
} | |
public function hide(_arg1:Event=null):void{ | |
visible = false; | |
x = 100; | |
y = 100; | |
Mouse.show(); | |
dispatchEvent(new Event(HIDE)); | |
} | |
public function updateCursor(_arg1:Event=null):void{ | |
if (this._activeZone == null){ | |
return; | |
}; | |
var _local2:Rectangle = this._activeZone.getBounds(parent); | |
var _local3:DisplayObject = parent; | |
var _local4:Number = _local2.left; | |
var _local5:Number = _local2.right; | |
if (_local3.mouseX < _local4){ | |
x = _local4; | |
} else { | |
if (_local3.mouseX > _local5){ | |
x = _local5; | |
} else { | |
x = _local3.mouseX; | |
}; | |
}; | |
var _local6:Number = _local2.top; | |
var _local7:Number = _local2.bottom; | |
if (_local3.mouseY < _local6){ | |
y = _local6; | |
} else { | |
if (_local3.mouseY > _local7){ | |
y = _local7; | |
} else { | |
y = _local3.mouseY; | |
}; | |
}; | |
} | |
} | |
}//package com.vpg.vpage.utils.cursor | |
package com.vpg.vpage.utils { | |
import flash.events.*; | |
import flash.text.*; | |
public class SubmitOnEnterField { | |
private static var _functionMap:HashMap = new HashMap(); | |
public static function registerField(_arg1:TextField, _arg2:Function):void{ | |
_arg1.addEventListener(KeyboardEvent.KEY_DOWN, _keyHandler); | |
_arg1.wordWrap = false; | |
_arg1.multiline = false; | |
_arg1.type = TextFieldType.INPUT; | |
_arg1.selectable = true; | |
_functionMap.put(_arg1, _arg2); | |
} | |
public static function deregisterField(_arg1:TextField):void{ | |
_arg1.removeEventListener(KeyboardEvent.KEY_DOWN, _keyHandler); | |
_functionMap.remove(_arg1); | |
} | |
private static function _keyHandler(_arg1:KeyboardEvent):void{ | |
var _local2:Function; | |
if (_arg1.charCode == 13){ | |
_local2 = _functionMap.get(_arg1.currentTarget); | |
_local2(_arg1.currentTarget); | |
}; | |
} | |
} | |
}//package com.vpg.vpage.utils | |
package com.vpg.lib.effects.pageflip { | |
import flash.events.*; | |
public class PageFlipEvent extends Event { | |
public static const START:String = "pageFlipStart"; | |
public static const END:String = "pageFlipEnd"; | |
public function PageFlipEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false){ | |
super(_arg1, _arg2, _arg3); | |
} | |
} | |
}//package com.vpg.lib.effects.pageflip | |
package com.vpg.lib.effects.pageflip { | |
import flash.display.*; | |
import flash.geom.*; | |
import flash.events.*; | |
import caurina.transitions.*; | |
public class PageSpreadFlip extends EventDispatcher { | |
private static var red:ColorTransform = createSimpleColorTransform(0xFF, 0, 0, 102); | |
private static var green:ColorTransform = createSimpleColorTransform(0, 153, 0, 170); | |
private static var blue:ColorTransform = createSimpleColorTransform(0, 0, 0xFF, 170); | |
private static var purple:ColorTransform = createSimpleColorTransform(68, 17, 68, 0xFF); | |
private static var grey:ColorTransform = createSimpleColorTransform(0, 0, 0, 68); | |
private var container:DisplayObjectContainer; | |
private var fromSpread:DisplayObject; | |
private var toSpread:DisplayObject; | |
private var flippingPage:Sprite; | |
private var flippingPageMask:Shape; | |
protected var fromSpreadMask:Shape; | |
protected var visualizeMetricsFlag:Boolean = false; | |
protected var spreadRect:Rectangle; | |
private var dots:Sprite; | |
protected var origin:Point; | |
private var spineTop:Point; | |
private var spineBottom:Point; | |
protected var startCorner:Point; | |
protected var pageWidth:Number; | |
private var pageHeight:Number; | |
protected var pageHalfHeight:Number; | |
private var mouse:Point; | |
private var follow:Point; | |
private var radius1:Point; | |
private var radius2:Point; | |
private var bisector:Point; | |
private var dx:Number = 0; | |
private var dy:Number = 0; | |
private var a2f:Number = 0; | |
private var fixedRadius:Number = 0; | |
private var pageDiagonal:Number; | |
private var distanceToFollow:Number; | |
private var corner:Point; | |
protected var tangentBottom:Point; | |
private var maskSize:Point; | |
private var bisectorAngle:Number; | |
private var bisectorTanget:Number; | |
private var tangentToCornerAngle:Number; | |
private var tangentTopX:Number; | |
protected var tangentTop:Point; | |
public function PageSpreadFlip(_arg1:DisplayObject, _arg2:DisplayObject){ | |
this.mouse = new Point(0, 0); | |
this.follow = new Point(0, 0); | |
this.radius1 = new Point(0, 0); | |
this.radius2 = new Point(0, 0); | |
this.bisector = new Point(0, 0); | |
this.corner = new Point(0, 0); | |
this.tangentBottom = new Point(0, 0); | |
this.maskSize = new Point(0, 0); | |
this.tangentTop = new Point(0, 0); | |
super(); | |
this.container = _arg1.parent; | |
this.fromSpread = _arg1; | |
this.toSpread = _arg2; | |
this.initMetrics(); | |
this.createPageAndMasks(); | |
this.resetDots(); | |
} | |
public static function createSimpleColorTransform(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):ColorTransform{ | |
return (new ColorTransform(0, 0, 0, 0, _arg1, _arg2, _arg3, _arg4)); | |
} | |
private function initMetrics():void{ | |
this.spreadRect = this.toSpread.getBounds(this.container); | |
this.pageWidth = (this.spreadRect.width / 2); | |
this.pageHeight = this.spreadRect.height; | |
this.pageHalfHeight = (this.pageHeight * 0.5); | |
this.origin = new Point(this.pageWidth, (this.pageHeight / 2)); | |
this.spineBottom = new Point(0, this.pageHalfHeight); | |
this.spineTop = new Point(0, -(this.pageHalfHeight)); | |
this.fixedRadius = this.pageWidth; | |
this.pageDiagonal = Math.sqrt(((this.pageWidth * this.pageWidth) + (this.pageHeight * this.pageHeight))); | |
this.initStartCorner(); | |
} | |
protected function initStartCorner():void{ | |
this.startCorner = new Point(this.pageWidth, this.pageHalfHeight); | |
} | |
private function createPageAndMasks():void{ | |
this.createFromPageMask(); | |
this.createFlippingPage(); | |
this.createFlippingPageMask(); | |
} | |
private function removePageAndMasks():void{ | |
if (!this.visualizeMetricsFlag){ | |
this.fromSpread.mask = null; | |
}; | |
this.container.removeChild(this.fromSpreadMask); | |
if (!this.visualizeMetricsFlag){ | |
this.flippingPage.mask = null; | |
}; | |
this.container.removeChild(this.flippingPage); | |
this.container.removeChild(this.flippingPageMask); | |
} | |
private function createFromPageMask():void{ | |
var _local1:Number = ((this.visualizeMetricsFlag) ? 0.33 : 1); | |
var _local2:Shape = new Shape(); | |
var _local3:Graphics = _local2.graphics; | |
_local3.beginFill(0xFF00, _local1); | |
_local3.drawRect(this.spreadRect.x, this.spreadRect.y, this.spreadRect.width, this.spreadRect.height); | |
_local3.endFill(); | |
this.container.addChild(_local2); | |
if (!this.visualizeMetricsFlag){ | |
this.fromSpread.mask = _local2; | |
}; | |
this.fromSpreadMask = _local2; | |
} | |
private function createFlippingPage():void{ | |
var _local1:BitmapData = new BitmapData(this.pageWidth, this.pageHeight, true, 0x808080); | |
var _local2:Matrix = this.toSpread.transform.matrix; | |
_local2.tx = ((this.isFromRight()) ? 0 : -(this.pageWidth)); | |
_local2.ty = 0; | |
_local1.draw(this.toSpread, _local2); | |
var _local3:Bitmap = new Bitmap(_local1, PixelSnapping.AUTO, true); | |
this.initFlippingPageBitmapPosition(_local3); | |
var _local4:Sprite = new Sprite(); | |
_local4 = new Sprite(); | |
_local4.addChild(_local3); | |
this.initFlippingPageRotationAndPosition(_local4); | |
this.container.addChild(_local4); | |
this.flippingPage = _local4; | |
} | |
protected function isFromRight():Boolean{ | |
return (true); | |
} | |
protected function initFlippingPageBitmapPosition(_arg1:Bitmap):void{ | |
_arg1.y = -(_arg1.height); | |
} | |
protected function initFlippingPageRotationAndPosition(_arg1:Sprite):void{ | |
_arg1.rotation = 90; | |
_arg1.x = this.spreadRect.right; | |
_arg1.y = this.spreadRect.bottom; | |
} | |
private function createFlippingPageMask():void{ | |
var _local1:Number = ((this.visualizeMetricsFlag) ? 0.33 : 1); | |
var _local2:Shape = this.createRotatingMaskShape(0xFF0000, _local1); | |
this.initFlippingPageMaskPosition(_local2); | |
this.container.addChild(_local2); | |
if (!this.visualizeMetricsFlag){ | |
this.flippingPage.mask = _local2; | |
}; | |
this.flippingPageMask = _local2; | |
} | |
private function createRotatingMaskShape(_arg1:Number, _arg2:Number):Shape{ | |
var _local3:Rectangle = new Rectangle(0, 0, this.pageWidth, this.spreadRect.width); | |
this.initFlippingPageMaskRectOrigin(_local3); | |
var _local4:Shape = new Shape(); | |
var _local5:Graphics = _local4.graphics; | |
_local5.beginFill(_arg1, _arg2); | |
_local5.drawRect(_local3.x, _local3.y, _local3.width, _local3.height); | |
_local5.endFill(); | |
return (_local4); | |
} | |
protected function initFlippingPageMaskRectOrigin(_arg1:Rectangle):void{ | |
_arg1.offset(-(_arg1.width), (-(_arg1.height) * 0.85)); | |
} | |
protected function initFlippingPageMaskPosition(_arg1:Shape):void{ | |
_arg1.x = this.spreadRect.right; | |
_arg1.y = this.spreadRect.bottom; | |
} | |
private function resetDots():void{ | |
if (!this.visualizeMetricsFlag){ | |
return; | |
}; | |
if (this.dots != null){ | |
this.container.removeChild(this.dots); | |
}; | |
this.dots = new Sprite(); | |
this.dots.x = (this.spreadRect.x + this.origin.x); | |
this.dots.y = (this.spreadRect.y + this.origin.y); | |
this.container.addChild(this.dots); | |
} | |
private function destroyDots():void{ | |
if (!this.visualizeMetricsFlag){ | |
return; | |
}; | |
this.container.removeChild(this.dots); | |
} | |
public function startFlip():void{ | |
var tweenProps:* = null; | |
var onFlipStep:* = null; | |
var onFlipComplete:* = null; | |
onFlipStep = function ():void{ | |
var _local1:Point = new Point((pageWidth * Math.cos(tweenProps.angle)), ((pageWidth * Math.sin(tweenProps.angle)) / 3)); | |
_local1.offset(pageWidth, pageHeight); | |
setMousePos(_local1.x, _local1.y); | |
}; | |
onFlipComplete = function ():void{ | |
dispatchEvent(new PageFlipEvent(PageFlipEvent.END)); | |
}; | |
var startAngle:* = ((this.isFromRight()) ? 0 : -(Math.PI)); | |
var endAngle:* = ((this.isFromRight()) ? -(Math.PI) : 0); | |
tweenProps = { | |
angle:startAngle, | |
count:0 | |
}; | |
Tweener.addTween(tweenProps, { | |
angle:endAngle, | |
time:1, | |
count:24, | |
transition:"easeInOutSine", | |
onUpdateScope:this, | |
onUpdate:onFlipStep, | |
onCompleteScope:this, | |
onComplete:onFlipComplete | |
}); | |
} | |
protected function getFlipTweenAngleRange():Object{ | |
return ({ | |
start:0, | |
end:-(Math.PI) | |
}); | |
} | |
public function setMousePos(_arg1:Number, _arg2:Number):void{ | |
this.mouse = new Point((_arg1 - this.origin.x), (_arg2 - this.origin.y)); | |
this.updateUI(); | |
} | |
private function updateUI():void{ | |
this.updateMetrics(); | |
this.updatePagesAndMasks(); | |
this.visualizeMetrics(); | |
} | |
private function updateMetrics():void{ | |
this.follow.x = this.mouse.x; | |
this.follow.y = this.mouse.y; | |
this.dx = this.follow.x; | |
this.dy = (this.spineBottom.y - this.follow.y); | |
this.a2f = Math.atan2(this.dy, this.dx); | |
this.radius1.x = (Math.cos(this.a2f) * this.fixedRadius); | |
this.radius1.y = (this.spineBottom.y - (Math.sin(this.a2f) * this.fixedRadius)); | |
this.distanceToFollow = Math.sqrt((((this.spineBottom.y - this.follow.y) * (this.spineBottom.y - this.follow.y)) + (this.follow.x * this.follow.x))); | |
var _local1:Number = Math.sqrt((((this.spineBottom.y - this.radius1.y) * (this.spineBottom.y - this.radius1.y)) + (this.radius1.x * this.radius1.x))); | |
if (_local1 < this.distanceToFollow){ | |
this.corner.x = this.radius1.x; | |
this.corner.y = this.radius1.y; | |
} else { | |
this.corner.x = this.follow.x; | |
this.corner.y = this.follow.y; | |
}; | |
this.dx = (this.spineTop.x - this.corner.x); | |
this.dy = (this.corner.y + this.pageHalfHeight); | |
this.distanceToFollow = Math.sqrt(((this.dx * this.dx) + (this.dy * this.dy))); | |
this.a2f = Math.atan2(this.dy, this.dx); | |
this.radius2.x = (-(Math.cos(this.a2f)) * this.pageDiagonal); | |
this.radius2.y = (this.spineTop.y + (Math.sin(this.a2f) * this.pageDiagonal)); | |
if (this.distanceToFollow > this.pageDiagonal){ | |
this.corner.x = this.radius2.x; | |
this.corner.y = this.radius2.y; | |
}; | |
this.bisector.x = (this.corner.x + (0.5 * (this.startCorner.x - this.corner.x))); | |
this.bisector.y = (this.corner.y + (0.5 * (this.startCorner.y - this.corner.y))); | |
this.bisectorAngle = Math.atan2((this.startCorner.y - this.bisector.y), (this.startCorner.x - this.bisector.x)); | |
this.bisectorTanget = (this.bisector.x - (Math.tan(this.bisectorAngle) * (this.startCorner.y - this.bisector.y))); | |
this.bisectorTanget = this.restrictTangentX(this.bisectorTanget); | |
this.tangentBottom.x = this.bisectorTanget; | |
this.tangentBottom.y = this.startCorner.y; | |
this.tangentTopX = (this.bisector.x + (Math.tan(this.bisectorAngle) * (this.pageHalfHeight + this.bisector.y))); | |
this.tangentTopX = this.restrictTangentX(this.tangentTopX); | |
this.tangentTop.x = this.tangentTopX; | |
this.tangentTop.y = -(this.startCorner.y); | |
this.tangentToCornerAngle = Math.atan2((this.tangentBottom.y - this.corner.y), (this.tangentBottom.x - this.corner.x)); | |
} | |
protected function restrictTangentX(_arg1:Number):Number{ | |
return (Math.max(0, _arg1)); | |
} | |
private function updatePagesAndMasks():void{ | |
this.updateFlippingPage(); | |
this.updateFlippingPageMask(); | |
this.updateFromPageMask(); | |
} | |
private function updateFlippingPage():void{ | |
this.flippingPage.x = ((this.spreadRect.x + this.origin.x) + this.corner.x); | |
this.flippingPage.y = ((this.spreadRect.y + this.origin.y) + this.corner.y); | |
this.updateFlippingPageAngle(this.flippingPage, this.tangentToCornerAngle); | |
} | |
protected function updateFlippingPageAngle(_arg1:DisplayObject, _arg2:Number):void{ | |
_arg1.rotation = ((_arg2 * 180) / Math.PI); | |
} | |
private function updateFlippingPageMask():void{ | |
var _local1:Number = Math.atan2((this.pageHalfHeight - this.bisector.y), (this.bisector.x - this.bisectorTanget)); | |
this.flippingPageMask.rotation = ((90 * (_local1 / Math.abs(_local1))) - ((_local1 * 180) / Math.PI)); | |
this.flippingPageMask.x = ((this.spreadRect.x + this.pageWidth) + (this.tangentBottom.x - this.maskSize.x)); | |
} | |
protected function updateFromPageMask():void{ | |
var _local1:Number = ((this.visualizeMetricsFlag) ? 0.33 : 1); | |
var _local2:Graphics = this.fromSpreadMask.graphics; | |
var _local3:Point = this.origin.clone(); | |
_local3.offset(this.spreadRect.x, this.spreadRect.y); | |
_local2.clear(); | |
_local2.beginFill(0xFF00, _local1); | |
_local2.moveTo(this.spreadRect.left, this.spreadRect.top); | |
_local2.lineTo((_local3.x + this.tangentTop.x), (_local3.y + this.tangentTop.y)); | |
_local2.lineTo((_local3.x + this.tangentBottom.x), (_local3.y + this.tangentBottom.y)); | |
_local2.lineTo(this.spreadRect.left, this.spreadRect.bottom); | |
_local2.lineTo(this.spreadRect.left, this.spreadRect.top); | |
_local2.endFill(); | |
} | |
private function visualizeMetrics():void{ | |
if (!this.visualizeMetricsFlag){ | |
return; | |
}; | |
this.resetDots(); | |
this.drawLine(0, -(this.pageHalfHeight), this.corner.x, this.corner.y, red); | |
this.drawLine(this.corner.x, this.corner.y, this.startCorner.x, this.startCorner.y, red); | |
this.drawLine(0, this.pageHalfHeight, this.corner.x, this.corner.y, red); | |
this.drawLine(this.spineTop.x, this.spineTop.y, this.corner.x, this.corner.y, red); | |
this.addDot(0, -(this.pageHalfHeight), "ST"); | |
this.addDot(this.spineBottom.x, this.spineBottom.y, "SB"); | |
this.addDot(this.startCorner.x, this.startCorner.y, "EB"); | |
this.addDot(this.mouse.x, this.mouse.y, "M"); | |
this.addDot(this.follow.x, this.follow.y, "F"); | |
this.addDot(this.corner.x, this.corner.y, "C"); | |
this.drawLine(this.bisector.x, this.bisector.y, this.bisector.x, this.pageHalfHeight, blue); | |
this.drawLine(this.bisector.x, this.bisector.y, this.tangentBottom.x, this.tangentBottom.y, blue); | |
this.drawLine(this.bisector.x, this.pageHalfHeight, this.tangentBottom.x, this.tangentBottom.y, blue); | |
this.addDot(this.bisector.x, this.bisector.y, "T0"); | |
this.addDot(this.bisector.x, this.pageHalfHeight, "T1"); | |
this.addDot(this.tangentBottom.x, this.tangentBottom.y, "T2"); | |
this.addDot(this.tangentTop.x, this.tangentTop.y, "T3"); | |
} | |
private function drawLine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:ColorTransform):void{ | |
var _local6:Graphics = this.dots.graphics; | |
_local6.lineStyle(1, _arg5.color, (_arg5.alphaOffset / 0xFF)); | |
_local6.moveTo(_arg1, _arg2); | |
_local6.lineTo(_arg3, _arg4); | |
} | |
private function addDot(... _args):void{ | |
var _local2:Number; | |
var _local3:Number; | |
var _local4:String; | |
if (_args.length == 2){ | |
_local2 = Point(_args[0]).x; | |
_local3 = Point(_args[0]).y; | |
_local4 = _args[1]; | |
} else { | |
if (_args.length == 3){ | |
_local2 = _args[0]; | |
_local3 = _args[1]; | |
_local4 = _args[2]; | |
}; | |
}; | |
var _local5:Dot = new Dot(_local4); | |
_local5.x = _local2; | |
_local5.y = _local3; | |
this.dots.addChild(_local5); | |
} | |
public function destroy():void{ | |
this.removePageAndMasks(); | |
this.destroyDots(); | |
} | |
} | |
}//package com.vpg.lib.effects.pageflip | |
package com.vpg.lib.effects.pageflip { | |
import flash.display.*; | |
import flash.text.*; | |
public class Dot extends Sprite { | |
public var label:TextField; | |
public function Dot(_arg1:String){ | |
this.createLabel(_arg1); | |
this.draw(); | |
} | |
private function createLabel(_arg1:String):void{ | |
this.label = new TextField(); | |
this.label.multiline = false; | |
this.label.wordWrap = false; | |
this.label.autoSize = TextFieldAutoSize.LEFT; | |
this.label.selectable = false; | |
this.label.text = _arg1; | |
var _local2:TextFormat = this.label.getTextFormat(); | |
_local2.color = 0xFFFFFF; | |
_local2.align = TextFormatAlign.CENTER; | |
_local2.font = "_sans"; | |
this.label.setTextFormat(_local2); | |
addChild(this.label); | |
} | |
private function draw():void{ | |
var _local1:Graphics = graphics; | |
_local1.beginFill(0, (153 / 0xFF)); | |
_local1.drawCircle(0, 0, 10); | |
_local1.endFill(); | |
this.label.x = (-(this.label.width) / 2); | |
this.label.y = (-(this.label.height) / 2); | |
} | |
} | |
}//package com.vpg.lib.effects.pageflip | |
package com.vpg.lib.effects.pageflip { | |
import flash.display.*; | |
import flash.geom.*; | |
public class PageSpreadBottomLeftFlip extends PageSpreadFlip { | |
public function PageSpreadBottomLeftFlip(_arg1:DisplayObject, _arg2:DisplayObject){ | |
super(_arg1, _arg2); | |
} | |
override protected function initStartCorner():void{ | |
startCorner = new Point(-(pageWidth), pageHalfHeight); | |
} | |
override protected function isFromRight():Boolean{ | |
return (false); | |
} | |
override protected function initFlippingPageBitmapPosition(_arg1:Bitmap):void{ | |
_arg1.x = -(_arg1.width); | |
_arg1.y = -(_arg1.height); | |
} | |
override protected function initFlippingPageRotationAndPosition(_arg1:Sprite):void{ | |
_arg1.rotation = -90; | |
_arg1.x = spreadRect.left; | |
_arg1.y = spreadRect.bottom; | |
} | |
override protected function initFlippingPageMaskRectOrigin(_arg1:Rectangle):void{ | |
_arg1.offset(0, (-(_arg1.height) * 0.85)); | |
} | |
override protected function initFlippingPageMaskPosition(_arg1:Shape):void{ | |
_arg1.x = spreadRect.left; | |
_arg1.y = spreadRect.bottom; | |
} | |
override protected function restrictTangentX(_arg1:Number):Number{ | |
return (Math.min(0, _arg1)); | |
} | |
override protected function updateFlippingPageAngle(_arg1:DisplayObject, _arg2:Number):void{ | |
_arg1.rotation = (-180 + ((_arg2 * 180) / Math.PI)); | |
} | |
override protected function updateFromPageMask():void{ | |
var _local1:Number = ((visualizeMetricsFlag) ? 0.33 : 1); | |
var _local2:Graphics = fromSpreadMask.graphics; | |
var _local3:Point = origin.clone(); | |
_local3.offset(spreadRect.x, spreadRect.y); | |
_local2.clear(); | |
_local2.beginFill(0xFF00, _local1); | |
_local2.moveTo(spreadRect.right, spreadRect.top); | |
_local2.lineTo((_local3.x + tangentTop.x), (_local3.y + tangentTop.y)); | |
_local2.lineTo((_local3.x + tangentBottom.x), (_local3.y + tangentBottom.y)); | |
_local2.lineTo(spreadRect.right, spreadRect.bottom); | |
_local2.lineTo(spreadRect.right, spreadRect.top); | |
_local2.endFill(); | |
} | |
} | |
}//package com.vpg.lib.effects.pageflip | |
package com.sociodox.utils { | |
import flash.utils.*; | |
import __AS3__.vec.*; | |
public class Base64 { | |
private static const _encodeChars:Vector.<int> = InitEncoreChar(); | |
private static const _decodeChars:Vector.<int> = InitDecodeChar(); | |
public static function encode(_arg1:ByteArray):String{ | |
var _local6:uint; | |
var _local2:ByteArray = new ByteArray(); | |
_local2.length = ((((2 + _arg1.length) - ((_arg1.length + 2) % 3)) * 4) / 3); | |
var _local3:int; | |
var _local4:int = (_arg1.length % 3); | |
var _local5:int = (_arg1.length - _local4); | |
var _local7:int; | |
while (_local3 < _local5) { | |
var _temp1 = _local3; | |
_local3 = (_local3 + 1); | |
var _temp2 = _local3; | |
_local3 = (_local3 + 1); | |
var _temp3 = _local3; | |
_local3 = (_local3 + 1); | |
_local6 = (((_arg1[int(_temp1)] << 16) | (_arg1[int(_temp2)] << 8)) | _arg1[int(_temp3)]); | |
var _temp4 = _local7; | |
_local7 = (_local7 + 1); | |
_local2[int(_temp4)] = _encodeChars[int((_local6 >>> 18))]; | |
var _temp5 = _local7; | |
_local7 = (_local7 + 1); | |
_local2[int(_temp5)] = _encodeChars[int(((_local6 >>> 12) & 63))]; | |
var _temp6 = _local7; | |
_local7 = (_local7 + 1); | |
_local2[int(_temp6)] = _encodeChars[int(((_local6 >>> 6) & 63))]; | |
var _temp7 = _local7; | |
_local7 = (_local7 + 1); | |
_local2[int(_temp7)] = _encodeChars[int((_local6 & 63))]; | |
}; | |
if (_local4 == 1){ | |
_local6 = _arg1[int(_local3)]; | |
var _temp8 = _local7; | |
_local7 = (_local7 + 1); | |
_local2[int(_temp8)] = _encodeChars[int((_local6 >>> 2))]; | |
var _temp9 = _local7; | |
_local7 = (_local7 + 1); | |
_local2[int(_temp9)] = _encodeChars[int(((_local6 & 3) << 4))]; | |
var _temp10 = _local7; | |
_local7 = (_local7 + 1); | |
_local2[int(_temp10)] = 61; | |
var _temp11 = _local7; | |
_local7 = (_local7 + 1); | |
_local2[int(_temp11)] = 61; | |
} else { | |
if (_local4 == 2){ | |
var _temp12 = _local3; | |
_local3 = (_local3 + 1); | |
_local6 = ((_arg1[int(_temp12)] << 8) | _arg1[int(_local3)]); | |
var _temp13 = _local7; | |
_local7 = (_local7 + 1); | |
_local2[int(_temp13)] = _encodeChars[int((_local6 >>> 10))]; | |
var _temp14 = _local7; | |
_local7 = (_local7 + 1); | |
_local2[int(_temp14)] = _encodeChars[int(((_local6 >>> 4) & 63))]; | |
var _temp15 = _local7; | |
_local7 = (_local7 + 1); | |
_local2[int(_temp15)] = _encodeChars[int(((_local6 & 15) << 2))]; | |
var _temp16 = _local7; | |
_local7 = (_local7 + 1); | |
_local2[int(_temp16)] = 61; | |
}; | |
}; | |
return (_local2.readUTFBytes(_local2.length)); | |
} | |
public static function decode(_arg1:String):ByteArray{ | |
var _local2:int; | |
var _local3:int; | |
var _local4:int; | |
var _local5:int; | |
var _local6:int; | |
var _local7:int = _arg1.length; | |
var _local8:ByteArray = new ByteArray(); | |
_local8.writeUTFBytes(_arg1); | |
var _local9:int; | |
while (_local6 < _local7) { | |
var _temp1 = _local6; | |
_local6 = (_local6 + 1); | |
_local2 = _decodeChars[int(_local8[_temp1])]; | |
if (_local2 == -1){ | |
break; | |
}; | |
var _temp2 = _local6; | |
_local6 = (_local6 + 1); | |
_local3 = _decodeChars[int(_local8[_temp2])]; | |
if (_local3 == -1){ | |
break; | |
}; | |
var _temp3 = _local9; | |
_local9 = (_local9 + 1); | |
_local8[int(_temp3)] = ((_local2 << 2) | ((_local3 & 48) >> 4)); | |
var _temp4 = _local6; | |
_local6 = (_local6 + 1); | |
_local4 = _local8[int(_temp4)]; | |
if (_local4 == 61){ | |
_local8.length = _local9; | |
return (_local8); | |
}; | |
_local4 = _decodeChars[int(_local4)]; | |
if (_local4 == -1){ | |
break; | |
}; | |
var _temp5 = _local9; | |
_local9 = (_local9 + 1); | |
_local8[int(_temp5)] = (((_local3 & 15) << 4) | ((_local4 & 60) >> 2)); | |
var _temp6 = _local6; | |
_local6 = (_local6 + 1); | |
_local5 = _local8[int(_temp6)]; | |
if (_local5 == 61){ | |
_local8.length = _local9; | |
return (_local8); | |
}; | |
_local5 = _decodeChars[int(_local5)]; | |
if (_local5 == -1){ | |
break; | |
}; | |
var _temp7 = _local9; | |
_local9 = (_local9 + 1); | |
_local8[int(_temp7)] = (((_local4 & 3) << 6) | _local5); | |
}; | |
_local8.length = _local9; | |
return (_local8); | |
} | |
public static function InitEncoreChar():Vector.<int>{ | |
var _local1:Vector.<int> = new Vector.<int>(64, true); | |
var _local2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; | |
var _local3:int; | |
while (_local3 < 64) { | |
_local1[_local3] = _local2.charCodeAt(_local3); | |
_local3++; | |
}; | |
return (_local1); | |
} | |
public static function InitDecodeChar():Vector.<int>{ | |
var _local1:Vector.<int> = new <int>[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1]; | |
return (_local1); | |
} | |
} | |
}//package com.sociodox.utils | |
package com.motiondraw.geometry { | |
import flash.display.*; | |
public class CatmullRomSpline { | |
var verteces:Array; | |
var lengths:Array; | |
var totalLength:Number; | |
public var numPoints:Number; | |
private var __APPROXLINELENGTH = 5; | |
private var vertecesPlus:Array; | |
public function CatmullRomSpline(_arg1:Array){ | |
this.lengths = new Array(); | |
this.verteces = _arg1; | |
} | |
private function catmullRom(_arg1:Number, _arg2:Object, _arg3:Object, _arg4:Object, _arg5:Object):Object{ | |
var _local6:* = (_arg1 * _arg1); | |
var _local7:* = (_arg1 * _local6); | |
return ({ | |
x:(0.5 * ((((2 * _arg3.x) + ((-(_arg2.x) + _arg4.x) * _arg1)) + (((((2 * _arg2.x) - (5 * _arg3.x)) + (4 * _arg4.x)) - _arg5.x) * _local6)) + ((((-(_arg2.x) + (3 * _arg3.x)) - (3 * _arg4.x)) + _arg5.x) * _local7))), | |
y:(0.5 * ((((2 * _arg3.y) + ((-(_arg2.y) + _arg4.y) * _arg1)) + (((((2 * _arg2.y) - (5 * _arg3.y)) + (4 * _arg4.y)) - _arg5.y) * _local6)) + ((((-(_arg2.y) + (3 * _arg3.y)) - (3 * _arg4.y)) + _arg5.y) * _local7))) | |
}); | |
} | |
public function plotAll(_arg1, _arg2:Number):void{ | |
var _local4:*; | |
var _local3:* = this.getAllPoints(_arg2); | |
if (_local3.length){ | |
_arg1.moveTo(_local3[0].x, _local3[0].y); | |
_local4 = 1; | |
while (_local4 < _local3.length) { | |
_arg1.lineTo(_local3[_local4].x, _local3[_local4].y); | |
_local4++; | |
}; | |
}; | |
} | |
public function getAllPoints(_arg1:Number):Array{ | |
var _local8:*; | |
var _local9:*; | |
var _local10:*; | |
var _local11:Number; | |
var _local12:Number; | |
var _local13:*; | |
if (!_arg1){ | |
_arg1 = this.__APPROXLINELENGTH; | |
}; | |
if (!this.vertecesPlus){ | |
this.makeVertecesPlus(); | |
}; | |
var _local2:Array = this.vertecesPlus; | |
var _local3:Array = new Array(); | |
var _local4:Number = 0; | |
var _local5 = _local2.length; | |
var _local6:* = 0; | |
while (_local6 < (_local5 - 3)) { | |
_local8 = _local2[(_local6 + 1)]; | |
_local9 = _local2[(_local6 + 2)]; | |
_local10 = this.catmullRom(0.5, _local2[_local6], _local8, _local9, _local2[(_local6 + 3)]); | |
_local11 = (Math.sqrt((Math.abs(Math.pow((_local10.x - _local8.x), 2)) + Math.abs(Math.pow((_local10.y - _local8.y), 2)))) + Math.sqrt((Math.abs(Math.pow((_local10.x - _local9.x), 2)) + Math.abs(Math.pow((_local10.y - _local9.y), 2))))); | |
this.lengths[_local6] = _local11; | |
_local12 = (1 / (_local11 / _arg1)); | |
_local13 = 0; | |
while (_local13 < 1) { | |
_local3[_local4] = this.catmullRom(_local13, _local2[_local6], _local8, _local9, _local2[(_local6 + 3)]); | |
var _temp1 = _local4; | |
_local4 = (_local4 + 1); | |
_local3[_temp1].vertex = _local6; | |
_local13 = (_local13 + _local12); | |
}; | |
_local6++; | |
}; | |
var _local7:* = _local3.length; | |
_local3[(_local7 - 1)].x = _local2[(_local5 - 1)].x; | |
_local3[(_local7 - 1)].y = _local2[(_local5 - 1)].y; | |
this.numPoints = _local3.length; | |
return (_local3); | |
} | |
function getPointsInRange(_arg1:Number, _arg2:Number, _arg3:Number):Array{ | |
var _local9:*; | |
var _local10:*; | |
var _local11:Number; | |
var _local12:Number; | |
var _local13:*; | |
var _local14:*; | |
if (!this.lengths.length){ | |
this.getSegmentLengths(); | |
}; | |
if (!_arg3){ | |
_arg3 = this.__APPROXLINELENGTH; | |
}; | |
var _local4:Array = this.vertecesPlus; | |
var _local5:Array = new Array(); | |
var _local6:Number = 0; | |
var _local7:* = 0; | |
var _local8:* = _local4.length; | |
while (_local7 < (_local8 - 3)) { | |
_local9 = _local4[(_local7 + 1)]; | |
_local10 = _local4[(_local7 + 2)]; | |
if ((((_arg1 >= _local9.t)) && ((_arg1 < _local10.t)))){ | |
_local11 = this.lengths[_local7]; | |
_local12 = (1 / (_local11 / _arg3)); | |
_local13 = ((_arg2)>_local10.t) ? 1 : ((_arg2 - _local9.t) / (_local10.t - _local9.t)); | |
_local14 = ((_arg1 - _local9.t) / (_local10.t - _local9.t)); | |
while (_local14 < _local13) { | |
_local5[_local6] = this.catmullRom(_local14, _local4[_local7], _local9, _local10, _local4[(_local7 + 3)]); | |
var _temp1 = _local6; | |
_local6 = (_local6 + 1); | |
_local5[_temp1].vertex = _local7; | |
_local14 = (_local14 + _local12); | |
}; | |
_local5[_local6] = this.catmullRom(_local13, _local4[_local7], _local9, _local10, _local4[(_local7 + 3)]); | |
var _temp2 = _local6; | |
_local6 = (_local6 + 1); | |
_local5[_temp2].vertex = _local7; | |
if (_arg2 > _local10.t){ | |
_arg1 = _local10.t; | |
} else { | |
if (_local13 <= 1){ | |
break; | |
}; | |
}; | |
}; | |
_local7++; | |
}; | |
return (_local5); | |
} | |
function getPointAtT(_arg1:Number):Object{ | |
var _local6:*; | |
var _local7:*; | |
var _local8:Number; | |
var _local9:*; | |
if (!this.lengths.length){ | |
this.getSegmentLengths(); | |
}; | |
var _local2:Array = this.vertecesPlus; | |
var _local3:Number = 0; | |
var _local4:* = 0; | |
var _local5:* = _local2.length; | |
while (_local4 < (_local5 - 3)) { | |
_local6 = _local2[(_local4 + 1)]; | |
_local7 = _local2[(_local4 + 2)]; | |
if ((((_arg1 >= _local6.t)) && ((_arg1 <= _local7.t)))){ | |
_local8 = ((_arg1 - _local6.t) / (_local7.t - _local6.t)); | |
_local9 = this.catmullRom(_local8, _local2[_local4], _local6, _local7, _local2[(_local4 + 3)]); | |
break; | |
}; | |
_local4++; | |
}; | |
return (_local9); | |
} | |
function getTOfVertex(_arg1:Number):Number{ | |
if (!this.lengths.length){ | |
this.getSegmentLengths(); | |
}; | |
return (this.verteces[_arg1].t); | |
} | |
function getSegmentLengths():void{ | |
var _local7:*; | |
var _local8:*; | |
var _local9:*; | |
var _local10:*; | |
if (!this.vertecesPlus){ | |
this.makeVertecesPlus(); | |
}; | |
var _local1:Array = this.vertecesPlus; | |
this.lengths = new Array(); | |
this.totalLength = 0; | |
var _local2:* = 0; | |
var _local3:* = _local1.length; | |
while (_local2 < (_local3 - 3)) { | |
_local7 = _local1[(_local2 + 1)]; | |
_local8 = _local1[(_local2 + 2)]; | |
_local9 = this.catmullRom(0.5, _local1[_local2], _local7, _local8, _local1[(_local2 + 3)]); | |
_local10 = (Math.sqrt((Math.abs(Math.pow((_local9.x - _local7.x), 2)) + Math.abs(Math.pow((_local9.y - _local7.y), 2)))) + Math.sqrt((Math.abs(Math.pow((_local9.x - _local8.x), 2)) + Math.abs(Math.pow((_local9.y - _local8.y), 2))))); | |
this.lengths[_local2] = _local10; | |
this.totalLength = (this.totalLength + _local10); | |
_local2++; | |
}; | |
this.verteces[0].t = 0; | |
var _local4:* = 0; | |
var _local5:* = 0; | |
var _local6:* = this.lengths.length; | |
while (_local5 < _local6) { | |
_local4 = (_local4 + this.lengths[_local5]); | |
this.verteces[(_local2 + 1)].t = (_local4 / this.totalLength); | |
_local5++; | |
}; | |
} | |
private function makeVertecesPlus():void{ | |
this.vertecesPlus = this.verteces.slice(0); | |
this.vertecesPlus.splice(0, 0, this.vertecesPlus[0]); | |
this.vertecesPlus.push(this.vertecesPlus[(this.vertecesPlus.length - 1)]); | |
} | |
} | |
}//package com.motiondraw.geometry | |
package com.motiondraw { | |
public class LineGeneralization { | |
public function smoothMcMaster(_arg1:Array):Array{ | |
var _local4:*; | |
var _local5:*; | |
var _local6:*; | |
var _local2:* = []; | |
var _local3:* = _arg1.length; | |
if (_local3 < 5){ | |
return (_arg1); | |
}; | |
var _local7:* = _local3; | |
while (_local7--) { | |
if ((((((((_local7 == (_local3 - 1))) || ((_local7 == (_local3 - 2))))) || ((_local7 == 1)))) || ((_local7 == 0)))){ | |
_local2[_local7] = { | |
x:_arg1[_local7].x, | |
y:_arg1[_local7].y | |
}; | |
} else { | |
_local4 = 5; | |
_local5 = 0; | |
_local6 = 0; | |
while (_local4--) { | |
_local5 = (_local5 + _arg1[((_local7 + 2) - _local4)].x); | |
_local6 = (_local6 + _arg1[((_local7 + 2) - _local4)].y); | |
}; | |
_local5 = (_local5 / 5); | |
_local6 = (_local6 / 5); | |
_local2[_local7] = (_local2[_local7] = { | |
x:((_arg1[_local7].x + _local5) / 2), | |
y:((_arg1[_local7].y + _local6) / 2) | |
}); | |
}; | |
}; | |
return (_local2); | |
} | |
public function simplifyLang(_arg1:Number, _arg2:Number, _arg3:Array):Array{ | |
var _local5:Number; | |
var _local6:Number; | |
var _local7:Number; | |
if ((((_arg1 <= 1)) || ((_arg3.length < 3)))){ | |
return (_arg3); | |
}; | |
var _local4:Array = new Array(); | |
_local6 = _arg3.length; | |
if (_arg1 > (_local6 - 1)){ | |
_arg1 = (_local6 - 1); | |
}; | |
_local4[0] = { | |
x:_arg3[0].x, | |
y:_arg3[0].y | |
}; | |
_local7 = 1; | |
var _local8:* = 0; | |
while (_local8 < _local6) { | |
if ((_local8 + _arg1) > _local6){ | |
_arg1 = ((_local6 - _local8) - 1); | |
}; | |
_local5 = this.recursiveToleranceBar(_arg3, _local8, _arg1, _arg2); | |
if ((((_local5 > 0)) && (_arg3[(_local8 + _local5)]))){ | |
_local4[_local7] = { | |
x:_arg3[(_local8 + _local5)].x, | |
y:_arg3[(_local8 + _local5)].y | |
}; | |
_local8 = (_local8 + (_local5 - 1)); | |
_local7++; | |
}; | |
_local8++; | |
}; | |
_local4[(_local7 - 1)] = { | |
x:_arg3[(_local6 - 1)].x, | |
y:_arg3[(_local6 - 1)].y | |
}; | |
return (_local4); | |
} | |
private function recursiveToleranceBar(_arg1, _arg2, _arg3, _arg4):Number{ | |
var _local6:*; | |
var _local7:*; | |
var _local8:*; | |
var _local9:*; | |
var _local10:*; | |
var _local11:*; | |
var _local12:*; | |
var _local14:*; | |
var _local5:* = _arg3; | |
_local6 = _arg1[_arg2]; | |
if (!_arg1[(_arg2 + _local5)]){ | |
return (0); | |
}; | |
_local8 = { | |
x:(_arg1[(_arg2 + _local5)].x - _local6.x), | |
y:(_arg1[(_arg2 + _local5)].y - _local6.y) | |
}; | |
var _local13:* = 1; | |
while (_local13 <= _local5) { | |
_local7 = _arg1[(_arg2 + _local13)]; | |
_local9 = { | |
x:(_local7.x - _local6.x), | |
y:(_local7.y - _local6.y) | |
}; | |
_local10 = Math.acos((((_local8.x * _local9.x) + (_local8.y * _local9.y)) / (Math.sqrt(((_local8.y * _local8.y) + (_local8.x * _local8.x))) * Math.sqrt(((_local9.y * _local9.y) + (_local9.x * _local9.x)))))); | |
if (isNaN(_local10)){ | |
_local10 = 0; | |
}; | |
_local11 = (_local6.x - _local7.x); | |
_local12 = (_local6.y - _local7.y); | |
_local14 = Math.sqrt(((_local11 * _local11) + (_local12 * _local12))); | |
if ((Math.sin(_local10) * _local14) >= _arg4){ | |
--_local5; | |
if (_local5 > 0){ | |
return (this.recursiveToleranceBar(_arg1, _arg2, _local5, _arg4)); | |
}; | |
return (0); | |
}; | |
_local13++; | |
}; | |
return (_local5); | |
} | |
private function recursiveToleranceBar_old(_arg1, _arg2, _arg3, _arg4):Number{ | |
var _local6:*; | |
var _local7:*; | |
var _local8:*; | |
var _local9:*; | |
var _local10:*; | |
var _local11:*; | |
var _local12:*; | |
var _local13:*; | |
var _local15:*; | |
var _local5:* = _arg3; | |
_local6 = _arg1[_arg2]; | |
_local8 = { | |
x:(_arg1[(_arg2 + _local5)].x - _local6.x), | |
y:(_arg1[(_arg2 + _local5)].y - _local6.y) | |
}; | |
var _local14:* = 1; | |
while (_local14 <= _local5) { | |
_local7 = _arg1[(_arg2 + _local14)]; | |
_local9 = { | |
x:(_local7.x - _local6.x), | |
y:(_local7.y - _local6.y) | |
}; | |
_local10 = Math.acos((((_local8.x * _local9.x) + (_local8.y * _local9.y)) / (Math.sqrt(((_local8.y * _local8.y) + (_local8.x * _local8.x))) * Math.sqrt(((_local9.y * _local9.y) + (_local9.x * _local9.x)))))); | |
if (isNaN(_local10)){ | |
_local10 = 0; | |
}; | |
_local11 = (_local6.x - _local7.x); | |
_local12 = (_local6.y - _local7.y); | |
_local15 = Math.sqrt(((_local11 * _local11) + (_local12 * _local12))); | |
if ((Math.sin(_local10) * _local15) >= _arg4){ | |
--_local5; | |
if (_local5 > 0){ | |
_local13 = this.recursiveToleranceBar(_arg1, _arg2, _local5, _arg4); | |
break; | |
}; | |
_local13 = 0; | |
break; | |
}; | |
_local14++; | |
}; | |
return (_local13); | |
} | |
} | |
}//package com.motiondraw | |
package { | |
import com.vpg.vpage.components.button.*; | |
public dynamic class zoom_out_btn extends BasicButton { | |
} | |
}//package | |
package { | |
import com.vpg.vpage.components.slider.*; | |
public dynamic class volume_slider extends Slider { | |
} | |
}//package | |
package caurina.transitions { | |
public class Equations { | |
public function Equations(){ | |
trace("Equations is a static class and should not be instantiated."); | |
} | |
public static function easeOutBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ | |
_arg1 = (_arg1 / _arg4); | |
if (_arg1 < (1 / 2.75)){ | |
return (((_arg3 * ((7.5625 * _arg1) * _arg1)) + _arg2)); | |
}; | |
if (_arg1 < (2 / 2.75)){ | |
_arg1 = (_arg1 - (1.5 / 2.75)); | |
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.75)) + _arg2)); | |
}; | |
if (_arg1 < (2.5 / 2.75)){ | |
_arg1 = (_arg1 - (2.25 / 2.75)); | |
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.9375)) + _arg2)); | |
}; | |
_arg1 = (_arg1 - (2.625 / 2.75)); | |
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.984375)) + _arg2)); | |
} | |
public static function easeInOutElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ | |
var _local7:Number; | |
if (_arg1 == 0){ | |
return (_arg2); | |
}; | |
_arg1 = (_arg1 / (_arg4 / 2)); | |
if (_arg1 == 2){ | |
return ((_arg2 + _arg3)); | |
}; | |
var _local6:Number = ((((!(Boolean(_arg5))) || (isNaN(_arg5.period)))) ? (_arg4 * (0.3 * 1.5)) : _arg5.period); | |
var _local8:Number = ((((!(Boolean(_arg5))) || (isNaN(_arg5.amplitude)))) ? 0 : _arg5.amplitude); | |
if (((!(Boolean(_local8))) || ((_local8 < Math.abs(_arg3))))){ | |
_local8 = _arg3; | |
_local7 = (_local6 / 4); | |
} else { | |
_local7 = ((_local6 / (2 * Math.PI)) * Math.asin((_arg3 / _local8))); | |
}; | |
if (_arg1 < 1){ | |
--_arg1; | |
return (((-0.5 * ((_local8 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _local6)))) + _arg2)); | |
}; | |
--_arg1; | |
return ((((((_local8 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _local6))) * 0.5) + _arg3) + _arg2)); | |
} | |
public static function easeInOutQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ | |
_arg1 = (_arg1 / (_arg4 / 2)); | |
if (_arg1 < 1){ | |
return (((((_arg3 / 2) * _arg1) * _arg1) + _arg2)); | |
}; | |
--_arg1; | |
return ((((-(_arg3) / 2) * ((_arg1 * (_arg1 - 2)) - 1)) + _arg2)); | |
} | |
public static function easeInOutBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ | |
if (_arg1 < (_arg4 / 2)){ | |
return (((easeInBounce((_arg1 * 2), 0, _arg3, _arg4) * 0.5) + _arg2)); | |
}; | |
return ((((easeOutBounce(((_arg1 * 2) - _arg4), 0, _arg3, _arg4) * 0.5) + (_arg3 * 0.5)) + _arg2)); | |
} | |
public static function easeInOutBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ | |
var _local6:Number = ((((!(Boolean(_arg5))) || (isNaN(_arg5.overshoot)))) ? 1.70158 : _arg5.overshoot); | |
_arg1 = (_arg1 / (_arg4 / 2)); | |
if (_arg1 < 1){ | |
_local6 = (_local6 * 1.525); | |
return ((((_arg3 / 2) * ((_arg1 * _arg1) * (((_local6 + 1) * _arg1) - _local6))) + _arg2)); | |
}; | |
_arg1 = (_arg1 - 2); | |
_local6 = (_local6 * 1.525); | |
return ((((_arg3 / 2) * (((_arg1 * _arg1) * (((_local6 + 1) * _arg1) + _local6)) + 2)) + _arg2)); | |
} | |
public static function easeOutInCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ | |
if (_arg1 < (_arg4 / 2)){ | |
return (easeOutCubic((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5)); | |
}; | |
return (easeInCubic(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5)); | |
} | |
public static function easeNone(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ | |
return ((((_arg3 * _arg1) / _arg4) + _arg2)); | |
} | |
public static function easeOutBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ | |
var _local6:Number = ((((!(Boolean(_arg5))) || (isNaN(_arg5.overshoot)))) ? 1.70158 : _arg5.overshoot); | |
_arg1 = ((_arg1 / _arg4) - 1); | |
return (((_arg3 * (((_arg1 * _arg1) * (((_local6 + 1) * _arg1) + _local6)) + 1)) + _arg2)); | |
} | |
public static function easeInOutSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ | |
return ((((-(_arg3) / 2) * (Math.cos(((Math.PI * _arg1) / _arg4)) - 1)) + _arg2)); | |
} | |
public static function easeInBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ | |
var _local6:Number = ((((!(Boolean(_arg5))) || (isNaN(_arg5.overshoot)))) ? 1.70158 : _arg5.overshoot); | |
_arg1 = (_arg1 / _arg4); | |
return (((((_arg3 * _arg1) * _arg1) * (((_local6 + 1) * _arg1) - _local6)) + _arg2)); | |
} | |
public static function easeInQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ | |
_arg1 = (_arg1 / _arg4); | |
return ((((((_arg3 * _arg1) * _arg1) * _arg1) * _arg1) + _arg2)); | |
} | |
public static function easeOutInQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ | |
if (_arg1 < (_arg4 / 2)){ | |
return (easeOutQuint((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5)); | |
}; | |
return (easeInQuint(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5)); | |
} | |
public static function easeOutInBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ | |
if (_arg1 < (_arg4 / 2)){ | |
return (easeOutBounce((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5)); | |
}; | |
return (easeInBounce(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5)); | |
} | |
public static function init():void{ | |
Tweener.registerTransition("easenone", easeNone); | |
Tweener.registerTransition("linear", easeNone); | |
Tweener.registerTransition("easeinquad", easeInQuad); | |
Tweener.registerTransition("easeoutquad", easeOutQuad); | |
Tweener.registerTransition("easeinoutquad", easeInOutQuad); | |
Tweener.registerTransition("easeoutinquad", easeOutInQuad); | |
Tweener.registerTransition("easeincubic", easeInCubic); | |
Tweener.registerTransition("easeoutcubic", easeOutCubic); | |
Tweener.registerTransition("easeinoutcubic", easeInOutCubic); | |
Tweener.registerTransition("easeoutincubic", easeOutInCubic); | |
Tweener.registerTransition("easeinquart", easeInQuart); | |
Tweener.registerTransition("easeoutquart", easeOutQuart); | |
Tweener.registerTransition("easeinoutquart", easeInOutQuart); | |
Tweener.registerTransition("easeoutinquart", easeOutInQuart); | |
Tweener.registerTransition("easeinquint", easeInQuint); | |
Tweener.registerTransition("easeoutquint", easeOutQuint); | |
Tweener.registerTransition("easeinoutquint", easeInOutQuint); | |
Tweener.registerTransition("easeoutinquint", easeOutInQuint); | |
Tweener.registerTransition("easeinsine", easeInSine); | |
Tweener.registerTransition("easeoutsine", easeOutSine); | |
Tweener.registerTransition("easeinoutsine", easeInOutSine); | |
Tweener.registerTransition("easeoutinsine", easeOutInSine); | |
Tweener.registerTransition("easeincirc", easeInCirc); | |
Tweener.registerTransition("easeoutcirc", easeOutCirc); | |
Tweener.registerTransition("easeinoutcirc", easeInOutCirc); | |
Tweener.registerTransition("easeoutincirc", easeOutInCirc); | |
Tweener.registerTransition("easeinexpo", easeInExpo); | |
Tweener.registerTransition("easeoutexpo", easeOutExpo); | |
Tweener.registerTransition("easeinoutexpo", easeInOutExpo); | |
Tweener.registerTransition("easeoutinexpo", easeOutInExpo); | |
Tweener.registerTransition("easeinelastic", easeInElastic); | |
Tweener.registerTransition("easeoutelastic", easeOutElastic); | |
Tweener.registerTransition("easeinoutelastic", easeInOutElastic); | |
Tweener.registerTransition("easeoutinelastic", easeOutInElastic); | |
Tweener.registerTransition("easeinback", easeInBack); | |
Tweener.registerTransition("easeoutback", easeOutBack); | |
Tweener.registerTransition("easeinoutback", easeInOutBack); | |
Tweener.registerTransition("easeoutinback", easeOutInBack); | |
Tweener.registerTransition("easeinbounce", easeInBounce); | |
Tweener.registerTransition("easeoutbounce", easeOutBounce); | |
Tweener.registerTransition("easeinoutbounce", easeInOutBounce); | |
Tweener.registerTransition("easeoutinbounce", easeOutInBounce); | |
} | |
public static function easeOutExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ | |
return (((_arg1)==_arg4) ? (_arg2 + _arg3) : (((_arg3 * 1.001) * (-(Math.pow(2, ((-10 * _arg1) / _arg4))) + 1)) + _arg2)); | |
} | |
public static function easeOutInBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ | |
if (_arg1 < (_arg4 / 2)){ | |
return (easeOutBack((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5)); | |
}; | |
return (easeInBack(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5)); | |
} | |
public static function easeInExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ | |
return (((_arg1)==0) ? _arg2 : (((_arg3 * Math.pow(2, (10 * ((_arg1 / _arg4) - 1)))) + _arg2) - (_arg3 * 0.001))); | |
} | |
public static function easeInCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ | |
_arg1 = (_arg1 / _arg4); | |
return (((((_arg3 * _arg1) * _arg1) * _arg1) + _arg2)); | |
} | |
public static function easeInQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ | |
_arg1 = (_arg1 / _arg4); | |
return (((((((_arg3 * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2)); | |
} | |
public static function easeInOutCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ | |
_arg1 = (_arg1 / (_arg4 / 2)); | |
if (_arg1 < 1){ | |
return ((((-(_arg3) / 2) * (Math.sqrt((1 - (_arg1 * _arg1))) - 1)) + _arg2)); | |
}; | |
_arg1 = (_arg1 - 2); | |
return ((((_arg3 / 2) * (Math.sqrt((1 - (_arg1 * _arg1))) + 1)) + _arg2)); | |
} | |
public static function easeInQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ | |
_arg1 = (_arg1 / _arg4); | |
return ((((_arg3 * _arg1) * _arg1) + _arg2)); | |
} | |
public static function easeInBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ | |
return (((_arg3 - easeOutBounce((_arg4 - _arg1), 0, _arg3, _arg4)) + _arg2)); | |
} | |
public static function easeOutInExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ | |
if (_arg1 < (_arg4 / 2)){ | |
return (easeOutExpo((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5)); | |
}; | |
return (easeInExpo(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5)); | |
} | |
public static function easeOutQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ | |
_arg1 = ((_arg1 / _arg4) - 1); | |
return (((-(_arg3) * ((((_arg1 * _arg1) * _arg1) * _arg1) - 1)) + _arg2)); | |
} | |
public static function easeInSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ | |
return ((((-(_arg3) * Math.cos(((_arg1 / _arg4) * (Math.PI / 2)))) + _arg3) + _arg2)); | |
} | |
public static function easeInOutQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ | |
_arg1 = (_arg1 / (_arg4 / 2)); | |
if (_arg1 < 1){ | |
return (((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2)); | |
}; | |
_arg1 = (_arg1 - 2); | |
return ((((-(_arg3) / 2) * ((((_arg1 * _arg1) * _arg1) * _arg1) - 2)) + _arg2)); | |
} | |
public static function easeOutQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ | |
_arg1 = (_arg1 / _arg4); | |
return ((((-(_arg3) * _arg1) * (_arg1 - 2)) + _arg2)); | |
} | |
public static function easeOutInElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ | |
if (_arg1 < (_arg4 / 2)){ | |
return (easeOutElastic((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5)); | |
}; | |
return (easeInElastic(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5)); | |
} | |
public static function easeInElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ | |
var _local7:Number; | |
if (_arg1 == 0){ | |
return (_arg2); | |
}; | |
_arg1 = (_arg1 / _arg4); | |
if (_arg1 == 1){ | |
return ((_arg2 + _arg3)); | |
}; | |
var _local6:Number = ((((!(Boolean(_arg5))) || (isNaN(_arg5.period)))) ? (_arg4 * 0.3) : _arg5.period); | |
var _local8:Number = ((((!(Boolean(_arg5))) || (isNaN(_arg5.amplitude)))) ? 0 : _arg5.amplitude); | |
if (((!(Boolean(_local8))) || ((_local8 < Math.abs(_arg3))))){ | |
_local8 = _arg3; | |
_local7 = (_local6 / 4); | |
} else { | |
_local7 = ((_local6 / (2 * Math.PI)) * Math.asin((_arg3 / _local8))); | |
}; | |
--_arg1; | |
return ((-(((_local8 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _local6)))) + _arg2)); | |
} | |
public static function easeOutCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ | |
_arg1 = ((_arg1 / _arg4) - 1); | |
return (((_arg3 * (((_arg1 * _arg1) * _arg1) + 1)) + _arg2)); | |
} | |
public static function easeOutQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ | |
_arg1 = ((_arg1 / _arg4) - 1); | |
return (((_arg3 * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 1)) + _arg2)); | |
} | |
public static function easeOutInQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ | |
if (_arg1 < (_arg4 / 2)){ | |
return (easeOutQuad((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5)); | |
}; | |
return (easeInQuad(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5)); | |
} | |
public static function easeOutSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ | |
return (((_arg3 * Math.sin(((_arg1 / _arg4) * (Math.PI / 2)))) + _arg2)); | |
} | |
public static function easeInOutCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ | |
_arg1 = (_arg1 / (_arg4 / 2)); | |
if (_arg1 < 1){ | |
return ((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) + _arg2)); | |
}; | |
_arg1 = (_arg1 - 2); | |
return ((((_arg3 / 2) * (((_arg1 * _arg1) * _arg1) + 2)) + _arg2)); | |
} | |
public static function easeInOutQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ | |
_arg1 = (_arg1 / (_arg4 / 2)); | |
if (_arg1 < 1){ | |
return ((((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2)); | |
}; | |
_arg1 = (_arg1 - 2); | |
return ((((_arg3 / 2) * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 2)) + _arg2)); | |
} | |
public static function easeInCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ | |
_arg1 = (_arg1 / _arg4); | |
return (((-(_arg3) * (Math.sqrt((1 - (_arg1 * _arg1))) - 1)) + _arg2)); | |
} | |
public static function easeOutInSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ | |
if (_arg1 < (_arg4 / 2)){ | |
return (easeOutSine((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5)); | |
}; | |
return (easeInSine(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5)); | |
} | |
public static function easeInOutExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ | |
if (_arg1 == 0){ | |
return (_arg2); | |
}; | |
if (_arg1 == _arg4){ | |
return ((_arg2 + _arg3)); | |
}; | |
_arg1 = (_arg1 / (_arg4 / 2)); | |
if (_arg1 < 1){ | |
return (((((_arg3 / 2) * Math.pow(2, (10 * (_arg1 - 1)))) + _arg2) - (_arg3 * 0.0005))); | |
}; | |
--_arg1; | |
return (((((_arg3 / 2) * 1.0005) * (-(Math.pow(2, (-10 * _arg1))) + 2)) + _arg2)); | |
} | |
public static function easeOutElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ | |
var _local7:Number; | |
if (_arg1 == 0){ | |
return (_arg2); | |
}; | |
_arg1 = (_arg1 / _arg4); | |
if (_arg1 == 1){ | |
return ((_arg2 + _arg3)); | |
}; | |
var _local6:Number = ((((!(Boolean(_arg5))) || (isNaN(_arg5.period)))) ? (_arg4 * 0.3) : _arg5.period); | |
var _local8:Number = ((((!(Boolean(_arg5))) || (isNaN(_arg5.amplitude)))) ? 0 : _arg5.amplitude); | |
if (((!(Boolean(_local8))) || ((_local8 < Math.abs(_arg3))))){ | |
_local8 = _arg3; | |
_local7 = (_local6 / 4); | |
} else { | |
_local7 = ((_local6 / (2 * Math.PI)) * Math.asin((_arg3 / _local8))); | |
}; | |
return (((((_local8 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _local6))) + _arg3) + _arg2)); | |
} | |
public static function easeOutCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ | |
_arg1 = ((_arg1 / _arg4) - 1); | |
return (((_arg3 * Math.sqrt((1 - (_arg1 * _arg1)))) + _arg2)); | |
} | |
public static function easeOutInQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ | |
if (_arg1 < (_arg4 / 2)){ | |
return (easeOutQuart((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5)); | |
}; | |
return (easeInQuart(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5)); | |
} | |
public static function easeOutInCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ | |
if (_arg1 < (_arg4 / 2)){ | |
return (easeOutCirc((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5)); | |
}; | |
return (easeInCirc(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5)); | |
} | |
} | |
}//package caurina.transitions | |
package caurina.transitions { | |
public class SpecialPropertySplitter { | |
public var parameters:Array; | |
public var splitValues:Function; | |
public function SpecialPropertySplitter(_arg1:Function, _arg2:Array){ | |
splitValues = _arg1; | |
parameters = _arg2; | |
} | |
public function toString():String{ | |
var _local1 = ""; | |
_local1 = (_local1 + "[SpecialPropertySplitter "); | |
_local1 = (_local1 + ("splitValues:" + String(splitValues))); | |
_local1 = (_local1 + ", "); | |
_local1 = (_local1 + ("parameters:" + String(parameters))); | |
_local1 = (_local1 + "]"); | |
return (_local1); | |
} | |
} | |
}//package caurina.transitions | |
package caurina.transitions { | |
public class SpecialProperty { | |
public var parameters:Array; | |
public var getValue:Function; | |
public var preProcess:Function; | |
public var setValue:Function; | |
public function SpecialProperty(_arg1:Function, _arg2:Function, _arg3:Array=null, _arg4:Function=null){ | |
getValue = _arg1; | |
setValue = _arg2; | |
parameters = _arg3; | |
preProcess = _arg4; | |
} | |
public function toString():String{ | |
var _local1 = ""; | |
_local1 = (_local1 + "[SpecialProperty "); | |
_local1 = (_local1 + ("getValue:" + String(getValue))); | |
_local1 = (_local1 + ", "); | |
_local1 = (_local1 + ("setValue:" + String(setValue))); | |
_local1 = (_local1 + ", "); | |
_local1 = (_local1 + ("parameters:" + String(parameters))); | |
_local1 = (_local1 + ", "); | |
_local1 = (_local1 + ("preProcess:" + String(preProcess))); | |
_local1 = (_local1 + "]"); | |
return (_local1); | |
} | |
} | |
}//package caurina.transitions | |
package caurina.transitions { | |
public class SpecialPropertyModifier { | |
public var getValue:Function; | |
public var modifyValues:Function; | |
public function SpecialPropertyModifier(_arg1:Function, _arg2:Function){ | |
modifyValues = _arg1; | |
getValue = _arg2; | |
} | |
public function toString():String{ | |
var _local1 = ""; | |
_local1 = (_local1 + "[SpecialPropertyModifier "); | |
_local1 = (_local1 + ("modifyValues:" + String(modifyValues))); | |
_local1 = (_local1 + ", "); | |
_local1 = (_local1 + ("getValue:" + String(getValue))); | |
_local1 = (_local1 + "]"); | |
return (_local1); | |
} | |
} | |
}//package caurina.transitions | |
package caurina.transitions { | |
import flash.display.*; | |
import flash.events.*; | |
import flash.utils.*; | |
public class Tweener { | |
private static var _timeScale:Number = 1; | |
private static var _currentTimeFrame:Number; | |
private static var _specialPropertySplitterList:Object; | |
public static var autoOverwrite:Boolean = true; | |
private static var _engineExists:Boolean = false; | |
private static var _currentTime:Number; | |
private static var _tweenList:Array; | |
private static var _specialPropertyModifierList:Object; | |
private static var _specialPropertyList:Object; | |
private static var _transitionList:Object; | |
private static var _inited:Boolean = false; | |
private static var __tweener_controller__:MovieClip; | |
public function Tweener(){ | |
trace("Tweener is a static class and should not be instantiated."); | |
} | |
public static function registerSpecialPropertyModifier(_arg1:String, _arg2:Function, _arg3:Function):void{ | |
if (!_inited){ | |
init(); | |
}; | |
var _local4:SpecialPropertyModifier = new SpecialPropertyModifier(_arg2, _arg3); | |
_specialPropertyModifierList[_arg1] = _local4; | |
} | |
public static function registerSpecialProperty(_arg1:String, _arg2:Function, _arg3:Function, _arg4:Array=null, _arg5:Function=null):void{ | |
if (!_inited){ | |
init(); | |
}; | |
var _local6:SpecialProperty = new SpecialProperty(_arg2, _arg3, _arg4, _arg5); | |
_specialPropertyList[_arg1] = _local6; | |
} | |
public static function init(... _args):void{ | |
_inited = true; | |
_transitionList = new Object(); | |
Equations.init(); | |
_specialPropertyList = new Object(); | |
_specialPropertyModifierList = new Object(); | |
_specialPropertySplitterList = new Object(); | |
} | |
private static function updateTweens():Boolean{ | |
var _local1:int; | |
if (_tweenList.length == 0){ | |
return (false); | |
}; | |
_local1 = 0; | |
while (_local1 < _tweenList.length) { | |
if ((((_tweenList[_local1] == undefined)) || (!(_tweenList[_local1].isPaused)))){ | |
if (!updateTweenByIndex(_local1)){ | |
removeTweenByIndex(_local1); | |
}; | |
if (_tweenList[_local1] == null){ | |
removeTweenByIndex(_local1, true); | |
_local1--; | |
}; | |
}; | |
_local1++; | |
}; | |
return (true); | |
} | |
public static function addCaller(_arg1:Object=null, _arg2:Object=null):Boolean{ | |
var _local3:Number; | |
var _local4:Array; | |
var _local8:Function; | |
var _local9:TweenListObj; | |
var _local10:Number; | |
var _local11:String; | |
if (!Boolean(_arg1)){ | |
return (false); | |
}; | |
if ((_arg1 is Array)){ | |
_local4 = _arg1.concat(); | |
} else { | |
_local4 = [_arg1]; | |
}; | |
var _local5:Object = _arg2; | |
if (!_inited){ | |
init(); | |
}; | |
if (((!(_engineExists)) || (!(Boolean(__tweener_controller__))))){ | |
startEngine(); | |
}; | |
var _local6:Number = ((isNaN(_local5.time)) ? 0 : _local5.time); | |
var _local7:Number = ((isNaN(_local5.delay)) ? 0 : _local5.delay); | |
if (typeof(_local5.transition) == "string"){ | |
_local11 = _local5.transition.toLowerCase(); | |
_local8 = _transitionList[_local11]; | |
} else { | |
_local8 = _local5.transition; | |
}; | |
if (!Boolean(_local8)){ | |
_local8 = _transitionList["easeoutexpo"]; | |
}; | |
_local3 = 0; | |
while (_local3 < _local4.length) { | |
if (_local5.useFrames == true){ | |
_local9 = new TweenListObj(_local4[_local3], (_currentTimeFrame + (_local7 / _timeScale)), (_currentTimeFrame + ((_local7 + _local6) / _timeScale)), true, _local8, _local5.transitionParams); | |
} else { | |
_local9 = new TweenListObj(_local4[_local3], (_currentTime + ((_local7 * 1000) / _timeScale)), (_currentTime + (((_local7 * 1000) + (_local6 * 1000)) / _timeScale)), false, _local8, _local5.transitionParams); | |
}; | |
_local9.properties = null; | |
_local9.onStart = _local5.onStart; | |
_local9.onUpdate = _local5.onUpdate; | |
_local9.onComplete = _local5.onComplete; | |
_local9.onOverwrite = _local5.onOverwrite; | |
_local9.onStartParams = _local5.onStartParams; | |
_local9.onUpdateParams = _local5.onUpdateParams; | |
_local9.onCompleteParams = _local5.onCompleteParams; | |
_local9.onOverwriteParams = _local5.onOverwriteParams; | |
_local9.onStartScope = _local5.onStartScope; | |
_local9.onUpdateScope = _local5.onUpdateScope; | |
_local9.onCompleteScope = _local5.onCompleteScope; | |
_local9.onOverwriteScope = _local5.onOverwriteScope; | |
_local9.onErrorScope = _local5.onErrorScope; | |
_local9.isCaller = true; | |
_local9.count = _local5.count; | |
_local9.waitFrames = _local5.waitFrames; | |
_tweenList.push(_local9); | |
if ((((_local6 == 0)) && ((_local7 == 0)))){ | |
_local10 = (_tweenList.length - 1); | |
updateTweenByIndex(_local10); | |
removeTweenByIndex(_local10); | |
}; | |
_local3++; | |
}; | |
return (true); | |
} | |
public static function pauseAllTweens():Boolean{ | |
var _local2:uint; | |
if (!Boolean(_tweenList)){ | |
return (false); | |
}; | |
var _local1:Boolean; | |
_local2 = 0; | |
while (_local2 < _tweenList.length) { | |
pauseTweenByIndex(_local2); | |
_local1 = true; | |
_local2++; | |
}; | |
return (_local1); | |
} | |
public static function removeTweens(_arg1:Object, ... _args):Boolean{ | |
var _local4:uint; | |
var _local5:SpecialPropertySplitter; | |
var _local6:Array; | |
var _local7:uint; | |
var _local3:Array = new Array(); | |
_local4 = 0; | |
while (_local4 < _args.length) { | |
if ((((typeof(_args[_local4]) == "string")) && ((_local3.indexOf(_args[_local4]) == -1)))){ | |
if (_specialPropertySplitterList[_args[_local4]]){ | |
_local5 = _specialPropertySplitterList[_args[_local4]]; | |
_local6 = _local5.splitValues(_arg1, null); | |
_local7 = 0; | |
while (_local7 < _local6.length) { | |
_local3.push(_local6[_local7].name); | |
_local7++; | |
}; | |
} else { | |
_local3.push(_args[_local4]); | |
}; | |
}; | |
_local4++; | |
}; | |
return (affectTweens(removeTweenByIndex, _arg1, _local3)); | |
} | |
public static function updateFrame():void{ | |
_currentTimeFrame++; | |
} | |
public static function splitTweens(_arg1:Number, _arg2:Array):uint{ | |
var _local5:uint; | |
var _local6:String; | |
var _local7:Boolean; | |
var _local3:TweenListObj = _tweenList[_arg1]; | |
var _local4:TweenListObj = _local3.clone(false); | |
_local5 = 0; | |
while (_local5 < _arg2.length) { | |
_local6 = _arg2[_local5]; | |
if (Boolean(_local3.properties[_local6])){ | |
_local3.properties[_local6] = undefined; | |
delete _local3.properties[_local6]; | |
}; | |
_local5++; | |
}; | |
for (_local6 in _local4.properties) { | |
_local7 = false; | |
_local5 = 0; | |
while (_local5 < _arg2.length) { | |
if (_arg2[_local5] == _local6){ | |
_local7 = true; | |
break; | |
}; | |
_local5++; | |
}; | |
if (!_local7){ | |
_local4.properties[_local6] = undefined; | |
delete _local4.properties[_local6]; | |
}; | |
}; | |
_tweenList.push(_local4); | |
return ((_tweenList.length - 1)); | |
} | |
public static function resumeTweenByIndex(_arg1:Number):Boolean{ | |
var _local2:TweenListObj = _tweenList[_arg1]; | |
if ((((_local2 == null)) || (!(_local2.isPaused)))){ | |
return (false); | |
}; | |
var _local3:Number = getCurrentTweeningTime(_local2); | |
_local2.timeStart = (_local2.timeStart + (_local3 - _local2.timePaused)); | |
_local2.timeComplete = (_local2.timeComplete + (_local3 - _local2.timePaused)); | |
_local2.timePaused = undefined; | |
_local2.isPaused = false; | |
return (true); | |
} | |
public static function getVersion():String{ | |
return ("AS3 1.33.74"); | |
} | |
public static function onEnterFrame(_arg1:Event):void{ | |
updateTime(); | |
updateFrame(); | |
var _local2:Boolean; | |
_local2 = updateTweens(); | |
if (!_local2){ | |
stopEngine(); | |
}; | |
} | |
public static function updateTime():void{ | |
_currentTime = getTimer(); | |
} | |
private static function updateTweenByIndex(_arg1:Number):Boolean{ | |
var tTweening:* = null; | |
var mustUpdate:* = false; | |
var nv:* = NaN; | |
var t:* = NaN; | |
var b:* = NaN; | |
var c:* = NaN; | |
var d:* = NaN; | |
var pName:* = null; | |
var eventScope:* = null; | |
var tScope:* = null; | |
var tProperty:* = null; | |
var pv:* = NaN; | |
var i:* = _arg1; | |
tTweening = _tweenList[i]; | |
if ((((tTweening == null)) || (!(Boolean(tTweening.scope))))){ | |
return (false); | |
}; | |
var isOver:* = false; | |
var cTime:* = getCurrentTweeningTime(tTweening); | |
if (cTime >= tTweening.timeStart){ | |
tScope = tTweening.scope; | |
if (tTweening.isCaller){ | |
do { | |
t = (((tTweening.timeComplete - tTweening.timeStart) / tTweening.count) * (tTweening.timesCalled + 1)); | |
b = tTweening.timeStart; | |
c = (tTweening.timeComplete - tTweening.timeStart); | |
d = (tTweening.timeComplete - tTweening.timeStart); | |
nv = tTweening.transition(t, b, c, d); | |
if (cTime >= nv){ | |
if (Boolean(tTweening.onUpdate)){ | |
eventScope = ((Boolean(tTweening.onUpdateScope)) ? tTweening.onUpdateScope : tScope); | |
try { | |
tTweening.onUpdate.apply(eventScope, tTweening.onUpdateParams); | |
} catch(e1:Error) { | |
handleError(tTweening, e1, "onUpdate"); | |
}; | |
}; | |
tTweening.timesCalled++; | |
if (tTweening.timesCalled >= tTweening.count){ | |
isOver = true; | |
break; | |
}; | |
if (tTweening.waitFrames){ | |
break; | |
}; | |
}; | |
} while (cTime >= nv); | |
} else { | |
mustUpdate = (((((tTweening.skipUpdates < 1)) || (!(tTweening.skipUpdates)))) || ((tTweening.updatesSkipped >= tTweening.skipUpdates))); | |
if (cTime >= tTweening.timeComplete){ | |
isOver = true; | |
mustUpdate = true; | |
}; | |
if (!tTweening.hasStarted){ | |
if (Boolean(tTweening.onStart)){ | |
eventScope = ((Boolean(tTweening.onStartScope)) ? tTweening.onStartScope : tScope); | |
try { | |
tTweening.onStart.apply(eventScope, tTweening.onStartParams); | |
} catch(e2:Error) { | |
handleError(tTweening, e2, "onStart"); | |
}; | |
}; | |
for (pName in tTweening.properties) { | |
if (tTweening.properties[pName].isSpecialProperty){ | |
if (Boolean(_specialPropertyList[pName].preProcess)){ | |
tTweening.properties[pName].valueComplete = _specialPropertyList[pName].preProcess(tScope, _specialPropertyList[pName].parameters, tTweening.properties[pName].originalValueComplete, tTweening.properties[pName].extra); | |
}; | |
pv = _specialPropertyList[pName].getValue(tScope, _specialPropertyList[pName].parameters, tTweening.properties[pName].extra); | |
} else { | |
pv = tScope[pName]; | |
}; | |
tTweening.properties[pName].valueStart = ((isNaN(pv)) ? tTweening.properties[pName].valueComplete : pv); | |
}; | |
mustUpdate = true; | |
tTweening.hasStarted = true; | |
}; | |
if (mustUpdate){ | |
for (pName in tTweening.properties) { | |
tProperty = tTweening.properties[pName]; | |
if (isOver){ | |
nv = tProperty.valueComplete; | |
} else { | |
if (tProperty.hasModifier){ | |
t = (cTime - tTweening.timeStart); | |
d = (tTweening.timeComplete - tTweening.timeStart); | |
nv = tTweening.transition(t, 0, 1, d, tTweening.transitionParams); | |
nv = tProperty.modifierFunction(tProperty.valueStart, tProperty.valueComplete, nv, tProperty.modifierParameters); | |
} else { | |
t = (cTime - tTweening.timeStart); | |
b = tProperty.valueStart; | |
c = (tProperty.valueComplete - tProperty.valueStart); | |
d = (tTweening.timeComplete - tTweening.timeStart); | |
nv = tTweening.transition(t, b, c, d, tTweening.transitionParams); | |
}; | |
}; | |
if (tTweening.rounded){ | |
nv = Math.round(nv); | |
}; | |
if (tProperty.isSpecialProperty){ | |
_specialPropertyList[pName].setValue(tScope, nv, _specialPropertyList[pName].parameters, tTweening.properties[pName].extra); | |
} else { | |
tScope[pName] = nv; | |
}; | |
}; | |
tTweening.updatesSkipped = 0; | |
if (Boolean(tTweening.onUpdate)){ | |
eventScope = ((Boolean(tTweening.onUpdateScope)) ? tTweening.onUpdateScope : tScope); | |
try { | |
tTweening.onUpdate.apply(eventScope, tTweening.onUpdateParams); | |
} catch(e3:Error) { | |
handleError(tTweening, e3, "onUpdate"); | |
}; | |
}; | |
} else { | |
tTweening.updatesSkipped++; | |
}; | |
}; | |
if (((isOver) && (Boolean(tTweening.onComplete)))){ | |
eventScope = ((Boolean(tTweening.onCompleteScope)) ? tTweening.onCompleteScope : tScope); | |
try { | |
tTweening.onComplete.apply(eventScope, tTweening.onCompleteParams); | |
} catch(e4:Error) { | |
handleError(tTweening, e4, "onComplete"); | |
}; | |
}; | |
return (!(isOver)); | |
}; | |
return (true); | |
} | |
public static function setTimeScale(_arg1:Number):void{ | |
var _local2:Number; | |
var _local3:Number; | |
if (isNaN(_arg1)){ | |
_arg1 = 1; | |
}; | |
if (_arg1 < 1E-5){ | |
_arg1 = 1E-5; | |
}; | |
if (_arg1 != _timeScale){ | |
if (_tweenList != null){ | |
_local2 = 0; | |
while (_local2 < _tweenList.length) { | |
_local3 = getCurrentTweeningTime(_tweenList[_local2]); | |
_tweenList[_local2].timeStart = (_local3 - (((_local3 - _tweenList[_local2].timeStart) * _timeScale) / _arg1)); | |
_tweenList[_local2].timeComplete = (_local3 - (((_local3 - _tweenList[_local2].timeComplete) * _timeScale) / _arg1)); | |
if (_tweenList[_local2].timePaused != undefined){ | |
_tweenList[_local2].timePaused = (_local3 - (((_local3 - _tweenList[_local2].timePaused) * _timeScale) / _arg1)); | |
}; | |
_local2++; | |
}; | |
}; | |
_timeScale = _arg1; | |
}; | |
} | |
public static function resumeAllTweens():Boolean{ | |
var _local2:uint; | |
if (!Boolean(_tweenList)){ | |
return (false); | |
}; | |
var _local1:Boolean; | |
_local2 = 0; | |
while (_local2 < _tweenList.length) { | |
resumeTweenByIndex(_local2); | |
_local1 = true; | |
_local2++; | |
}; | |
return (_local1); | |
} | |
private static function handleError(_arg1:TweenListObj, _arg2:Error, _arg3:String):void{ | |
var eventScope:* = null; | |
var pTweening:* = _arg1; | |
var pError:* = _arg2; | |
var pCallBackName:* = _arg3; | |
if (((Boolean(pTweening.onError)) && ((pTweening.onError is Function)))){ | |
eventScope = ((Boolean(pTweening.onErrorScope)) ? pTweening.onErrorScope : pTweening.scope); | |
try { | |
pTweening.onError.apply(eventScope, [pTweening.scope, pError]); | |
} catch(metaError:Error) { | |
printError(((((String(pTweening.scope) + " raised an error while executing the 'onError' handler. Original error:\n ") + pError.getStackTrace()) + "\nonError error: ") + metaError.getStackTrace())); | |
}; | |
} else { | |
if (!Boolean(pTweening.onError)){ | |
printError(((((String(pTweening.scope) + " raised an error while executing the '") + pCallBackName) + "'handler. \n") + pError.getStackTrace())); | |
}; | |
}; | |
} | |
private static function startEngine():void{ | |
_engineExists = true; | |
_tweenList = new Array(); | |
__tweener_controller__ = new MovieClip(); | |
__tweener_controller__.addEventListener(Event.ENTER_FRAME, Tweener.onEnterFrame); | |
_currentTimeFrame = 0; | |
updateTime(); | |
} | |
public static function removeAllTweens():Boolean{ | |
var _local2:uint; | |
if (!Boolean(_tweenList)){ | |
return (false); | |
}; | |
var _local1:Boolean; | |
_local2 = 0; | |
while (_local2 < _tweenList.length) { | |
removeTweenByIndex(_local2); | |
_local1 = true; | |
_local2++; | |
}; | |
return (_local1); | |
} | |
public static function addTween(_arg1:Object=null, _arg2:Object=null):Boolean{ | |
var _local3:Number; | |
var _local4:Number; | |
var _local5:String; | |
var _local6:Array; | |
var _local13:Function; | |
var _local14:Object; | |
var _local15:TweenListObj; | |
var _local16:Number; | |
var _local17:Array; | |
var _local18:Array; | |
var _local19:Array; | |
var _local20:String; | |
if (!Boolean(_arg1)){ | |
return (false); | |
}; | |
if ((_arg1 is Array)){ | |
_local6 = _arg1.concat(); | |
} else { | |
_local6 = [_arg1]; | |
}; | |
var _local7:Object = TweenListObj.makePropertiesChain(_arg2); | |
if (!_inited){ | |
init(); | |
}; | |
if (((!(_engineExists)) || (!(Boolean(__tweener_controller__))))){ | |
startEngine(); | |
}; | |
var _local8:Number = ((isNaN(_local7.time)) ? 0 : _local7.time); | |
var _local9:Number = ((isNaN(_local7.delay)) ? 0 : _local7.delay); | |
var _local10:Array = new Array(); | |
var _local11:Object = { | |
overwrite:true, | |
time:true, | |
delay:true, | |
useFrames:true, | |
skipUpdates:true, | |
transition:true, | |
transitionParams:true, | |
onStart:true, | |
onUpdate:true, | |
onComplete:true, | |
onOverwrite:true, | |
onError:true, | |
rounded:true, | |
onStartParams:true, | |
onUpdateParams:true, | |
onCompleteParams:true, | |
onOverwriteParams:true, | |
onStartScope:true, | |
onUpdateScope:true, | |
onCompleteScope:true, | |
onOverwriteScope:true, | |
onErrorScope:true | |
}; | |
var _local12:Object = new Object(); | |
for (_local5 in _local7) { | |
if (!_local11[_local5]){ | |
if (_specialPropertySplitterList[_local5]){ | |
_local17 = _specialPropertySplitterList[_local5].splitValues(_local7[_local5], _specialPropertySplitterList[_local5].parameters); | |
_local3 = 0; | |
while (_local3 < _local17.length) { | |
if (_specialPropertySplitterList[_local17[_local3].name]){ | |
_local18 = _specialPropertySplitterList[_local17[_local3].name].splitValues(_local17[_local3].value, _specialPropertySplitterList[_local17[_local3].name].parameters); | |
_local4 = 0; | |
while (_local4 < _local18.length) { | |
_local10[_local18[_local4].name] = { | |
valueStart:undefined, | |
valueComplete:_local18[_local4].value, | |
arrayIndex:_local18[_local4].arrayIndex, | |
isSpecialProperty:false | |
}; | |
_local4++; | |
}; | |
} else { | |
_local10[_local17[_local3].name] = { | |
valueStart:undefined, | |
valueComplete:_local17[_local3].value, | |
arrayIndex:_local17[_local3].arrayIndex, | |
isSpecialProperty:false | |
}; | |
}; | |
_local3++; | |
}; | |
} else { | |
if (_specialPropertyModifierList[_local5] != undefined){ | |
_local19 = _specialPropertyModifierList[_local5].modifyValues(_local7[_local5]); | |
_local3 = 0; | |
while (_local3 < _local19.length) { | |
_local12[_local19[_local3].name] = { | |
modifierParameters:_local19[_local3].parameters, | |
modifierFunction:_specialPropertyModifierList[_local5].getValue | |
}; | |
_local3++; | |
}; | |
} else { | |
_local10[_local5] = { | |
valueStart:undefined, | |
valueComplete:_local7[_local5] | |
}; | |
}; | |
}; | |
}; | |
}; | |
for (_local5 in _local10) { | |
if (_specialPropertyList[_local5] != undefined){ | |
_local10[_local5].isSpecialProperty = true; | |
} else { | |
if (_local6[0][_local5] == undefined){ | |
printError((((("The property '" + _local5) + "' doesn't seem to be a normal object property of ") + String(_local6[0])) + " or a registered special property.")); | |
}; | |
}; | |
}; | |
for (_local5 in _local12) { | |
if (_local10[_local5] != undefined){ | |
_local10[_local5].modifierParameters = _local12[_local5].modifierParameters; | |
_local10[_local5].modifierFunction = _local12[_local5].modifierFunction; | |
}; | |
}; | |
if (typeof(_local7.transition) == "string"){ | |
_local20 = _local7.transition.toLowerCase(); | |
_local13 = _transitionList[_local20]; | |
} else { | |
_local13 = _local7.transition; | |
}; | |
if (!Boolean(_local13)){ | |
_local13 = _transitionList["easeoutexpo"]; | |
}; | |
_local3 = 0; | |
while (_local3 < _local6.length) { | |
_local14 = new Object(); | |
for (_local5 in _local10) { | |
_local14[_local5] = new PropertyInfoObj(_local10[_local5].valueStart, _local10[_local5].valueComplete, _local10[_local5].valueComplete, _local10[_local5].arrayIndex, {}, _local10[_local5].isSpecialProperty, _local10[_local5].modifierFunction, _local10[_local5].modifierParameters); | |
}; | |
if (_local7.useFrames == true){ | |
_local15 = new TweenListObj(_local6[_local3], (_currentTimeFrame + (_local9 / _timeScale)), (_currentTimeFrame + ((_local9 + _local8) / _timeScale)), true, _local13, _local7.transitionParams); | |
} else { | |
_local15 = new TweenListObj(_local6[_local3], (_currentTime + ((_local9 * 1000) / _timeScale)), (_currentTime + (((_local9 * 1000) + (_local8 * 1000)) / _timeScale)), false, _local13, _local7.transitionParams); | |
}; | |
_local15.properties = _local14; | |
_local15.onStart = _local7.onStart; | |
_local15.onUpdate = _local7.onUpdate; | |
_local15.onComplete = _local7.onComplete; | |
_local15.onOverwrite = _local7.onOverwrite; | |
_local15.onError = _local7.onError; | |
_local15.onStartParams = _local7.onStartParams; | |
_local15.onUpdateParams = _local7.onUpdateParams; | |
_local15.onCompleteParams = _local7.onCompleteParams; | |
_local15.onOverwriteParams = _local7.onOverwriteParams; | |
_local15.onStartScope = _local7.onStartScope; | |
_local15.onUpdateScope = _local7.onUpdateScope; | |
_local15.onCompleteScope = _local7.onCompleteScope; | |
_local15.onOverwriteScope = _local7.onOverwriteScope; | |
_local15.onErrorScope = _local7.onErrorScope; | |
_local15.rounded = _local7.rounded; | |
_local15.skipUpdates = _local7.skipUpdates; | |
if ((((_local7.overwrite == undefined)) ? autoOverwrite : _local7.overwrite)){ | |
removeTweensByTime(_local15.scope, _local15.properties, _local15.timeStart, _local15.timeComplete); | |
}; | |
_tweenList.push(_local15); | |
if ((((_local8 == 0)) && ((_local9 == 0)))){ | |
_local16 = (_tweenList.length - 1); | |
updateTweenByIndex(_local16); | |
removeTweenByIndex(_local16); | |
}; | |
_local3++; | |
}; | |
return (true); | |
} | |
public static function registerTransition(_arg1:String, _arg2:Function):void{ | |
if (!_inited){ | |
init(); | |
}; | |
_transitionList[_arg1] = _arg2; | |
} | |
public static function printError(_arg1:String):void{ | |
trace(("## [Tweener] Error: " + _arg1)); | |
} | |
private static function affectTweens(_arg1:Function, _arg2:Object, _arg3:Array):Boolean{ | |
var _local5:uint; | |
var _local6:Array; | |
var _local7:uint; | |
var _local8:uint; | |
var _local9:uint; | |
var _local4:Boolean; | |
if (!Boolean(_tweenList)){ | |
return (false); | |
}; | |
_local5 = 0; | |
while (_local5 < _tweenList.length) { | |
if (((_tweenList[_local5]) && ((_tweenList[_local5].scope == _arg2)))){ | |
if (_arg3.length == 0){ | |
_arg1(_local5); | |
_local4 = true; | |
} else { | |
_local6 = new Array(); | |
_local7 = 0; | |
while (_local7 < _arg3.length) { | |
if (Boolean(_tweenList[_local5].properties[_arg3[_local7]])){ | |
_local6.push(_arg3[_local7]); | |
}; | |
_local7++; | |
}; | |
if (_local6.length > 0){ | |
_local8 = AuxFunctions.getObjectLength(_tweenList[_local5].properties); | |
if (_local8 == _local6.length){ | |
_arg1(_local5); | |
_local4 = true; | |
} else { | |
_local9 = splitTweens(_local5, _local6); | |
_arg1(_local9); | |
_local4 = true; | |
}; | |
}; | |
}; | |
}; | |
_local5++; | |
}; | |
return (_local4); | |
} | |
public static function getTweens(_arg1:Object):Array{ | |
var _local2:uint; | |
var _local3:String; | |
if (!Boolean(_tweenList)){ | |
return ([]); | |
}; | |
var _local4:Array = new Array(); | |
_local2 = 0; | |
while (_local2 < _tweenList.length) { | |
if (((Boolean(_tweenList[_local2])) && ((_tweenList[_local2].scope == _arg1)))){ | |
for (_local3 in _tweenList[_local2].properties) { | |
_local4.push(_local3); | |
}; | |
}; | |
_local2++; | |
}; | |
return (_local4); | |
} | |
public static function isTweening(_arg1:Object):Boolean{ | |
var _local2:uint; | |
if (!Boolean(_tweenList)){ | |
return (false); | |
}; | |
_local2 = 0; | |
while (_local2 < _tweenList.length) { | |
if (((Boolean(_tweenList[_local2])) && ((_tweenList[_local2].scope == _arg1)))){ | |
return (true); | |
}; | |
_local2++; | |
}; | |
return (false); | |
} | |
public static function pauseTweenByIndex(_arg1:Number):Boolean{ | |
var _local2:TweenListObj = _tweenList[_arg1]; | |
if ((((_local2 == null)) || (_local2.isPaused))){ | |
return (false); | |
}; | |
_local2.timePaused = getCurrentTweeningTime(_local2); | |
_local2.isPaused = true; | |
return (true); | |
} | |
public static function getCurrentTweeningTime(_arg1:Object):Number{ | |
return (((_arg1.useFrames) ? _currentTimeFrame : _currentTime)); | |
} | |
public static function getTweenCount(_arg1:Object):Number{ | |
var _local2:uint; | |
if (!Boolean(_tweenList)){ | |
return (0); | |
}; | |
var _local3:Number = 0; | |
_local2 = 0; | |
while (_local2 < _tweenList.length) { | |
if (((Boolean(_tweenList[_local2])) && ((_tweenList[_local2].scope == _arg1)))){ | |
_local3 = (_local3 + AuxFunctions.getObjectLength(_tweenList[_local2].properties)); | |
}; | |
_local2++; | |
}; | |
return (_local3); | |
} | |
private static function stopEngine():void{ | |
_engineExists = false; | |
_tweenList = null; | |
_currentTime = 0; | |
_currentTimeFrame = 0; | |
__tweener_controller__.removeEventListener(Event.ENTER_FRAME, Tweener.onEnterFrame); | |
__tweener_controller__ = null; | |
} | |
public static function removeTweensByTime(_arg1:Object, _arg2:Object, _arg3:Number, _arg4:Number):Boolean{ | |
var removedLocally:* = false; | |
var i:* = 0; | |
var pName:* = null; | |
var eventScope:* = null; | |
var p_scope:* = _arg1; | |
var p_properties:* = _arg2; | |
var p_timeStart:* = _arg3; | |
var p_timeComplete:* = _arg4; | |
var removed:* = false; | |
var tl:* = _tweenList.length; | |
i = 0; | |
while (i < tl) { | |
if (((Boolean(_tweenList[i])) && ((p_scope == _tweenList[i].scope)))){ | |
if ((((p_timeComplete > _tweenList[i].timeStart)) && ((p_timeStart < _tweenList[i].timeComplete)))){ | |
removedLocally = false; | |
for (pName in _tweenList[i].properties) { | |
if (Boolean(p_properties[pName])){ | |
if (Boolean(_tweenList[i].onOverwrite)){ | |
eventScope = ((Boolean(_tweenList[i].onOverwriteScope)) ? _tweenList[i].onOverwriteScope : _tweenList[i].scope); | |
try { | |
_tweenList[i].onOverwrite.apply(eventScope, _tweenList[i].onOverwriteParams); | |
} catch(e:Error) { | |
handleError(_tweenList[i], e, "onOverwrite"); | |
}; | |
}; | |
_tweenList[i].properties[pName] = undefined; | |
delete _tweenList[i].properties[pName]; | |
removedLocally = true; | |
removed = true; | |
}; | |
}; | |
if (removedLocally){ | |
if (AuxFunctions.getObjectLength(_tweenList[i].properties) == 0){ | |
removeTweenByIndex(i); | |
}; | |
}; | |
}; | |
}; | |
i = (i + 1); | |
}; | |
return (removed); | |
} | |
public static function registerSpecialPropertySplitter(_arg1:String, _arg2:Function, _arg3:Array=null):void{ | |
if (!_inited){ | |
init(); | |
}; | |
var _local4:SpecialPropertySplitter = new SpecialPropertySplitter(_arg2, _arg3); | |
_specialPropertySplitterList[_arg1] = _local4; | |
} | |
public static function removeTweenByIndex(_arg1:Number, _arg2:Boolean=false):Boolean{ | |
_tweenList[_arg1] = null; | |
if (_arg2){ | |
_tweenList.splice(_arg1, 1); | |
}; | |
return (true); | |
} | |
public static function resumeTweens(_arg1:Object, ... _args):Boolean{ | |
var _local4:uint; | |
var _local3:Array = new Array(); | |
_local4 = 0; | |
while (_local4 < _args.length) { | |
if ((((typeof(_args[_local4]) == "string")) && ((_local3.indexOf(_args[_local4]) == -1)))){ | |
_local3.push(_args[_local4]); | |
}; | |
_local4++; | |
}; | |
return (affectTweens(resumeTweenByIndex, _arg1, _local3)); | |
} | |
public static function pauseTweens(_arg1:Object, ... _args):Boolean{ | |
var _local4:uint; | |
var _local3:Array = new Array(); | |
_local4 = 0; | |
while (_local4 < _args.length) { | |
if ((((typeof(_args[_local4]) == "string")) && ((_local3.indexOf(_args[_local4]) == -1)))){ | |
_local3.push(_args[_local4]); | |
}; | |
_local4++; | |
}; | |
return (affectTweens(pauseTweenByIndex, _arg1, _local3)); | |
} | |
} | |
}//package caurina.transitions | |
package caurina.transitions { | |
public class TweenListObj { | |
public var hasStarted:Boolean; | |
public var onUpdate:Function; | |
public var useFrames:Boolean; | |
public var count:Number; | |
public var onOverwriteParams:Array; | |
public var timeStart:Number; | |
public var timeComplete:Number; | |
public var onStartParams:Array; | |
public var onUpdateScope:Object; | |
public var rounded:Boolean; | |
public var onUpdateParams:Array; | |
public var properties:Object; | |
public var onComplete:Function; | |
public var transitionParams:Object; | |
public var updatesSkipped:Number; | |
public var onStart:Function; | |
public var onOverwriteScope:Object; | |
public var skipUpdates:Number; | |
public var onStartScope:Object; | |
public var scope:Object; | |
public var isCaller:Boolean; | |
public var timePaused:Number; | |
public var transition:Function; | |
public var onCompleteParams:Array; | |
public var onError:Function; | |
public var timesCalled:Number; | |
public var onErrorScope:Object; | |
public var onOverwrite:Function; | |
public var isPaused:Boolean; | |
public var waitFrames:Boolean; | |
public var onCompleteScope:Object; | |
public function TweenListObj(_arg1:Object, _arg2:Number, _arg3:Number, _arg4:Boolean, _arg5:Function, _arg6:Object){ | |
scope = _arg1; | |
timeStart = _arg2; | |
timeComplete = _arg3; | |
useFrames = _arg4; | |
transition = _arg5; | |
transitionParams = _arg6; | |
properties = new Object(); | |
isPaused = false; | |
timePaused = undefined; | |
isCaller = false; | |
updatesSkipped = 0; | |
timesCalled = 0; | |
skipUpdates = 0; | |
hasStarted = false; | |
} | |
public static function makePropertiesChain(_arg1:Object):Object{ | |
var _local3:Object; | |
var _local4:Object; | |
var _local5:Object; | |
var _local6:Number; | |
var _local7:Number; | |
var _local8:Number; | |
var _local2:Object = _arg1.base; | |
if (_local2){ | |
_local3 = {}; | |
if ((_local2 is Array)){ | |
_local4 = []; | |
_local8 = 0; | |
while (_local8 < _local2.length) { | |
_local4.push(_local2[_local8]); | |
_local8++; | |
}; | |
} else { | |
_local4 = [_local2]; | |
}; | |
_local4.push(_arg1); | |
_local6 = _local4.length; | |
_local7 = 0; | |
while (_local7 < _local6) { | |
if (_local4[_local7]["base"]){ | |
_local5 = AuxFunctions.concatObjects(makePropertiesChain(_local4[_local7]["base"]), _local4[_local7]); | |
} else { | |
_local5 = _local4[_local7]; | |
}; | |
_local3 = AuxFunctions.concatObjects(_local3, _local5); | |
_local7++; | |
}; | |
if (_local3["base"]){ | |
delete _local3["base"]; | |
}; | |
return (_local3); | |
}; | |
return (_arg1); | |
} | |
public function clone(_arg1:Boolean):TweenListObj{ | |
var _local3:String; | |
var _local2:TweenListObj = new TweenListObj(scope, timeStart, timeComplete, useFrames, transition, transitionParams); | |
_local2.properties = new Array(); | |
for (_local3 in properties) { | |
_local2.properties[_local3] = properties[_local3].clone(); | |
}; | |
_local2.skipUpdates = skipUpdates; | |
_local2.updatesSkipped = updatesSkipped; | |
if (!_arg1){ | |
_local2.onStart = onStart; | |
_local2.onUpdate = onUpdate; | |
_local2.onComplete = onComplete; | |
_local2.onOverwrite = onOverwrite; | |
_local2.onError = onError; | |
_local2.onStartParams = onStartParams; | |
_local2.onUpdateParams = onUpdateParams; | |
_local2.onCompleteParams = onCompleteParams; | |
_local2.onOverwriteParams = onOverwriteParams; | |
_local2.onStartScope = onStartScope; | |
_local2.onUpdateScope = onUpdateScope; | |
_local2.onCompleteScope = onCompleteScope; | |
_local2.onOverwriteScope = onOverwriteScope; | |
_local2.onErrorScope = onErrorScope; | |
}; | |
_local2.rounded = rounded; | |
_local2.isPaused = isPaused; | |
_local2.timePaused = timePaused; | |
_local2.isCaller = isCaller; | |
_local2.count = count; | |
_local2.timesCalled = timesCalled; | |
_local2.waitFrames = waitFrames; | |
_local2.hasStarted = hasStarted; | |
return (_local2); | |
} | |
public function toString():String{ | |
var _local3:String; | |
var _local1 = "\n[TweenListObj "; | |
_local1 = (_local1 + ("scope:" + String(scope))); | |
_local1 = (_local1 + ", properties:"); | |
var _local2:Boolean; | |
for (_local3 in properties) { | |
if (!_local2){ | |
_local1 = (_local1 + ","); | |
}; | |
_local1 = (_local1 + ("[name:" + properties[_local3].name)); | |
_local1 = (_local1 + (",valueStart:" + properties[_local3].valueStart)); | |
_local1 = (_local1 + (",valueComplete:" + properties[_local3].valueComplete)); | |
_local1 = (_local1 + "]"); | |
_local2 = false; | |
}; | |
_local1 = (_local1 + (", timeStart:" + String(timeStart))); | |
_local1 = (_local1 + (", timeComplete:" + String(timeComplete))); | |
_local1 = (_local1 + (", useFrames:" + String(useFrames))); | |
_local1 = (_local1 + (", transition:" + String(transition))); | |
_local1 = (_local1 + (", transitionParams:" + String(transitionParams))); | |
if (skipUpdates){ | |
_local1 = (_local1 + (", skipUpdates:" + String(skipUpdates))); | |
}; | |
if (updatesSkipped){ | |
_local1 = (_local1 + (", updatesSkipped:" + String(updatesSkipped))); | |
}; | |
if (Boolean(onStart)){ | |
_local1 = (_local1 + (", onStart:" + String(onStart))); | |
}; | |
if (Boolean(onUpdate)){ | |
_local1 = (_local1 + (", onUpdate:" + String(onUpdate))); | |
}; | |
if (Boolean(onComplete)){ | |
_local1 = (_local1 + (", onComplete:" + String(onComplete))); | |
}; | |
if (Boolean(onOverwrite)){ | |
_local1 = (_local1 + (", onOverwrite:" + String(onOverwrite))); | |
}; | |
if (Boolean(onError)){ | |
_local1 = (_local1 + (", onError:" + String(onError))); | |
}; | |
if (onStartParams){ | |
_local1 = (_local1 + (", onStartParams:" + String(onStartParams))); | |
}; | |
if (onUpdateParams){ | |
_local1 = (_local1 + (", onUpdateParams:" + String(onUpdateParams))); | |
}; | |
if (onCompleteParams){ | |
_local1 = (_local1 + (", onCompleteParams:" + String(onCompleteParams))); | |
}; | |
if (onOverwriteParams){ | |
_local1 = (_local1 + (", onOverwriteParams:" + String(onOverwriteParams))); | |
}; | |
if (onStartScope){ | |
_local1 = (_local1 + (", onStartScope:" + String(onStartScope))); | |
}; | |
if (onUpdateScope){ | |
_local1 = (_local1 + (", onUpdateScope:" + String(onUpdateScope))); | |
}; | |
if (onCompleteScope){ | |
_local1 = (_local1 + (", onCompleteScope:" + String(onCompleteScope))); | |
}; | |
if (onOverwriteScope){ | |
_local1 = (_local1 + (", onOverwriteScope:" + String(onOverwriteScope))); | |
}; | |
if (onErrorScope){ | |
_local1 = (_local1 + (", onErrorScope:" + String(onErrorScope))); | |
}; | |
if (rounded){ | |
_local1 = (_local1 + (", rounded:" + String(rounded))); | |
}; | |
if (isPaused){ | |
_local1 = (_local1 + (", isPaused:" + String(isPaused))); | |
}; | |
if (timePaused){ | |
_local1 = (_local1 + (", timePaused:" + String(timePaused))); | |
}; | |
if (isCaller){ | |
_local1 = (_local1 + (", isCaller:" + String(isCaller))); | |
}; | |
if (count){ | |
_local1 = (_local1 + (", count:" + String(count))); | |
}; | |
if (timesCalled){ | |
_local1 = (_local1 + (", timesCalled:" + String(timesCalled))); | |
}; | |
if (waitFrames){ | |
_local1 = (_local1 + (", waitFrames:" + String(waitFrames))); | |
}; | |
if (hasStarted){ | |
_local1 = (_local1 + (", hasStarted:" + String(hasStarted))); | |
}; | |
_local1 = (_local1 + "]\n"); | |
return (_local1); | |
} | |
} | |
}//package caurina.transitions | |
package caurina.transitions { | |
public class AuxFunctions { | |
public static function getObjectLength(_arg1:Object):uint{ | |
var _local3:String; | |
var _local2:uint; | |
for (_local3 in _arg1) { | |
_local2++; | |
}; | |
return (_local2); | |
} | |
public static function numberToG(_arg1:Number):Number{ | |
return (((_arg1 & 0xFF00) >> 8)); | |
} | |
public static function numberToB(_arg1:Number):Number{ | |
return ((_arg1 & 0xFF)); | |
} | |
public static function numberToR(_arg1:Number):Number{ | |
return (((_arg1 & 0xFF0000) >> 16)); | |
} | |
public static function concatObjects(... _args):Object{ | |
var _local3:Object; | |
var _local5:String; | |
var _local2:Object = {}; | |
var _local4:int; | |
while (_local4 < _args.length) { | |
_local3 = _args[_local4]; | |
for (_local5 in _local3) { | |
if (_local3[_local5] == null){ | |
delete _local2[_local5]; | |
} else { | |
_local2[_local5] = _local3[_local5]; | |
}; | |
}; | |
_local4++; | |
}; | |
return (_local2); | |
} | |
} | |
}//package caurina.transitions | |
package caurina.transitions { | |
public class PropertyInfoObj { | |
public var modifierParameters:Array; | |
public var isSpecialProperty:Boolean; | |
public var valueComplete:Number; | |
public var modifierFunction:Function; | |
public var extra:Object; | |
public var valueStart:Number; | |
public var hasModifier:Boolean; | |
public var arrayIndex:Number; | |
public var originalValueComplete:Object; | |
public function PropertyInfoObj(_arg1:Number, _arg2:Number, _arg3:Object, _arg4:Number, _arg5:Object, _arg6:Boolean, _arg7:Function, _arg8:Array){ | |
valueStart = _arg1; | |
valueComplete = _arg2; | |
originalValueComplete = _arg3; | |
arrayIndex = _arg4; | |
extra = _arg5; | |
isSpecialProperty = _arg6; | |
hasModifier = Boolean(_arg7); | |
modifierFunction = _arg7; | |
modifierParameters = _arg8; | |
} | |
public function toString():String{ | |
var _local1 = "\n[PropertyInfoObj "; | |
_local1 = (_local1 + ("valueStart:" + String(valueStart))); | |
_local1 = (_local1 + ", "); | |
_local1 = (_local1 + ("valueComplete:" + String(valueComplete))); | |
_local1 = (_local1 + ", "); | |
_local1 = (_local1 + ("originalValueComplete:" + String(originalValueComplete))); | |
_local1 = (_local1 + ", "); | |
_local1 = (_local1 + ("arrayIndex:" + String(arrayIndex))); | |
_local1 = (_local1 + ", "); | |
_local1 = (_local1 + ("extra:" + String(extra))); | |
_local1 = (_local1 + ", "); | |
_local1 = (_local1 + ("isSpecialProperty:" + String(isSpecialProperty))); | |
_local1 = (_local1 + ", "); | |
_local1 = (_local1 + ("hasModifier:" + String(hasModifier))); | |
_local1 = (_local1 + ", "); | |
_local1 = (_local1 + ("modifierFunction:" + String(modifierFunction))); | |
_local1 = (_local1 + ", "); | |
_local1 = (_local1 + ("modifierParameters:" + String(modifierParameters))); | |
_local1 = (_local1 + "]\n"); | |
return (_local1); | |
} | |
public function clone():PropertyInfoObj{ | |
var _local1:PropertyInfoObj = new PropertyInfoObj(valueStart, valueComplete, originalValueComplete, arrayIndex, extra, isSpecialProperty, modifierFunction, modifierParameters); | |
return (_local1); | |
} | |
} | |
}//package caurina.transitions |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment