CombinedText stringlengths 4 3.42M |
|---|
package serverProto.activity
{
import com.netease.protobuf.Message;
import com.netease.protobuf.fieldDescriptors.FieldDescriptor$TYPE_MESSAGE;
import com.netease.protobuf.fieldDescriptors.FieldDescriptor$TYPE_INT32;
import com.netease.protobuf.WireType;
import serverProto.inc.ProtoRetInfo;
import com.netease.protobuf.WritingBuffer;
import com.netease.protobuf.WriteUtils;
import flash.utils.IDataInput;
import com.netease.protobuf.ReadUtils;
import flash.errors.IOError;
public final class ProtoFirstSaveQueryRsp extends Message
{
public static const RET:FieldDescriptor$TYPE_MESSAGE = new FieldDescriptor$TYPE_MESSAGE("serverProto.activity.ProtoFirstSaveQueryRsp.ret","ret",1 << 3 | WireType.LENGTH_DELIMITED,ProtoRetInfo);
public static const AWARD_STATUS:FieldDescriptor$TYPE_INT32 = new FieldDescriptor$TYPE_INT32("serverProto.activity.ProtoFirstSaveQueryRsp.award_status","awardStatus",2 << 3 | WireType.VARINT);
public static const AWARD_LIST:FieldDescriptor$TYPE_MESSAGE = new FieldDescriptor$TYPE_MESSAGE("serverProto.activity.ProtoFirstSaveQueryRsp.award_list","awardList",3 << 3 | WireType.LENGTH_DELIMITED,ProtoAwardList);
private var ret$field:ProtoRetInfo;
private var award_status$field:int;
private var hasField$0:uint = 0;
private var award_list$field:serverProto.activity.ProtoAwardList;
public function ProtoFirstSaveQueryRsp()
{
super();
}
public function clearRet() : void
{
this.ret$field = null;
}
public function get hasRet() : Boolean
{
return this.ret$field != null;
}
public function set ret(param1:ProtoRetInfo) : void
{
this.ret$field = param1;
}
public function get ret() : ProtoRetInfo
{
return this.ret$field;
}
public function clearAwardStatus() : void
{
this.hasField$0 = this.hasField$0 & 4.294967294E9;
this.award_status$field = new int();
}
public function get hasAwardStatus() : Boolean
{
return (this.hasField$0 & 1) != 0;
}
public function set awardStatus(param1:int) : void
{
this.hasField$0 = this.hasField$0 | 1;
this.award_status$field = param1;
}
public function get awardStatus() : int
{
return this.award_status$field;
}
public function clearAwardList() : void
{
this.award_list$field = null;
}
public function get hasAwardList() : Boolean
{
return this.award_list$field != null;
}
public function set awardList(param1:serverProto.activity.ProtoAwardList) : void
{
this.award_list$field = param1;
}
public function get awardList() : serverProto.activity.ProtoAwardList
{
return this.award_list$field;
}
override final function writeToBuffer(param1:WritingBuffer) : void
{
var _loc2_:* = undefined;
if(this.hasRet)
{
WriteUtils.writeTag(param1,WireType.LENGTH_DELIMITED,1);
WriteUtils.write$TYPE_MESSAGE(param1,this.ret$field);
}
if(this.hasAwardStatus)
{
WriteUtils.writeTag(param1,WireType.VARINT,2);
WriteUtils.write$TYPE_INT32(param1,this.award_status$field);
}
if(this.hasAwardList)
{
WriteUtils.writeTag(param1,WireType.LENGTH_DELIMITED,3);
WriteUtils.write$TYPE_MESSAGE(param1,this.award_list$field);
}
for(_loc2_ in this)
{
super.writeUnknown(param1,_loc2_);
}
}
override final function readFromSlice(param1:IDataInput, param2:uint) : void
{
/*
* Decompilation error
* Code may be obfuscated
* Tip: You can try enabling "Automatic deobfuscation" in Settings
* Error type: IndexOutOfBoundsException (Index: 3, Size: 3)
*/
throw new flash.errors.IllegalOperationError("Not decompiled due to error");
}
}
}
|
package kabam.rotmg.arena.view {
import kabam.lib.net.api.MessageProvider;
import kabam.lib.net.impl.SocketServer;
import kabam.rotmg.account.core.signals.OpenMoneyWindowSignal;
import kabam.rotmg.arena.model.CurrentArenaRunModel;
import kabam.rotmg.dialogs.control.CloseDialogsSignal;
import kabam.rotmg.external.command.RequestPlayerCreditsCompleteSignal;
import kabam.rotmg.game.model.GameModel;
import kabam.rotmg.messaging.impl.outgoing.arena.EnterArena;
import kabam.rotmg.ui.model.HUDModel;
import robotlegs.bender.bundles.mvcs.Mediator;
public class ContinueOrQuitMediator extends Mediator {
public function ContinueOrQuitMediator() {
super();
}
[Inject]
public var view:ContinueOrQuitDialog;
[Inject]
public var closeDialogs:CloseDialogsSignal;
[Inject]
public var socketServer:SocketServer;
[Inject]
public var messages:MessageProvider;
[Inject]
public var hudModel:HUDModel;
[Inject]
public var currentRunModel:CurrentArenaRunModel;
[Inject]
public var gameModel:GameModel;
[Inject]
public var requestPlayerCreditsComplete:RequestPlayerCreditsCompleteSignal;
[Inject]
public var openMoneyWindow:OpenMoneyWindowSignal;
override public function initialize():void {
this.requestPlayerCreditsComplete.add(this.onRequestPlayerCreditsComplete);
this.view.quit.add(this.onQuit);
this.view.buyContinue.add(this.onContinue);
this.view.init(this.currentRunModel.entry.currentWave, this.gameModel.player.credits_);
}
override public function destroy():void {
this.requestPlayerCreditsComplete.remove(this.onRequestPlayerCreditsComplete);
this.view.quit.remove(this.onQuit);
this.view.buyContinue.remove(this.onContinue);
this.view.destroy();
}
private function onRequestPlayerCreditsComplete():void {
this.view.setProcessing(false);
}
private function onContinue(param1:int, param2:int):void {
var _loc3_:* = null;
if (this.gameModel.player.credits_ >= param2) {
this.closeDialogs.dispatch();
_loc3_ = this.messages.require(17) as EnterArena;
_loc3_.currency = param1;
this.socketServer.sendMessage(_loc3_);
} else {
this.view.setProcessing(true);
this.openMoneyWindow.dispatch();
}
}
private function onQuit():void {
this.closeDialogs.dispatch();
this.hudModel.gameSprite.gsc_.escape();
}
}
}
|
package kabam.rotmg.game.view {
import com.company.assembleegameclient.game.GameSprite;
import com.company.assembleegameclient.game.events.ReconnectEvent;
import com.company.assembleegameclient.objects.Player;
import kabam.rotmg.core.model.MapModel;
import kabam.rotmg.core.model.PlayerModel;
import kabam.rotmg.core.signals.InvalidateDataSignal;
import kabam.rotmg.core.signals.SetScreenSignal;
import kabam.rotmg.core.signals.SetScreenWithValidDataSignal;
import kabam.rotmg.dialogs.control.CloseDialogsSignal;
import kabam.rotmg.game.model.GameInitData;
import kabam.rotmg.game.signals.DisconnectGameSignal;
import kabam.rotmg.game.signals.GameClosedSignal;
import kabam.rotmg.game.signals.PlayGameSignal;
import kabam.rotmg.game.signals.SetWorldInteractionSignal;
import kabam.rotmg.ui.signals.HUDModelInitialized;
import kabam.rotmg.ui.signals.HUDSetupStarted;
import kabam.rotmg.ui.signals.UpdateHUDSignal;
import robotlegs.bender.bundles.mvcs.Mediator;
public class GameSpriteMediator extends Mediator {
public function GameSpriteMediator() {
super();
}
[Inject]
public var view:GameSprite;
[Inject]
public var setWorldInteraction:SetWorldInteractionSignal;
[Inject]
public var invalidate:InvalidateDataSignal;
[Inject]
public var setScreenWithValidData:SetScreenWithValidDataSignal;
[Inject]
public var setScreen:SetScreenSignal;
[Inject]
public var playGame:PlayGameSignal;
[Inject]
public var playerModel:PlayerModel;
[Inject]
public var gameClosed:GameClosedSignal;
[Inject]
public var mapModel:MapModel;
[Inject]
public var closeDialogs:CloseDialogsSignal;
[Inject]
public var disconnect:DisconnectGameSignal;
[Inject]
public var hudSetupStarted:HUDSetupStarted;
[Inject]
public var updateHUDSignal:UpdateHUDSignal;
[Inject]
public var hudModelInitialized:HUDModelInitialized;
override public function initialize():void {
this.setWorldInteraction.add(this.onSetWorldInteraction);
addViewListener(ReconnectEvent.RECONNECT, this.onReconnect);
this.view.modelInitialized.add(this.onGameSpriteModelInitialized);
this.view.drawCharacterWindow.add(this.onStatusPanelDraw);
this.hudModelInitialized.add(this.onHUDModelInitialized);
this.disconnect.add(this.onDisconnect);
this.view.closed.add(this.onClosed);
this.view.mapModel = this.mapModel;
this.view.connect();
}
override public function destroy():void {
this.setWorldInteraction.remove(this.onSetWorldInteraction);
removeViewListener(ReconnectEvent.RECONNECT, this.onReconnect);
this.view.modelInitialized.remove(this.onGameSpriteModelInitialized);
this.view.drawCharacterWindow.remove(this.onStatusPanelDraw);
this.hudModelInitialized.remove(this.onHUDModelInitialized);
this.disconnect.remove(this.onDisconnect);
this.view.closed.remove(this.onClosed);
this.view.disconnect();
}
public function onSetWorldInteraction(value:Boolean):void {
this.view.mui_.setEnablePlayerInput(value);
}
private function onDisconnect():void {
this.view.disconnect();
}
private function onClosed():void {
this.closeDialogs.dispatch();
this.gameClosed.dispatch();
}
private function onGameSpriteModelInitialized():void {
this.hudSetupStarted.dispatch(this.view);
}
private function onStatusPanelDraw(player:Player):void {
this.updateHUDSignal.dispatch(player);
}
private function onHUDModelInitialized():void {
this.view.hudModelInitialized();
}
private function onReconnect(event:ReconnectEvent):void {
if (this.view.isEditor) {
return;
}
var data:GameInitData = new GameInitData();
data.server = event.server_;
data.gameId = event.gameId_;
data.createCharacter = event.createCharacter_;
data.charId = event.charId_;
data.keyTime = event.keyTime_;
data.key = event.key_;
this.playGame.dispatch(data);
}
}
}
|
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package tests.flex.lang.reflect.metadata.metaDataArgument {
import flex.lang.reflect.metadata.MetaDataArgument;
import org.flexunit.asserts.assertEquals;
import org.flexunit.asserts.assertFalse;
import org.flexunit.asserts.assertNull;
public class ArgumentWithInvalidData {
[Test(expects="ArgumentError")]
public function shouldThrowError():void {
var argument:MetaDataArgument = new MetaDataArgument( null );
}
[Test]
public function shouldReturnEmptyStringForKey():void {
var xml:XML = <arg/>;
var argument:MetaDataArgument = new MetaDataArgument( xml );
assertEquals( 0, argument.key.length );
}
[Test]
public function shouldReturnValueAndKeyAsString():void {
var xml:XML = <arg/>;
var argument:MetaDataArgument = new MetaDataArgument( xml );
assertEquals( "", argument.key );
assertEquals( "", argument.value );
}
[Test]
public function shouldNotBeUnpaired():void {
var xml:XML = <arg/>;
var argument:MetaDataArgument = new MetaDataArgument( xml );
assertFalse( argument.unpaired );
}
}
} |
/************************************************************************
* Copyright 2010-2012 Worlize Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
***********************************************************************/
package com.worlize.websocket
{
import com.adobe.net.URI;
import com.adobe.net.URIEncodingBitmap;
import com.adobe.utils.StringUtil;
import com.hurlant.crypto.hash.SHA1;
import com.hurlant.crypto.tls.TLSConfig;
import com.hurlant.crypto.tls.TLSEngine;
import com.hurlant.crypto.tls.TLSSecurityParameters;
import com.hurlant.crypto.tls.TLSSocket;
import com.hurlant.util.Base64;
import com.hurlant.util.Hex;
import flash.events.Event;
import flash.events.EventDispatcher;
import flash.events.IEventDispatcher;
import flash.events.IOErrorEvent;
import flash.events.ProgressEvent;
import flash.events.SecurityErrorEvent;
import flash.events.TimerEvent;
import flash.net.Socket;
import flash.utils.ByteArray;
import flash.utils.Endian;
import flash.utils.IDataInput;
import flash.utils.Timer;
[Event(name="connectionFail",type="com.worlize.websocket.WebSocketErrorEvent")]
[Event(name="ioError",type="flash.events.IOErrorEvent")]
[Event(name="abnormalClose",type="com.worlize.websocket.WebSocketErrorEvent")]
[Event(name="message",type="com.worlize.websocket.WebSocketEvent")]
[Event(name="frame",type="com.worlize.websocket.WebSocketEvent")]
[Event(name="ping",type="com.worlize.websocket.WebSocketEvent")]
[Event(name="pong",type="com.worlize.websocket.WebSocketEvent")]
[Event(name="open",type="com.worlize.websocket.WebSocketEvent")]
[Event(name="closed",type="com.worlize.websocket.WebSocketEvent")]
public class WebSocket extends EventDispatcher
{
private static const MODE_UTF8:int = 0;
private static const MODE_BINARY:int = 0;
private static const MAX_HANDSHAKE_BYTES:int = 10 * 1024; // 10KiB
private var _bufferedAmount:int = 0;
private var _readyState:int;
private var _uri:URI;
private var _protocols:Array;
private var _serverProtocol:String;
private var _host:String;
private var _port:uint;
private var _resource:String;
private var _secure:Boolean;
private var _origin:String;
private var _useNullMask:Boolean = false;
private var rawSocket:Socket;
private var socket:Socket;
private var timeout:uint;
private var fatalError:Boolean = false;
private var nonce:ByteArray;
private var base64nonce:String;
private var serverHandshakeResponse:String;
private var serverExtensions:Array;
private var currentFrame:WebSocketFrame;
private var frameQueue:Vector.<WebSocketFrame>;
private var fragmentationOpcode:int = 0;
private var fragmentationSize:uint = 0;
private var waitingForServerClose:Boolean = false;
private var closeTimeout:int = 5000;
private var closeTimer:Timer;
private var handshakeBytesReceived:int;
private var handshakeTimer:Timer;
private var handshakeTimeout:int = 10000;
private var tlsConfig:TLSConfig;
private var tlsSocket:TLSSocket;
private var URIpathExcludedBitmap:URIEncodingBitmap =
new URIEncodingBitmap(URI.URIpathEscape);
public var config:WebSocketConfig = new WebSocketConfig();
public var debug:Boolean = false;
public static var logger:Function = function(text:String):void {
trace(text);
};
public function WebSocket(uri:String, origin:String, protocols:* = null, timeout:uint = 10000)
{
super(null);
_uri = new URI(uri);
if (protocols is String) {
_protocols = [protocols];
}
else {
_protocols = protocols;
}
if (_protocols) {
for (var i:int=0; i<_protocols.length; i++) {
_protocols[i] = StringUtil.trim(_protocols[i]);
}
}
_origin = origin;
this.timeout = timeout;
this.handshakeTimeout = timeout;
init();
}
private function init():void {
parseUrl();
validateProtocol();
frameQueue = new Vector.<WebSocketFrame>();
fragmentationOpcode = 0x00;
fragmentationSize = 0;
currentFrame = new WebSocketFrame();
fatalError = false;
closeTimer = new Timer(closeTimeout, 1);
closeTimer.addEventListener(TimerEvent.TIMER, handleCloseTimer);
handshakeTimer = new Timer(handshakeTimeout, 1);
handshakeTimer.addEventListener(TimerEvent.TIMER, handleHandshakeTimer);
rawSocket = socket = new Socket();
socket.timeout = timeout;
if (secure) {
tlsConfig = new TLSConfig(TLSEngine.CLIENT,
null, null, null, null, null,
TLSSecurityParameters.PROTOCOL_VERSION);
tlsConfig.trustAllCertificates = true;
tlsConfig.ignoreCommonNameMismatch = true;
socket = tlsSocket = new TLSSocket();
}
rawSocket.addEventListener(Event.CONNECT, handleSocketConnect);
rawSocket.addEventListener(IOErrorEvent.IO_ERROR, handleSocketIOError);
rawSocket.addEventListener(SecurityErrorEvent.SECURITY_ERROR, handleSocketSecurityError);
socket.addEventListener(Event.CLOSE, handleSocketClose);
socket.addEventListener(ProgressEvent.SOCKET_DATA, handleSocketData);
_readyState = WebSocketState.INIT;
}
private function validateProtocol():void {
if (_protocols) {
var separators:Array = [
"(", ")", "<", ">", "@",
",", ";", ":", "\\", "\"",
"/", "[", "]", "?", "=",
"{", "}", " ", String.fromCharCode(9)
];
for (var p:int = 0; p < _protocols.length; p++) {
var protocol:String = _protocols[p];
for (var i:int = 0; i < protocol.length; i++) {
var charCode:int = protocol.charCodeAt(i);
var char:String = protocol.charAt(i);
if (charCode < 0x21 || charCode > 0x7E || separators.indexOf(char) !== -1) {
throw new WebSocketError("Illegal character '" + String.fromCharCode(char) + "' in subprotocol.");
}
}
}
}
}
public function connect():void {
if (_readyState === WebSocketState.INIT || _readyState === WebSocketState.CLOSED) {
_readyState = WebSocketState.CONNECTING;
generateNonce();
handshakeBytesReceived = 0;
rawSocket.connect(_host, _port);
if (debug) {
logger("Connecting to " + _host + " on port " + _port);
}
}
}
private function parseUrl():void {
_host = _uri.authority;
var scheme:String = _uri.scheme.toLocaleLowerCase();
if (scheme === 'wss') {
_secure = true;
_port = 443;
}
else if (scheme === 'ws') {
_secure = false;
_port = 80;
}
else {
throw new Error("Unsupported scheme: " + scheme);
}
var tempPort:uint = parseInt(_uri.port, 10);
if (!isNaN(tempPort) && tempPort !== 0) {
_port = tempPort;
}
var path:String = URI.fastEscapeChars(_uri.path, URIpathExcludedBitmap);
if (path.length === 0) {
path = "/";
}
var query:String = _uri.queryRaw;
if (query.length > 0) {
query = "?" + query;
}
_resource = path + query;
}
private function generateNonce():void {
nonce = new ByteArray();
for (var i:int = 0; i < 16; i++) {
nonce.writeByte(Math.round(Math.random()*0xFF));
}
nonce.position = 0;
base64nonce = Base64.encodeByteArray(nonce);
}
public function get readyState():int {
return _readyState;
}
public function get bufferedAmount():int {
return _bufferedAmount;
}
public function get uri():String {
var uri:String;
uri = _secure ? "wss://" : "ws://";
uri += _host;
if ((_secure && _port !== 443) || (!_secure && _port !== 80)) {
uri += (":" + _port.toString());
}
uri += _resource;
return uri;
}
public function get protocol():String {
return _serverProtocol;
}
public function get extensions():Array {
return [];
}
public function get host():String {
return _host;
}
public function get port():uint {
return _port;
}
public function get resource():String {
return _resource;
}
public function get secure():Boolean {
return _secure;
}
public function get connected():Boolean {
return readyState === WebSocketState.OPEN;
}
// Pseudo masking is useful for speeding up wbesocket usage in a controlled environment,
// such as a self-contained AIR app for mobile where the client can be resonably sure of
// not intending to screw up proxies by confusing them with HTTP commands in the frame body
// Probably not a good idea to enable if being used on the web in general cases.
public function set useNullMask(val:Boolean):void {
_useNullMask = val;
}
public function get useNullMask():Boolean {
return _useNullMask;
}
private function verifyConnectionForSend():void {
if (_readyState === WebSocketState.CONNECTING) {
throw new WebSocketError("Invalid State: Cannot send data before connected.");
}
}
public function sendUTF(data:String):void {
verifyConnectionForSend();
var frame:WebSocketFrame = new WebSocketFrame();
frame.opcode = WebSocketOpcode.TEXT_FRAME;
frame.binaryPayload = new ByteArray();
frame.binaryPayload.writeMultiByte(data, 'utf-8');
fragmentAndSend(frame);
}
public function sendBytes(data:ByteArray):void {
verifyConnectionForSend();
var frame:WebSocketFrame = new WebSocketFrame();
frame.opcode = WebSocketOpcode.BINARY_FRAME;
frame.binaryPayload = data;
fragmentAndSend(frame);
}
public function ping(payload:ByteArray = null):void {
verifyConnectionForSend();
var frame:WebSocketFrame = new WebSocketFrame();
frame.fin = true;
frame.opcode = WebSocketOpcode.PING;
if (payload) {
frame.binaryPayload = payload;
}
sendFrame(frame);
}
private function pong(binaryPayload:ByteArray = null):void {
verifyConnectionForSend();
var frame:WebSocketFrame = new WebSocketFrame();
frame.fin = true;
frame.opcode = WebSocketOpcode.PONG;
frame.binaryPayload = binaryPayload;
sendFrame(frame);
}
private function fragmentAndSend(frame:WebSocketFrame):void {
if (frame.opcode > 0x07) {
throw new WebSocketError("You cannot fragment control frames.");
}
var threshold:uint = config.fragmentationThreshold;
if (config.fragmentOutgoingMessages && frame.binaryPayload && frame.binaryPayload.length > threshold) {
frame.binaryPayload.position = 0;
var length:int = frame.binaryPayload.length;
var numFragments:int = Math.ceil(length / threshold);
for (var i:int = 1; i <= numFragments; i++) {
var currentFrame:WebSocketFrame = new WebSocketFrame();
// continuation opcode except for first frame.
currentFrame.opcode = (i === 1) ? frame.opcode : 0x00;
// fin set on last frame only
currentFrame.fin = (i === numFragments);
// length is likely to be shorter on the last fragment
var currentLength:int = (i === numFragments) ? length - (threshold * (i-1)) : threshold;
frame.binaryPayload.position = threshold * (i-1);
// Slice the right portion of the original payload
currentFrame.binaryPayload = new ByteArray();
frame.binaryPayload.readBytes(currentFrame.binaryPayload, 0, currentLength);
sendFrame(currentFrame);
}
}
else {
frame.fin = true;
sendFrame(frame);
}
}
private function sendFrame(frame:WebSocketFrame, force:Boolean = false):void {
frame.mask = true;
frame.useNullMask = _useNullMask;
var buffer:ByteArray = new ByteArray();
frame.send(buffer);
sendData(buffer);
}
private function sendData(data:ByteArray, fullFlush:Boolean = false):void {
if (!connected) { return; }
data.position = 0;
socket.writeBytes(data, 0, data.bytesAvailable);
socket.flush();
data.clear();
}
public function close(waitForServer:Boolean = true):void {
if (!socket.connected && _readyState === WebSocketState.CONNECTING) {
_readyState = WebSocketState.CLOSED;
try {
socket.close();
}
catch(e:Error) { /* do nothing */ }
}
if (socket.connected) {
var frame:WebSocketFrame = new WebSocketFrame();
frame.rsv1 = frame.rsv2 = frame.rsv3 = frame.mask = false;
frame.fin = true;
frame.opcode = WebSocketOpcode.CONNECTION_CLOSE;
frame.closeStatus = WebSocketCloseStatus.NORMAL;
var buffer:ByteArray = new ByteArray();
frame.mask = true;
frame.send(buffer);
sendData(buffer, true);
if (waitForServer) {
waitingForServerClose = true;
closeTimer.stop();
closeTimer.reset();
closeTimer.start();
}
dispatchClosedEvent();
}
}
private function handleCloseTimer(event:TimerEvent):void {
if (waitingForServerClose) {
// server hasn't responded to our request to close the
// connection, so we'll just close it.
if (socket.connected) {
socket.close();
}
}
}
private function handleSocketConnect(event:Event):void {
if (debug) {
logger("Socket Connected");
}
if (secure) {
if (debug) {
logger("starting SSL/TLS");
}
tlsSocket.startTLS(rawSocket, _host, tlsConfig);
}
socket.endian = Endian.BIG_ENDIAN;
sendHandshake();
}
private function handleSocketClose(event:Event):void {
if (debug) {
logger("Socket Disconnected");
}
dispatchClosedEvent();
}
private function handleSocketData(event:ProgressEvent=null):void {
if (_readyState === WebSocketState.CONNECTING) {
readServerHandshake();
return;
}
// addData returns true if the frame is complete, and false
// if more data is needed.
while (socket.connected && currentFrame.addData(socket, fragmentationOpcode, config) && !fatalError) {
if (currentFrame.protocolError) {
drop(WebSocketCloseStatus.PROTOCOL_ERROR, currentFrame.dropReason);
return;
}
else if (currentFrame.frameTooLarge) {
drop(WebSocketCloseStatus.MESSAGE_TOO_LARGE, currentFrame.dropReason);
return;
}
if (!config.assembleFragments) {
var frameEvent:WebSocketEvent = new WebSocketEvent(WebSocketEvent.FRAME);
frameEvent.frame = currentFrame;
dispatchEvent(frameEvent);
}
processFrame(currentFrame);
currentFrame = new WebSocketFrame();
}
}
private function processFrame(frame:WebSocketFrame):void {
var event:WebSocketEvent;
var i:int;
var currentFrame:WebSocketFrame;
if (frame.rsv1 || frame.rsv2 || frame.rsv3) {
drop(WebSocketCloseStatus.PROTOCOL_ERROR,
"Received frame with reserved bit set without a negotiated extension.");
return;
}
switch (frame.opcode) {
case WebSocketOpcode.BINARY_FRAME:
if (config.assembleFragments) {
if (frameQueue.length === 0) {
if (frame.fin) {
event = new WebSocketEvent(WebSocketEvent.MESSAGE);
event.message = new WebSocketMessage();
event.message.type = WebSocketMessage.TYPE_BINARY;
event.message.binaryData = frame.binaryPayload;
dispatchEvent(event);
}
else if (frameQueue.length === 0) {
// beginning of a fragmented message
frameQueue.push(frame);
fragmentationOpcode = frame.opcode;
}
}
else {
drop(WebSocketCloseStatus.PROTOCOL_ERROR,
"Illegal BINARY_FRAME received in the middle of a fragmented message. Expected a continuation or control frame.");
return;
}
}
break;
case WebSocketOpcode.TEXT_FRAME:
if (config.assembleFragments) {
if (frameQueue.length === 0) {
if (frame.fin) {
event = new WebSocketEvent(WebSocketEvent.MESSAGE);
event.message = new WebSocketMessage();
event.message.type = WebSocketMessage.TYPE_UTF8;
event.message.utf8Data = frame.binaryPayload.readMultiByte(frame.length, 'utf-8');
dispatchEvent(event);
}
else {
// beginning of a fragmented message
frameQueue.push(frame);
fragmentationOpcode = frame.opcode;
}
}
else {
drop(WebSocketCloseStatus.PROTOCOL_ERROR,
"Illegal TEXT_FRAME received in the middle of a fragmented message. Expected a continuation or control frame.");
return;
}
}
break;
case WebSocketOpcode.CONTINUATION:
if (config.assembleFragments) {
if (fragmentationOpcode === WebSocketOpcode.CONTINUATION &&
frame.opcode === WebSocketOpcode.CONTINUATION)
{
drop(WebSocketCloseStatus.PROTOCOL_ERROR,
"Unexpected continuation frame.");
return;
}
fragmentationSize += frame.length;
if (fragmentationSize > config.maxMessageSize) {
drop(WebSocketCloseStatus.MESSAGE_TOO_LARGE, "Maximum message size exceeded.");
return;
}
frameQueue.push(frame);
if (frame.fin) {
// end of fragmented message, so we process the whole
// message now. We also have to decode the utf-8 data
// for text frames after combining all the fragments.
event = new WebSocketEvent(WebSocketEvent.MESSAGE);
event.message = new WebSocketMessage();
var messageOpcode:int = frameQueue[0].opcode;
var binaryData:ByteArray = new ByteArray();
var totalLength:int = 0;
for (i=0; i < frameQueue.length; i++) {
totalLength += frameQueue[i].length;
}
if (totalLength > config.maxMessageSize) {
drop(WebSocketCloseStatus.MESSAGE_TOO_LARGE,
"Message size of " + totalLength +
" bytes exceeds maximum accepted message size of " +
config.maxMessageSize + " bytes.");
return;
}
for (i=0; i < frameQueue.length; i++) {
currentFrame = frameQueue[i];
binaryData.writeBytes(
currentFrame.binaryPayload,
0,
currentFrame.binaryPayload.length
);
currentFrame.binaryPayload.clear();
}
binaryData.position = 0;
switch (messageOpcode) {
case WebSocketOpcode.BINARY_FRAME:
event.message.type = WebSocketMessage.TYPE_BINARY;
event.message.binaryData = binaryData;
break;
case WebSocketOpcode.TEXT_FRAME:
event.message.type = WebSocketMessage.TYPE_UTF8;
event.message.utf8Data = binaryData.readMultiByte(binaryData.length, 'utf-8');
break;
default:
drop(WebSocketCloseStatus.PROTOCOL_ERROR,
"Unexpected first opcode in fragmentation sequence: 0x" + messageOpcode.toString(16));
return;
}
frameQueue = new Vector.<WebSocketFrame>();
fragmentationOpcode = 0x00;
fragmentationSize = 0;
dispatchEvent(event);
}
}
break;
case WebSocketOpcode.PING:
if (debug) {
logger("Received Ping");
}
var pingEvent:WebSocketEvent = new WebSocketEvent(WebSocketEvent.PING, false, true);
pingEvent.frame = frame;
if (dispatchEvent(pingEvent)) {
pong(frame.binaryPayload);
}
break;
case WebSocketOpcode.PONG:
if (debug) {
logger("Received Pong");
}
var pongEvent:WebSocketEvent = new WebSocketEvent(WebSocketEvent.PONG);
pongEvent.frame = frame;
dispatchEvent(pongEvent);
break;
case WebSocketOpcode.CONNECTION_CLOSE:
if (debug) {
logger("Received close frame");
}
if (waitingForServerClose) {
// got confirmation from server, finish closing connection
if (debug) {
logger("Got close confirmation from server.");
}
closeTimer.stop();
waitingForServerClose = false;
socket.close();
}
else {
if (debug) {
logger("Sending close response to server.");
}
close(false);
socket.close();
}
break;
default:
if (debug) {
logger("Unrecognized Opcode: 0x" + frame.opcode.toString(16));
}
drop(WebSocketCloseStatus.PROTOCOL_ERROR, "Unrecognized Opcode: 0x" + frame.opcode.toString(16));
break;
}
}
private function handleSocketIOError(event:IOErrorEvent):void {
if (debug) {
logger("IO Error: " + event);
}
dispatchEvent(event);
dispatchClosedEvent();
}
private function handleSocketSecurityError(event:SecurityErrorEvent):void {
if (debug) {
logger("Security Error: " + event);
}
dispatchEvent(event.clone());
dispatchClosedEvent();
}
private function sendHandshake():void {
serverHandshakeResponse = "";
var hostValue:String = host;
if ((_secure && _port !== 443) || (!_secure && _port !== 80)) {
hostValue += (":" + _port.toString());
}
var text:String = "";
text += "GET " + resource + " HTTP/1.1\r\n";
text += "Host: " + hostValue + "\r\n";
text += "Upgrade: websocket\r\n";
text += "Connection: Upgrade\r\n";
text += "Sec-WebSocket-Key: " + base64nonce + "\r\n";
if (_origin) {
text += "Origin: " + _origin + "\r\n";
}
text += "Sec-WebSocket-Version: 13\r\n";
if (_protocols) {
var protosList:String = _protocols.join(", ");
text += "Sec-WebSocket-Protocol: " + protosList + "\r\n";
}
// TODO: Handle Extensions
text += "\r\n";
if (debug) {
logger(text);
}
socket.writeMultiByte(text, 'us-ascii');
handshakeTimer.stop();
handshakeTimer.reset();
handshakeTimer.start();
}
private function failHandshake(message:String = "Unable to complete websocket handshake."):void {
if (debug) {
logger(message);
}
_readyState = WebSocketState.CLOSED;
if (socket.connected) {
socket.close();
}
handshakeTimer.stop();
handshakeTimer.reset();
var errorEvent:WebSocketErrorEvent = new WebSocketErrorEvent(WebSocketErrorEvent.CONNECTION_FAIL);
errorEvent.text = message;
dispatchEvent(errorEvent);
var event:WebSocketEvent = new WebSocketEvent(WebSocketEvent.CLOSED);
dispatchEvent(event);
}
private function failConnection(message:String):void {
_readyState = WebSocketState.CLOSED;
if (socket.connected) {
socket.close();
}
var errorEvent:WebSocketErrorEvent = new WebSocketErrorEvent(WebSocketErrorEvent.CONNECTION_FAIL);
errorEvent.text = message;
dispatchEvent(errorEvent);
var event:WebSocketEvent = new WebSocketEvent(WebSocketEvent.CLOSED);
dispatchEvent(event);
}
private function drop(closeReason:uint = WebSocketCloseStatus.PROTOCOL_ERROR, reasonText:String = null):void {
if (!connected) {
return;
}
fatalError = true;
var logText:String = "WebSocket: Dropping Connection. Code: " + closeReason.toString(10);
if (reasonText) {
logText += (" - " + reasonText);;
}
logger(logText);
frameQueue = new Vector.<WebSocketFrame>();
fragmentationSize = 0;
if (closeReason !== WebSocketCloseStatus.NORMAL) {
var errorEvent:WebSocketErrorEvent = new WebSocketErrorEvent(WebSocketErrorEvent.ABNORMAL_CLOSE);
errorEvent.text = "Close reason: " + closeReason;
dispatchEvent(errorEvent);
}
sendCloseFrame(closeReason, reasonText, true);
dispatchClosedEvent();
socket.close();
}
private function sendCloseFrame(reasonCode:uint = WebSocketCloseStatus.NORMAL, reasonText:String = null, force:Boolean = false):void {
var frame:WebSocketFrame = new WebSocketFrame();
frame.fin = true;
frame.opcode = WebSocketOpcode.CONNECTION_CLOSE;
frame.closeStatus = reasonCode;
if (reasonText) {
frame.binaryPayload = new ByteArray();
frame.binaryPayload.writeUTFBytes(reasonText);
}
sendFrame(frame, force);
}
private function readServerHandshake():void {
var upgradeHeader:Boolean = false;
var connectionHeader:Boolean = false;
var serverProtocolHeaderMatch:Boolean = false;
var keyValidated:Boolean = false;
var headersTerminatorIndex:int = -1;
// Load in HTTP Header lines until we encounter a double-newline.
while (headersTerminatorIndex === -1 && readHandshakeLine()) {
if (handshakeBytesReceived > MAX_HANDSHAKE_BYTES) {
failHandshake("Received more than " + MAX_HANDSHAKE_BYTES + " bytes during handshake.");
return;
}
headersTerminatorIndex = serverHandshakeResponse.search(/\r?\n\r?\n/);
}
if (headersTerminatorIndex === -1) {
return;
}
if (debug) {
logger("Server Response Headers:\n" + serverHandshakeResponse);
}
// Slice off the trailing \r\n\r\n from the handshake data
serverHandshakeResponse = serverHandshakeResponse.slice(0, headersTerminatorIndex);
var lines:Array = serverHandshakeResponse.split(/\r?\n/);
// Validate status line
var responseLine:String = lines.shift();
var responseLineMatch:Array = responseLine.match(/^(HTTP\/\d\.\d) (\d{3}) ?(.*)$/i);
if (responseLineMatch.length === 0) {
failHandshake("Unable to find correctly-formed HTTP status line.");
return;
}
var httpVersion:String = responseLineMatch[1];
var statusCode:int = parseInt(responseLineMatch[2], 10);
var statusDescription:String = responseLineMatch[3];
if (debug) {
logger("HTTP Status Received: " + statusCode + " " + statusDescription);
}
// Verify correct status code received
if (statusCode !== 101) {
failHandshake("An HTTP response code other than 101 was received. Actual Response Code: " + statusCode + " " + statusDescription);
return;
}
// Interpret HTTP Response Headers
serverExtensions = [];
try {
while (lines.length > 0) {
responseLine = lines.shift();
var header:Object = parseHTTPHeader(responseLine);
var lcName:String = header.name.toLocaleLowerCase();
var lcValue:String = header.value.toLocaleLowerCase();
if (lcName === 'upgrade' && lcValue === 'websocket') {
upgradeHeader = true;
}
else if (lcName === 'connection' && lcValue === 'upgrade') {
connectionHeader = true;
}
else if (lcName === 'sec-websocket-extensions' && header.value) {
var extensionsThisLine:Array = header.value.split(',');
serverExtensions = serverExtensions.concat(extensionsThisLine);
}
else if (lcName === 'sec-websocket-accept') {
var byteArray:ByteArray = new ByteArray();
byteArray.writeUTFBytes(base64nonce + "258EAFA5-E914-47DA-95CA-C5AB0DC85B11");
var expectedKey:String = Base64.encodeByteArray(new SHA1().hash(byteArray));
if (debug) {
logger("Expected Sec-WebSocket-Accept value: " + expectedKey);
}
if (header.value === expectedKey) {
keyValidated = true;
}
}
else if(lcName === 'sec-websocket-protocol') {
if (_protocols) {
for each (var protocol:String in _protocols) {
if (protocol == header.value) {
_serverProtocol = protocol;
}
}
}
}
}
}
catch(e:Error) {
failHandshake("There was an error while parsing the following HTTP Header line:\n" + responseLine);
return;
}
if (!upgradeHeader) {
failHandshake("The server response did not include a valid Upgrade: websocket header.");
return;
}
if (!connectionHeader) {
failHandshake("The server response did not include a valid Connection: upgrade header.");
return;
}
if (!keyValidated) {
failHandshake("Unable to validate server response for Sec-Websocket-Accept header.");
return;
}
if (_protocols && !_serverProtocol) {
failHandshake("The server can not respond in any of our requested protocols");
return;
}
if (debug) {
logger("Server Extensions: " + serverExtensions.join(' | '));
}
// The connection is validated!!
handshakeTimer.stop();
handshakeTimer.reset();
serverHandshakeResponse = null;
_readyState = WebSocketState.OPEN;
// prepare for first frame
currentFrame = new WebSocketFrame();
frameQueue = new Vector.<WebSocketFrame>();
dispatchEvent(new WebSocketEvent(WebSocketEvent.OPEN));
// Start reading data
handleSocketData();
return;
}
private function handleHandshakeTimer(event:TimerEvent):void {
failHandshake("Timed out waiting for server response.");
}
private function parseHTTPHeader(line:String):Object {
var header:Array = line.split(/\: +/);
return header.length === 2 ? {
name: header[0],
value: header[1]
} : null;
}
// Return true if the header is completely read
private function readHandshakeLine():Boolean {
var char:String;
while (socket.bytesAvailable) {
char = socket.readMultiByte(1, 'us-ascii');
handshakeBytesReceived ++;
serverHandshakeResponse += char;
if (char == "\n") {
return true;
}
}
return false;
}
private function dispatchClosedEvent():void {
if (handshakeTimer.running) {
handshakeTimer.stop();
}
if (_readyState !== WebSocketState.CLOSED) {
_readyState = WebSocketState.CLOSED;
var event:WebSocketEvent = new WebSocketEvent(WebSocketEvent.CLOSED);
dispatchEvent(event);
}
}
}
}
|
package pl.brun.lib.test.animation {
import pl.brun.lib.actions.ActionEvent;
import pl.brun.lib.animation.Tween;
import pl.brun.lib.display.button.MCButton;
import pl.brun.lib.models.easing.Easing;
import pl.brun.lib.models.easing.EasingUtil;
import pl.brun.lib.test.TestBase;
import flash.display.MovieClip;
import flash.events.MouseEvent;
/**
* created: 2010-01-24
* @author Marek Brun
*/
public class TweenStaticTest extends TestBase {
private var mc:TweenStaticTestMC;
public function TweenStaticTest() {
mc = new TweenStaticTestMC();
addChild(mc);
var easingClasses:Array /*of Class*/= EasingUtil.getEasingClasses();
var i:uint;
var easingClass:Class;
for(i = 0;i < easingClasses.length;i++) {
easingClass = easingClasses[i];
mc.comboEasings.addItem({data:easingClass, label:easingClass});
}
mc.comboEasings.selectedIndex = 0;
MCButton.forInstance(mc.a).addEventListener(MouseEvent.CLICK, onA_Click);
MCButton.forInstance(mc.b).addEventListener(MouseEvent.CLICK, onB_Click);
MCButton.forInstance(mc.c).addEventListener(MouseEvent.CLICK, onC_Click);
MCButton.forInstance(mc.d).addEventListener(MouseEvent.CLICK, onD_Click);
}
private function tweenBallToClip(tragetClip:MovieClip):void {
var objectsAndProperties:Array/*of Array*/ = [[mc.ball, 'x', tragetClip.x], [mc.ball, 'y', tragetClip.y]];
var time:uint=2000;
var easing:Easing = new mc.comboEasings.selectedItem.data();
var finishHandler:Function = onTweenFinish;
Tween.tweenTo(objectsAndProperties, time, easing, onTweenFinish);
}
//----------------------------------------------------------------------
// event handlers
//----------------------------------------------------------------------
private function onA_Click(event:MouseEvent):void {
tweenBallToClip(mc.a);
}
private function onB_Click(event:MouseEvent):void {
tweenBallToClip(mc.b);
}
private function onC_Click(event:MouseEvent):void {
tweenBallToClip(mc.c);
}
private function onD_Click(event:MouseEvent):void {
tweenBallToClip(mc.d);
}
private function onTweenFinish(event:ActionEvent):void {
dbg.log('onTweenFinish()');
}
}
} |
package com.idsquare.vince.iwedding.view
{
import flash.display.Sprite;
import flash.display.MovieClip;
import flash.display.AVM1Movie;
import com.idsquare.vince.iwedding.GlobalModelManager;
public class StickerButtonHolder extends Sprite
{
public var sid:uint;
private var HOLDER_WIDTH:int = GlobalModelManager.stickerConfig.button_width;
private var HOLDER_HEIGHT:int = GlobalModelManager.stickerConfig.button_height;
private var _graphic:MovieClip;
public function StickerButtonHolder($graphic:MovieClip, $index:uint)
{
this._graphic = $graphic;
this.sid = $index;
//this,graphics.beginFill(0x00FF0000); // red
this,graphics.beginFill(GlobalModelManager.stickerConfig.button_bgColor); // pink
this.graphics.drawRect(0, 0, HOLDER_WIDTH, HOLDER_HEIGHT);
this.graphics.endFill();
this._graphic.x = GlobalModelManager.stickerList[this.sid].x;
this._graphic.y = GlobalModelManager.stickerList[this.sid].y;
this._graphic.scaleX = GlobalModelManager.stickerList[this.sid].scalex;
this._graphic.scaleY = GlobalModelManager.stickerList[this.sid].scaley;
this.addChild(this._graphic);
this.mouseChildren = false;
}
}
}
|
package starling.animation
{
import starling.events.EventDispatcher;
import starling.utils.Color;
public class Tween extends EventDispatcher implements IAnimatable
{
private static const HINT_MARKER:String = "#";
private static var sTweenPool:Vector.<Tween> = new Vector.<Tween>(0);
private var _target:Object;
private var _transitionFunc:Function;
private var _transitionName:String;
private var _properties:Vector.<String>;
private var _startValues:Vector.<Number>;
private var _endValues:Vector.<Number>;
private var _updateFuncs:Vector.<Function>;
private var _onStart:Function;
private var _onUpdate:Function;
private var _onRepeat:Function;
private var _onComplete:Function;
private var _onStartArgs:Array;
private var _onUpdateArgs:Array;
private var _onRepeatArgs:Array;
private var _onCompleteArgs:Array;
private var _totalTime:Number;
private var _currentTime:Number;
private var _progress:Number;
private var _delay:Number;
private var _roundToInt:Boolean;
private var _nextTween:Tween;
private var _repeatCount:int;
private var _repeatDelay:Number;
private var _reverse:Boolean;
private var _currentCycle:int;
public function Tween(param1:Object, param2:Number, param3:Object = "linear")
{
super();
reset(param1,param2,param3);
}
static function getPropertyHint(param1:String) : String
{
if(param1.indexOf("color") != -1 || param1.indexOf("Color") != -1)
{
return "rgb";
}
var _loc2_:int = param1.indexOf("#");
if(_loc2_ != -1)
{
return param1.substr(_loc2_ + 1);
}
return null;
}
static function getPropertyName(param1:String) : String
{
var _loc2_:int = param1.indexOf("#");
if(_loc2_ != -1)
{
return param1.substring(0,_loc2_);
}
return param1;
}
static function fromPool(param1:Object, param2:Number, param3:Object = "linear") : Tween
{
if(sTweenPool.length)
{
return sTweenPool.pop().reset(param1,param2,param3);
}
return new Tween(param1,param2,param3);
}
static function toPool(param1:Tween) : void
{
var _loc2_:* = null;
param1._onComplete = _loc2_;
_loc2_ = _loc2_;
param1._onRepeat = _loc2_;
_loc2_ = _loc2_;
param1._onUpdate = _loc2_;
param1._onStart = _loc2_;
_loc2_ = null;
param1._onCompleteArgs = _loc2_;
_loc2_ = _loc2_;
param1._onRepeatArgs = _loc2_;
_loc2_ = _loc2_;
param1._onUpdateArgs = _loc2_;
param1._onStartArgs = _loc2_;
param1._target = null;
param1._transitionFunc = null;
param1.removeEventListeners();
sTweenPool.push(param1);
}
public function reset(param1:Object, param2:Number, param3:Object = "linear") : Tween
{
_target = param1;
_currentTime = 0;
_totalTime = Math.max(0.0001,param2);
_progress = 0;
_repeatDelay = 0;
_delay = 0;
_onComplete = null;
_onRepeat = null;
_onUpdate = null;
_onStart = null;
_onCompleteArgs = null;
_onRepeatArgs = null;
_onUpdateArgs = null;
_onStartArgs = null;
_reverse = false;
_roundToInt = false;
_repeatCount = 1;
_currentCycle = -1;
_nextTween = null;
if(param3 is String)
{
this.transition = param3 as String;
}
else if(param3 is Function)
{
this.transitionFunc = param3 as Function;
}
else
{
throw new ArgumentError("Transition must be either a string or a function");
}
if(_properties)
{
_properties.length = 0;
}
else
{
_properties = new Vector.<String>(0);
}
if(_startValues)
{
_startValues.length = 0;
}
else
{
_startValues = new Vector.<Number>(0);
}
if(_endValues)
{
_endValues.length = 0;
}
else
{
_endValues = new Vector.<Number>(0);
}
if(_updateFuncs)
{
_updateFuncs.length = 0;
}
else
{
_updateFuncs = new Vector.<Function>(0);
}
return this;
}
public function animate(param1:String, param2:Number) : void
{
if(_target == null)
{
return;
}
var _loc3_:int = _properties.length;
var _loc4_:Function = getUpdateFuncFromProperty(param1);
_properties[_loc3_] = getPropertyName(param1);
_startValues[_loc3_] = NaN;
_endValues[_loc3_] = param2;
_updateFuncs[_loc3_] = _loc4_;
}
public function scaleTo(param1:Number) : void
{
animate("scaleX",param1);
animate("scaleY",param1);
}
public function moveTo(param1:Number, param2:Number) : void
{
animate("x",param1);
animate("y",param2);
}
public function fadeTo(param1:Number) : void
{
animate("alpha",param1);
}
public function rotateTo(param1:Number, param2:String = "rad") : void
{
animate("rotation#" + param2,param1);
}
public function advanceTime(param1:Number) : void
{
var _loc6_:int = 0;
var _loc7_:* = null;
var _loc5_:* = null;
var _loc8_:* = null;
if(param1 == 0 || _repeatCount == 1 && _currentTime == _totalTime)
{
return;
}
var _loc3_:Number = _currentTime;
var _loc2_:Number = _totalTime - _currentTime;
var _loc10_:* = Number(param1 > _loc2_?param1 - _loc2_:0);
_currentTime = _currentTime + param1;
if(_currentTime <= 0)
{
return;
}
if(_currentTime > _totalTime)
{
_currentTime = _totalTime;
}
if(_currentCycle < 0 && _loc3_ <= 0 && _currentTime > 0)
{
_currentCycle = Number(_currentCycle) + 1;
if(_onStart != null)
{
_onStart.apply(this,_onStartArgs);
}
}
var _loc11_:Number = _currentTime / _totalTime;
var _loc9_:Boolean = _reverse && _currentCycle % 2 == 1;
var _loc4_:int = _startValues.length;
_progress = !!_loc9_?_transitionFunc(1 - _loc11_):_transitionFunc(_loc11_);
_loc6_ = 0;
while(_loc6_ < _loc4_)
{
if(_startValues[_loc6_] != _startValues[_loc6_])
{
_startValues[_loc6_] = _target[_properties[_loc6_]] as Number;
}
_loc7_ = _updateFuncs[_loc6_] as Function;
_loc7_(_properties[_loc6_],_startValues[_loc6_],_endValues[_loc6_]);
_loc6_++;
}
if(_onUpdate != null)
{
_onUpdate.apply(this,_onUpdateArgs);
}
if(_loc3_ < _totalTime && _currentTime >= _totalTime)
{
if(_repeatCount == 0 || _repeatCount > 1)
{
_currentTime = -_repeatDelay;
_currentCycle = Number(_currentCycle) + 1;
if(_repeatCount > 1)
{
_repeatCount = Number(_repeatCount) - 1;
}
if(_onRepeat != null)
{
_onRepeat.apply(this,_onRepeatArgs);
}
}
else
{
_loc5_ = _onComplete;
_loc8_ = _onCompleteArgs;
dispatchEventWith("removeFromJuggler");
if(_loc5_ != null)
{
_loc5_.apply(this,_loc8_);
}
if(_currentTime == 0)
{
_loc10_ = 0;
}
}
}
if(_loc10_)
{
advanceTime(_loc10_);
}
}
private function getUpdateFuncFromProperty(param1:String) : Function
{
var _loc3_:* = null;
var _loc2_:String = getPropertyHint(param1);
var _loc4_:* = _loc2_;
switch(_loc4_)
{
case null:
_loc3_ = updateStandard;
break;
case "rgb":
_loc3_ = updateRgb;
break;
case "rad":
_loc3_ = updateRad;
break;
case "deg":
_loc3_ = updateDeg;
break;
default:
trace("[Starling] Ignoring unknown property hint:",_loc2_);
_loc3_ = updateStandard;
}
return _loc3_;
}
private function updateStandard(param1:String, param2:Number, param3:Number) : void
{
var _loc4_:Number = param2 + _progress * (param3 - param2);
if(_roundToInt)
{
_loc4_ = Math.round(_loc4_);
}
_target[param1] = _loc4_;
}
private function updateRgb(param1:String, param2:Number, param3:Number) : void
{
_target[param1] = Color.interpolate(uint(param2),uint(param3),_progress);
}
private function updateRad(param1:String, param2:Number, param3:Number) : void
{
updateAngle(3.14159265358979,param1,param2,param3);
}
private function updateDeg(param1:String, param2:Number, param3:Number) : void
{
updateAngle(180,param1,param2,param3);
}
private function updateAngle(param1:Number, param2:String, param3:Number, param4:Number) : void
{
while(Math.abs(param4 - param3) > param1)
{
if(param3 < param4)
{
param4 = param4 - 2 * param1;
}
else
{
param4 = param4 + 2 * param1;
}
}
updateStandard(param2,param3,param4);
}
public function getEndValue(param1:String) : Number
{
var _loc2_:int = _properties.indexOf(param1);
if(_loc2_ == -1)
{
throw new ArgumentError("The property \'" + param1 + "\' is not animated");
}
return _endValues[_loc2_] as Number;
}
public function get isComplete() : Boolean
{
return _currentTime >= _totalTime && _repeatCount == 1;
}
public function get target() : Object
{
return _target;
}
public function get transition() : String
{
return _transitionName;
}
public function set transition(param1:String) : void
{
_transitionName = param1;
_transitionFunc = Transitions.getTransition(param1);
if(_transitionFunc == null)
{
throw new ArgumentError("Invalid transiton: " + param1);
}
}
public function get transitionFunc() : Function
{
return _transitionFunc;
}
public function set transitionFunc(param1:Function) : void
{
_transitionName = "custom";
_transitionFunc = param1;
}
public function get totalTime() : Number
{
return _totalTime;
}
public function get currentTime() : Number
{
return _currentTime;
}
public function get progress() : Number
{
return _progress;
}
public function get delay() : Number
{
return _delay;
}
public function set delay(param1:Number) : void
{
_currentTime = _currentTime + _delay - param1;
_delay = param1;
}
public function get repeatCount() : int
{
return _repeatCount;
}
public function set repeatCount(param1:int) : void
{
_repeatCount = param1;
}
public function get repeatDelay() : Number
{
return _repeatDelay;
}
public function set repeatDelay(param1:Number) : void
{
_repeatDelay = param1;
}
public function get reverse() : Boolean
{
return _reverse;
}
public function set reverse(param1:Boolean) : void
{
_reverse = param1;
}
public function get roundToInt() : Boolean
{
return _roundToInt;
}
public function set roundToInt(param1:Boolean) : void
{
_roundToInt = param1;
}
public function get onStart() : Function
{
return _onStart;
}
public function set onStart(param1:Function) : void
{
_onStart = param1;
}
public function get onUpdate() : Function
{
return _onUpdate;
}
public function set onUpdate(param1:Function) : void
{
_onUpdate = param1;
}
public function get onRepeat() : Function
{
return _onRepeat;
}
public function set onRepeat(param1:Function) : void
{
_onRepeat = param1;
}
public function get onComplete() : Function
{
return _onComplete;
}
public function set onComplete(param1:Function) : void
{
_onComplete = param1;
}
public function get onStartArgs() : Array
{
return _onStartArgs;
}
public function set onStartArgs(param1:Array) : void
{
_onStartArgs = param1;
}
public function get onUpdateArgs() : Array
{
return _onUpdateArgs;
}
public function set onUpdateArgs(param1:Array) : void
{
_onUpdateArgs = param1;
}
public function get onRepeatArgs() : Array
{
return _onRepeatArgs;
}
public function set onRepeatArgs(param1:Array) : void
{
_onRepeatArgs = param1;
}
public function get onCompleteArgs() : Array
{
return _onCompleteArgs;
}
public function set onCompleteArgs(param1:Array) : void
{
_onCompleteArgs = param1;
}
public function get nextTween() : Tween
{
return _nextTween;
}
public function set nextTween(param1:Tween) : void
{
_nextTween = param1;
}
}
}
|
package petsBag.petsAdvanced
{
import com.pickgliss.ui.ComponentFactory;
import com.pickgliss.ui.core.Disposeable;
import com.pickgliss.ui.text.FilterFrameText;
import com.pickgliss.utils.ObjectUtils;
import ddt.manager.LanguageMgr;
import flash.display.MovieClip;
import flash.display.Sprite;
import flash.events.Event;
public class PetsPropItem extends Sprite implements Disposeable
{
private var _propNameArr:Array;
private var _propNameTxt:FilterFrameText;
private var _propValueTxt:FilterFrameText;
private var _risingStarAddedPropValueTxt:FilterFrameText;
private var _evolutionAddedPropValueTxt:FilterFrameText;
private var _viewType:int;
private var _numMc:MovieClip;
private var _isPlayComplete:Boolean = true;
private var _propValue:int;
private var _addedProValue:Number;
private var _index:int;
public function PetsPropItem(param1:int)
{
this._propNameArr = ["MaxHp","attack","defence","agility","luck"];
super();
this._viewType = param1;
this.initView();
}
private function initView() : void
{
this._propNameTxt = ComponentFactory.Instance.creatComponentByStylename("petsBag.advanced.propNameTxt");
addChild(this._propNameTxt);
this._propValueTxt = ComponentFactory.Instance.creatComponentByStylename("petsBag.advanced.propValueTxt");
addChild(this._propValueTxt);
if(this._viewType == 1)
{
this._risingStarAddedPropValueTxt = ComponentFactory.Instance.creatComponentByStylename("petsBag.risingStar.addedPropValueTxt");
addChild(this._risingStarAddedPropValueTxt);
}
else
{
this._evolutionAddedPropValueTxt = ComponentFactory.Instance.creatComponentByStylename("petsBag.evolution.addedPropValueTxt");
addChild(this._evolutionAddedPropValueTxt);
}
}
public function setData(param1:int, param2:int, param3:Number) : void
{
this._index = param1;
this._propValue = param2;
this._addedProValue = param3;
if(!this._isPlayComplete)
{
return;
}
this._propNameTxt.text = LanguageMgr.GetTranslation(this._propNameArr[param1]);
if(this._viewType == 1)
{
this._propValueTxt.text = "+" + param2;
this._risingStarAddedPropValueTxt.text = "(+" + param3.toFixed(1) + ")";
}
else
{
this._propValueTxt.text = "" + param2;
this._evolutionAddedPropValueTxt.text = "+" + int(param3);
}
}
public function playNumMc() : void
{
var _loc1_:int = 0;
if(this._viewType == 1)
{
_loc1_ = this._propValueTxt.text.length - 1;
}
else
{
_loc1_ = this._propValueTxt.text.length;
}
this._numMc = ComponentFactory.Instance.creat("petsBag.advanced.numMc" + _loc1_);
this._numMc.x = this._propValueTxt.x + 13 + 4.5 * (5 - _loc1_);
this._numMc.y = this._propValueTxt.y + 2;
addChild(this._numMc);
this._isPlayComplete = false;
addEventListener(Event.ENTER_FRAME,this.__enterHandler);
}
protected function __enterHandler(param1:Event) : void
{
if(this._numMc.currentFrame >= 23)
{
this._isPlayComplete = true;
this.setData(this._index,this._propValue,this._addedProValue);
removeChild(this._numMc);
this._numMc = null;
removeEventListener(Event.ENTER_FRAME,this.__enterHandler);
}
}
public function dispose() : void
{
ObjectUtils.disposeObject(this._propNameTxt);
this._propNameTxt = null;
ObjectUtils.disposeObject(this._propValueTxt);
this._propValueTxt = null;
ObjectUtils.disposeObject(this._risingStarAddedPropValueTxt);
this._risingStarAddedPropValueTxt = null;
ObjectUtils.disposeObject(this._evolutionAddedPropValueTxt);
this._evolutionAddedPropValueTxt = null;
if(parent)
{
parent.removeChild(this);
}
}
}
}
|
/**
* Created with IntelliJ IDEA.
* User: mobitile
* Date: 4/26/13
* Time: 9:59 AM
* To change this template use File | Settings | File Templates.
*/
package skein.binding.operators.conditional
{
import org.flexunit.asserts.assertEquals;
public class ConditionalOperatorTest
{
public function ConditionalOperatorTest()
{
}
[Test]
public function getValue():void
{
assertEquals(1, new ConditionalOperator(true).ifTrue(1).ifFalse(2).getValue());
assertEquals(2, new ConditionalOperator(false).ifTrue(1).ifFalse(2).getValue());
assertEquals("test", new ConditionalOperator(false).ifTrue(null).ifFalse("test").getValue());
}
}
}
|
/*
Copyright 2012 DotComIt, LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Additional Documentation, Samples, and Support may be available at http://www.flextras.com
*/
/**
* @eventType com.flextras.calendar.CalendarDragEvent.DRAG_COMPLETE_DAY
* @copy mx.controls.listClasses.ListBase#event:dragComplete
*/
[Event(name="dayDragComplete", type="com.flextras.calendar.CalendarDragEvent")]
/**
* @eventType com.flextras.calendar.CalendarDragEvent.DRAG_DROP_DAY
* @copy mx.controls.listClasses.ListBase#event:dragDrop
*/
[Event(name="dayDragDrop", type="com.flextras.calendar.CalendarDragEvent")]
/**
* @eventType com.flextras.calendar.CalendarDragEvent.DRAG_ENTER_DAY
* @copy mx.controls.listClasses.ListBase#event:dragEnter
*/
[Event(name="dayDragEnter", type="com.flextras.calendar.CalendarDragEvent")]
/**
* @eventType com.flextras.calendar.CalendarDragEvent.DRAG_EXIT_DAY
* @copy mx.controls.listClasses.ListBase#event:dragExit
*/
[Event(name="dayDragExit", type="com.flextras.calendar.CalendarDragEvent")]
/**
* @eventType com.flextras.calendar.CalendarDragEvent.DRAG_OVER_DAY
* @copy mx.controls.listClasses.ListBase#event:dragOver
*/
[Event(name="dayDragOver", type="com.flextras.calendar.CalendarDragEvent")]
/**
* @eventType com.flextras.calendar.CalendarDragEvent.DRAG_START_DAY
* @copy mx.controls.listClasses.ListBase#event:dragStart
*/
[Event(name="dayDragStart", type="com.flextras.calendar.CalendarDragEvent")]
|
package view.scene.shop
{
import flash.display.*;
import flash.filters.*;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.utils.Dictionary;
import flash.filters.DropShadowFilter;
import flash.geom.*;
import mx.core.UIComponent;
import mx.core.ClassFactory;
import mx.containers.*;
import mx.controls.*;
import mx.collections.ArrayCollection;
import org.libspark.thread.*;
import org.libspark.thread.utils.*;
import org.libspark.thread.threads.between.BeTweenAS3Thread;
import model.*;
import model.events.AvatarItemEvent;
import view.*;
import view.utils.*;
import view.image.common.AvatarItemImage;
import view.image.common.AvatarItemImage;
import view.scene.common.IInventoryClip;
import view.scene.BaseScene;
import view.scene.ModelWaitShowThread;
import controller.LobbyCtrl;
import controller.*;
/**
* ShopInventoryClipの表示クラス
*
*/
public class ShopInventoryClip extends BaseScene implements IInventoryClip
{
// 描画コンテナ
private var _container:UIComponent = new UIComponent();
// アイテムパネル
private var _shopInventoryBaseImage:ShopInventoryBaseImage = new ShopInventoryBaseImage();
// アイテムの個数
private var _priceLabel:Label = new Label();
// アバターアイテム
private var _avatarItem:AvatarItem;
// アバターアイテム
private var _avatarItemImage:AvatarItemImage;
// アイテムの個数
private var _count:int = 0;
// アイテムの個数
private var _price:int = 0;
/**
* コンストラクタ
*
*/
public function ShopInventoryClip(avatarItem:AvatarItem)
{
// アバターアイテムを保存
_avatarItem = avatarItem;
// アイテムを作成
_avatarItemImage = new AvatarItemImage(_avatarItem.image, _avatarItem.imageFrame);
_avatarItemImage.x = 44;
_avatarItemImage.y = 44;
_avatarItemImage.scaleX = 0.5;
_avatarItemImage.scaleY = 0.5;
// カウンターを作成
_priceLabel.x = 7;
_priceLabel.y = 72;
_priceLabel.width = 80;
_priceLabel.height = 30;
_priceLabel.text = _price + "Gems";
_priceLabel.styleName = "ItemListNumericRight";
_shopInventoryBaseImage.offEquip();
_container.addChild(_shopInventoryBaseImage);
}
// 装備する
public function onEquip():void
{
_shopInventoryBaseImage.onEquip();
}
// 装備を外す
public function offEquip():void
{
_shopInventoryBaseImage.offEquip();
}
// 選択する
public function onSelect():void
{
_shopInventoryBaseImage.onSelect();
}
// 装備を外す
public function offSelect():void
{
_shopInventoryBaseImage.offSelect();
}
//
public function get avatarItem():AvatarItem
{
return _avatarItem;
}
//
public function get avatarItemImage():AvatarItemImage
{
return _avatarItemImage;
}
//
public function get price():int
{
return _price;
}
//
public function set price(c:int):void
{
_price = c;
_priceLabel.text = _price + "Gems";
}
//
public function get count():int
{
return _count;
}
//
public function set count(c:int):void
{
_count = c;
}
// 初期化
public override function init():void
{
_avatarItemImage.getShowThread(_container).start();
_container.addChild(_priceLabel);
addChild(_container);
}
// 後処理
public override function final():void
{
if (_avatarItemImage != null)
{
_avatarItemImage.getHideThread().start();
};
if (_itemInventoryBaseImage != null)
{
RemoveChild.apply(DisplayObject(_itemInventoryBaseImage));
};
RemoveChild.apply(_container);
_avatarItemImage = null;
_itemInventoryBaseImage = null;
}
// 表示用スレッドを返す
public override function getShowThread(stage:DisplayObjectContainer, at:int = -1, type:String=""):Thread
{
_depthAt = at;
return new ShowThread(this, stage, at);
}
}
}
import flash.display.Sprite;
import flash.display.DisplayObjectContainer;
import org.libspark.thread.Thread;
import model.BaseModel;
import view.BaseShowThread;
import view.IViewThread;
import view.scene.common.AvatarClip;
class ShowThread extends BaseShowThread
{
public function ShowThread(view:IViewThread, stage:DisplayObjectContainer, at:int)
{
super(view, stage);
}
protected override function run():void
{
next(close);
}
} |
package org.papervision3d.materials.utils
{
import flash.geom.Matrix;
import org.papervision3d.core.geom.renderables.Vertex3DInstance;
public class RenderRecStorage
{
public var v0:Vertex3DInstance;
public var v1:Vertex3DInstance;
public var v2:Vertex3DInstance;
public var mat:Matrix;
public function RenderRecStorage()
{
this.v0 = new Vertex3DInstance();
this.v1 = new Vertex3DInstance();
this.v2 = new Vertex3DInstance();
this.mat = new Matrix();
super();
}
}
}
|
/*
Copyright (c) 2008 Christopher Martin-Sperry (audiofx.org@gmail.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
package org.audiofx.mp3
{
import flash.events.Event;
import flash.media.Sound;
/**
* Event type used by <code>MP3FileReferenceLoader</code>
* @author spender
* @see org.audiofx.mp3.MP3FileReferenceLoader
*/
public class MP3SoundEvent extends Event
{
/**
* A loaded Sound instance. Can call <code>play</code> or <code>extract</code> to get at the audio
*/
public var sound:Sound;
/**
* Used to signal the loading of a sound by the <code>MP3FileReferenceLoader</code> following a call to <code>MP3FileReferenceLoader.getSound</code>
* @eventType complete
* @see org.audiofx.mp3.MP3FileReferenceLoader
*/
public static const COMPLETE:String="complete";
public function MP3SoundEvent(type:String, sound:Sound, bubbles:Boolean=false, cancelable:Boolean=false)
{
super(type, bubbles, cancelable);
this.sound=sound;
}
}
} |
/*
Copyright (c) 2006 - 2008 Eric J. Feminella <eric@ericfeminella.com>
All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
@internal
*/
package com.neopets.util.general
{
/**
*
* Defines the contract for classes which are to provide a specific
* implementation of an <code>IMap</code> entry.
*
* <p>
* An <code>Entry</code> object is essentially a sealed type which
* defines two properties: <code>key</code> and <code>value</code>
* <code>IHashMapEntry</code> provides an interface into an Entry
* object. <code>IHashMapEntry</code> implementations are intended
* to provide a Strongly typed implementation of a key / values
* pair.
* </p>
*
* @see IMap
*
*/
public interface IHashMapEntry
{
/**
*
* Assigns a value to the <code>key</code> property of the
* <code>IHashMapEntry</code> implementation.
*
* @param value to assign to the <code>key</code> property
*
*/
function set key(value:*) : void;
/**
*
* Retrieves the value of the <code>key</code> property of the
* <code>IHashMapEntry</code> implementation.
*
* @return value of the <code>key</code> property
*
*/
function get key() : *;
/**
*
* Assignes a value to the <code>value</code> property of an
* <code>IHashMapEntry</code> implementation.
*
* @param value to assign to the <code>value</code> property
*
*/
function set value(value:*) : void;
/**
*
* Retrieves the value of the <code>value</code> property of an
* <code>IHashMapEntry</code> implementation.
*
* @return value of the <code>value</code> property
*
*/
function get value() : *;
}
}
|
package flare.vis.axis
{
import flare.animate.Transitioner;
import flare.display.RectSprite;
import flare.display.TextSprite;
import flare.vis.Visualization;
import flash.geom.Rectangle;
/**
* Axes class representing 2D Cartesian (X-Y) axes.
*/
public class CartesianAxes extends Axes
{
// -- Properties ------------------------------------------------------
private var _xaxis:Axis;
private var _yaxis:Axis;
private var _xline:AxisGridLine;
private var _yline:AxisGridLine;
private var _border:RectSprite;
private var _xGridClip:RectSprite;
private var _yGridClip:RectSprite;
/** Flag indicating if the x-origin line should be shown. */
public var showXLine:Boolean;
/** Flag indicating if the y-origin line should be shown. */
public var showYLine:Boolean;
/** Determines if the x-axis should be in reverse order. */
public var xReverse:Boolean = false;
/** Determines if the y-axis should be in reverse order. */
public var yReverse:Boolean = false;
/** The x-axis. */
public function get xAxis():Axis { return _xaxis; }
/** The y-axis. */
public function get yAxis():Axis { return _yaxis; }
/** Grid line for the origin along the x-axis. */
public function get xLine():AxisGridLine { return _xline; }
/** Grid line for the origin along the y-axis. */
public function get yLine():AxisGridLine { return _yline; }
/** The x-coordinate of the axes' origin point. */
public function get originX():Number { return _xaxis.originX; }
/** The y-coordinate of the axes' origin point. */
public function get originY():Number { return _yaxis.originY; }
/** Flag indicating if a border for the axes should be shown. */
public function get showBorder():Boolean { return _border.visible; }
public function set showBorder(b:Boolean):void { _border.visible = b; }
/** The axes border color. */
public function get borderColor():uint { return _border.lineColor; }
public function set borderColor(c:uint):void { _border.lineColor = c; }
/** The line width of the axes border. */
public function get borderWidth():Number { return _border.lineWidth; }
public function set borderWidth(w:Number):void { _border.lineWidth = w; }
// -- Methods ---------------------------------------------------------
/**
* Creates new CartesianAxes.
* @param vis the visualization the axes correspond to.
*/
public function CartesianAxes(vis:Visualization=null) {
_vis = vis;
addChild(_xaxis = new Axis());
addChild(_yaxis = new Axis());
addChild(_xline = new AxisGridLine());
addChild(_yline = new AxisGridLine());
addChild(_border = new RectSprite());
addChild(_xGridClip = new RectSprite());
addChild(_yGridClip = new RectSprite());
// set names
_xaxis.name = "_xaxis";
_yaxis.name = "_yaxis";
_xline.name = "_xline";
_yline.name = "_yline";
_border.name = "_border";
// set label anchors
_xaxis.horizontalAnchor = TextSprite.CENTER;
_xaxis.verticalAnchor = TextSprite.TOP;
_yaxis.horizontalAnchor = TextSprite.RIGHT;
_yaxis.verticalAnchor = TextSprite.MIDDLE;
// set default label offsets
_xaxis.labelOffsetX = 0; _xaxis.labelOffsetY = 8;
_yaxis.labelOffsetX = -8; _yaxis.labelOffsetY = 0;
// set default gridline caps
_xaxis.lineCapX1 = _xaxis.lineCapX2 = 0;
_xaxis.lineCapY1 = _xaxis.lineCapY2 = 0;
_yaxis.lineCapX1 = _yaxis.lineCapX2 = 0;
_yaxis.lineCapY1 = _yaxis.lineCapY2 = 0;
// set default gridline colors
_xaxis.lineColor = 0xd8d8d8;
_yaxis.lineColor = 0xd8d8d8;
// set default line settings
_xline.lineColor = 0xcccccc;
_yline.lineColor = 0xcccccc;
// set up border
_border.lineColor = 0xffd8d8d8;
_border.fillColor = 0x00ffffff;
// set up clipping masks
_xGridClip.lineColor = 0;
_xGridClip.fillColor = 0xffffffff;
_yGridClip.lineColor = 0;
_yGridClip.fillColor = 0xffffffff;
}
/** @inheritDoc */
public override function update(trans:Transitioner=null):Transitioner
{
var t:Transitioner = (trans!=null ? trans : Transitioner.DEFAULT);
var o:Object;
var b:Rectangle = layoutBounds;
// set x-axis position
if (xReverse) {
_xaxis.x1 = b.right; _xaxis.y1 = b.bottom;
_xaxis.x2 = b.left; _xaxis.y2 = b.bottom;
} else {
_xaxis.x1 = b.left; _xaxis.y1 = b.bottom;
_xaxis.x2 = b.right; _xaxis.y2 = b.bottom;
}
// set y-axis position
if (yReverse) {
_yaxis.x1 = b.left; _yaxis.y1 = b.top;
_yaxis.x2 = b.left; _yaxis.y2 = b.bottom;
} else {
_yaxis.x1 = b.left; _yaxis.y1 = b.bottom;
_yaxis.x2 = b.left; _yaxis.y2 = b.top;
}
// gridline length
_xaxis.lineLengthX = 0;
_xaxis.lineLengthY = -b.height;
_yaxis.lineLengthX = b.width;
_yaxis.lineLengthY = 0;
// update axes
_xaxis.update(t);
_yaxis.update(t);
// update x-axis origin line
var yx:Number = _yaxis.offsetX(0);
var yy:Number = _yaxis.offsetY(0);
var ys:Boolean = showXLine && yx >= 0 && yx <= b.width;
o = t.$(_xline);
o.x1 = _xaxis.x1 + yx;
o.y1 = _xaxis.y1 + yy;
o.x2 = _xaxis.x2 + yx;
o.y2 = _xaxis.y2 + yy;
o.alpha = ys ? 1 : 0;
// update y-axis origin line
var xx:Number = _xaxis.offsetX(0);
var xy:Number = _xaxis.offsetY(0);
var xs:Boolean = showYLine && xy >= 0 && xy <= b.height;
o = t.$(_yline);
o.x1 = _yaxis.x1 + xx;
o.y1 = _yaxis.y1 + xy;
o.x2 = _yaxis.x2 + xx;
o.y2 = _yaxis.y2 + xy;
o.alpha = xs ? 1 : 0;
// update axis border
o = t.$(_border);
o.x = b.x;
o.y = b.y;
o.w = b.width;
o.h = b.height;
// set the gridline clipping regions
o = t.$(_xGridClip);
o.x = b.x;
o.y = b.y - _xaxis.lineCapY2;
o.w = b.width + 1;
o.h = b.height + _xaxis.lineCapY1 + _xaxis.lineCapY2;
_xaxis.gridLines.mask = _xGridClip;
o = t.$(_yGridClip);
o.x = b.x - _yaxis.lineCapX1;
o.y = b.y;
o.w = b.width + _yaxis.lineCapX1 + _yaxis.lineCapX2;
o.h = b.height + 1;
_yaxis.gridLines.mask = _yGridClip;
return trans;
}
} // end of class CartesianAxes
} |
package com.ankamagames.dofus.network.messages.game.guild
{
import com.ankamagames.dofus.network.messages.game.social.SocialNoticeSetRequestMessage;
import com.ankamagames.jerakine.network.CustomDataWrapper;
import com.ankamagames.jerakine.network.ICustomDataInput;
import com.ankamagames.jerakine.network.ICustomDataOutput;
import com.ankamagames.jerakine.network.INetworkMessage;
import com.ankamagames.jerakine.network.utils.FuncTree;
import flash.utils.ByteArray;
public class GuildBulletinSetRequestMessage extends SocialNoticeSetRequestMessage implements INetworkMessage
{
public static const protocolId:uint = 7121;
private var _isInitialized:Boolean = false;
[Transient]
public var content:String = "";
public var notifyMembers:Boolean = false;
public function GuildBulletinSetRequestMessage()
{
super();
}
override public function get isInitialized() : Boolean
{
return super.isInitialized && this._isInitialized;
}
override public function getMessageId() : uint
{
return 7121;
}
public function initGuildBulletinSetRequestMessage(content:String = "", notifyMembers:Boolean = false) : GuildBulletinSetRequestMessage
{
this.content = content;
this.notifyMembers = notifyMembers;
this._isInitialized = true;
return this;
}
override public function reset() : void
{
this.content = "";
this.notifyMembers = false;
this._isInitialized = false;
}
override public function pack(output:ICustomDataOutput) : void
{
var data:ByteArray = new ByteArray();
this.serialize(new CustomDataWrapper(data));
writePacket(output,this.getMessageId(),data);
}
override public function unpack(input:ICustomDataInput, length:uint) : void
{
this.deserialize(input);
}
override public function unpackAsync(input:ICustomDataInput, length:uint) : FuncTree
{
var tree:FuncTree = new FuncTree();
tree.setRoot(input);
this.deserializeAsync(tree);
return tree;
}
override public function serialize(output:ICustomDataOutput) : void
{
this.serializeAs_GuildBulletinSetRequestMessage(output);
}
public function serializeAs_GuildBulletinSetRequestMessage(output:ICustomDataOutput) : void
{
super.serializeAs_SocialNoticeSetRequestMessage(output);
output.writeUTF(this.content);
output.writeBoolean(this.notifyMembers);
}
override public function deserialize(input:ICustomDataInput) : void
{
this.deserializeAs_GuildBulletinSetRequestMessage(input);
}
public function deserializeAs_GuildBulletinSetRequestMessage(input:ICustomDataInput) : void
{
super.deserialize(input);
this._contentFunc(input);
this._notifyMembersFunc(input);
}
override public function deserializeAsync(tree:FuncTree) : void
{
this.deserializeAsyncAs_GuildBulletinSetRequestMessage(tree);
}
public function deserializeAsyncAs_GuildBulletinSetRequestMessage(tree:FuncTree) : void
{
super.deserializeAsync(tree);
tree.addChild(this._contentFunc);
tree.addChild(this._notifyMembersFunc);
}
private function _contentFunc(input:ICustomDataInput) : void
{
this.content = input.readUTF();
}
private function _notifyMembersFunc(input:ICustomDataInput) : void
{
this.notifyMembers = input.readBoolean();
}
}
}
|
/*
Copyright (c) 2012 Josh Tynjala
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
*/
package feathers.themes
{
import feathers.controls.Alert;
import feathers.controls.Button;
import feathers.controls.ButtonGroup;
import feathers.controls.Callout;
import feathers.controls.Check;
import feathers.controls.Drawers;
import feathers.controls.GroupedList;
import feathers.controls.Header;
import feathers.controls.IScrollBar;
import feathers.controls.ImageLoader;
import feathers.controls.Label;
import feathers.controls.List;
import feathers.controls.NumericStepper;
import feathers.controls.PageIndicator;
import feathers.controls.Panel;
import feathers.controls.PanelScreen;
import feathers.controls.PickerList;
import feathers.controls.ProgressBar;
import feathers.controls.Radio;
import feathers.controls.Screen;
import feathers.controls.ScrollBar;
import feathers.controls.ScrollContainer;
import feathers.controls.ScrollScreen;
import feathers.controls.ScrollText;
import feathers.controls.Scroller;
import feathers.controls.SimpleScrollBar;
import feathers.controls.Slider;
import feathers.controls.TabBar;
import feathers.controls.TextArea;
import feathers.controls.TextInput;
import feathers.controls.ToggleSwitch;
import feathers.controls.popups.DropDownPopUpContentManager;
import feathers.controls.renderers.BaseDefaultItemRenderer;
import feathers.controls.renderers.DefaultGroupedListHeaderOrFooterRenderer;
import feathers.controls.renderers.DefaultGroupedListItemRenderer;
import feathers.controls.renderers.DefaultListItemRenderer;
import feathers.controls.text.TextFieldTextEditor;
import feathers.controls.text.TextFieldTextRenderer;
import feathers.core.DisplayListWatcher;
import feathers.core.FeathersControl;
import feathers.core.FocusManager;
import feathers.core.IFeathersControl;
import feathers.core.ITextEditor;
import feathers.core.ITextRenderer;
import feathers.core.PopUpManager;
import feathers.display.Scale3Image;
import feathers.display.Scale9Image;
import feathers.layout.HorizontalLayout;
import feathers.skins.SmartDisplayObjectStateValueSelector;
import feathers.skins.StandardIcons;
import feathers.system.DeviceCapabilities;
import feathers.textures.Scale3Textures;
import feathers.textures.Scale9Textures;
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.errors.IllegalOperationError;
import flash.geom.Rectangle;
import flash.text.TextFormat;
import flash.text.TextFormatAlign;
import flash.utils.getQualifiedClassName;
import starling.core.Starling;
import starling.display.DisplayObject;
import starling.display.DisplayObjectContainer;
import starling.display.Image;
import starling.display.Quad;
import starling.events.Event;
import starling.textures.Texture;
import starling.textures.TextureAtlas;
import starling.utils.AssetManager;
[Event(name="complete",type="starling.events.Event")]
/**
* The "Aeon" theme for desktop Feathers apps.
*
* <p>This version of the theme requires loading assets at runtime. To use
* embedded assets, see <code>AeonDesktopTheme</code> instead.</p>
*
* <p>To use this theme, the following files must be included when packaging
* your app:</p>
* <ul>
* <li>images/aeon.png</li>
* <li>images/aeon.xml</li>
* </ul>
*
* @see http://wiki.starling-framework.org/feathers/theme-assets
*/
public class AeonDesktopThemeWithAssetManager extends DisplayListWatcher
{
protected static const THEME_NAME_HORIZONTAL_SCROLL_BAR_INCREMENT_BUTTON:String = "aeon-horizontal-scroll-bar-increment-button";
protected static const THEME_NAME_HORIZONTAL_SCROLL_BAR_DECREMENT_BUTTON:String = "aeon-horizontal-scroll-bar-decrement-button";
protected static const THEME_NAME_HORIZONTAL_SCROLL_BAR_THUMB:String = "aeon-horizontal-scroll-bar-thumb";
protected static const THEME_NAME_HORIZONTAL_SCROLL_BAR_MINIMUM_TRACK:String = "aeon-horizontal-scroll-bar-minimum-track";
protected static const THEME_NAME_VERTICAL_SCROLL_BAR_INCREMENT_BUTTON:String = "aeon-vertical-scroll-bar-increment-button";
protected static const THEME_NAME_VERTICAL_SCROLL_BAR_DECREMENT_BUTTON:String = "aeon-vertical-scroll-bar-decrement-button";
protected static const THEME_NAME_VERTICAL_SCROLL_BAR_THUMB:String = "aeon-vertical-scroll-bar-thumb";
protected static const THEME_NAME_VERTICAL_SCROLL_BAR_MINIMUM_TRACK:String = "aeon-vertical-scroll-bar-minimum-track";
protected static const THEME_NAME_HORIZONTAL_SIMPLE_SCROLL_BAR_THUMB:String = "aeon-horizontal-simple-scroll-bar-thumb";
protected static const THEME_NAME_VERTICAL_SIMPLE_SCROLL_BAR_THUMB:String = "aeon-vertical-simple-scroll-bar-thumb";
protected static const THEME_NAME_HORIZONTAL_SLIDER_THUMB:String = "aeon-horizontal-slider-thumb";
protected static const THEME_NAME_HORIZONTAL_SLIDER_MINIMUM_TRACK:String = "aeon-horizontal-slider-minimum-track";
protected static const THEME_NAME_VERTICAL_SLIDER_THUMB:String = "aeon-vertical-slider-thumb";
protected static const THEME_NAME_VERTICAL_SLIDER_MINIMUM_TRACK:String = "aeon-vertical-slider-minimum-track";
protected static const ATLAS_NAME:String = "aeon";
protected static const FONT_NAME:String = "_sans";
protected static const FOCUS_INDICATOR_SCALE_9_GRID:Rectangle = new Rectangle(5, 4, 1, 14);
protected static const BUTTON_SCALE_9_GRID:Rectangle = new Rectangle(6, 6, 70, 10);
protected static const SELECTED_BUTTON_SCALE_9_GRID:Rectangle = new Rectangle(6, 6, 52, 10);
protected static const TAB_SCALE_9_GRID:Rectangle = new Rectangle(4, 4, 55, 16);
protected static const STEPPER_INCREMENT_BUTTON_SCALE_9_GRID:Rectangle = new Rectangle(1, 9, 15, 1);
protected static const STEPPER_DECREMENT_BUTTON_SCALE_9_GRID:Rectangle = new Rectangle(1, 1, 15, 1);
protected static const HSLIDER_FIRST_REGION:Number = 2;
protected static const HSLIDER_SECOND_REGION:Number = 75;
protected static const TEXT_INPUT_SCALE_9_GRID:Rectangle = new Rectangle(2, 2, 148, 18);
protected static const VERTICAL_SCROLL_BAR_THUMB_SCALE_9_GRID:Rectangle = new Rectangle(2, 5, 6, 42);
protected static const VERTICAL_SCROLL_BAR_TRACK_SCALE_9_GRID:Rectangle = new Rectangle(2, 1, 11, 2);
protected static const VERTICAL_SCROLL_BAR_STEP_BUTTON_SCALE_9_GRID:Rectangle = new Rectangle(2, 2, 11, 10);
protected static const HORIZONTAL_SCROLL_BAR_THUMB_SCALE_9_GRID:Rectangle = new Rectangle(5, 2, 42, 6);
protected static const HORIZONTAL_SCROLL_BAR_TRACK_SCALE_9_GRID:Rectangle = new Rectangle(1, 2, 2, 11);
protected static const HORIZONTAL_SCROLL_BAR_STEP_BUTTON_SCALE_9_GRID:Rectangle = new Rectangle(2, 2, 10, 11);
protected static const SIMPLE_BORDER_SCALE_9_GRID:Rectangle = new Rectangle(2, 2, 2, 2);
protected static const PANEL_BORDER_SCALE_9_GRID:Rectangle = new Rectangle(6, 6, 2, 2);
protected static const HEADER_SCALE_9_GRID:Rectangle = new Rectangle(0, 0, 4, 28);
protected static const BACKGROUND_COLOR:uint = 0x869CA7;
protected static const MODAL_OVERLAY_COLOR:uint = 0xDDDDDD;
protected static const PRIMARY_TEXT_COLOR:uint = 0x0B333C;
protected static const DISABLED_TEXT_COLOR:uint = 0x5B6770;
protected static const MODAL_OVERLAY_ALPHA:Number = 0.5;
protected static function textRendererFactory():ITextRenderer
{
return new TextFieldTextRenderer();
}
protected static function textEditorFactory():ITextEditor
{
return new TextFieldTextEditor();
}
protected static function scrollBarFactory():IScrollBar
{
return new ScrollBar();
}
protected static function popUpOverlayFactory():DisplayObject
{
const quad:Quad = new Quad(100, 100, MODAL_OVERLAY_COLOR);
quad.alpha = MODAL_OVERLAY_ALPHA;
return quad;
}
public function AeonDesktopThemeWithAssetManager(assets:Object = null, assetManager:AssetManager = null, container:DisplayObjectContainer = null)
{
if(!container)
{
container = Starling.current.stage;
}
super(container);
this.processSource(assets, assetManager);
}
public function get originalDPI():int
{
return DeviceCapabilities.dpi;
}
public function get scaleToDPI():Boolean
{
return false;
}
/**
* A subclass may embed the theme's assets and override this setter to
* return the class that creates the bitmap used for the texture atlas.
*/
protected function get atlasImageClass():Class
{
return null;
}
/**
* A subclass may embed the theme's assets and override this setter to
* return the class that creates the XML used for the texture atlas.
*/
protected function get atlasXMLClass():Class
{
return null;
}
protected var assetManager:AssetManager;
protected var atlas:TextureAtlas;
protected var atlasTexture:Texture;
protected var defaultTextFormat:TextFormat;
protected var disabledTextFormat:TextFormat;
protected var headingTextFormat:TextFormat;
protected var headingDisabledTextFormat:TextFormat;
protected var detailTextFormat:TextFormat;
protected var detailDisabledTextFormat:TextFormat;
protected var headerTitleTextFormat:TextFormat;
protected var focusIndicatorSkinTextures:Scale9Textures;
protected var buttonUpSkinTextures:Scale9Textures;
protected var buttonHoverSkinTextures:Scale9Textures;
protected var buttonDownSkinTextures:Scale9Textures;
protected var buttonDisabledSkinTextures:Scale9Textures;
protected var buttonSelectedUpSkinTextures:Scale9Textures;
protected var buttonSelectedHoverSkinTextures:Scale9Textures;
protected var buttonSelectedDownSkinTextures:Scale9Textures;
protected var buttonSelectedDisabledSkinTextures:Scale9Textures;
protected var tabUpSkinTextures:Scale9Textures;
protected var tabHoverSkinTextures:Scale9Textures;
protected var tabDownSkinTextures:Scale9Textures;
protected var tabDisabledSkinTextures:Scale9Textures;
protected var tabSelectedUpSkinTextures:Scale9Textures;
protected var tabSelectedDisabledSkinTextures:Scale9Textures;
protected var stepperIncrementButtonUpSkinTextures:Scale9Textures;
protected var stepperIncrementButtonHoverSkinTextures:Scale9Textures;
protected var stepperIncrementButtonDownSkinTextures:Scale9Textures;
protected var stepperIncrementButtonDisabledSkinTextures:Scale9Textures;
protected var stepperDecrementButtonUpSkinTextures:Scale9Textures;
protected var stepperDecrementButtonHoverSkinTextures:Scale9Textures;
protected var stepperDecrementButtonDownSkinTextures:Scale9Textures;
protected var stepperDecrementButtonDisabledSkinTextures:Scale9Textures;
protected var hSliderThumbUpSkinTexture:Texture;
protected var hSliderThumbHoverSkinTexture:Texture;
protected var hSliderThumbDownSkinTexture:Texture;
protected var hSliderThumbDisabledSkinTexture:Texture;
protected var hSliderTrackSkinTextures:Scale3Textures;
protected var vSliderThumbUpSkinTexture:Texture;
protected var vSliderThumbHoverSkinTexture:Texture;
protected var vSliderThumbDownSkinTexture:Texture;
protected var vSliderThumbDisabledSkinTexture:Texture;
protected var vSliderTrackSkinTextures:Scale3Textures;
protected var itemRendererUpSkinTexture:Texture;
protected var itemRendererHoverSkinTexture:Texture;
protected var itemRendererSelectedUpSkinTexture:Texture;
protected var headerBackgroundSkinTextures:Scale9Textures;
protected var groupedListHeaderBackgroundSkinTextures:Scale9Textures;
protected var checkUpIconTexture:Texture;
protected var checkHoverIconTexture:Texture;
protected var checkDownIconTexture:Texture;
protected var checkDisabledIconTexture:Texture;
protected var checkSelectedUpIconTexture:Texture;
protected var checkSelectedHoverIconTexture:Texture;
protected var checkSelectedDownIconTexture:Texture;
protected var checkSelectedDisabledIconTexture:Texture;
protected var radioUpIconTexture:Texture;
protected var radioHoverIconTexture:Texture;
protected var radioDownIconTexture:Texture;
protected var radioDisabledIconTexture:Texture;
protected var radioSelectedUpIconTexture:Texture;
protected var radioSelectedHoverIconTexture:Texture;
protected var radioSelectedDownIconTexture:Texture;
protected var radioSelectedDisabledIconTexture:Texture;
protected var pageIndicatorNormalSkinTexture:Texture;
protected var pageIndicatorSelectedSkinTexture:Texture;
protected var pickerListUpIconTexture:Texture;
protected var pickerListHoverIconTexture:Texture;
protected var pickerListDownIconTexture:Texture;
protected var pickerListDisabledIconTexture:Texture;
protected var textInputBackgroundSkinTextures:Scale9Textures;
protected var textInputBackgroundDisabledSkinTextures:Scale9Textures;
protected var textInputSearchIconTexture:Texture;
protected var vScrollBarThumbUpSkinTextures:Scale9Textures;
protected var vScrollBarThumbHoverSkinTextures:Scale9Textures;
protected var vScrollBarThumbDownSkinTextures:Scale9Textures;
protected var vScrollBarTrackSkinTextures:Scale9Textures;
protected var vScrollBarThumbIconTexture:Texture;
protected var vScrollBarStepButtonUpSkinTextures:Scale9Textures;
protected var vScrollBarStepButtonHoverSkinTextures:Scale9Textures;
protected var vScrollBarStepButtonDownSkinTextures:Scale9Textures;
protected var vScrollBarStepButtonDisabledSkinTextures:Scale9Textures;
protected var vScrollBarDecrementButtonIconTexture:Texture;
protected var vScrollBarIncrementButtonIconTexture:Texture;
protected var hScrollBarThumbUpSkinTextures:Scale9Textures;
protected var hScrollBarThumbHoverSkinTextures:Scale9Textures;
protected var hScrollBarThumbDownSkinTextures:Scale9Textures;
protected var hScrollBarTrackSkinTextures:Scale9Textures;
protected var hScrollBarThumbIconTexture:Texture;
protected var hScrollBarStepButtonUpSkinTextures:Scale9Textures;
protected var hScrollBarStepButtonHoverSkinTextures:Scale9Textures;
protected var hScrollBarStepButtonDownSkinTextures:Scale9Textures;
protected var hScrollBarStepButtonDisabledSkinTextures:Scale9Textures;
protected var hScrollBarDecrementButtonIconTexture:Texture;
protected var hScrollBarIncrementButtonIconTexture:Texture;
protected var simpleBorderBackgroundSkinTextures:Scale9Textures;
protected var panelBorderBackgroundSkinTextures:Scale9Textures;
protected var progressBarFillSkinTexture:Texture;
override public function dispose():void
{
if(this.root)
{
this.root.removeEventListener(Event.ADDED_TO_STAGE, root_addedToStageHandler);
}
if(this.atlas)
{
this.atlas.dispose();
this.atlas = null;
//no need to dispose the atlas texture because the atlas will do that
this.atlasTexture = null;
}
if(this.assetManager)
{
this.assetManager.removeTextureAtlas(ATLAS_NAME);
}
super.dispose();
}
protected function initializeRoot():void
{
if(this.root != this.root.stage)
{
return;
}
this.root.stage.color = BACKGROUND_COLOR;
Starling.current.nativeStage.color = BACKGROUND_COLOR;
}
protected function atlasTexture_onRestore():void
{
var AtlasImageClass:Class = this.atlasImageClass;
var atlasBitmapData:BitmapData = Bitmap(new AtlasImageClass()).bitmapData;
this.atlasTexture.root.uploadBitmapData(atlasBitmapData);
atlasBitmapData.dispose();
}
protected function assetManager_onProgress(progress:Number):void
{
if(progress < 1)
{
return;
}
this.initialize();
this.dispatchEventWith(Event.COMPLETE);
}
protected function processSource(assets:Object, assetManager:AssetManager):void
{
if(assets)
{
this.assetManager = assetManager;
if(!this.assetManager)
{
this.assetManager = new AssetManager(Starling.contentScaleFactor);
}
//add a trailing slash, if needed
if(assets is String)
{
var assetsDirectoryName:String = assets as String;
if(assetsDirectoryName.lastIndexOf("/") != assetsDirectoryName.length - 1)
{
assets = assetsDirectoryName + "/";
}
this.assetManager.enqueue(assets + "images/aeon.xml");
this.assetManager.enqueue(assets + "images/aeon.png");
}
else if(getQualifiedClassName(assets) == "flash.filesystem::File" && assets["isDirectory"])
{
this.assetManager.enqueue(assets["resolvePath"]("images/aeon.xml"));
this.assetManager.enqueue(assets["resolvePath"]("images/aeon.png"));
}
else
{
this.assetManager.enqueue(assets);
}
this.assetManager.loadQueue(assetManager_onProgress);
}
else
{
var AtlasImageClass:Class = this.atlasImageClass;
var AtlasXMLType:Class = this.atlasXMLClass;
if(AtlasImageClass && AtlasXMLType)
{
var atlasBitmapData:BitmapData = Bitmap(new AtlasImageClass()).bitmapData;
this.atlasTexture = Texture.fromBitmapData(atlasBitmapData, false);
this.atlasTexture.root.onRestore = this.atlasTexture_onRestore;
atlasBitmapData.dispose();
this.atlas = new TextureAtlas(atlasTexture, XML(new AtlasXMLType()));
this.initialize();
this.dispatchEventWith(Event.COMPLETE);
}
else
{
throw new Error("Asset path or embedded assets not found. Theme not loaded.")
}
}
}
protected function initialize():void
{
if(!this.atlas)
{
if(this.assetManager)
{
this.atlas = this.assetManager.getTextureAtlas(ATLAS_NAME);
}
else
{
throw new IllegalOperationError("Atlas not loaded.");
}
}
this.initializeFonts();
this.initializeTextures();
this.initializeGlobals();
if(this.root.stage)
{
this.initializeRoot();
}
else
{
this.root.addEventListener(Event.ADDED_TO_STAGE, root_addedToStageHandler);
}
this.setInitializers();
}
protected function initializeGlobals():void
{
FocusManager.isEnabled = true;
FeathersControl.defaultTextRendererFactory = textRendererFactory;
FeathersControl.defaultTextEditorFactory = textEditorFactory;
PopUpManager.overlayFactory = popUpOverlayFactory;
Callout.stagePaddingTop = Callout.stagePaddingRight = Callout.stagePaddingBottom =
Callout.stagePaddingLeft = 16;
}
protected function initializeFonts():void
{
this.defaultTextFormat = new TextFormat(FONT_NAME, 11, PRIMARY_TEXT_COLOR, false, false, false, null, null, TextFormatAlign.LEFT, 0, 0, 0, 0);
this.disabledTextFormat = new TextFormat(FONT_NAME, 11, DISABLED_TEXT_COLOR, false, false, false, null, null, TextFormatAlign.LEFT, 0, 0, 0, 0);
this.headerTitleTextFormat = new TextFormat(FONT_NAME, 12, PRIMARY_TEXT_COLOR, false, false, false, null, null, TextFormatAlign.LEFT, 0, 0, 0, 0);
this.headingTextFormat = new TextFormat(FONT_NAME, 14, PRIMARY_TEXT_COLOR, false, false, false, null, null, TextFormatAlign.LEFT, 0, 0, 0, 0);
this.headingDisabledTextFormat = new TextFormat(FONT_NAME, 14, DISABLED_TEXT_COLOR, false, false, false, null, null, TextFormatAlign.LEFT, 0, 0, 0, 0);
this.detailTextFormat = new TextFormat(FONT_NAME, 10, PRIMARY_TEXT_COLOR, false, false, false, null, null, TextFormatAlign.LEFT, 0, 0, 0, 0);
this.detailDisabledTextFormat = new TextFormat(FONT_NAME, 10, DISABLED_TEXT_COLOR, false, false, false, null, null, TextFormatAlign.LEFT, 0, 0, 0, 0);
}
protected function initializeTextures():void
{
this.focusIndicatorSkinTextures = new Scale9Textures(this.atlas.getTexture("focus-indicator-skin"), FOCUS_INDICATOR_SCALE_9_GRID);
this.buttonUpSkinTextures = new Scale9Textures(this.atlas.getTexture("button-up-skin"), BUTTON_SCALE_9_GRID);
this.buttonHoverSkinTextures = new Scale9Textures(this.atlas.getTexture("button-hover-skin"), BUTTON_SCALE_9_GRID);
this.buttonDownSkinTextures = new Scale9Textures(this.atlas.getTexture("button-down-skin"), BUTTON_SCALE_9_GRID);
this.buttonDisabledSkinTextures = new Scale9Textures(this.atlas.getTexture("button-disabled-skin"), BUTTON_SCALE_9_GRID);
this.buttonSelectedUpSkinTextures = new Scale9Textures(this.atlas.getTexture("button-selected-up-skin"), SELECTED_BUTTON_SCALE_9_GRID);
this.buttonSelectedHoverSkinTextures = new Scale9Textures(this.atlas.getTexture("button-selected-hover-skin"), SELECTED_BUTTON_SCALE_9_GRID);
this.buttonSelectedDownSkinTextures = new Scale9Textures(this.atlas.getTexture("button-selected-down-skin"), SELECTED_BUTTON_SCALE_9_GRID);
this.buttonSelectedDisabledSkinTextures = new Scale9Textures(this.atlas.getTexture("button-selected-disabled-skin"), SELECTED_BUTTON_SCALE_9_GRID);
this.tabUpSkinTextures = new Scale9Textures(this.atlas.getTexture("tab-up-skin"), TAB_SCALE_9_GRID);
this.tabHoverSkinTextures = new Scale9Textures(this.atlas.getTexture("tab-hover-skin"), TAB_SCALE_9_GRID);
this.tabDownSkinTextures = new Scale9Textures(this.atlas.getTexture("tab-down-skin"), TAB_SCALE_9_GRID);
this.tabDisabledSkinTextures = new Scale9Textures(this.atlas.getTexture("tab-disabled-skin"), TAB_SCALE_9_GRID);
this.tabSelectedUpSkinTextures = new Scale9Textures(this.atlas.getTexture("tab-selected-up-skin"), TAB_SCALE_9_GRID);
this.tabSelectedDisabledSkinTextures = new Scale9Textures(this.atlas.getTexture("tab-selected-disabled-skin"), TAB_SCALE_9_GRID);
this.stepperIncrementButtonUpSkinTextures = new Scale9Textures(this.atlas.getTexture("numeric-stepper-increment-button-up-skin"), STEPPER_INCREMENT_BUTTON_SCALE_9_GRID);
this.stepperIncrementButtonHoverSkinTextures = new Scale9Textures(this.atlas.getTexture("numeric-stepper-increment-button-hover-skin"), STEPPER_INCREMENT_BUTTON_SCALE_9_GRID);
this.stepperIncrementButtonDownSkinTextures = new Scale9Textures(this.atlas.getTexture("numeric-stepper-increment-button-down-skin"), STEPPER_INCREMENT_BUTTON_SCALE_9_GRID);
this.stepperIncrementButtonDisabledSkinTextures = new Scale9Textures(this.atlas.getTexture("numeric-stepper-increment-button-disabled-skin"), STEPPER_INCREMENT_BUTTON_SCALE_9_GRID);
this.stepperDecrementButtonUpSkinTextures = new Scale9Textures(this.atlas.getTexture("numeric-stepper-decrement-button-up-skin"), STEPPER_DECREMENT_BUTTON_SCALE_9_GRID);
this.stepperDecrementButtonHoverSkinTextures = new Scale9Textures(this.atlas.getTexture("numeric-stepper-decrement-button-hover-skin"), STEPPER_DECREMENT_BUTTON_SCALE_9_GRID);
this.stepperDecrementButtonDownSkinTextures = new Scale9Textures(this.atlas.getTexture("numeric-stepper-decrement-button-down-skin"), STEPPER_DECREMENT_BUTTON_SCALE_9_GRID);
this.stepperDecrementButtonDisabledSkinTextures = new Scale9Textures(this.atlas.getTexture("numeric-stepper-decrement-button-disabled-skin"), STEPPER_DECREMENT_BUTTON_SCALE_9_GRID);
this.hSliderThumbUpSkinTexture = this.atlas.getTexture("hslider-thumb-up-skin");
this.hSliderThumbHoverSkinTexture = this.atlas.getTexture("hslider-thumb-hover-skin");
this.hSliderThumbDownSkinTexture = this.atlas.getTexture("hslider-thumb-down-skin");
this.hSliderThumbDisabledSkinTexture = this.atlas.getTexture("hslider-thumb-disabled-skin");
this.hSliderTrackSkinTextures = new Scale3Textures(this.atlas.getTexture("hslider-track-skin"), HSLIDER_FIRST_REGION, HSLIDER_SECOND_REGION, Scale3Textures.DIRECTION_HORIZONTAL);
this.vSliderThumbUpSkinTexture = this.atlas.getTexture("vslider-thumb-up-skin");
this.vSliderThumbHoverSkinTexture = this.atlas.getTexture("vslider-thumb-hover-skin");
this.vSliderThumbDownSkinTexture = this.atlas.getTexture("vslider-thumb-down-skin");
this.vSliderThumbDisabledSkinTexture = this.atlas.getTexture("vslider-thumb-disabled-skin");
this.vSliderTrackSkinTextures = new Scale3Textures(this.atlas.getTexture("vslider-track-skin"), HSLIDER_FIRST_REGION, HSLIDER_SECOND_REGION, Scale3Textures.DIRECTION_VERTICAL);
this.itemRendererUpSkinTexture = this.atlas.getTexture("item-renderer-up-skin");
this.itemRendererHoverSkinTexture = this.atlas.getTexture("item-renderer-hover-skin");
this.itemRendererSelectedUpSkinTexture = this.atlas.getTexture("item-renderer-selected-up-skin");
this.headerBackgroundSkinTextures = new Scale9Textures(this.atlas.getTexture("header-background-skin"), HEADER_SCALE_9_GRID);
this.groupedListHeaderBackgroundSkinTextures = new Scale9Textures(this.atlas.getTexture("grouped-list-header-background-skin"), HEADER_SCALE_9_GRID);
this.checkUpIconTexture = this.atlas.getTexture("check-up-icon");
this.checkHoverIconTexture = this.atlas.getTexture("check-hover-icon");
this.checkDownIconTexture = this.atlas.getTexture("check-down-icon");
this.checkDisabledIconTexture = this.atlas.getTexture("check-disabled-icon");
this.checkSelectedUpIconTexture = this.atlas.getTexture("check-selected-up-icon");
this.checkSelectedHoverIconTexture = this.atlas.getTexture("check-selected-hover-icon");
this.checkSelectedDownIconTexture = this.atlas.getTexture("check-selected-down-icon");
this.checkSelectedDisabledIconTexture = this.atlas.getTexture("check-selected-disabled-icon");
this.radioUpIconTexture = this.atlas.getTexture("radio-up-icon");
this.radioHoverIconTexture = this.atlas.getTexture("radio-hover-icon");
this.radioDownIconTexture = this.atlas.getTexture("radio-down-icon");
this.radioDisabledIconTexture = this.atlas.getTexture("radio-disabled-icon");
this.radioSelectedUpIconTexture = this.atlas.getTexture("radio-selected-up-icon");
this.radioSelectedHoverIconTexture = this.atlas.getTexture("radio-selected-hover-icon");
this.radioSelectedDownIconTexture = this.atlas.getTexture("radio-selected-down-icon");
this.radioSelectedDisabledIconTexture = this.atlas.getTexture("radio-selected-disabled-icon");
this.pageIndicatorNormalSkinTexture = this.atlas.getTexture("page-indicator-normal-skin");
this.pageIndicatorSelectedSkinTexture = this.atlas.getTexture("page-indicator-selected-skin");
this.pickerListUpIconTexture = this.atlas.getTexture("picker-list-up-icon");
this.pickerListHoverIconTexture = this.atlas.getTexture("picker-list-hover-icon");
this.pickerListDownIconTexture = this.atlas.getTexture("picker-list-down-icon");
this.pickerListDisabledIconTexture = this.atlas.getTexture("picker-list-disabled-icon");
this.textInputBackgroundSkinTextures = new Scale9Textures(this.atlas.getTexture("text-input-background-skin"), TEXT_INPUT_SCALE_9_GRID);
this.textInputBackgroundDisabledSkinTextures = new Scale9Textures(this.atlas.getTexture("text-input-background-disabled-skin"), TEXT_INPUT_SCALE_9_GRID);
this.textInputSearchIconTexture = this.atlas.getTexture("search-icon");
this.vScrollBarThumbUpSkinTextures = new Scale9Textures(this.atlas.getTexture("vertical-scroll-bar-thumb-up-skin"), VERTICAL_SCROLL_BAR_THUMB_SCALE_9_GRID);
this.vScrollBarThumbHoverSkinTextures = new Scale9Textures(this.atlas.getTexture("vertical-scroll-bar-thumb-hover-skin"), VERTICAL_SCROLL_BAR_THUMB_SCALE_9_GRID);
this.vScrollBarThumbDownSkinTextures = new Scale9Textures(this.atlas.getTexture("vertical-scroll-bar-thumb-down-skin"), VERTICAL_SCROLL_BAR_THUMB_SCALE_9_GRID);
this.vScrollBarTrackSkinTextures = new Scale9Textures(this.atlas.getTexture("vertical-scroll-bar-track-skin"), VERTICAL_SCROLL_BAR_TRACK_SCALE_9_GRID);
this.vScrollBarThumbIconTexture = this.atlas.getTexture("vertical-scroll-bar-thumb-icon");
this.vScrollBarStepButtonUpSkinTextures = new Scale9Textures(this.atlas.getTexture("vertical-scroll-bar-step-button-up-skin"), VERTICAL_SCROLL_BAR_STEP_BUTTON_SCALE_9_GRID);
this.vScrollBarStepButtonHoverSkinTextures = new Scale9Textures(this.atlas.getTexture("vertical-scroll-bar-step-button-hover-skin"), VERTICAL_SCROLL_BAR_STEP_BUTTON_SCALE_9_GRID);
this.vScrollBarStepButtonDownSkinTextures = new Scale9Textures(this.atlas.getTexture("vertical-scroll-bar-step-button-down-skin"), VERTICAL_SCROLL_BAR_STEP_BUTTON_SCALE_9_GRID);
this.vScrollBarStepButtonDisabledSkinTextures = new Scale9Textures(this.atlas.getTexture("vertical-scroll-bar-step-button-disabled-skin"), VERTICAL_SCROLL_BAR_STEP_BUTTON_SCALE_9_GRID);
this.vScrollBarDecrementButtonIconTexture = this.atlas.getTexture("vertical-scroll-bar-decrement-button-icon");
this.vScrollBarIncrementButtonIconTexture = this.atlas.getTexture("vertical-scroll-bar-increment-button-icon");
this.hScrollBarThumbUpSkinTextures = new Scale9Textures(this.atlas.getTexture("horizontal-scroll-bar-thumb-up-skin"), HORIZONTAL_SCROLL_BAR_THUMB_SCALE_9_GRID);
this.hScrollBarThumbHoverSkinTextures = new Scale9Textures(this.atlas.getTexture("horizontal-scroll-bar-thumb-hover-skin"), HORIZONTAL_SCROLL_BAR_THUMB_SCALE_9_GRID);
this.hScrollBarThumbDownSkinTextures = new Scale9Textures(this.atlas.getTexture("horizontal-scroll-bar-thumb-down-skin"), HORIZONTAL_SCROLL_BAR_THUMB_SCALE_9_GRID);
this.hScrollBarTrackSkinTextures = new Scale9Textures(this.atlas.getTexture("horizontal-scroll-bar-track-skin"), HORIZONTAL_SCROLL_BAR_TRACK_SCALE_9_GRID);
this.hScrollBarThumbIconTexture = this.atlas.getTexture("horizontal-scroll-bar-thumb-icon");
this.hScrollBarStepButtonUpSkinTextures = new Scale9Textures(this.atlas.getTexture("horizontal-scroll-bar-step-button-up-skin"), HORIZONTAL_SCROLL_BAR_STEP_BUTTON_SCALE_9_GRID);
this.hScrollBarStepButtonHoverSkinTextures = new Scale9Textures(this.atlas.getTexture("horizontal-scroll-bar-step-button-hover-skin"), HORIZONTAL_SCROLL_BAR_STEP_BUTTON_SCALE_9_GRID);
this.hScrollBarStepButtonDownSkinTextures = new Scale9Textures(this.atlas.getTexture("horizontal-scroll-bar-step-button-down-skin"), HORIZONTAL_SCROLL_BAR_STEP_BUTTON_SCALE_9_GRID);
this.hScrollBarStepButtonDisabledSkinTextures = new Scale9Textures(this.atlas.getTexture("horizontal-scroll-bar-step-button-disabled-skin"), HORIZONTAL_SCROLL_BAR_STEP_BUTTON_SCALE_9_GRID);
this.hScrollBarDecrementButtonIconTexture = this.atlas.getTexture("horizontal-scroll-bar-decrement-button-icon");
this.hScrollBarIncrementButtonIconTexture = this.atlas.getTexture("horizontal-scroll-bar-increment-button-icon");
this.simpleBorderBackgroundSkinTextures = new Scale9Textures(this.atlas.getTexture("simple-border-background-skin"), SIMPLE_BORDER_SCALE_9_GRID);
this.panelBorderBackgroundSkinTextures = new Scale9Textures(this.atlas.getTexture("panel-background-skin"), PANEL_BORDER_SCALE_9_GRID);
this.progressBarFillSkinTexture = this.atlas.getTexture("progress-bar-fill-skin");
StandardIcons.listDrillDownAccessoryTexture = this.atlas.getTexture("list-accessory-drill-down-icon");
}
protected function setInitializers():void
{
//screens
this.setInitializerForClassAndSubclasses(Screen, screenInitializer);
this.setInitializerForClassAndSubclasses(PanelScreen, panelScreenInitializer);
this.setInitializerForClassAndSubclasses(ScrollScreen, scrollScreenInitializer);
//alert
this.setInitializerForClass(Alert, alertInitializer);
this.setInitializerForClass(Header, panelHeaderInitializer, Alert.DEFAULT_CHILD_NAME_HEADER);
this.setInitializerForClass(ButtonGroup, alertButtonGroupInitializer, Alert.DEFAULT_CHILD_NAME_BUTTON_GROUP);
this.setInitializerForClass(TextFieldTextRenderer, alertMessageInitializer, Alert.DEFAULT_CHILD_NAME_MESSAGE);
//button
this.setInitializerForClass(Button, buttonInitializer);
this.setInitializerForClass(Button, quietButtonInitializer, Button.ALTERNATE_NAME_QUIET_BUTTON);
//button group
this.setInitializerForClass(ButtonGroup, buttonGroupInitializer);
//callout
this.setInitializerForClass(Callout, calloutInitializer);
//check
this.setInitializerForClass(Check, checkInitializer);
//drawers
this.setInitializerForClass(Drawers, drawersInitializer);
//grouped list (see also: item renderers)
this.setInitializerForClass(GroupedList, groupedListInitializer);
//header
this.setInitializerForClass(Header, headerInitializer);
//item renderers for lists
this.setInitializerForClass(DefaultListItemRenderer, defaultItemRendererInitializer);
this.setInitializerForClass(DefaultGroupedListItemRenderer, defaultItemRendererInitializer);
this.setInitializerForClass(TextFieldTextRenderer, itemRendererAccessoryLabelInitializer, BaseDefaultItemRenderer.DEFAULT_CHILD_NAME_ACCESSORY_LABEL);
this.setInitializerForClass(TextFieldTextRenderer, itemRendererIconLabelInitializer, BaseDefaultItemRenderer.DEFAULT_CHILD_NAME_ICON_LABEL);
//header and footer renderers for grouped list
this.setInitializerForClass(DefaultGroupedListHeaderOrFooterRenderer, defaultHeaderOrFooterRendererInitializer);
//label
this.setInitializerForClass(Label, labelInitializer);
this.setInitializerForClass(Label, headingLabelInitializer, Label.ALTERNATE_NAME_HEADING);
this.setInitializerForClass(Label, detailLabelInitializer, Label.ALTERNATE_NAME_DETAIL);
//list (see also: item renderers)
this.setInitializerForClass(List, listInitializer);
//numeric stepper
this.setInitializerForClass(NumericStepper, numericStepperInitializer);
this.setInitializerForClass(TextInput, numericStepperTextInputInitializer, NumericStepper.DEFAULT_CHILD_NAME_TEXT_INPUT);
this.setInitializerForClass(Button, stepperIncrementButtonInitializer, NumericStepper.DEFAULT_CHILD_NAME_INCREMENT_BUTTON);
this.setInitializerForClass(Button, stepperDecrementButtonInitializer, NumericStepper.DEFAULT_CHILD_NAME_DECREMENT_BUTTON);
//panel
this.setInitializerForClass(Panel, panelInitializer);
this.setInitializerForClass(Header, panelHeaderInitializer, Panel.DEFAULT_CHILD_NAME_HEADER);
//page indicator
this.setInitializerForClass(PageIndicator, pageIndicatorInitializer);
//picker list (see also: item renderers)
this.setInitializerForClass(PickerList, pickerListInitializer);
this.setInitializerForClass(List, pickerListListInitializer, PickerList.DEFAULT_CHILD_NAME_LIST);
this.setInitializerForClass(Button, pickerListButtonInitializer, PickerList.DEFAULT_CHILD_NAME_BUTTON);
//progress bar
this.setInitializerForClass(ProgressBar, progressBarInitializer);
//radio
this.setInitializerForClass(Radio, radioInitializer);
//scroll bar
this.setInitializerForClass(ScrollBar, horizontalScrollBarInitializer, Scroller.DEFAULT_CHILD_NAME_HORIZONTAL_SCROLL_BAR);
this.setInitializerForClass(ScrollBar, verticalScrollBarInitializer, Scroller.DEFAULT_CHILD_NAME_VERTICAL_SCROLL_BAR);
this.setInitializerForClass(Button, horizontalScrollBarIncrementButtonInitializer, THEME_NAME_HORIZONTAL_SCROLL_BAR_INCREMENT_BUTTON);
this.setInitializerForClass(Button, horizontalScrollBarDecrementButtonInitializer, THEME_NAME_HORIZONTAL_SCROLL_BAR_DECREMENT_BUTTON);
this.setInitializerForClass(Button, horizontalScrollBarThumbInitializer, THEME_NAME_HORIZONTAL_SCROLL_BAR_THUMB);
this.setInitializerForClass(Button, horizontalScrollBarMinimumTrackInitializer, THEME_NAME_HORIZONTAL_SCROLL_BAR_MINIMUM_TRACK);
this.setInitializerForClass(Button, verticalScrollBarIncrementButtonInitializer, THEME_NAME_VERTICAL_SCROLL_BAR_INCREMENT_BUTTON);
this.setInitializerForClass(Button, verticalScrollBarDecrementButtonInitializer, THEME_NAME_VERTICAL_SCROLL_BAR_DECREMENT_BUTTON);
this.setInitializerForClass(Button, verticalScrollBarThumbInitializer, THEME_NAME_VERTICAL_SCROLL_BAR_THUMB);
this.setInitializerForClass(Button, verticalScrollBarMinimumTrackInitializer, THEME_NAME_VERTICAL_SCROLL_BAR_MINIMUM_TRACK);
//scroll container
this.setInitializerForClass(ScrollContainer, scrollContainerInitializer);
this.setInitializerForClass(ScrollContainer, scrollContainerToolbarInitializer, ScrollContainer.ALTERNATE_NAME_TOOLBAR);
//scroll text
this.setInitializerForClass(ScrollText, scrollTextInitializer);
//simple scroll bar
this.setInitializerForClass(SimpleScrollBar, horizontalSimpleScrollBarInitializer, Scroller.DEFAULT_CHILD_NAME_HORIZONTAL_SCROLL_BAR);
this.setInitializerForClass(SimpleScrollBar, verticalSimpleScrollBarInitializer, Scroller.DEFAULT_CHILD_NAME_VERTICAL_SCROLL_BAR);
this.setInitializerForClass(Button, horizontalSimpleScrollBarThumbInitializer, THEME_NAME_HORIZONTAL_SIMPLE_SCROLL_BAR_THUMB);
this.setInitializerForClass(Button, verticalSimpleScrollBarThumbInitializer, THEME_NAME_VERTICAL_SIMPLE_SCROLL_BAR_THUMB);
//slider
this.setInitializerForClass(Slider, sliderInitializer);
this.setInitializerForClass(Button, horizontalSliderThumbInitializer, THEME_NAME_HORIZONTAL_SLIDER_THUMB);
this.setInitializerForClass(Button, horizontalSliderMinimumTrackInitializer, THEME_NAME_HORIZONTAL_SLIDER_MINIMUM_TRACK);
this.setInitializerForClass(Button, verticalSliderThumbInitializer, THEME_NAME_VERTICAL_SLIDER_THUMB);
this.setInitializerForClass(Button, verticalSliderMinimumTrackInitializer, THEME_NAME_VERTICAL_SLIDER_MINIMUM_TRACK);
//tab bar
this.setInitializerForClass(Button, tabInitializer, TabBar.DEFAULT_CHILD_NAME_TAB);
//text area
this.setInitializerForClass(TextArea, textAreaInitializer);
//text input
this.setInitializerForClass(TextInput, textInputInitializer);
this.setInitializerForClass(TextInput, searchTextInputInitializer, TextInput.ALTERNATE_NAME_SEARCH_TEXT_INPUT);
//toggle switch
this.setInitializerForClass(ToggleSwitch, toggleSwitchInitializer);
this.setInitializerForClass(Button, toggleSwitchOnTrackInitializer, ToggleSwitch.DEFAULT_CHILD_NAME_ON_TRACK);
this.setInitializerForClass(Button, toggleSwitchThumbInitializer, ToggleSwitch.DEFAULT_CHILD_NAME_THUMB);
}
protected function pageIndicatorNormalSymbolFactory():Image
{
return new Image(this.pageIndicatorNormalSkinTexture);
}
protected function pageIndicatorSelectedSymbolFactory():Image
{
return new Image(this.pageIndicatorSelectedSkinTexture);
}
protected function nothingInitializer(target:IFeathersControl):void
{
//do nothing
}
protected function screenInitializer(screen:Screen):void
{
screen.originalDPI = this.originalDPI;
}
protected function panelScreenInitializer(screen:PanelScreen):void
{
screen.originalDPI = this.originalDPI;
screen.interactionMode = ScrollContainer.INTERACTION_MODE_MOUSE;
screen.scrollBarDisplayMode = ScrollContainer.SCROLL_BAR_DISPLAY_MODE_FIXED;
screen.horizontalScrollBarFactory = scrollBarFactory;
screen.verticalScrollBarFactory = scrollBarFactory;
}
protected function scrollScreenInitializer(screen:ScrollScreen):void
{
screen.originalDPI = this.originalDPI;
screen.interactionMode = ScrollContainer.INTERACTION_MODE_MOUSE;
screen.scrollBarDisplayMode = ScrollContainer.SCROLL_BAR_DISPLAY_MODE_FIXED;
screen.horizontalScrollBarFactory = scrollBarFactory;
screen.verticalScrollBarFactory = scrollBarFactory;
}
protected function labelInitializer(label:Label):void
{
label.textRendererProperties.textFormat = this.defaultTextFormat;
label.textRendererProperties.disabledTextFormat = this.disabledTextFormat;
}
protected function headingLabelInitializer(label:Label):void
{
label.textRendererProperties.textFormat = this.headingTextFormat;
label.textRendererProperties.disabledTextFormat = this.headingDisabledTextFormat;
}
protected function detailLabelInitializer(label:Label):void
{
label.textRendererProperties.textFormat = this.detailTextFormat;
label.textRendererProperties.disabledTextFormat = this.detailDisabledTextFormat;
}
protected function scrollTextInitializer(text:ScrollText):void
{
text.textFormat = this.defaultTextFormat;
text.disabledTextFormat = this.disabledTextFormat;
text.paddingTop = text.paddingRight = text.paddingBottom = text.paddingLeft = 8;
text.interactionMode = ScrollText.INTERACTION_MODE_MOUSE;
text.scrollBarDisplayMode = ScrollText.SCROLL_BAR_DISPLAY_MODE_FIXED;
text.horizontalScrollBarFactory = scrollBarFactory;
text.verticalScrollBarFactory = scrollBarFactory;
}
protected function itemRendererAccessoryLabelInitializer(renderer:TextFieldTextRenderer):void
{
renderer.textFormat = this.defaultTextFormat;
}
protected function itemRendererIconLabelInitializer(renderer:TextFieldTextRenderer):void
{
renderer.textFormat = this.defaultTextFormat;
}
protected function alertMessageInitializer(renderer:TextFieldTextRenderer):void
{
renderer.textFormat = this.defaultTextFormat;
renderer.wordWrap = true;
}
protected function buttonInitializer(button:Button):void
{
const skinSelector:SmartDisplayObjectStateValueSelector = new SmartDisplayObjectStateValueSelector();
skinSelector.defaultValue = this.buttonUpSkinTextures;
skinSelector.defaultSelectedValue = this.buttonSelectedUpSkinTextures;
skinSelector.setValueForState(this.buttonHoverSkinTextures, Button.STATE_HOVER, false);
skinSelector.setValueForState(this.buttonDownSkinTextures, Button.STATE_DOWN, false);
skinSelector.setValueForState(this.buttonDisabledSkinTextures, Button.STATE_DISABLED, false);
skinSelector.setValueForState(this.buttonSelectedHoverSkinTextures, Button.STATE_HOVER, true);
skinSelector.setValueForState(this.buttonSelectedDownSkinTextures, Button.STATE_DOWN, true);
skinSelector.setValueForState(this.buttonSelectedDisabledSkinTextures, Button.STATE_DISABLED, true);
button.stateToSkinFunction = skinSelector.updateValue;
this.baseButtonInitializer(button);
}
protected function quietButtonInitializer(button:Button):void
{
const skinSelector:SmartDisplayObjectStateValueSelector = new SmartDisplayObjectStateValueSelector();
skinSelector.defaultValue = null;
skinSelector.defaultSelectedValue = this.buttonSelectedUpSkinTextures;
skinSelector.setValueForState(this.buttonHoverSkinTextures, Button.STATE_HOVER, false);
skinSelector.setValueForState(this.buttonDownSkinTextures, Button.STATE_DOWN, false);
skinSelector.setValueForState(this.buttonDisabledSkinTextures, Button.STATE_DISABLED, false);
skinSelector.setValueForState(this.buttonSelectedHoverSkinTextures, Button.STATE_HOVER, true);
skinSelector.setValueForState(this.buttonSelectedDownSkinTextures, Button.STATE_DOWN, true);
skinSelector.setValueForState(this.buttonSelectedDisabledSkinTextures, Button.STATE_DISABLED, true);
button.stateToSkinFunction = skinSelector.updateValue;
this.baseButtonInitializer(button);
}
protected function baseButtonInitializer(button:Button):void
{
button.focusIndicatorSkin = new Scale9Image(this.focusIndicatorSkinTextures);
button.focusPadding = -1;
button.defaultLabelProperties.textFormat = this.defaultTextFormat;
button.disabledLabelProperties.textFormat = this.disabledTextFormat;
button.paddingTop = button.paddingBottom = 2;
button.paddingLeft = button.paddingRight = 10;
button.gap = 2;
button.minGap = 2;
button.minWidth = button.minHeight = 12;
}
protected function pickerListButtonInitializer(button:Button):void
{
this.buttonInitializer(button);
const iconSelector:SmartDisplayObjectStateValueSelector = new SmartDisplayObjectStateValueSelector();
iconSelector.defaultValue = this.pickerListUpIconTexture;
iconSelector.setValueForState(this.pickerListHoverIconTexture, Button.STATE_HOVER, false);
iconSelector.setValueForState(this.pickerListDownIconTexture, Button.STATE_DOWN, false);
iconSelector.setValueForState(this.pickerListDisabledIconTexture, Button.STATE_DISABLED, false);
button.stateToIconFunction = iconSelector.updateValue;
button.gap = Number.POSITIVE_INFINITY; //fill as completely as possible
button.minGap = 2;
button.horizontalAlign = Button.HORIZONTAL_ALIGN_LEFT;
button.iconPosition = Button.ICON_POSITION_RIGHT;
button.paddingRight = 6;
}
protected function toggleSwitchOnTrackInitializer(track:Button):void
{
track.defaultSkin = new Scale9Image(buttonSelectedUpSkinTextures);
}
protected function toggleSwitchThumbInitializer(thumb:Button):void
{
this.buttonInitializer(thumb);
var frame:Rectangle = this.buttonUpSkinTextures.texture.frame;
if(frame)
{
thumb.width = thumb.height = buttonUpSkinTextures.texture.frame.height;
}
else
{
thumb.width = thumb.height = buttonUpSkinTextures.texture.height;
}
}
protected function horizontalScrollBarIncrementButtonInitializer(button:Button):void
{
const skinSelector:SmartDisplayObjectStateValueSelector = new SmartDisplayObjectStateValueSelector();
skinSelector.defaultValue = this.hScrollBarStepButtonUpSkinTextures;
skinSelector.setValueForState(this.hScrollBarStepButtonHoverSkinTextures, Button.STATE_HOVER, false);
skinSelector.setValueForState(this.hScrollBarStepButtonDownSkinTextures, Button.STATE_DOWN, false);
skinSelector.setValueForState(this.hScrollBarStepButtonDisabledSkinTextures, Button.STATE_DISABLED, false);
button.stateToSkinFunction = skinSelector.updateValue;
button.defaultIcon = new Image(this.hScrollBarIncrementButtonIconTexture);
const incrementButtonDisabledIcon:Quad = new Quad(1, 1, 0xff00ff);
incrementButtonDisabledIcon.alpha = 0;
button.disabledIcon = incrementButtonDisabledIcon;
}
protected function horizontalScrollBarDecrementButtonInitializer(button:Button):void
{
const skinSelector:SmartDisplayObjectStateValueSelector = new SmartDisplayObjectStateValueSelector();
skinSelector.defaultValue = hScrollBarStepButtonUpSkinTextures;
skinSelector.setValueForState(this.hScrollBarStepButtonHoverSkinTextures, Button.STATE_HOVER, false);
skinSelector.setValueForState(this.hScrollBarStepButtonDownSkinTextures, Button.STATE_DOWN, false);
skinSelector.setValueForState(this.hScrollBarStepButtonDisabledSkinTextures, Button.STATE_DISABLED, false);
button.stateToSkinFunction = skinSelector.updateValue;
button.defaultIcon = new Image(this.hScrollBarDecrementButtonIconTexture);
const decrementButtonDisabledIcon:Quad = new Quad(1, 1, 0xff00ff);
decrementButtonDisabledIcon.alpha = 0;
button.disabledIcon = decrementButtonDisabledIcon;
}
protected function horizontalScrollBarThumbInitializer(thumb:Button):void
{
const skinSelector:SmartDisplayObjectStateValueSelector = new SmartDisplayObjectStateValueSelector();
skinSelector.defaultValue = this.hScrollBarThumbUpSkinTextures;
skinSelector.setValueForState(this.hScrollBarThumbHoverSkinTextures, Button.STATE_HOVER, false);
skinSelector.setValueForState(this.hScrollBarThumbDownSkinTextures, Button.STATE_DOWN, false);
thumb.stateToSkinFunction = skinSelector.updateValue;
thumb.defaultIcon = new Image(this.hScrollBarThumbIconTexture);
thumb.verticalAlign = Button.VERTICAL_ALIGN_TOP;
thumb.paddingTop = 4;
}
protected function horizontalScrollBarMinimumTrackInitializer(track:Button):void
{
track.defaultSkin = new Scale9Image(this.hScrollBarTrackSkinTextures);
}
protected function verticalScrollBarIncrementButtonInitializer(button:Button):void
{
const skinSelector:SmartDisplayObjectStateValueSelector = new SmartDisplayObjectStateValueSelector();
skinSelector.defaultValue = this.vScrollBarStepButtonUpSkinTextures;
skinSelector.setValueForState(this.vScrollBarStepButtonHoverSkinTextures, Button.STATE_HOVER, false);
skinSelector.setValueForState(this.vScrollBarStepButtonDownSkinTextures, Button.STATE_DOWN, false);
skinSelector.setValueForState(this.vScrollBarStepButtonDisabledSkinTextures, Button.STATE_DISABLED, false);
button.stateToSkinFunction = skinSelector.updateValue;
button.defaultIcon = new Image(this.vScrollBarIncrementButtonIconTexture);
const incrementButtonDisabledIcon:Quad = new Quad(1, 1, 0xff00ff);
incrementButtonDisabledIcon.alpha = 0;
button.disabledIcon = incrementButtonDisabledIcon;
}
protected function verticalScrollBarDecrementButtonInitializer(button:Button):void
{
const skinSelector:SmartDisplayObjectStateValueSelector = new SmartDisplayObjectStateValueSelector();
skinSelector.defaultValue = this.vScrollBarStepButtonUpSkinTextures;
skinSelector.setValueForState(this.vScrollBarStepButtonHoverSkinTextures, Button.STATE_HOVER, false);
skinSelector.setValueForState(this.vScrollBarStepButtonDownSkinTextures, Button.STATE_DOWN, false);
skinSelector.setValueForState(this.vScrollBarStepButtonDisabledSkinTextures, Button.STATE_DISABLED, false);
button.stateToSkinFunction = skinSelector.updateValue;
button.defaultIcon = new Image(this.vScrollBarDecrementButtonIconTexture);
const decrementButtonDisabledIcon:Quad = new Quad(1, 1, 0xff00ff);
decrementButtonDisabledIcon.alpha = 0;
button.disabledIcon = decrementButtonDisabledIcon;
}
protected function verticalScrollBarThumbInitializer(thumb:Button):void
{
const skinSelector:SmartDisplayObjectStateValueSelector = new SmartDisplayObjectStateValueSelector();
skinSelector.defaultValue = this.vScrollBarThumbUpSkinTextures;
skinSelector.setValueForState(this.vScrollBarThumbHoverSkinTextures, Button.STATE_HOVER, false);
skinSelector.setValueForState(this.vScrollBarThumbDownSkinTextures, Button.STATE_DOWN, false);
thumb.stateToSkinFunction = skinSelector.updateValue;
thumb.defaultIcon = new Image(this.vScrollBarThumbIconTexture);
thumb.horizontalAlign = Button.HORIZONTAL_ALIGN_LEFT;
thumb.paddingLeft = 4;
}
protected function verticalScrollBarMinimumTrackInitializer(track:Button):void
{
track.defaultSkin = new Scale9Image(this.vScrollBarTrackSkinTextures);
}
protected function horizontalSimpleScrollBarThumbInitializer(thumb:Button):void
{
const skinSelector:SmartDisplayObjectStateValueSelector = new SmartDisplayObjectStateValueSelector();
skinSelector.defaultValue = this.hScrollBarThumbUpSkinTextures;
skinSelector.setValueForState(this.hScrollBarThumbHoverSkinTextures, Button.STATE_HOVER, false);
skinSelector.setValueForState(this.hScrollBarThumbDownSkinTextures, Button.STATE_DOWN, false);
thumb.stateToSkinFunction = skinSelector.updateValue;
thumb.defaultIcon = new Image(this.hScrollBarThumbIconTexture);
thumb.verticalAlign = Button.VERTICAL_ALIGN_TOP;
thumb.paddingTop = 4;
}
protected function verticalSimpleScrollBarThumbInitializer(thumb:Button):void
{
const skinSelector:SmartDisplayObjectStateValueSelector = new SmartDisplayObjectStateValueSelector();
skinSelector.defaultValue = this.vScrollBarThumbUpSkinTextures;
skinSelector.setValueForState(this.vScrollBarThumbHoverSkinTextures, Button.STATE_HOVER, false);
skinSelector.setValueForState(this.vScrollBarThumbDownSkinTextures, Button.STATE_DOWN, false);
thumb.stateToSkinFunction = skinSelector.updateValue;
thumb.defaultIcon = new Image(this.vScrollBarThumbIconTexture);
thumb.horizontalAlign = Button.HORIZONTAL_ALIGN_LEFT;
thumb.paddingLeft = 4;
}
protected function horizontalSliderThumbInitializer(thumb:Button):void
{
const skinSelector:SmartDisplayObjectStateValueSelector = new SmartDisplayObjectStateValueSelector();
skinSelector.defaultValue = this.hSliderThumbUpSkinTexture;
skinSelector.setValueForState(this.hSliderThumbHoverSkinTexture, Button.STATE_HOVER, false);
skinSelector.setValueForState(this.hSliderThumbDownSkinTexture, Button.STATE_DOWN, false);
skinSelector.setValueForState(this.hSliderThumbDisabledSkinTexture, Button.STATE_DISABLED, false);
thumb.stateToSkinFunction = skinSelector.updateValue;
}
protected function horizontalSliderMinimumTrackInitializer(track:Button):void
{
track.defaultSkin = new Scale3Image(this.hSliderTrackSkinTextures);
}
protected function verticalSliderThumbInitializer(thumb:Button):void
{
const skinSelector:SmartDisplayObjectStateValueSelector = new SmartDisplayObjectStateValueSelector();
skinSelector.defaultValue = this.vSliderThumbUpSkinTexture;
skinSelector.setValueForState(this.vSliderThumbHoverSkinTexture, Button.STATE_HOVER, false);
skinSelector.setValueForState(this.vSliderThumbDownSkinTexture, Button.STATE_DOWN, false);
skinSelector.setValueForState(this.vSliderThumbDisabledSkinTexture, Button.STATE_DISABLED, false);
thumb.stateToSkinFunction = skinSelector.updateValue;
}
protected function verticalSliderMinimumTrackInitializer(track:Button):void
{
track.defaultSkin = new Scale3Image(this.vSliderTrackSkinTextures);
}
protected function checkInitializer(check:Check):void
{
const iconSelector:SmartDisplayObjectStateValueSelector = new SmartDisplayObjectStateValueSelector();
iconSelector.defaultValue = this.checkUpIconTexture;
iconSelector.defaultSelectedValue = this.checkSelectedUpIconTexture;
iconSelector.setValueForState(this.checkHoverIconTexture, Button.STATE_HOVER, false);
iconSelector.setValueForState(this.checkDownIconTexture, Button.STATE_DOWN, false);
iconSelector.setValueForState(this.checkDisabledIconTexture, Button.STATE_DISABLED, false);
iconSelector.setValueForState(this.checkSelectedHoverIconTexture, Button.STATE_HOVER, true);
iconSelector.setValueForState(this.checkSelectedDownIconTexture, Button.STATE_DOWN, true);
iconSelector.setValueForState(this.checkSelectedDisabledIconTexture, Button.STATE_DISABLED, true);
check.stateToIconFunction = iconSelector.updateValue;
check.focusIndicatorSkin = new Scale9Image(this.focusIndicatorSkinTextures);
check.focusPadding = -2;
check.defaultLabelProperties.textFormat = this.defaultTextFormat;
check.disabledLabelProperties.textFormat = this.disabledTextFormat;
check.horizontalAlign = Button.HORIZONTAL_ALIGN_LEFT;
check.verticalAlign = Button.VERTICAL_ALIGN_MIDDLE;
check.gap = 4;
}
protected function radioInitializer(radio:Radio):void
{
const iconSelector:SmartDisplayObjectStateValueSelector = new SmartDisplayObjectStateValueSelector();
iconSelector.defaultValue = this.radioUpIconTexture;
iconSelector.defaultSelectedValue = this.radioSelectedUpIconTexture;
iconSelector.setValueForState(this.radioHoverIconTexture, Button.STATE_HOVER, false);
iconSelector.setValueForState(this.radioDownIconTexture, Button.STATE_DOWN, false);
iconSelector.setValueForState(this.radioDisabledIconTexture, Button.STATE_DISABLED, false);
iconSelector.setValueForState(this.radioSelectedHoverIconTexture, Button.STATE_HOVER, true);
iconSelector.setValueForState(this.radioSelectedDownIconTexture, Button.STATE_DOWN, true);
iconSelector.setValueForState(this.radioSelectedDisabledIconTexture, Button.STATE_DISABLED, true);
radio.stateToIconFunction = iconSelector.updateValue;
radio.focusIndicatorSkin = new Scale9Image(this.focusIndicatorSkinTextures);
radio.focusPadding = -2;
radio.defaultLabelProperties.textFormat = this.defaultTextFormat;
radio.disabledLabelProperties.textFormat = this.disabledTextFormat;
radio.horizontalAlign = Button.HORIZONTAL_ALIGN_LEFT;
radio.verticalAlign = Button.VERTICAL_ALIGN_MIDDLE;
radio.gap = 4;
}
protected function tabInitializer(tab:Button):void
{
const skinSelector:SmartDisplayObjectStateValueSelector = new SmartDisplayObjectStateValueSelector();
skinSelector.defaultValue = this.tabUpSkinTextures;
skinSelector.defaultSelectedValue = this.tabSelectedUpSkinTextures;
skinSelector.setValueForState(this.tabHoverSkinTextures, Button.STATE_HOVER, false);
skinSelector.setValueForState(this.tabDownSkinTextures, Button.STATE_DOWN, false);
skinSelector.setValueForState(this.tabDisabledSkinTextures, Button.STATE_DISABLED, false);
skinSelector.setValueForState(this.tabSelectedDisabledSkinTextures, Button.STATE_DISABLED, true);
tab.stateToSkinFunction = skinSelector.updateValue;
tab.defaultLabelProperties.textFormat = this.defaultTextFormat;
tab.disabledLabelProperties.textFormat = this.disabledTextFormat;
tab.paddingTop = tab.paddingBottom = 2;
tab.paddingLeft = tab.paddingRight = 10;
tab.gap = 2;
tab.minWidth = tab.minHeight = 12;
}
protected function stepperIncrementButtonInitializer(button:Button):void
{
const skinSelector:SmartDisplayObjectStateValueSelector = new SmartDisplayObjectStateValueSelector();
skinSelector.defaultValue = this.stepperIncrementButtonUpSkinTextures;
skinSelector.setValueForState(this.stepperIncrementButtonHoverSkinTextures, Button.STATE_HOVER, false);
skinSelector.setValueForState(this.stepperIncrementButtonDownSkinTextures, Button.STATE_DOWN, false);
skinSelector.setValueForState(this.stepperIncrementButtonDisabledSkinTextures, Button.STATE_DISABLED, false);
button.stateToSkinFunction = skinSelector.updateValue;
}
protected function stepperDecrementButtonInitializer(button:Button):void
{
const skinSelector:SmartDisplayObjectStateValueSelector = new SmartDisplayObjectStateValueSelector();
skinSelector.defaultValue = this.stepperDecrementButtonUpSkinTextures;
skinSelector.setValueForState(this.stepperDecrementButtonHoverSkinTextures, Button.STATE_HOVER, false);
skinSelector.setValueForState(this.stepperDecrementButtonDownSkinTextures, Button.STATE_DOWN, false);
skinSelector.setValueForState(this.stepperDecrementButtonDisabledSkinTextures, Button.STATE_DISABLED, false);
button.stateToSkinFunction = skinSelector.updateValue;
}
protected function toggleSwitchInitializer(toggle:ToggleSwitch):void
{
toggle.trackLayoutMode = ToggleSwitch.TRACK_LAYOUT_MODE_SINGLE;
toggle.labelAlign = ToggleSwitch.LABEL_ALIGN_MIDDLE;
toggle.defaultLabelProperties.textFormat = this.defaultTextFormat;
toggle.disabledLabelProperties.textFormat = this.disabledTextFormat;
toggle.focusIndicatorSkin = new Scale9Image(this.focusIndicatorSkinTextures);
toggle.focusPadding = -1;
}
protected function buttonGroupInitializer(group:ButtonGroup):void
{
group.gap = 4;
}
protected function alertButtonGroupInitializer(group:ButtonGroup):void
{
group.direction = ButtonGroup.DIRECTION_HORIZONTAL;
group.horizontalAlign = ButtonGroup.HORIZONTAL_ALIGN_CENTER;
group.verticalAlign = ButtonGroup.VERTICAL_ALIGN_JUSTIFY;
group.gap = 4;
group.paddingTop = 12;
group.paddingRight = 12;
group.paddingBottom = 12;
group.paddingLeft = 12;
}
protected function sliderInitializer(slider:Slider):void
{
slider.trackLayoutMode = Slider.TRACK_LAYOUT_MODE_SINGLE;
slider.minimumPadding = slider.maximumPadding = -vSliderThumbUpSkinTexture.height / 2;
if(slider.direction == Slider.DIRECTION_VERTICAL)
{
slider.customThumbName = THEME_NAME_VERTICAL_SLIDER_THUMB;
slider.customMinimumTrackName = THEME_NAME_VERTICAL_SLIDER_MINIMUM_TRACK;
slider.focusPaddingLeft = slider.focusPaddingRight = -2;
slider.focusPaddingTop = slider.focusPaddingBottom = -2 + slider.minimumPadding;
}
else //horizontal
{
slider.customThumbName = THEME_NAME_HORIZONTAL_SLIDER_THUMB;
slider.customMinimumTrackName = THEME_NAME_HORIZONTAL_SLIDER_MINIMUM_TRACK;
slider.focusPaddingTop = slider.focusPaddingBottom = -2;
slider.focusPaddingLeft = slider.focusPaddingRight = -2 + slider.minimumPadding;
}
slider.focusIndicatorSkin = new Scale9Image(this.focusIndicatorSkinTextures);
}
protected function verticalScrollBarInitializer(scrollBar:ScrollBar):void
{
scrollBar.direction = ScrollBar.DIRECTION_VERTICAL;
scrollBar.trackLayoutMode = ScrollBar.TRACK_LAYOUT_MODE_SINGLE;
scrollBar.customIncrementButtonName = THEME_NAME_VERTICAL_SCROLL_BAR_INCREMENT_BUTTON;
scrollBar.customDecrementButtonName = THEME_NAME_VERTICAL_SCROLL_BAR_DECREMENT_BUTTON;
scrollBar.customThumbName = THEME_NAME_VERTICAL_SCROLL_BAR_THUMB;
scrollBar.customMinimumTrackName = THEME_NAME_VERTICAL_SCROLL_BAR_MINIMUM_TRACK;
}
protected function horizontalScrollBarInitializer(scrollBar:ScrollBar):void
{
scrollBar.direction = ScrollBar.DIRECTION_HORIZONTAL;
scrollBar.trackLayoutMode = ScrollBar.TRACK_LAYOUT_MODE_SINGLE;
scrollBar.customIncrementButtonName = THEME_NAME_HORIZONTAL_SCROLL_BAR_INCREMENT_BUTTON;
scrollBar.customDecrementButtonName = THEME_NAME_HORIZONTAL_SCROLL_BAR_DECREMENT_BUTTON;
scrollBar.customThumbName = THEME_NAME_HORIZONTAL_SCROLL_BAR_THUMB;
scrollBar.customMinimumTrackName = THEME_NAME_HORIZONTAL_SCROLL_BAR_MINIMUM_TRACK;
}
protected function horizontalSimpleScrollBarInitializer(scrollBar:SimpleScrollBar):void
{
scrollBar.customThumbName = THEME_NAME_HORIZONTAL_SIMPLE_SCROLL_BAR_THUMB;
}
protected function verticalSimpleScrollBarInitializer(scrollBar:SimpleScrollBar):void
{
scrollBar.customThumbName = THEME_NAME_VERTICAL_SIMPLE_SCROLL_BAR_THUMB;
}
protected function numericStepperInitializer(stepper:NumericStepper):void
{
stepper.buttonLayoutMode = NumericStepper.BUTTON_LAYOUT_MODE_RIGHT_SIDE_VERTICAL;
stepper.focusIndicatorSkin = new Scale9Image(this.focusIndicatorSkinTextures);
stepper.focusPadding = -1;
}
protected function baseTextInputInitializer(input:TextInput):void
{
var skinSelector:SmartDisplayObjectStateValueSelector = new SmartDisplayObjectStateValueSelector();
skinSelector.defaultValue = this.textInputBackgroundSkinTextures;
skinSelector.setValueForState(this.textInputBackgroundDisabledSkinTextures, TextInput.STATE_DISABLED);
input.stateToSkinFunction = skinSelector.updateValue;
input.focusIndicatorSkin = new Scale9Image(this.focusIndicatorSkinTextures);
input.focusPadding = -1;
input.minWidth = input.minHeight = 22;
input.gap = 2;
input.paddingTop = input.paddingBottom = 2;
input.paddingRight = input.paddingLeft = 4;
input.textEditorProperties.textFormat = this.defaultTextFormat;
input.promptProperties.textFormat = this.defaultTextFormat;
}
protected function textInputInitializer(input:TextInput):void
{
this.baseTextInputInitializer(input);
}
protected function searchTextInputInitializer(input:TextInput):void
{
this.baseTextInputInitializer(input);
var searchIcon:ImageLoader = new ImageLoader();
searchIcon.source = this.textInputSearchIconTexture;
searchIcon.snapToPixels = true;
input.defaultIcon = searchIcon;
}
protected function numericStepperTextInputInitializer(input:TextInput):void
{
input.minWidth = input.minHeight = 22;
input.gap = 2;
input.paddingTop = input.paddingBottom = 2;
input.paddingRight = input.paddingLeft = 4;
input.textEditorProperties.textFormat = this.defaultTextFormat;
const backgroundSkin:Scale9Image = new Scale9Image(textInputBackgroundSkinTextures);
backgroundSkin.width = backgroundSkin.height;
input.backgroundSkin = backgroundSkin;
const backgroundDisabledSkin:Scale9Image = new Scale9Image(textInputBackgroundDisabledSkinTextures);
backgroundDisabledSkin.width = backgroundDisabledSkin.height;
input.backgroundDisabledSkin = backgroundDisabledSkin;
}
protected function textAreaInitializer(textArea:TextArea):void
{
textArea.textEditorProperties.textFormat = this.defaultTextFormat;
textArea.paddingTop = 2;
textArea.paddingBottom = 2;
textArea.paddingRight = 2;
textArea.paddingLeft = 4;
textArea.focusIndicatorSkin = new Scale9Image(this.focusIndicatorSkinTextures);
textArea.focusPadding = -1;
const backgroundSkin:Scale9Image = new Scale9Image(textInputBackgroundSkinTextures);
backgroundSkin.width = 264;
backgroundSkin.height = 88;
textArea.backgroundSkin = backgroundSkin;
const backgroundDisabledSkin:Scale9Image = new Scale9Image(textInputBackgroundDisabledSkinTextures);
backgroundDisabledSkin.width = 264;
backgroundDisabledSkin.height = 88;
textArea.backgroundDisabledSkin = backgroundDisabledSkin;
textArea.interactionMode = ScrollContainer.INTERACTION_MODE_MOUSE;
textArea.scrollBarDisplayMode = ScrollContainer.SCROLL_BAR_DISPLAY_MODE_FIXED;
textArea.horizontalScrollBarFactory = scrollBarFactory;
textArea.verticalScrollBarFactory = scrollBarFactory;
}
protected function pageIndicatorInitializer(pageIndicator:PageIndicator):void
{
pageIndicator.interactionMode = PageIndicator.INTERACTION_MODE_PRECISE;
pageIndicator.normalSymbolFactory = this.pageIndicatorNormalSymbolFactory;
pageIndicator.selectedSymbolFactory = this.pageIndicatorSelectedSymbolFactory;
pageIndicator.gap = 12;
pageIndicator.paddingTop = pageIndicator.paddingRight = pageIndicator.paddingBottom =
pageIndicator.paddingLeft = 12;
pageIndicator.minTouchWidth = pageIndicator.minTouchHeight = 12;
}
protected function progressBarInitializer(progress:ProgressBar):void
{
const backgroundSkin:Scale9Image = new Scale9Image(simpleBorderBackgroundSkinTextures);
backgroundSkin.width = backgroundSkin.height * 30;
progress.backgroundSkin = backgroundSkin;
progress.fillSkin = new Image(progressBarFillSkinTexture);
progress.paddingTop = progress.paddingRight = progress.paddingBottom =
progress.paddingLeft = 1;
}
protected function scrollContainerInitializer(container:ScrollContainer):void
{
container.interactionMode = ScrollContainer.INTERACTION_MODE_MOUSE;
container.scrollBarDisplayMode = ScrollContainer.SCROLL_BAR_DISPLAY_MODE_FIXED;
container.horizontalScrollBarFactory = scrollBarFactory;
container.verticalScrollBarFactory = scrollBarFactory;
}
protected function scrollContainerToolbarInitializer(container:ScrollContainer):void
{
if(!container.layout)
{
const layout:HorizontalLayout = new HorizontalLayout();
layout.paddingTop = layout.paddingBottom = 2;
layout.paddingRight = layout.paddingLeft = 6;
layout.gap = 2;
container.layout = layout;
}
container.minHeight = 22;
container.interactionMode = ScrollContainer.INTERACTION_MODE_MOUSE;
container.scrollBarDisplayMode = ScrollContainer.SCROLL_BAR_DISPLAY_MODE_FIXED;
container.horizontalScrollBarFactory = scrollBarFactory;
container.verticalScrollBarFactory = scrollBarFactory;
container.backgroundSkin = new Scale9Image(headerBackgroundSkinTextures);
}
protected function panelInitializer(panel:Panel):void
{
panel.backgroundSkin = new Scale9Image(panelBorderBackgroundSkinTextures);
panel.paddingTop = 0;
panel.paddingRight = 10;
panel.paddingBottom = 10;
panel.paddingLeft = 10;
panel.interactionMode = ScrollContainer.INTERACTION_MODE_MOUSE;
panel.scrollBarDisplayMode = ScrollContainer.SCROLL_BAR_DISPLAY_MODE_FIXED;
panel.horizontalScrollBarFactory = scrollBarFactory;
panel.verticalScrollBarFactory = scrollBarFactory;
}
protected function alertInitializer(alert:Alert):void
{
alert.backgroundSkin = new Scale9Image(panelBorderBackgroundSkinTextures);
alert.paddingTop = 0;
alert.paddingRight = 14;
alert.paddingBottom = 0;
alert.paddingLeft = 14;
alert.gap = 12;
alert.interactionMode = ScrollContainer.INTERACTION_MODE_MOUSE;
alert.scrollBarDisplayMode = ScrollContainer.SCROLL_BAR_DISPLAY_MODE_FIXED;
alert.horizontalScrollBarFactory = scrollBarFactory;
alert.verticalScrollBarFactory = scrollBarFactory;
alert.maxWidth = alert.maxHeight = 300;
}
protected function drawersInitializer(drawers:Drawers):void
{
var overlaySkin:Quad = new Quad(10, 10, MODAL_OVERLAY_COLOR);
overlaySkin.alpha = MODAL_OVERLAY_ALPHA;
drawers.overlaySkin = overlaySkin;
}
protected function listInitializer(list:List):void
{
list.backgroundSkin = new Scale9Image(simpleBorderBackgroundSkinTextures);
list.focusIndicatorSkin = new Scale9Image(this.focusIndicatorSkinTextures);
list.focusPadding = -1;
list.paddingTop = list.paddingRight = list.paddingBottom =
list.paddingLeft = 1;
list.interactionMode = List.INTERACTION_MODE_MOUSE;
list.scrollBarDisplayMode = List.SCROLL_BAR_DISPLAY_MODE_FIXED;
list.horizontalScrollBarFactory = scrollBarFactory;
list.verticalScrollBarFactory = scrollBarFactory;
}
protected function groupedListInitializer(list:GroupedList):void
{
list.backgroundSkin = new Scale9Image(simpleBorderBackgroundSkinTextures);
list.focusIndicatorSkin = new Scale9Image(this.focusIndicatorSkinTextures);
list.focusPadding = -1;
list.paddingTop = list.paddingRight = list.paddingBottom =
list.paddingLeft = 1;
list.interactionMode = GroupedList.INTERACTION_MODE_MOUSE;
list.scrollBarDisplayMode = GroupedList.SCROLL_BAR_DISPLAY_MODE_FIXED;
list.horizontalScrollBarFactory = scrollBarFactory;
list.verticalScrollBarFactory = scrollBarFactory;
}
protected function pickerListInitializer(list:PickerList):void
{
list.popUpContentManager = new DropDownPopUpContentManager();
}
protected function pickerListListInitializer(list:List):void
{
this.listInitializer(list);
list.maxHeight = 110;
}
protected function defaultItemRendererInitializer(renderer:BaseDefaultItemRenderer):void
{
const skinSelector:SmartDisplayObjectStateValueSelector = new SmartDisplayObjectStateValueSelector();
skinSelector.defaultValue = this.itemRendererUpSkinTexture;
skinSelector.defaultSelectedValue = this.itemRendererSelectedUpSkinTexture;
skinSelector.setValueForState(this.itemRendererHoverSkinTexture, Button.STATE_HOVER, false);
skinSelector.setValueForState(this.itemRendererSelectedUpSkinTexture, Button.STATE_DOWN, false);
renderer.stateToSkinFunction = skinSelector.updateValue;
renderer.defaultLabelProperties.textFormat = this.defaultTextFormat;
renderer.disabledLabelProperties.textFormat = this.disabledTextFormat;
renderer.horizontalAlign = Button.HORIZONTAL_ALIGN_LEFT;
renderer.iconPosition = Button.ICON_POSITION_LEFT;
renderer.accessoryPosition = BaseDefaultItemRenderer.ACCESSORY_POSITION_RIGHT;
renderer.paddingTop = renderer.paddingBottom = 2;
renderer.paddingRight = renderer.paddingLeft = 6;
renderer.gap = 2;
renderer.minGap = 2;
renderer.accessoryGap = Number.POSITIVE_INFINITY;
renderer.minAccessoryGap = 2;
renderer.minWidth = renderer.minHeight = 22;
}
protected function defaultHeaderOrFooterRendererInitializer(renderer:DefaultGroupedListHeaderOrFooterRenderer):void
{
renderer.backgroundSkin = new Scale9Image(groupedListHeaderBackgroundSkinTextures);
renderer.backgroundSkin.height = 18;
renderer.contentLabelProperties.textFormat = this.defaultTextFormat;
renderer.paddingTop = renderer.paddingBottom = 2;
renderer.paddingRight = renderer.paddingLeft = 6;
renderer.minWidth = renderer.minHeight = 18;
}
protected function calloutInitializer(callout:Callout):void
{
callout.backgroundSkin = new Scale9Image(panelBorderBackgroundSkinTextures);
const arrowSkin:Quad = new Quad(8, 8, 0xff00ff);
arrowSkin.alpha = 0;
callout.topArrowSkin = callout.rightArrowSkin = callout.bottomArrowSkin =
callout.leftArrowSkin = arrowSkin;
callout.paddingTop = callout.paddingBottom = 6;
callout.paddingRight = callout.paddingLeft = 10;
}
protected function headerInitializer(header:Header):void
{
header.backgroundSkin = new Scale9Image(headerBackgroundSkinTextures);
header.minHeight = 22;
header.titleProperties.textFormat = this.headerTitleTextFormat;
header.paddingTop = header.paddingBottom = 4;
header.paddingRight = header.paddingLeft = 6;
header.gap = 2;
header.titleGap = 4;
}
protected function panelHeaderInitializer(header:Header):void
{
header.titleProperties.textFormat = this.headerTitleTextFormat;
header.minHeight = 22;
header.paddingTop = header.paddingBottom = 6;
header.paddingRight = header.paddingLeft = 6;
header.gap = 2;
header.titleGap = 4;
}
protected function root_addedToStageHandler(event:Event):void
{
DisplayObject(event.currentTarget).stage.color = BACKGROUND_COLOR;
}
}
}
|
package
{
import flash.__native.WebGLRenderer;
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.display.BlendMode;
import flash.display.DisplayObject;
import flash.display.Loader;
import flash.display.LoaderInfo;
import flash.display.Sprite;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.geom.Matrix;
import flash.net.URLRequest;
import flash.text.TextField;
/**
* ...
* @author lizhi
*/
public class TestGraphics extends Sprite
{
private var s2:Sprite;
private var matr:Matrix = new Matrix;
private var tf:TextField;
public function TestGraphics()
{
COMPILE::JS{
//SpriteFlexjs.wmode = "gpu batch";
//SpriteFlexjs.renderer = new WebGLRenderer;
}
var s:Sprite = new Sprite;
addChild(s);
//s.graphics.lineStyle(0, 0xff00);
s.graphics.lineStyle(5);
s.graphics.beginFill(0xff0000);
s.graphics.moveTo(200, 0);
s.graphics.curveTo(300, 0, 300, 100);
addChild(s);
s2 = new Sprite;
addChild(s2);
s2.graphics.beginFill(0xff00ff);
s2.graphics.lineStyle(0, 0xffff);
s2.graphics.drawCircle(0, 0, 50);
//s2.graphics.drawRoundRect( 70, -50, 100, 100, 10, 10);
s2.graphics.drawRoundRectComplex( 70, -50, 100, 100, 10, 20,30,40);
s2.graphics.drawEllipse( 300, 0, 200, 100);
s2.rotation = 30;
addEventListener(Event.ENTER_FRAME, enterFrame);
s2.x = 150;
s2.y = 150;
tf = new TextField;
tf.text = "textfield";
addChild(tf);
tf.y = 200;
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loader_complete);
loader.load(new URLRequest("../../assets/wood.jpg"));
stage.addEventListener(MouseEvent.MOUSE_MOVE, stage_mouseMove);
}
private function stage_mouseMove(e:MouseEvent):void
{
tf.text = e.localX + "," + e.localY;
for (var i:int = 0; i < numChildren;i++ ) {
var c:DisplayObject = getChildAt(i);
if (c.hitTestPoint(e.localX,e.localY)) {
tf.appendText("hittest,")
}
}
}
private function loader_complete(e:Event):void
{
var target:LoaderInfo = e.currentTarget as LoaderInfo;
var bmp:Bitmap = target.content as Bitmap;
var bmd:BitmapData = bmp.bitmapData;
var s3:Sprite = new Sprite;
//s3.blendMode = BlendMode.ADD;
s3.graphics.beginBitmapFill(bmd,matr,true);
s3.graphics.drawRect(20, 20, 100, 100);
addChild(s3);
//s3.graphics.beginFill(0xff0000);
s3.graphics.drawRect(50, 50, 100, 100);
s3.graphics.moveTo(100, 0);
s3.graphics.curveTo(200, 0, 200, 100);
addChild(bmp);
bmp.y = 300;
}
private function enterFrame(e:Event):void
{
matr.rotate(1/180*Math.PI);
}
public function start():void {
}
}
} |
package com.playata.application.ui.elements.background
{
public class UiBackgroundMetrics
{
private var _width:Number;
private var _height:Number;
public function UiBackgroundMetrics(param1:Number, param2:Number)
{
super();
_width = param1;
_height = param2;
}
public function get width() : Number
{
return _width;
}
public function get height() : Number
{
return _height;
}
public function get minX() : Number
{
return 900 - width;
}
public function get minY() : Number
{
return 630 - height;
}
}
}
|
import flash.events.*;
import flash.net.*;
import flash.system.*;
import flash.utils.*;
private var qaLoader:URLLoader = null;
private var qaPerfString:String = "PERF_";
private var oldIrrelevantNumber:Number = 0;
private var newIrrelevantNumber:Number = 0;
// If/when we test on mobile, these will need to be set dynamically.
// Maybe we can generate this file on the fly right before compiling,
// filled in with the needed values, like we did for Flex.
private var server:String = "localhost";
private var port:String = "31671";
public function sayHello():void{
trace("hello");
}
/**
* Sends info. to the server. Pass in an array of objects. Each object
* needs to have a field called "key" and a field called "value".
**/
public function qaSendInfo( key:String, value:String, done:Boolean ):void{
// Only on Windows, we have to add something irrelevant, but different, to the URL or else the
// player won't send it.
// Sometimes the number is the same (e.g. after uploading the last result, getting a complete
// event, then sending another request telling the server everything is done) so loop until it's
// different.
do{
newIrrelevantNumber = new Date().getTime();
}while( newIrrelevantNumber == oldIrrelevantNumber );
var req:URLRequest = new URLRequest( "http://" + server + ":" + port + "?irrelevantNumber=" + newIrrelevantNumber.toString() );
var headers:Array = new Array();
var i:int;
if( qaLoader == null ){
qaLoader = new URLLoader();
qaLoader.addEventListener( flash.events.IOErrorEvent.IO_ERROR, QAHandleError );
qaLoader.addEventListener( flash.events.SecurityErrorEvent.SECURITY_ERROR, QAHandleError );
qaLoader.addEventListener( flash.events.Event.COMPLETE, qaHandleComplete );
}
// When the final data has been successfully sent, we'll send a final "complete" event to the server.
if( done ){
qaLoader.addEventListener( flash.events.Event.COMPLETE, qaHandleCompleteDone );
}
// Create the array of URLRequestHeaders to send.
var key:String = escape( key );
var value:String = value;
headers.push( new URLRequestHeader( key, value ) );
req.requestHeaders = headers;
req.method = "POST";
req.data="";
trace( "request url: " + req.url + ", key: " + key + ", value: " + value );
qaLoader.load( req );
oldIrrelevantNumber = newIrrelevantNumber;
}
private function QAHandleError( e:Event ):void{
trace("QAHandleError");
}
private function qaHandleComplete( e:Event ):void{
trace("QAHandleComplete");
}
// When the final data has been successfully sent, we'll send a final "complete" event to the server.
private function qaHandleCompleteDone( e:Event ):void{
qaSendInfo( [ {key:qaPerfString + "TestingComplete", value:1}], true );
qaLoader.removeEventListener( flash.events.Event.COMPLETE, qaHandleCompleteDone );
}
|
// =================================================================================================
//
// Starling Framework
// Copyright 2011-2014 Gamua. All Rights Reserved.
//
// This program is free software. You can redistribute and/or modify it
// in accordance with the terms of the accompanying license agreement.
//
// =================================================================================================
package starling.filters
{
import flash.display.BitmapDataChannel;
import flash.display3D.Context3D;
import flash.display3D.Context3DProgramType;
import flash.display3D.Context3DTextureFormat;
import flash.display3D.Context3DVertexBufferFormat;
import flash.display3D.Program3D;
import flash.display3D.VertexBuffer3D;
import flash.geom.Matrix3D;
import flash.geom.Point;
import starling.core.RenderSupport;
import starling.core.Starling;
import starling.textures.Texture;
import starling.utils.formatString;
/** The DisplacementMapFilter class uses the pixel values from the specified texture (called
* the displacement map) to perform a displacement of an object. You can use this filter
* to apply a warped or mottled effect to any object that inherits from the DisplayObject
* class.
*
* <p>The filter uses the following formula:</p>
* <listing>dstPixel[x, y] = srcPixel[x + ((componentX(x, y) - 128) * scaleX) / 256,
* y + ((componentY(x, y) - 128) * scaleY) / 256]
* </listing>
*
* <p>Where <code>componentX(x, y)</code> gets the componentX property color value from the
* map texture at <code>(x - mapPoint.x, y - mapPoint.y)</code>.</p>
*/
public class DisplacementMapFilter extends FragmentFilter
{
private var mMapTexture:Texture;
private var mMapPoint:Point;
private var mComponentX:uint;
private var mComponentY:uint;
private var mScaleX:Number;
private var mScaleY:Number;
private var mRepeat:Boolean;
private var mShaderProgram:Program3D;
private var mMapTexCoordBuffer:VertexBuffer3D;
/** Helper objects */
private static var sOneHalf:Vector.<Number> = new <Number>[0.5, 0.5, 0.5, 0.5];
private static var sMapTexCoords:Vector.<Number> = new <Number>[0, 0, 1, 0, 0, 1, 1, 1];
private static var sMatrix:Matrix3D = new Matrix3D();
private static var sMatrixData:Vector.<Number> =
new <Number>[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
/** Creates a new displacement map filter that uses the provided map texture. */
public function DisplacementMapFilter(mapTexture:Texture, mapPoint:Point=null,
componentX:uint=0, componentY:uint=0,
scaleX:Number=0.0, scaleY:Number=0.0,
repeat:Boolean=false)
{
mMapTexture = mapTexture;
mMapPoint = new Point();
mComponentX = componentX;
mComponentY = componentY;
mScaleX = scaleX;
mScaleY = scaleY;
mRepeat = repeat;
this.mapPoint = mapPoint;
super();
}
/** @inheritDoc */
public override function dispose():void
{
if (mMapTexCoordBuffer) mMapTexCoordBuffer.dispose();
super.dispose();
}
/** @private */
protected override function createPrograms():void
{
// the texture coordinates for the map texture are uploaded via a separate buffer
if (mMapTexCoordBuffer) mMapTexCoordBuffer.dispose();
mMapTexCoordBuffer = Starling.context.createVertexBuffer(4, 2);
var target:Starling = Starling.current;
var mapFlags:String = RenderSupport.getTextureLookupFlags(
mapTexture.format, mapTexture.mipMapping, mapTexture.repeat);
var inputFlags:String = RenderSupport.getTextureLookupFlags(
Context3DTextureFormat.BGRA, false, mRepeat);
var programName:String = formatString("DMF_m{0}_i{1}", mapFlags, inputFlags);
if (target.hasProgram(programName))
{
mShaderProgram = target.getProgram(programName);
}
else
{
// vc0-3: mvpMatrix
// va0: vertex position
// va1: input texture coords
// va2: map texture coords
var vertexShader:String = [
"m44 op, va0, vc0", // 4x4 matrix transform to output space
"mov v0, va1", // pass input texture coordinates to fragment program
"mov v1, va2" // pass map texture coordinates to fragment program
].join("\n");
// v0: input texCoords
// v1: map texCoords
// fc0: OneHalf
// fc1-4: matrix
var fragmentShader:String = [
"tex ft0, v1, fs1 " + mapFlags, // read map texture
"sub ft1, ft0, fc0", // subtract 0.5 -> range [-0.5, 0.5]
"m44 ft2, ft1, fc1", // multiply matrix with displacement values
"add ft3, v0, ft2", // add displacement values to texture coords
"tex oc, ft3, fs0 " + inputFlags // read input texture at displaced coords
].join("\n");
mShaderProgram = target.registerProgramFromSource(programName,
vertexShader, fragmentShader);
}
}
/** @private */
protected override function activate(pass:int, context:Context3D, texture:Texture):void
{
// already set by super class:
//
// vertex constants 0-3: mvpMatrix (3D)
// vertex attribute 0: vertex position (FLOAT_2)
// vertex attribute 1: texture coordinates (FLOAT_2)
// texture 0: input texture
updateParameters(texture.nativeWidth, texture.nativeHeight);
context.setVertexBufferAt(2, mMapTexCoordBuffer, 0, Context3DVertexBufferFormat.FLOAT_2);
context.setProgramConstantsFromVector(Context3DProgramType.FRAGMENT, 0, sOneHalf);
context.setProgramConstantsFromMatrix(Context3DProgramType.FRAGMENT, 1, sMatrix, true);
context.setTextureAt(1, mMapTexture.base);
context.setProgram(mShaderProgram);
}
/** @private */
override protected function deactivate(pass:int, context:Context3D, texture:Texture):void
{
context.setVertexBufferAt(2, null);
context.setTextureAt(1, null);
}
private function updateParameters(textureWidth:int, textureHeight:int):void
{
// matrix:
// Maps RGBA values of map texture to UV-offsets in input texture.
var scale:Number = Starling.contentScaleFactor;
var columnX:int, columnY:int;
for (var i:int=0; i<16; ++i)
sMatrixData[i] = 0;
if (mComponentX == BitmapDataChannel.RED) columnX = 0;
else if (mComponentX == BitmapDataChannel.GREEN) columnX = 1;
else if (mComponentX == BitmapDataChannel.BLUE) columnX = 2;
else columnX = 3;
if (mComponentY == BitmapDataChannel.RED) columnY = 0;
else if (mComponentY == BitmapDataChannel.GREEN) columnY = 1;
else if (mComponentY == BitmapDataChannel.BLUE) columnY = 2;
else columnY = 3;
sMatrixData[int(columnX * 4 )] = mScaleX * scale / textureWidth;
sMatrixData[int(columnY * 4 + 1)] = mScaleY * scale / textureHeight;
sMatrix.copyRawDataFrom(sMatrixData);
// vertex buffer: (containing map texture coordinates)
// The size of input texture and map texture may be different. We need to calculate
// the right values for the texture coordinates at the filter vertices.
var mapX:Number = mMapPoint.x / mapTexture.width;
var mapY:Number = mMapPoint.y / mapTexture.height;
var maxU:Number = textureWidth / (mapTexture.width * scale);
var maxV:Number = textureHeight / (mapTexture.height * scale);
sMapTexCoords[0] = -mapX; sMapTexCoords[1] = -mapY;
sMapTexCoords[2] = -mapX + maxU; sMapTexCoords[3] = -mapY;
sMapTexCoords[4] = -mapX; sMapTexCoords[5] = -mapY + maxV;
sMapTexCoords[6] = -mapX + maxU; sMapTexCoords[7] = -mapY + maxV;
mMapTexture.adjustTexCoords(sMapTexCoords);
mMapTexCoordBuffer.uploadFromVector(sMapTexCoords, 0, 4);
}
// properties
/** Describes which color channel to use in the map image to displace the x result.
* Possible values are constants from the BitmapDataChannel class. */
public function get componentX():uint { return mComponentX; }
public function set componentX(value:uint):void { mComponentX = value; }
/** Describes which color channel to use in the map image to displace the y result.
* Possible values are constants from the BitmapDataChannel class. */
public function get componentY():uint { return mComponentY; }
public function set componentY(value:uint):void { mComponentY = value; }
/** The multiplier used to scale the x displacement result from the map calculation. */
public function get scaleX():Number { return mScaleX; }
public function set scaleX(value:Number):void { mScaleX = value; }
/** The multiplier used to scale the y displacement result from the map calculation. */
public function get scaleY():Number { return mScaleY; }
public function set scaleY(value:Number):void { mScaleY = value; }
/** The texture that will be used to calculate displacement. */
public function get mapTexture():Texture { return mMapTexture; }
public function set mapTexture(value:Texture):void
{
if (mMapTexture != value)
{
mMapTexture = value;
createPrograms();
}
}
/** A value that contains the offset of the upper-left corner of the target display
* object from the upper-left corner of the map image. */
public function get mapPoint():Point { return mMapPoint; }
public function set mapPoint(value:Point):void
{
if (value) mMapPoint.setTo(value.x, value.y);
else mMapPoint.setTo(0, 0);
}
/** Indicates how the pixels at the edge of the input image (the filtered object) will
* be wrapped at the edge. */
public function get repeat():Boolean { return mRepeat; }
public function set repeat(value:Boolean):void
{
if (mRepeat != value)
{
mRepeat = value;
createPrograms();
}
}
}
} |
package
{
// helper function for linear interpolation
public function lerp(a:Number, b:Number, t:Number):Number
{
return a + (b - a) * t;
}
}
|
////////////////////////////////////////////////////////////////////////////////
//
// Licensed to the Apache Software Foundation (ASF) under one or more
// contributor license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright ownership.
// The ASF licenses this file to You under the Apache License, Version 2.0
// (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////
package mx.skins.halo
{
import flash.display.Graphics;
import mx.skins.ProgrammaticSkin;
import mx.utils.ColorUtil;
/**
* The skin for the column drop indicator in a DataGrid.
*
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
* @productversion Flex 3
*/
public class DataGridColumnDropIndicator extends ProgrammaticSkin
{
include "../../core/Version.as";
//--------------------------------------------------------------------------
//
// Constructor
//
//--------------------------------------------------------------------------
/**
* Constructor.
*
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
* @productversion Flex 3
*/
public function DataGridColumnDropIndicator()
{
super();
}
//--------------------------------------------------------------------------
//
// Overridden methods
//
//--------------------------------------------------------------------------
/**
* @private
*/
override protected function updateDisplayList(w:Number, h:Number):void
{
super.updateDisplayList(w, h);
var g:Graphics = graphics;
g.clear();
g.lineStyle(1, getStyle("rollOverColor"));
g.moveTo(0, 0);
g.lineTo(0, h);
g.lineStyle(1, ColorUtil.adjustBrightness(getStyle("themeColor"), -75));
g.moveTo(1, 0);
g.lineTo(1, h);
g.lineStyle(1, getStyle("rollOverColor"));
g.moveTo(2, 0);
g.lineTo(2, h);
}
}
}
|
/*
* Copyright (c) 2005 Pablo Costantini (www.luminicbox.com). All rights reserved.
*
* Licensed under the MOZILLA PUBLIC LICENSE, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.mozilla.org/MPL/MPL-1.1.html
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import LuminicBox.Log.Level;
/**
* Represents a log message with information about the object to inspect, its level, the originator logger and other information.<br />
* THIS CLASS IS USED INTERNALLY. It should only be used when implementing publishers.
*/
class LuminicBox.Log.LogEvent {
/**
* The event's timetamp.
*/
var time:Date;
/**
* The originator logger id.
*/
var loggerId:String;
/**
* The message level.
*/
var level:Level;
/**
* The message or object
*/
var argument:Object;
/**
* Creates a LogEvent instance.
* @param loggerId The originators logged id. It may be null.
* @param argument The message or object to log.
* @param level The level of the event.
*/
function LogEvent(loggerId:String, argument:Object, level:Level) {
this.loggerId = loggerId;
this.argument = argument;
this.level = level;
time = new Date();
}
/**
* Serializes the LogEvent object into an object that can be passed to LocalConnection or similar objects.
* @param logEvent A LogEvent obj.
* @returns A serialized LogEvent obj.
*/
static function serialize(logEvent:LogEvent):Object {
var o:Object = new Object();
o.loggerId = logEvent.loggerId;
o.time = logEvent.time;
o.levelName = logEvent.level.getName();
o.argument = logEvent.argument;
return o;
}
/**
* Deseriliazes a serialized LogEvent object into a LogEvent obj.
* @param o The serialized LogEvent obj.
* @returns A LogEvent obj.
*/
static function deserialize(o:Object):LogEvent {
var l:Level = LuminicBox.Log.Level[""+o.levelName];
var e:LogEvent = new LogEvent(o.loggerId, o.argument, l);
e.time = o.time;
return e;
}
} |
/*
* =BEGIN CLOSED LICENSE
*
* Copyright (c) 2013-2014 Andras Csizmadia
* http://www.vpmedia.eu
*
* For information about the licensing and copyright please
* contact Andras Csizmadia at andras@vpmedia.eu
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* =END CLOSED LICENSE
*/
package hu.vpmedia.blitting {
import flash.display.BitmapData;
import hu.vpmedia.framework.IBaseSteppable;
/**
* TBD
*/
public class BlitGroup implements IBaseSteppable {
/**
* TBD
*/
public var currentSequence:BlitClip;
/**
* TBD
*/
public var sequences:Vector.<BlitClip>;
/**
* TBD
*/
public function BlitGroup(defaultSequence:BlitClip = null) {
sequences = new Vector.<BlitClip>();
if (defaultSequence)
addSequence(defaultSequence);
}
/**
* TBD
*/
public function play(animationName:String):void {
var newSequence:BlitClip = getSequenceByName(animationName);
if (!newSequence || newSequence.name == currentSequence.name)
return;
currentSequence = newSequence;
currentSequence.currentFrame = 0;
}
/**
* TBD
*/
public function addSequence(bitmapSequence:BlitClip):void {
sequences.push(bitmapSequence);
if (!currentSequence)
currentSequence = bitmapSequence;
}
/**
* TBD
*/
public function getSequenceByName(name:String):BlitClip {
for each (var sequence:BlitClip in sequences) {
if (sequence.name == name)
return sequence;
}
return null;
}
/**
* TBD
*/
public function setCanvas(value:BitmapData):void {
for each (var sequence:BlitClip in sequences) {
sequence.canvas = value;
}
}
/**
* TBD
*/
public function step(timeDelta:Number):void {
currentSequence.step(timeDelta);
}
}
}
|
package org.flg.soma
{
import org.papervision3d.core.math.*;
import org.papervision3d.core.proto.*;
import org.papervision3d.objects.DisplayObject3D;
import org.papervision3d.materials.ColorMaterial;
import org.papervision3d.objects.primitives.Cylinder;
import org.papervision3d.objects.primitives.Sphere;
import org.papervision3d.objects.primitives.Cone;
public class Axon extends DisplayObject3D
{
protected var mat:MaterialObject3D;
protected var r:Number;
protected var a:Number;
protected var n:Number;
protected var pents:Array;
protected var c:DisplayObject3D;
protected var leds:Array;
protected var m:Array;
protected var flames:Array;
protected var flMat:ColorMaterial;
public function Axon(material:MaterialObject3D,
radius:Number,
angle:Number,
sections:Number,
structure:Boolean = true)
{
var i:Number;
mat = material;
r = radius;
a = angle;
n = sections;
pents = new Array(n+1);
leds = new Array(10);
m = new Array(10);
flames = new Array(24);
c = new DisplayObject3D();
for (i = 0; i < n + 1; i++) {
var pos:Number3D;
var rot:Number;
pos = new Number3D(0,0,r);
pents[i] = new Ngon(material, 5, r/15);
rot = 90 + i * angle / n;
pents[i].rotationY = rot;
pos.rotateY(i * a / n );
pents[i].position = pos;
pents[i].visible = structure;
c.addChild(pents[i]);
flMat = new ColorMaterial(0xff8800);
if (i > 0 && i < 11) {
trace("m[" + (i - 1) + "]");
m[i-1] = new ColorMaterial(0x00ffff);
leds[i-1] = new Sphere(m[i-1], 10);
leds[i-1].rotationY = rot;
pos = new Number3D(0,0,r*0.9);
pos.rotateY(i * a / n );
leds[i-1].position = pos;
c.addChild(leds[i-1]);
if (i > 1 && i < 10) {
var j:Number;
for (j = 0; j < 3; j++) {
var f:Number = (i - 2) * 3 + j;
flames[f] = new Cone(flMat,
j == 1 ? 20 : 10,
j == 1 ? 120 : 60,
3, 3);
flames[f].rotationX = 90 + ((j - 1) * 20);
flames[f].rotationY = rot - 90 - angle/(2*n);
pos = new Number3D(0,0,r*1.05 +
(j == 1 ? 60 : 20));
pos.rotateX((j - 1) * 5);
pos.rotateY(rot-90-angle/(2*n));
flames[f].position = pos;
flames[f].visible = false;
c.addChild(flames[f]);
}
}
}
}
c.z = -r;
addChild(c);
}
public function setLight(led:Number, color:Number):void
{
m[9-led].fillColor = color;
}
public function setRelay(relay:Number, on:Boolean):void
{
flames[23-relay].visible = on;
}
public function displayStructure(structure:Boolean = true):void
{
var i:Number;
for (i = 0; i < n + 1; i++) {
pents[i].visible = structure;
}
}
}
}
|
package net.richardlord.asteroidsember.signals
{
import org.osflash.signals.Signal;
public class Update extends Signal
{
public function Update()
{
super( Number );
}
}
}
|
/* AS3
Copyright 2008
*/
package com.neopets.games.inhouse.ExtremePotatoCounterAS3.game
{
import flash.display.MovieClip;
import flash.display.DisplayObject;
import flash.display.DisplayObjectContainer;
import flash.text.TextField;
import flash.events.Event;
import com.neopets.games.inhouse.ExtremePotatoCounterAS3.game.ExtremePotatoCounterGameScreen;
import com.neopets.util.display.DisplayUtils;
import com.neopets.projects.gameEngine.gui.MenuManager;
/**
* This class lets textfield clips load their text from the game screen object when added.
* In flash 6 this was handled by attaching the text to root.
*
* @langversion ActionScript 3.0
* @playerversion Flash 9.0
* @NP9 Game System
*
* @author David Cary
* @since 1.05.2010
*/
dynamic public class GameScreenText extends MovieClip {
//--------------------------------------
// CLASS CONSTANTS
//--------------------------------------
//--------------------------------------
// VARIABLES
//--------------------------------------
protected var _textField:TextField;
protected var _textID:String;
//--------------------------------------
// CONSTRUCTOR
//--------------------------------------
/**
* @Constructor
*/
public function GameScreenText():void {
// search for a child textfield
var child:DisplayObject;
for(var i:int = 0; i < numChildren; i++) {
child = getChildAt(i);
if(child is TextField) {
_textField = child as TextField;
break;
}
}
}
//--------------------------------------
// GETTER/SETTERS
//--------------------------------------
public function get textID():String { return _textID; }
public function set textID(tag:String) {
_textID = tag;
updateText();
}
public function get textField():TextField { return _textField; }
public function set textField(txt:TextField) {
_textField = txt;
updateText();
}
//--------------------------------------
// PUBLIC METHODS
//--------------------------------------
/**
* @Note: This function tries to set our text from the game screen object.
*/
public function updateText():void {
// validate variables
if(_textField == null || _textID == null) return;
// try checking for the target property
var menus:MenuManager = MenuManager.instance;
var game:MovieClip = menus.getMenuScreen(MenuManager.MENU_GAME_SCR);
if(game != null) {
if(_textID in game) {
_textField.htmlText = String(game[_textID]);
}
}
}
//--------------------------------------
// EVENT HANDLERS
//--------------------------------------
//--------------------------------------
// PRIVATE & PROTECTED INSTANCE METHODS
//--------------------------------------
}
}
|
/*
Copyright aswing.org, see the LICENCE.txt.
*/
package devoron.aswing3d.table.sorter{
import org.aswing.table.TableModel;
/**
* @author iiley
*/
public class Row{
public var modelIndex:int;
public var tableSorter:TableSorter;
public function Row(tableSorter:TableSorter, index:int) {
this.tableSorter = tableSorter;
this.modelIndex = index;
}
public function compareTo(o:*):int {
var row1:int = modelIndex;
var row2:int = (Row(o)).modelIndex;
var sortingColumns:Array = tableSorter.getSortingColumns();
var tableModel:TableModel = tableSorter.getTableModel();
for (var i:int=0; i<sortingColumns.length; i++) {
var directive:Directive = Directive(sortingColumns[i]);
var column:int = directive.column;
var o1:* = tableModel.getValueAt(row1, column);
var o2:* = tableModel.getValueAt(row2, column);
var comparison:int = 0;
// Define null less than everything, except null.
if (o1 == null && o2 == null) {
comparison = 0;
} else if (o1 == null) {
comparison = -1;
} else if (o2 == null) {
comparison = 1;
} else {
var comparator:Function = tableSorter.getComparator(column);
comparison = comparator(o1, o2);
}
if (comparison != 0) {
return directive.direction == TableSorter.DESCENDING ? -comparison : comparison;
}
}
return 0;
}
public function getModelIndex():int{
return modelIndex;
}
}
} |
package
{
import flash.display.MovieClip;
import flash.display.Stage;
import flash.events.Event;
import flash.utils.Timer;
import flash.events.TimerEvent;
import flash.display.StageDisplayState;
import flash.display.StageScaleMode;
import com.mesmotronic.ane.AndroidFullScreen;
public class Game extends MovieClip
{
public var level1: Level;
private var spawn_timer: Timer;
private var restart_dialog: RestartDialog;
private var start_screen: StartScreen;
public function Game()
{
if (!AndroidFullScreen.immersiveMode())
{
stage.displayState = StageDisplayState.FULL_SCREEN;
}
stage.scaleMode = StageScaleMode.NO_BORDER;
//newGame();
getToStartScreen();
}
private function getToStartScreen(): void
{
start_screen = new StartScreen();
stage.addChild(start_screen);
start_screen.addEventListener(Event.COMPLETE, startGame);
}
private function startGame(e: Event): void
{
start_screen.removeEventListener(Event.COMPLETE, startGame);
stage.removeChild(start_screen);
newGame();
}
private function newGame(): void
{
level1 = new Level1();
spawn_timer = new Timer(1000);
spawn_timer.addEventListener(TimerEvent.TIMER, _spawn);
spawn_timer.start();
stage.addChild(level1);
level1.startGame();
addEventListener(Event.DEACTIVATE, _freeze);
addEventListener(Event.ACTIVATE, _unfreeze);
level1.addEventListener(Event.CUT, _lose);
}
private function _lose(e: Event): void
{
level1.removeEventListener(Event.CUT, _lose);
spawn_timer.stop();
removeEventListener(Event.DEACTIVATE, _freeze);
removeEventListener(Event.ACTIVATE, _unfreeze);
stage.removeChild(level1);
level1 = null;
restart_dialog = new RestartDialog();
restart_dialog.addEventListener(Event.COMPLETE, _start_over);
stage.addChild(restart_dialog);
}
private function _start_over(e: Event): void
{
restart_dialog.removeEventListener(Event.COMPLETE, _start_over);
stage.removeChild(restart_dialog);
restart_dialog = null;
newGame();
}
public function _freeze(e: Event): void
{
level1.freeze();
}
public function _unfreeze(e: Event): void
{
level1.unfreeze();
}
private function _spawn(e: TimerEvent)
{
if (level1.getEnemies().length <= 2)
level1.spawnTestEnemies();
}
}
}
|
package cmodule.lua_wrapper
{
const __2E_str38294:int = gstaticInitter.alloc(23,1);
}
|
package com.ankamagames.dofus.network.messages.game.alliance
{
import com.ankamagames.jerakine.network.CustomDataWrapper;
import com.ankamagames.jerakine.network.ICustomDataInput;
import com.ankamagames.jerakine.network.ICustomDataOutput;
import com.ankamagames.jerakine.network.INetworkMessage;
import com.ankamagames.jerakine.network.NetworkMessage;
import com.ankamagames.jerakine.network.utils.FuncTree;
import flash.utils.ByteArray;
public class AllianceCreationStartedMessage extends NetworkMessage implements INetworkMessage
{
public static const protocolId:uint = 389;
public function AllianceCreationStartedMessage()
{
super();
}
override public function get isInitialized() : Boolean
{
return true;
}
override public function getMessageId() : uint
{
return 389;
}
public function initAllianceCreationStartedMessage() : AllianceCreationStartedMessage
{
return this;
}
override public function reset() : void
{
}
override public function pack(output:ICustomDataOutput) : void
{
var data:ByteArray = new ByteArray();
this.serialize(new CustomDataWrapper(data));
writePacket(output,this.getMessageId(),data);
}
override public function unpack(input:ICustomDataInput, length:uint) : void
{
this.deserialize(input);
}
override public function unpackAsync(input:ICustomDataInput, length:uint) : FuncTree
{
var tree:FuncTree = new FuncTree();
tree.setRoot(input);
this.deserializeAsync(tree);
return tree;
}
public function serialize(output:ICustomDataOutput) : void
{
}
public function serializeAs_AllianceCreationStartedMessage(output:ICustomDataOutput) : void
{
}
public function deserialize(input:ICustomDataInput) : void
{
}
public function deserializeAs_AllianceCreationStartedMessage(input:ICustomDataInput) : void
{
}
public function deserializeAsync(tree:FuncTree) : void
{
}
public function deserializeAsyncAs_AllianceCreationStartedMessage(tree:FuncTree) : void
{
}
}
}
|
package flash.net
{
final public class NetGroupInfo extends Object
{
private var m_postingSendDataBytesPerSecond:Number;
private var m_postingSendControlBytesPerSecond:Number;
private var m_postingReceiveDataBytesPerSecond:Number;
private var m_postingReceiveControlBytesPerSecond:Number;
private var m_routingSendBytesPerSecond:Number;
private var m_routingReceiveBytesPerSecond:Number;
private var m_objectReplicationSendBytesPerSecond:Number;
private var m_objectReplicationReceiveBytesPerSecond:Number;
public function NetGroupInfo(param1:Number, param2:Number, param3:Number, param4:Number, param5:Number, param6:Number, param7:Number, param8:Number)
{
this.m_postingSendDataBytesPerSecond = param1;
this.m_postingSendControlBytesPerSecond = param2;
this.m_postingReceiveDataBytesPerSecond = param3;
this.m_postingReceiveControlBytesPerSecond = param4;
this.m_routingSendBytesPerSecond = param5;
this.m_routingReceiveBytesPerSecond = param6;
this.m_objectReplicationSendBytesPerSecond = param7;
this.m_objectReplicationReceiveBytesPerSecond = param8;
return;
}// end function
public function get postingSendDataBytesPerSecond() : Number
{
return this.m_postingSendDataBytesPerSecond;
}// end function
public function get postingSendControlBytesPerSecond() : Number
{
return this.m_postingSendControlBytesPerSecond;
}// end function
public function get postingReceiveDataBytesPerSecond() : Number
{
return this.m_postingReceiveDataBytesPerSecond;
}// end function
public function get postingReceiveControlBytesPerSecond() : Number
{
return this.m_postingReceiveControlBytesPerSecond;
}// end function
public function get routingSendBytesPerSecond() : Number
{
return this.m_routingSendBytesPerSecond;
}// end function
public function get routingReceiveBytesPerSecond() : Number
{
return this.m_routingReceiveBytesPerSecond;
}// end function
public function get objectReplicationSendBytesPerSecond() : Number
{
return this.m_objectReplicationSendBytesPerSecond;
}// end function
public function get objectReplicationReceiveBytesPerSecond() : Number
{
return this.m_objectReplicationReceiveBytesPerSecond;
}// end function
public function toString() : String
{
return "postingSendDataBytesPerSecond=" + this.m_postingSendDataBytesPerSecond + " postingSendControlBytesPerSecond=" + this.m_postingSendControlBytesPerSecond + " postingReceiveDataBytesPerSecond=" + this.m_postingReceiveDataBytesPerSecond + " postingReceiveControlBytesPerSecond=" + this.m_postingReceiveControlBytesPerSecond + " routingSendBytesPerSecond=" + this.m_routingSendBytesPerSecond + " routingReceiveBytesPerSecond=" + this.m_routingReceiveBytesPerSecond + " objectReplicationSendBytesPerSecond=" + this.m_objectReplicationSendBytesPerSecond + " objectReplicationReceiveBytesPerSecond=" + this.m_objectReplicationReceiveBytesPerSecond;
}// end function
}
}
|
package com.axiomalaska.integratedlayers.models.presentation_data
{
public class ModuleIcons
{
public static const forest:String = 'FOREST';
public static const water:String = 'WATER';
public static const land_features:String = 'LAND_FEATURES';
public static const coverages:String = 'COVERAGES';
public static const weather_sensors:String = 'WEATHER_SENSORS';
public static const fish:String = 'FISH';
public static const birds:String = 'BIRDS';
public static const mammals:String = 'MAMMALS';
public static const contaminants:String = 'CONTAMINANTS';
public static const human_use:String = 'HUMAN_USE';
public static const land_use:String = 'LAND_USE';
public static const transportation:String = 'TRANSPORTATION';
public static const shore_zone:String = 'SHORE_ZONE';
}
} |
package com.company.assembleegameclient.objects {
import com.company.assembleegameclient.game.GameSprite;
import com.company.assembleegameclient.ui.panels.Panel;
import kabam.rotmg.characters.reskin.view.ReskinPanel;
public class ReskinVendor extends GameObject implements IInteractiveObject {
public function ReskinVendor(objectXML:XML) {
super(objectXML);
isInteractive_ = true;
}
public function getPanel(gs:GameSprite):Panel {
return new ReskinPanel(gs);
}
}
}
|
package
{
import Shared.GlobalFunc;
import flash.display.MovieClip;
import flash.text.TextField;
public class ConfirmPanelComponentSourceEntry extends MovieClip
{
public var textField:TextField;
private var XBufferBeforeComponentsC = 1;
private var EntriesA:Array;
private var ItemCount:uint;
private var ItemName:String;
private var OriginalWidth:Number;
private var OriginalY:Number;
public function ConfirmPanelComponentSourceEntry(param1:String)
{
super();
this.EntriesA = new Array();
this.ItemName = param1;
}
public function get itemCount() : uint
{
return this.ItemCount;
}
public function set itemCount(param1:uint) : *
{
this.ItemCount = param1;
this.UpdateText();
}
public function get itemName() : String
{
return this.ItemName;
}
public function get numComponents() : uint
{
return this.EntriesA.length;
}
public function get originalY() : Number
{
return this.OriginalY;
}
public function set originalY(param1:Number) : *
{
this.OriginalY = param1;
}
public function get textWidth() : Number
{
return this.textField.textWidth;
}
public function get textFieldWidth() : Number
{
return this.textField.width;
}
public function set textFieldWidth(param1:*) : *
{
var _loc2_:* = param1 - this.textField.width;
this.textField.width = param1;
this.textField.x = this.textField.x - _loc2_;
}
public function AddComponent(param1:String, param2:uint, param3:uint = 4.294967295E9) : *
{
var _loc4_:* = null;
var _loc5_:* = this.EntriesA.length;
var _loc6_:* = 0;
while(_loc6_ < _loc5_)
{
if(this.EntriesA[_loc6_].componentName == param1)
{
_loc4_ = this.EntriesA[_loc6_];
break;
}
_loc6_++;
}
if(_loc4_ == null)
{
_loc4_ = new ConfirmPanelComponentEntry(param1);
addChild(_loc4_);
this.EntriesA.push(_loc4_);
}
_loc4_.componentRequiredCount = _loc4_.componentRequiredCount + param2;
_loc4_.componentInventoryCount = param3;
}
public function Clip(param1:Number, param2:Number) : Boolean
{
var _loc8_:* = undefined;
var _loc3_:Boolean = false;
var _loc4_:Number = param1 - y;
var _loc5_:Number = param2 - y;
this.textField.visible = this.textField.y >= _loc4_ && this.textField.y + this.textField.textHeight <= _loc5_;
var _loc6_:* = this.EntriesA.length;
var _loc7_:* = 0;
while(_loc7_ < _loc6_)
{
_loc8_ = this.EntriesA[_loc7_] as ConfirmPanelComponentEntry;
if(_loc8_.y < _loc4_ - 1)
{
_loc8_.visible = false;
}
else if(_loc8_.y + _loc8_.height > _loc5_)
{
_loc8_.visible = false;
_loc3_ = true;
}
else
{
_loc8_.visible = true;
}
_loc7_++;
}
return _loc3_;
}
public function GetComponentOriginalY(param1:uint) : Number
{
var _loc2_:* = this.EntriesA[0] as ConfirmPanelComponentEntry;
return this.OriginalY + param1 * _loc2_.height;
}
public function UpdateList() : *
{
var _loc4_:* = undefined;
var _loc1_:* = 0;
var _loc2_:* = this.EntriesA.length;
var _loc3_:* = 0;
while(_loc3_ < _loc2_)
{
_loc4_ = this.EntriesA[_loc3_] as ConfirmPanelComponentEntry;
_loc4_.x = this.textField.width + this.textField.x + this.XBufferBeforeComponentsC;
_loc4_.y = _loc1_;
_loc1_ = _loc1_ + _loc4_.height;
_loc3_++;
}
}
public function UpdateText() : *
{
if(this.ItemCount > 1)
{
GlobalFunc.SetText(this.textField,this.ItemName + " (" + this.ItemCount.toString() + ")",false);
}
else
{
GlobalFunc.SetText(this.textField,this.ItemName,false);
}
}
}
}
|
package {
import flash.display.Sprite;
import flash.utils.*;
import flash.events.Event;
import elements.*;
public class Main extends Sprite {
private const groundY = 600;
public function Main():void {
spawn('wall', 700);
setInterval(function(){
spawn('footbot', 0)
}, 1300);
addEventListener(CustomEvent.ON_DIE, handler_ON_DIE);
addEventListener(CustomEvent.ON_DESTROY, handler_ON_DESTROY);
}
private function handler_ON_DIE(event){
event.target.doDie(function () {
removeEventListener(CustomEvent.ON_SHOOT, event.target.handler_ON_SHOOT);
removeChild(event.target);
});
}
private function handler_ON_DESTROY(event){
removeChild(event.target);
}
public function spawn(type:String, x:Number, y:Number = groundY) {
var obj;
switch (type.toLowerCase()) {
case 'wall':
obj = new Wall(x, groundY);
addEventListener(CustomEvent.ON_MOVE, obj.handler_ON_MOVE);
addEventListener(CustomEvent.ON_DIE, obj.handler_ON_DIE);s
break;
case 'footbot':
obj = new FootBot(x, groundY);
addEventListener(CustomEvent.ON_SHOOT, obj.handler_ON_SHOOT);
break;
default:
throw new Error('Unknow spawn type requested');
}
return addChild(obj);
}
}
}
|
package flashx.textLayout.conversion
{
public interface ITextLayoutImporter extends ITextImporter
{
function get imageSourceResolveFunction() : Function;
function set imageSourceResolveFunction(param1:Function) : void;
}
}
|
/* Compile using: mxmlc --target-player=10.0.0 -static-link-runtime-shared-libraries=true -library-path+=lib ZeroClipboardPdf.as */
package {
import flash.display.Stage;
import flash.display.Sprite;
import flash.display.LoaderInfo;
import flash.display.StageScaleMode;
import flash.events.*;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.external.ExternalInterface;
import flash.system.Security;
import flash.utils.*;
import flash.system.System;
import flash.net.FileReference;
import flash.net.FileFilter;
/* PDF imports */
import org.alivepdf.pdf.PDF;
import org.alivepdf.data.Grid;
import org.alivepdf.data.GridColumn;
import org.alivepdf.layout.Orientation;
import org.alivepdf.layout.Size;
import org.alivepdf.layout.Unit;
import org.alivepdf.display.Display;
import org.alivepdf.saving.Method;
import org.alivepdf.fonts.FontFamily;
import org.alivepdf.fonts.Style;
import org.alivepdf.fonts.CoreFont;
import org.alivepdf.colors.RGBColor;
public class ZeroClipboard extends Sprite {
private var domId:String = '';
private var button:Sprite;
private var clipText:String = 'blank';
private var fileName:String = '';
private var action:String = 'copy';
private var incBom:Boolean = true;
private var charSet:String = 'utf8';
public function ZeroClipboard() {
// constructor, setup event listeners and external interfaces
stage.scaleMode = StageScaleMode.EXACT_FIT;
flash.system.Security.allowDomain("*");
// import flashvars
var flashvars:Object = LoaderInfo( this.root.loaderInfo ).parameters;
domId = flashvars.id;
// invisible button covers entire stage
button = new Sprite();
button.buttonMode = true;
button.useHandCursor = true;
button.graphics.beginFill(0x00FF00);
button.graphics.drawRect(0, 0, stage.stageWidth, stage.stageHeight);
button.alpha = 0.0;
addChild(button);
button.addEventListener(MouseEvent.CLICK, function(event:Event):void {
clickHandler(event);
} );
button.addEventListener(MouseEvent.MOUSE_OVER, function(event:Event):void {
ExternalInterface.call( 'ZeroClipboard.dispatch', domId, 'mouseOver', null );
} );
button.addEventListener(MouseEvent.MOUSE_OUT, function(event:Event):void {
ExternalInterface.call( 'ZeroClipboard.dispatch', domId, 'mouseOut', null );
} );
button.addEventListener(MouseEvent.MOUSE_DOWN, function(event:Event):void {
ExternalInterface.call( 'ZeroClipboard.dispatch', domId, 'mouseDown', null );
} );
button.addEventListener(MouseEvent.MOUSE_UP, function(event:Event):void {
ExternalInterface.call( 'ZeroClipboard.dispatch', domId, 'mouseUp', null );
} );
// External functions - readd whenever the stage is made active for IE
addCallbacks();
stage.addEventListener(Event.ACTIVATE, addCallbacks);
// signal to the browser that we are ready
ExternalInterface.call( 'ZeroClipboard.dispatch', domId, 'load', null );
}
public function addCallbacks ():void {
ExternalInterface.addCallback("setHandCursor", setHandCursor);
ExternalInterface.addCallback("clearText", clearText);
ExternalInterface.addCallback("setText", setText);
ExternalInterface.addCallback("appendText", appendText);
ExternalInterface.addCallback("setFileName", setFileName);
ExternalInterface.addCallback("setAction", setAction);
ExternalInterface.addCallback("setCharSet", setCharSet);
ExternalInterface.addCallback("setBomInc", setBomInc);
}
public function setCharSet(newCharSet:String):void {
if ( newCharSet == 'UTF16LE' ) {
charSet = newCharSet;
} else {
charSet = 'UTF8';
}
}
public function setBomInc(newBomInc:Boolean):void {
incBom = newBomInc;
}
public function clearText():void {
clipText = '';
}
public function appendText(newText:String):void {
clipText += newText;
}
public function setText(newText:String):void {
clipText = newText;
}
public function setFileName(newFileName:String):void {
fileName = newFileName;
}
public function setAction(newAction:String):void {
action = newAction;
}
public function setHandCursor(enabled:Boolean):void {
// control whether the hand cursor is shown on rollover (true)
// or the default arrow cursor (false)
button.useHandCursor = enabled;
}
private function clickHandler(event:Event):void {
var fileRef:FileReference = new FileReference();
fileRef.addEventListener(Event.COMPLETE, saveComplete);
if ( action == "save" ) {
/* Save as a file */
if ( charSet == 'UTF16LE' ) {
fileRef.save( strToUTF16LE(clipText), fileName );
} else {
fileRef.save( strToUTF8(clipText), fileName );
}
} else if ( action == "pdf" ) {
/* Save as a PDF */
var pdf:PDF = configPdf();
fileRef.save( pdf.save( Method.LOCAL ), fileName );
} else {
/* Copy the text to the clipboard. Note charset and BOM have no effect here */
System.setClipboard( clipText );
ExternalInterface.call( 'ZeroClipboard.dispatch', domId, 'complete', clipText );
}
}
private function saveComplete(event:Event):void {
ExternalInterface.call( 'ZeroClipboard.dispatch', domId, 'complete', clipText );
}
private function getProp( prop:String, opts:Array ):String
{
var i:int, iLen:int;
for ( i=0, iLen=opts.length ; i<iLen ; i++ )
{
if ( opts[i].indexOf( prop+":" ) != -1 )
{
return opts[i].replace( prop+":", "" );
}
}
return "";
}
private function configPdf():PDF
{
var
pdf:PDF,
i:int, iLen:int,
splitText:Array = clipText.split("--/TableToolsOpts--\n"),
opts:Array = splitText[0].split("\n"),
dataIn:Array = splitText[1].split("\n"),
aColRatio:Array = getProp( 'colWidth', opts ).split('\t'),
title:String = getProp( 'title', opts ),
message:String = getProp( 'message', opts ),
orientation:String = getProp( 'orientation', opts ),
size:String = getProp( 'size', opts ),
iPageWidth:int = 0,
dataOut:Array = [],
columns:Array = [],
headers:Array,
y:int = 0;
/* Create the PDF */
pdf = new PDF( Orientation[orientation.toUpperCase()], Unit.MM, Size[size.toUpperCase()] );
pdf.setDisplayMode( Display.FULL_WIDTH );
pdf.addPage();
iPageWidth = pdf.getCurrentPage().w-20;
pdf.textStyle( new RGBColor(0), 1 );
/* Add the title / message if there is one */
pdf.setFont( new CoreFont(FontFamily.HELVETICA), 14 );
if ( title != "" )
{
pdf.writeText(11, title+"\n");
}
pdf.setFont( new CoreFont(FontFamily.HELVETICA), 11 );
if ( message != "" )
{
pdf.writeText(11, message+"\n");
}
/* Data setup. Split up the headers, and then construct the columns */
for ( i=0, iLen=dataIn.length ; i<iLen ; i++ )
{
if ( dataIn[i] != "" )
{
dataOut.push( dataIn[i].split("\t") );
}
}
headers = dataOut.shift();
for ( i=0, iLen=headers.length ; i<iLen ; i++ )
{
columns.push( new GridColumn( " \n"+headers[i]+"\n ", i.toString(), aColRatio[i]*iPageWidth, 'C' ) );
}
var grid:Grid = new Grid(
dataOut, /* 1. data */
iPageWidth, /* 2. width */
100, /* 3. height */
new RGBColor (0xE0E0E0), /* 4. headerColor */
new RGBColor (0xFFFFFF), /* 5. backgroundColor */
true, /* 6. alternateRowColor */
new RGBColor ( 0x0 ), /* 7. borderColor */
.1, /* 8. border alpha */
null, /* 9. joins */
columns /* 10. columns */
);
pdf.addGrid( grid, 0, y );
return pdf;
}
/*
* Function: strToUTF8
* Purpose: Convert a string to the output utf-8
* Returns: ByteArray
* Inputs: String
*/
private function strToUTF8( str:String ):ByteArray {
var utf8:ByteArray = new ByteArray();
/* BOM first */
if ( incBom ) {
utf8.writeByte( 0xEF );
utf8.writeByte( 0xBB );
utf8.writeByte( 0xBF );
}
utf8.writeUTFBytes( str );
return utf8;
}
/*
* Function: strToUTF16LE
* Purpose: Convert a string to the output utf-16
* Returns: ByteArray
* Inputs: String
* Notes: The fact that this function is needed is a little annoying. Basically, strings in
* AS3 are UTF-16 (with surrogate pairs and everything), but characters which take up less
* than 8 bytes appear to be stored as only 8 bytes. This function effective adds the
* padding required, and the BOM
*/
private function strToUTF16LE( str:String ):ByteArray {
var utf16:ByteArray = new ByteArray();
var iChar:uint;
var i:uint=0, iLen:uint = str.length;
/* BOM first */
if ( incBom ) {
utf16.writeByte( 0xFF );
utf16.writeByte( 0xFE );
}
while ( i < iLen ) {
iChar = str.charCodeAt(i);
if ( iChar < 0xFF ) {
/* one byte char */
utf16.writeByte( iChar );
utf16.writeByte( 0 );
} else {
/* two byte char */
utf16.writeByte( iChar & 0x00FF );
utf16.writeByte( iChar >> 8 );
}
i++;
}
return utf16;
}
}
}
|
////////////////////////////////////////////////////////////////////////////////
//
// Licensed to the Apache Software Foundation (ASF) under one or more
// contributor license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright ownership.
// The ASF licenses this file to You under the Apache License, Version 2.0
// (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////
package
{
/**
* @private
* In some projects, this class is used to link additional classes
* into the SWC beyond those that are found by dependency analysis
* starting from the classes specified in manifest.xml.
* This project has no manifest file (because there are no MXML tags
* corresponding to any classes in it) so all the classes linked into
* the SWC are found by a dependency analysis starting from the classes
* listed here.
*/
internal class ZenClasses
{
import zen.skins.ApplicationSkin; ApplicationSkin;
import zen.skins.BorderSkin; BorderSkin;
import zen.skins.ButtonBarFirstButtonSkin; ButtonBarFirstButtonSkin;
import zen.skins.ButtonBarLastButtonSkin; ButtonBarLastButtonSkin;
import zen.skins.ButtonBarMiddleButtonSkin; ButtonBarMiddleButtonSkin;
import zen.skins.ButtonBarSkin; ButtonBarSkin;
import zen.skins.ButtonSkin; ButtonSkin;
import zen.skins.CheckBoxSkin; CheckBoxSkin;
import zen.skins.ComboBoxButtonSkin; ComboBoxButtonSkin;
import zen.skins.ComboBoxSkin; ComboBoxSkin;
import zen.skins.ComboBoxTextInputSkin; ComboBoxTextInputSkin;
import zen.skins.DefaultButtonSkin; DefaultButtonSkin;
import zen.skins.DefaultComplexItemRenderer; DefaultComplexItemRenderer;
import zen.skins.DefaultItemRenderer; DefaultItemRenderer;
import zen.skins.DropDownListButtonSkin; DropDownListButtonSkin;
import zen.skins.DropDownListSkin; DropDownListSkin;
import zen.skins.HScrollBarSkin; HScrollBarSkin;
import zen.skins.HScrollBarThumbSkin; HScrollBarThumbSkin;
import zen.skins.HScrollBarTrackSkin; HScrollBarTrackSkin;
import zen.skins.HSliderSkin; HSliderSkin;
import zen.skins.HSliderThumbSkin; HSliderThumbSkin;
import zen.skins.HSliderTrackSkin; HSliderTrackSkin;
import zen.skins.ListSkin; ListSkin;
import zen.skins.NumericStepperSkin; NumericStepperSkin;
import zen.skins.NumericStepperTextInputSkin; NumericStepperTextInputSkin;
import zen.skins.PanelSkin; PanelSkin;
import zen.skins.RadioButtonSkin; RadioButtonSkin;
import zen.skins.ScrollBarDownButtonSkin; ScrollBarDownButtonSkin;
import zen.skins.ScrollBarLeftButtonSkin; ScrollBarLeftButtonSkin;
import zen.skins.ScrollBarRightButtonSkin; ScrollBarRightButtonSkin;
import zen.skins.ScrollBarUpButtonSkin; ScrollBarUpButtonSkin;
import zen.skins.ScrollerSkin; ScrollerSkin;
import zen.skins.SkinnableContainerSkin; SkinnableContainerSkin;
import zen.skins.SkinnableDataContainerSkin; SkinnableDataContainerSkin;
import zen.skins.SpinnerDecrButtonSkin; SpinnerDecrButtonSkin;
import zen.skins.SpinnerIncrButtonSkin; SpinnerIncrButtonSkin;
import zen.skins.SpinnerSkin; SpinnerSkin;
import zen.skins.TabBarButtonSkin; TabBarButtonSkin;
import zen.skins.TabBarSkin; TabBarSkin;
import zen.skins.TextAreaBorderSkin; TextAreaBorderSkin;
import zen.skins.TextAreaSkin; TextAreaSkin;
import zen.skins.TextInputBorderSkin; TextInputBorderSkin;
import zen.skins.TextInputSkin; TextInputSkin;
import zen.skins.TitleWindowCloseButtonSkin; TitleWindowCloseButtonSkin;
import zen.skins.TitleWindowSkin; TitleWindowSkin;
import zen.skins.ToggleButtonSkin; ToggleButtonSkin;
import zen.skins.VScrollBarSkin; VScrollBarSkin;
import zen.skins.VScrollBarThumbSkin; VScrollBarThumbSkin;
import zen.skins.VScrollBarTrackSkin; VScrollBarTrackSkin;
import zen.skins.VSliderSkin; VSliderSkin;
import zen.skins.VSliderThumbSkin; VSliderThumbSkin;
import zen.skins.VSliderTrackSkin; VSliderTrackSkin;
import zen.skins.VideoPlayerSkin; VideoPlayerSkin;
}
} |
package game.view.arena
{
import game.view.uitils.DisplayMemoryMrg;
import starling.display.DisplayObject;
import starling.display.Sprite;
public class ArenafaceFactory extends Sprite
{
public function ArenafaceFactory()
{
super();
}
public function createFace(type:String):void
{
var face:DisplayObject ;
if(numChildren > 0) face = getChildAt(0);
face && face.removeFromParent();
face = null;
//玩家挑战界面
if(type == "dare")
{
face = DisplayMemoryMrg.instance.getMemory(type,DareFace);
}
else if(type == "convert")//兑换
{
face = DisplayMemoryMrg.instance.getMemory(type,ConvertFace);
}
else if(type == "Battlefield")//战报
{
face = DisplayMemoryMrg.instance.getMemory(type,BattlefieldFace);
(face as BattlefieldFace).send();
}
else if(type == "rank")//排行
{
face = DisplayMemoryMrg.instance.getMemory(type,RankFace);
(face as RankFace).send();
}
else if(type == "Reward")//悬赏
{
face = DisplayMemoryMrg.instance.getMemory(type,RewardFace);
(face as RewardFace).send();
}
if(face)addChild(face);
}
}
} |
package co.sparemind.trackermodule {
public class XMSample {
import flash.utils.ByteArray;
import flash.utils.Endian;
public var volume:uint;
public var finuetune:uint = 0;
// type bitfield: looping, 8-bit/16-bit
public var panning:uint = 0x80;
public var relativeNoteNumber:int = 0;
protected var _name:ByteArray;
public var data:ByteArray;
public var bitsPerSample:uint = 8;
public var finetune:uint = 0;
public var loopStart:uint = 0;
public var loopLength:uint = 0;
public var loopsForward:Boolean = false;
public function XMSample() {
_name = new ByteArray();
_name.endian = Endian.LITTLE_ENDIAN;
this.name = ' ';
}
public function get name():String {
return _name.toString();
}
public function set name(unpadded:String):void {
_name.clear();
_name.writeMultiByte(unpadded.slice(0,22), 'us-ascii');
for (var i:uint = _name.length; i < 22; i++) {
_name.writeByte(0x20); // space-padded
}
}
}
}
|
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is [Open Source Virtual Machine.].
*
* The Initial Developer of the Original Code is
* Adobe System Incorporated.
* Portions created by the Initial Developer are Copyright (C) 2005-2006
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Adobe AS3 Team
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
package test{
public var a = 'PASSED';
public function f() {
var g = "g";
return g;
}
}
package test2{
public function g() {
var h = "h";
return h;
}
public var b = "hello";
}
class C {
import test2.*;
public function returnB() {
return b;
}
}
import test.*;
var SECTION = "Definitions"; // provide a document reference (ie, Actionscript section)
var VERSION = "AS 3.0"; // Version of ECMAScript or ActionScript
var TITLE = "PackageDefinition" //Proved ECMA section titile or a description
var BUGNUMBER = "";
startTest(); // leave this alone
var d = a;
AddTestCase( "import outside of package, variable", "PASSED",d );
AddTestCase( "import outside of package, function", "g", f());
var c = new C();
AddTestCase( "import outside of package, inside class", "hello", c.returnB());
test(); // leave this alone. this executes the test cases and
// displays results.
|
package fairygui
{
/**
* Use for GComponent.childrenRenderOrder
*/
public class ChildrenRenderOrder
{
public static const Ascent:int = 0;
public static const Descent:int = 1;
public static const Arch:int = 2;
}
} |
/**
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package flatspark.enums
{
public class BrandColorEnum
{
public static const Primary:int = 1;
public static const Success:int = 2;
public static const Warning:int = 3;
public static const Inverse:int = 4;
public static const Default:int = 5;
public static const Info:int = 6;
public static const Danger:int = 7;
}
} |
package cmodule.lua_wrapper
{
import avm2.intrinsics.memory.li16;
import avm2.intrinsics.memory.li32;
import avm2.intrinsics.memory.li8;
import avm2.intrinsics.memory.si16;
import avm2.intrinsics.memory.si32;
public final class FSM_ifree extends Machine
{
public function FSM_ifree()
{
super();
}
public static function start() : void
{
var _loc1_:* = 0;
var _loc2_:* = 0;
var _loc3_:* = 0;
var _loc4_:* = 0;
var _loc5_:* = 0;
var _loc6_:* = 0;
var _loc7_:* = 0;
var _loc8_:* = 0;
var _loc9_:int = 0;
mstate.esp -= 4;
si32(mstate.ebp,mstate.esp);
mstate.ebp = mstate.esp;
mstate.esp -= 0;
_loc1_ = int(li32(mstate.ebp + 8));
while(true)
{
_loc3_ = int(_loc1_);
if(_loc3_ == 0)
{
break;
}
_loc1_ = int(li32(_malloc_origo));
_loc2_ = int(_loc3_ >>> 12);
_loc4_ = int(_loc2_ - _loc1_);
_loc5_ = int(_loc3_);
if(uint(_loc4_) < uint(12))
{
break;
}
_loc6_ = int(li32(_last_index));
if(uint(_loc4_) > uint(_loc6_))
{
break;
}
_loc6_ = int(li32(_page_dir));
_loc7_ = _loc4_ << 2;
_loc7_ = int(_loc6_ + _loc7_);
_loc8_ = int(li32(_loc7_));
_loc9_ = _loc6_;
if(uint(_loc8_) <= uint(3))
{
if(_loc8_ == 2)
{
if(_loc8_ != 1)
{
_loc5_ &= 4095;
if(_loc5_ == 0)
{
_loc5_ = 1;
_loc8_ = _loc4_ << 2;
si32(_loc5_,_loc7_);
_loc5_ = int(_loc8_ + _loc9_);
_loc5_ = int(li32(_loc5_ + 4));
if(_loc5_ != 3)
{
_loc1_ = 4096;
}
else
{
_loc5_ = 1;
_loc1_ = int(_loc2_ - _loc1_);
_loc1_ <<= 2;
_loc8_ = int(_loc6_);
do
{
_loc2_ = 1;
_loc4_ = int(_loc1_ + _loc8_);
si32(_loc2_,_loc4_ + 4);
_loc2_ = int(li32(_loc4_ + 8));
_loc8_ += 4;
_loc5_ += 1;
}
while(_loc2_ == 3);
_loc1_ = _loc5_ << 12;
}
_loc5_ = int(_loc1_);
_loc1_ = int(li8(_malloc_junk_2E_b));
_loc1_ ^= 1;
_loc1_ &= 1;
if(_loc1_ == 0)
{
_loc1_ = -48;
_loc8_ = int(_loc3_);
_loc2_ = int(_loc5_);
memset(_loc8_,_loc1_,_loc2_);
}
_loc1_ = int(li8(_malloc_hint_2E_b));
_loc1_ ^= 1;
_loc1_ &= 1;
if(_loc1_ == 0)
{
_loc1_ = int(__2E_str8);
_loc8_ = 4;
_loc2_ = int(_loc8_);
log(_loc2_,mstate.gworker.stringFromPtr(_loc1_));
}
_loc1_ = int(li32(_px));
_loc8_ = int(_loc3_ + _loc5_);
if(_loc1_ != 0)
{
_loc2_ = int(_loc1_);
}
else
{
_loc1_ = 20;
mstate.esp -= 4;
si32(_loc1_,mstate.esp);
mstate.esp -= 4;
FSM_imalloc.start();
_loc1_ = int(mstate.eax);
mstate.esp += 4;
si32(_loc1_,_px);
_loc2_ = int(_loc1_);
}
si32(_loc3_,_loc1_ + 8);
si32(_loc8_,_loc2_ + 12);
si32(_loc5_,_loc2_ + 16);
_loc1_ = int(li32(_free_list));
if(_loc1_ == 0)
{
_loc5_ = int(_free_list);
si32(_loc1_,_loc2_);
si32(_loc5_,_loc2_ + 4);
si32(_loc2_,_free_list);
_loc1_ = 0;
si32(_loc1_,_px);
_loc1_ = int(li32(_loc2_));
if(_loc1_ != 0)
{
_loc1_ = 0;
}
else
{
_loc1_ = 0;
_loc5_ = int(_loc2_);
addr741:
_loc3_ = int(_loc5_);
_loc5_ = int(li32(_loc3_ + 16));
_loc8_ = int(li32(_malloc_cache));
_loc2_ = int(_loc3_ + 16);
if(uint(_loc5_) > uint(_loc8_))
{
_loc5_ = int(li32(_loc3_ + 12));
_loc8_ = int(li32(_malloc_brk));
_loc4_ = int(_loc3_ + 12);
if(_loc5_ == _loc8_)
{
_loc5_ = 0;
_loc5_ = int(_sbrk(_loc5_));
_loc8_ = int(li32(_malloc_brk));
if(_loc5_ == _loc8_)
{
_loc3_ = int(li32(_loc3_ + 8));
_loc5_ = int(li32(_malloc_cache));
_loc3_ += _loc5_;
si32(_loc3_,_loc4_);
si32(_loc5_,_loc2_);
_loc3_ = int(_brk(_loc3_));
_loc3_ = int(li32(_loc4_));
si32(_loc3_,_malloc_brk);
_loc5_ = int(li32(_malloc_origo));
_loc8_ = int(li32(_last_index));
_loc3_ >>>= 12;
_loc2_ = int(_loc3_ - _loc5_);
if(uint(_loc2_) <= uint(_loc8_))
{
_loc3_ -= _loc5_;
_loc5_ = int(li32(_page_dir));
_loc4_ = _loc3_ << 2;
_loc5_ += _loc4_;
do
{
_loc4_ = 0;
si32(_loc4_,_loc5_);
_loc5_ += 4;
_loc3_ += 1;
}
while(uint(_loc3_) <= uint(_loc8_));
}
_loc3_ = int(_loc2_ + -1);
si32(_loc3_,_last_index);
addr926:
if(_loc1_ == 0)
{
break;
}
continue;
}
§§goto(addr926);
}
}
}
§§goto(addr926);
}
else
{
_loc4_ = int(li32(_loc1_ + 12));
if(uint(_loc4_) < uint(_loc3_))
{
do
{
_loc4_ = int(_loc1_);
_loc1_ = int(li32(_loc4_));
if(_loc1_ == 0)
{
_loc1_ = int(_loc4_);
break;
}
_loc4_ = int(li32(_loc1_ + 12));
}
while(uint(_loc4_) < uint(_loc3_));
}
_loc4_ = int(li32(_loc1_ + 8));
_loc6_ = int(_loc1_ + 8);
if(uint(_loc4_) > uint(_loc8_))
{
_loc5_ = 0;
si32(_loc1_,_loc2_);
_loc8_ = int(li32(_loc1_ + 4));
si32(_loc8_,_loc2_ + 4);
si32(_loc2_,_loc1_ + 4);
_loc1_ = int(li32(_loc2_ + 4));
si32(_loc2_,_loc1_);
si32(_loc5_,_px);
_loc1_ = int(_loc2_);
}
else
{
_loc7_ = int(li32(_loc1_ + 12));
_loc9_ = _loc1_ + 12;
if(_loc7_ == _loc3_)
{
_loc8_ = int(_loc7_ + _loc5_);
si32(_loc8_,_loc9_);
_loc2_ = int(li32(_loc1_ + 16));
_loc5_ = int(_loc2_ + _loc5_);
si32(_loc5_,_loc1_ + 16);
_loc2_ = int(li32(_loc1_));
_loc3_ = int(_loc1_ + 16);
_loc4_ = int(_loc1_);
if(_loc2_ != 0)
{
_loc6_ = int(li32(_loc2_ + 8));
if(_loc8_ == _loc6_)
{
_loc8_ = int(li32(_loc2_ + 12));
si32(_loc8_,_loc9_);
_loc8_ = int(li32(_loc2_ + 16));
_loc5_ = int(_loc8_ + _loc5_);
si32(_loc5_,_loc3_);
_loc5_ = int(li32(_loc2_));
si32(_loc5_,_loc4_);
if(_loc5_ == 0)
{
_loc5_ = int(_loc2_);
addr720:
_loc3_ = int(_loc5_);
_loc5_ = int(li32(_loc1_));
if(_loc5_ != 0)
{
_loc1_ = int(_loc3_);
}
else
{
_loc5_ = int(_loc1_);
_loc1_ = int(_loc3_);
§§goto(addr741);
}
§§goto(addr926);
}
else
{
si32(_loc1_,_loc5_ + 4);
_loc5_ = int(_loc2_);
§§goto(addr720);
}
}
else
{
addr595:
}
§§goto(addr720);
}
_loc5_ = 0;
}
else if(_loc4_ == _loc8_)
{
_loc2_ = 0;
_loc8_ = int(li32(_loc1_ + 16));
_loc5_ = int(_loc8_ + _loc5_);
si32(_loc5_,_loc1_ + 16);
si32(_loc3_,_loc6_);
_loc5_ = int(_loc2_);
}
else
{
_loc5_ = int(li32(_loc1_));
_loc3_ = int(_loc1_);
if(_loc5_ == 0)
{
_loc5_ = 0;
si32(_loc5_,_loc2_);
si32(_loc1_,_loc2_ + 4);
si32(_loc2_,_loc3_);
si32(_loc5_,_px);
_loc1_ = int(_loc2_);
}
}
§§goto(addr720);
}
§§goto(addr720);
}
}
break;
}
break;
}
break;
}
_loc1_ = int(li16(_loc8_ + 8));
_loc2_ = int(li16(_loc8_ + 10));
_loc4_ = _loc5_ & 4095;
_loc2_ = int(_loc4_ >>> _loc2_);
_loc4_ = int(_loc8_ + 10);
_loc6_ = int(_loc1_ + -1);
_loc5_ = _loc6_ & _loc5_;
if(_loc5_ != 0)
{
break;
}
_loc5_ = 1;
_loc6_ = _loc2_ & -32;
_loc6_ >>>= 3;
_loc6_ = int(_loc8_ + _loc6_);
_loc2_ &= 31;
_loc7_ = int(li32(_loc6_ + 16));
_loc2_ = _loc5_ << _loc2_;
_loc5_ = int(_loc6_ + 16);
_loc6_ = _loc7_ & _loc2_;
if(_loc6_ != 0)
{
break;
}
_loc6_ = int(li8(_malloc_junk_2E_b));
_loc6_ ^= 1;
_loc6_ &= 1;
if(_loc6_ == 0)
{
_loc6_ = -48;
memset(_loc3_,_loc6_,_loc1_);
}
_loc1_ = int(li32(_loc5_));
_loc1_ |= _loc2_;
si32(_loc1_,_loc5_);
_loc1_ = int(li16(_loc8_ + 12));
_loc2_ = int(_loc1_ + 1);
si16(_loc2_,_loc8_ + 12);
_loc3_ = int(li16(_loc4_));
_loc4_ = int(li32(_page_dir));
_loc3_ <<= 2;
_loc3_ = int(_loc4_ + _loc3_);
if(_loc1_ == 0)
{
_loc1_ = int(li32(_loc3_));
if(_loc1_ == 0)
{
_loc1_ = int(_loc3_);
}
else
{
_loc1_ = int(_loc8_ + 4);
_loc2_ = int(_loc3_);
while(true)
{
_loc3_ = int(li32(_loc2_));
_loc4_ = int(li32(_loc3_));
if(_loc4_ == 0)
{
_loc1_ = int(_loc2_);
break;
}
_loc5_ = int(li32(_loc4_ + 4));
_loc6_ = int(li32(_loc1_));
_loc2_ = int(uint(_loc5_) < uint(_loc6_) ? int(_loc3_) : int(_loc2_));
_loc5_ = int(uint(_loc5_) >= uint(_loc6_) ? 1 : 0);
if(_loc4_ != 0)
{
_loc4_ = _loc5_ & 1;
if(_loc4_ == 0)
{
continue;
}
}
_loc1_ = int(_loc2_);
break;
}
}
_loc2_ = int(li32(_loc1_));
si32(_loc2_,_loc8_);
si32(_loc8_,_loc1_);
break;
}
_loc1_ = int(li16(_loc8_ + 14));
_loc2_ &= 65535;
if(_loc2_ != _loc1_)
{
break;
}
_loc1_ = int(li32(_loc3_));
if(_loc1_ != _loc8_)
{
_loc1_ = int(_loc3_);
do
{
_loc1_ = int(li32(_loc1_));
_loc2_ = int(li32(_loc1_));
}
while(_loc2_ != _loc8_);
}
else
{
_loc1_ = int(_loc3_);
}
_loc2_ = 2;
_loc3_ = int(li32(_loc8_));
si32(_loc3_,_loc1_);
_loc1_ = int(li32(_loc8_ + 4));
_loc3_ = int(li32(_malloc_origo));
_loc1_ >>>= 12;
_loc1_ -= _loc3_;
_loc1_ <<= 2;
_loc1_ = int(_loc4_ + _loc1_);
si32(_loc2_,_loc1_);
_loc1_ = int(li32(_loc8_ + 4));
_loc2_ = int(_loc8_);
if(_loc1_ != _loc8_)
{
mstate.esp -= 4;
si32(_loc2_,mstate.esp);
mstate.esp -= 4;
FSM_ifree.start();
mstate.esp += 4;
}
}
mstate.esp = mstate.ebp;
mstate.ebp = li32(mstate.esp);
mstate.esp += 4;
mstate.esp += 4;
}
}
}
|
////////////////////////////////////////////////////////////////////////////////
//
// Licensed to the Apache Software Foundation (ASF) under one or more
// contributor license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright ownership.
// The ASF licenses this file to You under the Apache License, Version 2.0
// (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////
package mx.automation.delegates.controls
{
import flash.display.DisplayObject;
import mx.automation.Automation;
import mx.automation.IAutomationObject;
import mx.automation.delegates.core.UITextFieldAutomationImpl;
import mx.controls.dataGridClasses.DataGridItemRenderer;
import mx.core.mx_internal;
use namespace mx_internal;
[Mixin]
/**
*
* Defines methods and properties required to perform instrumentation for the
* DataGridItemRenderer class.
*
* @see mx.controls.dataGridClasses.DataGridItemRenderer
*
*
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
* @productversion Flex 3
*/
public class DataGridItemRendererAutomationImpl extends UITextFieldAutomationImpl
{
include "../../../core/Version.as";
//--------------------------------------------------------------------------
//
// Class methods
//
//--------------------------------------------------------------------------
/**
* Registers the delegate class for a component class with automation manager.
*
* @param root The SystemManger of the application.
*
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
* @productversion Flex 3
*/
public static function init(root:DisplayObject):void
{
Automation.registerDelegateClass(DataGridItemRenderer, DataGridItemRendererAutomationImpl);
}
//--------------------------------------------------------------------------
//
// Constructor
//
//--------------------------------------------------------------------------
/**
* Constructor.
* @param obj DataGridItem object to be automated.
*
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
* @productversion Flex 3
*/
public function DataGridItemRendererAutomationImpl(obj:DataGridItemRenderer)
{
super(obj);
}
/**
* @private
*/
protected function get itemRenderer():DataGridItemRenderer
{
return uiTextField as DataGridItemRenderer;
}
}
}
|
// Aphelion (edited by Frikman) \\
#include "CreatureCommon.as";
const u16 ATTACK_FREQUENCY = 60;
const f32 ATTACK_DAMAGE = 1.0f;
const int COINS_ON_DEATH = 20;
void onInit(CBlob@ this)
{
this.set_u8("attack frequency", ATTACK_FREQUENCY);
this.set_f32("attack damage", ATTACK_DAMAGE);
this.set_string("attack sound", "zBisonMad");
this.set_u16("coins on death", COINS_ON_DEATH);
this.set_f32(target_searchrad_property, 512.0f);
this.getShape().SetRotationsAllowed(false);
this.getBrain().server_SetActive(true);
this.set_f32("gib health", -3.5f);
this.Tag("flesh");
this.getCurrentScript().runFlags |= Script::tick_not_attached;
this.getCurrentScript().removeIfTag = "dead";
}
void onTick( CBlob@ this )
{
if (getNet().isClient() && XORRandom(1024) == 0)
{
this.getSprite().PlaySound("/zBisonBoo");
}
if (getNet().isServer() && getGameTime() % 10 == 0)
{
CBlob@ target = this.getBrain().getTarget();
if (target !is null && this.getDistanceTo(target) < 128.0f)
{
this.Tag(chomp_tag);
}
else
{
this.Untag(chomp_tag);
}
this.Sync(chomp_tag, true);
}
}
f32 onHit( CBlob@ this, Vec2f worldPoint, Vec2f velocity, f32 damage, CBlob@ hitterBlob, u8 customData )
{
if (damage >= 0.0f)
{
this.getSprite().PlaySound("/ZombieHit");
}
return damage;
} |
package org.osflash.signals.natives.sets
{
import flash.events.Event;
import flash.events.FileListEvent;
import flash.filesystem.File;
import flash.net.FileReference;
import org.osflash.signals.natives.NativeSignal;
/**
* @author Behrooz Tahanzadeh
*/
public class FileSignalSet extends FileReferenceSignalSet
{
public function FileSignalSet(target:File)
{
super(target);
}
public function get directoryListing():NativeSignal
{
return getNativeSignal(FileListEvent.DIRECTORY_LISTING, FileListEvent);
}
public function get selectMultiple():NativeSignal
{
return getNativeSignal(FileListEvent.SELECT_MULTIPLE, FileListEvent);
}
}//EOC
}//EOP |
////////////////////////////////////////////////////////////////////////////////
//
// Licensed to the Apache Software Foundation (ASF) under one or more
// contributor license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright ownership.
// The ASF licenses this file to You under the Apache License, Version 2.0
// (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////
package UnitTest.Fixtures
{
import flash.events.Event;
import flash.events.IOErrorEvent;
import flash.events.SecurityErrorEvent;
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.net.URLRequestMethod;
import mx.utils.LoaderUtil;
/** Gateway class for reading and caching files used by the test harness code.
*/
public class FileRepository
{
/** Get the named file.
* @param fileName name of the file we're looking for
* @return String that contains the content of the file
*/
static public function getFile(baseURL:String, fileName:String):String
{
return CustomURLLoader.getFile(LoaderUtil.createAbsoluteURL(baseURL,fileName));
}
/** Get the named file as an XML object.
* File will be converted assuming whitespace is significant.
* @param fileName of the file we're looking for
* @return String that contains the content of the file
*/
static public function getFileAsXML(baseURL:String, fileName:String):XML
{
var xmlData:XML = null;
var sourceString:String = getFile(baseURL,fileName);
return sourceString ? convertToXML(sourceString) : null;
}
/** Convert from string to XML */
static private function convertToXML(sourceString:String):XML
{
var xmlData:XML = null;
// Convert string data to XML
var originalSettings:Object = XML.settings();
try
{
XML.ignoreProcessingInstructions = false;
XML.ignoreWhitespace = false;
xmlData = new XML(sourceString);
}
finally
{
XML.setSettings(originalSettings);
}
return xmlData;
}
/**
* Reads in a file and set up a handler for when the file read is complete
*/
static public function readFile(baseURL:String, fileName:String, handler:Function = null, errorHandler:Function = null, securityHandler:Function = null, ignoreWhitespace:Boolean = false): void
{
if (fileName == null || fileName.length <= 0)
return;
var tcURL:URLRequest = new URLRequest(LoaderUtil.createAbsoluteURL(baseURL,fileName));
tcURL.method = URLRequestMethod.GET;
var tcLoader:URLLoader = new CustomURLLoader(handler, errorHandler, securityHandler);
tcLoader.load(tcURL);
}
/**
* Returns true if there are pending requests, false if not
*/
static public function pendingRequests(): Boolean
{
return (CustomURLLoader.requestsPending != 0);
}
}
}
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.events.Event;
import flash.events.SecurityErrorEvent;
import flash.events.IOErrorEvent;
import flashx.textLayout.debug.assert;
/** Serves as a single bottleneck for all requests that go through
* FileRepository. Requests come in as URLLoader.load calls, and we
* always listen for completion, error, and security error. If a handler
* for any of these is passed in when the CustomURLLoader is constructed,
* we will in addition call the handler.
*
* Override URLLoader so we can get the request back when we're
* in a completion function. Also tracks outstanding requests so we
* can block until results are complete.
*/
class CustomURLLoader extends URLLoader
{
public var request: URLRequest; // original request for file load
public var completeHandler:Function; // custom completion handler
public var ioErrorHandler:Function; // custom i/o error handler
public var securityErrorHandler:Function; // custom security error handler
/** Cache containing all files that have been requested.
* The key is the name of the file as given in the original request, and the
* value is the contents of the file as a string. */
static private var _fileCache:Object;
/** Number of file read requests that are pending -- i.e., that have neither
* completed successfully nor returned errors.
*/
static private var _requestsPending:int = 0;
static private var FILE_ERROR:String = "$$$NOT_FOUNDXXX" // unique string to signal file read error
/** Constructor
* Note that if you specify all three handlers, one will be called depending on the outcome of the
* read.
*
* @param completeHandler - custom handler called on successful completion of file read
* @param ioErrorHandler - custom handler called on i/o error of file read
* @param securityErrorHandler - custom handler called on security error of file read
*/
public function CustomURLLoader(completeHandler:Function, ioErrorHandler:Function = null, securityErrorHandler:Function = null)
{
this.completeHandler = completeHandler;
this.ioErrorHandler = ioErrorHandler;
this.securityErrorHandler = securityErrorHandler;
if (!_fileCache)
_fileCache = new Object();
}
/** Returns number of file read requests that are pending -- i.e., that have neither
* completed successfully nor returned errors.
*/
static public function get requestsPending():int
{
return _requestsPending;
}
/** Given the name of a file, look it up in the cache and return the contents as a string. */
static public function getFile(fileName:String):String
{
// If it's in the cache, just return it
if (_fileCache[fileName] != null)
return _fileCache[fileName];
// We have a request out, and we're waiting for the result. Unfortunately, there's no
// way we know to wait and still handle the events that would cause the pending status
// to complete. So we return failure here as well.
if (_fileCache.hasOwnProperty(fileName))
return null;
// We've never seen this file
return null;
}
/** Add a new file to the cache. Takes the name of the file, as given in the URLRequest,
* and the file contents as a string. */
static private function addToCache(urlLoader:CustomURLLoader, data:String):void
{
CONFIG::debug { assert(_fileCache[getFileKey(urlLoader)] == null, "Adding over existing cache entry!"); }
_fileCache[getFileKey(urlLoader)] = data;
}
/** Default handler. This will get called on every successful completion of a read that goes
* through CustomURLLoader. It's job is to add the file to the file cache, and call the
* custom completion handler, if one was specified.
*/
static private function defaultCompleteHandler(event:Event):void
{
// Remove the event listener that was attached so this function could get called.
if (event)
event.target.removeEventListener(Event.COMPLETE, defaultCompleteHandler);
// This request handled; is no longer pending
--_requestsPending;
// Add the new file to the cache
var urlLoader:CustomURLLoader = CustomURLLoader(event.target);
addToCache(urlLoader, urlLoader.data);
// Call the custom completion handler
if (urlLoader.completeHandler != null)
urlLoader.completeHandler(event);
urlLoader.close();
}
/** Default handler. This will get called on every security error of a read that goes
* through CustomURLLoader. It's job is to update the file cache, and call the
* custom security error handler, if one was specified.
*/
static private function defaultSecurityErrorHandler(event:SecurityErrorEvent):void
{
if (event)
event.target.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, defaultSecurityErrorHandler);
--_requestsPending;
var urlLoader:CustomURLLoader = CustomURLLoader(event.target);
addToCache(urlLoader, FILE_ERROR);
if (urlLoader.securityErrorHandler != null)
urlLoader.securityErrorHandler(event);
}
/** Default handler. This will get called on every i/o error of a read that goes
* through CustomURLLoader. It's job is to update the file cache, and call the
* custom i/o error handler, if one was specified.
*/
static private function defaultIOErrorHandler(event:IOErrorEvent):void
{
if (event)
event.target.removeEventListener(IOErrorEvent.IO_ERROR, defaultIOErrorHandler);
--_requestsPending;
var urlLoader:CustomURLLoader = CustomURLLoader(event.target);
addToCache(urlLoader, FILE_ERROR);
if (urlLoader.ioErrorHandler != null)
urlLoader.ioErrorHandler(event);
}
/* Start a file read.
* @param request - URL request for the read
*/
override public function load(request:URLRequest):void
{
this.request = request;
// If we have already read this file in, or we are already in the middle of reading it in, don't make another request
if (_fileCache.hasOwnProperty(getFileKey(this)))
{
CONFIG::debug { assert (completeHandler == null, "Load has file cached, won't be calling completeHandler! You should call get() before calling readFile()"); }
return;
}
// Add it to the cache as a null entry, to signal there's a request pending on it
_fileCache[getFileKey(this)] = null;
// Attach listeners so the default handlers get called.
addEventListener(Event.COMPLETE,defaultCompleteHandler, false, 0, true);
addEventListener(SecurityErrorEvent.SECURITY_ERROR,defaultSecurityErrorHandler, false, 0, true);
addEventListener(IOErrorEvent.IO_ERROR, defaultIOErrorHandler, false, 0, true);
++_requestsPending;
super.load(request);
}
/** Given a URLLoader, return the key for access the file cache. Right now, we
* just use the file name for this.
*/
static private function getFileKey(urlLoader:CustomURLLoader):String
{
return urlLoader.request.url;
}
}
|
package de.codekommando.cosmicwonder.views.editor
{
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.display.PixelSnapping;
import flash.display.Sprite;
public class EffectThumb extends Sprite
{
public var id:int = 0;
private var _image:Bitmap = new Bitmap();
public function EffectThumb(_effect:String, _id:int)
{
id = _id;
this.blendMode = _effect;
}
public function set image(b:Bitmap):void
{
//trace( 'EffectThumb:image' );
_image = b;
_image.pixelSnapping = PixelSnapping.ALWAYS;
//_image.x = _image.width / -2;
//_image.y = _image.height / -2;
addChild(_image);
}
}
} |
package com.bojinx.mnav.meta
{
import com.bojinx.api.constants.ProcessorLifeCycleStage;
import com.bojinx.api.processor.metadata.IMetaData;
import com.bojinx.reflection.MetaDataDescriptor;
public class WayPointMetadata implements IMetaData
{
/*============================================================================*/
/*= PUBLIC PROPERTIES */
/*============================================================================*/
public var mode:String;
public var path:String;
public function get stage():int
{
return ProcessorLifeCycleStage.READY;
}
public var target:String;
public var factory:String;
public var effectEndpoint:Boolean;
public function WayPointMetadata()
{
}
/*============================================================================*/
/*= STATIC PUBLIC PROPERTIES */
/*============================================================================*/
public static function get config():MetaDataDescriptor
{
var conf:MetaDataDescriptor = new MetaDataDescriptor();
conf.setMetaName( "WayPoint" );
conf.setDefaultProperty( "name" );
conf.setSupportedMembers( MetaDataDescriptor.CLASS );
return conf;
}
}
}
|
package nl.niftysystems.touchKeyboard
{
import flash.display.*;
//import flash.events.TransformGestureEvent;
import org.tuio.TouchEvent;
/*
* Original source code available at http://www.indieas.org/2009/11/onscreen-keyboard-with-air/
*/
[SWF(width = "720", height = "240")]
public class ScreenBoard extends Sprite {
private var keys:Array;
private var shift:Boolean;
private var gap:Number = 2.5;
private var _keyColor:uint;
private var _buttonColor:uint;
private var _buttonBorderColor:uint;
public function ScreenBoard(screenBoardX:uint = 0, screenBoardY:uint = 0, keyColor:uint = 0xffffff, buttonColor:uint = 0x000000, buttonBorderColor:uint = 0x000000) {
super();
shift = false;
_keyColor = keyColor;
_buttonColor = buttonColor;
_buttonBorderColor = buttonBorderColor;
initRows();
graphics.beginFill(0, 0);
graphics.drawRect(0, 0, width, height);
graphics.endFill();
this.x = screenBoardX;
this.y = screenBoardY;
}
private function initRows():void {
var row1:Array = createKeys(String.fromCharCode(8593));
row1.push(new ToggleKey("b", "b", _keyColor, _buttonColor, _buttonBorderColor));
row1.reverse();
row1.push(new ToggleKey("e", "e", _keyColor, _buttonColor, _buttonBorderColor));
var row2:Array = createKeys(String.fromCharCode(8592) + String.fromCharCode(8595) + String.fromCharCode(8594));
var row3:Array = createKeys("acdfg");
var row4:Array = [new ShiftKey(_keyColor, _buttonColor, _buttonBorderColor), new SpaceKey(_keyColor, _buttonColor, _buttonBorderColor)];
var rows:Array = [row1, row2, row3, row4];
var dy:Number = 0;
var lines:Array = new Array();
keys = new Array();
for each(var row:Array in rows) {
var line:Sprite = new Sprite();
var dx:Number = 0;
for each(var key:Key in row) {
key.addEventListener(TouchEvent.TOUCH_DOWN, onKey);
key.x = dx;
keys.push(key);
dx += key.width + gap;
line.addChild(key);
}
line.y = dy;
dy += line.height + gap;
addChild(line);
lines.push(line);
}
var maxWidth:Number = 0;
for each(line in lines) maxWidth = Math.max(maxWidth, line.width);
for each(line in lines) line.x = (maxWidth - line.width) / 2;
}
private function onKey(me:TouchEvent):void {
var key:Key = me.currentTarget as Key;
if(key is ShiftKey) {
shift = !shift;
applyShift();
} else {
dispatchEvent(new ScreenBoardEvent(key.char, ScreenBoardEvent.ADDCHAR));
}
}
private function createKeys(chars:String):Array {
var array:Array = new Array();
for (var i:Number = 0; i < chars.length; i++) {
array.push(new Key(chars.charAt(i), _keyColor, _buttonColor, _buttonBorderColor));
}
return array;
}
private function applyShift():void {
for each(var key:Key in keys) {
if(shift) {
key.toUpperCase();
} else {
key.toLowerCase();
}
}
}
}
} |
package com.andywoods.multitrialapp.data
{
public class TestData
{
public static const data:String = "CXEBCgsBD2dyb3VwSUQGD1Rhc3RlXzgNYml0bWFwBochZU5ydDE3Rk5BekVVQnVDYkNORXdDQklsSlJOUU1BQWIwTEFCTFJVejBOQ3hCR01FdmVKRlQ5WUYrNGdVaFBNVm4yUVNjNWQ3ei82ZExNdHl0L3Y2K0FRQUp2RjQvN0JibG1WVnZIZXF6L0h5OUx5L2I0eDc4OTlmMy9iell6eFRQL0o1WXB3OWlKcHM3VWU5MWxhMXJqSHV6Yis2dU56UGovR3NlK1dZUFhGN2ZmT3Jmc1QvMUpyMjZodHJKZTVWN3p1eXAyYnBSODJ3V3JQTXRLam5XdDVFbmVMdmtmVWJjL0phdGRZam4vUFlkZlNmK2xGZnk0eW9XWlo3SXRkNDdvOTJUcTllZVI2TTlPNmMrOUh1aDZqem9kclZmclRmRTNwcnZsN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BodZZU5ydDFqRk93MEFRQlZBZmdCcUppZzVSVUZCUzBYQUFqcENHUGkzWDRCaWNNbWlRUnBxc0hMSHJCQ2x4WHZFazVJeDN6ZnoxcnFkcCt0aDl2MndCZ0pWNHVMbmJUZE8wSjY0dEhlL3JlVE4wZjUxL1pKN04vZXV2bnRxMzI2ZnUyblBKNVBQeGZlLzV3NUt4UnZLTUhrVitPZWRJampGUFQ0K2pwcmYyWFBNWVhlUEh2Qi8xdnQ1M0pOZDdiNDlIYWkvaC9jZzFWdGRaM1dPaU52Nk9ubVllZWEyT1UvZkVRMnUrSjdkNDFyWG5VWHRWZTFqWGU2N2h6SzcyTDJveWoxcVRXZGVlWkczYjU1NmU1Yk5kMi91UnZXNy9sM28ySHNxajdsZnQvWmw5blMvci9uck91Q2R6dktZOGNvM25tbTMzcmlWNXhQZzVaanRmL3I3a1c3RDNURi9MKzFHemFmZWFta2YycDgwanI4V1k3UjQyMTZ2L1dQT1hsTWZjbW12M2szcWV6K1dXMzdnMXM3WSszNCtzelhPcW5iYzlWNDd0OGR5M0NNQXA1SGsxWjI0dkc2MEhBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQU9Ba2ZnQlg0SExBEgYUAQ==";
}
} |
/**
* Apache License
* Version 2.0, January 2004
* http://www.apache.org/licenses/
*
* TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
*
* 1. Definitions.
*
* "License" shall mean the terms and conditions for use, reproduction,
* and distribution as defined by Sections 1 through 9 of this document.
*
* "Licensor" shall mean the copyright owner or entity authorized by
* the copyright owner that is granting the License.
*
* "Legal Entity" shall mean the union of the acting entity and all
* other entities that control, are controlled by, or are under common
* control with that entity. For the purposes of this definition,
* "control" means (i) the power, direct or indirect, to cause the
* direction or management of such entity, whether by contract or
* otherwise, or (ii) ownership of fifty percent (50%) or more of the
* outstanding shares, or (iii) beneficial ownership of such entity.
*
* "You" (or "Your") shall mean an individual or Legal Entity
* exercising permissions granted by this License.
*
* "Source" form shall mean the preferred form for making modifications,
* including but not limited to software source code, documentation
* source, and configuration files.
*
* "Object" form shall mean any form resulting from mechanical
* transformation or translation of a Source form, including but
* not limited to compiled object code, generated documentation,
* and conversions to other media types.
*
* "Work" shall mean the work of authorship, whether in Source or
* Object form, made available under the License, as indicated by a
* copyright notice that is included in or attached to the work
* (an example is provided in the Appendix below).
*
* "Derivative Works" shall mean any work, whether in Source or Object
* form, that is based on (or derived from) the Work and for which the
* editorial revisions, annotations, elaborations, or other modifications
* represent, as a whole, an original work of authorship. For the purposes
* of this License, Derivative Works shall not include works that remain
* separable from, or merely link (or bind by name) to the interfaces of,
* the Work and Derivative Works thereof.
*
* "Contribution" shall mean any work of authorship, including
* the original version of the Work and any modifications or additions
* to that Work or Derivative Works thereof, that is intentionally
* submitted to Licensor for inclusion in the Work by the copyright owner
* or by an individual or Legal Entity authorized to submit on behalf of
* the copyright owner. For the purposes of this definition, "submitted"
* means any form of electronic, verbal, or written communication sent
* to the Licensor or its representatives, including but not limited to
* communication on electronic mailing lists, source code control systems,
* and issue tracking systems that are managed by, or on behalf of, the
* Licensor for the purpose of discussing and improving the Work, but
* excluding communication that is conspicuously marked or otherwise
* designated in writing by the copyright owner as "Not a Contribution."
*
* "Contributor" shall mean Licensor and any individual or Legal Entity
* on behalf of whom a Contribution has been received by Licensor and
* subsequently incorporated within the Work.
*
* 2. Grant of Copyright License. Subject to the terms and conditions of
* this License, each Contributor hereby grants to You a perpetual,
* worldwide, non-exclusive, no-charge, royalty-free, irrevocable
* copyright license to reproduce, prepare Derivative Works of,
* publicly display, publicly perform, sublicense, and distribute the
* Work and such Derivative Works in Source or Object form.
*
* 3. Grant of Patent License. Subject to the terms and conditions of
* this License, each Contributor hereby grants to You a perpetual,
* worldwide, non-exclusive, no-charge, royalty-free, irrevocable
* (except as stated in this section) patent license to make, have made,
* use, offer to sell, sell, import, and otherwise transfer the Work,
* where such license applies only to those patent claims licensable
* by such Contributor that are necessarily infringed by their
* Contribution(s) alone or by combination of their Contribution(s)
* with the Work to which such Contribution(s) was submitted. If You
* institute patent litigation against any entity (including a
* cross-claim or counterclaim in a lawsuit) alleging that the Work
* or a Contribution incorporated within the Work constitutes direct
* or contributory patent infringement, then any patent licenses
* granted to You under this License for that Work shall terminate
* as of the date such litigation is filed.
*
* 4. Redistribution. You may reproduce and distribute copies of the
* Work or Derivative Works thereof in any medium, with or without
* modifications, and in Source or Object form, provided that You
* meet the following conditions:
*
* (a) You must give any other recipients of the Work or
* Derivative Works a copy of this License; and
*
* (b) You must cause any modified files to carry prominent notices
* stating that You changed the files; and
*
* (c) You must retain, in the Source form of any Derivative Works
* that You distribute, all copyright, patent, trademark, and
* attribution notices from the Source form of the Work,
* excluding those notices that do not pertain to any part of
* the Derivative Works; and
*
* (d) If the Work includes a "NOTICE" text file as part of its
* distribution, then any Derivative Works that You distribute must
* include a readable copy of the attribution notices contained
* within such NOTICE file, excluding those notices that do not
* pertain to any part of the Derivative Works, in at least one
* of the following places: within a NOTICE text file distributed
* as part of the Derivative Works; within the Source form or
* documentation, if provided along with the Derivative Works; or,
* within a display generated by the Derivative Works, if and
* wherever such third-party notices normally appear. The contents
* of the NOTICE file are for informational purposes only and
* do not modify the License. You may add Your own attribution
* notices within Derivative Works that You distribute, alongside
* or as an addendum to the NOTICE text from the Work, provided
* that such additional attribution notices cannot be construed
* as modifying the License.
*
* You may add Your own copyright statement to Your modifications and
* may provide additional or different license terms and conditions
* for use, reproduction, or distribution of Your modifications, or
* for any such Derivative Works as a whole, provided Your use,
* reproduction, and distribution of the Work otherwise complies with
* the conditions stated in this License.
*
* 5. Submission of Contributions. Unless You explicitly state otherwise,
* any Contribution intentionally submitted for inclusion in the Work
* by You to the Licensor shall be under the terms and conditions of
* this License, without any additional terms or conditions.
* Notwithstanding the above, nothing herein shall supersede or modify
* the terms of any separate license agreement you may have executed
* with Licensor regarding such Contributions.
*
* 6. Trademarks. This License does not grant permission to use the trade
* names, trademarks, service marks, or product names of the Licensor,
* except as required for reasonable and customary use in describing the
* origin of the Work and reproducing the content of the NOTICE file.
*
* 7. Disclaimer of Warranty. Unless required by applicable law or
* agreed to in writing, Licensor provides the Work (and each
* Contributor provides its Contributions) on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
* implied, including, without limitation, any warranties or conditions
* of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
* PARTICULAR PURPOSE. You are solely responsible for determining the
* appropriateness of using or redistributing the Work and assume any
* risks associated with Your exercise of permissions under this License.
*
* 8. Limitation of Liability. In no event and under no legal theory,
* whether in tort (including negligence), contract, or otherwise,
* unless required by applicable law (such as deliberate and grossly
* negligent acts) or agreed to in writing, shall any Contributor be
* liable to You for damages, including any direct, indirect, special,
* incidental, or consequential damages of any character arising as a
* result of this License or out of the use or inability to use the
* Work (including but not limited to damages for loss of goodwill,
* work stoppage, computer failure or malfunction, or any and all
* other commercial damages or losses), even if such Contributor
* has been advised of the possibility of such damages.
*
* 9. Accepting Warranty or Additional Liability. While redistributing
* the Work or Derivative Works thereof, You may choose to offer,
* and charge a fee for, acceptance of support, warranty, indemnity,
* or other liability obligations and/or rights consistent with this
* License. However, in accepting such obligations, You may act only
* on Your own behalf and on Your sole responsibility, not on behalf
* of any other Contributor, and only if You agree to indemnify,
* defend, and hold each Contributor harmless for any liability
* incurred by, or claims asserted against, such Contributor by reason
* of your accepting any such warranty or additional liability.
*
* END OF TERMS AND CONDITIONS
*
* APPENDIX: How to apply the Apache License to your work.
*
* To apply the Apache License to your work, attach the following
* boilerplate notice, with the fields enclosed by brackets "{}"
* replaced with your own identifying information. (Don't include
* the brackets!) The text should be enclosed in the appropriate
* comment syntax for the file format. We also recommend that a
* file or class name and description of purpose be included on the
* same "printed page" as the copyright notice for easier
* identification within third-party archives.
*
* Copyright {yyyy} {name of copyright owner}
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.deleidos.rtws.sysmon.views
{
import com.deleidos.rtws.commons.event.OperationStatusEvent;
import com.deleidos.rtws.commons.util.StringUtils;
import com.deleidos.rtws.commons.util.batchoperation.BatchOperationStatusEvent;
import SystemMonitor;
import com.deleidos.rtws.sysmon.events.CommandEvent;
import com.deleidos.rtws.sysmon.events.ConnCommsStatusChangeEvent;
import com.deleidos.rtws.sysmon.models.ParameterModel;
import org.robotlegs.mvcs.Mediator;
public class SystemMonitorMediator extends Mediator
{
[Inject] public var systemMonitor:SystemMonitor;
[Inject] public var paramModel:ParameterModel;
public function SystemMonitorMediator()
{
super();
}
override public function onRegister():void
{
super.onRegister();
// Startup Event Listener
eventMap.mapListener(eventDispatcher, BatchOperationStatusEvent.BATCH_OPERATION, onStartupBatchStatusEvent);
eventMap.mapListener(eventDispatcher, CommandEvent.CHANGE_SYSTEM, onSystemChange);
eventMap.mapListener(eventDispatcher, ConnCommsStatusChangeEvent.STATUS_CHANGE, onConnCommsStatusChangeEvent);
}
override public function onRemove():void
{
super.onRemove();
// Startup Event Listeners
eventMap.unmapListener(eventDispatcher, BatchOperationStatusEvent.BATCH_OPERATION, onStartupBatchStatusEvent);
}
private function onStartupBatchStatusEvent(event:BatchOperationStatusEvent):void
{
if(event == null || StringUtils.isBlank(event.subType) || SystemMonitor.STARTUP_TRACKING_TOKEN !== event.trackingToken)
{
return;
}
var isStartupComplete:Boolean = false;
var newViewState:String = null;
if(OperationStatusEvent.SUB_TYPE_SUCCESS == event.subType)
{
isStartupComplete = true;
newViewState = systemMonitor.monitoringState.name;
}
else if(OperationStatusEvent.SUB_TYPE_FAILURE == event.subType)
{
isStartupComplete = true;
newViewState = systemMonitor.launchState.name;
}
else if(OperationStatusEvent.SUB_TYPE_PROGRESS == event.subType)
{
newViewState = systemMonitor.launchState.name;
}
if(isStartupComplete)
{
this.eventMap.unmapListener(eventDispatcher, BatchOperationStatusEvent.BATCH_OPERATION, onStartupBatchStatusEvent);
}
systemMonitor.currentState = newViewState;
}
private function onSystemChange(event:CommandEvent):void
{
systemMonitor.connCommsStatus = paramModel.connCommsStatus;
}
private function onConnCommsStatusChangeEvent(event:ConnCommsStatusChangeEvent):void
{
systemMonitor.connCommsStatus = event.newStatus;
}
}
} |
/*
TapTab as3 library
Copyright 2014 Grégory Lardon. All Rights Reserved.
This program is free software. You can redistribute and/or modify it in
accordance with the terms of the accompanying license agreement.
*/
package taptabcontroller.controller
{
/**
*
* This class provides constants for directions, used with Stick360Control
* @author Grégory Lardon
*
*/
public class Directions
{
/**
* None
*/
public static const NONE : String = "Directions.NONE";
/**
* Right
*/
public static const RIGHT : String = "Directions.RIGHT";
/**
* Bottom
*/
public static const BOTTOM : String = "Directions.BOTTOM";
/**
* Bottom left
*/
public static const BOTTOM_LEFT : String = "Directions.BOTTOM_LEFT";
/**
* Bottom right
*/
public static const BOTTOM_RIGHT : String = "Directions.BOTTOM_RIGHT";
/**
* Left
*/
public static const LEFT : String = "Directions.LEFT";
/**
* Top
*/
public static const TOP : String = "Directions.TOP";
/**
* Top left
*/
public static const TOP_LEFT : String = "Directions.TOP_LEFT";
/**
* Top right
*/
public static const TOP_RIGHT : String = "Directions.TOP_RIGHT";
/**
* Array that containers [RIGHT, TOP, LEFT, BOTTOM]
*/
public static const DIRECTIONS_4 : Array = [RIGHT, TOP, LEFT, BOTTOM];
/**
* Array that contains [RIGHT, TOP_RIGHT, TOP, TOP_LEFT, LEFT, BOTTOM_LEFT, BOTTOM, BOTTOM_RIGHT]
*/
public static const DIRECTIONS_8 : Array = [RIGHT, TOP_RIGHT, TOP, TOP_LEFT, LEFT, BOTTOM_LEFT, BOTTOM, BOTTOM_RIGHT];
}
} |
/**
* Apache License
* Version 2.0, January 2004
* http://www.apache.org/licenses/
*
* TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
*
* 1. Definitions.
*
* "License" shall mean the terms and conditions for use, reproduction,
* and distribution as defined by Sections 1 through 9 of this document.
*
* "Licensor" shall mean the copyright owner or entity authorized by
* the copyright owner that is granting the License.
*
* "Legal Entity" shall mean the union of the acting entity and all
* other entities that control, are controlled by, or are under common
* control with that entity. For the purposes of this definition,
* "control" means (i) the power, direct or indirect, to cause the
* direction or management of such entity, whether by contract or
* otherwise, or (ii) ownership of fifty percent (50%) or more of the
* outstanding shares, or (iii) beneficial ownership of such entity.
*
* "You" (or "Your") shall mean an individual or Legal Entity
* exercising permissions granted by this License.
*
* "Source" form shall mean the preferred form for making modifications,
* including but not limited to software source code, documentation
* source, and configuration files.
*
* "Object" form shall mean any form resulting from mechanical
* transformation or translation of a Source form, including but
* not limited to compiled object code, generated documentation,
* and conversions to other media types.
*
* "Work" shall mean the work of authorship, whether in Source or
* Object form, made available under the License, as indicated by a
* copyright notice that is included in or attached to the work
* (an example is provided in the Appendix below).
*
* "Derivative Works" shall mean any work, whether in Source or Object
* form, that is based on (or derived from) the Work and for which the
* editorial revisions, annotations, elaborations, or other modifications
* represent, as a whole, an original work of authorship. For the purposes
* of this License, Derivative Works shall not include works that remain
* separable from, or merely link (or bind by name) to the interfaces of,
* the Work and Derivative Works thereof.
*
* "Contribution" shall mean any work of authorship, including
* the original version of the Work and any modifications or additions
* to that Work or Derivative Works thereof, that is intentionally
* submitted to Licensor for inclusion in the Work by the copyright owner
* or by an individual or Legal Entity authorized to submit on behalf of
* the copyright owner. For the purposes of this definition, "submitted"
* means any form of electronic, verbal, or written communication sent
* to the Licensor or its representatives, including but not limited to
* communication on electronic mailing lists, source code control systems,
* and issue tracking systems that are managed by, or on behalf of, the
* Licensor for the purpose of discussing and improving the Work, but
* excluding communication that is conspicuously marked or otherwise
* designated in writing by the copyright owner as "Not a Contribution."
*
* "Contributor" shall mean Licensor and any individual or Legal Entity
* on behalf of whom a Contribution has been received by Licensor and
* subsequently incorporated within the Work.
*
* 2. Grant of Copyright License. Subject to the terms and conditions of
* this License, each Contributor hereby grants to You a perpetual,
* worldwide, non-exclusive, no-charge, royalty-free, irrevocable
* copyright license to reproduce, prepare Derivative Works of,
* publicly display, publicly perform, sublicense, and distribute the
* Work and such Derivative Works in Source or Object form.
*
* 3. Grant of Patent License. Subject to the terms and conditions of
* this License, each Contributor hereby grants to You a perpetual,
* worldwide, non-exclusive, no-charge, royalty-free, irrevocable
* (except as stated in this section) patent license to make, have made,
* use, offer to sell, sell, import, and otherwise transfer the Work,
* where such license applies only to those patent claims licensable
* by such Contributor that are necessarily infringed by their
* Contribution(s) alone or by combination of their Contribution(s)
* with the Work to which such Contribution(s) was submitted. If You
* institute patent litigation against any entity (including a
* cross-claim or counterclaim in a lawsuit) alleging that the Work
* or a Contribution incorporated within the Work constitutes direct
* or contributory patent infringement, then any patent licenses
* granted to You under this License for that Work shall terminate
* as of the date such litigation is filed.
*
* 4. Redistribution. You may reproduce and distribute copies of the
* Work or Derivative Works thereof in any medium, with or without
* modifications, and in Source or Object form, provided that You
* meet the following conditions:
*
* (a) You must give any other recipients of the Work or
* Derivative Works a copy of this License; and
*
* (b) You must cause any modified files to carry prominent notices
* stating that You changed the files; and
*
* (c) You must retain, in the Source form of any Derivative Works
* that You distribute, all copyright, patent, trademark, and
* attribution notices from the Source form of the Work,
* excluding those notices that do not pertain to any part of
* the Derivative Works; and
*
* (d) If the Work includes a "NOTICE" text file as part of its
* distribution, then any Derivative Works that You distribute must
* include a readable copy of the attribution notices contained
* within such NOTICE file, excluding those notices that do not
* pertain to any part of the Derivative Works, in at least one
* of the following places: within a NOTICE text file distributed
* as part of the Derivative Works; within the Source form or
* documentation, if provided along with the Derivative Works; or,
* within a display generated by the Derivative Works, if and
* wherever such third-party notices normally appear. The contents
* of the NOTICE file are for informational purposes only and
* do not modify the License. You may add Your own attribution
* notices within Derivative Works that You distribute, alongside
* or as an addendum to the NOTICE text from the Work, provided
* that such additional attribution notices cannot be construed
* as modifying the License.
*
* You may add Your own copyright statement to Your modifications and
* may provide additional or different license terms and conditions
* for use, reproduction, or distribution of Your modifications, or
* for any such Derivative Works as a whole, provided Your use,
* reproduction, and distribution of the Work otherwise complies with
* the conditions stated in this License.
*
* 5. Submission of Contributions. Unless You explicitly state otherwise,
* any Contribution intentionally submitted for inclusion in the Work
* by You to the Licensor shall be under the terms and conditions of
* this License, without any additional terms or conditions.
* Notwithstanding the above, nothing herein shall supersede or modify
* the terms of any separate license agreement you may have executed
* with Licensor regarding such Contributions.
*
* 6. Trademarks. This License does not grant permission to use the trade
* names, trademarks, service marks, or product names of the Licensor,
* except as required for reasonable and customary use in describing the
* origin of the Work and reproducing the content of the NOTICE file.
*
* 7. Disclaimer of Warranty. Unless required by applicable law or
* agreed to in writing, Licensor provides the Work (and each
* Contributor provides its Contributions) on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
* implied, including, without limitation, any warranties or conditions
* of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
* PARTICULAR PURPOSE. You are solely responsible for determining the
* appropriateness of using or redistributing the Work and assume any
* risks associated with Your exercise of permissions under this License.
*
* 8. Limitation of Liability. In no event and under no legal theory,
* whether in tort (including negligence), contract, or otherwise,
* unless required by applicable law (such as deliberate and grossly
* negligent acts) or agreed to in writing, shall any Contributor be
* liable to You for damages, including any direct, indirect, special,
* incidental, or consequential damages of any character arising as a
* result of this License or out of the use or inability to use the
* Work (including but not limited to damages for loss of goodwill,
* work stoppage, computer failure or malfunction, or any and all
* other commercial damages or losses), even if such Contributor
* has been advised of the possibility of such damages.
*
* 9. Accepting Warranty or Additional Liability. While redistributing
* the Work or Derivative Works thereof, You may choose to offer,
* and charge a fee for, acceptance of support, warranty, indemnity,
* or other liability obligations and/or rights consistent with this
* License. However, in accepting such obligations, You may act only
* on Your own behalf and on Your sole responsibility, not on behalf
* of any other Contributor, and only if You agree to indemnify,
* defend, and hold each Contributor harmless for any liability
* incurred by, or claims asserted against, such Contributor by reason
* of your accepting any such warranty or additional liability.
*
* END OF TERMS AND CONDITIONS
*
* APPENDIX: How to apply the Apache License to your work.
*
* To apply the Apache License to your work, attach the following
* boilerplate notice, with the fields enclosed by brackets "{}"
* replaced with your own identifying information. (Don't include
* the brackets!) The text should be enclosed in the appropriate
* comment syntax for the file format. We also recommend that a
* file or class name and description of purpose be included on the
* same "printed page" as the copyright notice for easier
* identification within third-party archives.
*
* Copyright {yyyy} {name of copyright owner}
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.deleidos.rtws.tablemgr.view.dimension
{
import com.deleidos.rtws.commons.model.status.StatusMessage;
import com.deleidos.rtws.commons.model.status.StatusType;
import com.deleidos.rtws.commons.util.StringUtils;
import com.deleidos.rtws.tablemgr.event.dimension.DimTableMappingEvent;
import com.deleidos.rtws.tablemgr.event.sequence.SequenceEvent;
import com.deleidos.rtws.tablemgr.event.sequence.SequenceStatusEvent;
import com.deleidos.rtws.tablemgr.event.table.LoadTableDataEvent;
import com.deleidos.rtws.tablemgr.event.table.TableEvent;
import com.deleidos.rtws.tablemgr.model.DatabaseModel;
import com.deleidos.rtws.tablemgr.model.DatabaseModels;
import com.deleidos.rtws.tablemgr.model.db.Sequence;
import com.deleidos.rtws.tablemgr.model.db.Table;
import mx.collections.ArrayList;
import mx.utils.UIDUtil;
import org.robotlegs.mvcs.Mediator;
public class MappingEditorMediator extends Mediator
{
private static const SEQUENCES_SCHEMA:String = "DIMENSIONS";
[Inject] public var view:MappingEditor;
[Inject] public var databasesModel:DatabaseModels;
private var dbModel:DatabaseModel;
private var _initSequencesFetchUid:String;
private var _sequenceCreateUid:String = null;
public function MappingEditorMediator()
{
super();
}
override public function onRegister():void
{
super.onRegister();
if(view.tableCtxt != null)
{
dbModel = databasesModel.getModel(view.tableCtxt.connConfig);
if(dbModel == null)
{
view.displayUnrecoverableError("Unknown DB Connection");
}
else
{
eventMap.mapListener(view, DimTableMappingEvent.LOAD_REQUEST, dispatch);
eventMap.mapListener(eventDispatcher, TableEvent.TABLE_UPDATED, onTableUpdate);
eventMap.mapListener(eventDispatcher, DimTableMappingEvent.LOAD_STATUS, onLoadMappingStatusEvent);
eventMap.mapListener(view, SequenceStatusEvent.CREATE_SEQUENCE, onSequenceCreateRequest);
eventMap.mapListener(eventDispatcher, SequenceStatusEvent.CREATE_SEQUENCE_STATUS, onSequenceCreateStatusUpd);
eventMap.mapListener(eventDispatcher, SequenceEvent.SEQUENCES_UPDATED, onSequencesUpdated);
eventMap.mapListener(view, DimTableMappingEvent.SAVE_REQUEST, dispatch);
eventMap.mapListener(eventDispatcher, DimTableMappingEvent.SAVE_STATUS, onSaveMappingStatusEvent);
var existingTableData:Table = dbModel.getTable(view.tableCtxt.table);
if(existingTableData == null)
{
this.dispatch(new LoadTableDataEvent(LoadTableDataEvent.LOAD_FULL_TABLE_DETAILS, view.tableCtxt.connConfig, view.tableCtxt.table));
}
else
{
view.tableData = existingTableData;
}
var mappingDataRequestEvent:DimTableMappingEvent = new DimTableMappingEvent(DimTableMappingEvent.LOAD_REQUEST, null, null);
mappingDataRequestEvent.tableCtxt = view.tableCtxt;
this.dispatch(mappingDataRequestEvent);
var existingSequences:ArrayList = dbModel.getSequences(SEQUENCES_SCHEMA);
if(existingSequences != null)
{
view.availSequences = existingSequences;
}
else
{
_initSequencesFetchUid = UIDUtil.createUID();
this.eventDispatcher.addEventListener(SequenceStatusEvent.FETCH_SEQUENCES_STATUS, onSequenceStatusUpdate);
var sequencesRequestEvent:SequenceStatusEvent = new SequenceStatusEvent(SequenceStatusEvent.FETCH_SEQUENCES, null, _initSequencesFetchUid);
sequencesRequestEvent.connConfig = view.tableCtxt.connConfig;
sequencesRequestEvent.schema = SEQUENCES_SCHEMA;
this.dispatch(sequencesRequestEvent);
}
}
}
}
override public function onRemove():void
{
eventMap.unmapListener(view, DimTableMappingEvent.LOAD_REQUEST, dispatch);
eventMap.unmapListener(eventDispatcher, TableEvent.TABLE_UPDATED, onTableUpdate);
eventMap.unmapListener(eventDispatcher, DimTableMappingEvent.LOAD_STATUS, onLoadMappingStatusEvent);
eventMap.unmapListener(view, DimTableMappingEvent.SAVE_REQUEST, dispatch);
eventMap.unmapListener(eventDispatcher, DimTableMappingEvent.SAVE_STATUS, onSaveMappingStatusEvent);
}
private function onTableUpdate(event:TableEvent):void
{
if(event != null && view.tableCtxt.connConfig.equals(event.connConfig) && view.tableCtxt.table.equals(event.table))
{
view.tableData = event.table;
}
}
private function onLoadMappingStatusEvent(event:DimTableMappingEvent):void
{
if(event != null && event.isComplete() && view.tableCtxt.equals(event.tableCtxt))
{
if(event.isUnsuccessful())
{
view.displayUnrecoverableError((StringUtils.isNotBlank(event.userMsg) ? event.userMsg : "Failed to Load Enrichment Data"));
}
else
{
view.tableMappingData = event.dimTableMapping;
}
}
}
private function onSaveMappingStatusEvent(event:DimTableMappingEvent):void
{
if(event != null && event.isComplete() && view.tableCtxt.equals(event.tableCtxt))
{
var statusMsg:StatusMessage = null;
if(event.isUnsuccessful())
{
statusMsg = new StatusMessage(StatusType.ERROR);
statusMsg.userMsg = (StringUtils.isNotBlank(event.userMsg) ? event.userMsg : "Failed to Save Enrichment Configuration");
statusMsg.userDismissible = true;
}
else
{
statusMsg = new StatusMessage(StatusType.SUCCESS, "Enrichment Configuration Saved");
statusMsg.userDismissible = true;
}
view.displaySaveMappingResult(statusMsg);
}
}
private function onSequenceCreateRequest(event:SequenceStatusEvent):void
{
if(event != null && _sequenceCreateUid == null)
{
_sequenceCreateUid = UIDUtil.createUID();
var eventToDispatch:SequenceStatusEvent = (event.clone() as SequenceStatusEvent);
eventToDispatch.trackingToken = _sequenceCreateUid;
dispatch(eventToDispatch);
}
}
private function onSequenceCreateStatusUpd(event:SequenceStatusEvent):void
{
if(event != null && event.isComplete() && event.trackingToken == _sequenceCreateUid)
{
if(event.isUnsuccessful())
{
var failureMsg:StatusMessage = new StatusMessage(StatusType.ERROR, "Failed to Create Sequence");
failureMsg.userDismissible = true;
view.displayNonBlockingStatusMsg(failureMsg);
}
else
{
view.quickAddSeqComplete(event.sequences.getItemAt(0) as Sequence);
}
_sequenceCreateUid = null;
}
}
private function onSequencesUpdated(event:SequenceEvent):void
{
if(event != null && view.tableCtxt.connConfig.equals(event.connConfig) && event.schema == SEQUENCES_SCHEMA)
{
view.availSequences = event.sequences;
}
}
private function onSequenceStatusUpdate(event:SequenceStatusEvent):void
{
if(event != null && event.isComplete() && event.trackingToken == _initSequencesFetchUid)
{
this.eventDispatcher.removeEventListener(SequenceStatusEvent.FETCH_SEQUENCES_STATUS, onSequenceStatusUpdate);
if(event.isUnsuccessful())
{
view.availSequences = null;
}
}
}
}
} |
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
import com.adobe.test.Assert;
// TODO: REVIEW AS4 CONVERSION ISSUE
function ToInteger( t ) {
t = Number( t );
if ( isNaN( t ) ){
return ( Number.NaN );
}
if ( t == 0 || t == -0 ||
t == Number.POSITIVE_INFINITY || t == Number.NEGATIVE_INFINITY ) {
return 0;
}
var sign = ( t < 0 ) ? -1 : 1;
return ( sign * Math.floor( Math.abs( t ) ) );
}
function getTimeZoneDiff()
{
return -((new Date(2000, 1, 1)).getTimezoneOffset())/60;
}
var msPerDay = 86400000;
var HoursPerDay = 24;
var MinutesPerHour = 60;
var SecondsPerMinute = 60;
var msPerSecond = 1000;
var msPerMinute = 60000; // msPerSecond * SecondsPerMinute
var msPerHour = 3600000; // msPerMinute * MinutesPerHour
var TZ_DIFF = getTimeZoneDiff(); // offset of tester's timezone from UTC
var TZ_PST = -8; // offset of Pacific Standard Time from UTC
var TZ_IST = +5.5; // offset of Indian Standard Time from UTC
var IST_DIFF = TZ_DIFF - TZ_IST; // offset of tester's timezone from IST
var PST_DIFF = TZ_DIFF - TZ_PST; // offset of tester's timezone from PST
var TIME_1970 = 0;
var TIME_2000 = 946684800000;
var TIME_1900 = -2208988800000;
var now = new Date();
var TZ_DIFF = getTimeZoneDiff();
var TZ_ADJUST = TZ_DIFF * msPerHour;
var UTC_29_FEB_2000 = TIME_2000 + 31*msPerDay + 28*msPerDay;
var UTC_1_JAN_2005 = TIME_2000 + TimeInYear(2000) + TimeInYear(2001) +
TimeInYear(2002) + TimeInYear(2003) + TimeInYear(2004);
var TIME_NOW = now.valueOf();
// Date test "ResultArrays" are hard-coded for Pacific Standard Time.
// We must adjust them for the tester's own timezone -
var TIME;
var UTC_YEAR;
var UTC_MONTH;
var UTC_DATE;
var UTC_DAY;
var UTC_HOURS;
var UTC_MINUTES;
var UTC_SECONDS;
var UTC_MS;
var YEAR;
var MONTH;
var DATE;
var DAY;
var HOURS;
var MINUTES;
var SECONDS;
var MS;
function adjustResultArray(ResultArray, msMode)
{
// If the tester's system clock is in PST, no need to continue -
if (!PST_DIFF) {return;}
// The date testcases instantiate Date objects in two different ways:
//
// millisecond mode: e.g. dt = new Date(10000000);
// year-month-day mode: dt = new Date(2000, 5, 1, ...);
//
// In the first case, the date is measured from Time 0 in Greenwich (i.e. UTC).
// In the second case, it is measured with reference to the tester's local timezone.
//
// In the first case we must correct those values expected for local measurements,
// like dt.getHours() etc. No correction is necessary for dt.getUTCHours() etc.
//
// In the second case, it is exactly the other way around -
var t;
if (msMode)
{
// The hard-coded UTC milliseconds from Time 0 derives from a UTC date.
// Shift to the right by the offset between UTC and the tester.
t = ResultArray[TIME] + TZ_DIFF*msPerHour;
// Use our date arithmetic functions to determine the local hour, day, etc.
ResultArray[MINUTES] = MinFromTime(t);
ResultArray[HOURS] = HourFromTime(t);
ResultArray[DAY] = WeekDay(t);
ResultArray[DATE] = DateFromTime(t);
ResultArray[MONTH] = MonthFromTime(t);
ResultArray[YEAR] = YearFromTime(t);
}
else
{
// The hard-coded UTC milliseconds from Time 0 derives from a PST date.
// Shift to the left by the offset between PST and the tester.
t = ResultArray[TIME] - PST_DIFF*msPerHour;
// Use our date arithmetic functions to determine the UTC hour, day, etc.
ResultArray[TIME] = t;
ResultArray[UTC_MINUTES] = MinFromTime(t);
ResultArray[UTC_HOURS] = HourFromTime(t);
ResultArray[UTC_DAY] = WeekDay(t);
ResultArray[UTC_DATE] = DateFromTime(t);
ResultArray[UTC_MONTH] = MonthFromTime(t);
ResultArray[UTC_YEAR] = YearFromTime(t);
}
}
function Day( t ) {
return ( Math.floor(t/msPerDay ) );
}
function DaysInYear( y ) {
if ( y % 4 != 0 ) {
return 365;
}
if ( (y % 4 == 0) && (y % 100 != 0) ) {
return 366;
}
if ( (y % 100 == 0) && (y % 400 != 0) ) {
return 365;
}
if ( (y % 400 == 0) ){
return 366;
} else {
_print("ERROR: DaysInYear(" + y + ") case not covered");
return Number.NaN; //"ERROR: DaysInYear(" + y + ") case not covered";
}
}
function TimeInYear( y ) {
return ( DaysInYear(y) * msPerDay );
}
function DayNumber( t ) {
return ( Math.floor( t / msPerDay ) );
}
function TimeWithinDay( t ) {
if ( t < 0 ) {
return ( (t % msPerDay) + msPerDay );
} else {
return ( t % msPerDay );
}
}
function YearNumber( t ) {
}
function TimeFromYear( y ) {
return ( msPerDay * DayFromYear(y) );
}
function DayFromYear( y ) {
return ( 365*(y-1970) +
Math.floor((y-1969)/4) -
Math.floor((y-1901)/100) +
Math.floor((y-1601)/400) );
}
function InLeapYear( t ) {
if ( DaysInYear(YearFromTime(t)) == 365 ) {
return 0;
}
if ( DaysInYear(YearFromTime(t)) == 366 ) {
return 1;
} else {
return "ERROR: InLeapYear("+ t + ") case not covered";
}
}
function YearFromTime( t ) {
t = Number( t );
var sign = ( t < 0 ) ? -1 : 1;
var year = ( sign < 0 ) ? 1969 : 1970;
for ( var timeToTimeZero = t; ; ) {
// subtract the current year's time from the time that's left.
timeToTimeZero -= sign * TimeInYear(year)
if (isNaN(timeToTimeZero))
return NaN;
// if there's less than the current year's worth of time left, then break.
if ( sign < 0 ) {
if ( sign * timeToTimeZero <= 0 ) {
break;
} else {
year += sign;
}
} else {
if ( sign * timeToTimeZero < 0 ) {
break;
} else {
year += sign;
}
}
}
return ( year );
}
function MonthFromTime( t ) {
// i know i could use switch but i'd rather not until it's part of ECMA
var day = DayWithinYear( t );
var leap = InLeapYear(t);
if ( (0 <= day) && (day < 31) ) {
return 0;
}
if ( (31 <= day) && (day < (59+leap)) ) {
return 1;
}
if ( ((59+leap) <= day) && (day < (90+leap)) ) {
return 2;
}
if ( ((90+leap) <= day) && (day < (120+leap)) ) {
return 3;
}
if ( ((120+leap) <= day) && (day < (151+leap)) ) {
return 4;
}
if ( ((151+leap) <= day) && (day < (181+leap)) ) {
return 5;
}
if ( ((181+leap) <= day) && (day < (212+leap)) ) {
return 6;
}
if ( ((212+leap) <= day) && (day < (243+leap)) ) {
return 7;
}
if ( ((243+leap) <= day) && (day < (273+leap)) ) {
return 8;
}
if ( ((273+leap) <= day) && (day < (304+leap)) ) {
return 9;
}
if ( ((304+leap) <= day) && (day < (334+leap)) ) {
return 10;
}
if ( ((334+leap) <= day) && (day < (365+leap)) ) {
return 11;
} else {
return "ERROR: MonthFromTime("+t+") not known";
}
}
function DayWithinYear( t ) {
return( Day(t) - DayFromYear(YearFromTime(t)));
}
function DateFromTime( t ) {
var day = DayWithinYear(t);
var month = MonthFromTime(t);
if ( month == 0 ) {
return ( day + 1 );
}
if ( month == 1 ) {
return ( day - 30 );
}
if ( month == 2 ) {
return ( day - 58 - InLeapYear(t) );
}
if ( month == 3 ) {
return ( day - 89 - InLeapYear(t));
}
if ( month == 4 ) {
return ( day - 119 - InLeapYear(t));
}
if ( month == 5 ) {
return ( day - 150- InLeapYear(t));
}
if ( month == 6 ) {
return ( day - 180- InLeapYear(t));
}
if ( month == 7 ) {
return ( day - 211- InLeapYear(t));
}
if ( month == 8 ) {
return ( day - 242- InLeapYear(t));
}
if ( month == 9 ) {
return ( day - 272- InLeapYear(t));
}
if ( month == 10 ) {
return ( day - 303- InLeapYear(t));
}
if ( month == 11 ) {
return ( day - 333- InLeapYear(t));
}
return ("ERROR: DateFromTime("+t+") not known" );
}
function WeekDay( t ) {
var weekday = (Day(t)+4) % 7;
return( weekday < 0 ? 7 + weekday : weekday );
}
// missing daylight savins time adjustment
function HourFromTime( t ) {
var h = Math.floor( t / msPerHour ) % HoursPerDay;
return ( (h<0) ? HoursPerDay + h : h );
}
function MinFromTime( t ) {
var min = Math.floor( t / msPerMinute ) % MinutesPerHour;
return( ( min < 0 ) ? MinutesPerHour + min : min );
}
function SecFromTime( t ) {
var sec = Math.floor( t / msPerSecond ) % SecondsPerMinute;
return ( (sec < 0 ) ? SecondsPerMinute + sec : sec );
}
function msFromTime( t ) {
var ms = t % msPerSecond;
return ( (ms < 0 ) ? msPerSecond + ms : ms );
}
function LocalTZA() {
return ( TZ_DIFF * msPerHour );
}
function UTC( t ) {
return ( t - LocalTZA() - DaylightSavingTA(t - LocalTZA()) );
}
function DaylightSavingTA( t ) {
// There is no Daylight saving time in India
if (IST_DIFF == 0)
return 0;
var dst_start;
var dst_end;
// Windows fix for 2007 DST change made all previous years follow new DST rules
// create a date pre-2007 when DST is enabled according to 2007 rules
var pre_2007:Date = new Date("Mar 20 2006");
// create a date post-2007
var post_2007:Date = new Date("Mar 20 2008");
// if the two dates timezoneoffset match, then this must be a windows box applying
// post-2007 DST rules to earlier dates.
var win_machine:Boolean = pre_2007.timezoneOffset == post_2007.timezoneOffset
if (TZ_DIFF<=-4 && TZ_DIFF>=-8) {
if (win_machine || YearFromTime(t)>=2007) {
dst_start = GetSecondSundayInMarch(t) + 2*msPerHour;
dst_end = GetFirstSundayInNovember(t) + 2*msPerHour;
} else {
dst_start = GetFirstSundayInApril(t) + 2*msPerHour;
dst_end = GetLastSundayInOctober(t) + 2*msPerHour;
}
} else {
dst_start = GetLastSundayInMarch(t) + 2*msPerHour;
dst_end = GetLastSundayInOctober(t) + 2*msPerHour;
}
if ( t >= dst_start && t < dst_end ) {
return msPerHour;
} else {
return 0;
}
// Daylight Savings Time starts on the second Sunday in March at 2:00AM in
// PST. Other time zones will need to override this function.
_print( new Date( UTC(dst_start + LocalTZA())) );
return UTC(dst_start + LocalTZA());
}
function GetLastSundayInMarch(t) {
var year = YearFromTime(t);
var leap = InLeapYear(t);
var march = TimeFromYear(year) + TimeInMonth(0,leap) + TimeInMonth(1,leap)-LocalTZA()+2*msPerHour;
var sunday;
for( sunday=march;WeekDay(sunday)>0;sunday +=msPerDay ){;}
var last_sunday;
while (true) {
sunday=sunday+7*msPerDay;
if (MonthFromTime(sunday)>2)
break;
last_sunday=sunday;
}
return last_sunday;
}
function GetSecondSundayInMarch(t ) {
var year = YearFromTime(t);
var leap = InLeapYear(t);
var march = TimeFromYear(year) + TimeInMonth(0,leap) + TimeInMonth(1,leap)-LocalTZA()+2*msPerHour;
var first_sunday;
for ( first_sunday = march; WeekDay(first_sunday) >0;
first_sunday +=msPerDay )
{
;
}
var second_sunday=first_sunday+7*msPerDay;
return second_sunday;
}
function GetFirstSundayInNovember( t ) {
var year = YearFromTime(t);
var leap = InLeapYear(t);
var nov,m;
for ( nov = TimeFromYear(year), m = 0; m < 10; m++ ) {
nov += TimeInMonth(m, leap);
}
nov=nov-LocalTZA()+2*msPerHour;
for ( var first_sunday = nov; WeekDay(first_sunday) > 0;
first_sunday += msPerDay )
{
;
}
return first_sunday;
}
function GetFirstSundayInApril( t ) {
var year = YearFromTime(t);
var leap = InLeapYear(t);
var apr,m;
for ( apr = TimeFromYear(year), m = 0; m < 3; m++ ) {
apr += TimeInMonth(m, leap);
}
apr=apr-LocalTZA()+2*msPerHour;
for ( var first_sunday = apr; WeekDay(first_sunday) > 0;
first_sunday += msPerDay )
{
;
}
return first_sunday;
}
function GetLastSundayInOctober(t) {
var year = YearFromTime(t);
var leap = InLeapYear(t);
var oct,m;
for (oct = TimeFromYear(year), m = 0; m < 9; m++ ) {
oct += TimeInMonth(m, leap);
}
oct=oct-LocalTZA()+2*msPerHour;
var sunday;
for( sunday=oct;WeekDay(sunday)>0;sunday +=msPerDay ){;}
var last_sunday;
while (true) {
last_sunday=sunday;
sunday=sunday+7*msPerDay;
if (MonthFromTime(sunday)>9)
break;
}
return last_sunday;
}
function LocalTime( t ) {
return ( t + LocalTZA() + DaylightSavingTA(t) );
}
function MakeTime( hour, min, sec, ms ) {
if ( isNaN( hour ) || isNaN( min ) || isNaN( sec ) || isNaN( ms ) ) {
return Number.NaN;
}
hour = ToInteger(hour);
min = ToInteger( min);
sec = ToInteger( sec);
ms = ToInteger( ms );
return( (hour*msPerHour) + (min*msPerMinute) +
(sec*msPerSecond) + ms );
}
function MakeDay( year, month, date ) {
if ( isNaN(year) || isNaN(month) || isNaN(date) ) {
return Number.NaN;
}
year = ToInteger(year);
month = ToInteger(month);
date = ToInteger(date );
var sign = ( year < 1970 ) ? -1 : 1;
var t = ( year < 1970 ) ? 1 : 0;
var y = ( year < 1970 ) ? 1969 : 1970;
var result5 = year + Math.floor( month/12 );
var result6 = month % 12;
if ( year < 1970 ) {
for ( y = 1969; y >= year; y += sign ) {
t += sign * TimeInYear(y);
}
} else {
for ( y = 1970 ; y < year; y += sign ) {
t += sign * TimeInYear(y);
}
}
var leap = InLeapYear( t );
for ( var m = 0; m < month; m++ ) {
t += TimeInMonth( m, leap );
}
if ( YearFromTime(t) != result5 ) {
return Number.NaN;
}
if ( MonthFromTime(t) != result6 ) {
return Number.NaN;
}
if ( DateFromTime(t) != 1 ) {
return Number.NaN;
}
return ( (Day(t)) + date - 1 );
}
function TimeInMonth( month, leap ) {
// september april june november
// jan 0 feb 1 mar 2 apr 3 may 4 june 5 jul 6
// aug 7 sep 8 oct 9 nov 10 dec 11
if ( month == 3 || month == 5 || month == 8 || month == 10 ) {
return ( 30*msPerDay );
}
// all the rest
if ( month == 0 || month == 2 || month == 4 || month == 6 ||
month == 7 || month == 9 || month == 11 ) {
return ( 31*msPerDay );
}
// save february
return ( (leap == 0) ? 28*msPerDay : 29*msPerDay );
}
function MakeDate( day, time ) {
if ( day == Number.POSITIVE_INFINITY ||
day == Number.NEGATIVE_INFINITY ||
day == Number.NaN ) {
return Number.NaN;
}
if ( time == Number.POSITIVE_INFINITY ||
time == Number.POSITIVE_INFINITY ||
day == Number.NaN) {
return Number.NaN;
}
return ( day * msPerDay ) + time;
}
// Compare 2 dates, they are considered equal if the difference is less than 1 second
function compareDate(d1, d2) {
//Dates may be off by a second
if (d1 == d2) {
return true;
} else if (Math.abs(new Date(d1).getTime() - new Date(d2).getTime()) <= 1000) {
return true;
} else {
return false;
}
}
function TimeClip( t ) {
if ( isNaN( t ) ) {
return ( Number.NaN );
}
if ( Math.abs( t ) > 8.64e15 ) {
return ( Number.NaN );
}
return ( ToInteger( t ) );
}
// TODO: --END-- REVIEW AS4 CONVERSION ISSUE
// var SECTION = "15.9.5.22";
// var VERSION = "ECMA_1";
// var TITLE = "Date.prototype.getTimezoneOffset()";
var testcases = getTestCases();
function getTestCases() {
var array = new Array();
var item = 0;
var TZ_ADJUST = TZ_DIFF * msPerHour;
// get the current time
var now = (new Date()).valueOf();
// calculate time for year 0
for ( var time = 0, year = 1969; year >= 0; year-- ) {
time -= TimeInYear(year);
}
// get time for 29 feb 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour;
// get time for 1 jan 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+
TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004);
addTestCase( TIME_1970 );
/*
addTestCase( TIME_1900 );
addTestCase( TIME_2000 );
addTestCase( UTC_FEB_29_2000 );
addTestCase( UTC_JAN_1_2005 );
array[item++] = Assert.expectEq(
"(new Date(NaN)).getTimezoneOffset()",
NaN,
(new Date(NaN)).getTimezoneOffset() );
array[item++] = Assert.expectEq(
"Date.prototype.getTimezoneOffset.length",
0,
Date.prototype.getTimezoneOffset.length );
*/
function addTestCase( t ) {
for ( m = 0; m <= 1000; m+=100 ) {
t++;
array[item++] = Assert.expectEq(
"(new Date("+t+")).getTimezoneOffset()",
(t - LocalTime(t)) / msPerMinute,
(new Date(t)).getTimezoneOffset() );
}
}
return array;
}
|
package metaswarm.scrap {
import flash.display.*;
import flash.events.*;
import flash.net.URLRequest;
import metaswarm.node.components.thumb.BitmapLoadr;
import metaswarm.node.components.Particle;
public class Image extends Particle{
var path:String;
var ldr:BitmapLoadr;
var bmp:Bitmap;
var bmpLoaded:Boolean;
public function Image():void {
ldr = new BitmapLoadr(this);
bmp = new Bitmap();
bmpLoaded = false;
init();
}
public function init():void {
addChild(ldr);
//l.loadImg("fake string");
visible = false;
//focusRect = true;
//tabEnabled = true;
}
public function load(path:String):void{
this.path = path;
}
public function make():void{
if(!bmpLoaded){
ldr.loadBmp(path);
bmpLoaded = true;
}
}
}
} |
package serverProto.secondAwakenItemExchange
{
import com.netease.protobuf.Message;
import com.netease.protobuf.fieldDescriptors.RepeatedFieldDescriptor$TYPE_MESSAGE;
import com.netease.protobuf.WireType;
import serverProto.inc.ProtoItemInfo;
import com.netease.protobuf.WritingBuffer;
import com.netease.protobuf.WriteUtils;
import flash.utils.IDataInput;
import com.netease.protobuf.ReadUtils;
public final class ProtoSecondAwakenExchangeReq extends Message
{
public static const ITEM_LIST:RepeatedFieldDescriptor$TYPE_MESSAGE = new RepeatedFieldDescriptor$TYPE_MESSAGE("serverProto.secondAwakenItemExchange.ProtoSecondAwakenExchangeReq.item_list","itemList",1 << 3 | WireType.LENGTH_DELIMITED,ProtoItemInfo);
[ArrayElementType("serverProto.inc.ProtoItemInfo")]
public var itemList:Array;
public function ProtoSecondAwakenExchangeReq()
{
this.itemList = [];
super();
}
override final function writeToBuffer(param1:WritingBuffer) : void
{
var _loc3_:* = undefined;
var _loc2_:uint = 0;
while(_loc2_ < this.itemList.length)
{
WriteUtils.writeTag(param1,WireType.LENGTH_DELIMITED,1);
WriteUtils.write$TYPE_MESSAGE(param1,this.itemList[_loc2_]);
_loc2_++;
}
for(_loc3_ in this)
{
super.writeUnknown(param1,_loc3_);
}
}
override final function readFromSlice(param1:IDataInput, param2:uint) : void
{
/*
* Decompilation error
* Code may be obfuscated
* Tip: You can try enabling "Automatic deobfuscation" in Settings
* Error type: IndexOutOfBoundsException (Index: 1, Size: 1)
*/
throw new flash.errors.IllegalOperationError("Not decompiled due to error");
}
}
}
|
package com.ankamagames.dofus.datacenter.documents
{
import com.ankamagames.dofus.types.IdAccessors;
import com.ankamagames.jerakine.data.GameData;
import com.ankamagames.jerakine.data.I18n;
import com.ankamagames.jerakine.interfaces.IDataCenter;
public class Document implements IDataCenter
{
private static const MODULE:String = "Documents";
private static const PAGEFEED:String = "<pagefeed/>";
public static var idAccessors:IdAccessors = new IdAccessors(getDocumentById,getDocuments);
public var id:int;
public var typeId:uint;
public var showTitle:Boolean;
public var showBackgroundImage:Boolean;
public var titleId:uint;
public var authorId:uint;
public var subTitleId:uint;
public var contentId:uint;
public var contentCSS:String;
public var clientProperties:String;
private var _title:String;
private var _author:String;
private var _subTitle:String;
private var _content:String;
private var _pages:Array;
public function Document()
{
super();
}
public static function getDocumentById(id:int) : Document
{
return GameData.getObject(MODULE,id) as Document;
}
public static function getDocuments() : Array
{
return GameData.getObjects(MODULE);
}
public function get title() : String
{
if(!this._title)
{
this._title = I18n.getText(this.titleId);
}
return this._title;
}
public function get author() : String
{
if(!this._author)
{
this._author = I18n.getText(this.authorId);
}
return this._author;
}
public function get subTitle() : String
{
if(!this._subTitle)
{
this._subTitle = I18n.getText(this.subTitleId);
if(this._subTitle.charAt(0) == "[")
{
this._subTitle = "";
}
}
return this._subTitle;
}
public function get content() : String
{
if(!this._content)
{
this._content = I18n.getText(this.contentId);
}
return this._content;
}
public function get pages() : Array
{
if(!this._pages)
{
this._pages = this.content.split(PAGEFEED);
}
return this._pages;
}
}
}
|
package examples.fiducial
{
import mx.core.UIComponent;
/**
* Allows to include a Flash Sprite into a Flex application.
* In this example the multi-touch and TUI example app is being
* included.
*
* @author Johannes Luderschmidt
*
*/
public class FlashToMXMLWrapper extends UIComponent
{
private var fiducialTest:TUIOAS3FiducialExampleFlash;
public function FlashToMXMLWrapper()
{
super();
}
/**
* initializes the Flash Sprite. In createChildren() of UIComponent (and ONLY
* here) DisplayObject that do inherit from DisplayObject but do NOT inherit
* from UIComponent may be added to a UIComponent.
*
*/
override protected function createChildren():void{
if(!fiducialTest){
fiducialTest = new TUIOAS3FiducialExampleFlash();
addChild(fiducialTest);
}
}
}
} |
package core.communication
{
import core.communication.base.CoreBaseCommunication;
import core.communication.utils.CoreCommunicationUtils;
import flash.net.URLRequest;
import flash.net.navigateToURL;
public class CoreCommunicationWeb extends CoreBaseCommunication
{
public function CoreCommunicationWeb()
{
super();
}
override public function sendEmail(address:String):void
{
if (!CoreCommunicationUtils.isValidEmail(address))
{
log("the email adress is not valide!!!");
return;
}
navigateToURL(new URLRequest('mailto::' + address));
}
override public function sendSms(number:String):void
{
throw new Error('web platform can not send sms!');
}
override public function phoneCall(number:String):void
{
throw new Error('web platform can not phone call!');
}
{
throw new Error('web platform can not send sms!');
}
}
}
|
package com.vmware.simplivity.citrixplugin {
import com.vmware.flexutil.ServiceUtil;
import com.vmware.flexutil.proxies.BaseProxy;
/**
* Proxy class for the GlobalService java service
*/
public class DeconfigurationServiceProxy extends BaseProxy {
// Service name matching the flex:remoting-destination declared in
// main/webapp/WEB-INF/spring/bundle-context.xml
private static const SERVICE_NAME:String = "DeconfigurationService";
/**
* Create a GlobalServiceProxy with a secure channel.
*/
public function DeconfigurationServiceProxy() {
// channelUri uses the Web-ContextPath defined in MANIFEST.MF
const channelUri:String = ServiceUtil.getDefaultChannelUri(CitrixPluginModule.contextPath);
super(SERVICE_NAME, channelUri);
}
public function deconfigure(input:BaseInputData, rowNumber:int, callback:Function = null,
context:Object = null):void {
callService("deconfigure", [input, rowNumber], callback, context);
}
}
} |
//------------------------------------------------------------------------------
// Copyright (c) 2011 the original author or authors. All Rights Reserved.
//
// NOTICE: You are permitted to use, modify, and distribute this file
// in accordance with the terms of the license agreement accompanying it.
//------------------------------------------------------------------------------
package robotlegs.bender.extensions.navigator.support
{
public class CallbackCommand
{
[Inject(name="executeCallback")]
public var callback:Function;
public function execute():void
{
callback();
}
}
}
|
package punk.transition.effects
{
import net.flashpunk.Entity;
import net.flashpunk.FP;
/**
* @author GIT: cjke
* @author Mail: cjke.7777@gmail.com
*/
public class StarOut extends Star
{
public function StarOut(options:Object = null)
{
super(options);
_scale = 10;
}
override public function render():void
{
super.render();
_scale += ((FP.timeInFrames ? 1 : FP.elapsed) / _duration) * _distance;
if(_scale > _distance)
{
_onComplete();
}
}
}
} |
/**
* <p>Original Author: Daniel Freeman</p>
*
* <p>Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:</p>
*
* <p>The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.</p>
*
* <p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.</p>
*
* <p>Licensed under The MIT License</p>
* <p>Redistributions of files must retain the above copyright notice.</p>
*/
package com.danielfreeman.madcomponents
{
import flash.display.DisplayObject;
import flash.display.Sprite;
import flash.text.TextFormat;
/**
* MadComponents circular container
* <pre>
* <circular
* id = "IDENTIFIER"
* background = "#rrggbb, #rrggbb, ..."
* alignH = "left|right|centre|fill"
* alignV = "top|bottom|centre"
* />
* </pre>
*/
public class UICircular extends UIContainerBaseClass {
protected var _radius:uint = uint.MAX_VALUE;
protected var _maximumWidth:Number = 0.0;
protected var _maximumHeight:Number = 0.0;
protected var _startAngle:Number = 0;
protected var _finishAngle:Number;
public function UICircular(screen:Sprite, xml:XML, attributes:Attributes) {
super(screen, xml, attributes);
}
override protected function initialise(xml:XML, attributes:Attributes):void {
if (xml.@radius.length() > 0) {
_radius = parseInt(xml.@radius);
}
if (xml.@startAngle.length() > 0) {
_startAngle = parseFloat(xml.@startAngle);
}
if (xml.@finishAngle.length() > 0) {
_finishAngle = parseFloat(xml.@finishAngle);
}
else {
_finishAngle = (xml.children().length() - 1) * 360 / xml.children().length();
}
for each (var xmlChild:XML in xml.children()) {
var childAttributes:Attributes = attributes.copy(xml, true);
var localName:String = xmlChild.localName();
if (UI.isContainer(localName)) {
var child:DisplayObject = UI.containers(this, xmlChild, childAttributes);
_maximumWidth = Math.max(_maximumWidth, child.width);
_maximumHeight = Math.max(_maximumHeight, child.height);
}
else {
trace(localName," not supported by UICircular");
}
}
}
override public function layout(attributes:Attributes):void {
super.layout(attributes);
drawComponent();
}
override public function drawComponent():void {
super.drawComponent();
var useRadius:int = Math.min(_radius, (_attributes.width - _maximumWidth) / 2, (_attributes.height - _maximumHeight) / 2);
var interval:Number = (_finishAngle - _startAngle) / (numChildren - 1);
for (var i:int = 0; i < numChildren; i++) {
var angle:Number = (_startAngle + i * interval) / 180 * Math.PI;
var item:DisplayObject = getChildAt(i);
item.x = _attributes.width / 2 + useRadius * Math.sin(angle) - item.width / 2;
item.y = _attributes.height / 2 - useRadius * Math.cos(angle) - item.height / 2;
}
}
}
} |
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is [Open Source Virtual Machine.].
*
* The Initial Developer of the Original Code is
* Adobe System Incorporated.
* Portions created by the Initial Developer are Copyright (C) 2004-2006
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Adobe AS3 Team
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
package PublicClassImpPublicInt{
use namespace ns;
public class PublicClass implements PublicInt{
public function deffunc():String{ //Default method
return"PASSED";
}
public function getdeffunc():String{return deffunc();}
// access default function deffunc
public function pubFunc():Boolean{ //Public method
return true;
}
ns function nsFunc(a="test"):int{ //Namespace method
return a.length;
}
public function getnsFunc(a="test"):int{return ns::nsFunc(a);}
// access default function nsFunc
}
}
|
package laya.webgl.resource {
import laya.maths.Arith;
import laya.renders.Render;
import laya.resource.Bitmap;
import laya.resource.Context;
import laya.webgl.WebGL;
import laya.webgl.WebGLContext;
import laya.webgl.atlas.AtlasResourceManager;
public class WebGLSubImage extends Bitmap implements IMergeAtlasBitmap {
/*[DISABLE-ADD-VARIABLE-DEFAULT-VALUE]*/
/**HTML Context*/
private var _ctx:Context;
/***是否创建私有Source,值为false时不根据src创建私有WebGLTexture,同时销毁时也只清空source=null,不调用WebGL.mainContext.deleteTexture类似函数,调用资源激活前有效*/
private var _allowMerageInAtlas:Boolean;
/**是否允许加入大图合集*/
private var _enableMerageInAtlas:Boolean;
/**HTML Canvas,绘制子图载体,非私有数据载体*/
public var canvas:*;
/**是否使用重复模式纹理寻址*/
public var repeat:Boolean;
/**是否使用mipLevel*/
public var mipmap:Boolean;
/**缩小过滤器*/
public var minFifter:int;//动态默认值,判断是否可生成miplevel
/**放大过滤器*/
public var magFifter:int;//动态默认值,判断是否可生成miplevel
public var atlasImage:*;
public var offsetX:int = 0;
public var offsetY:int = 0;
public var src:String;
///**像素,私有数据*/
//public var imageData:*
//public var createFromPixel:Boolean = true;
public function get atlasSource():* {
return canvas;
}
/**
* 是否创建私有Source
* @return 是否创建
*/
public function get allowMerageInAtlas():Boolean {
return _allowMerageInAtlas;
}
/**
* 是否创建私有Source
* @return 是否创建
*/
public function get enableMerageInAtlas():Boolean {
return _allowMerageInAtlas;
}
/**
* 是否创建私有Source,通常禁止修改
* @param value 是否创建
*/
public function set enableMerageInAtlas(value:Boolean):void {
_allowMerageInAtlas = value;
}
public function WebGLSubImage(canvas:*, offsetX:int, offsetY:int, width:int, height:int, atlasImage:*, src:String) {
super();
repeat = true;
mipmap = false;
minFifter = -1;
magFifter = -1;
this.atlasImage = atlasImage;
this.canvas = canvas;
_ctx = canvas.getContext('2d', undefined);
_w = width;
_h = height;
this.offsetX = offsetX;
this.offsetY = offsetY;
this.src = src;
_enableMerageInAtlas = true;
(AtlasResourceManager.enabled) && (_w < AtlasResourceManager.atlasLimitWidth && _h < AtlasResourceManager.atlasLimitHeight) ? _allowMerageInAtlas = true : _allowMerageInAtlas = false;
}
/*override public function copyTo(dec:Bitmap):void {
var d:WebGLSubImage = dec as WebGLSubImage;
super.copyTo(dec);
d._ctx = _ctx;
}*/
private function size(w:Number, h:Number):void {
_w = w;
_h = h;
_ctx && _ctx.size(w, h);
canvas && (canvas.height = h, canvas.width = w);
}
override protected function recreateResource():void {
size(_w, _h);
_ctx.drawImage(atlasImage, offsetX, offsetY, _w, _h, 0, 0, _w, _h);
//imageData = _ctx.getImageData(0, 0, _w, _h);
(!(_allowMerageInAtlas && _enableMerageInAtlas)) ? (createWebGlTexture()) : (memorySize = 0/*, _recreateLock = false*/);
completeCreate();
}
private function createWebGlTexture():void {
var gl:WebGLContext = WebGL.mainContext;
if (!canvas) {
throw "create GLTextur err:no data:" + canvas;
}
var glTex:* = _source = gl.createTexture();
var preTarget:* = WebGLContext.curBindTexTarget;
var preTexture:* = WebGLContext.curBindTexValue;
WebGLContext.bindTexture(gl, WebGLContext.TEXTURE_2D, glTex);
if (Render.isConchWebGL) {
gl.texImage2DEx(true, WebGLContext.TEXTURE_2D, 0, WebGLContext.RGBA, WebGLContext.RGBA, WebGLContext.UNSIGNED_BYTE, canvas);
}
else {
gl.pixelStorei(WebGLContext.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
gl.texImage2D(WebGLContext.TEXTURE_2D, 0, WebGLContext.RGBA, WebGLContext.RGBA, WebGLContext.UNSIGNED_BYTE, canvas);
gl.pixelStorei(WebGLContext.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);
}
var minFifter:int = this.minFifter;
var magFifter:int = this.magFifter;
var repeat:int = this.repeat ? WebGLContext.REPEAT : WebGLContext.CLAMP_TO_EDGE
var isPOT:Boolean = Arith.isPOT(width, height);//提前修改内存尺寸,忽悠异步影响
if (isPOT) {
if (this.mipmap)
(minFifter !== -1) || (minFifter = WebGLContext.LINEAR_MIPMAP_LINEAR);
else
(minFifter !== -1) || (minFifter = WebGLContext.LINEAR);
(magFifter !== -1) || (magFifter = WebGLContext.LINEAR);
gl.texParameteri(WebGLContext.TEXTURE_2D, WebGLContext.TEXTURE_MAG_FILTER, magFifter);
gl.texParameteri(WebGLContext.TEXTURE_2D, WebGLContext.TEXTURE_MIN_FILTER, minFifter);
gl.texParameteri(WebGLContext.TEXTURE_2D, WebGLContext.TEXTURE_WRAP_S, repeat);
gl.texParameteri(WebGLContext.TEXTURE_2D, WebGLContext.TEXTURE_WRAP_T, repeat);
this.mipmap && gl.generateMipmap(WebGLContext.TEXTURE_2D);
} else {
(minFifter !== -1) || (minFifter = WebGLContext.LINEAR);
(magFifter !== -1) || (magFifter = WebGLContext.LINEAR);
gl.texParameteri(WebGLContext.TEXTURE_2D, WebGLContext.TEXTURE_MIN_FILTER, minFifter);
gl.texParameteri(WebGLContext.TEXTURE_2D, WebGLContext.TEXTURE_MAG_FILTER, magFifter);
gl.texParameteri(WebGLContext.TEXTURE_2D, WebGLContext.TEXTURE_WRAP_S, WebGLContext.CLAMP_TO_EDGE);
gl.texParameteri(WebGLContext.TEXTURE_2D, WebGLContext.TEXTURE_WRAP_T, WebGLContext.CLAMP_TO_EDGE);
}
(preTarget && preTexture) && (WebGLContext.bindTexture(gl, preTarget, preTexture));
canvas = null;
if (isPOT && this.mipmap)
memorySize = _w * _h * 4 * (1 + 1 / 3);//使用mipmap则在原来的基础上增加1/3
else
memorySize = _w * _h * 4;
}
override protected function disposeResource():void {
if (!(AtlasResourceManager.enabled && _allowMerageInAtlas) && _source) {
WebGL.mainContext.deleteTexture(_source);
_source = null;
memorySize = 0;
}
}
///***调整尺寸*/
//override protected function onresize():void {
//this._w = this._image.width;
//this._h = this._image.height;
//}
public function clearAtlasSource():void {
//canvas = null;//资源恢复时问题
}
}
} |
////////////////////////////////////////////////////////////////////////////////
//
// Licensed to the Apache Software Foundation (ASF) under one or more
// contributor license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright ownership.
// The ASF licenses this file to You under the Apache License, Version 2.0
// (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////
package mx.globalization
{
// originally flash.xx
import mx.globalization.LastOperationStatus;
import mx.globalization.LocaleID;
import mx.formatters.NumberBase;
import mx.formatters.NumberFormatter;
/**
* The NumberFormatter class provides locale-sensitive formatting and parsing
* of numeric values. It can format <code>int</code>, <code>uint</code>, and
* <code>Number</code> objects.
*
* <p>The NumberFormatter class uses the data and functionality provided by
* the operating system and is designed to format numbers according to the
* conventions of a specific locale, based on the user's preferences and
* features supported by the user's operating system. The position of the
* negative symbol, the decimal separator, the grouping separator, the
* grouping pattern, and other elements within the number format can vary
* depending on the locale.</p>
*
* <p>If the operating system supports the requested locale, the number
* formatting properties are set according to the conventions and defaults of
* the requested locale. If the requested locale is not available, then the
* properties are set according to a fallback or default system locale, which
* can be retrieved using the <code>actualLocaleIDName</code> property.</p>
*
* <p>Due to the use of the user's settings, the use of formatting patterns
* provided by the operating system, and the use of a fallback locale when a
* requested locale is not supported, different users can see different
* formatting results, even when using the same locale ID.</p>
*
* @langversion 3.0
* @playerversion Flash 10.1
* @playerversion AIR 2.0
* @productversion Royale 0.9.8
*/
public class NumberFormatter
{
/**
* The name of the actual locale ID used by this NumberFormatter object.
*
* <p>There are three possibilities for the value of the name, depending on
* operating system and the value of the <code>requestedLocaleIDName</code>
* parameter passed to the <code>Collator()</code> constructor.</p>
*
* <ol>
* <li>If the requested locale was not <code>LocaleID.DEFAULT</code> and the
* operating system provides support for the requested locale, then the name
* returned is the same as the <code>requestedLocaleIDName</code>
* property.</li>
* <li>If <code>LocaleID.DEFAULT</code> was used as the value for the
* <code>requestedLocaleIDName</code> parameter to the constructor, then the
* name of the current locale specified by the user's operating system is
* used. The <code>LocaleID.DEFAULT</code> value preserves user's customized
* setting in the OS. Passing an explicit value as the
* <code>requestedLocaleIDName</code> parameter does not necessarily give the
* same result as using the <code>LocaleID.DEFAULT</code> even if the two
* locale ID names are the same. The user could have customized the locale
* settings on their machine, and by requesting an explicit locale ID name
* rather than using <code>LocaleID.DEFAULT</code> your application would not
* retrieve those customized settings.</li>
* <li>If the system does not support the <code>requestedLocaleIDName</code>
* specified in the constructor then a fallback locale ID name is
* provided.</li>
* </ol>
*
* @see LocaleID
* @see #requestedLocaleIDName
* @see #NumberFormatter()
*
* @langversion 3.0
* @playerversion Flash 10.1
* @playerversion AIR 2.0
* @productversion Royale 0.9.8
*/
public var actualLocaleIDName:String;
/**
* The status of previous operation that this NumberFormatter object
* performed. The <code>lastOperationStatus</code> property is set whenever
* the constructor or a method of this class is called, or another property is
* set. For the possible values see the description for each method.
*
* @see LastOperationStatus
*
* @langversion 3.0
* @playerversion Flash 10.1
* @playerversion AIR 2.0
* @productversion Royale 0.9.8
*/
public var lastOperationStatus:String;
/**
* The name of the requested locale ID that was passed to the constructor of
* this NumberFormatter object.
*
* <p>If the <code>LocaleID.DEFAULT</code> value was used then the name
* returned is "i-default". The actual locale used can differ from the
* requested locale when a fallback locale is applied. The name of the actual
* locale can be retrieved using the <code>actualLocaleIDName</code>
* property.</p>
*
* @see LocaleID
* @see #actualLocaleIDName
* @see #NumberFormatter()
*
* @langversion 3.0
* @playerversion Flash 10.1
* @playerversion AIR 2.0
* @productversion Royale 0.9.8
*/
public var requestedLocaleIDName:String;
/**
* The decimal separator character used for formatting or parsing numbers that
* have a decimal part.
*
* <p>This property is initially set based on the locale that is selected when
* the formatter object is constructed.</p>
*
* <p>When this property is assigned a value and there are no errors or
* warnings, the <code>lastOperationStatus</code> property is set to:</p>
*
* <ul>
* <li><code>LastOperationStatus.NO_ERROR</code></li>
* </ul>
*
* <p>Otherwise the <code>lastOperationStatus</code> property is set to one of
* the constants defined in the <code>LastOperationStatus</code> class.</p>
*
* @default dependent on the locale and operating system
*
* @throws TypeError if this property is assigned a null value.
*
* @see #formatInt()
* @see #formatNumber()
* @see #formatUInt()
* @see #lastOperationStatus
* @see LastOperationStatus
*
* @langversion 3.0
* @playerversion Flash 10.1
* @playerversion AIR 2.0
* @productversion Royale 0.9.8
*/
public var decimalSeparator:String;
/**
* Defines the set of digit characters to be used when formatting numbers.
*
* <p>Different languages and regions use different sets of characters to
* represent the digits 0 through 9. This property defines the set of digits
* to be used.</p>
*
* <p>The value of this property represents the Unicode value for the zero
* digit of a decimal digit set. The valid values for this property are
* defined in the NationalDigitsType class.</p>
*
* <p>When this property is assigned a value and there are no errors or
* warnings, the <code>lastOperationStatus</code> property is set to:</p>
*
* <ul>
* <li><code>LastOperationStatus.NO_ERROR</code></li>
* </ul>
*
* <p>Otherwise the <code>lastOperationStatus</code> property is set to one of
* the constants defined in the <code>LastOperationStatus</code> class.</p>
*
* @default <code>dependent on the locale and operating system</code>
*
* @throws TypeError if this property is assigned a null value.
*
* @see #lastOperationStatus
* @see LastOperationStatus
* @see NationalDigitsType
*
* @langversion 3.0
* @playerversion Flash 10.1
* @playerversion AIR 2.0
* @productversion Royale 0.9.8
*/
public var digitsType:uint;
/**
* The maximum number of digits that can appear after the decimal separator.
*
* <p>Numbers are rounded to the number of digits specified by this property.
* <b>The rounding scheme varies depending on the user's operating
* system.</b></p>
*
* <p>When the <code>trailingZeros</code> property is set to
* <code>true</code>, the fractional portion of the number (after the
* decimal point) is padded with trailing zeros until its length matches the
* value of this <code>fractionalDigits</code> property.</p>
*
* <p>When this property is assigned a value and there are no errors or
* warnings, the <code>lastOperationStatus</code> property is set to:</p>
*
* <ul>
* <li><code>LastOperationStatus.NO_ERROR</code></li>
* </ul>
*
* <p>Otherwise the <code>lastOperationStatus</code> property is set to one of
* the constants defined in the <code>LastOperationStatus</code> class.</p>
*
* @default <code>0</code>
*
* @see #trailingZeros
* @see #lastOperationStatus
* @see LastOperationStatus
*
* @langversion 3.0
* @playerversion Flash 10.1
* @playerversion AIR 2.0
* @productversion Royale 0.9.8
*/
public var fractionalDigits:int;
/**
* Describes the placement of grouping separators within the formatted number
* string.
*
* <p>When the <code>useGrouping</code> property is set to true, the
* <code>groupingPattern</code> property is used to define the placement and
* pattern used for the grouping separator.</p>
*
* <p>The grouping pattern is defined as a string containing numbers
* separated by semicolons and optionally may end with an asterisk. For
* example: <code>"3;2;*"</code>. Each number in the string represents the
* number of digits in a group. The grouping separator is placed before each
* group of digits. An asterisk at the end of the string indicates that groups
* with that number of digits should be repeated for the rest of the formatted
* string. If there is no asterisk then there are no additional groups or
* separators for the rest of the formatted string. </p>
*
* <p>The first number in the string corresponds to the first group of digits
* to the left of the decimal separator. Subsequent numbers define the number
* of digits in subsequent groups to the left. Thus the string "3;2;*"
* indicates that a grouping separator is placed after the first group of 3
* digits, followed by groups of 2 digits. For example:
* <code>98,76,54,321</code></p>
*
* <p>The following table shows examples of formatting the number
* 123456789.12 with various grouping patterns. The grouping separator is a
* comma and the decimal separator is a period.</p>
*
* <table class="innertable">
* <tbody>
* <tr>
* <td>Grouping Pattern</td>
* <td>Sample Format</td>
* </tr>
* <tr>
* <td><code>3;*</code></td>
* <td>123,456,789.12</td>
* </tr>
* <tr>
* <td><code>3;2;*</code></td>
* <td>12,34,56,789.12</td>
* </tr>
* <tr>
* <td><code>3</code></td>
* <td>123456,789.12</td>
* </tr>
* </tbody>
* </table>
*
* <p>Only a limited number of grouping sizes can be defined. On some
* operating systems, grouping patterns can only contain two numbers plus an
* asterisk. Other operating systems can support up to four numbers and an
* asterisk. For patterns without an asterisk, some operating systems only
* support one number while others support up to three numbers. If the
* maximum number of grouping pattern elements is exceeded, then additional
* elements are ignored and the <code>lastOperationStatus</code> property is
* set as described below.</p>
*
* <p>When this property is assigned a value and there are no errors or
* warnings, the <code>lastOperationStatus</code> property is set to:</p>
*
* <ul>
* <li><code>LastOperationStatus.NO_ERROR</code></li>
* </ul>
*
* <p>Otherwise the <code>lastOperationStatus</code> property is set to one of
* the constants defined in the <code>LastOperationStatus</code> class.</p>
*
* @throws TypeError if this property is assigned a null value.
*
* @see #groupingSeparator
* @see #useGrouping
* @see #lastOperationStatus
* @see LastOperationStatus
*
* @langversion 3.0
* @playerversion Flash 10.1
* @playerversion AIR 2.0
* @productversion Royale 0.9.8
*/
public var groupingPattern:String;
/**
* The character or string used for the grouping separator.
*
* <p>The value of this property is used as the grouping separator when
* formatting numbers with the <code>useGrouping</code> property set to
* <code>true</code>. This property is initially set based on the locale
* that is selected when the formatter object is constructed.</p>
*
* <p>When this property is assigned a value and there are no errors or
* warnings, the <code>lastOperationStatus</code> property is set to:</p>
*
* <ul>
* <li><code>LastOperationStatus.NO_ERROR</code></li>
* </ul>
*
* <p>Otherwise the <code>lastOperationStatus</code> property is set to one of
* the constants defined in the <code>LastOperationStatus</code> class.</p>
*
* @default <code>dependent on the locale and operating system</code>
*
* @throws TypeError if this property is assigned a null value.
*
* @see #formatInt()
* @see #formatNumber()
* @see #formatUInt()
* @see #useGrouping
* @see #lastOperationStatus
* @see LastOperationStatus
*
* @langversion 3.0
* @playerversion Flash 10.1
* @playerversion AIR 2.0
* @productversion Royale 0.9.8
*/
public var groupingSeparator:String;
/**
* Specifies whether a leading zero is included in a formatted number when
* there are no integer digits to the left of the decimal separator.
*
* <p>When this property is set to <code>true</code> a leading zero is
* included to the left of the decimal separator when formatting numeric
* values between -1.0 and 1.0. When this property is set to
* <code>false</code> a leading zero is not included.</p>
*
* <p>For example if the number is 0.321 and this property is set
* <code>true</code>, then the leading zero is included in the formatted
* string. If the property is set to <code>false</code>, the leading zero
* is not included. In that case the string would just include the decimal
* separator followed by the decimal digits, like <code>.321</code>. </p>
*
* <p>The following table shows examples of how numbers are formatted based on
* the values of this property and the related <code>fractionalDigits</code>
* and <code>trailingZeros</code> properties.</p>
*
* <table class="innertable">
* <tbody>
* <tr>
* <td>trailingZeros</td>
* <td><b>leadingZero</b></td>
* <td>fractionalDigits</td>
* <td>0.12</td>
* <td>0</td>
* </tr>
* <tr>
* <td>true</td>
* <td>true</td>
* <td>3</td>
* <td>0.120</td>
* <td>0.000</td>
* </tr>
* <tr>
* <td>false</td>
* <td>true</td>
* <td>3</td>
* <td>0.12</td>
* <td>0</td>
* </tr>
* <tr>
* <td>true</td>
* <td>false</td>
* <td>3</td>
* <td>.120</td>
* <td>.000</td>
* </tr>
* <tr>
* <td>false</td>
* <td>false</td>
* <td>3</td>
* <td>.12</td>
* <td>0</td>
* </tr>
* </tbody>
* </table>
*
* <p>When this property is assigned a value and there are no errors or
* warnings, the <code>lastOperationStatus</code> property is set to:</p>
*
* <ul>
* <li><code>LastOperationStatus.NO_ERROR</code></li>
* </ul>
*
* <p>Otherwise the <code>lastOperationStatus</code> property is set to one of
* the constants defined in the <code>LastOperationStatus</code> class.</p>
*
* @default <code>dependent on the locale and operating system</code>
*
* @throws TypeError if this property is assigned a null value.
*
* @see #formatInt()
* @see #formatNumber()
* @see #formatUInt()
* @see #trailingZeros
* @see #lastOperationStatus
* @see LastOperationStatus
*
* @langversion 3.0
* @playerversion Flash 10.1
* @playerversion AIR 2.0
* @productversion Royale 0.9.8
*/
public var leadingZero:Boolean;
/**
* A numeric value that indicates a formatting pattern for negative numbers.
* This pattern defines the location of the negative symbol or parentheses
* in relation to the numeric portion of the formatted number.
*
* <p> The following table summarizes the possible formats for negative
* numbers. When a negative number is formatted, the minus sign in the format
* is replaced with the value of the <code>negativeSymbol</code> property and
* the 'n' character is replaced with the formatted numeric value.</p>
*
* <table class="innertable">
* <tbody>
* <tr>
* <td>Negative number format type</td>
* <td>Format</td>
* </tr>
* <tr>
* <td>0</td>
* <td>(n)</td>
* </tr>
* <tr>
* <td>1</td>
* <td>-n</td>
* </tr>
* <tr>
* <td>2</td>
* <td>- n</td>
* </tr>
* <tr>
* <td>3</td>
* <td>n-</td>
* </tr>
* <tr>
* <td>4</td>
* <td>n -</td>
* </tr>
* </tbody>
* </table>
*
* <p>When this property is assigned a value and there are no errors or
* warnings, the <code>lastOperationStatus</code> property is set to:</p>
*
* <ul>
* <li><code>LastOperationStatus.NO_ERROR</code></li>
* </ul>
*
* <p>Otherwise the <code>lastOperationStatus</code> property is set to one of
* the constants defined in the <code>LastOperationStatus</code> class.</p>
*
* @default <code>dependent on the locale and operating system</code>
*
* @throws ArgumentError if the assigned value is not a number between 0 and 4.
*
* @see #negativeSymbol
* @see #formatInt()
* @see #formatNumber()
* @see #formatUInt()
* @see #lastOperationStatus
* @see LastOperationStatus
*
* @langversion 3.0
* @playerversion Flash 10.1
* @playerversion AIR 2.0
* @productversion Royale 0.9.8
*/
public var negativeNumberFormat:uint;
/**
* The negative symbol to be used when formatting negative values.
*
* <p>This symbol is used with the negative number format when formatting a
* number that is less than zero. It is not used in negative number formats
* that do not include a negative sign (e.g. when negative numbers are
* enclosed in parentheses). </p>
*
* <p> This property is set to a default value for the actual locale selected
* when this formatter is constructed. It can be set with a value to override
* the default setting.</p>
*
* <p>When this property is assigned a value and there are no errors or
* warnings, the <code>lastOperationStatus</code> property is set to:</p>
*
* <ul>
* <li><code>LastOperationStatus.NO_ERROR</code></li>
* </ul>
*
* <p>Otherwise the <code>lastOperationStatus</code> property is set to one of
* the constants defined in the <code>LastOperationStatus</code> class.</p>
*
* @throws MemoryError if the system cannot allocate enough internal memory.
*
* @see #negativeNumberFormat
* @see #formatInt()
* @see #formatNumber()
* @see #formatUInt()
* @see #lastOperationStatus
* @see LastOperationStatus
*
* @langversion 3.0
* @playerversion Flash 10.1
* @playerversion AIR 2.0
* @productversion Royale 0.9.8
*/
public var negativeSymbol:String;
/**
* Specifies whether trailing zeros are included in a formatted number.
*
* <p>When this property is set to <code>true</code>, trailing zeros are
* included in the fractional part of the formatted number up to the limit
* specified by the <code>fractionalDigits</code> property. When this
* property is set to <code>false</code> then no trailing zeros are shown.</p>
*
* <p>For example if the numeric value is 123.4, and this property is set
* true, and the <code>fractionalDigits</code> property is set to 3, the
* formatted string would show trailing zeros, like <code>123.400</code> .
* If this property is <code>false</code>, trailing zeros are not included,
* and the string shows just the decimal separator followed by the non-zero
* decimal digits, like <code>123.4</code> .</p>
*
* <p>The following table shows examples of how numeric values are formatted
* based on the values of this property and the related
* <code>fractionalDigits</code> and <code>leadingZero</code> properties.</p>
*
* <table class="innertable">
* <tbody>
* <tr>
* <td><b>trailingZeros</b></td>
* <td>leadingZero</td>
* <td>fractionalDigits</td>
* <td>0.12</td>
* <td>0</td>
* </tr>
* <tr>
* <td>true</td>
* <td>true</td>
* <td>3</td>
* <td>0.120</td>
* <td>0.000</td>
* </tr>
* <tr>
* <td>false</td>
* <td>true</td>
* <td>3</td>
* <td>0.12</td>
* <td>0</td>
* </tr>
* <tr>
* <td>true</td>
* <td>false</td>
* <td>3</td>
* <td>.120</td>
* <td>.000</td>
* </tr>
* <tr>
* <td>false</td>
* <td>false</td>
* <td>3</td>
* <td>.12</td>
* <td>0</td>
* </tr>
* </tbody>
* </table>
*
* <p>When this property is assigned a value and there are no errors or
* warnings, the <code>lastOperationStatus</code> property is set to:</p>
*
* <ul>
* <li><code>LastOperationStatus.NO_ERROR</code></li>
* </ul>
*
* <p>Otherwise the <code>lastOperationStatus</code> property is set to one of
* the constants defined in the <code>LastOperationStatus</code> class.</p>
*
* @default <code>dependent on the locale and operating system</code>
*
* @throws TypeError if this property is assigned a null value.
*
* @see #leadingZero
* @see #lastOperationStatus
* @see LastOperationStatus
*
* @langversion 3.0
* @playerversion Flash 10.1
* @playerversion AIR 2.0
* @productversion Royale 0.9.8
*/
public var trailingZeros:Boolean;
/**
* Enables the use of the grouping separator when formatting numbers.
*
* <p>When the <code>useGrouping</code> property is set to <code>true</code>,
* digits are grouped and delimited by the grouping separator character. For
* example: <code>123,456,789.22</code></p>
*
* <p>When the <code>useGrouping</code> property is set to <code>false</code>,
* digits are not grouped or separated. For example:
* <code>123456789.22</code></p>
*
* <p>The symbol to be used as a grouping separator is defined by the
* <code>groupingSeparator</code> property. The number of digits between
* grouping separators is defined by the <code>groupingPattern</code>
* property.</p>
*
* <p>When this property is assigned a value and there are no errors or
* warnings, the <code>lastOperationStatus</code> property is set to:</p>
*
* <ul>
* <li><code>LastOperationStatus.NO_ERROR</code></li>
* </ul>
*
* <p>Otherwise the <code>lastOperationStatus</code> property is set to one of
* the constants defined in the <code>LastOperationStatus</code> class.</p>
*
* @see #groupingPattern
* @see #groupingSeparator
* @see #lastOperationStatus
* @see LastOperationStatus
*
* @langversion 3.0
* @playerversion Flash 10.1
* @playerversion AIR 2.0
* @productversion Royale 0.9.8
*/
public var useGrouping:Boolean;
/**
* Constructs a new NumberFormatter object to format numbers according to the
* conventions of a given locale.
*
* <p>This constructor determines if the current operating system supports the
* requested locale ID name. If it is not supported then a fallback locale is
* used instead. If a fallback locale is used then the the
* <code>lastOperationStatus</code> property indicates the type of fallback,
* and the <code>actualLocaleIDName</code> property contains the name of the
* fallback locale ID. </p>
*
* <p>To format based on the user's current operating system preferences, pass
* the value <code>LocaleID.DEFAULT</code> in the
* <code>requestedLocaleIDName</code> parameter to the constructor.</p>
*
* <p>When the constructor completes successfully, the
* <code>lastOperationStatus</code> property is set to:</p>
*
* <ul>
* <li><code>LastOperationStatus.NO_ERROR</code></li>
* </ul>
*
* <p>When the requested locale ID name is not available then the
* <code>lastOperationStatus</code> is set to one of the following:</p>
*
* <ul>
* <li><code>LastOperationStatus.USING_FALLBACK_WARNING</code></li>
* <li><code>LastOperationStatus.USING_DEFAULT_WARNING</code></li>
* </ul>
*
* <p>If this class is not supported on the current operating system, then
* the <code>lastOperationStatus</code> property is set to:</p>
*
* <ul>
* <li><code>LastOperationStatus.UNSUPPORTED_ERROR</code></li>
* </ul>
*
* <p>Otherwise the <code>lastOperationStatus</code> property is set to one of
* the constants defined in the LastOperationStatus class.</p>
*
* <p><b>For details on the warnings listed above and other possible values of
* the <code>lastOperationStatus</code> property see the descriptions in the
* <code>LastOperationStatus</code> class.</b></p>
*
* @param requestedLocaleIDName The preferred locale ID name to use when
* determining number formats.
*
* @throws TypeError if the <code>requestedLocaleIDName</code> is
* <code>null</code>
*
* @see LocaleID
* @see #requestedLocaleIDName
* @see #actualLocaleIDName
* @see #lastOperationStatus
* @see LastOperationStatus
*
* @langversion 3.0
* @playerversion Flash 10.1
* @playerversion AIR 2.0
* @productversion Royale 0.9.8
*/
public function NumberFormatter(requestedLocaleIDName:String)
{
// TODO
if( requestedLocaleIDName == LocaleID.DEFAULT )
{
// TODO
}
actualLocaleIDName = "";
lastOperationStatus = LastOperationStatus.USING_DEFAULT_WARNING; /* or NO_ERROR */
this.requestedLocaleIDName = requestedLocaleIDName;
fmt = new mx.formatters.NumberFormatter();
decimalSeparator = "";
digitsType = 0;
fractionalDigits = 0;
groupingPattern = "";
groupingSeparator = "";
leadingZero = false;
negativeNumberFormat = 0;
negativeSymbol = "";
trailingZeros = false;
useGrouping = false;
}
/**
* Lists all of the locale ID names supported by this class.
*
* <p>If this class is not supported on the current operating system, this
* method returns a null value.</p>
*
* <p>When this method is called and it completes successfully, the
* <code>lastOperationStatus</code> property is set to:</p>
*
* <ul>
* <li><code>LastOperationStatus.NO_ERROR</code></li>
* </ul>
*
* <p>Otherwise the <code>lastOperationStatus</code> property is set to one of
* the constants defined in the <code>LastOperationStatus</code> class.</p>
*
* @return A vector of strings containing all of the locale ID names supported
* by this class.
*
* @langversion 3.0
* @playerversion Flash 10.1
* @playerversion AIR 2.0
* @productversion Royale 0.9.8
*/
public static function getAvailableLocaleIDNames():Vector.<String>
{
// HOW? This is a static function... lastOperationStatus = LastOperationStatus.UNSUPPORTED_ERROR;
return null;
}
/**
* Formats an int value.
*
* This function is equivalent to the <code>formatNumber()</code> method
* except that it takes an <code>int</code> value. If the value passed in is
* too large or small, such as a value greater than 1.72e308 or less than
* 1.72e-308, then this function returns 0.
*
* <p>When this method is called and it completes successfully, the
* <code>lastOperationStatus</code> property is set to:</p>
*
* <ul>
* <li><code>LastOperationStatus.NO_ERROR</code></li>
* </ul>
*
* <p>Otherwise the <code>lastOperationStatus</code> property is set to one of
* the constants defined in the <code>LastOperationStatus</code> class.</p>
*
* @param value An int value to format.
*
* @return A formatted number string.
*
* @throws MemoryError for any internal memory allocation problems.
*
* @see #lastOperationStatus
* @see LastOperationStatus
*
* @langversion 3.0
* @playerversion Flash 10.1
* @playerversion AIR 2.0
* @productversion Royale 0.9.8
*/
public function formatInt(value:int):String
{
var s:String;
// TODO
s = fmt.format(value);
lastOperationStatus = LastOperationStatus.NO_ERROR;
return s;
}
/**
* Formats a Number value.
*
* <p>This function formats the number based on the property values of the
* formatter. If the properties are not modified after the the numberFormatter
* object is created, the numbers are formatted according to the locale
* specific conventions provided by the operating system for the locale
* identified by actualLocaleIDName. To customize the format, the properties
* can be altered to control specific aspects of formatting a number.</p>
*
* <p> Very large numbers and very small magnitude numbers can be formatted
* with this function. However, the number of significant digits is limited to
* the precision provided by the Number object. Scientific notation is not
* supported.</p>
*
* <p>When this method is called and it completes successfully, the
* <code>lastOperationStatus</code> property is set to:</p>
*
* <ul>
* <li><code>LastOperationStatus.NO_ERROR</code></li>
* </ul>
*
* <p>Otherwise the <code>lastOperationStatus</code> property is set to one of
* the constants defined in the <code>LastOperationStatus</code> class.</p>
*
* @param value A Number value to format.
*
* @return A formatted number string.
*
* @throws MemoryError if there are any internal memory allocation problems.
*
* @see lastOperationStatus
* @see LastOperationStatus
*
* @langversion 3.0
* @playerversion Flash 10.1
* @playerversion AIR 2.0
* @productversion Royale 0.9.8
*/
public function formatNumber(value:Number):String
{
var s:String;
// TODO
s = fmt.format(value);
lastOperationStatus = LastOperationStatus.NO_ERROR;
return s;
}
/**
* Formats a uint value.
*
* This function is equivalent to the <code>formatNumber()</code> method
* except that it takes a <code>uint</code>. If the value passed in is too
* large, such as a value greater than 1.72e308, then this function returns 0.
*
* <p>When this method is called and it completes successfully, the
* <code>lastOperationStatus</code> property is set to:</p>
*
* <ul>
* <li><code>LastOperationStatus.NO_ERROR</code></li>
* </ul>
*
* <p>Otherwise the <code>lastOperationStatus</code> property is set to one of
* the constants defined in the <code>LastOperationStatus</code> class.</p>
*
* @param value A uint value.
*
* @return A formatted number string.
*
* @throws MemoryError if there are any internal memory allocation problems.
*
* @see #lastOperationStatus
* @see LastOperationStatus
*
* @langversion 3.0
* @playerversion Flash 10.1
* @playerversion AIR 2.0
* @productversion Royale 0.9.8
*/
public function formatUint(value:uint):String
{
var s:String;
// TODO
s = fmt.format(value);
lastOperationStatus = LastOperationStatus.NO_ERROR;
return s;
}
/**
* Parses a string and returns a NumberParseResult object containing the
* parsed elements.
*
* <p>The NumberParseResult object contains the value of the first number
* found in the input string, the starting index for the number within the
* string, and the index of the first character after the number in the
* string.</p>
*
* <p> If the string does not contain a number, the value property of the
* NumberParseResult is set to <code>NaN</code> and the
* <code>startIndex</code> and <code>endIndex</code> properties are set to the
* hexadecimal value <code>0x7fffffff</code>.</p>
*
* <p>This function uses the value of the <code>decimalSeparator</code>
* property to determine the portion of the number that contains fractional
* digits, and the <code>groupingSeparator</code> property to determine which
* characters are allowed within the digits of a number, and the
* <code>negativeNumberFormat</code> property to control how negative values
* are represented. </p>
*
* <p>The following table identifies the result of strings parsed for the
* various NegativeNumberFormat values:</p>
*
* <table class="innertable">
* <tbody>
* <tr>
* <td>NegativeNumberFormat</td>
* <td>Input String</td>
* <td>Result</td>
* </tr>
* <tr>
* <td>(n)</td>
* <td>"(123)" or "( 123 )"</td>
* <td>"-123"</td>
* </tr>
* <tr>
* <td>-n</td>
* <td>"-123" or "- 123"</td>
* <td>"-123"</td>
* </tr>
* <tr>
* <td>- n</td>
* <td>"-123" or "- 123"</td>
* <td>"-123"</td>
* </tr>
* <tr>
* <td>n-</td>
* <td>"123-" or "123 -"</td>
* <td>"-123"</td>
* </tr>
* <tr>
* <td>n -</td>
* <td>"123-" or "123 -"</td>
* <td>"-123"</td>
* </tr>
* </tbody>
* </table>
*
* <p>A single white space is allowed between the number and the minus sign or
* parenthesis.</p>
*
* <p>Other properties are ignored when determining a valid number.
* Specifically the value of the <code>digitsType</code> property is ignored
* and the digits can be from any of the digit sets that are enumerated in
* the NationalDigitsType class. The values of the
* <code>groupingPattern</code> and <code>useGrouping</code> properties do
* not influence the parsing of the number.</p>
*
* <p> If numbers are preceded or followed in the string by a plus sign '+',
* the plus sign is treated as a character that is not part of the number.</p>
*
* <p> This function does not parse strings containing numbers in scientific
* notation (e.g. 1.23e40).</p>
*
* <p>When this method is called and it completes successfully, the
* <code>lastOperationStatus</code> property is set to:</p>
*
* <ul>
* <li><code>LastOperationStatus.NO_ERROR</code></li>
* </ul>
*
* <p>Otherwise the <code>lastOperationStatus</code> property is set to one of
* the constants defined in the <code>LastOperationStatus</code> class.</p>
*
* @param parseString
*
* @return
*
* @throws TypeError if the parseString is <code>null</code>
*
* @see #lastOperationStatus
* @see LastOperationStatus
* @see NumberParseResult
* @see #parseNumber()
* @see #parseFloat()
* @see NationalDigitsType
*
* @example The following code parses a number from a string and retrieves the
* prefix and suffix:
* <listing version="3.0">
*
* var nf:NumberFormatter = new NumberFormatter("fr-FR");
* var str:String = "1,56 mètre"
* var result:NumberParseResult = nf.parse(str);
* trace(result.value) // 1.56
* trace(str.substr(0,result.startIndex)); // ""
* trace(str.substr(result.startIndex, result.endIndex)); // "1,56"
* trace(str.substr(result.endIndex)); // " mètre"
* </listing>
*
* @langversion 3.0
* @playerversion Flash 10.1
* @playerversion AIR 2.0
* @productversion Royale 0.9.8
*/
public function parse(parseString:String):NumberParseResult
{
// TODO
return new NumberParseResult(parseNumber(parseString));
}
/**
* Parses a string that contains only digits and optional whitespace
* characters and returns a Number.
*
* If the string does not begin with a number or contains characters other
* than whitespace that are not part of the number, then this method returns
* <code>NaN</code>. White space before or after the numeric digits is
* ignored. A white space character is a character that has a Space Separator
* (Zs) property in the Unicode Character Database
* (see http://www.unicode.org/ucd/).
*
* <p> If the numeric digit is preceded or followed by a plus sign '+' it is
* treated as a non-whitespace character. The return value is
* <code>NaN</code>.</p>
*
* <p> See the description of the parse function for more information about
* number parsing and what constitutes a valid number.</p>
*
* <p>When this method is called and it completes successfully, the
* <code>lastOperationStatus</code> property is set to:</p>
*
* <ul>
* <li><code>LastOperationStatus.NO_ERROR</code></li>
* </ul>
*
* <p>Otherwise the <code>lastOperationStatus</code> property is set to one of
* the constants defined in the <code>LastOperationStatus</code> class.</p>
*
* @param parseString
*
* @return
*
* @throws TypeError if the parseString is <code>null</code>
*
* @see #lastOperationStatus
* @see LastOperationStatus
* @see #parse()
* @see #parseFloat()
* @see NationalDigitsType
*
* @langversion 3.0
* @playerversion Flash 10.1
* @playerversion AIR 2.0
* @productversion Royale 0.9.8
*/
public function parseNumber(parseString:String):Number
{
// TODO
var parser:NumberBase = new NumberBase(".", ",", ".", ",");
var num:Number = Number(parser.parseNumberString(parseString));
return num;
}
private var fmt:mx.formatters.NumberFormatter;
}
}
|
package ckaction.act {
public class XML2JSON {
private static var _arrays: Array;
public static function parse(node: * ): Object {
var obj: Object = {};
var numOfChilds: int = node.children().length();
for (var i: int = 0; i < numOfChilds; i++) {
var childNode: * = node.children()[i];
var childNodeName: String = childNode.name();
var value: * ;
if (childNode.children().length() == 1 && childNode.children()[0].name() == null) {
if (childNode.attributes().length() > 0) {
value = {
_content: childNode.children()[0].toString()
};
var numOfAttributes: int = childNode.attributes().length();
for (var j: int = 0; j < numOfAttributes; j++) {
value[childNode.attributes()[j].name().toString()] = childNode.attributes()[j];
}
} else {
value = childNode.children()[0].toString();
}
} else {
value = parse(childNode);
}
if (obj[childNodeName]) {
if (getTypeof(obj[childNodeName]) == "array") {
obj[childNodeName].push(value);
} else {
obj[childNodeName] = [obj[childNodeName], value];
}
} else if (isArray(childNodeName)) {
obj[childNodeName] = [value];
} else {
obj[childNodeName] = value;
}
}
numOfAttributes = node.attributes().length();
for (i = 0; i < numOfAttributes; i++) {
obj[node.attributes()[i].name().toString()] = node.attributes()[i];
}
if (numOfChilds == 0) {
if (numOfAttributes == 0) {
obj = "";
} else {
obj._content = "";
}
}
return obj;
}
public static function get arrays(): Array {
if (!_arrays) {
_arrays = [];
}
return _arrays;
}
public static function set arrays(a: Array): void {
_arrays = a;
}
private static function isArray(nodeName: String): Boolean {
var numOfArrays: int = _arrays ? _arrays.length : 0;
for (var i: int = 0; i < numOfArrays; i++) {
if (nodeName == _arrays[i]) {
return true;
}
}
return false;
}
private static function getTypeof(o: * ): String {
if (typeof (o) == "object") {
if (o.length == null) {
return "object";
} else if (typeof (o.length) == "number") {
return "array";
} else {
return "object";
}
} else {
return typeof (o);
}
}
}
} |
/*
* FLINT PARTICLE SYSTEM
* .....................
*
* Author: Richard Lord
* Copyright (c) Richard Lord 2008-2011
* http://flintparticles.org
*
*
* Licence Agreement
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package org.flintparticles.threeD.actions
{
import org.flintparticles.common.actions.ActionBase;
import org.flintparticles.common.emitters.Emitter;
import org.flintparticles.common.particles.Particle;
import org.flintparticles.threeD.particles.Particle3D;
import flash.geom.Vector3D;
/**
* The RotationalLinearDrag action applies drag to the particle to slow it down
* when it's rotating. The drag force is proportional to the angular velocity of
* the particle.
*/
public class RotationalLinearDrag extends ActionBase
{
private var _drag:Number;
/**
* The constructor creates a RotationalLinearDrag action for use by
* an emitter. To add a RotationalLinearDrag to all particles created by an
* emitter, use the emitter's addAction method.
*
* @see org.flintparticles.common.emitters.Emitter#addAction()
*
* @param drag The amount of drag. A higher number produces a stronger drag force.
*/
public function RotationalLinearDrag( drag:Number = 0 )
{
this.drag = drag;
}
/**
* The amount of drag. A higher number produces a stronger drag force.
*/
public function get drag():Number
{
return _drag;
}
public function set drag( value:Number ):void
{
_drag = value;
}
/**
* @inheritDoc
*/
override public function update( emitter:Emitter, particle:Particle, time:Number ):void
{
var v : Vector3D = Particle3D( particle ).angVelocity;
if ( v.x == 0 && v.y == 0 && v.z == 0 )
{
return;
}
var scale:Number = 1 - _drag * time / Particle3D( particle ).inertia;
if( scale < 0 )
{
v.x = 0;
v.y = 0;
v.z = 0;
}
else
{
v.scaleBy( scale );
}
}
}
}
|
/*
Copyright 2012-2016 Bowler Hat LLC
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
*/
package feathers.themes
{
import feathers.controls.Alert;
import feathers.controls.Button;
import feathers.controls.ButtonGroup;
import feathers.controls.ButtonState;
import feathers.controls.Callout;
import feathers.controls.Check;
import feathers.controls.DateTimeSpinner;
import feathers.controls.Drawers;
import feathers.controls.GroupedList;
import feathers.controls.Header;
import feathers.controls.ImageLoader;
import feathers.controls.ItemRendererLayoutOrder;
import feathers.controls.Label;
import feathers.controls.LayoutGroup;
import feathers.controls.List;
import feathers.controls.NumericStepper;
import feathers.controls.PageIndicator;
import feathers.controls.Panel;
import feathers.controls.PanelScreen;
import feathers.controls.PickerList;
import feathers.controls.ProgressBar;
import feathers.controls.Radio;
import feathers.controls.ScrollContainer;
import feathers.controls.ScrollScreen;
import feathers.controls.ScrollText;
import feathers.controls.Scroller;
import feathers.controls.SimpleScrollBar;
import feathers.controls.Slider;
import feathers.controls.SpinnerList;
import feathers.controls.StepperButtonLayoutMode;
import feathers.controls.TabBar;
import feathers.controls.TextArea;
import feathers.controls.TextCallout;
import feathers.controls.TextInput;
import feathers.controls.TextInputState;
import feathers.controls.ToggleButton;
import feathers.controls.ToggleSwitch;
import feathers.controls.TrackLayoutMode;
import feathers.controls.popups.BottomDrawerPopUpContentManager;
import feathers.controls.popups.CalloutPopUpContentManager;
import feathers.controls.renderers.BaseDefaultItemRenderer;
import feathers.controls.renderers.DefaultGroupedListHeaderOrFooterRenderer;
import feathers.controls.renderers.DefaultGroupedListItemRenderer;
import feathers.controls.renderers.DefaultListItemRenderer;
import feathers.controls.text.BitmapFontTextEditor;
import feathers.controls.text.BitmapFontTextRenderer;
import feathers.controls.text.ITextEditorViewPort;
import feathers.controls.text.StageTextTextEditor;
import feathers.controls.text.TextFieldTextEditorViewPort;
import feathers.core.FeathersControl;
import feathers.core.ITextEditor;
import feathers.core.ITextRenderer;
import feathers.core.PopUpManager;
import feathers.layout.Direction;
import feathers.layout.HorizontalAlign;
import feathers.layout.HorizontalLayout;
import feathers.layout.RelativePosition;
import feathers.layout.VerticalAlign;
import feathers.layout.VerticalLayout;
import feathers.media.FullScreenToggleButton;
import feathers.media.MuteToggleButton;
import feathers.media.PlayPauseToggleButton;
import feathers.media.SeekSlider;
import feathers.media.VideoPlayer;
import feathers.media.VolumeSlider;
import feathers.skins.ImageSkin;
import feathers.system.DeviceCapabilities;
import feathers.text.BitmapFontTextFormat;
import flash.geom.Rectangle;
import flash.text.TextFormat;
import flash.text.TextFormatAlign;
import starling.core.Starling;
import starling.display.DisplayObject;
import starling.display.Image;
import starling.display.Quad;
import starling.text.TextField;
import starling.textures.Texture;
import starling.textures.TextureAtlas;
import starling.textures.TextureSmoothing;
/**
* The base class for the "Minimal" theme for mobile Feathers apps. Handles
* everything except asset loading, which is left to subclasses.
*
* @see MinimalMobileTheme
* @see MinimalMobileThemeWithAssetManager
*/
public class BaseMinimalMobileTheme extends StyleNameFunctionTheme
{
/**
* The name of the embedded bitmap font used by controls in this theme.
*/
public static const FONT_NAME:String = "PF Ronda Seven";
/**
* @private
* The theme's custom style name for item renderers in a SpinnerList.
*/
protected static const THEME_STYLE_NAME_SPINNER_LIST_ITEM_RENDERER:String = "minimal-mobile-spinner-list-item-renderer";
/**
* @private
* The theme's custom style name for the label text renderer inside item
* renderers in a SpinnerList.
*/
protected static const THEME_STYLE_NAME_SPINNER_LIST_ITEM_RENDERER_LABEL:String = "minimal-mobile-spinner-list-item-renderer-label";
/**
* @private
* The theme's custom style name for the minimum track of a horizontal slider.
*/
protected static const THEME_STYLE_NAME_HORIZONTAL_SLIDER_MINIMUM_TRACK:String = "minimal-mobile-horizontal-slider-minimum-track";
/**
* @private
* The theme's custom style name for the minimum track of a vertical slider.
*/
protected static const THEME_STYLE_NAME_VERTICAL_SLIDER_MINIMUM_TRACK:String = "minimal-mobile-vertical-slider-minimum-track";
/**
* @private
* The theme's custom style name for the text editor of the text input
* in a NumericStepper.
*/
protected static const THEME_STYLE_NAME_NUMERIC_STEPPER_TEXT_INPUT_TEXT_EDITOR:String = "minimal-mobile-numeric-stepper-text-input-text-editor";
/**
* @private
* The theme's custom style name for the item renderer of the
* SpinnerList in a DateTimeSpinner.
*/
protected static const THEME_STYLE_NAME_DATE_TIME_SPINNER_LIST_ITEM_RENDERER:String = "minimal-mobile-date-time-spinner-list-item-renderer";
/**
* @private
* The theme's custom style name for the text renderer that displays an
* error message or is related to a destructive action.
*/
protected static const THEME_STYLE_NAME_DANGER_TEXT_RENDERER:String = "minimal-mobile-theme-danger-text-callout-text-renderer";
/**
* @private
* The theme's custom style name for the text renderer of a heading Label.
*/
protected static const THEME_STYLE_NAME_HEADING_LABEL_TEXT_RENDERER:String = "minimal-mobile-heading-label-text-renderer";
/**
* @private
* The theme's custom style name for the text renderer of a detail Label.
*/
protected static const THEME_STYLE_NAME_DETAIL_LABEL_TEXT_RENDERER:String = "minimal-mobile-detail-label-text-renderer";
protected static const FONT_TEXTURE_NAME:String = "pf_ronda_seven_0";
protected static const DEFAULT_SCALE_9_GRID:Rectangle = new Rectangle(4, 4, 1, 1);
protected static const SCROLLBAR_THUMB_SCALE_9_GRID:Rectangle = new Rectangle(1, 1, 2, 2);
protected static const ITEM_RENDERER_SCALE_9_GRID:Rectangle = new Rectangle(0, 3, 2, 1);
protected static const TAB_SCALE_9_GRID:Rectangle = new Rectangle(11, 11, 1, 1);
protected static const HEADER_SCALE_9_GRID:Rectangle = new Rectangle(1, 3, 1, 1);
protected static const SPINNER_LIST_SELECTION_OVERLAY_SCALE9_GRID:Rectangle = new Rectangle(1, 3, 1, 1);
protected static const SEEK_SLIDER_PROGRESS_SKIN_SCALE9_GRID:Rectangle = new Rectangle(0, 2, 2, 10);
protected static const BACK_BUTTON_SCALE9_GRID:Rectangle = new Rectangle(16, 0, 1, 28);
protected static const FORWARD_BUTTON_SCALE9_GRID:Rectangle = new Rectangle(3, 0, 1, 28);
protected static const BACKGROUND_COLOR:uint = 0xf3f3f3;
protected static const LIST_BACKGROUND_COLOR:uint = 0xf8f8f8;
protected static const LIST_HEADER_BACKGROUND_COLOR:uint = 0xeeeeee;
protected static const DRAWERS_DIVIDER_COLOR:uint = 0xebebeb;
protected static const PRIMARY_TEXT_COLOR:uint = 0x666666;
protected static const DISABLED_TEXT_COLOR:uint = 0x999999;
protected static const DANGER_TEXT_COLOR:uint = 0x990000;
protected static const MODAL_OVERLAY_COLOR:uint = 0xcccccc;
protected static const MODAL_OVERLAY_ALPHA:Number = 0.4;
protected static const VIDEO_OVERLAY_COLOR:uint = 0xcccccc;
protected static const VIDEO_OVERLAY_ALPHA:Number = 0.2;
/**
* The default global text renderer factory for this theme creates a
* BitmapFontTextRenderer.
*/
protected static function textRendererFactory():ITextRenderer
{
var renderer:BitmapFontTextRenderer = new BitmapFontTextRenderer();
//since it's a pixel font, we don't want to smooth it.
renderer.textureSmoothing = TextureSmoothing.NONE;
return renderer;
}
/**
* The default global text editor factory for this theme creates a
* StageTextTextEditor.
*/
protected static function textEditorFactory():ITextEditor
{
return new StageTextTextEditor();
}
/**
* The text editor factory for a TextArea creates a
* TextFieldTextEditorViewPort.
*/
protected static function textAreaTextEditorFactory():ITextEditorViewPort
{
return new TextFieldTextEditorViewPort();
}
/**
* The text editor factory for a NumericStepper creates a
* BitmapFontTextEditor.
*/
protected static function numericStepperTextEditorFactory():BitmapFontTextEditor
{
//we're only using this text editor in the NumericStepper because
//isEditable is false on the TextInput. this text editor is not
//suitable for mobile use if the TextInput needs to be editable
//because it can't use the soft keyboard or other mobile-friendly UI
var editor:BitmapFontTextEditor = new BitmapFontTextEditor();
//since it's a pixel font, we don't want to smooth it.
editor.textureSmoothing = TextureSmoothing.NONE;
return editor;
}
protected static function pickerListButtonFactory():ToggleButton
{
return new ToggleButton();
}
protected static function pickerListSpinnerListFactory():SpinnerList
{
return new SpinnerList();
}
protected static function popUpOverlayFactory():DisplayObject
{
var quad:Quad = new Quad(100, 100, MODAL_OVERLAY_COLOR);
quad.alpha = MODAL_OVERLAY_ALPHA;
return quad;
}
/**
* This theme's scroll bar type is SimpleScrollBar.
*/
protected static function scrollBarFactory():SimpleScrollBar
{
return new SimpleScrollBar();
}
/**
* Constructor.
*
* @param scaleToDPI Determines if the theme's skins will be scaled based on the screen density and content scale factor.
*/
public function BaseMinimalMobileTheme()
{
super();
}
/**
* A normal font size.
*/
protected var fontSize:int;
/**
* A larger font size for headers.
*/
protected var largeFontSize:int;
/**
* A smaller font size for details.
*/
protected var smallFontSize:int;
/**
* The texture atlas that contains skins for this theme. This base class
* does not initialize this member variable. Subclasses are expected to
* load the assets somehow and set the <code>atlas</code> member
* variable before calling <code>initialize()</code>.
*/
protected var atlas:TextureAtlas;
protected var buttonUpSkinTexture:Texture;
protected var buttonDownSkinTexture:Texture;
protected var buttonDisabledSkinTexture:Texture;
protected var buttonSelectedSkinTexture:Texture;
protected var buttonSelectedDisabledSkinTexture:Texture;
protected var buttonCallToActionUpSkinTexture:Texture;
protected var buttonDangerUpSkinTexture:Texture;
protected var buttonDangerDownSkinTexture:Texture;
protected var buttonBackUpSkinTexture:Texture;
protected var buttonBackDownSkinTexture:Texture;
protected var buttonBackDisabledSkinTexture:Texture;
protected var buttonForwardUpSkinTexture:Texture;
protected var buttonForwardDownSkinTexture:Texture;
protected var buttonForwardDisabledSkinTexture:Texture;
protected var tabDownSkinTexture:Texture;
protected var tabSelectedSkinTexture:Texture;
protected var tabSelectedDisabledSkinTexture:Texture;
protected var thumbSkinTexture:Texture;
protected var thumbDisabledSkinTexture:Texture;
protected var scrollBarThumbSkinTexture:Texture;
protected var insetBackgroundSkinTexture:Texture;
protected var insetBackgroundDisabledSkinTexture:Texture;
protected var insetBackgroundFocusedSkinTexture:Texture;
protected var insetBackgroundDangerSkinTexture:Texture;
protected var pickerListButtonIconUpTexture:Texture;
protected var pickerListButtonIconSelectedTexture:Texture;
protected var pickerListButtonIconDisabledTexture:Texture;
protected var searchIconTexture:Texture;
protected var searchIconDisabledTexture:Texture;
protected var itemRendererUpSkinTexture:Texture;
protected var itemRendererDownSkinTexture:Texture;
protected var itemRendererSelectedUpSkinTexture:Texture;
protected var checkItemRendererSelectedIconTexture:Texture;
protected var spinnerListSelectionOverlaySkinTexture:Texture;
protected var headerSkinTexture:Texture;
protected var panelHeaderSkinTexture:Texture;
protected var panelBackgroundSkinTexture:Texture;
protected var popUpBackgroundSkinTexture:Texture;
protected var dangerPopUpBackgroundSkinTexture:Texture;
protected var calloutTopArrowSkinTexture:Texture;
protected var calloutBottomArrowSkinTexture:Texture;
protected var calloutLeftArrowSkinTexture:Texture;
protected var calloutRightArrowSkinTexture:Texture;
protected var dangerCalloutTopArrowSkinTexture:Texture;
protected var dangerCalloutBottomArrowSkinTexture:Texture;
protected var dangerCalloutLeftArrowSkinTexture:Texture;
protected var dangerCalloutRightArrowSkinTexture:Texture;
protected var checkIconTexture:Texture;
protected var checkDisabledIconTexture:Texture;
protected var checkSelectedIconTexture:Texture;
protected var checkSelectedDisabledIconTexture:Texture;
protected var radioIconTexture:Texture;
protected var radioDisabledIconTexture:Texture;
protected var radioSelectedIconTexture:Texture;
protected var radioSelectedDisabledIconTexture:Texture;
protected var pageIndicatorNormalSkinTexture:Texture;
protected var pageIndicatorSelectedSkinTexture:Texture;
//media textures
protected var playPauseButtonPlayUpIconTexture:Texture;
protected var playPauseButtonPauseUpIconTexture:Texture;
protected var overlayPlayPauseButtonPlayUpIconTexture:Texture;
protected var fullScreenToggleButtonEnterUpIconTexture:Texture;
protected var fullScreenToggleButtonExitUpIconTexture:Texture;
protected var muteToggleButtonLoudUpIconTexture:Texture;
protected var muteToggleButtonMutedUpIconTexture:Texture;
protected var seekSliderProgressSkinTexture:Texture;
protected var volumeSliderMinimumTrackSkinTexture:Texture;
protected var volumeSliderMaximumTrackSkinTexture:Texture;
protected var listDrillDownAccessoryTexture:Texture;
/**
* The size, in pixels, of major regions in the grid. Used for sizing
* containers and larger UI controls.
*/
protected var gridSize:int;
/**
* The size, in pixels, of minor regions in the grid. Used for larger
* padding and gaps.
*/
protected var gutterSize:int;
/**
* The size, in pixels, of smaller padding and gaps within the major
* regions in the grid.
*/
protected var smallGutterSize:int;
/**
* The width, in pixels, of UI controls that span across multiple grid regions.
*/
protected var wideControlSize:int;
/**
* The size, in pixels, of a typical UI control.
*/
protected var controlSize:int;
/**
* The size, in pixels, of smaller UI controls.
*/
protected var smallControlSize:int;
/**
* The size, in pixels, of a UI control's border.
*/
protected var borderSize:int;
protected var simpleScrollBarThumbSize:int;
protected var calloutBackgroundMinSize:int;
protected var calloutBottomRightArrowOverlapGapSize:Number;
protected var calloutTopLeftArrowOverlapGapSize:int;
protected var popUpFillSize:int;
protected var dropShadowSize:int;
protected var primaryTextFormat:BitmapFontTextFormat;
protected var disabledTextFormat:BitmapFontTextFormat;
protected var centeredTextFormat:BitmapFontTextFormat;
protected var centeredDisabledTextFormat:BitmapFontTextFormat;
protected var headingTextFormat:BitmapFontTextFormat;
protected var headingDisabledTextFormat:BitmapFontTextFormat;
protected var detailTextFormat:BitmapFontTextFormat;
protected var detailDisabledTextFormat:BitmapFontTextFormat;
protected var dangerTextFormat:BitmapFontTextFormat;
protected var scrollTextTextFormat:TextFormat;
protected var scrollTextDisabledTextFormat:TextFormat;
/**
* Disposes the texture atlas and bitmap font before calling
* super.dispose().
*/
override public function dispose():void
{
if(this.atlas)
{
//if anything is keeping a reference to the texture, we don't
//want it to keep a reference to the theme too.
this.atlas.texture.root.onRestore = null;
this.atlas.dispose();
this.atlas = null;
}
TextField.unregisterBitmapFont(FONT_NAME);
//don't forget to call super.dispose()!
super.dispose();
}
/**
* Initializes the theme. Expected to be called by subclasses after the
* assets have been loaded and the skin texture atlas has been created.
*/
protected function initialize():void
{
this.initializeDimensions();
this.initializeTextures();
this.initializeFonts();
this.initializeGlobals();
this.initializeStage();
this.initializeStyleProviders();
}
/**
* Sets the stage background color.
*/
protected function initializeStage():void
{
Starling.current.stage.color = BACKGROUND_COLOR;
Starling.current.nativeStage.color = BACKGROUND_COLOR;
}
/**
* Initializes global variables (not including global style providers).
*/
protected function initializeGlobals():void
{
PopUpManager.overlayFactory = popUpOverlayFactory;
Callout.stagePadding = this.smallGutterSize;
FeathersControl.defaultTextRendererFactory = textRendererFactory;
FeathersControl.defaultTextEditorFactory = textEditorFactory;
}
/**
* Initializes common values used for setting the dimensions of components.
*/
protected function initializeDimensions():void
{
this.gridSize = 44;
this.smallGutterSize = 6;
this.gutterSize = 11;
this.borderSize = 2;
this.dropShadowSize = 6;
this.controlSize = 30;
this.smallControlSize = 16;
this.popUpFillSize = 276;
this.wideControlSize = this.gridSize * 3 + this.gutterSize * 2;
this.simpleScrollBarThumbSize = 4;
this.calloutBackgroundMinSize = 6;
this.calloutTopLeftArrowOverlapGapSize = -4;
this.calloutBottomRightArrowOverlapGapSize = -10.5;
}
/**
* Initializes the textures by extracting them from the atlas and
* setting up any scaling grids that are needed.
*/
protected function initializeTextures():void
{
this.buttonUpSkinTexture = this.atlas.getTexture("button-up-skin0000");
this.buttonDownSkinTexture = this.atlas.getTexture("button-down-skin0000");
this.buttonDisabledSkinTexture = this.atlas.getTexture("button-disabled-skin0000");
this.buttonSelectedSkinTexture = this.atlas.getTexture("inset-background-enabled-skin0000");
this.buttonSelectedDisabledSkinTexture = this.atlas.getTexture("inset-background-disabled-skin0000");
this.buttonCallToActionUpSkinTexture = this.atlas.getTexture("call-to-action-button-up-skin0000");
this.buttonDangerUpSkinTexture = this.atlas.getTexture("danger-button-up-skin0000");
this.buttonDangerDownSkinTexture = this.atlas.getTexture("danger-button-down-skin0000");
this.buttonBackUpSkinTexture = this.atlas.getTexture("back-button-up-skin0000");
this.buttonBackDownSkinTexture = this.atlas.getTexture("back-button-down-skin0000");
this.buttonBackDisabledSkinTexture = this.atlas.getTexture("back-button-disabled-skin0000");
this.buttonForwardUpSkinTexture = this.atlas.getTexture("forward-button-up-skin0000");
this.buttonForwardDownSkinTexture = this.atlas.getTexture("forward-button-down-skin0000");
this.buttonForwardDisabledSkinTexture = this.atlas.getTexture("forward-button-disabled-skin0000");
this.tabDownSkinTexture = this.atlas.getTexture("tab-down-skin0000");
this.tabSelectedSkinTexture = this.atlas.getTexture("tab-selected-up-skin0000");
this.tabSelectedDisabledSkinTexture = this.atlas.getTexture("tab-selected-disabled-skin0000");
this.thumbSkinTexture = this.atlas.getTexture("face-up-skin0000");
this.thumbDisabledSkinTexture = this.atlas.getTexture("face-disabled-skin0000");
this.scrollBarThumbSkinTexture = this.atlas.getTexture("simple-scroll-bar-thumb-skin0000");
this.insetBackgroundSkinTexture = this.atlas.getTexture("inset-background-enabled-skin0000");
this.insetBackgroundDisabledSkinTexture = this.atlas.getTexture("inset-background-disabled-skin0000");
this.insetBackgroundFocusedSkinTexture = this.atlas.getTexture("inset-background-focused-skin0000");
this.insetBackgroundDangerSkinTexture = this.atlas.getTexture("inset-background-danger-skin0000");
this.pickerListButtonIconUpTexture = this.atlas.getTexture("picker-list-icon0000");
this.pickerListButtonIconSelectedTexture = this.atlas.getTexture("picker-list-selected-icon0000");
this.pickerListButtonIconDisabledTexture = this.atlas.getTexture("picker-list-disabled-icon0000");
this.searchIconTexture = this.atlas.getTexture("search-enabled-icon0000");
this.searchIconDisabledTexture = this.atlas.getTexture("search-disabled-icon0000");
this.itemRendererUpSkinTexture = this.atlas.getTexture("item-renderer-up-skin0000");
this.itemRendererDownSkinTexture = this.atlas.getTexture("item-renderer-down-skin0000");
this.itemRendererSelectedUpSkinTexture = this.atlas.getTexture("item-renderer-selected-up-skin0000");
this.checkItemRendererSelectedIconTexture = this.atlas.getTexture("check-item-renderer-selected-icon0000");
this.spinnerListSelectionOverlaySkinTexture = this.atlas.getTexture("spinner-list-selection-overlay-skin0000");
this.headerSkinTexture = this.atlas.getTexture("header-background-skin0000");
this.panelHeaderSkinTexture = this.atlas.getTexture("panel-header-background-skin0000");
this.panelBackgroundSkinTexture = this.atlas.getTexture("panel-background-skin0000");
this.popUpBackgroundSkinTexture = this.atlas.getTexture("pop-up-background-skin0000");
this.dangerPopUpBackgroundSkinTexture = this.atlas.getTexture("danger-pop-up-background-skin0000");
this.calloutTopArrowSkinTexture = this.atlas.getTexture("callout-top-arrow-skin0000");
this.calloutBottomArrowSkinTexture = this.atlas.getTexture("callout-bottom-arrow-skin0000");
this.calloutLeftArrowSkinTexture = this.atlas.getTexture("callout-left-arrow-skin0000");
this.calloutRightArrowSkinTexture = this.atlas.getTexture("callout-right-arrow-skin0000");
this.dangerCalloutTopArrowSkinTexture = this.atlas.getTexture("danger-callout-top-arrow-skin0000");
this.dangerCalloutBottomArrowSkinTexture = this.atlas.getTexture("danger-callout-bottom-arrow-skin0000");
this.dangerCalloutLeftArrowSkinTexture = this.atlas.getTexture("danger-callout-left-arrow-skin0000");
this.dangerCalloutRightArrowSkinTexture = this.atlas.getTexture("danger-callout-right-arrow-skin0000");
this.checkIconTexture = this.atlas.getTexture("check-up-icon0000");
this.checkDisabledIconTexture = this.atlas.getTexture("check-disabled-icon0000");
this.checkSelectedIconTexture = this.atlas.getTexture("check-selected-up-icon0000");
this.checkSelectedDisabledIconTexture = this.atlas.getTexture("check-selected-disabled-icon0000");
this.radioIconTexture = this.atlas.getTexture("radio-up-icon0000");
this.radioDisabledIconTexture = this.atlas.getTexture("radio-disabled-icon0000");
this.radioSelectedIconTexture = this.atlas.getTexture("radio-selected-up-icon0000");
this.radioSelectedDisabledIconTexture = this.atlas.getTexture("radio-selected-disabled-icon0000");
this.pageIndicatorNormalSkinTexture = this.atlas.getTexture("page-indicator-symbol0000");
this.pageIndicatorSelectedSkinTexture = this.atlas.getTexture("page-indicator-selected-symbol0000");
this.playPauseButtonPlayUpIconTexture = this.atlas.getTexture("play-pause-toggle-button-play-up-icon0000");
this.playPauseButtonPauseUpIconTexture = this.atlas.getTexture("play-pause-toggle-button-pause-up-icon0000");
this.overlayPlayPauseButtonPlayUpIconTexture = this.atlas.getTexture("overlay-play-pause-toggle-button-play-up-icon0000");
this.fullScreenToggleButtonEnterUpIconTexture = this.atlas.getTexture("full-screen-toggle-button-enter-up-icon0000");
this.fullScreenToggleButtonExitUpIconTexture = this.atlas.getTexture("full-screen-toggle-button-exit-up-icon0000");
this.muteToggleButtonMutedUpIconTexture = this.atlas.getTexture("mute-toggle-button-muted-up-icon0000");
this.muteToggleButtonLoudUpIconTexture = this.atlas.getTexture("mute-toggle-button-loud-up-icon0000");
this.volumeSliderMinimumTrackSkinTexture = this.atlas.getTexture("volume-slider-minimum-track-skin0000");
this.volumeSliderMaximumTrackSkinTexture = this.atlas.getTexture("volume-slider-maximum-track-skin0000");
this.seekSliderProgressSkinTexture = this.atlas.getTexture("seek-slider-progress-skin0000");
this.listDrillDownAccessoryTexture = this.atlas.getTexture("list-accessory-drill-down-icon0000");
}
/**
* Initializes font sizes and formats.
*/
protected function initializeFonts():void
{
this.fontSize = 12;
this.largeFontSize = 16;
this.smallFontSize = 8;
this.primaryTextFormat = new BitmapFontTextFormat(FONT_NAME, this.fontSize, PRIMARY_TEXT_COLOR);
this.disabledTextFormat = new BitmapFontTextFormat(FONT_NAME, this.fontSize, DISABLED_TEXT_COLOR);
this.centeredTextFormat = new BitmapFontTextFormat(FONT_NAME, this.fontSize, PRIMARY_TEXT_COLOR, TextFormatAlign.CENTER);
this.centeredDisabledTextFormat = new BitmapFontTextFormat(FONT_NAME, this.fontSize, DISABLED_TEXT_COLOR, TextFormatAlign.CENTER);
this.headingTextFormat = new BitmapFontTextFormat(FONT_NAME, this.largeFontSize, PRIMARY_TEXT_COLOR);
this.headingDisabledTextFormat = new BitmapFontTextFormat(FONT_NAME, this.largeFontSize, DISABLED_TEXT_COLOR);
this.detailTextFormat = new BitmapFontTextFormat(FONT_NAME, this.smallFontSize, PRIMARY_TEXT_COLOR);
this.detailDisabledTextFormat = new BitmapFontTextFormat(FONT_NAME, this.smallFontSize, DISABLED_TEXT_COLOR);
this.dangerTextFormat = new BitmapFontTextFormat(FONT_NAME, this.fontSize, DANGER_TEXT_COLOR);
var scrollTextFontList:String = "PF Ronda Seven,Roboto,Helvetica,Arial,_sans";
this.scrollTextTextFormat = new TextFormat(scrollTextFontList, this.fontSize, PRIMARY_TEXT_COLOR);
this.scrollTextDisabledTextFormat = new TextFormat(scrollTextFontList, this.fontSize, DISABLED_TEXT_COLOR);
}
/**
* Sets global style providers for all components.
*/
protected function initializeStyleProviders():void
{
//alert
this.getStyleProviderForClass(Alert).defaultStyleFunction = this.setAlertStyles;
this.getStyleProviderForClass(Header).setFunctionForStyleName(Alert.DEFAULT_CHILD_STYLE_NAME_HEADER, this.setPanelHeaderStyles);
this.getStyleProviderForClass(ButtonGroup).setFunctionForStyleName(Alert.DEFAULT_CHILD_STYLE_NAME_BUTTON_GROUP, this.setAlertButtonGroupStyles);
this.getStyleProviderForClass(BitmapFontTextRenderer).setFunctionForStyleName(Alert.DEFAULT_CHILD_STYLE_NAME_MESSAGE, this.setAlertMessageTextRendererStyles);
//button
this.getStyleProviderForClass(Button).defaultStyleFunction = this.setButtonStyles;
this.getStyleProviderForClass(Button).setFunctionForStyleName(Button.ALTERNATE_STYLE_NAME_CALL_TO_ACTION_BUTTON, this.setCallToActionButtonStyles);
this.getStyleProviderForClass(Button).setFunctionForStyleName(Button.ALTERNATE_STYLE_NAME_QUIET_BUTTON, this.setQuietButtonStyles);
this.getStyleProviderForClass(Button).setFunctionForStyleName(Button.ALTERNATE_STYLE_NAME_DANGER_BUTTON, this.setDangerButtonStyles);
this.getStyleProviderForClass(Button).setFunctionForStyleName(Button.ALTERNATE_STYLE_NAME_BACK_BUTTON, this.setBackButtonStyles);
this.getStyleProviderForClass(Button).setFunctionForStyleName(Button.ALTERNATE_STYLE_NAME_FORWARD_BUTTON, this.setForwardButtonStyles);
this.getStyleProviderForClass(BitmapFontTextRenderer).setFunctionForStyleName(Button.DEFAULT_CHILD_STYLE_NAME_LABEL, this.setButtonLabelStyles);
this.getStyleProviderForClass(BitmapFontTextRenderer).setFunctionForStyleName(THEME_STYLE_NAME_DANGER_TEXT_RENDERER, this.setDangerTextRendererStyles);
//button group
this.getStyleProviderForClass(ButtonGroup).defaultStyleFunction = this.setButtonGroupStyles;
this.getStyleProviderForClass(Button).setFunctionForStyleName(ButtonGroup.DEFAULT_CHILD_STYLE_NAME_BUTTON, this.setButtonGroupButtonStyles);
this.getStyleProviderForClass(ToggleButton).setFunctionForStyleName(ButtonGroup.DEFAULT_CHILD_STYLE_NAME_BUTTON, this.setButtonGroupButtonStyles);
//callout
this.getStyleProviderForClass(Callout).defaultStyleFunction = this.setCalloutStyles;
//check
this.getStyleProviderForClass(Check).defaultStyleFunction = this.setCheckStyles;
this.getStyleProviderForClass(BitmapFontTextRenderer).setFunctionForStyleName(Check.DEFAULT_CHILD_STYLE_NAME_LABEL, this.setCheckLabelStyles);
//date time spinner
this.getStyleProviderForClass(SpinnerList).setFunctionForStyleName(DateTimeSpinner.DEFAULT_CHILD_STYLE_NAME_LIST, this.setDateTimeSpinnerListStyles);
this.getStyleProviderForClass(DefaultListItemRenderer).setFunctionForStyleName(THEME_STYLE_NAME_DATE_TIME_SPINNER_LIST_ITEM_RENDERER, this.setDateTimeSpinnerListItemRendererStyles);
//drawers
this.getStyleProviderForClass(Drawers).defaultStyleFunction = this.setDrawersStyles;
//grouped list (see also: item renderers)
this.getStyleProviderForClass(GroupedList).defaultStyleFunction = this.setGroupedListStyles;
this.getStyleProviderForClass(GroupedList).setFunctionForStyleName(GroupedList.ALTERNATE_STYLE_NAME_INSET_GROUPED_LIST, this.setInsetGroupedListStyles);
//header
this.getStyleProviderForClass(Header).defaultStyleFunction = this.setHeaderStyles;
this.getStyleProviderForClass(BitmapFontTextRenderer).setFunctionForStyleName(Header.DEFAULT_CHILD_STYLE_NAME_TITLE, this.setHeaderTitleStyles);
//item renderers for lists
this.getStyleProviderForClass(DefaultListItemRenderer).defaultStyleFunction = this.setItemRendererStyles;
this.getStyleProviderForClass(DefaultListItemRenderer).setFunctionForStyleName(DefaultListItemRenderer.ALTERNATE_STYLE_NAME_DRILL_DOWN, this.setDrillDownItemRendererStyles);
this.getStyleProviderForClass(DefaultListItemRenderer).setFunctionForStyleName(DefaultListItemRenderer.ALTERNATE_STYLE_NAME_CHECK, this.setCheckItemRendererStyles);
this.getStyleProviderForClass(DefaultListItemRenderer).setFunctionForStyleName(THEME_STYLE_NAME_SPINNER_LIST_ITEM_RENDERER, this.setSpinnerListItemRendererStyles);
this.getStyleProviderForClass(DefaultGroupedListItemRenderer).defaultStyleFunction = this.setItemRendererStyles;
this.getStyleProviderForClass(DefaultGroupedListItemRenderer).setFunctionForStyleName(DefaultGroupedListItemRenderer.ALTERNATE_STYLE_NAME_DRILL_DOWN, this.setDrillDownItemRendererStyles);
this.getStyleProviderForClass(DefaultGroupedListItemRenderer).setFunctionForStyleName(DefaultGroupedListItemRenderer.ALTERNATE_STYLE_NAME_CHECK, this.setCheckItemRendererStyles);
this.getStyleProviderForClass(BitmapFontTextRenderer).setFunctionForStyleName(BaseDefaultItemRenderer.DEFAULT_CHILD_STYLE_NAME_LABEL, this.setItemRendererLabelStyles);
this.getStyleProviderForClass(BitmapFontTextRenderer).setFunctionForStyleName(BaseDefaultItemRenderer.DEFAULT_CHILD_STYLE_NAME_ACCESSORY_LABEL, this.setItemRendererAccessoryLabelStyles);
this.getStyleProviderForClass(BitmapFontTextRenderer).setFunctionForStyleName(BaseDefaultItemRenderer.DEFAULT_CHILD_STYLE_NAME_ICON_LABEL, this.setItemRendererIconLabelStyles);
this.getStyleProviderForClass(BitmapFontTextRenderer).setFunctionForStyleName(THEME_STYLE_NAME_SPINNER_LIST_ITEM_RENDERER_LABEL, this.setSpinnerListItemRendererLabelStyles);
//header and footer renderers for grouped list
this.getStyleProviderForClass(DefaultGroupedListHeaderOrFooterRenderer).defaultStyleFunction = this.setGroupedListHeaderOrFooterRendererStyles;
this.getStyleProviderForClass(DefaultGroupedListHeaderOrFooterRenderer).setFunctionForStyleName(GroupedList.ALTERNATE_CHILD_STYLE_NAME_INSET_HEADER_RENDERER, this.setInsetGroupedListHeaderOrFooterRendererStyles);
this.getStyleProviderForClass(DefaultGroupedListHeaderOrFooterRenderer).setFunctionForStyleName(GroupedList.ALTERNATE_CHILD_STYLE_NAME_INSET_FOOTER_RENDERER, this.setInsetGroupedListHeaderOrFooterRendererStyles);
this.getStyleProviderForClass(BitmapFontTextRenderer).setFunctionForStyleName(DefaultGroupedListHeaderOrFooterRenderer.DEFAULT_CHILD_STYLE_NAME_CONTENT_LABEL, this.setGroupedListHeaderOrFooterRendererContentLabelStyles);
//label
this.getStyleProviderForClass(Label).setFunctionForStyleName(Label.ALTERNATE_STYLE_NAME_HEADING, this.setHeadingLabelStyles);
this.getStyleProviderForClass(Label).setFunctionForStyleName(Label.ALTERNATE_STYLE_NAME_DETAIL, this.setDetailLabelStyles);
this.getStyleProviderForClass(BitmapFontTextRenderer).setFunctionForStyleName(Label.DEFAULT_CHILD_STYLE_NAME_TEXT_RENDERER, this.setLabelTextRendererStyles);
this.getStyleProviderForClass(BitmapFontTextRenderer).setFunctionForStyleName(THEME_STYLE_NAME_HEADING_LABEL_TEXT_RENDERER, this.setHeadingLabelTextRendererStyles);
this.getStyleProviderForClass(BitmapFontTextRenderer).setFunctionForStyleName(THEME_STYLE_NAME_DETAIL_LABEL_TEXT_RENDERER, this.setDetailLabelTextRendererStyles);
//layout group
this.getStyleProviderForClass(LayoutGroup).setFunctionForStyleName(LayoutGroup.ALTERNATE_STYLE_NAME_TOOLBAR, this.setToolbarLayoutGroupStyles);
//list (see also: item renderers)
this.getStyleProviderForClass(List).defaultStyleFunction = this.setListStyles;
//numeric stepper
this.getStyleProviderForClass(NumericStepper).defaultStyleFunction = this.setNumericStepperStyles;
this.getStyleProviderForClass(TextInput).setFunctionForStyleName(NumericStepper.DEFAULT_CHILD_STYLE_NAME_TEXT_INPUT, this.setNumericStepperTextInputStyles);
this.getStyleProviderForClass(Button).setFunctionForStyleName(NumericStepper.DEFAULT_CHILD_STYLE_NAME_DECREMENT_BUTTON, this.setNumericStepperButtonStyles);
this.getStyleProviderForClass(Button).setFunctionForStyleName(NumericStepper.DEFAULT_CHILD_STYLE_NAME_INCREMENT_BUTTON, this.setNumericStepperButtonStyles);
this.getStyleProviderForClass(BitmapFontTextEditor).setFunctionForStyleName(THEME_STYLE_NAME_NUMERIC_STEPPER_TEXT_INPUT_TEXT_EDITOR, this.setNumericStepperTextInputTextEditorStyles);
//page indicator
this.getStyleProviderForClass(PageIndicator).defaultStyleFunction = this.setPageIndicatorStyles;
//panel
this.getStyleProviderForClass(Panel).defaultStyleFunction = this.setPanelStyles;
this.getStyleProviderForClass(Header).setFunctionForStyleName(Panel.DEFAULT_CHILD_STYLE_NAME_HEADER, this.setPanelHeaderStyles);
//panel screen
this.getStyleProviderForClass(PanelScreen).defaultStyleFunction = this.setPanelScreenStyles;
this.getStyleProviderForClass(Header).setFunctionForStyleName(PanelScreen.DEFAULT_CHILD_STYLE_NAME_HEADER, this.setPanelScreenHeaderStyles);
//picker list (see also: item renderers)
this.getStyleProviderForClass(PickerList).defaultStyleFunction = this.setPickerListStyles;
this.getStyleProviderForClass(Button).setFunctionForStyleName(PickerList.DEFAULT_CHILD_STYLE_NAME_BUTTON, this.setPickerListButtonStyles);
this.getStyleProviderForClass(ToggleButton).setFunctionForStyleName(PickerList.DEFAULT_CHILD_STYLE_NAME_BUTTON, this.setPickerListButtonStyles);
this.getStyleProviderForClass(List).setFunctionForStyleName(PickerList.DEFAULT_CHILD_STYLE_NAME_LIST, this.setPickerListPopUpListStyles);
//progress bar
this.getStyleProviderForClass(ProgressBar).defaultStyleFunction = this.setProgressBarStyles;
//radio
this.getStyleProviderForClass(Radio).defaultStyleFunction = this.setRadioStyles;
this.getStyleProviderForClass(BitmapFontTextRenderer).setFunctionForStyleName(Radio.DEFAULT_CHILD_STYLE_NAME_LABEL, this.setRadioLabelStyles);
//scroll container
this.getStyleProviderForClass(ScrollContainer).defaultStyleFunction = this.setScrollContainerStyles;
this.getStyleProviderForClass(ScrollContainer).setFunctionForStyleName(ScrollContainer.ALTERNATE_STYLE_NAME_TOOLBAR, this.setToolbarScrollContainerStyles);
//scroll screen
this.getStyleProviderForClass(ScrollScreen).defaultStyleFunction = this.setScrollScreenStyles;
//scroll text
this.getStyleProviderForClass(ScrollText).defaultStyleFunction = this.setScrollTextStyles;
//simple scroll bar
this.getStyleProviderForClass(Button).setFunctionForStyleName(SimpleScrollBar.DEFAULT_CHILD_STYLE_NAME_THUMB, this.setSimpleScrollBarThumbStyles);
//slider
this.getStyleProviderForClass(Slider).defaultStyleFunction = this.setSliderStyles;
this.getStyleProviderForClass(Button).setFunctionForStyleName(Slider.DEFAULT_CHILD_STYLE_NAME_THUMB, this.setSliderThumbStyles);
this.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_HORIZONTAL_SLIDER_MINIMUM_TRACK, this.setHorizontalSliderMinimumTrackStyles);
this.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_VERTICAL_SLIDER_MINIMUM_TRACK, this.setVerticalSliderMinimumTrackStyles);
//spinner list
this.getStyleProviderForClass(SpinnerList).defaultStyleFunction = this.setSpinnerListStyles;
//tab bar
this.getStyleProviderForClass(TabBar).defaultStyleFunction = this.setTabBarStyles;
this.getStyleProviderForClass(ToggleButton).setFunctionForStyleName(TabBar.DEFAULT_CHILD_STYLE_NAME_TAB, this.setTabStyles);
//text input
this.getStyleProviderForClass(TextInput).defaultStyleFunction = this.setTextInputStyles;
this.getStyleProviderForClass(TextInput).setFunctionForStyleName(TextInput.ALTERNATE_STYLE_NAME_SEARCH_TEXT_INPUT, this.setSearchTextInputStyles);
this.getStyleProviderForClass(BitmapFontTextRenderer).setFunctionForStyleName(TextInput.DEFAULT_CHILD_STYLE_NAME_PROMPT, this.setTextInputPromptStyles);
this.getStyleProviderForClass(StageTextTextEditor).setFunctionForStyleName(TextInput.DEFAULT_CHILD_STYLE_NAME_TEXT_EDITOR, this.setTextInputTextEditorStyles);
this.getStyleProviderForClass(TextCallout).setFunctionForStyleName(TextInput.DEFAULT_CHILD_STYLE_NAME_ERROR_CALLOUT, this.setTextInputErrorCalloutStyles);
//text area
this.getStyleProviderForClass(TextArea).defaultStyleFunction = this.setTextAreaStyles;
this.getStyleProviderForClass(TextFieldTextEditorViewPort).setFunctionForStyleName(TextArea.DEFAULT_CHILD_STYLE_NAME_TEXT_EDITOR, this.setTextAreaTextEditorStyles);
this.getStyleProviderForClass(TextCallout).setFunctionForStyleName(TextArea.DEFAULT_CHILD_STYLE_NAME_ERROR_CALLOUT, this.setTextAreaErrorCalloutStyles);
//text callout
this.getStyleProviderForClass(TextCallout).defaultStyleFunction = this.setTextCalloutStyles;
this.getStyleProviderForClass(BitmapFontTextRenderer).setFunctionForStyleName(TextCallout.DEFAULT_CHILD_STYLE_NAME_TEXT_RENDERER, this.setTextCalloutTextRendererStyles);
//toggle button
this.getStyleProviderForClass(ToggleButton).defaultStyleFunction = this.setButtonStyles;
this.getStyleProviderForClass(ToggleButton).setFunctionForStyleName(Button.ALTERNATE_STYLE_NAME_QUIET_BUTTON, this.setQuietButtonStyles);
//toggle switch
this.getStyleProviderForClass(ToggleSwitch).defaultStyleFunction = this.setToggleSwitchStyles;
this.getStyleProviderForClass(Button).setFunctionForStyleName(ToggleSwitch.DEFAULT_CHILD_STYLE_NAME_THUMB, this.setToggleSwitchThumbStyles);
this.getStyleProviderForClass(ToggleButton).setFunctionForStyleName(ToggleSwitch.DEFAULT_CHILD_STYLE_NAME_THUMB, this.setToggleSwitchThumbStyles);
this.getStyleProviderForClass(Button).setFunctionForStyleName(ToggleSwitch.DEFAULT_CHILD_STYLE_NAME_ON_TRACK, this.setToggleSwitchOnTrackStyles);
this.getStyleProviderForClass(BitmapFontTextRenderer).setFunctionForStyleName(ToggleSwitch.DEFAULT_CHILD_STYLE_NAME_ON_LABEL, this.setToggleSwitchOnLabelStyles);
this.getStyleProviderForClass(BitmapFontTextRenderer).setFunctionForStyleName(ToggleSwitch.DEFAULT_CHILD_STYLE_NAME_OFF_LABEL, this.setToggleSwitchOffLabelStyles);
//media controls
this.getStyleProviderForClass(VideoPlayer).defaultStyleFunction = this.setVideoPlayerStyles;
//play/pause toggle button
this.getStyleProviderForClass(PlayPauseToggleButton).defaultStyleFunction = this.setPlayPauseToggleButtonStyles;
this.getStyleProviderForClass(PlayPauseToggleButton).setFunctionForStyleName(PlayPauseToggleButton.ALTERNATE_STYLE_NAME_OVERLAY_PLAY_PAUSE_TOGGLE_BUTTON, this.setOverlayPlayPauseToggleButtonStyles);
//full screen toggle button
this.getStyleProviderForClass(FullScreenToggleButton).defaultStyleFunction = this.setFullScreenToggleButtonStyles;
//mute toggle button
this.getStyleProviderForClass(MuteToggleButton).defaultStyleFunction = this.setMuteToggleButtonStyles;
//seek slider
this.getStyleProviderForClass(SeekSlider).defaultStyleFunction = this.setSeekSliderStyles;
this.getStyleProviderForClass(Button).setFunctionForStyleName(SeekSlider.DEFAULT_CHILD_STYLE_NAME_THUMB, this.setSliderThumbStyles);
this.getStyleProviderForClass(Button).setFunctionForStyleName(SeekSlider.DEFAULT_CHILD_STYLE_NAME_MINIMUM_TRACK, this.setHorizontalSliderMinimumTrackStyles);
//volume slider
this.getStyleProviderForClass(VolumeSlider).defaultStyleFunction = this.setVolumeSliderStyles;
this.getStyleProviderForClass(Button).setFunctionForStyleName(VolumeSlider.DEFAULT_CHILD_STYLE_NAME_THUMB, this.setVolumeSliderThumbStyles);
this.getStyleProviderForClass(Button).setFunctionForStyleName(VolumeSlider.DEFAULT_CHILD_STYLE_NAME_MINIMUM_TRACK, this.setVolumeSliderMinimumTrackStyles);
this.getStyleProviderForClass(Button).setFunctionForStyleName(VolumeSlider.DEFAULT_CHILD_STYLE_NAME_MAXIMUM_TRACK, this.setVolumeSliderMaximumTrackStyles);
}
protected function pageIndicatorNormalSymbolFactory():DisplayObject
{
return new Image(this.pageIndicatorNormalSkinTexture);
}
protected function pageIndicatorSelectedSymbolFactory():DisplayObject
{
return new Image(this.pageIndicatorSelectedSkinTexture);
}
//-------------------------
// Shared
//-------------------------
protected function setNoStyles(target:DisplayObject):void
{
//if this is assigned as a style function, chances are the target
//will be a subcomponent of something. the style function for this
//component's parent is probably handing the styling for the target
}
protected function setScrollerStyles(scroller:Scroller):void
{
scroller.horizontalScrollBarFactory = scrollBarFactory;
scroller.verticalScrollBarFactory = scrollBarFactory;
}
//-------------------------
// Alert
//-------------------------
protected function setAlertStyles(alert:Alert):void
{
this.setScrollerStyles(alert);
var backgroundSkin:Image = new Image(this.popUpBackgroundSkinTexture);
backgroundSkin.scale9Grid = DEFAULT_SCALE_9_GRID;
backgroundSkin.width = this.controlSize;
backgroundSkin.height = this.controlSize;
alert.backgroundSkin = backgroundSkin;
alert.paddingTop = this.gutterSize;
alert.paddingRight = this.gutterSize;
alert.paddingBottom = this.smallGutterSize;
alert.paddingLeft = this.gutterSize;
alert.outerPadding = this.borderSize;
alert.outerPaddingBottom = this.borderSize + this.dropShadowSize;
alert.outerPaddingRight = this.borderSize + this.dropShadowSize;
alert.gap = this.smallGutterSize;
alert.maxWidth = this.popUpFillSize;
alert.maxHeight = this.popUpFillSize;
}
protected function setAlertButtonGroupStyles(group:ButtonGroup):void
{
group.direction = Direction.VERTICAL;
group.horizontalAlign = HorizontalAlign.JUSTIFY;
group.verticalAlign = VerticalAlign.JUSTIFY;
group.gap = this.smallGutterSize;
group.padding = this.smallGutterSize;
}
protected function setAlertMessageTextRendererStyles(renderer:BitmapFontTextRenderer):void
{
renderer.wordWrap = true;
renderer.textFormat = this.primaryTextFormat;
}
//-------------------------
// Button
//-------------------------
protected function setBaseButtonStyles(button:Button):void
{
button.paddingTop = this.smallGutterSize;
button.paddingBottom = this.smallGutterSize;
button.paddingLeft = this.gutterSize;
button.paddingRight = this.gutterSize;
button.gap = this.smallGutterSize;
button.minGap = this.smallGutterSize;
button.minWidth = this.smallControlSize;
button.minHeight = this.smallControlSize;
button.minTouchWidth = this.gridSize;
button.minTouchHeight = this.gridSize;
}
protected function setButtonStyles(button:Button):void
{
var skin:ImageSkin = new ImageSkin(this.buttonUpSkinTexture);
skin.setTextureForState(ButtonState.DOWN, this.buttonDownSkinTexture);
skin.setTextureForState(ButtonState.DISABLED, this.buttonDisabledSkinTexture);
if(button is ToggleButton)
{
//for convenience, this function can style both a regular button
//and a toggle button
skin.selectedTexture = this.buttonSelectedSkinTexture;
skin.setTextureForState(ButtonState.DOWN_AND_SELECTED, this.buttonDownSkinTexture);
skin.setTextureForState(ButtonState.DISABLED_AND_SELECTED, this.buttonSelectedDisabledSkinTexture);
}
skin.scale9Grid = DEFAULT_SCALE_9_GRID;
skin.width = this.controlSize;
skin.height = this.controlSize;
button.defaultSkin = skin;
this.setBaseButtonStyles(button);
}
protected function setButtonLabelStyles(textRenderer:BitmapFontTextRenderer):void
{
textRenderer.textFormat = this.primaryTextFormat;
textRenderer.disabledTextFormat = this.disabledTextFormat;
}
protected function setCallToActionButtonStyles(button:Button):void
{
var skin:ImageSkin = new ImageSkin(this.buttonCallToActionUpSkinTexture);
skin.setTextureForState(ButtonState.DOWN, this.buttonDownSkinTexture);
skin.setTextureForState(ButtonState.DISABLED, this.buttonDisabledSkinTexture);
skin.scale9Grid = DEFAULT_SCALE_9_GRID;
skin.width = this.controlSize;
skin.height = this.controlSize;
button.defaultSkin = skin;
this.setBaseButtonStyles(button);
}
protected function setQuietButtonStyles(button:Button):void
{
var defaultSkin:Quad = new Quad(this.controlSize, this.controlSize, 0xff00ff);
defaultSkin.alpha = 0;
button.defaultSkin = defaultSkin;
var otherSkin:ImageSkin = new ImageSkin(null);
otherSkin.setTextureForState(ButtonState.DOWN, this.buttonDownSkinTexture);
if(button is ToggleButton)
{
//for convenience, this function can style both a regular button
//and a toggle button
otherSkin.selectedTexture = this.buttonSelectedSkinTexture;
otherSkin.setTextureForState(ButtonState.DOWN_AND_SELECTED, this.buttonDownSkinTexture);
otherSkin.setTextureForState(ButtonState.DISABLED_AND_SELECTED, this.buttonSelectedDisabledSkinTexture);
ToggleButton(button).defaultSelectedSkin = otherSkin;
button.setSkinForState(ButtonState.DOWN_AND_SELECTED, otherSkin);
button.setSkinForState(ButtonState.DISABLED_AND_SELECTED, otherSkin);
}
button.setSkinForState(ButtonState.DOWN, otherSkin);
otherSkin.scale9Grid = DEFAULT_SCALE_9_GRID;
otherSkin.width = this.controlSize;
otherSkin.height = this.controlSize;
this.setBaseButtonStyles(button);
}
protected function setDangerButtonStyles(button:Button):void
{
var skin:ImageSkin = new ImageSkin(this.buttonDangerUpSkinTexture);
skin.setTextureForState(ButtonState.DOWN, this.buttonDangerDownSkinTexture);
skin.setTextureForState(ButtonState.DISABLED, this.buttonDisabledSkinTexture);
skin.scale9Grid = DEFAULT_SCALE_9_GRID;
skin.width = this.controlSize;
skin.height = this.controlSize;
button.defaultSkin = skin;
button.customLabelStyleName = THEME_STYLE_NAME_DANGER_TEXT_RENDERER;
this.setBaseButtonStyles(button);
}
protected function setBackButtonStyles(button:Button):void
{
var skin:ImageSkin = new ImageSkin(this.buttonBackUpSkinTexture);
skin.setTextureForState(ButtonState.DOWN, this.buttonBackDownSkinTexture);
skin.setTextureForState(ButtonState.DISABLED, this.buttonBackDisabledSkinTexture);
skin.scale9Grid = BACK_BUTTON_SCALE9_GRID;
skin.width = this.controlSize;
skin.height = this.controlSize;
button.defaultSkin = skin;
this.setBaseButtonStyles(button);
button.minWidth = this.controlSize;
button.height = this.controlSize;
button.paddingLeft = 2 * this.gutterSize;
}
protected function setForwardButtonStyles(button:Button):void
{
var skin:ImageSkin = new ImageSkin(this.buttonForwardUpSkinTexture);
skin.setTextureForState(ButtonState.DOWN, this.buttonForwardDownSkinTexture);
skin.setTextureForState(ButtonState.DISABLED, this.buttonForwardDisabledSkinTexture);
skin.scale9Grid = FORWARD_BUTTON_SCALE9_GRID;
skin.width = this.controlSize;
skin.height = this.controlSize;
button.defaultSkin = skin;
this.setBaseButtonStyles(button);
button.minWidth = this.controlSize;
button.height = this.controlSize;
button.paddingRight = 2 * this.gutterSize;
}
//-------------------------
// ButtonGroup
//-------------------------
protected function setButtonGroupStyles(group:ButtonGroup):void
{
group.minWidth = this.popUpFillSize;
group.gap = this.smallGutterSize;
}
protected function setButtonGroupButtonStyles(button:Button):void
{
var skin:ImageSkin = new ImageSkin(this.buttonUpSkinTexture);
skin.setTextureForState(ButtonState.DOWN, this.buttonDownSkinTexture);
skin.setTextureForState(ButtonState.DISABLED, this.buttonDisabledSkinTexture);
if(button is ToggleButton)
{
//for convenience, this function can style both a regular button
//and a toggle button
skin.selectedTexture = this.buttonSelectedSkinTexture;
skin.setTextureForState(ButtonState.DOWN_AND_SELECTED, this.buttonDownSkinTexture);
skin.setTextureForState(ButtonState.DISABLED_AND_SELECTED, this.buttonSelectedDisabledSkinTexture);
}
skin.scale9Grid = DEFAULT_SCALE_9_GRID;
skin.width = this.gridSize;
skin.height = this.gridSize;
button.defaultSkin = skin;
button.paddingTop = this.smallGutterSize;
button.paddingBottom = this.smallGutterSize;
button.paddingLeft = this.gutterSize;
button.paddingRight = this.gutterSize;
button.gap = this.smallGutterSize;
button.minGap = this.smallGutterSize;
button.minWidth = this.gridSize;
button.minHeight = this.gridSize;
button.minTouchWidth = this.gridSize;
button.minTouchHeight = this.gridSize;
}
//-------------------------
// Callout
//-------------------------
protected function setCalloutStyles(callout:Callout):void
{
callout.padding = this.smallGutterSize;
callout.paddingRight = this.gutterSize + this.dropShadowSize;
callout.paddingBottom = this.gutterSize + this.dropShadowSize;
var backgroundSkin:Image = new Image(this.popUpBackgroundSkinTexture);
backgroundSkin.scale9Grid = DEFAULT_SCALE_9_GRID;
backgroundSkin.width = this.calloutBackgroundMinSize;
backgroundSkin.height = this.calloutBackgroundMinSize;
callout.backgroundSkin = backgroundSkin;
var topArrowSkin:Image = new Image(this.calloutTopArrowSkinTexture);
callout.topArrowSkin = topArrowSkin;
callout.topArrowGap = this.calloutTopLeftArrowOverlapGapSize;
var bottomArrowSkin:Image = new Image(this.calloutBottomArrowSkinTexture);
callout.bottomArrowSkin = bottomArrowSkin;
callout.bottomArrowGap = this.calloutBottomRightArrowOverlapGapSize;
var leftArrowSkin:Image = new Image(this.calloutLeftArrowSkinTexture);
callout.leftArrowSkin = leftArrowSkin;
callout.leftArrowGap = this.calloutTopLeftArrowOverlapGapSize;
var rightArrowSkin:Image = new Image(this.calloutRightArrowSkinTexture);
callout.rightArrowSkin = rightArrowSkin;
callout.rightArrowGap = this.calloutBottomRightArrowOverlapGapSize;
}
protected function setDangerCalloutStyles(callout:Callout):void
{
callout.padding = this.smallGutterSize;
callout.paddingRight = this.gutterSize + this.dropShadowSize;
callout.paddingBottom = this.gutterSize + this.dropShadowSize;
var backgroundSkin:Image = new Image(this.dangerPopUpBackgroundSkinTexture);
backgroundSkin.scale9Grid = DEFAULT_SCALE_9_GRID;
backgroundSkin.width = this.calloutBackgroundMinSize;
backgroundSkin.height = this.calloutBackgroundMinSize;
callout.backgroundSkin = backgroundSkin;
var topArrowSkin:Image = new Image(this.dangerCalloutTopArrowSkinTexture);
callout.topArrowSkin = topArrowSkin;
callout.topArrowGap = this.calloutTopLeftArrowOverlapGapSize;
var bottomArrowSkin:Image = new Image(this.dangerCalloutBottomArrowSkinTexture);
callout.bottomArrowSkin = bottomArrowSkin;
callout.bottomArrowGap = this.calloutBottomRightArrowOverlapGapSize;
var leftArrowSkin:Image = new Image(this.dangerCalloutLeftArrowSkinTexture);
callout.leftArrowSkin = leftArrowSkin;
callout.leftArrowGap = this.calloutTopLeftArrowOverlapGapSize;
var rightArrowSkin:Image = new Image(this.dangerCalloutRightArrowSkinTexture);
callout.rightArrowSkin = rightArrowSkin;
callout.rightArrowGap = this.calloutBottomRightArrowOverlapGapSize;
}
//-------------------------
// Check
//-------------------------
protected function setCheckStyles(check:Check):void
{
var icon:ImageSkin = new ImageSkin(this.checkIconTexture);
icon.selectedTexture = this.checkSelectedIconTexture;
icon.setTextureForState(ButtonState.DISABLED, this.checkDisabledIconTexture);
icon.setTextureForState(ButtonState.DISABLED_AND_SELECTED, this.checkSelectedDisabledIconTexture);
check.defaultIcon = icon;
check.gap = this.smallGutterSize;
check.minWidth = this.controlSize;
check.minHeight = this.controlSize;
check.minTouchWidth = this.gridSize;
check.minTouchHeight = this.gridSize;
check.horizontalAlign = HorizontalAlign.LEFT;
check.verticalAlign = VerticalAlign.MIDDLE;
}
protected function setCheckLabelStyles(textRenderer:BitmapFontTextRenderer):void
{
textRenderer.textFormat = this.primaryTextFormat;
textRenderer.disabledTextFormat = this.disabledTextFormat;
}
//-------------------------
// DateTimeSpinner
//-------------------------
protected function setDateTimeSpinnerListStyles(list:SpinnerList):void
{
this.setSpinnerListStyles(list);
list.customItemRendererStyleName = THEME_STYLE_NAME_DATE_TIME_SPINNER_LIST_ITEM_RENDERER;
}
protected function setDateTimeSpinnerListItemRendererStyles(itemRenderer:DefaultListItemRenderer):void
{
this.setSpinnerListItemRendererStyles(itemRenderer);
itemRenderer.accessoryPosition = RelativePosition.LEFT;
itemRenderer.gap = this.gutterSize;
itemRenderer.minGap = this.gutterSize;
itemRenderer.accessoryGap = this.gutterSize;
itemRenderer.minAccessoryGap = this.gutterSize;
}
//-------------------------
// Drawers
//-------------------------
protected function setDrawersStyles(drawers:Drawers):void
{
var overlaySkin:Quad = new Quad(10, 10, MODAL_OVERLAY_COLOR);
overlaySkin.alpha = MODAL_OVERLAY_ALPHA;
drawers.overlaySkin = overlaySkin;
var topDrawerDivider:Quad = new Quad(this.borderSize, this.borderSize, DRAWERS_DIVIDER_COLOR);
drawers.topDrawerDivider = topDrawerDivider;
var rightDrawerDivider:Quad = new Quad(this.borderSize, this.borderSize, DRAWERS_DIVIDER_COLOR);
drawers.rightDrawerDivider = rightDrawerDivider;
var bottomDrawerDivider:Quad = new Quad(this.borderSize, this.borderSize, DRAWERS_DIVIDER_COLOR);
drawers.bottomDrawerDivider = bottomDrawerDivider;
var leftDrawerDivider:Quad = new Quad(this.borderSize, this.borderSize, DRAWERS_DIVIDER_COLOR);
drawers.leftDrawerDivider = leftDrawerDivider;
}
//-------------------------
// GroupedList
//-------------------------
protected function setGroupedListStyles(list:GroupedList):void
{
this.setScrollerStyles(list);
var backgroundSkin:Quad = new Quad(this.gridSize, this.gridSize, LIST_BACKGROUND_COLOR);
list.backgroundSkin = backgroundSkin;
}
//see List section for item renderer styles
protected function setGroupedListHeaderOrFooterRendererStyles(renderer:DefaultGroupedListHeaderOrFooterRenderer):void
{
renderer.backgroundSkin = new Quad(1, 1, LIST_HEADER_BACKGROUND_COLOR);
renderer.paddingTop = this.smallGutterSize;
renderer.paddingBottom = this.smallGutterSize;
renderer.paddingLeft = this.gutterSize;
renderer.paddingRight = this.gutterSize;
}
protected function setGroupedListHeaderOrFooterRendererContentLabelStyles(textRenderer:BitmapFontTextRenderer):void
{
textRenderer.textFormat = this.primaryTextFormat;
textRenderer.disabledTextFormat = this.disabledTextFormat;
}
protected function setInsetGroupedListStyles(list:GroupedList):void
{
this.setScrollerStyles(list);
list.customHeaderRendererStyleName = GroupedList.ALTERNATE_CHILD_STYLE_NAME_INSET_HEADER_RENDERER;
list.customFooterRendererStyleName = GroupedList.ALTERNATE_CHILD_STYLE_NAME_INSET_FOOTER_RENDERER;
var layout:VerticalLayout = new VerticalLayout();
layout.useVirtualLayout = true;
layout.padding = this.gutterSize;
layout.paddingTop = 0;
layout.gap = 0;
layout.horizontalAlign = HorizontalAlign.JUSTIFY;
layout.verticalAlign = VerticalAlign.TOP;
list.layout = layout;
}
protected function setInsetGroupedListHeaderOrFooterRendererStyles(renderer:DefaultGroupedListHeaderOrFooterRenderer):void
{
renderer.paddingTop = this.smallGutterSize;
renderer.paddingBottom = this.smallGutterSize;
renderer.paddingLeft = this.gutterSize;
renderer.paddingRight = this.gutterSize;
renderer.minWidth = this.controlSize;
renderer.minHeight = this.controlSize;
}
//-------------------------
// Header
//-------------------------
protected function setHeaderStyles(header:Header):void
{
header.minWidth = this.gridSize;
header.minHeight = this.gridSize;
header.padding = this.smallGutterSize;
header.gap = this.smallGutterSize;
header.titleGap = this.smallGutterSize;
var backgroundSkin:Image = new Image(this.headerSkinTexture);
backgroundSkin.scale9Grid = HEADER_SCALE_9_GRID;
backgroundSkin.width = this.gridSize;
backgroundSkin.height = this.gridSize;
header.backgroundSkin = backgroundSkin;
}
protected function setHeaderTitleStyles(textRenderer:BitmapFontTextRenderer):void
{
textRenderer.textFormat = this.primaryTextFormat;
textRenderer.disabledTextFormat = this.disabledTextFormat;
}
//-------------------------
// Label
//-------------------------
protected function setLabelTextRendererStyles(textRenderer:BitmapFontTextRenderer):void
{
textRenderer.textFormat = this.primaryTextFormat;
textRenderer.disabledTextFormat = this.disabledTextFormat;
}
protected function setHeadingLabelStyles(label:Label):void
{
label.customTextRendererStyleName = THEME_STYLE_NAME_HEADING_LABEL_TEXT_RENDERER;
}
protected function setHeadingLabelTextRendererStyles(textRenderer:BitmapFontTextRenderer):void
{
textRenderer.textFormat = this.headingTextFormat;
textRenderer.disabledTextFormat = this.headingDisabledTextFormat;
}
protected function setDetailLabelStyles(label:Label):void
{
label.customTextRendererStyleName = THEME_STYLE_NAME_DETAIL_LABEL_TEXT_RENDERER;
}
protected function setDetailLabelTextRendererStyles(textRenderer:BitmapFontTextRenderer):void
{
textRenderer.textFormat = this.detailTextFormat;
textRenderer.disabledTextFormat = this.detailDisabledTextFormat;
}
//-------------------------
// LayoutGroup
//-------------------------
protected function setToolbarLayoutGroupStyles(group:LayoutGroup):void
{
if(!group.layout)
{
var layout:HorizontalLayout = new HorizontalLayout();
layout.padding = this.smallGutterSize;
layout.gap = this.smallGutterSize;
layout.verticalAlign = VerticalAlign.MIDDLE;
group.layout = layout;
}
group.minWidth = this.gridSize;
group.minHeight = this.gridSize;
var backgroundSkin:Image = new Image(this.headerSkinTexture);
backgroundSkin.scale9Grid = HEADER_SCALE_9_GRID;
backgroundSkin.width = this.gridSize;
backgroundSkin.height = this.gridSize;
group.backgroundSkin = backgroundSkin;
}
//-------------------------
// List
//-------------------------
protected function setListStyles(list:List):void
{
this.setScrollerStyles(list);
list.backgroundSkin = new Quad(this.gridSize, this.gridSize, LIST_BACKGROUND_COLOR);
}
protected function setItemRendererStyles(renderer:BaseDefaultItemRenderer):void
{
var defaultSkin:Image = new Image(this.itemRendererUpSkinTexture);
defaultSkin.scale9Grid = ITEM_RENDERER_SCALE_9_GRID;
defaultSkin.width = this.gridSize;
defaultSkin.height = this.gridSize;
renderer.defaultSkin = defaultSkin;
var otherSkin:ImageSkin = new ImageSkin(null);
otherSkin.defaultTexture = this.itemRendererDownSkinTexture;
otherSkin.selectedTexture = this.itemRendererSelectedUpSkinTexture;
otherSkin.scale9Grid = DEFAULT_SCALE_9_GRID;
otherSkin.width = this.gridSize;
otherSkin.height = this.gridSize;
renderer.defaultSelectedSkin = otherSkin;
renderer.setSkinForState(ButtonState.DOWN, otherSkin);
renderer.paddingTop = this.smallGutterSize;
renderer.paddingBottom = this.smallGutterSize;
renderer.paddingLeft = this.gutterSize;
renderer.paddingRight = this.gutterSize;
renderer.gap = this.gutterSize;
renderer.minGap = this.gutterSize;
renderer.accessoryGap = Number.POSITIVE_INFINITY;
renderer.minAccessoryGap = this.gutterSize;
renderer.minWidth = this.gridSize;
renderer.minHeight = this.gridSize;
renderer.minTouchWidth = this.gridSize;
renderer.minTouchHeight = this.gridSize;
renderer.horizontalAlign = HorizontalAlign.LEFT;
renderer.iconPosition = RelativePosition.LEFT;
renderer.accessoryPosition = RelativePosition.RIGHT;
}
protected function setDrillDownItemRendererStyles(itemRenderer:BaseDefaultItemRenderer):void
{
this.setItemRendererStyles(itemRenderer);
itemRenderer.itemHasAccessory = false;
var defaultAccessory:ImageLoader = new ImageLoader();
defaultAccessory.source = this.listDrillDownAccessoryTexture;
itemRenderer.defaultAccessory = defaultAccessory;
}
protected function setCheckItemRendererStyles(itemRenderer:BaseDefaultItemRenderer):void
{
var defaultSkin:Image = new Image(this.itemRendererUpSkinTexture);
defaultSkin.scale9Grid = ITEM_RENDERER_SCALE_9_GRID;
defaultSkin.width = this.gridSize;
defaultSkin.height = this.gridSize;
itemRenderer.defaultSkin = defaultSkin;
var otherSkin:Image = new Image(this.itemRendererDownSkinTexture);
otherSkin.scale9Grid = DEFAULT_SCALE_9_GRID;
otherSkin.width = this.gridSize;
otherSkin.height = this.gridSize;
itemRenderer.setSkinForState(ButtonState.DOWN, otherSkin);
var defaultSelectedIcon:ImageLoader = new ImageLoader();
defaultSelectedIcon.source = this.checkItemRendererSelectedIconTexture;
itemRenderer.defaultSelectedIcon = defaultSelectedIcon;
var frame:Rectangle = this.checkItemRendererSelectedIconTexture.frame;
if(frame)
{
var iconWidth:Number = frame.width;
var iconHeight:Number = frame.height;
}
else
{
iconWidth = this.checkItemRendererSelectedIconTexture.width;
iconHeight = this.checkItemRendererSelectedIconTexture.height;
}
var defaultIcon:Quad = new Quad(iconWidth, iconHeight, 0xff00ff);
defaultIcon.alpha = 0;
itemRenderer.defaultIcon = defaultIcon;
itemRenderer.itemHasIcon = false;
itemRenderer.paddingTop = this.smallGutterSize;
itemRenderer.paddingBottom = this.smallGutterSize;
itemRenderer.paddingLeft = this.gutterSize;
itemRenderer.paddingRight = this.gutterSize;
itemRenderer.gap = Number.POSITIVE_INFINITY;
itemRenderer.minGap = this.gutterSize;
itemRenderer.iconPosition = RelativePosition.RIGHT;
itemRenderer.horizontalAlign = HorizontalAlign.LEFT;
itemRenderer.accessoryGap = this.smallGutterSize;
itemRenderer.minAccessoryGap = this.smallGutterSize;
itemRenderer.accessoryPosition = RelativePosition.BOTTOM;
itemRenderer.layoutOrder = ItemRendererLayoutOrder.LABEL_ACCESSORY_ICON;
itemRenderer.minWidth = this.gridSize;
itemRenderer.minHeight = this.gridSize;
itemRenderer.minTouchWidth = this.gridSize;
itemRenderer.minTouchHeight = this.gridSize;
}
protected function setItemRendererLabelStyles(textRenderer:BitmapFontTextRenderer):void
{
textRenderer.textFormat = this.primaryTextFormat;
textRenderer.disabledTextFormat = this.disabledTextFormat;
}
protected function setItemRendererAccessoryLabelStyles(textRenderer:BitmapFontTextRenderer):void
{
textRenderer.textFormat = this.primaryTextFormat;
textRenderer.disabledTextFormat = this.disabledTextFormat;
}
protected function setItemRendererIconLabelStyles(textRenderer:BitmapFontTextRenderer):void
{
textRenderer.textFormat = this.primaryTextFormat;
textRenderer.disabledTextFormat = this.disabledTextFormat;
}
//-------------------------
// NumericStepper
//-------------------------
protected function setNumericStepperStyles(stepper:NumericStepper):void
{
stepper.buttonLayoutMode = StepperButtonLayoutMode.SPLIT_HORIZONTAL;
stepper.incrementButtonLabel = "+";
stepper.decrementButtonLabel = "-";
}
protected function setNumericStepperTextInputStyles(input:TextInput):void
{
input.minWidth = this.controlSize;
input.minHeight = this.controlSize;
input.minTouchWidth = this.gridSize;
input.minTouchHeight = this.gridSize;
input.gap = this.smallGutterSize;
input.padding = this.smallGutterSize;
input.isEditable = false;
input.isSelectable = false;
input.textEditorFactory = numericStepperTextEditorFactory;
input.customTextEditorStyleName = THEME_STYLE_NAME_NUMERIC_STEPPER_TEXT_INPUT_TEXT_EDITOR;
var skin:ImageSkin = new ImageSkin(this.insetBackgroundSkinTexture);
skin.setTextureForState(TextInputState.DISABLED, this.insetBackgroundDisabledSkinTexture);
skin.setTextureForState(TextInputState.FOCUSED, this.insetBackgroundFocusedSkinTexture);
skin.scale9Grid = DEFAULT_SCALE_9_GRID;
skin.width = this.gridSize;
skin.height = this.controlSize;
input.backgroundSkin = skin;
}
protected function setNumericStepperTextInputTextEditorStyles(textEditor:BitmapFontTextEditor):void
{
textEditor.textFormat = this.centeredTextFormat;
textEditor.disabledTextFormat = this.centeredDisabledTextFormat;
}
protected function setNumericStepperButtonStyles(button:Button):void
{
this.setButtonStyles(button);
button.keepDownStateOnRollOut = true;
}
//-------------------------
// PageIndicator
//-------------------------
protected function setPageIndicatorStyles(pageIndicator:PageIndicator):void
{
pageIndicator.normalSymbolFactory = this.pageIndicatorNormalSymbolFactory;
pageIndicator.selectedSymbolFactory = this.pageIndicatorSelectedSymbolFactory;
pageIndicator.gap = this.smallGutterSize;
pageIndicator.padding = this.smallGutterSize;
pageIndicator.minTouchWidth = this.smallControlSize * 2;
pageIndicator.minTouchHeight = this.smallControlSize * 2;
}
//-------------------------
// Panel
//-------------------------
protected function setPanelStyles(panel:Panel):void
{
this.setScrollerStyles(panel);
var backgroundSkin:Image = new Image(this.panelBackgroundSkinTexture);
backgroundSkin.scale9Grid = DEFAULT_SCALE_9_GRID;
backgroundSkin.width = this.smallControlSize;
backgroundSkin.height = this.smallControlSize;
panel.backgroundSkin = backgroundSkin;
panel.outerPadding = this.borderSize;
panel.padding = this.smallGutterSize;
}
protected function setPanelHeaderStyles(header:Header):void
{
header.minWidth = this.gridSize;
header.minHeight = this.gridSize;
header.padding = this.smallGutterSize;
header.gap = this.smallGutterSize;
header.titleGap = this.smallGutterSize;
var backgroundSkin:Image = new Image(this.panelHeaderSkinTexture);
backgroundSkin.scale9Grid = HEADER_SCALE_9_GRID;
backgroundSkin.width = this.gridSize;
backgroundSkin.height = this.gridSize;
header.backgroundSkin = backgroundSkin;
}
//-------------------------
// PanelScreen
//-------------------------
protected function setPanelScreenStyles(screen:PanelScreen):void
{
this.setScrollerStyles(screen);
}
protected function setPanelScreenHeaderStyles(header:Header):void
{
this.setHeaderStyles(header);
header.useExtraPaddingForOSStatusBar = true;
}
//-------------------------
// PickerList
//-------------------------
protected function setPickerListStyles(list:PickerList):void
{
list.toggleButtonOnOpenAndClose = true;
list.buttonFactory = pickerListButtonFactory;
if(DeviceCapabilities.isTablet(Starling.current.nativeStage))
{
list.popUpContentManager = new CalloutPopUpContentManager();
}
else
{
list.listFactory = pickerListSpinnerListFactory;
list.popUpContentManager = new BottomDrawerPopUpContentManager();
}
}
protected function setPickerListPopUpListStyles(list:List):void
{
list.customItemRendererStyleName = DefaultListItemRenderer.ALTERNATE_STYLE_NAME_CHECK;
if(DeviceCapabilities.isTablet(Starling.current.nativeStage))
{
list.minWidth = this.popUpFillSize;
list.maxHeight = this.popUpFillSize;
}
else //phone
{
//the pop-up list should be a SpinnerList in this case, but we
//should provide a reasonable fallback skin if the listFactory
//on the PickerList returns a List instead. we don't want the
//List to be too big for the BottomDrawerPopUpContentManager
var layout:VerticalLayout = new VerticalLayout();
layout.horizontalAlign = HorizontalAlign.JUSTIFY;
layout.requestedRowCount = 4;
list.layout = layout;
}
}
protected function setPickerListButtonStyles(button:Button):void
{
var skin:ImageSkin = new ImageSkin(this.buttonUpSkinTexture);
skin.setTextureForState(ButtonState.DOWN, this.buttonDownSkinTexture);
skin.setTextureForState(ButtonState.DISABLED, this.buttonDisabledSkinTexture);
skin.scale9Grid = DEFAULT_SCALE_9_GRID;
skin.width = this.controlSize;
skin.height = this.controlSize;
button.defaultSkin = skin;
var icon:ImageSkin = new ImageSkin(this.pickerListButtonIconUpTexture);
icon.disabledTexture = this.pickerListButtonIconDisabledTexture;
if(button is ToggleButton)
{
//for convenience, this function can style both a regular button
//and a toggle button
icon.selectedTexture = this.pickerListButtonIconSelectedTexture;
}
button.defaultIcon = icon;
this.setBaseButtonStyles(button);
button.gap = Number.POSITIVE_INFINITY; //fill as completely as possible
button.minGap = this.gutterSize;
button.iconPosition = RelativePosition.RIGHT;
button.horizontalAlign = HorizontalAlign.LEFT;
}
//-------------------------
// ProgressBar
//-------------------------
protected function setProgressBarStyles(progress:ProgressBar):void
{
var backgroundSkin:Image = new Image(this.insetBackgroundSkinTexture);
backgroundSkin.scale9Grid = DEFAULT_SCALE_9_GRID;
if(progress.direction == Direction.VERTICAL)
{
backgroundSkin.width = this.smallControlSize;
backgroundSkin.height = this.wideControlSize;
}
else
{
backgroundSkin.width = this.wideControlSize;
backgroundSkin.height = this.smallControlSize;
}
progress.backgroundSkin = backgroundSkin;
var backgroundDisabledSkin:Image = new Image(this.insetBackgroundDisabledSkinTexture);
backgroundDisabledSkin.scale9Grid = DEFAULT_SCALE_9_GRID;
if(progress.direction == Direction.VERTICAL)
{
backgroundDisabledSkin.width = this.smallControlSize;
backgroundDisabledSkin.height = this.wideControlSize;
}
else
{
backgroundDisabledSkin.width = this.wideControlSize;
backgroundDisabledSkin.height = this.smallControlSize;
}
progress.backgroundDisabledSkin = backgroundDisabledSkin;
var fillSkin:Image = new Image(this.buttonUpSkinTexture);
fillSkin.scale9Grid = DEFAULT_SCALE_9_GRID;
if(progress.direction == Direction.VERTICAL)
{
fillSkin.width = this.smallGutterSize;
fillSkin.height = this.borderSize;
}
else
{
fillSkin.width = this.borderSize;
fillSkin.height = this.smallGutterSize;
}
progress.fillSkin = fillSkin;
var fillDisabledSkin:Image = new Image(this.buttonDisabledSkinTexture);
fillDisabledSkin.scale9Grid = DEFAULT_SCALE_9_GRID;
if(progress.direction == Direction.VERTICAL)
{
fillDisabledSkin.width = this.smallGutterSize;
fillDisabledSkin.height = this.borderSize;
}
else
{
fillDisabledSkin.width = this.borderSize;
fillDisabledSkin.height = this.smallGutterSize;
}
progress.fillDisabledSkin = fillDisabledSkin;
}
//-------------------------
// Radio
//-------------------------
protected function setRadioStyles(radio:Radio):void
{
var icon:ImageSkin = new ImageSkin(this.radioIconTexture);
icon.selectedTexture = this.radioSelectedIconTexture;
icon.setTextureForState(ButtonState.DISABLED, this.radioDisabledIconTexture);
icon.setTextureForState(ButtonState.DISABLED_AND_SELECTED, this.radioSelectedDisabledIconTexture);
radio.defaultIcon = icon;
radio.gap = this.smallGutterSize;
radio.minWidth = this.controlSize;
radio.minHeight = this.controlSize;
radio.minTouchWidth = this.gridSize;
radio.minTouchHeight = this.gridSize;
radio.horizontalAlign = HorizontalAlign.LEFT;
radio.verticalAlign = VerticalAlign.MIDDLE;
}
protected function setRadioLabelStyles(textRenderer:BitmapFontTextRenderer):void
{
textRenderer.textFormat = this.primaryTextFormat;
textRenderer.disabledTextFormat = this.disabledTextFormat;
}
//-------------------------
// ScrollContainer
//-------------------------
protected function setScrollContainerStyles(container:ScrollContainer):void
{
this.setScrollerStyles(container);
}
protected function setToolbarScrollContainerStyles(container:ScrollContainer):void
{
this.setScrollerStyles(container);
if(!container.layout)
{
var layout:HorizontalLayout = new HorizontalLayout();
layout.padding = this.smallGutterSize;
layout.gap = this.smallGutterSize;
container.layout = layout;
}
container.minWidth = this.gridSize;
container.minHeight = this.gridSize;
var backgroundSkin:Image = new Image(this.headerSkinTexture);
backgroundSkin.scale9Grid = HEADER_SCALE_9_GRID;
backgroundSkin.width = this.gridSize;
backgroundSkin.height = this.gridSize;
container.backgroundSkin = backgroundSkin;
}
//-------------------------
// ScrollScreen
//-------------------------
protected function setScrollScreenStyles(screen:ScrollScreen):void
{
this.setScrollerStyles(screen);
}
//-------------------------
// ScrollText
//-------------------------
protected function setScrollTextStyles(text:ScrollText):void
{
this.setScrollerStyles(text);
text.textFormat = this.scrollTextTextFormat;
text.disabledTextFormat = this.scrollTextDisabledTextFormat;
text.padding = this.gutterSize;
text.paddingRight = this.gutterSize + this.smallGutterSize;
}
//-------------------------
// SimpleScrollBar
//-------------------------
protected function setSimpleScrollBarThumbStyles(thumb:Button):void
{
var defaultSkin:Image = new Image(this.scrollBarThumbSkinTexture);
defaultSkin.scale9Grid = SCROLLBAR_THUMB_SCALE_9_GRID;
defaultSkin.width = this.simpleScrollBarThumbSize;
defaultSkin.height = this.simpleScrollBarThumbSize;
thumb.defaultSkin = defaultSkin;
thumb.minTouchWidth = this.smallControlSize;
thumb.minTouchHeight = this.smallControlSize;
thumb.hasLabelTextRenderer = false;
}
//-------------------------
// Slider
//-------------------------
protected function setSliderStyles(slider:Slider):void
{
slider.trackLayoutMode = TrackLayoutMode.SINGLE;
if(slider.direction == Direction.VERTICAL)
{
slider.customMinimumTrackStyleName = THEME_STYLE_NAME_VERTICAL_SLIDER_MINIMUM_TRACK;
}
else //horizontal
{
slider.customMinimumTrackStyleName = THEME_STYLE_NAME_HORIZONTAL_SLIDER_MINIMUM_TRACK;
}
}
protected function setHorizontalSliderMinimumTrackStyles(track:Button):void
{
var skin:ImageSkin = new ImageSkin(this.insetBackgroundSkinTexture);
skin.setTextureForState(ButtonState.DISABLED, this.insetBackgroundDisabledSkinTexture);
skin.scale9Grid = DEFAULT_SCALE_9_GRID;
skin.width = this.wideControlSize;
skin.height = this.smallControlSize;
track.defaultSkin = skin;
track.minTouchHeight = this.gridSize;
track.hasLabelTextRenderer = false;
}
protected function setVerticalSliderMinimumTrackStyles(track:Button):void
{
var skin:ImageSkin = new ImageSkin(this.insetBackgroundSkinTexture);
skin.setTextureForState(ButtonState.DISABLED, this.insetBackgroundDisabledSkinTexture);
skin.scale9Grid = DEFAULT_SCALE_9_GRID;
skin.width = this.smallControlSize;
skin.height = this.wideControlSize;
track.defaultSkin = skin;
track.minTouchWidth = this.gridSize;
track.hasLabelTextRenderer = false;
}
protected function setSliderThumbStyles(thumb:Button):void
{
var skin:ImageSkin = new ImageSkin(this.thumbSkinTexture);
skin.setTextureForState(ButtonState.DISABLED, this.thumbDisabledSkinTexture);
skin.scale9Grid = DEFAULT_SCALE_9_GRID;
skin.width = this.smallControlSize;
skin.height = this.smallControlSize;
thumb.defaultSkin = skin;
thumb.minTouchWidth = this.gridSize;
thumb.minTouchHeight = this.gridSize;
thumb.hasLabelTextRenderer = false;
}
//-------------------------
// SpinnerList
//-------------------------
protected function setSpinnerListStyles(list:SpinnerList):void
{
this.setListStyles(list);
list.customItemRendererStyleName = THEME_STYLE_NAME_SPINNER_LIST_ITEM_RENDERER;
var selectionOverlaySkin:Image = new Image(this.spinnerListSelectionOverlaySkinTexture);
selectionOverlaySkin.scale9Grid = SPINNER_LIST_SELECTION_OVERLAY_SCALE9_GRID;
list.selectionOverlaySkin = selectionOverlaySkin;
}
protected function setSpinnerListItemRendererStyles(renderer:BaseDefaultItemRenderer):void
{
renderer.customLabelStyleName = THEME_STYLE_NAME_SPINNER_LIST_ITEM_RENDERER_LABEL;
renderer.customIconLabelStyleName = THEME_STYLE_NAME_SPINNER_LIST_ITEM_RENDERER_LABEL;
renderer.customAccessoryLabelStyleName = THEME_STYLE_NAME_SPINNER_LIST_ITEM_RENDERER_LABEL;
renderer.paddingTop = this.smallGutterSize;
renderer.paddingBottom = this.smallGutterSize;
renderer.paddingLeft = this.gutterSize;
renderer.paddingRight = this.gutterSize;
renderer.gap = Number.POSITIVE_INFINITY;
renderer.minGap = this.gutterSize;
renderer.iconPosition = RelativePosition.RIGHT;
renderer.horizontalAlign = HorizontalAlign.LEFT;
renderer.accessoryGap = Number.POSITIVE_INFINITY;
renderer.minAccessoryGap = this.gutterSize;
renderer.accessoryPosition = RelativePosition.RIGHT;
renderer.minWidth = this.gridSize;
renderer.minHeight = this.gridSize;
renderer.minTouchWidth = this.gridSize;
renderer.minTouchHeight = this.gridSize;
renderer.isQuickHitAreaEnabled = true;
}
protected function setSpinnerListItemRendererLabelStyles(textRenderer:BitmapFontTextRenderer):void
{
//if it's not selected, we don't want it to be highlighted, so we're
//borrowing the less prominent disabled color
textRenderer.textFormat = this.disabledTextFormat;
textRenderer.selectedTextFormat = this.primaryTextFormat;
textRenderer.disabledTextFormat = this.disabledTextFormat;
}
//-------------------------
// TabBar
//-------------------------
protected function setTabBarStyles(tabBar:TabBar):void
{
tabBar.distributeTabSizes = true;
}
protected function setTabStyles(tab:ToggleButton):void
{
var defaultSkin:ImageSkin = new ImageSkin(this.headerSkinTexture);
defaultSkin.scale9Grid = HEADER_SCALE_9_GRID;
defaultSkin.width = this.gridSize;
defaultSkin.height = this.gridSize;
tab.defaultSkin = defaultSkin;
var otherSkin:ImageSkin = new ImageSkin(this.tabSelectedSkinTexture);
otherSkin.setTextureForState(ButtonState.DOWN, this.tabDownSkinTexture);
otherSkin.setTextureForState(ButtonState.DISABLED_AND_SELECTED, this.tabSelectedDisabledSkinTexture);
otherSkin.scale9Grid = TAB_SCALE_9_GRID;
otherSkin.width = this.gridSize;
otherSkin.height = this.gridSize;
tab.defaultSelectedSkin = otherSkin;
tab.setSkinForState(ButtonState.DOWN, otherSkin);
tab.iconPosition = RelativePosition.TOP;
tab.padding = this.gutterSize;
tab.gap = this.smallGutterSize;
tab.minGap = this.smallGutterSize;
tab.minWidth = this.gridSize;
tab.minHeight = this.gridSize;
tab.minTouchWidth = this.gridSize;
tab.minTouchHeight = this.gridSize;
}
//-------------------------
// TextArea
//-------------------------
protected function setTextAreaStyles(textArea:TextArea):void
{
this.setScrollerStyles(textArea);
var skin:ImageSkin = new ImageSkin(this.insetBackgroundSkinTexture);
skin.setTextureForState(TextInputState.DISABLED, this.insetBackgroundDisabledSkinTexture);
skin.setTextureForState(TextInputState.FOCUSED, this.insetBackgroundFocusedSkinTexture);
skin.setTextureForState(TextInputState.ERROR, this.insetBackgroundDangerSkinTexture);
skin.scale9Grid = DEFAULT_SCALE_9_GRID;
skin.width = this.wideControlSize;
skin.height = this.wideControlSize;
textArea.backgroundSkin = skin;
textArea.textEditorFactory = textAreaTextEditorFactory;
}
protected function setTextAreaTextEditorStyles(textEditor:TextFieldTextEditorViewPort):void
{
textEditor.textFormat = this.scrollTextTextFormat;
textEditor.disabledTextFormat = this.scrollTextDisabledTextFormat;
textEditor.padding = this.smallGutterSize;
}
protected function setTextAreaErrorCalloutStyles(callout:TextCallout):void
{
this.setDangerTextCalloutStyles(callout);
callout.horizontalAlign = HorizontalAlign.LEFT;
callout.verticalAlign = VerticalAlign.TOP;
}
//-------------------------
// TextCallout
//-------------------------
protected function setTextCalloutStyles(callout:TextCallout):void
{
this.setCalloutStyles(callout);
}
protected function setDangerTextCalloutStyles(callout:TextCallout):void
{
this.setDangerCalloutStyles(callout);
callout.customTextRendererStyleName = THEME_STYLE_NAME_DANGER_TEXT_RENDERER;
}
protected function setTextCalloutTextRendererStyles(textRenderer:BitmapFontTextRenderer):void
{
textRenderer.textFormat = this.primaryTextFormat;
}
protected function setDangerTextRendererStyles(textRenderer:BitmapFontTextRenderer):void
{
textRenderer.textFormat = this.dangerTextFormat;
}
//-------------------------
// TextInput
//-------------------------
protected function setBaseTextInputStyles(input:TextInput):void
{
var skin:ImageSkin = new ImageSkin(this.insetBackgroundSkinTexture);
skin.setTextureForState(TextInputState.DISABLED, this.insetBackgroundDisabledSkinTexture);
skin.setTextureForState(TextInputState.FOCUSED, this.insetBackgroundFocusedSkinTexture);
skin.setTextureForState(TextInputState.ERROR, this.insetBackgroundDangerSkinTexture);
skin.scale9Grid = DEFAULT_SCALE_9_GRID;
skin.width = this.wideControlSize;
skin.height = this.controlSize;
input.backgroundSkin = skin;
input.minWidth = this.controlSize;
input.minHeight = this.controlSize;
input.minTouchWidth = this.gridSize;
input.minTouchHeight = this.gridSize;
input.gap = this.smallGutterSize;
input.padding = this.smallGutterSize;
}
protected function setTextInputStyles(input:TextInput):void
{
this.setBaseTextInputStyles(input);
}
protected function setSearchTextInputStyles(input:TextInput):void
{
this.setBaseTextInputStyles(input);
var icon:ImageSkin = new ImageSkin(this.searchIconTexture);
icon.disabledTexture = this.searchIconDisabledTexture;
input.defaultIcon = icon;
}
protected function setTextInputTextEditorStyles(textEditor:StageTextTextEditor):void
{
textEditor.fontFamily = "_sans";
textEditor.fontSize = this.fontSize;
textEditor.color = PRIMARY_TEXT_COLOR;
textEditor.disabledColor = DISABLED_TEXT_COLOR;
}
protected function setTextInputPromptStyles(textRenderer:BitmapFontTextRenderer):void
{
textRenderer.textFormat = this.primaryTextFormat;
textRenderer.disabledTextFormat = this.disabledTextFormat;
}
protected function setTextInputErrorCalloutStyles(callout:TextCallout):void
{
this.setDangerTextCalloutStyles(callout);
callout.horizontalAlign = HorizontalAlign.LEFT;
callout.verticalAlign = VerticalAlign.TOP;
}
//-------------------------
// ToggleSwitch
//-------------------------
protected function setToggleSwitchStyles(toggleSwitch:ToggleSwitch):void
{
toggleSwitch.trackLayoutMode = TrackLayoutMode.SINGLE;
}
protected function setToggleSwitchOnLabelStyles(textRenderer:BitmapFontTextRenderer):void
{
textRenderer.textFormat = this.primaryTextFormat;
textRenderer.disabledTextFormat = this.disabledTextFormat;
}
protected function setToggleSwitchOffLabelStyles(textRenderer:BitmapFontTextRenderer):void
{
textRenderer.textFormat = this.primaryTextFormat;
textRenderer.disabledTextFormat = this.disabledTextFormat;
}
protected function setToggleSwitchOnTrackStyles(track:Button):void
{
var skin:ImageSkin = new ImageSkin(this.insetBackgroundSkinTexture);
skin.setTextureForState(ButtonState.DISABLED, this.insetBackgroundDisabledSkinTexture);
skin.scale9Grid = DEFAULT_SCALE_9_GRID;
skin.width = Math.round(this.controlSize * 2.5);
skin.height = this.controlSize;
track.defaultSkin = skin;
track.minTouchWidth = this.gridSize;
track.minTouchHeight = this.gridSize;
track.hasLabelTextRenderer = false;
}
protected function setToggleSwitchThumbStyles(thumb:Button):void
{
var skin:ImageSkin = new ImageSkin(this.thumbSkinTexture);
skin.disabledTexture = this.thumbDisabledSkinTexture;
skin.scale9Grid = DEFAULT_SCALE_9_GRID;
skin.width = this.controlSize;
skin.height = this.controlSize;
thumb.defaultSkin = skin;
thumb.minTouchWidth = this.gridSize;
thumb.minTouchHeight = this.gridSize;
thumb.hasLabelTextRenderer = false;
}
//-------------------------
// VideoPlayer
//-------------------------
protected function setVideoPlayerStyles(player:VideoPlayer):void
{
player.backgroundSkin = new Quad(1, 1, 0x000000);
}
//-------------------------
// PlayPauseToggleButton
//-------------------------
protected function setPlayPauseToggleButtonStyles(button:PlayPauseToggleButton):void
{
var defaultSkin:Quad = new Quad(this.controlSize, this.controlSize, 0xff00ff);
defaultSkin.alpha = 0;
button.defaultSkin = defaultSkin;
var otherSkin:ImageSkin = new ImageSkin(null);
otherSkin.setTextureForState(ButtonState.DOWN, this.buttonDownSkinTexture);
otherSkin.setTextureForState(ButtonState.DOWN_AND_SELECTED, this.buttonDownSkinTexture);
otherSkin.width = this.controlSize;
otherSkin.height = this.controlSize;
button.setSkinForState(ButtonState.DOWN, otherSkin);
button.setSkinForState(ButtonState.DOWN_AND_SELECTED, otherSkin);
var icon:ImageSkin = new ImageSkin(this.playPauseButtonPlayUpIconTexture);
icon.selectedTexture = this.playPauseButtonPauseUpIconTexture;
icon.textureSmoothing = TextureSmoothing.NONE;
button.defaultIcon = icon;
button.hasLabelTextRenderer = false;
button.padding = this.smallGutterSize;
button.gap = this.smallGutterSize;
button.minGap = this.smallGutterSize;
button.minWidth = this.controlSize;
button.minHeight = this.controlSize;
}
protected function setOverlayPlayPauseToggleButtonStyles(button:PlayPauseToggleButton):void
{
var icon:ImageSkin = new ImageSkin(null);
icon.setTextureForState(ButtonState.UP, this.overlayPlayPauseButtonPlayUpIconTexture);
icon.setTextureForState(ButtonState.HOVER, this.overlayPlayPauseButtonPlayUpIconTexture);
button.defaultIcon = icon;
button.hasLabelTextRenderer = false;
var overlaySkin:Quad = new Quad(1, 1, VIDEO_OVERLAY_COLOR);
overlaySkin.alpha = VIDEO_OVERLAY_ALPHA;
button.upSkin = overlaySkin;
button.hoverSkin = overlaySkin;
//since the selected states don't have a skin, the minWidth and
//minHeight values will ensure that the button doesn't resize!
button.minWidth = this.overlayPlayPauseButtonPlayUpIconTexture.width;
button.minHeight = this.overlayPlayPauseButtonPlayUpIconTexture.height;
}
//-------------------------
// FullScreenToggleButton
//-------------------------
protected function setFullScreenToggleButtonStyles(button:FullScreenToggleButton):void
{
var defaultSkin:Quad = new Quad(this.controlSize, this.controlSize, 0xff00ff);
defaultSkin.alpha = 0;
button.defaultSkin = defaultSkin;
var otherSkin:ImageSkin = new ImageSkin(null);
otherSkin.setTextureForState(ButtonState.DOWN, this.buttonDownSkinTexture);
otherSkin.setTextureForState(ButtonState.DOWN_AND_SELECTED, this.buttonDownSkinTexture);
otherSkin.width = this.controlSize;
otherSkin.height = this.controlSize;
button.setSkinForState(ButtonState.DOWN, otherSkin);
button.setSkinForState(ButtonState.DOWN_AND_SELECTED, otherSkin);
var icon:ImageSkin = new ImageSkin(this.fullScreenToggleButtonEnterUpIconTexture);
icon.selectedTexture = this.fullScreenToggleButtonExitUpIconTexture;
icon.textureSmoothing = TextureSmoothing.NONE;
button.defaultIcon = icon;
button.hasLabelTextRenderer = false;
button.padding = this.smallGutterSize;
button.gap = this.smallGutterSize;
button.minGap = this.smallGutterSize;
button.minWidth = this.controlSize;
button.minHeight = this.controlSize;
}
//-------------------------
// MuteToggleButton
//-------------------------
protected function setMuteToggleButtonStyles(button:MuteToggleButton):void
{
var defaultSkin:Quad = new Quad(this.controlSize, this.controlSize, 0xff00ff);
defaultSkin.alpha = 0;
button.defaultSkin = defaultSkin;
var otherSkin:ImageSkin = new ImageSkin(null);
otherSkin.setTextureForState(ButtonState.DOWN, this.buttonDownSkinTexture);
otherSkin.setTextureForState(ButtonState.DOWN_AND_SELECTED, this.buttonDownSkinTexture);
otherSkin.width = this.controlSize;
otherSkin.height = this.controlSize;
button.setSkinForState(ButtonState.DOWN, otherSkin);
button.setSkinForState(ButtonState.DOWN_AND_SELECTED, otherSkin);
var icon:ImageSkin = new ImageSkin(this.muteToggleButtonLoudUpIconTexture);
icon.selectedTexture = this.muteToggleButtonMutedUpIconTexture;
icon.textureSmoothing = TextureSmoothing.NONE;
button.defaultIcon = icon;
button.hasLabelTextRenderer = false;
button.showVolumeSliderOnHover = false;
button.padding = this.smallGutterSize;
button.gap = this.smallGutterSize;
button.minGap = this.smallGutterSize;
button.minWidth = this.controlSize;
button.minHeight = this.controlSize;
}
//-------------------------
// SeekSlider
//-------------------------
protected function setSeekSliderStyles(slider:SeekSlider):void
{
slider.direction = Direction.HORIZONTAL;
slider.trackLayoutMode = TrackLayoutMode.SINGLE;
slider.minWidth = this.controlSize;
slider.minHeight = this.smallControlSize;
var progressSkin:Image = new Image(this.seekSliderProgressSkinTexture);
progressSkin.scale9Grid = SEEK_SLIDER_PROGRESS_SKIN_SCALE9_GRID;
slider.progressSkin = progressSkin;
}
//-------------------------
// VolumeSlider
//-------------------------
protected function setVolumeSliderStyles(slider:VolumeSlider):void
{
slider.direction = Direction.HORIZONTAL;
slider.trackLayoutMode = TrackLayoutMode.SPLIT;
slider.showThumb = false;
slider.minWidth = this.volumeSliderMinimumTrackSkinTexture.width;
slider.minHeight = this.volumeSliderMinimumTrackSkinTexture.height;
}
protected function setVolumeSliderThumbStyles(thumb:Button):void
{
var thumbSize:Number = 6;
thumb.defaultSkin = new Quad(thumbSize, thumbSize);
thumb.defaultSkin.width = 0;
thumb.defaultSkin.height = 0;
thumb.hasLabelTextRenderer = false;
}
protected function setVolumeSliderMinimumTrackStyles(track:Button):void
{
var defaultSkin:ImageLoader = new ImageLoader();
defaultSkin.scaleContent = false;
defaultSkin.source = this.volumeSliderMinimumTrackSkinTexture;
track.defaultSkin = defaultSkin;
track.hasLabelTextRenderer = false;
track.minTouchHeight = this.gridSize;
}
protected function setVolumeSliderMaximumTrackStyles(track:Button):void
{
var defaultSkin:ImageLoader = new ImageLoader();
defaultSkin.scaleContent = false;
defaultSkin.horizontalAlign = HorizontalAlign.RIGHT;
defaultSkin.source = this.volumeSliderMaximumTrackSkinTexture;
track.defaultSkin = defaultSkin;
track.hasLabelTextRenderer = false;
track.minTouchHeight = this.gridSize;
}
}
}
|
////////////////////////////////////////////////////////////////////////////////
//
// Licensed to the Apache Software Foundation (ASF) under one or more
// contributor license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright ownership.
// The ASF licenses this file to You under the Apache License, Version 2.0
// (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////
package flashx.textLayout.edit {
import flash.geom.Point;
import flash.geom.Rectangle;
import flash.system.IME;
import flash.text.engine.TextLine;
import flash.text.ime.CompositionAttributeRange;
import flash.text.ime.IIMEClient;
import flashx.textLayout.compose.IFlowComposer;
import flashx.textLayout.compose.TextFlowLine;
import flashx.textLayout.container.ContainerController;
import flashx.textLayout.debug.assert;
import flashx.textLayout.elements.FlowLeafElement;
import flashx.textLayout.elements.TextFlow;
import flashx.textLayout.elements.TextRange;
import flashx.textLayout.formats.BlockProgression;
import flashx.textLayout.formats.IMEStatus;
import flashx.textLayout.formats.ITextLayoutFormat;
import flashx.textLayout.formats.TextLayoutFormat;
import flashx.textLayout.operations.ApplyFormatToElementOperation;
import flashx.textLayout.operations.DeleteTextOperation;
import flashx.textLayout.operations.FlowOperation;
import flashx.textLayout.operations.InsertTextOperation;
import flashx.textLayout.tlf_internal;
import flashx.textLayout.utils.GeometryUtil;
import flashx.undo.IOperation;
import flashx.undo.UndoManager;
use namespace tlf_internal;
internal class IMEClient implements IIMEClient
{
private var _editManager:EditManager;
private var _undoManager:UndoManager;
/** Maintain position of text we've inserted while in the middle of processing IME. */
private var _imeAnchorPosition:int; // start of IME text
private var _imeLength:int; // length of IME text
private var _controller:ContainerController; // controller that had focus at the start of the IME session -- we want this one to keep focus
private var _closing:Boolean;
CONFIG::debug {
private var _imeOperation:IOperation; // IME in-progress edits - used for debugging to confirm that operation we're undoing is the one we did via IME
}
public function IMEClient(editManager:EditManager)
{
_editManager = editManager;
_imeAnchorPosition = _editManager.absoluteStart;
if (_editManager.textFlow)
{
var flowComposer:IFlowComposer = _editManager.textFlow.flowComposer;
if (flowComposer)
{
var controllerIndex:int = flowComposer.findControllerIndexAtPosition(_imeAnchorPosition);
_controller = flowComposer.getControllerAt(controllerIndex);
if (_controller)
_controller.setFocus();
}
}
_closing = false;
if (_editManager.undoManager == null)
{
_undoManager = new UndoManager();
_editManager.setUndoManager(_undoManager);
}
}
/** @private
* Handler function called when the selection has been changed.
* @playerversion Flash 10
* @playerversion AIR 1.5
* @langversion 3.0
*/
public function selectionChanged():void
{
// trace("IMEClient.selectionChanged", _editManager.anchorPosition, _editManager.activePosition);
// If we change the selection to something outside the session, abort the
// session. If we just moved the selection within the session, we tell the IME about the changes.
if (_editManager.absoluteStart > _imeAnchorPosition + _imeLength || _editManager.absoluteEnd < _imeAnchorPosition)
{
//trace("selection changed to out of IME session");
compositionAbandoned();
}
else
{
// This code doesn't with current version of Argo, but should work in future
//trace("selection changed within IME session");
// var imeCompositionSelectionChanged:Function = IME["compositionSelectionChanged"];
// if (IME["compositionSelectionChanged"] !== undefined)
// imeCompositionSelectionChanged(_editManager.absoluteStart - _imeAnchorPosition, _editManager.absoluteEnd - (_imeAnchorPosition + _imeLength));
}
}
private function doIMEClauseOperation(selState:SelectionState, clause:int):void
{
var leaf:FlowLeafElement = _editManager.textFlow.findLeaf(selState.absoluteStart);;
var leafAbsoluteStart:int = leaf.getAbsoluteStart();
var format:TextLayoutFormat = new TextLayoutFormat();
format.setStyle(IMEStatus.IME_CLAUSE, clause.toString());
_editManager.doOperation(new ApplyFormatToElementOperation(selState, leaf, format, selState.absoluteStart - leafAbsoluteStart, selState.absoluteEnd - leafAbsoluteStart));
}
private function doIMEStatusOperation(selState:SelectionState, attrRange:CompositionAttributeRange):void
{
var imeStatus:String;
// Get the IME status from the converted & selected flags
if (attrRange == null)
imeStatus = IMEStatus.DEAD_KEY_INPUT_STATE;
else if (!attrRange.converted)
{
if(!attrRange.selected)
imeStatus = IMEStatus.NOT_SELECTED_RAW;
else
imeStatus = IMEStatus.SELECTED_RAW;
}
else
{
if (!attrRange.selected)
imeStatus = IMEStatus.NOT_SELECTED_CONVERTED;
else
imeStatus = IMEStatus.SELECTED_CONVERTED;
}
// refind since the previous operation changed the spans
var leaf:FlowLeafElement = _editManager.textFlow.findLeaf(selState.absoluteStart);
CONFIG::debug { assert( leaf != null, "found null FlowLeafELement at" + (selState.absoluteStart).toString()); }
var leafAbsoluteStart:int = leaf.getAbsoluteStart();
var format:TextLayoutFormat = new TextLayoutFormat();
format.setStyle(IMEStatus.IME_STATUS, imeStatus);
_editManager.doOperation(new ApplyFormatToElementOperation(selState, leaf, format, selState.absoluteStart - leafAbsoluteStart, selState.absoluteEnd - leafAbsoluteStart));
}
private function deleteIMEText(textFlow:TextFlow):void
{
// Delete any leaves that have IME attributes applied
var leaf:FlowLeafElement = textFlow.getFirstLeaf();
while (leaf)
{
if (leaf.getStyle(IMEStatus.IME_STATUS) !== undefined || leaf.getStyle(IMEStatus.IME_CLAUSE) !== undefined)
{
var leafFormat:TextLayoutFormat = new TextLayoutFormat(leaf.format);
leafFormat.setStyle(IMEStatus.IME_STATUS, undefined);
leafFormat.setStyle(IMEStatus.IME_CLAUSE, undefined);
leaf.format = leafFormat;
var absoluteStart:int = leaf.getAbsoluteStart();
ModelEdit.deleteText(textFlow, absoluteStart, absoluteStart + leaf.textLength, false);
leaf = textFlow.findLeaf(absoluteStart);
}
else
leaf = leaf.getNextLeaf();
}
}
private function rollBackIMEChanges():void
{
// Undo the previous interim ime operation, if there is one. This deletes any text that came in a previous updateComposition call.
// Doing it via undo keeps the undo stack in sync. But if there's been an intervening direct model change, just delete the IME text
// directly. It won't restore what we selected at the beginning of the IME session, but it's the best we can do.
var previousIMEOperation:FlowOperation = _editManager.undoManager.peekUndo() as FlowOperation;
if (_imeLength > 0 && previousIMEOperation && previousIMEOperation.endGeneration == _editManager.textFlow.generation && previousIMEOperation.canUndo())
{
CONFIG::debug { assert(_editManager.undoManager.peekUndo() == _imeOperation, "Unexpected operation in undo stack at end of IME update"); }
if (_editManager.undoManager)
_editManager.undoManager.undo();
CONFIG::debug { assert(_editManager.undoManager.peekRedo() == _imeOperation, "Unexpected operation in redo stack at end of IME session"); }
_editManager.undoManager.popRedo();
}
else // there's been a model change since the last IME change that blocks undo, just find IME text and delete it.
{
_editManager.undoManager.popUndo(); // remove the operation we can't undo
deleteIMEText(_editManager.textFlow);
}
_imeLength = 0; // prevent double deletion
CONFIG::debug { _imeOperation = null; }
}
// IME-related functions
public function updateComposition(text:String, attributes:Vector.<CompositionAttributeRange>, compositionStartIndex:int, compositionEndIndex:int):void
{
// CONFIG::debug { Debugging.traceOut("updateComposition ", compositionStartIndex, compositionEndIndex, text.length); }
// CONFIG::debug { Debugging.traceOut("updateComposition selection ", _editManager.absoluteStart, _editManager.absoluteEnd); }
// Undo the previous interim ime operation, if there is one. This deletes any text that came in a previous updateComposition call.
// Doing it via undo keeps the undo stack in sync.
if (_imeLength > 0)
rollBackIMEChanges();
if (text.length > 0)
{
// Insert the supplied string, using the current editing format.
var pointFormat:ITextLayoutFormat = _editManager.getSelectionState().pointFormat;
var selState:SelectionState = new SelectionState(_editManager.textFlow, _imeAnchorPosition, _imeAnchorPosition + _imeLength, pointFormat);
_editManager.beginIMEOperation();
if (_editManager.absoluteStart != _editManager.absoluteEnd)
_editManager.deleteText(); // delete current selection
var insertOp:InsertTextOperation = new InsertTextOperation(selState, text);
_imeLength = text.length;
_editManager.doOperation(insertOp);
if (attributes && attributes.length > 0)
{
var attrLen:int = attributes.length;
for (var i:int = 0; i < attrLen; i++)
{
var attrRange:CompositionAttributeRange = attributes[i];
var clauseSelState:SelectionState = new SelectionState(_editManager.textFlow, _imeAnchorPosition + attrRange.relativeStart, _imeAnchorPosition + attrRange.relativeEnd);
doIMEClauseOperation(clauseSelState, i);
doIMEStatusOperation(clauseSelState, attrRange);
}
}
else // composing accented characters
{
clauseSelState = new SelectionState(_editManager.textFlow, _imeAnchorPosition, _imeAnchorPosition + _imeLength, pointFormat);
doIMEClauseOperation(clauseSelState, 0);
doIMEStatusOperation(clauseSelState, null);
}
var newSelectionStart:int = _imeAnchorPosition + compositionStartIndex;
var newSelectionEnd:int = _imeAnchorPosition + compositionEndIndex;
if (_editManager.absoluteStart != newSelectionStart || _editManager.absoluteEnd != newSelectionEnd)
{
_editManager.selectRange(_imeAnchorPosition + compositionStartIndex, _imeAnchorPosition + compositionEndIndex);
}
CONFIG::debug { _imeOperation = null; }
_editManager.endIMEOperation();
CONFIG::debug { _imeOperation = _editManager.undoManager.peekUndo(); }
}
}
public function confirmComposition(text:String = null, preserveSelection:Boolean = false):void
{
// trace("confirmComposition", text, preserveSelection);
endIMESession();
}
public function compositionAbandoned():void
{
// trace("compositionAbandoned");
// In Argo we could just do this:
// IME.compositionAbandoned();
// but for support in Astro/Squirt where this API is undefined we do this:
var imeCompositionAbandoned:Function = IME["compositionAbandoned"];
if (IME["compositionAbandoned"] !== undefined)
imeCompositionAbandoned();
}
private function endIMESession():void
{
if (!_editManager || _closing)
return;
// trace("end IME session");
_closing = true;
// Undo the IME operation. We're going to re-add the text, without all the special attributes, as part of handling
// the textInput event that comes next.
if (_imeLength > 0)
rollBackIMEChanges();
if (_undoManager)
_editManager.setUndoManager(null);
// Clear IME state - tell EditManager to release IMEClient to finally close session
_editManager.endIMESession();
_editManager = null;
}
CONFIG::debug
{ // debugging code for displaying IME bounds rectangle
import flash.display.Sprite;
import flash.display.Graphics;
private function displayRectInContainer(container:Sprite, r:Rectangle):void
{
var g:Graphics = container.graphics;
g.beginFill(0xff0000);
g.moveTo(r.x, r.y);
g.lineTo(r.right, r.y);
g.lineTo(r.right, r.bottom);
g.lineTo(r.x, r.bottom);
g.lineTo(r.x, r.y);
g.endFill();
}
}
public function getTextBounds(startIndex:int, endIndex:int):Rectangle
{
if(startIndex >= 0 && startIndex < _editManager.textFlow.textLength && endIndex >= 0 && endIndex < _editManager.textFlow.textLength)
{
if (startIndex != endIndex)
{
var boundsResult:Array = GeometryUtil.getHighlightBounds(new TextRange(_editManager.textFlow, startIndex, endIndex));
//bail out if we don't have any results to show
if (boundsResult.length > 0)
{
var bounds:Rectangle = boundsResult[0].rect;
var textLine:TextLine = boundsResult[0].textLine;
var resultTopLeft:Point = textLine.localToGlobal(bounds.topLeft);
var resultBottomRight:Point = textLine.localToGlobal(bounds.bottomRight);
if (textLine.parent)
{
var containerTopLeft:Point = textLine.parent.globalToLocal(resultTopLeft);
var containerBottomLeft:Point = textLine.parent.globalToLocal(resultBottomRight);
// CONFIG::debug { displayRectInContainer(Sprite(textLine.parent), new Rectangle(containerTopLeft.x, containerTopLeft.y, containerBottomLeft.x - containerTopLeft.x, containerBottomLeft.y - containerTopLeft.y));}
return new Rectangle(containerTopLeft.x, containerTopLeft.y, containerBottomLeft.x - containerTopLeft.x, containerBottomLeft.y - containerTopLeft.y);
}
}
}
else
{
var flowComposer:IFlowComposer = _editManager.textFlow.flowComposer;
var lineIndex:int = flowComposer.findLineIndexAtPosition(startIndex);
// Stick to the end of the last line
if (lineIndex == flowComposer.numLines)
lineIndex--;
if (flowComposer.getLineAt(lineIndex).controller == _controller)
{
var line:TextFlowLine = flowComposer.getLineAt(lineIndex);
var previousLine:TextFlowLine = lineIndex != 0 ? flowComposer.getLineAt(lineIndex-1) : null;
var nextLine:TextFlowLine = lineIndex != flowComposer.numLines-1 ? flowComposer.getLineAt(lineIndex+1) : null;
// CONFIG::debug { displayRectInContainer(_controller.container, line.computePointSelectionRectangle(startIndex, _controller.container, previousLine, nextLine, true));}
return line.computePointSelectionRectangle(startIndex, _controller.container, previousLine, nextLine, true);
}
}
}
return new Rectangle(0,0,0,0);
}
public function get compositionStartIndex():int
{
// trace("compositionStartIndex");
return _imeAnchorPosition;
}
public function get compositionEndIndex():int
{
// trace("compositionEndIndex");
return _imeAnchorPosition + _imeLength;
}
public function get verticalTextLayout():Boolean
{
// trace("verticalTextLayout ", _editManager.textFlow.computedFormat.blockProgression == BlockProgression.RL ? "true" : "false");
return _editManager.textFlow.computedFormat.blockProgression == BlockProgression.RL;
}
public function get selectionActiveIndex():int
{
//trace("selectionActiveIndex");
return _editManager.activePosition;
}
public function get selectionAnchorIndex():int
{
//trace("selectionAnchorIndex");
return _editManager.anchorPosition;
}
public function selectRange(anchorIndex:int, activeIndex:int):void
{
_editManager.selectRange(anchorIndex, activeIndex);
}
public function setFocus():void
{
if (_controller && _controller.container && _controller.container.stage && _controller.container.stage.focus != _controller.container)
_controller.setFocus();
}
/**
* Gets the specified range of text from a component implementing ITextSupport.
* To retrieve all text in the component, do not specify values for <code>startIndex</code> and <code>endIndex</code>.
* Components which wish to support inline IME or web searchability should call into this method.
* Components overriding this method should ensure that the default values of <code>-1</code>
* for <code>startIndex</code> and <code>endIndex</code> are supported.
*
* @playerversion Flash 10.0
* @langversion 3.0
*/
public function getTextInRange(startIndex:int, endIndex:int):String
{
//trace("getTextInRange");
// Check for valid indices
var textFlow:TextFlow = _editManager.textFlow;
if (startIndex < -1 || endIndex < -1 || startIndex > (textFlow.textLength - 1) || endIndex > (textFlow.textLength - 1))
return null;
// Make sure they're in the right order
if (endIndex < startIndex)
{
var tempIndex:int = endIndex;
endIndex = startIndex;
startIndex = tempIndex;
}
if (startIndex == -1)
startIndex = 0;
return textFlow.getText(startIndex, endIndex);
}
}
} |
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
import EmptyFunctionBody.*;
import com.adobe.test.Assert;
class EmptyFunctionBodyClass {
function EmptyFunctionBodyClass() {}
function noReturnNoParams() { return "noReturnNoParams"; }
function noReturnParams(s:String, b:Boolean) { return s; }
function noReturnCustomParam(c:Custom) { return new Custom(); }
function returnNoParams():String { return "returnNoParams"; }
function returnParams(s:String, b:Boolean):String { return s; }
function returnCustomNoParams():Custom { return new Custom(); }
}
function noReturnNoParamsNoPackage() { return "noReturnNoParams"; }
function noReturnParamsNoPackage(s:String, b:Boolean) { return s; }
function noReturnCustomParamNoPackage(c:Custom) { return new Custom(); }
function returnNoParamsNoPackage():String { return "returnNoParams"; }
function returnParamsNoPackage(s:String, b:Boolean):String { return s; }
function returnCustomNoParamsNoPackage():Custom { return new Custom(); }
// var SECTION = "Definitions"; // provide a document reference (ie, ECMA section)
// var VERSION = "AS3"; // Version of JavaScript or ECMA
// var TITLE = "Function Body Parameter/Result Type"; // Provide ECMA section title or a description
var BUGNUMBER = "";
var TESTOBJ;
var s:String = new String("this is a test");
var b:Boolean = new Boolean(true);
var c:Custom = new Custom();
// inside class inside package
TESTOBJ = new TestObj();
Assert.expectEq( "TESTOBJ.noReturnNoParams()", "noReturnNoParams", TESTOBJ.noReturnNoParams() );
Assert.expectEq( "TESTOBJ.noReturnParams(s,b)", "this is a test", TESTOBJ.noReturnParams(s,b) );
//Function returns a new Custom object therefore must be compared using strings.
Assert.expectEq( "TESTOBJ.noReturnCustomParams(c)", "[object Custom]", String(TESTOBJ.noReturnCustomParam(c)) );
Assert.expectEq( "TESTOBJ.returnNoParams()", "returnNoParams", TESTOBJ.returnNoParams() );
Assert.expectEq( "TESTOBJ.returnParams(s,b)", "this is a test", TESTOBJ.returnParams(s,b) );
Assert.expectEq( "TESTOBJ.returnCustomNoParams()", "[object Custom]", String(TESTOBJ.returnCustomNoParams()) );
// inside package outside of class
Assert.expectEq( "noReturnNoParams()", "noReturnNoParams", noReturnNoParams() );
Assert.expectEq( "noReturnParams(s,b)", "this is a test", noReturnParams(s,b) );
Assert.expectEq( "noReturnCustomParams()", "[object Custom]", String(noReturnCustomParam(c)) );
Assert.expectEq( "returnNoParams()", "returnNoParams", returnNoParams() );
Assert.expectEq( "returnParams(s,b)", "this is a test", returnParams(s,b) );
Assert.expectEq( "returnCustomNoParams()", "[object Custom]", String(returnCustomNoParams()) );
// outside package inside class
TESTOBJ = new EmptyFunctionBodyClass();
Assert.expectEq( "TESTOBJ.noReturnNoParams()", "noReturnNoParams", TESTOBJ.noReturnNoParams() );
Assert.expectEq( "TESTOBJ.noReturnParams(s,b)", "this is a test", TESTOBJ.noReturnParams(s,b) );
Assert.expectEq( "TESTOBJ.noReturnCustomParams()", "[object Custom]", String(TESTOBJ.noReturnCustomParam(c)) );
Assert.expectEq( "TESTOBJ.returnNoParams()", "returnNoParams", TESTOBJ.returnNoParams() );
Assert.expectEq( "TESTOBJ.returnParams(s,b)", "this is a test", TESTOBJ.returnParams(s,b) );
Assert.expectEq( "TESTOBJ.returnCustomNoParams()", "[object Custom]", String(TESTOBJ.returnCustomNoParams()) );
// outside package and outside class
Assert.expectEq( "noReturnNoParamsNoPackage()", "noReturnNoParams", noReturnNoParamsNoPackage() );
Assert.expectEq( "noReturnParamsNoPackage(s,b)", "this is a test", noReturnParamsNoPackage(s,b) );
Assert.expectEq( "noReturnCustomParamsNoPackage()", "[object Custom]", String(noReturnCustomParamNoPackage(c)) );
Assert.expectEq( "returnNoParamsNoPackage()", "returnNoParams", returnNoParamsNoPackage() );
Assert.expectEq( "returnParamsNoPackage(s,b)", "this is a test", returnParamsNoPackage(s,b) );
Assert.expectEq( "returnCustomNoParamsNoPackage()", "[object Custom]", String(returnCustomNoParamsNoPackage()) );
// displays results.
|
/*
* Copyright 2019 Tallence AG
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.tallence.core.redirects.studio.data {
public class PermissionResponse {
private var mayWrite:Boolean;
private var mayPublish:Boolean;
private var mayUseRegex:Boolean;
public function PermissionResponse(jsonResponse:Object = null) {
this.mayWrite = jsonResponse ? jsonResponse.mayWrite : false;
this.mayPublish = jsonResponse ? jsonResponse.mayPublish : false;
this.mayUseRegex = jsonResponse ? jsonResponse.mayUseRegex : false;
}
public function isMayWrite():Boolean {
return mayWrite;
}
public function isMayPublish():Boolean {
return mayPublish;
}
public function isMayUseRegex():Boolean {
return mayUseRegex;
}
}
}
|
package core.logger {
import core.base.CoreBaseClass;
import core.logger.base.CoreBaseLogger;
import core.logger.interfaces.ICoreLogger;
public class CoreLogger extends CoreBaseClass {
public static const LOGGER_LOG:String = "logger.log";
public static const MESSAGE:String = "message";
private static var _loggers:Vector.<ICoreLogger>;
private static var instance:CoreLogger;
public static function getInstance(loggers:Vector.<ICoreLogger>=null):CoreLogger {
if (instance == null)
instance = new CoreLogger(loggers);
return instance;
}
public static function addLogger(logger:ICoreLogger):void {
CoreLogger.getInstance();
if (_loggers == null)
_loggers = new Vector.<ICoreLogger>();
_loggers.push(logger);
}
public function CoreLogger(loggers:Vector.<ICoreLogger>):void {
_loggers = loggers;
this.sc.registerService(LOGGER_LOG, this.serviceLog);
}
private function serviceLog(params:Array):void {
for each(var logger:ICoreLogger in _loggers)
logger.addLog(params[MESSAGE]);
}
}
}
|
package format.swf.data.actions.swf4
{
import format.swf.data.actions.*;
class ActionTrace extends Action implements IAction
{
public static inline var CODE:Int = 0x26;
public function ActionTrace(code:Int, length:Int, pos:Int) {
super(code, length, pos);
}
override public function toString(indent:Int = 0):String {
return "[ActionTrace]";
}
}
}
|
package away3d.materials.methods
{
import away3d.arcane;
import away3d.core.managers.Stage3DProxy;
import away3d.lights.DirectionalLight;
import away3d.materials.methods.MethodVO;
import away3d.materials.utils.ShaderRegisterCache;
import away3d.materials.utils.ShaderRegisterElement;
import away3d.textures.BitmapTexture;
import flash.display.BitmapData;
use namespace arcane;
public class DitheredShadowMapMethod extends ShadowMapMethodBase
{
private static var _grainTexture : BitmapTexture;
private static var _grainUsages : int;
private static var _grainBitmapData : BitmapData;
private var _highRes : Boolean;
private var _depthMapSize : int;
private var _range : Number = 1;
/**
* Creates a new DitheredShadowMapMethod object.
*/
public function DitheredShadowMapMethod(castingLight : DirectionalLight, highRes : Boolean = false)
{
// todo: implement for point lights
super(castingLight);
// area to sample in texture space
_depthMapSize = castingLight.shadowMapper.depthMapSize;
_highRes = highRes;
++_grainUsages;
if (!_grainTexture) {
initGrainTexture();
}
}
override arcane function initConstants(vo : MethodVO) : void
{
super.initConstants(vo);
var fragmentData : Vector.<Number> = vo.fragmentData;
var index : int = vo.fragmentConstantsIndex;
fragmentData[index + 8] = _highRes? 1/8 : 1/4;
fragmentData[index + 9] = _range/_depthMapSize;
fragmentData[index + 10] = .5;
}
public function get range() : Number
{
return _range;
}
public function set range(value : Number) : void
{
_range = value;
}
private function initGrainTexture() : void
{
_grainBitmapData = new BitmapData(64, 64, false);
var vec : Vector.<uint> = new Vector.<uint>();
var len : uint = 4096;
var step : Number = 1/(_depthMapSize*_range);
var inv : Number = 1-step;
var r : Number, g : Number;
for (var i : uint = 0; i < len; ++i) {
r = 2*(Math.random() - .5)*inv;
g = 2*(Math.random() - .5)*inv;
if (r < 0) r -= step;
else r += step;
if (g < 0) g -= step;
else g += step;
vec[i] = (((r*.5 + .5)*0xff) << 16) | (((g*.5 + .5)*0xff) << 8);
}
_grainBitmapData.setVector(_grainBitmapData.rect, vec);
_grainTexture = new BitmapTexture(_grainBitmapData);
}
override public function dispose() : void
{
if (--_grainUsages == 0) {
_grainTexture.dispose();
_grainBitmapData.dispose();
_grainTexture = null;
}
}
arcane override function activate(vo : MethodVO, stage3DProxy : Stage3DProxy) : void
{
super.activate(vo, stage3DProxy);
vo.fragmentData[vo.fragmentConstantsIndex+9] = _range/_depthMapSize;
stage3DProxy.setTextureAt(vo.texturesIndex+1, _grainTexture.getTextureForStage3D(stage3DProxy));
}
/**
* @inheritDoc
*/
override protected function getPlanarFragmentCode(vo : MethodVO, regCache : ShaderRegisterCache, targetReg : ShaderRegisterElement) : String
{
var depthMapRegister : ShaderRegisterElement = regCache.getFreeTextureReg();
var grainRegister : ShaderRegisterElement = regCache.getFreeTextureReg();
var decReg : ShaderRegisterElement = regCache.getFreeFragmentConstant();
var dataReg : ShaderRegisterElement = regCache.getFreeFragmentConstant();
var customDataReg : ShaderRegisterElement = regCache.getFreeFragmentConstant();
var depthCol : ShaderRegisterElement = regCache.getFreeFragmentVectorTemp();
var uvReg : ShaderRegisterElement;
var code : String = "";
vo.fragmentConstantsIndex = decReg.index*4;
regCache.addFragmentTempUsages(depthCol, 1);
uvReg = regCache.getFreeFragmentVectorTemp();
code += // keep grain in uvReg.xy
"div " + uvReg + ", " + _depthMapCoordReg + ", " + customDataReg + ".y\n" +
"tex " + uvReg + ", " + uvReg + ", " + grainRegister + " <2d,nearest,repeat,mipnone>\n" +
"sub " + uvReg + ".xy, " + uvReg + ".xy, " + customDataReg + ".zz\n" + // uv-.5
"add " + uvReg + ".xy, " + uvReg + ".xy, " + uvReg + ".xy\n" + // 2*(uv-.5)
"mul " + uvReg + ".xy, " + uvReg + ".xy, " + customDataReg + ".y\n" +
"add " + uvReg+".z, " + _depthMapCoordReg+".z, " + dataReg+".x\n" + // offset by epsilon
"add " + uvReg+".xy, " + uvReg+".xy, " + _depthMapCoordReg+".xy\n" +
"tex " + depthCol + ", " + uvReg + ", " + depthMapRegister + " <2d,nearest,clamp,mipnone>\n" +
"dp4 " + depthCol+".z, " + depthCol + ", " + decReg + "\n" +
"slt " + targetReg+".w, " + uvReg+".z, " + depthCol+".z\n" + // 0 if in shadow
"sub " + uvReg+".xy, " + uvReg+".xy, " + _depthMapCoordReg+".xy\n" +
"neg " + uvReg+".xy, " + uvReg+".xy\n" +
"add " + uvReg+".xy, " + uvReg+".xy, " + _depthMapCoordReg+".xy\n" +
"tex " + depthCol + ", " + uvReg + ", " + depthMapRegister + " <2d,nearest,clamp,mipnone>\n" +
"dp4 " + depthCol+".z, " + depthCol + ", " + decReg + "\n" +
"slt " + uvReg+".w, " + uvReg+".z, " + depthCol+".z\n" + // 0 if in shadow
"add " + targetReg+".w, " + targetReg+".w, " + uvReg+".w\n" +
"sub " + uvReg+".xy, " + uvReg+".xy, " + _depthMapCoordReg+".xy\n" +
"mov " + uvReg+".xy, " + uvReg+".yx\n" +
"neg " + uvReg+".x, " + uvReg+".x\n" +
"add " + uvReg+".xy, " + uvReg+".xy, " + _depthMapCoordReg+".xy\n" +
"tex " + depthCol + ", " + uvReg + ", " + depthMapRegister + " <2d,nearest,clamp,mipnone>\n" +
"dp4 " + depthCol+".z, " + depthCol + ", " + decReg + "\n" +
"slt " + uvReg+".w, " + uvReg+".z, " + depthCol+".z\n" + // 0 if in shadow
"add " + targetReg+".w, " + targetReg+".w, " + uvReg+".w\n" +
"sub " + uvReg+".xy, " + uvReg+".xy, " + _depthMapCoordReg+".xy\n" +
"neg " + uvReg+".xy, " + uvReg+".xy\n" +
"add " + uvReg+".xy, " + uvReg+".xy, " + _depthMapCoordReg+".xy\n" +
"tex " + depthCol + ", " + uvReg + ", " + depthMapRegister + " <2d,nearest,clamp,mipnone>\n" +
"dp4 " + depthCol+".z, " + depthCol + ", " + decReg + "\n" +
"slt " + uvReg+".w, " + uvReg+".z, " + depthCol+".z\n" + // 0 if in shadow
"add " + targetReg+".w, " + targetReg+".w, " + uvReg+".w\n";
if (_highRes) {
// reseed
code += "div " + uvReg + ".xy, " + _depthMapCoordReg + ".xy, " + customDataReg + ".y\n" +
"tex " + uvReg + ", " + uvReg + ", " + grainRegister + " <2d,nearest,repeat,mipnone>\n" +
"sub " + uvReg + ".xy, " + uvReg + ".xy, " + customDataReg + ".zz\n" +
"add " + uvReg + ".xy, " + uvReg + ".xy, " + uvReg + ".xy\n" +
"mul " + uvReg + ".xy, " + uvReg + ".xy, " + customDataReg + ".y\n" +
"add " + uvReg+".z, " + _depthMapCoordReg+".z, " + dataReg+".x\n" + // offset by epsilon
"add " + uvReg+".xy, " + uvReg+".xy, " + _depthMapCoordReg+".xy\n" +
"tex " + depthCol + ", " + uvReg + ", " + depthMapRegister + " <2d,nearest,clamp,mipnone>\n" +
"dp4 " + depthCol+".z, " + depthCol + ", " + decReg + "\n" +
"slt " + uvReg+".w, " + uvReg+".z, " + depthCol+".z\n" + // 0 if in shadow
"add " + targetReg+".w, " + targetReg+".w, " + uvReg+".w\n" +
"sub " + uvReg+".xy, " + uvReg+".xy, " + _depthMapCoordReg+".xy\n" +
"neg " + uvReg+".xy, " + uvReg+".xy\n" +
"add " + uvReg+".xy, " + uvReg+".xy, " + _depthMapCoordReg+".xy\n" +
"tex " + depthCol + ", " + uvReg + ", " + depthMapRegister + " <2d,nearest,clamp,mipnone>\n" +
"dp4 " + depthCol+".z, " + depthCol + ", " + decReg + "\n" +
"slt " + uvReg+".w, " + uvReg+".z, " + depthCol+".z\n" + // 0 if in shadow
"add " + targetReg+".w, " + targetReg+".w, " + uvReg+".w\n" +
"sub " + uvReg+".xy, " + uvReg+".xy, " + _depthMapCoordReg+".xy\n" +
"mov " + uvReg+".xy, " + uvReg+".yx\n" +
"neg " + uvReg+".x, " + uvReg+".x\n" +
"add " + uvReg+".xy, " + uvReg+".xy, " + _depthMapCoordReg+".xy\n" +
"tex " + depthCol + ", " + uvReg + ", " + depthMapRegister + " <2d,nearest,clamp,mipnone>\n" +
"dp4 " + depthCol+".z, " + depthCol + ", " + decReg + "\n" +
"slt " + uvReg+".w, " + uvReg+".z, " + depthCol+".z\n" + // 0 if in shadow
"add " + targetReg+".w, " + targetReg+".w, " + uvReg+".w\n" +
"sub " + uvReg+".xy, " + uvReg+".xy, " + _depthMapCoordReg+".xy\n" +
"neg " + uvReg+".xy, " + uvReg+".xy\n" +
"add " + uvReg+".xy, " + uvReg+".xy, " + _depthMapCoordReg+".xy\n" +
"tex " + depthCol + ", " + uvReg + ", " + depthMapRegister + " <2d,nearest,clamp,mipnone>\n" +
"dp4 " + depthCol+".z, " + depthCol + ", " + decReg + "\n" +
"slt " + uvReg+".w, " + uvReg+".z, " + depthCol+".z\n" + // 0 if in shadow
"add " + targetReg+".w, " + targetReg+".w, " + uvReg+".w\n";
}
regCache.removeFragmentTempUsage(depthCol);
code += "mul " + targetReg+".w, " + targetReg+".w, " + customDataReg+".x\n"; // average
vo.texturesIndex = depthMapRegister.index;
return code;
}
}
} |
package {
import flash.display.*;
import flash.events.*;
import flash.media.*;
public class SoundPlayer {
[Embed(source='bgm01.mp3')]
private static const bgm01:Class;
[Embed(source='bgm02.mp3')]
private static const bgm02:Class;
[Embed(source='bgm03.mp3')]
private static const bgm03:Class;
[Embed(source='bgm04.mp3')]
private static const bgm04:Class;
[Embed(source='sound01.mp3')]
private static const sound01:Class;
[Embed(source='sound02.mp3')]
private static const sound02:Class;
[Embed(source='sound03.mp3')]
private static const sound03:Class;
[Embed(source='sound04.mp3')]
private static const sound04:Class;
private static var bgms:Array = new Array();
private static var sounds:Array = new Array();
public static var currentBGM:int = 0;
public static var nowPlayingBGM:Boolean = false;
public static var channel:SoundChannel;
public static function init():void{
bgms.push(new bgm01());
bgms.push(new bgm02());
bgms.push(new bgm03());
bgms.push(new bgm04());
sounds.push(new sound01());
sounds.push(new sound02());
sounds.push(new sound03());
sounds.push(new sound04());
}
public static function stopBGM():void{
if(nowPlayingBGM){
channel.stop();
}
nowPlayingBGM = false;
}
public static function playBGM(index:int):void{
if(nowPlayingBGM && index == currentBGM){
return;
}
stopBGM();
currentBGM=index;
nowPlayingBGM = true;
channel = bgms[index].play(0,256);
}
public static function playSound(index:int):void{
sounds[index].play(0,0);
}
}
}
|
// Decompiled by AS3 Sorcerer 6.08
// www.as3sorcerer.com
//kabam.rotmg.core.signals.HideTooltipsSignal
package kabam.rotmg.core.signals
{
import org.osflash.signals.Signal;
public class HideTooltipsSignal extends Signal
{
}
}//package kabam.rotmg.core.signals
|
package my.loaders
{
import com.sociodox.utils.Base64;
import flash.utils.ByteArray;
import flash.display.Bitmap;
import flash.display.Loader;
import flash.events.Event;
import flash.net.URLRequest;
public class BitmapLoader extends FileLoader
{
public var bitmap: Bitmap;
private var loader: Loader;
private static const dataURIPreambles: Array = ["data:image/gif;base64","data:image/jpeg;base64","data:image/png;base64"];
public function BitmapLoader()
{
}
private function getDataURIStart(url: String): int
{
var numPreambles: int = dataURIPreambles.length;
for(var i: int = 0; i < numPreambles; ++i){
var preamble: String = dataURIPreambles[i];
var preambleLength: int = preamble.length;
var uriSubstr: String = url.substr(0, preambleLength);
if(uriSubstr == preamble){
return preamble.length+1;
}
}
return 0;
}
override public function load(url: String): void
{
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete);
//check if is datauri
var base64Start: int = getDataURIStart(url);
if(base64Start>0) {
var base64String: String = url.substr(base64Start);
var bytes: ByteArray = Base64.decode(base64String);
loader.loadBytes(bytes);
} else {
loader.load(new URLRequest(url));
}
}
private function onComplete(event: Event): void
{
loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, onComplete);
processData(loader.content);
complete.dispatch();
}
override protected function processData(data: *): void
{
bitmap = Bitmap(data);
}
}
}
|
/**
* VERSION: 1.67
* DATE: 2011-04-20
* AS3 (AS2 version is also available)
* UPDATES AND DOCS AT: http://www.greensock.com/timelinemax/
**/
package com.greensock {
import com.greensock.core.*;
import com.greensock.OverwriteManager;
import com.greensock.events.TweenEvent;
import flash.events.*;
/**
* TimelineMax extends TimelineLite, offering exactly the same functionality plus useful
* (but non-essential) features like AS3 event dispatching, repeat, repeatDelay, yoyo,
* currentLabel, addCallback(), removeCallback(), tweenTo(), tweenFromTo(), getLabelAfter(), getLabelBefore(),
* and getActive() (and probably more in the future). It is the ultimate sequencing tool.
* Think of a TimelineMax instance like a virtual MovieClip timeline or a container where
* you place tweens (or other timelines) over the course of time. You can:
*
* <ul>
* <li> build sequences easily by adding tweens with the append(), prepend(), insert(), appendMultiple(),
* prependMultiple(), and insertMultiple() methods. Tweens can overlap as much as you want and you have
* complete control over where they get placed on the timeline.</li>
*
* <li> add labels, play(), stop(), gotoAndPlay(), gotoAndStop(), restart(), tweenTo() and even reverse()! </li>
*
* <li> nest timelines within timelines as deeply as you want.</li>
*
* <li> set the progress of the timeline using its <code>currentProgress</code> property. For example, to skip to
* the halfway point, set <code>myTimeline.currentProgress = 0.5</code>.</li>
*
* <li> tween the <code>currentTime</code>, <code>totalTime</code>, <code>currentProgress</code>, or <code>totalProgress</code>
* property to fastforward/rewind the timeline. You could
* even attach a slider to one of these properties to give the user the ability to drag
* forwards/backwards through the whole timeline.</li>
*
* <li> add onStart, onUpdate, onComplete, onReverseComplete, and/or onRepeat callbacks using the
* constructor's <code>vars</code> object.</li>
*
* <li> speed up or slow down the entire timeline with its <code>timeScale</code> property. You can even tween
* this property to gradually speed up or slow down the timeline.</li>
*
* <li> use the insertMultiple(), appendMultiple(), or prependMultiple() methods to create
* complex sequences including various alignment modes and staggering capabilities.
* Works great in conjunction with TweenMax.allTo() too. </li>
*
* <li> base the timing on frames instead of seconds if you prefer. Please note, however, that
* the timeline's timing mode dictates its childrens' timing mode as well. </li>
*
* <li> kill the tweens of a particular object inside the timeline with killTweensOf() or get the tweens of an object
* with getTweensOf() or get all the tweens/timelines in the timeline with getChildren()</li>
*
* <li> set the timeline to repeat any number of times or indefinitely. You can even set a delay
* between each repeat cycle and/or cause the repeat cycles to yoyo, appearing to reverse
* every other cycle. </li>
*
* <li> listen for START, UPDATE, REPEAT, REVERSE_COMPLETE, and COMPLETE events.</li>
*
* <li> get the active tweens in the timeline with getActive().</li>
*
* <li> add callbacks (function calls) anywhere in the timeline that call a function of your choosing when
* the "virtual playhead" passes a particular spot.</li>
*
* <li> Get the <code>currentLabel</code> or find labels at various positions in the timeline
* using getLabelAfter() and getLabelBefore()</li>
* </ul>
*
* <b>EXAMPLE:</b><br /><br /><code>
*
* import com.greensock.~~;<br /><br />
*
* //create the timeline and add an onComplete call to myFunction when the timeline completes<br />
* var myTimeline:TimelineMax = new TimelineMax({onComplete:myFunction});<br /><br />
*
* //add a tween<br />
* myTimeline.append(new TweenLite(mc, 1, {x:200, y:100}));<br /><br />
*
* //add another tween at the end of the timeline (makes sequencing easy)<br />
* myTimeline.append(new TweenLite(mc, 0.5, {alpha:0}));<br /><br />
*
* //repeat the entire timeline twice<br />
* myTimeline.repeat = 2;<br /><br />
*
* //delay the repeat by 0.5 seconds each time.<br />
* myTimeline.repeatDelay = 0.5;<br /><br />
*
* //pause the timeline (stop() works too)<br />
* myTimeline.pause();<br /><br />
*
* //reverse it anytime...<br />
* myTimeline.reverse();<br /><br />
*
* //Add a "spin" label 3-seconds into the timeline.<br />
* myTimeline.addLabel("spin", 3);<br /><br />
*
* //insert a rotation tween at the "spin" label (you could also define the insert point as the time instead of a label)<br />
* myTimeline.insert(new TweenLite(mc, 2, {rotation:"360"}), "spin"); <br /><br />
*
* //go to the "spin" label and play the timeline from there...<br />
* myTimeline.gotoAndPlay("spin");<br /><br />
*
* //call myCallbackwhen the "virtual playhead" travels past the 1.5-second point.
* myTimeline.addCallback(myCallback, 1.5);
*
* //add a tween to the beginning of the timeline, pushing all the other existing tweens back in time<br />
* myTimeline.prepend(new TweenMax(mc, 1, {tint:0xFF0000}));<br /><br />
*
* //nest another TimelineMax inside your timeline...<br />
* var nestedTimeline:TimelineMax = new TimelineMax();<br />
* nestedTimeline.append(new TweenLite(mc2, 1, {x:200}));<br />
* myTimeline.append(nestedTimeline);<br /><br /></code>
*
*
* <code>insertMultiple()</code> and <code>appendMultiple()</code> provide some very powerful sequencing tools as well,
* allowing you to add an Array of tweens/timelines and optionally align them with <code>SEQUENCE</code> or <code>START</code>
* modes, and even stagger them if you want. For example, to insert 3 tweens into the timeline, aligning their start times but
* staggering them by 0.2 seconds, <br /><br /><code>
*
* myTimeline.insertMultiple([new TweenLite(mc, 1, {y:"100"}),
* new TweenLite(mc2, 1, {x:120}),
* new TweenLite(mc3, 1, {alpha:0.5})],
* 0,
* TweenAlign.START,
* 0.2);</code><br /><br />
*
* You can use the constructor's <code>vars</code> object to do all the setup too, like:<br /><br /><code>
*
* var myTimeline:TimelineMax = new TimelineMax({tweens:[new TweenLite(mc1, 1, {y:"100"}), TweenMax.to(mc2, 1, {tint:0xFF0000})], align:TweenAlign.SEQUENCE, onComplete:myFunction, repeat:2, repeatDelay:1});</code><br /><br />
*
* If that confuses you, don't worry. Just use the <code>append()</code>, <code>insert()</code>, and <code>prepend()</code> methods to build your
* sequence. But power users will likely appreciate the quick, compact way they can set up sequences now. <br /><br />
*
*
* <b>NOTES:</b>
* <ul>
* <li> TimelineMax automatically inits the OverwriteManager class to prevent unexpected overwriting behavior in sequences.
* The default mode is <code>AUTO</code>, but you can set it to whatever you want with <code>OverwriteManager.init()</code>
* (see <a href="http://www.greensock.com/overwritemanager/">http://www.greensock.com/overwritemanager/</a>)</li>
* <li> TimelineMax adds about 4.9k to your SWF (not including OverwriteManager).</li>
* </ul>
*
* <b>Copyright 2011, GreenSock. All rights reserved.</b> This work is subject to the terms in <a href="http://www.greensock.com/terms_of_use.html">http://www.greensock.com/terms_of_use.html</a> or for corporate Club GreenSock members, the software agreement that was issued with the corporate membership.
*
* @author Jack Doyle, jack@greensock.com
**/
public class TimelineMax extends TimelineLite implements IEventDispatcher {
/** @private **/
public static const version:Number = 1.67;
/** @private **/
protected var _repeat:int;
/** @private **/
protected var _repeatDelay:Number;
/** @private **/
protected var _cyclesComplete:int;
/** @private **/
protected var _dispatcher:EventDispatcher;
/** @private **/
protected var _hasUpdateListener:Boolean;
/**
* Works in conjunction with the repeat property, determining the behavior of each cycle; when <code>yoyo</code> is true,
* the timeline will go back and forth, appearing to reverse every other cycle (this has no affect on the <code>reversed</code> property though).
* So if repeat is 2 and <code>yoyo</code> is false, it will look like: start - 1 - 2 - 3 - 1 - 2 - 3 - 1 - 2 - 3 - end.
* But if repeat is 2 and <code>yoyo</code> is true, it will look like: start - 1 - 2 - 3 - 3 - 2 - 1 - 1 - 2 - 3 - end.
**/
public var yoyo:Boolean;
/**
* Constructor. <br /><br />
*
* <b>SPECIAL PROPERTIES</b><br />
* The following special properties may be passed in via the constructor's vars parameter, like
* <code>new TimelineMax({paused:true, onComplete:myFunction, repeat:2, yoyo:true})</code>
*
* <ul>
* <li><b> delay : Number</b> Amount of delay in seconds (or frames for frames-based timelines) before the timeline should begin.</li>
*
* <li><b> useFrames : Boolean</b> If <code>useFrames</code> is set to true, the timeline's timing mode will be based on frames.
* Otherwise, it will be based on seconds/time. NOTE: a TimelineLite's timing mode is
* always determined by its parent timeline. </li>
*
* <li><b> paused : Boolean</b> Sets the initial paused state of the timeline (by default, timelines automatically begin playing immediately)</li>
*
* <li><b> reversed : Boolean</b> If true, the timeline will be reversed initially. This does NOT force it to the very end and start
* playing backwards. It simply affects the orientation of the timeline, so if <code>reversed</code> is set to
* true initially, it will appear not to play because it is already at the beginning. To cause it to
* play backwards from the end, set reversed to true and then set the <code>currentProgress</code> property to 1 immediately
* after creating the timeline.</li>
*
* <li><b> tweens : Array</b> To immediately insert several tweens into the timeline, use the <code>tweens</code> special property
* to pass in an Array of TweenLite/TweenMax/TimelineLite/TimelineMax instances. You can use this in conjunction
* with the <code>align</code> and <code>stagger</code> special properties to set up complex sequences with minimal code.
* These values simply get passed to the <code>insertMultiple()</code> method.</li>
*
* <li><b> align : String</b> Only used in conjunction with the <code>tweens</code> special property when multiple tweens are
* to be inserted immediately through the constructor. The value simply gets passed to the
* <code>insertMultiple()</code> method. The default is <code>TweenAlign.NORMAL</code>. Options are:
* <ul>
* <li><b> TweenAlign.SEQUENCE:</b> aligns the tweens one-after-the-other in a sequence</li>
* <li><b> TweenAlign.START:</b> aligns the start times of all of the tweens (ignores delays)</li>
* <li><b> TweenAlign.NORMAL:</b> aligns the start times of all the tweens (honors delays)</li>
* </ul>The <code>align</code> special property does <b>not</b> force all child tweens/timelines to maintain
* relative positioning, so for example, if you use TweenAlign.SEQUENCE and then later change the duration
* of one of the nested tweens, it does <b>not</b> force all subsequent timelines to change their position
* on the timeline. The <code>align</code> special property only affects the alignment of the tweens that are
* initially placed into the timeline through the <code>tweens</code> special property of the <code>vars</code> object.</li>
*
* <li><b> stagger : Number</b> Only used in conjunction with the <code>tweens</code> special property when multiple tweens are
* to be inserted immediately. It staggers the tweens by a set amount of time (in seconds) (or
* in frames if <code>useFrames</code> is true). For example, if the stagger value is 0.5 and the <code>align</code>
* property is set to <code>TweenAlign.START</code>, the second tween will start 0.5 seconds after the first one
* starts, then 0.5 seconds later the third one will start, etc. If the align property is
* <code>TweenAlign.SEQUENCE</code>, there would be 0.5 seconds added between each tween. This value simply gets
* passed to the <code>insertMultiple()</code> method. Default is 0.</li>
*
* <li><b> onStart : Function</b> A function that should be called when the timeline begins (the <code>currentProgress</code> won't necessarily
* be zero when onStart is called. For example, if the timeline is created and then its <code>currentProgress</code>
* property is immediately set to 0.5 or if its <code>currentTime</code> property is set to something other than zero,
* onStart will still get fired because it is the first time the timeline is getting rendered.)</li>
*
* <li><b> onStartParams : Array</b> An Array of parameters to pass the onStart function.</li>
*
* <li><b> onUpdate : Function</b> A function that should be called every time the timeline's time/position is updated
* (on every frame while the timeline is active)</li>
*
* <li><b> onUpdateParams : Array</b> An Array of parameters to pass the onUpdate function</li>
*
* <li><b> onComplete : Function</b> A function that should be called when the timeline has finished </li>
*
* <li><b> onCompleteParams : Array</b> An Array of parameters to pass the onComplete function</li>
*
* <li><b> onReverseComplete : Function</b> A function that should be called when the timeline has reached its starting point again after having been reversed </li>
*
* <li><b> onReverseCompleteParams : Array</b> An Array of parameters to pass the onReverseComplete functions</li>
*
* <li><b> onRepeat : Function</b> A function that should be called every time the timeline repeats </li>
*
* <li><b> onRepeatParams : Array</b> An Array of parameters to pass the onRepeat function</li>
*
* <li><b> autoRemoveChildren : Boolean</b> If autoRemoveChildren is set to true, as soon as child tweens/timelines complete,
* they will automatically get killed/removed. This is normally undesireable because
* it prevents going backwards in time (like if you want to reverse() or set the
* <code>currentProgress</code> value to a lower value, etc.). It can, however, improve speed and memory
* management. TweenLite's root timelines use <code>autoRemoveChildren:true</code>.</li>
*
* <li><b> repeat : int</b> Number of times that the timeline should repeat. To repeat indefinitely, use -1.</li>
*
* <li><b> repeatDelay : Number</b> Amount of time in seconds (or frames for frames-based timelines) between repeats.</li>
*
* <li><b> yoyo : Boolean</b> Works in conjunction with the repeat property, determining the behavior of each
* cycle. When <code>yoyo</code> is true, the timeline will go back and forth, appearing to reverse
* every other cycle (this has no affect on the <code>reversed</code> property though). So if repeat is
* 2 and yoyo is false, it will look like: start - 1 - 2 - 3 - 1 - 2 - 3 - 1 - 2 - 3 - end. But
* if repeat is 2 and yoyo is true, it will look like: start - 1 - 2 - 3 - 3 - 2 - 1 - 1 - 2 - 3 - end. </li>
*
* <li><b> onStartListener : Function</b> A function to which the TimelineMax instance should dispatch a TweenEvent when it begins.
* This is the same as doing <code>myTimeline.addEventListener(TweenEvent.START, myFunction);</code></li>
*
* <li><b> onUpdateListener : Function</b> A function to which the TimelineMax instance should dispatch a TweenEvent every time it
* updates values. This is the same as doing <code>myTimeline.addEventListener(TweenEvent.UPDATE, myFunction);</code></li>
*
* <li><b> onCompleteListener : Function</b> A function to which the TimelineMax instance should dispatch a TweenEvent when it completes.
* This is the same as doing <code>myTimeline.addEventListener(TweenEvent.COMPLETE, myFunction);</code></li>
* </ul>
*
* @param vars optionally pass in special properties like useFrames, onComplete, onCompleteParams, onUpdate, onUpdateParams, onStart, onStartParams, tweens, align, stagger, delay, autoRemoveChildren, onCompleteListener, onStartListener, onUpdateListener, repeat, repeatDelay, and/or yoyo.
*/
public function TimelineMax(vars:Object=null) {
super(vars);
_repeat = (this.vars.repeat) ? Number(this.vars.repeat) : 0;
_repeatDelay = (this.vars.repeatDelay) ? Number(this.vars.repeatDelay) : 0;
_cyclesComplete = 0;
this.yoyo = Boolean(this.vars.yoyo == true);
this.cacheIsDirty = true;
if (this.vars.onCompleteListener != null || this.vars.onUpdateListener != null || this.vars.onStartListener != null || this.vars.onRepeatListener != null || this.vars.onReverseCompleteListener != null) {
initDispatcher();
}
}
/**
* If you want a function to be called at a particular time or label, use addCallback. When you add
* a callback, it is technically considered a zero-duration tween, so if you getChildren() there will be
* a tween returned for each callback. You can discern a callback from other tweens by the fact that
* their target is a function and the duration is zero.
*
* @param function the function to be called
* @param timeOrLabel the time in seconds (or frames for frames-based timelines) or label at which the callback should be inserted. For example, myTimeline.addCallback(myFunction, 3) would call myFunction() 3-seconds into the timeline, and myTimeline.addCallback(myFunction, "myLabel") would call it at the "myLabel" label.
* @param params an Array of parameters to pass the callback
* @return TweenLite instance
*/
public function addCallback(callback:Function, timeOrLabel:*, params:Array=null):TweenLite {
var cb:TweenLite = new TweenLite(callback, 0, {onComplete:callback, onCompleteParams:params, overwrite:0, immediateRender:false});
insert(cb, timeOrLabel);
return cb;
}
/**
* Removes a callback from a particular time or label. If timeOrLabel is null, all callbacks of that
* particular function are removed from the timeline.
*
* @param function callback function to be removed
* @param timeOrLabel the time in seconds (or frames for frames-based timelines) or label from which the callback should be removed. For example, <code>myTimeline.removeCallback(myFunction, 3)</code> would remove the callback from 3-seconds into the timeline, and <code>myTimeline.removeCallback(myFunction, "myLabel")</code> would remove it from the "myLabel" label, and <code>myTimeline.removeCallback(myFunction, null)</code> would remove ALL callbacks of that function regardless of where they are on the timeline.
* @return true if any callbacks were successfully found and removed. false otherwise.
*/
public function removeCallback(callback:Function, timeOrLabel:*=null):Boolean {
if (timeOrLabel == null) {
return killTweensOf(callback, false);
} else {
if (typeof(timeOrLabel) == "string") {
if (!(timeOrLabel in _labels)) {
return false;
}
timeOrLabel = _labels[timeOrLabel];
}
var a:Array = getTweensOf(callback, false), success:Boolean;
var i:int = a.length;
while (--i > -1) {
if (a[i].cachedStartTime == timeOrLabel) {
remove(a[i] as TweenCore);
success = true;
}
}
return success;
}
}
/**
* Creates a linear tween that essentially scrubs the playhead to a particular time or label and then stops. For
* example, to make the TimelineMax play to the "myLabel2" label, simply do: <br /><br /><code>
*
* myTimeline.tweenTo("myLabel2"); <br /><br /></code>
*
* If you want advanced control over the tween, like adding an onComplete or changing the ease or adding a delay,
* just pass in a vars object with the appropriate properties. For example, to tween to the 5-second point on the
* timeline and then call a function named <code>myFunction</code> and pass in a parameter that's references this
* TimelineMax and use a Strong.easeOut ease, you'd do: <br /><br /><code>
*
* myTimeline.tweenTo(5, {onComplete:myFunction, onCompleteParams:[myTimeline], ease:Strong.easeOut});<br /><br /></code>
*
* Remember, this method simply creates a TweenLite instance that tweens the <code>currentTime</code> property of your timeline.
* So you can store a reference to that tween if you want, and you can kill() it anytime. Also note that <code>tweenTo()</code>
* does <b>NOT</b> affect the timeline's <code>reversed</code> property. So if your timeline is oriented normally
* (not reversed) and you tween to a time/label that precedes the current time, it will appear to go backwards
* but the <code>reversed</code> property will <b>not</b> change to <code>true</code>. Also note that <code>tweenTo()</code>
* pauses the timeline immediately before tweening its <code>currentTime</code> property, and it stays paused after the tween completes.
* If you need to resume playback, you could always use an onComplete to call the <code>resume()</code> method.<br /><br />
*
* If you plan to sequence multiple playhead tweens one-after-the-other, it is typically better to use
* <code>tweenFromTo()</code> so that you can define the starting point and ending point, allowing the
* duration to be accurately determined immediately.
*
* @see #tweenFromTo()
* @param timeOrLabel The destination time in seconds (or frame if the timeline is frames-based) or label to which the timeline should play. For example, myTimeline.tweenTo(5) would play from wherever the timeline is currently to the 5-second point whereas myTimeline.tweenTo("myLabel") would play to wherever "myLabel" is on the timeline.
* @param vars An optional vars object that will be passed to the TweenLite instance. This allows you to define an onComplete, ease, delay, or any other TweenLite special property. onInit is the only special property that is not available (tweenTo() sets it internally)
* @return TweenLite instance that handles tweening the timeline to the desired time/label.
*/
public function tweenTo(timeOrLabel:*, vars:Object=null):TweenLite {
var varsCopy:Object = {ease:easeNone, overwrite:2, useFrames:this.useFrames, immediateRender:false};
for (var p:String in vars) {
varsCopy[p] = vars[p];
}
varsCopy.onInit = onInitTweenTo;
varsCopy.onInitParams = [null, this, NaN];
varsCopy.currentTime = parseTimeOrLabel(timeOrLabel);
var tl:TweenLite = new TweenLite(this, (Math.abs(Number(varsCopy.currentTime) - this.cachedTime) / this.cachedTimeScale) || 0.001, varsCopy);
tl.vars.onInitParams[0] = tl;
return tl;
}
/**
* Creates a linear tween that essentially scrubs the playhead from a particular time or label to another
* time or label and then stops. If you plan to sequence multiple playhead tweens one-after-the-other,
* <code>tweenFromTo()</code> is better to use than <code>tweenTo()</code> because it allows the duration
* to be determined immediately, ensuring that subsequent tweens that are appended to a sequence are
* positioned appropriately. For example, to make the TimelineMax play from the label "myLabel1" to the "myLabel2"
* label, and then from "myLabel2" back to the beginning (a time of 0), simply do: <br /><br /><code>
*
* var playheadTweens:TimelineMax = new TimelineMax(); <br />
* playheadTweens.append( myTimeline.tweenFromTo("myLabel1", "myLabel2") );<br />
* playheadTweens.append( myTimeline.tweenFromTo("myLabel2", 0); <br /><br /></code>
*
* If you want advanced control over the tween, like adding an onComplete or changing the ease or adding a delay,
* just pass in a vars object with the appropriate properties. For example, to tween from the start (0) to the
* 5-second point on the timeline and then call a function named <code>myFunction</code> and pass in a parameter
* that's references this TimelineMax and use a Strong.easeOut ease, you'd do: <br /><br /><code>
*
* myTimeline.tweenFromTo(0, 5, {onComplete:myFunction, onCompleteParams:[myTimeline], ease:Strong.easeOut});<br /><br /></code>
*
* Remember, this method simply creates a TweenLite instance that tweens the <code>currentTime</code> property of your timeline.
* So you can store a reference to that tween if you want, and you can <code>kill()</code> it anytime. Also note that <code>tweenFromTo()</code>
* does <b>NOT</b> affect the timeline's <code>reversed</code> property. So if your timeline is oriented normally
* (not reversed) and you tween to a time/label that precedes the current time, it will appear to go backwards
* but the <code>reversed</code> property will <b>not</b> change to <code>true</code>. Also note that <code>tweenFromTo()</code>
* pauses the timeline immediately before tweening its <code>currentTime</code> property, and it stays paused after the tween completes.
* If you need to resume playback, you could always use an onComplete to call the <code>resume()</code> method.
*
* @see #tweenTo()
* @param fromTimeOrLabel The beginning time in seconds (or frame if the timeline is frames-based) or label from which the timeline should play. For example, <code>myTimeline.tweenTo(0, 5)</code> would play from 0 (the beginning) to the 5-second point whereas <code>myTimeline.tweenFromTo("myLabel1", "myLabel2")</code> would play from "myLabel1" to "myLabel2".
* @param toTimeOrLabel The destination time in seconds (or frame if the timeline is frames-based) or label to which the timeline should play. For example, <code>myTimeline.tweenTo(0, 5)</code> would play from 0 (the beginning) to the 5-second point whereas <code>myTimeline.tweenFromTo("myLabel1", "myLabel2")</code> would play from "myLabel1" to "myLabel2".
* @param vars An optional vars object that will be passed to the TweenLite instance. This allows you to define an onComplete, ease, delay, or any other TweenLite special property. onInit is the only special property that is not available (<code>tweenFromTo()</code> sets it internally)
* @return TweenLite instance that handles tweening the timeline between the desired times/labels.
*/
public function tweenFromTo(fromTimeOrLabel:*, toTimeOrLabel:*, vars:Object=null):TweenLite {
var tl:TweenLite = tweenTo(toTimeOrLabel, vars);
tl.vars.onInitParams[2] = parseTimeOrLabel(fromTimeOrLabel);
tl.duration = Math.abs(Number(tl.vars.currentTime) - tl.vars.onInitParams[2]) / this.cachedTimeScale;
return tl;
}
/** @private **/
private static function onInitTweenTo(tween:TweenLite, timeline:TimelineMax, fromTime:Number):void {
timeline.paused = true;
if (!isNaN(fromTime)) {
timeline.currentTime = fromTime;
}
if (tween.vars.currentTime != timeline.currentTime) { //don't make the duration zero - if it's supposed to be zero, don't worry because it's already initting the tween and will complete immediately, effectively making the duration zero anyway. If we make duration zero, the tween won't run at all.
tween.duration = Math.abs(Number(tween.vars.currentTime) - timeline.currentTime) / timeline.cachedTimeScale;
}
}
/** @private **/
private static function easeNone(t:Number, b:Number, c:Number, d:Number):Number {
return t / d;
}
/** @private **/
override public function renderTime(time:Number, suppressEvents:Boolean=false, force:Boolean=false):void {
if (this.gc) {
this.setEnabled(true, false);
} else if (!this.active && !this.cachedPaused) {
this.active = true; //so that if the user renders a tween (as opposed to the timeline rendering it), the timeline is forced to re-render and align it with the proper time/frame on the next rendering cycle. Maybe the tween already finished but the user manually re-renders it as halfway done.
}
var totalDur:Number = (this.cacheIsDirty) ? this.totalDuration : this.cachedTotalDuration, prevTime:Number = this.cachedTime, prevTotalTime:Number = this.cachedTotalTime, prevStart:Number = this.cachedStartTime, prevTimeScale:Number = this.cachedTimeScale, tween:TweenCore, isComplete:Boolean, rendered:Boolean, repeated:Boolean, next:TweenCore, dur:Number, prevPaused:Boolean = this.cachedPaused;
if (time >= totalDur) {
if (_rawPrevTime <= totalDur && _rawPrevTime != time) {
this.cachedTotalTime = totalDur;
if (!this.cachedReversed && this.yoyo && _repeat % 2 != 0) {
this.cachedTime = 0;
forceChildrenToBeginning(0, suppressEvents);
} else {
this.cachedTime = this.cachedDuration;
forceChildrenToEnd(this.cachedDuration, suppressEvents);
}
isComplete = !this.hasPausedChild();
rendered = true;
if (this.cachedDuration == 0 && isComplete && (time == 0 || _rawPrevTime < 0)) { //In order to accommodate zero-duration timelines, we must discern the momentum/direction of time in order to render values properly when the "playhead" goes past 0 in the forward direction or lands directly on it, and also when it moves past it in the backward direction (from a postitive time to a negative time).
force = true;
}
}
} else if (time <= 0) {
if (time < 0) {
this.active = false;
if (this.cachedDuration == 0 && _rawPrevTime >= 0) { //In order to accommodate zero-duration timelines, we must discern the momentum/direction of time in order to render values properly when the "playhead" goes past 0 in the forward direction or lands directly on it, and also when it moves past it in the backward direction (from a postitive time to a negative time).
force = true;
isComplete = true;
}
} else if (time == 0 && !this.initted) {
force = true;
}
if (_rawPrevTime >= 0 && _rawPrevTime != time) {
this.cachedTotalTime = 0;
this.cachedTime = 0;
forceChildrenToBeginning(0, suppressEvents);
rendered = true;
if (this.cachedReversed) {
isComplete = true;
}
}
} else {
this.cachedTotalTime = this.cachedTime = time;
}
_rawPrevTime = time;
if (_repeat != 0) {
var cycleDuration:Number = this.cachedDuration + _repeatDelay;
var prevCycles:int = _cyclesComplete;
_cyclesComplete = (this.cachedTotalTime / cycleDuration) >> 0; //rounds result, like int()
if (_cyclesComplete == this.cachedTotalTime / cycleDuration) {
_cyclesComplete--; //otherwise when rendered exactly at the end time, it will act as though it is repeating (at the beginning)
}
if (prevCycles != _cyclesComplete) {
repeated = true;
}
if (isComplete) {
if (this.yoyo && _repeat % 2) {
this.cachedTime = 0;
}
} else if (time > 0) {
this.cachedTime = ((this.cachedTotalTime / cycleDuration) - _cyclesComplete) * cycleDuration; //originally this.cachedTotalTime % cycleDuration but floating point errors caused problems, so I normalized it. (4 % 0.8 should be 0 but Flash reports it as 0.79999999!)
if (this.yoyo && _cyclesComplete % 2) {
this.cachedTime = this.cachedDuration - this.cachedTime;
} else if (this.cachedTime >= this.cachedDuration) {
this.cachedTime = this.cachedDuration;
}
if (this.cachedTime < 0) {
this.cachedTime = 0;
}
} else {
_cyclesComplete = 0;
}
if (repeated && !isComplete && (this.cachedTime != prevTime || force)) {
/*
make sure children at the end/beginning of the timeline are rendered properly. If, for example,
a 3-second long timeline rendered at 2.9 seconds previously, and now renders at 3.2 seconds (which
would get transated to 2.8 seconds if the timeline yoyos or 0.2 seconds if it just repeats), there
could be a callback or a short tween that's at 2.95 or 3 seconds in which wouldn't render. So
we need to push the timeline to the end (and/or beginning depending on its yoyo value).
*/
var forward:Boolean = Boolean(!this.yoyo || (_cyclesComplete % 2 == 0));
var prevForward:Boolean = Boolean(!this.yoyo || (prevCycles % 2 == 0));
var wrap:Boolean = Boolean(forward == prevForward);
if (prevCycles > _cyclesComplete) {
prevForward = !prevForward;
}
if (prevForward) {
prevTime = forceChildrenToEnd(this.cachedDuration, suppressEvents);
if (wrap) {
prevTime = forceChildrenToBeginning(0, true);
}
} else {
prevTime = forceChildrenToBeginning(0, suppressEvents);
if (wrap) {
prevTime = forceChildrenToEnd(this.cachedDuration, true);
}
}
rendered = false;
}
}
if (this.cachedTotalTime == prevTotalTime && !force) {
return;
} else if (!this.initted) {
this.initted = true;
}
if (prevTotalTime == 0 && this.cachedTotalTime != 0 && !suppressEvents) {
if (this.vars.onStart) {
this.vars.onStart.apply(null, this.vars.onStartParams);
}
if (_dispatcher) {
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.START));
}
}
if (rendered) {
//already rendered, so ignore
} else if (this.cachedTime - prevTime > 0) {
tween = _firstChild;
while (tween) {
next = tween.nextNode; //record it here because the value could change after rendering...
if (this.cachedPaused && !prevPaused) { //in case a tween pauses the timeline when rendering
break;
} else if (tween.active || (!tween.cachedPaused && tween.cachedStartTime <= this.cachedTime && !tween.gc)) {
if (!tween.cachedReversed) {
tween.renderTime((this.cachedTime - tween.cachedStartTime) * tween.cachedTimeScale, suppressEvents, false);
} else {
dur = (tween.cacheIsDirty) ? tween.totalDuration : tween.cachedTotalDuration;
tween.renderTime(dur - ((this.cachedTime - tween.cachedStartTime) * tween.cachedTimeScale), suppressEvents, false);
}
}
tween = next;
}
} else {
tween = _lastChild;
while (tween) {
next = tween.prevNode; //record it here because the value could change after rendering...
if (this.cachedPaused && !prevPaused) { //in case a tween pauses the timeline when rendering
break;
} else if (tween.active || (!tween.cachedPaused && tween.cachedStartTime <= prevTime && !tween.gc)) {
if (!tween.cachedReversed) {
tween.renderTime((this.cachedTime - tween.cachedStartTime) * tween.cachedTimeScale, suppressEvents, false);
} else {
dur = (tween.cacheIsDirty) ? tween.totalDuration : tween.cachedTotalDuration;
tween.renderTime(dur - ((this.cachedTime - tween.cachedStartTime) * tween.cachedTimeScale), suppressEvents, false);
}
}
tween = next;
}
}
if (_hasUpdate && !suppressEvents) {
this.vars.onUpdate.apply(null, this.vars.onUpdateParams);
}
if (_hasUpdateListener && !suppressEvents) {
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.UPDATE));
}
if (repeated && !suppressEvents) {
if (this.vars.onRepeat) {
this.vars.onRepeat.apply(null, this.vars.onRepeatParams);
}
if (_dispatcher) {
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.REPEAT));
}
}
if (isComplete && (prevStart == this.cachedStartTime || prevTimeScale != this.cachedTimeScale) && (totalDur >= this.totalDuration || this.cachedTime == 0)) { //if one of the tweens that was rendered altered this timeline's startTime (like if an onComplete reversed the timeline) or if it added more tweens to the timeline, we shouldn't run complete() because it probably isn't complete. If it is, don't worry, because whatever call altered the startTime would have called complete() if it was necessary at the new time. The only exception is the timeScale property.
complete(true, suppressEvents);
}
}
/**
* Forces the timeline to completion.
*
* @param skipRender to skip rendering the final state of the timeline, set skipRender to true.
* @param suppressEvents If true, no events or callbacks will be triggered for this render (like onComplete, onUpdate, onReverseComplete, etc.)
*/
override public function complete(skipRender:Boolean=false, suppressEvents:Boolean=false):void {
super.complete(skipRender, suppressEvents);
if (_dispatcher && !suppressEvents) {
if (this.cachedReversed && this.cachedTotalTime == 0 && this.cachedDuration != 0) {
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.REVERSE_COMPLETE));
} else {
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.COMPLETE));
}
}
}
/**
* Returns the tweens/timelines that are currently active in the timeline.
*
* @param nested determines whether or not tweens and/or timelines that are inside nested timelines should be returned. If you only want the "top level" tweens/timelines, set this to false.
* @param tweens determines whether or not tweens (TweenLite and TweenMax instances) should be included in the results
* @param timelines determines whether or not timelines (TimelineLite and TimelineMax instances) should be included in the results
* @return an Array of active tweens/timelines
*/
public function getActive(nested:Boolean=true, tweens:Boolean=true, timelines:Boolean=false):Array {
var a:Array = [], all:Array = getChildren(nested, tweens, timelines), i:int, tween:TweenCore;
var l:int = all.length;
var cnt:int = 0;
for (i = 0; i < l; i += 1) {
tween = all[i];
//note: we cannot just check tween.active because timelines that contain paused children will continue to have "active" set to true even after the playhead passes their end point (technically a timeline can only be considered complete after all of its children have completed too, but paused tweens are...well...just waiting and until they're unpaused we don't know where their end point will be).
if (!tween.cachedPaused && tween.timeline.cachedTotalTime >= tween.cachedStartTime && tween.timeline.cachedTotalTime < tween.cachedStartTime + tween.cachedTotalDuration / tween.cachedTimeScale && !OverwriteManager.getGlobalPaused(tween.timeline)) {
a[cnt++] = all[i];
}
}
return a;
}
/** @inheritDoc **/
override public function invalidate():void {
_repeat = (this.vars.repeat) ? Number(this.vars.repeat) : 0;
_repeatDelay = (this.vars.repeatDelay) ? Number(this.vars.repeatDelay) : 0;
this.yoyo = Boolean(this.vars.yoyo == true);
if (this.vars.onCompleteListener != null || this.vars.onUpdateListener != null || this.vars.onStartListener != null || this.vars.onRepeatListener != null || this.vars.onReverseCompleteListener != null) {
initDispatcher();
}
setDirtyCache(true);
super.invalidate();
}
/**
* Returns the next label (if any) that occurs AFTER the time parameter. It makes no difference
* if the timeline is reversed. A label that is positioned exactly at the same time as the <code>time</code>
* parameter will be ignored.
*
* @param time Time after which the label is searched for. If you do not pass a time in, the currentTime will be used.
* @return Name of the label that is after the time passed to getLabelAfter()
*/
public function getLabelAfter(time:Number=NaN):String {
if (!time && time != 0) { //faster than isNan()
time = this.cachedTime;
}
var labels:Array = getLabelsArray();
var l:int = labels.length;
for (var i:int = 0; i < l; i += 1) {
if (labels[i].time > time) {
return labels[i].name;
}
}
return null;
}
/**
* Returns the previous label (if any) that occurs BEFORE the time parameter. It makes no difference
* if the timeline is reversed. A label that is positioned exactly at the same time as the <code>time</code>
* parameter will be ignored.
*
* @param time Time before which the label is searched for. If you do not pass a time in, the currentTime will be used.
* @return Name of the label that is before the time passed to getLabelBefore()
*/
public function getLabelBefore(time:Number=NaN):String {
if (!time && time != 0) { //faster than isNan()
time = this.cachedTime;
}
var labels:Array = getLabelsArray();
var i:int = labels.length;
while (--i > -1) {
if (labels[i].time < time) {
return labels[i].name;
}
}
return null;
}
/** @private Returns an Array of label objects, each with a "time" and "name" property, in the order that they occur in the timeline. **/
protected function getLabelsArray():Array {
var a:Array = [];
for (var p:String in _labels) {
a[a.length] = {time:_labels[p], name:p};
}
a.sortOn("time", Array.NUMERIC);
return a;
}
//---- EVENT DISPATCHING ----------------------------------------------------------------------------------------------------------
/** @private **/
protected function initDispatcher():void {
if (_dispatcher == null) {
_dispatcher = new EventDispatcher(this);
}
if (this.vars.onStartListener is Function) {
_dispatcher.addEventListener(TweenEvent.START, this.vars.onStartListener, false, 0, true);
}
if (this.vars.onUpdateListener is Function) {
_dispatcher.addEventListener(TweenEvent.UPDATE, this.vars.onUpdateListener, false, 0, true);
_hasUpdateListener = true;
}
if (this.vars.onCompleteListener is Function) {
_dispatcher.addEventListener(TweenEvent.COMPLETE, this.vars.onCompleteListener, false, 0, true);
}
if (this.vars.onRepeatListener is Function) {
_dispatcher.addEventListener(TweenEvent.REPEAT, this.vars.onRepeatListener, false, 0, true);
}
if (this.vars.onReverseCompleteListener is Function) {
_dispatcher.addEventListener(TweenEvent.REVERSE_COMPLETE, this.vars.onReverseCompleteListener, false, 0, true);
}
}
/** @private **/
public function addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void {
if (_dispatcher == null) {
initDispatcher();
}
if (type == TweenEvent.UPDATE) {
_hasUpdateListener = true;
}
_dispatcher.addEventListener(type, listener, useCapture, priority, useWeakReference);
}
/** @private **/
public function removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void {
if (_dispatcher != null) {
_dispatcher.removeEventListener(type, listener, useCapture);
}
}
/** @private **/
public function hasEventListener(type:String):Boolean {
return (_dispatcher == null) ? false : _dispatcher.hasEventListener(type);
}
/** @private **/
public function willTrigger(type:String):Boolean {
return (_dispatcher == null) ? false : _dispatcher.willTrigger(type);
}
/** @private **/
public function dispatchEvent(e:Event):Boolean {
return (_dispatcher == null) ? false : _dispatcher.dispatchEvent(e);
}
//---- GETTERS / SETTERS -------------------------------------------------------------------------------------------------------
/**
* Value between 0 and 1 indicating the overall progress of the timeline according to its <code>totalDuration</code>
* where 0 is at the beginning, 0.5 is halfway finished, and 1 is finished. <code>currentProgress</code>,
* by contrast, describes the progress according to the timeline's duration which does not
* include repeats and repeatDelays. For example, if a TimelineMax instance is set
* to repeat once, at the end of the first cycle <code>totalProgress</code> would only be 0.5
* whereas <code>currentProgress</code> would be 1. If you tracked both properties over the course of the
* tween, you'd see <code>currentProgress</code> go from 0 to 1 twice (once for each cycle) in the same
* time it takes the <code>totalProgress</code> property to go from 0 to 1 once.
**/
public function get totalProgress():Number {
return this.cachedTotalTime / this.totalDuration;
}
public function set totalProgress(n:Number):void {
setTotalTime(this.totalDuration * n, false);
}
/**
* Duration of the timeline in seconds (or frames for frames-based timelines) including any repeats
* or repeatDelays. "duration", by contrast, does NOT include repeats and repeatDelays.
**/
override public function get totalDuration():Number {
if (this.cacheIsDirty) {
var temp:Number = super.totalDuration; //just forces refresh
//Instead of Infinity, we use 999999999999 so that we can accommodate reverses.
this.cachedTotalDuration = (_repeat == -1) ? 999999999999 : this.cachedDuration * (_repeat + 1) + (_repeatDelay * _repeat);
}
return this.cachedTotalDuration;
}
/** @private **/
override public function set currentTime(n:Number):void {
if (_cyclesComplete == 0) {
setTotalTime(n, false);
} else if (this.yoyo && (_cyclesComplete % 2 == 1)) {
setTotalTime((this.duration - n) + (_cyclesComplete * (this.cachedDuration + _repeatDelay)), false);
} else {
setTotalTime(n + (_cyclesComplete * (this.duration + _repeatDelay)), false);
}
}
/** Number of times that the timeline should repeat; -1 repeats indefinitely. **/
public function get repeat():int {
return _repeat;
}
public function set repeat(n:int):void {
_repeat = n;
setDirtyCache(true);
}
/** Amount of time in seconds (or frames for frames-based timelines) between repeats **/
public function get repeatDelay():Number {
return _repeatDelay;
}
public function set repeatDelay(n:Number):void {
_repeatDelay = n;
setDirtyCache(true);
}
/** The closest label that is at or before the current time. **/
public function get currentLabel():String {
return getLabelBefore(this.cachedTime + 0.00000001);
}
}
} |
package game.managers
{
import game.common.JTLogger;
import flash.utils.Dictionary;
/**
*
* @author CabbageWrom
* 函数管理器
*
*/
public class JTFunctionManager
{
private static var map:Dictionary = new Dictionary(false);
/**
*
* @param key 函数的键值
* @param callBack 要执行的回调函数
* @param isWeak 是否弱引用
*
*/
public static function registerFunction(key:String, callBack:Function, isWeak:Boolean = false):void
{
var functionList:Vector.<JTFunctionData> = map[key];
if (functionList)
{
for each (var refFunctionData:JTFunctionData in functionList)
{
var fun:Function = refFunctionData.fun;
if (fun != callBack)
{
continue;
}
// JTLogger.warn("[JTFunctionManager.registerFunction] Has Register The Function:" + key);
return;
}
}
else
{
functionList = new Vector.<JTFunctionData>();
map[key] = functionList;
}
var functionData:JTFunctionData = new JTFunctionData();
functionData.fun = callBack;
functionData.isWeak = isWeak;
functionData.key = key;
functionList.push(functionData);
}
private static function copyFunctionVector(functionList:Vector.<JTFunctionData>):Vector.<JTFunctionData>
{
var copyFunction:Vector.<JTFunctionData> = new Vector.<JTFunctionData>();
copyFunction = copyFunction.concat(functionList);
return copyFunction;
}
/**
*
* @param key 要执行的回调函数的键值
* @param args 要传递的数据
*
*/
public static function executeFunction(key:String, ...args):void
{
var functionList:Vector.<JTFunctionData> = map[key];
if (!functionList)
{
// JTLogger.warn("[JTFunctionManager.executeFunction] Don't Has Register The Function:" + key);
return;
}
var functionListLength:int = functionList.length;
if (functionListLength == 0)
{
// JTLogger.warn("[JTFunctionManager.executeFunction] Don't Has Register The Function:" + key);
return;
}
var copyFunctionList:Vector.<JTFunctionData> = copyFunctionVector(functionList);
for each (var copyFunction:JTFunctionData in copyFunctionList)
{
if (!copyFunction)
{
continue;
}
var fun:Function = copyFunction.fun;
var weak:Boolean = copyFunction.isWeak;
if (fun == null)
{
continue;
}
fun.apply(null, args);
if (!weak)
{
continue;
}
removeFunction(key,fun);
}
}
/**
*
* @param key 要移除的函数的键值
* @param callBack 要移除的函数
*
*/
public static function removeFunction(key:String, callBack:Function):void
{
var functionList:Vector.<JTFunctionData> = map[key];
if (!functionList)
{
// JTLogger.warn("[JTFunctionManager.removeFunction] Don't Has Register The Function:" + key);
return;
}
var functionListLength:int = functionList.length;
if (functionListLength == 0)
{
map[key] = null;
delete map[key];
// JTLogger.warn("[JTFunctionManager.removeFunction] Don't Has Register The Function:" + key);
return;
}
if (callBack == null)
{
map[key] = null;
delete map[key];
// JTLogger.warn("[JTFunctionManager.removeFunction] Don't Afferent Function empty" + key);
return;
}
var index:int = 0;
for (index = 0; index < functionList.length; index++)
{
var functionData:JTFunctionData = functionList[index];
if (!functionData)
{
functionList.splice(index, 1);
index --;
continue;
}
var fun:Function = functionData.fun;
if (fun == callBack)
{
fun = null;
functionList.splice(index, 1);
index --;
break;
}
}
if (functionList.length == 0)
{
map[key] = null;
delete map[key];
}
//JTLogger.info("[JTFunctionManager.removeFunction] Sueeccd removeFunction:" + key);
}
public static function checkRegisterFunction():void
{
for (var value:Object in map)
{
if (!value)
{
continue;
}
var functionList:Vector.<JTFunctionData> = map[value];
JTLogger.info("[JTFunctionManager.checkRegisterFunction]" + value);
if (!functionList)
{
continue;
}
JTLogger.info("[JTFunctionManager.checkRegisterFunction]" + value,"_____" + "Length:" + functionList.length);
}
}
}
}
class JTFunctionData
{
public var key:String = null;
public var fun:Function = null;
public var isWeak:Boolean = false;
} |
package flash.display
{
final public class StageAlign extends Object
{
public static const TOP:String = "T";
public static const LEFT:String = "L";
public static const BOTTOM:String = "B";
public static const RIGHT:String = "R";
public static const TOP_LEFT:String = "TL";
public static const TOP_RIGHT:String = "TR";
public static const BOTTOM_LEFT:String = "BL";
public static const BOTTOM_RIGHT:String = "BR";
public function StageAlign()
{
return;
}// end function
}
}
|
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.flexunit.experimental.runners.statements.cases
{
import mockolate.mock;
import mockolate.runner.MockolateRule;
import mockolate.strict;
import mockolate.verify;
import org.flexunit.experimental.runners.statements.AssignmentSequencer;
import org.flexunit.experimental.runners.statements.TheoryAnchor;
import org.flexunit.experimental.theories.internals.Assignments;
import org.flexunit.internals.AssumptionViolatedException;
import org.flexunit.internals.namespaces.classInternal;
import org.flexunit.runners.model.FrameworkMethod;
import org.flexunit.token.AsyncTestToken;
import org.flexunit.token.ChildResult;
use namespace classInternal;
public class AssignmentSequencerCase
{
//TODO: This test case still needs additional classes written for it
//Not all of the code in sendComplete will be reached because no errors are passed to it in the AssignmentSequencerC class
protected var assignmentSequencer:AssignmentSequencer;
protected var testClass:Class;
//----------------------
// MOCKOLATE
//---------------------
[Rule]
public var mockolateRule:MockolateRule = new MockolateRule();
[Mock(type="strict")]
public var assignmentsMock:Assignments;
[Mock(type="strict")]
public var parentToken:AsyncTestToken;
[Mock(type="strict")]
public var frameworkMethodMock:FrameworkMethod;
[Mock(type="strict")]
public var theoryAnchorMock:TheoryAnchor;
//-----------------------
// SETUP
//-----------------------
[Before(description="Create an instance of the AssignmentSequencer class")]
public function createAssignmentSequencer():void {
testClass = Object;
assignmentSequencer = new AssignmentSequencer(assignmentsMock, frameworkMethodMock, testClass, theoryAnchorMock)
}
//----------------------
// TEAR DOWN
//-----------------------
[After(description="Remove the reference to the instance of the AssignmentSequencer class")]
public function destroyAssignmentSequencer():void {
assignmentsMock = null;
parentToken = null;
frameworkMethodMock = null;
theoryAnchorMock = null;
assignmentSequencer = null;
testClass = null;
}
//------------------------
// TEST METHODS
//------------------------
[Test(description="Ensure that the evaluate function calls handleChildExecuteComplete with a null ChildResult if the parameterAssignment's complete property is false")]
public function evaluateNotCompleteTest():void {
//Set the parameterAssignment's complete property to false
mock(assignmentsMock).getter("complete").returns(false);
//Set expectations
mock(assignmentsMock).method("potentialsForNextUnassigned").noArgs().returns(new Array()).once();
mock(parentToken).method("sendResult").args(null).once();
assignmentSequencer.evaluate(parentToken);
//Verify expectations were met
verify(assignmentsMock);
verify(parentToken);
}
//TODO: This test is running into an issue with the nullsOk method in the theoryAnchorMock
[Ignore]
[Test(description="Ensure that the evaluate function calls runWithCompleteAssignment with the parameterAssignment if the parameterAssignment's complete property is false")]
public function evaluateCompleteTest():void {
mock(assignmentsMock).getter("complete").returns(true);
mock(theoryAnchorMock).method("reportParameterizedError").args(Error,[]).once();
mock(assignmentsMock).method("getArgumentStrings").args(true).returns(new Array()).once();
mock(theoryAnchorMock).method("nullsOk").noArgs().returns(true).once();
assignmentSequencer.evaluate(parentToken);
//verify(theoryAnchorMock2);
//verify(assignmentsMock2);
//Set the parameterAssignment's complete property to true
//assignmentsMock.mock.property("complete").returns(true);
//Set expectations, this will ensure that parameterAssignment has been called
//theoryAnchorMock.mock.method("reportParameterizedError").withArgs(Error, Array).once;
//assignmentsMock.mock.method("getArgumentStrings").withArgs(true).once.returns(Array);
//theoryAnchorMock.mock.method("nullsOk").withNoArgs.once.returns(true);
//assignmentSequencer.evaluate(parentToken);
//Verify expectations were met
//theoryAnchorMock.mock.verify();
//assignmentsMock.mock.verify();
}
//TODO: This function will call sendComplete and there currently isn't a parent token, this will cause this test to fail
[Ignore]
[Test(description="Ensure that the handleChildExecuteComplete function correctly operates when there are no errors and no potential array")]
public function handleChildExecuteCompleteNoPotentialTest():void {
// var asyncTestTokenMock:AsyncTestTokenMock = new AsyncTestTokenMock();
// var childResult:ChildResult = new ChildResult(asyncTestTokenMock);
//
// assignmentSequencer.handleChildExecuteComplete(childResult);
}
[Ignore]
[Test(description="Ensure that the handleChildExecuteComplete function correctly operates when there are no errors, there is a potential array, and the counter is less than the length of the array")]
public function handleChildExecuteCompletePotentialTest():void {
// var parentToken:AsyncTestTokenMock = new AsyncTestTokenMock();
// var potentialAssignmentMock:PotentialAssignmentMock = new PotentialAssignmentMock();
// var array:Array = [potentialAssignmentMock];
//
// //Set the parameterAssignment's complete property to false
// assignmentsMock.mock.property("complete").returns(false);
//
// //Set expectations
// assignmentsMock.mock.method("potentialsForNextUnassigned").withNoArgs.once.returns(array);
// assignmentsMock.mock.method("assignNext").withArgs(potentialAssignmentMock).once;
//
// assignmentSequencer.evaluate(parentToken);
//
// //Verify expectations were met
// assignmentsMock.mock.verify();
}
//TODO: This function will call sendComplete and there currently isn't a parent token, this will cause this test to fail
[Ignore]
[Test(description="Ensure that the handleChildExecuteComplete function correctly operates when the result contains an AssumptionViolationException")]
public function handleChildExecuteCompleteAssumptionErrorTest():void {
// var asyncTestTokenMock:AsyncTestTokenMock = new AsyncTestTokenMock();
// var assumptionViolatedException:AssumptionViolatedException = new AssumptionViolatedException(new Object());
// var childResult:ChildResult = new ChildResult(asyncTestTokenMock, assumptionViolatedException);
//
// assignmentSequencer.handleChildExecuteComplete(childResult);
}
//TODO: This function will call sendComplete and there currently isn't a parent token, this will cause this test to fail
[Ignore]
[Test(description="Ensure that the handleChildExecuteComplete function correctly operates when the result contains an error")]
public function handleChildExecuteCompleteSingleErrorTest():void {
// var asyncTestTokenMock:AsyncTestTokenMock = new AsyncTestTokenMock();
// var error:Error = new Error();
// var childResult:ChildResult = new ChildResult(asyncTestTokenMock, error);
//
// assignmentSequencer.handleChildExecuteComplete(childResult);
}
//TODO: This function will call sendComplete and there currently isn't a parent token, this will cause this test to fail
[Ignore]
[Test(description="Ensure that the handleChildExecuteComplete function correctly operates when the multiple results with errors are passed")]
public function handleChildExecuteCompleteMultipleErrorTest():void {
// //This tests is to ensure that the overriden send complete method genertes a mulitple failure exception
// //Create the first result
// var asyncTestTokenMockOne:AsyncTestTokenMock = new AsyncTestTokenMock();
// var errorOne:Error = new Error();
// var childResultOne:ChildResult = new ChildResult(asyncTestTokenMockOne, errorOne);
//
// //Create the second result
// var asyncTestTokenMockTwo:AsyncTestTokenMock = new AsyncTestTokenMock();
// var errorTwo:Error = new Error();
// var childResultTwo:ChildResult = new ChildResult(asyncTestTokenMockTwo, errorTwo);
//
// assignmentSequencer.handleChildExecuteComplete(childResultOne);
// assignmentSequencer.handleChildExecuteComplete(childResultTwo);
}
}
} |
/*
real time subtitle translate for PotPlayer using Bai Du API
*/
// string GetTitle() -> get title for UI
// string GetVersion -> get version for manage
// string GetDesc() -> get detail information
// string GetLoginTitle() -> get title for login dialog
// string GetLoginDesc() -> get desc for login dialog
// string ServerLogin(string User, string Pass) -> login
// string ServerLogout() -> logout
// array<string> GetSrcLangs() -> get source language
// array<string> GetDstLangs() -> get target language
// string Translate(string Text, string &in SrcLang, string &in DstLang) -> do translate !!
//必须配置的部分
string appId = "XXXXXXXXXXXXXXXXXXX";//appid
string toKey = "XXXXXXXXXXXXXXXXXXX";//密钥
string GetVersion(){
return "1";
}
string GetTitle(){
return "{$CP950=Bai Du 翻譯$}{$CP0=Bai Du translate$}";
}
string GetDesc(){
return "https://fanyi.baidu.com/";
}
string GetLoginTitle(){
return "";
}
string GetLoginDesc(){
return "";
}
array<string> GetSrcLangs(){
array<string> ret = GetLangTable();
ret.insertAt(0, ""); // empty is auto
return ret;
}
array<string> GetDstLangs(){
return GetLangTable();
}
string userAgent = "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36";
string Translate(string text, string &in srcLang, string &in dstLang){
string ret = "";
if(!text.empty()){//确实有内容需要翻译才有必要继续
//开发文档。需要App id 等信息
//http://api.fanyi.baidu.com/api/trans/product/apidoc
// HostOpenConsole(); // for debug
//语言选择
srcLang = GetLang(srcLang);
dstLang = GetLang(dstLang);
// API.. Always UTF-8
string q = HostUrlEncode(text);
string salt = "" + HostGetTickCount();//随机数
string sign = HostHashMD5(appId + text + salt + toKey);//签名 appid+q+salt+密钥
string parames = "from=" + srcLang + "&to=" + dstLang + "&appid=" + appId + "&sign=" + sign + "&salt=" + salt + "&q=" + q;
string url = "http://api.fanyi.baidu.com/api/trans/vip/translate?" + parames;
// HostPrintUTF8("url == " + url);// for debug
string html = HostUrlGetString(url, userAgent);
if(!html.empty()){
ret = JsonParse(html);
}
if (ret.length() > 0){
srcLang = "UTF8";
dstLang = "UTF8";
}
if(text == ret){//如果翻译后的译文,跟原文一致
ret = "";//那么忽略这个字幕
}
}
return ret;
}
//获取语言
string GetLang(string &in lang){
string result = lang;
if(result.empty()){//空字符串
result = "auto";
} else if(result == "zh-CN"){//简体中文
result = "zh";
} else if(result == "zh-TW"){//繁体中文
result = "cht";
} else if(result == "ja"){//日语
result = "jp";
} else if(result == "ro"){//罗马尼亚语
result = "rom";
}
return result;
}
array<string> langTable = {
"zh-CN",//->zh
"zh-TW",//->cht
"en",
"ja",//->jp
"kor",
"fra",
"spa",
"th",
"ara",
"ru",
"pt",
"de",
"it",
"el",
"nl",
"pl",
"bul",
"est",
"dan",
"fin",
"cs",
"ro",//->rom
"slo",
"swe",
"hu",
"vie"
"yue",//粤语
"wyw",//文言文
};
//获取支持语言
array<string> GetLangTable(){
return langTable;
}
//解析Json数据
string JsonParse(string json){
string ret = "";//返回值
JsonReader reader;
JsonValue root;
if (reader.parse(json, root)){//如果成功解析了json内容
if(root.isObject()){//要求是对象模式
bool hasError = false;
array<string> keys = root.getKeys();//获取json root对象中所有的key
//查找是否存在错误
for(uint i = 0; i < keys.size(); i++){
if("error_code" == keys[i]){
hasError = true;
break;
}
}
if(hasError){//如果发生了错误
JsonValue errorCode = root["error_code"];//错误编号
JsonValue errorMsg = root["error_msg"];//错误信息描述
ret = "error: " + errorCode.asString() + ", error_msg=" + errorMsg.asString();
}else{//如果没发生错误
JsonValue transResult = root["trans_result"];//取得翻译结果
if(transResult.isArray()){//如果有翻译结果-必须是数组形式
for(int i = 0; i < transResult.size(); i++){
JsonValue item = transResult[i];//取得翻译结果
JsonValue dst = item["dst"];//获取翻译结果的目标
if(i > 0){//如果需要处理多行的情况
ret += "\n";//第二行开始的开头位置,加上换行符
}
ret += dst.asString();//拼接翻译结果,可能存在多行
}
}
}
}
}
return ret;
}
|
package dungeon.command
{
import RSModel.command.RSModelCommand;
import dungeon.proxy.IDailySpecialDungeonClient;
public class RegisterDailySpecialDungeonClientCommand extends RSModelCommand
{
public var client:IDailySpecialDungeonClient;
public function RegisterDailySpecialDungeonClientCommand(param1:IDailySpecialDungeonClient)
{
super();
this.client = param1;
}
}
}
|
package aerys.minko.example.core.edgedetection.shaders {
import aerys.minko.render.RenderTarget;
import aerys.minko.render.resource.texture.ITextureResource;
import aerys.minko.render.shader.SFloat;
import aerys.minko.render.shader.Shader;
import aerys.minko.render.shader.part.PostProcessingShaderPart;
public class FastBlurShader extends Shader{
private var _input : ITextureResource = null;
private var _postProcessing : PostProcessingShaderPart = null;
private var _sampler : SamplingShaderPart = null;
private var _coef : Number;
public function FastBlurShader( input : ITextureResource,
boost : Number = 1.,
renderTarget : RenderTarget = null,
priority : Number = 0.0) {
super(renderTarget, priority);
_input = input;
_coef = 5. / boost;
_postProcessing = new PostProcessingShaderPart(this);
_sampler = new SamplingShaderPart(this, float2(input.width, input.height));
}
override protected function getVertexPosition():SFloat{
return _postProcessing.vertexPosition;
}
override protected function getPixelColor() : SFloat {
return getAveragedColor(interpolate(vertexUV.xy));
}
public function getAveragedColor(uv : SFloat) : SFloat {
var average : SFloat =
divide(
add(
_sampler.getPixel(_input,uv),
_sampler.getPixel(_input,uv, 1),
_sampler.getPixel(_input,uv, 3),
_sampler.getPixel(_input,uv, 5),
_sampler.getPixel(_input,uv, 7)
),
_coef
);
return average;
}
}
} |
/*
Dungeon Joe
By Cliff Hall <clifford.hall@futurescale.com>
Copyright(c) 2010, Futurescale, Inc. Some rights reserved.
*/
package com.futurescale.dungeonjoe.controller.constant.fsm
{
public class FSMStates
{
// FSM States namespace
private static const FSM_STATE:String = "FSM/state/";
// Showing the welcome screen
public static const WELCOMING:String = FSM_STATE+"welcoming";
// Quitting the game
public static const QUITTING:String = FSM_STATE+"quitting";
// Preparing the level about to be played
public static const PREPARING_LEVEL:String = FSM_STATE+"preparing/level";
// Showing the score after the user has died or completed the last level
public static const SHOWING_SCORE:String = FSM_STATE+"showing/score";
// Character is Waiting in a Room
public static const WAITING_IN_ROOM:String = FSM_STATE+"waiting/in/room";
// Character is Waiting in Pit
public static const WAITING_IN_PIT:String = FSM_STATE+"waiting/in/pit";
// Character is being carried through the dungeon by a wyvern
public static const BEING_CARRIED:String = FSM_STATE+"being/carried";
// Character is Moving
public static const MOVING_CHARACTER:String = FSM_STATE+"moving/character";
// Using the Sword, Rope or Crystal Ball
public static const USING_ITEM:String = FSM_STATE+"using/item";
// Taking the Treasure, Damsel, Rope, Sword or Crystal Ball
public static const TAKING_ITEM:String = FSM_STATE+"taking/item";
}
} |
package kabam.rotmg.ui.view.components.dropdown {
import flash.display.Sprite;
import flash.events.Event;
import flash.events.MouseEvent;
import kabam.rotmg.ui.view.SignalWaiter;
public class LocalizedDropDown extends Sprite {
protected const h_:int = 36;
protected var strings_:Vector.<String>;
protected var w_:int = 0;
protected var selected_:LocalizedDropDownItem;
private var items_:Vector.<LocalizedDropDownItem>;
private var all_:Sprite;
private var waiter:SignalWaiter;
public function LocalizedDropDown(_arg_1:Vector.<String>) {
this.items_ = new Vector.<LocalizedDropDownItem>();
this.all_ = new Sprite();
this.waiter = new SignalWaiter();
super();
this.strings_ = _arg_1;
this.makeDropDownItems();
this.updateView();
addChild(this.all_);
this.all_.visible = false;
this.waiter.complete.addOnce(this.onComplete);
}
public function getValue():String {
return (this.selected_.getValue());
}
public function setValue(_arg_1:String):void {
var _local_3:String;
var _local_2:int = this.strings_.indexOf(_arg_1);
if (_local_2 > 0) {
_local_3 = this.strings_[0];
this.strings_[_local_2] = _local_3;
this.strings_[0] = _arg_1;
this.updateView();
dispatchEvent(new Event(Event.CHANGE));
}
}
public function getClosedHeight():int {
return (this.h_);
}
private function makeDropDownItems():void {
var _local_1:LocalizedDropDownItem;
if (this.strings_.length > 0) {
_local_1 = this.makeDropDownItem(this.strings_[0]);
this.items_.push(_local_1);
this.selected_ = _local_1;
this.selected_.addEventListener(MouseEvent.CLICK, this.onClick);
addChild(this.selected_);
}
var _local_2:int = 1;
while (_local_2 < this.strings_.length) {
_local_1 = this.makeDropDownItem(this.strings_[_local_2]);
_local_1.addEventListener(MouseEvent.CLICK, this.onSelect);
_local_1.y = (this.h_ * _local_2);
this.items_.push(_local_1);
this.all_.addChild(_local_1);
_local_2++;
}
}
private function makeDropDownItem(_arg_1:String):LocalizedDropDownItem {
var _local_2:LocalizedDropDownItem = new LocalizedDropDownItem(_arg_1, 0, this.h_);
this.waiter.push(_local_2.getTextChanged());
return (_local_2);
}
private function updateView():void {
var _local_1:int;
while (_local_1 < this.strings_.length) {
this.items_[_local_1].setValue(this.strings_[_local_1]);
this.items_[_local_1].setWidth(this.w_);
_local_1++;
}
if (this.items_.length > 0) {
this.selected_ = this.items_[0];
}
}
private function showAll():void {
this.addEventListener(MouseEvent.ROLL_OUT, this.onOut);
this.all_.visible = true;
}
private function hideAll():void {
this.removeEventListener(MouseEvent.ROLL_OUT, this.onOut);
this.all_.visible = false;
}
private function onComplete():void {
var _local_2:LocalizedDropDownItem;
var _local_1:int = 83;
for each (_local_2 in this.items_) {
_local_1 = Math.max(_local_2.width, _local_1);
}
this.w_ = _local_1;
this.updateView();
}
private function onClick(_arg_1:MouseEvent):void {
_arg_1.stopImmediatePropagation();
this.selected_.removeEventListener(MouseEvent.CLICK, this.onClick);
this.selected_.addEventListener(MouseEvent.CLICK, this.onSelect);
this.showAll();
}
private function onSelect(_arg_1:MouseEvent):void {
_arg_1.stopImmediatePropagation();
this.selected_.addEventListener(MouseEvent.CLICK, this.onClick);
this.selected_.removeEventListener(MouseEvent.CLICK, this.onSelect);
this.hideAll();
var _local_2:LocalizedDropDownItem = (_arg_1.target as LocalizedDropDownItem);
this.setValue(_local_2.getValue());
}
private function onOut(_arg_1:MouseEvent):void {
this.selected_.addEventListener(MouseEvent.CLICK, this.onClick);
this.selected_.removeEventListener(MouseEvent.CLICK, this.onSelect);
this.hideAll();
}
}
}//package kabam.rotmg.ui.view.components.dropdown
|
package game.net.data.s
{
import flash.utils.ByteArray;
import game.net.data.DataBase;
import game.net.data.vo.*;
import game.net.data.IData;
public class SPlatformShare extends DataBase
{
public var code : int;
public static const CMD : int=36006;
public function SPlatformShare()
{
}
/**
*
* @param data
*/
override public function deSerialize(data:ByteArray):void
{
super.deSerialize(data);
code=data.readUnsignedByte();
}
override public function serialize():ByteArray
{
var byte:ByteArray= new ByteArray();
byte.writeByte(code);
return byte;
}
override public function getCmd():int
{
return CMD;
}
}
}
// vim: filetype=php :
|
package
{
import com.takumus.ui.events.ListEvent;
import com.takumus.ui.list.List;
import flash.display.Sprite;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.events.Event;
import flash.text.TextField;
import flash.text.TextFormat;
[SWF(frameRate="60")]
public class Demo extends Sprite
{
private var _list:List;
private var _log:TextField;
public function Demo()
{
stage.align = StageAlign.TOP_LEFT;
stage.scaleMode = StageScaleMode.NO_SCALE;
init();
}
private function init():void
{
_list = new List(SimpleCell, 50, 0, new SimpleScrollBar());
addChild(_list);
//add data to list
_list.setData("ABCDEGFHIJKLMNOPQRSTU".split(""));
//add message event from cell
_list.addEventListener(ListEvent.MESSAGE, function(event:ListEvent):void{
log("message : {id:"+event.cellData.id + ", message:\"" + event.message + "\"}\n");
});
//add update event
_list.addEventListener(ListEvent.UPDATE, function(event:ListEvent):void{
log("updated : [");
var tmpData:Array = _list.getData();
for(var i:int = 0; i < tmpData.length; i ++){
var data:String = tmpData[i];
log(data+",");
}
log("]\n");
});
//add remove event
_list.addEventListener(ListEvent.REMOVE, function(event:ListEvent):void
{
log("removed : {id:"+event.cellData.id + ", data:" + event.cellData.data.toString() + "}\n");
});
//debug log
_log = new TextField();
_log.width = _log.height = 400;
_log.alpha = 0.5;
_log.wordWrap = true;
_log.defaultTextFormat = new TextFormat("", 12, 0x000000);
_log.mouseEnabled = false;
_log.border = true;
_log.background = true;
addChild(_log);
//resize
this.stage.addEventListener(Event.RESIZE, function(e:Event):void
{
resize();
});
resize();
}
private function log(text:String):void
{
_log.appendText(text);
_log.scrollV = _log.maxScrollV;
}
private function resize():void
{
_list.resize(stage.stageWidth, stage.stageHeight);
_log.x = (stage.stageWidth - _log.width) / 2;
_log.y = (stage.stageHeight - _log.height) / 2;
}
}
} |
package flash.media
{
public class VideoStreamSettings extends Object
{
private var _bandwidth:int = 0;
private var _codec:String = "";
private var _fps:Number = 0;
private var _height:int = 0;
private var _keyFrameInterval:int;
private var _quality:int;
private var _width:int;
public function get bandwidth():int { return _bandwidth; }
public function get codec():String { return _codec; }
public function get fps():Number { return _fps; }
public function get height():int { return _height; }
public function get keyFrameInterval():int { return _keyFrameInterval; }
public function get quality():int { return _quality; }
public function get width():int { return _width; }
public function setKeyFrameInterval(keyFrameInterval:int):void
{
_keyFrameInterval = keyFrameInterval;
}
public function setMode(width:int, height:int, fps:Number):void
{
_width = width;
_height = height;
_fps = fps;
}
public function setQuality(bandwidth:int, quality:int):void
{
_bandwidth = bandwidth;
_quality = _quality;
}
public function VideoStreamSettings()
{
}
}
}
|
package com.codeazur.as3swf
{
import com.codeazur.as3swf.data.SWFRectangle;
import com.codeazur.as3swf.events.SWFProgressEvent;
import flash.utils.ByteArray;
public class SWF extends SWFTimelineContainer
{
public var version:int;
public var fileLength:uint;
public var fileLengthCompressed:uint;
public var frameSize:SWFRectangle;
public var frameRate:Number;
public var frameCount:uint;
public var compressed:Boolean;
public var compressionMethod:String;
protected var bytes:SWFData;
public static const COMPRESSION_METHOD_ZLIB:String = "zlib";
public static const COMPRESSION_METHOD_LZMA:String = "lzma";
protected static const FILE_LENGTH_POS:uint = 4;
protected static const COMPRESSION_START_POS:uint = 8;
public function SWF(ba:ByteArray = null) {
bytes = new SWFData();
if (ba != null) {
loadBytes(ba);
} else {
version = 10;
fileLength = 0;
fileLengthCompressed = 0;
frameSize = new SWFRectangle();
frameRate = 50;
frameCount = 1;
compressed = true;
compressionMethod = COMPRESSION_METHOD_ZLIB;
}
}
public function loadBytes(ba:ByteArray):void {
bytes.length = 0;
ba.position = 0;
ba.readBytes(bytes);
parse(bytes);
}
public function loadBytesAsync(ba:ByteArray):void {
bytes.length = 0;
ba.position = 0;
ba.readBytes(bytes);
parseAsync(bytes);
}
public function parse(data:SWFData):void {
bytes = data;
parseHeader();
parseTags(data, version);
}
public function parseAsync(data:SWFData):void {
bytes = data;
parseHeader();
parseTagsAsync(data, version);
}
public function publish(ba:ByteArray):void {
var data:SWFData = new SWFData();
publishHeader(data);
publishTags(data, version);
publishFinalize(data);
ba.writeBytes(data);
}
public function publishAsync(ba:ByteArray):void {
var data:SWFData = new SWFData();
publishHeader(data);
publishTagsAsync(data, version);
addEventListener(SWFProgressEvent.COMPLETE, function(event:SWFProgressEvent):void {
removeEventListener(SWFProgressEvent.COMPLETE, arguments.callee);
publishFinalize(data);
ba.length = 0;
ba.writeBytes(data);
}, false, int.MAX_VALUE);
}
protected function parseHeader():void {
compressed = false;
compressionMethod = COMPRESSION_METHOD_ZLIB;
bytes.position = 0;
var signatureByte:uint = bytes.readUI8();
if (signatureByte == 0x43) {
compressed = true;
} else if (signatureByte == 0x5A) {
compressed = true;
compressionMethod = COMPRESSION_METHOD_LZMA;
} else if (signatureByte != 0x46) {
throw(new Error("Not a SWF. First signature byte is 0x" + signatureByte.toString(16) + " (expected: 0x43 or 0x5A or 0x46)"));
}
signatureByte = bytes.readUI8();
if (signatureByte != 0x57) {
throw(new Error("Not a SWF. Second signature byte is 0x" + signatureByte.toString(16) + " (expected: 0x57)"));
}
signatureByte = bytes.readUI8();
if (signatureByte != 0x53) {
throw(new Error("Not a SWF. Third signature byte is 0x" + signatureByte.toString(16) + " (expected: 0x53)"));
}
version = bytes.readUI8();
fileLength = bytes.readUI32();
fileLengthCompressed = bytes.length;
if (compressed) {
// The following data (up to end of file) is compressed, if header has CWS or ZWS signature
bytes.swfUncompress(compressionMethod, fileLength);
}
frameSize = bytes.readRECT();
frameRate = bytes.readFIXED8();
frameCount = bytes.readUI16();
}
protected function publishHeader(data:SWFData):void {
var firstHeaderByte:uint = 0x46;
if(compressed) {
if (compressionMethod == COMPRESSION_METHOD_ZLIB) {
firstHeaderByte = 0x43;
} else if (compressionMethod == COMPRESSION_METHOD_LZMA) {
firstHeaderByte = 0x5A;
}
}
data.writeUI8(firstHeaderByte);
data.writeUI8(0x57);
data.writeUI8(0x53);
data.writeUI8(version);
data.writeUI32(0);
data.writeRECT(frameSize);
data.writeFIXED8(frameRate);
data.writeUI16(frameCount); // TODO: get the real number of frames from the tags
}
protected function publishFinalize(data:SWFData):void {
fileLength = fileLengthCompressed = data.length;
if (compressed) {
compressionMethod = SWF.COMPRESSION_METHOD_ZLIB; // Force ZLIB compression. LZMA doesn't seem to work when publishing.
data.position = COMPRESSION_START_POS;
data.swfCompress(compressionMethod);
fileLengthCompressed = data.length;
}
var endPos:uint = data.position;
data.position = FILE_LENGTH_POS;
data.writeUI32(fileLength);
data.position = 0;
}
override public function toString(indent:uint = 0):String {
var s:String = "[SWF]\n" +
" Header:\n" +
" Version: " + version + "\n" +
" Compression: ";
if(compressed) {
if(compressionMethod == COMPRESSION_METHOD_ZLIB) {
s += "ZLIB";
} else if(compressionMethod == COMPRESSION_METHOD_LZMA) {
s += "LZMA";
} else {
s += "Unknown";
}
} else {
s += "None";
}
return s + "\n FileLength: " + fileLength + "\n" +
" FileLengthCompressed: " + fileLengthCompressed + "\n" +
" FrameSize: " + frameSize.toStringSize() + "\n" +
" FrameRate: " + frameRate + "\n" +
" FrameCount: " + frameCount +
super.toString(indent);
}
}
}
|
import gfx.io.GameDelegate;
import Shared.GlobalFunc;
import gfx.ui.NavigationCode;
import gfx.ui.InputDetails;
import skyui.defines.Input;
import skyui.util.GlobalFunctions;
import skyui.util.ConfigManager;
import skyui.components.ButtonPanel;
import skyui.defines.Inventory;
import skyui.defines.Item;
import skyui.util.Debug;
import skyui.VRInput;
class ItemMenu extends MovieClip
{
/* PRIVATE VARIABLES */
private var _platform: Number;
private var _bItemCardFadedIn: Boolean = false;
private var _bItemCardPositioned: Boolean = false;
private var _quantityMinCount: Number = 5;
private var _config: Object;
private var _bPlayBladeSound: Boolean;
private var _searchKey: Number;
private var _switchTabKey: Number;
private var _acceptControls: Object;
private var _cancelControls: Object;
private var _searchControls: Object;
private var _switchControls: Object;
private var _sortColumnControls: Array;
private var _sortOrderControls: Object;
private var _VRInput: VRInput;
/* STAGE ELEMENTS */
public var inventoryLists: InventoryLists;
public var itemCardFadeHolder: MovieClip;
public var bottomBar: BottomBar;
public var mouseRotationRect: MovieClip;
public var exitMenuRect: MovieClip;
/* PROPERTIES */
public var itemCard: MovieClip;
public var navPanel: ButtonPanel;
public var bEnableTabs: Boolean = false;
// @GFx
public var bPCControlsReady: Boolean = true;
public var bFadedIn: Boolean = true;
/* INITIALIZATION */
public function ItemMenu()
{
super();
itemCard = itemCardFadeHolder.ItemCard_mc;
navPanel = bottomBar.buttonPanel;
Mouse.addListener(this);
ConfigManager.registerLoadCallback(this, "onConfigLoad");
bFadedIn = true;
_bItemCardFadedIn = false;
}
public function setupVRInput() {
_VRInput = VRInput.instance;
VRInput.instance.setup();
}
public function OnShow() {
setupVRInput();
}
/* PUBLIC FUNCTIONS */
// @API
public function InitExtensions(a_bPlayBladeSound): Void
{
skse.ExtendData(true);
skse.ForceContainerCategorization(true);
_bPlayBladeSound = a_bPlayBladeSound
inventoryLists.InitExtensions();
if (bEnableTabs)
inventoryLists.enableTabBar();
GameDelegate.addCallBack("UpdatePlayerInfo",this,"UpdatePlayerInfo");
GameDelegate.addCallBack("UpdateItemCardInfo",this,"UpdateItemCardInfo");
GameDelegate.addCallBack("ToggleMenuFade",this,"ToggleMenuFade");
GameDelegate.addCallBack("RestoreIndices",this,"RestoreIndices");
inventoryLists.addEventListener("categoryChange",this,"onCategoryChange");
inventoryLists.addEventListener("itemHighlightChange",this,"onItemHighlightChange");
inventoryLists.addEventListener("showItemsList",this,"onShowItemsList");
inventoryLists.addEventListener("hideItemsList",this,"onHideItemsList");
inventoryLists.itemList.addEventListener("itemPress", this ,"onItemSelect");
itemCard.addEventListener("quantitySelect",this,"onQuantityMenuSelect");
itemCard.addEventListener("subMenuAction",this,"onItemCardSubMenuAction");
positionFixedElements();
itemCard._visible = false;
navPanel.hideButtons();
exitMenuRect.onMouseDown = function()
{
if (_parent.bFadedIn == true && Mouse.getTopMostEntity() == this)
_parent.onExitMenuRectClick();
};
}
public function setConfig(a_config: Object): Void
{
_config = a_config;
positionFloatingElements();
var itemListState = inventoryLists.itemList.listState;
var categoryListState = inventoryLists.categoryList.listState;
var appearance = a_config["Appearance"];
categoryListState.iconSource = appearance.icons.category.source;
itemListState.iconSource = appearance.icons.item.source;
itemListState.showStolenIcon = appearance.icons.item.showStolen;
itemListState.defaultEnabledColor = appearance.colors.text.enabled;
itemListState.negativeEnabledColor = appearance.colors.negative.enabled;
itemListState.stolenEnabledColor = appearance.colors.stolen.enabled;
itemListState.defaultDisabledColor = appearance.colors.text.disabled;
itemListState.negativeDisabledColor = appearance.colors.negative.disabled;
itemListState.stolenDisabledColor = appearance.colors.stolen.disabled;
_quantityMinCount = a_config["ItemList"].quantityMenu.minCount;
if (_platform == 0) {
_switchTabKey = a_config["Input"].controls.pc.switchTab;
} else {
_switchTabKey = a_config["Input"].controls.gamepad.switchTab;
var previousColumnKey = a_config["Input"].controls.gamepad.prevColumn;
var nextColumnKey = a_config["Input"].controls.gamepad.nextColumn;
var sortOrderKey = a_config["Input"].controls.gamepad.sortOrder;
_sortColumnControls = [{keyCode: previousColumnKey},
{keyCode: nextColumnKey}];
_sortOrderControls = {keyCode: sortOrderKey};
}
_switchControls = {keyCode: _switchTabKey};
_searchKey = a_config["Input"].controls.pc.search;
_searchControls = {keyCode: _searchKey};
updateBottomBar(false);
}
// @API
public function SetPlatform(a_platform: Number, a_bPS3Switch: Boolean): Void
{
VRInput.instance.updatePlatform(a_platform);
_platform = a_platform;
if (a_platform == 0) {
_acceptControls = Input.Enter;
_cancelControls = Input.Tab;
// Defaults
_switchControls = Input.Alt;
} else {
_acceptControls = Input.Accept;
_cancelControls = Input.Cancel;
// Defaults
_switchControls = Input.GamepadBack;
_sortColumnControls = Input.SortColumn;
_sortOrderControls = Input.SortOrder;
}
// Defaults
_searchControls = Input.Space;
inventoryLists.setPlatform(a_platform,a_bPS3Switch);
itemCard.SetPlatform(a_platform,a_bPS3Switch);
bottomBar.setPlatform(a_platform,a_bPS3Switch);
}
// @API
public function GetInventoryItemList(): MovieClip
{
return inventoryLists.itemList;
}
// @GFx
public function handleInput(details: InputDetails, pathToFocus: Array): Boolean
{
if (!bFadedIn)
return true;
var nextClip = pathToFocus.shift();
if (nextClip.handleInput(details, pathToFocus))
return true;
if (GlobalFunc.IsKeyPressed(details) && (details.navEquivalent == NavigationCode.TAB || details.navEquivalent == NavigationCode.SHIFT_TAB))
closeMenu();
return true;
}
public function closeMenu()
{
//Debug.log(">>> ItemMenu::CloseMenu");
VRInput.instance.teardown();
GameDelegate.call("CloseMenu",[]);
//Debug.log("<<< ItemMenu::CloseMenu");
}
// @API
public function UpdatePlayerInfo(aUpdateObj: Object): Void
{
bottomBar.UpdatePlayerInfo(aUpdateObj,itemCard.itemInfo);
}
// @API
public function UpdateItemCardInfo(aUpdateObj: Object): Void
{
itemCard.itemInfo = aUpdateObj;
bottomBar.updatePerItemInfo(aUpdateObj);
}
// @API
public function ToggleMenuFade(): Void
{
if (bFadedIn) {
_parent.gotoAndPlay("fadeOut");
bFadedIn = false;
inventoryLists.itemList.disableSelection = true;
inventoryLists.itemList.disableInput = true;
inventoryLists.categoryList.disableSelection = true;
inventoryLists.categoryList.disableInput = true;
} else {
_parent.gotoAndPlay("fadeIn");
}
}
// @API
public function SetFadedIn(): Void
{
bFadedIn = true;
inventoryLists.itemList.disableSelection = false;
inventoryLists.itemList.disableInput = false;
inventoryLists.categoryList.disableSelection = false;
inventoryLists.categoryList.disableInput = false;
}
// @API
public function RestoreIndices(): Void
{
var categoryList = inventoryLists.categoryList;
var itemList = inventoryLists.itemList;
if (arguments[0] != undefined && arguments[0] != -1 && arguments.length == 5) {
categoryList.listState.restoredItem = arguments[0];
categoryList.onUnsuspend = function()
{
this.onItemPress(this.listState.restoredItem, 0);
delete this.onUnsuspend;
};
itemList.listState.restoredScrollPosition = arguments[2];
itemList.listState.restoredSelectedIndex = arguments[1];
itemList.listState.restoredActiveColumnIndex = arguments[3];
itemList.listState.restoredActiveColumnState = arguments[4];
itemList.onUnsuspend = function()
{
this.onInvalidate = function()
{
this.scrollPosition = this.listState.restoredScrollPosition;
this.selectedIndex = this.listState.restoredSelectedIndex;
delete this.onInvalidate;
};
this.layout.restoreColumnState(this.listState.restoredActiveColumnIndex, this.listState.restoredActiveColumnState);
delete this.onUnsuspend;
};
} else {
categoryList.onUnsuspend = function()
{
this.onItemPress(1, 0); // ALL
delete this.onUnsuspend;
};
}
}
/* PRIVATE FUNCTIONS */
public function onItemCardSubMenuAction(event: Object): Void
{
if (event.opening == true) {
inventoryLists.itemList.disableSelection = true;
inventoryLists.itemList.disableInput = true;
inventoryLists.categoryList.disableSelection = true;
inventoryLists.categoryList.disableInput = true;
} else if (event.opening == false) {
inventoryLists.itemList.disableSelection = false;
inventoryLists.itemList.disableInput = false;
inventoryLists.categoryList.disableSelection = false;
inventoryLists.categoryList.disableInput = false;
}
}
private function onConfigLoad(event: Object): Void
{
setConfig(event.config);
inventoryLists.showPanel(_bPlayBladeSound);
}
private function onMouseWheel(delta: Number): Void
{
for (var e = Mouse.getTopMostEntity(); e != undefined; e = e._parent) {
if (e == mouseRotationRect && shouldProcessItemsListInput(false) || !bFadedIn && delta == -1) {
GameDelegate.call("ZoomItemModel",[delta]);
break;
}
}
}
private function onExitMenuRectClick(): Void
{
closeMenu();
}
private function onCategoryChange(event: Object): Void
{
}
private function ResetItemCard(aiItemInfo)
{
itemCard.itemInfo = aiItemInfo;
bottomBar.updateBarterPerItemInfo(aiItemInfo);
}
private function onItemHighlightChange(event: Object): Void
{
if (event.index != -1) {
if (!_bItemCardFadedIn) {
_bItemCardFadedIn = true;
if (_bItemCardPositioned)
itemCard.FadeInCard();
}
if (_bItemCardPositioned)
GameDelegate.call("UpdateItem3D",[true]);
GameDelegate.call("RequestItemCardInfo",[], this, "UpdateItemCardInfo");
} else {
if (!bFadedIn)
resetMenu();
if (_bItemCardFadedIn) {
_bItemCardFadedIn = false;
onHideItemsList();
}
}
}
private function onShowItemsList(event: Object): Void
{
onItemHighlightChange(event);
}
private function onHideItemsList(event: Object): Void
{
GameDelegate.call("UpdateItem3D",[false]);
itemCard.FadeOutCard();
}
private function onItemSelect(event: Object): Void
{
if (event.entry.enabled) {
if (_quantityMinCount < 1 || (event.entry.count < _quantityMinCount))
onQuantityMenuSelect({amount:1});
else
itemCard.ShowQuantityMenu(event.entry.count);
} else {
GameDelegate.call("DisabledItemSelect",[]);
}
}
private function onQuantityMenuSelect(event: Object): Void
{
GameDelegate.call("ItemSelect",[event.amount]);
}
private function onMouseRotationStart(): Void
{
GameDelegate.call("StartMouseRotation",[]);
inventoryLists.categoryList.disableSelection = true;
inventoryLists.itemList.disableSelection = true;
}
private function onMouseRotationStop(): Void
{
GameDelegate.call("StopMouseRotation",[]);
inventoryLists.categoryList.disableSelection = false;
inventoryLists.itemList.disableSelection = false;
}
private function onMouseRotationFastClick(): Void
{
if (shouldProcessItemsListInput(false))
onItemSelect({entry:inventoryLists.itemList.selectedEntry, keyboardOrMouse:0});
}
private function saveIndices(): Void
{
var a = new Array();
// Save selected category, selected item and relative scroll position
a.push(inventoryLists.categoryList.selectedIndex);
a.push(inventoryLists.itemList.selectedIndex);
a.push(inventoryLists.itemList.scrollPosition);
a.push(inventoryLists.itemList.layout.activeColumnIndex);
a.push(inventoryLists.itemList.layout.activeColumnState);
GameDelegate.call("SaveIndices", [a]);
}
private function positionFixedElements(): Void
{
GlobalFunc.SetLockFunction();
inventoryLists.Lock("L");
inventoryLists._x = inventoryLists._x - 20;
var leftEdge = Stage.visibleRect.x + Stage.safeRect.x;
var rightEdge = Stage.visibleRect.x + Stage.visibleRect.width - Stage.safeRect.x;
bottomBar.positionElements(leftEdge, rightEdge);
MovieClip(exitMenuRect).Lock("TL");
exitMenuRect._x = exitMenuRect._x - Stage.safeRect.x;
exitMenuRect._y = exitMenuRect._y - Stage.safeRect.y;
}
private function positionFloatingElements(): Void
{
var leftEdge = Stage.visibleRect.x + Stage.safeRect.x;
var rightEdge = Stage.visibleRect.x + Stage.visibleRect.width - Stage.safeRect.x;
var a = inventoryLists.getContentBounds();
// 25 is hardcoded cause thats the final offset after the animation of the panel container is done
var panelEdge = inventoryLists._x + a[0] + a[2] + 25;
var itemCardContainer = itemCard._parent;
var itemcardPosition = _config.ItemInfo.itemcard;
var itemiconPosition = _config.ItemInfo.itemicon;
var scaleMult = (rightEdge - panelEdge) / itemCardContainer._width;
// Scale down if necessary
if (scaleMult < 1.0) {
itemCardContainer._width *= scaleMult;
itemCardContainer._height *= scaleMult;
itemiconPosition.scale *= scaleMult;
}
if (itemcardPosition.align == "left")
itemCardContainer._x = panelEdge + leftEdge + itemcardPosition.xOffset;
else if (itemcardPosition.align == "right")
itemCardContainer._x = rightEdge - itemCardContainer._width + itemcardPosition.xOffset;
else
itemCardContainer._x = panelEdge + itemcardPosition.xOffset + (Stage.visibleRect.x + Stage.visibleRect.width - panelEdge - itemCardContainer._width) / 2;
itemCardContainer._y = itemCardContainer._y + itemcardPosition.yOffset;
if (mouseRotationRect != undefined) {
MovieClip(mouseRotationRect).Lock("T");
mouseRotationRect._x = itemCard._parent._x;
mouseRotationRect._width = itemCardContainer._width;
mouseRotationRect._height = 0.55 * Stage.visibleRect.height;
}
_bItemCardPositioned = true;
// Delayed fade in if positioned wasn't set
if (_bItemCardFadedIn) {
GameDelegate.call("UpdateItem3D",[true]);
itemCard.FadeInCard();
}
}
private function shouldProcessItemsListInput(abCheckIfOverRect: Boolean): Boolean
{
var process = bFadedIn == true && inventoryLists.currentState == InventoryLists.SHOW_PANEL && inventoryLists.itemList.itemCount > 0 && !inventoryLists.itemList.disableSelection && !inventoryLists.itemList.disableInput;
if (process && _platform == Shared.Platforms.CONTROLLER_PC && abCheckIfOverRect) {
var e = Mouse.getTopMostEntity();
var found = false;
while (!found && e != undefined) {
if (e == inventoryLists.itemList)
found = true;
e = e._parent;
}
process = process && found;
}
return process;
}
// Added to prevent clicks on the scrollbar from equipping/using stuff
private function confirmSelectedEntry(): Boolean
{
// only confirm when using mouse
if (_platform != 0)
return true;
for (var e = Mouse.getTopMostEntity(); e != undefined; e = e._parent)
if (e.itemIndex == inventoryLists.itemList.selectedIndex)
return true;
return false;
}
/*
This method is only used for the InventoryMenu Favorites Category.
It prevents a lockup when unfavoriting the last item from favorites list by
resetting the menu.
*/
private function resetMenu(): Void
{
// FIXME? This crashes SkyrimVR
// When opening the inventory a second time without having an item selected for some reason.
//saveIndices();
//closemenu();
//skse.OpenMenu("Inventory Menu");
}
/*
This method is only used in InventoryMenu and ContainerMenu.
It it allows determination of read books.
Item list isn't re-sent when you activate a book, unlike other items,
so the flags don't get updated.
If the item is a book, we apply the book read flag and invalidate locally
*/
private function checkBook(a_entryObject: Object): Boolean
{
if (a_entryObject.type != Inventory.ICT_BOOK || _global.skse == null)
return false;
a_entryObject.flags |= Item.BOOKFLAG_READ;
a_entryObject.skyui_itemDataProcessed = false;
inventoryLists.itemList.requestInvalidate();
return true;
}
private function getEquipButtonData(a_itemType: Number, a_bAlwaysEquip: Boolean): Object
{
var btnData = {};
var useControls = Input.Activate;
var equipControls = Input.Equip;
switch (a_itemType) {
case Inventory.ICT_ARMOR :
btnData.text = "$Equip";
btnData.controls = a_bAlwaysEquip ? equipControls : useControls;
break;
case Inventory.ICT_BOOK :
btnData.text = "$Read";
btnData.controls = a_bAlwaysEquip ? equipControls : useControls;
break;
case Inventory.ICT_FOOD :
case Inventory.ICT_INGREDIENT :
btnData.text = "$Eat";
btnData.controls = a_bAlwaysEquip ? equipControls : useControls;
break;
case Inventory.ICT_WEAPON :
btnData.text = "$Equip";
btnData.controls = equipControls;
break;
default :
btnData.text = "$Use";
btnData.controls = a_bAlwaysEquip ? equipControls : useControls;
}
return btnData;
}
private function updateBottomBar(a_bSelected: Boolean): Void {}
}
|
package it.pixeldump.mk.struct {
import it.pixeldump.mk.*;
public class Asset {
public function get CLASS_NAME():String{
return "Asset";
}
public var itemID:uint;
public var name:String;
function Asset(itemID:uint = 0, name:String = ""){
this.itemID = itemID;
this.name = name;
}
public function fetch_xml(tabLevel:uint = 0, includeHeader:Boolean = false):String{
var xmlStr:String = includeHeader ? Constants.XML_HEADER : "" ;
var pfx:String = SwfUtils.get_xml_indent_row(++tabLevel);
xmlStr += pfx +"<" +CLASS_NAME;
xmlStr += " id=\"" +itemID +"\" ";
xmlStr += "name=\"" +name +"\" />";
return xmlStr;
}
}
} |
/**
* Copyright (c) 2007 Allurent, Inc.
* http://code.google.com/p/visualflexunit/
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package com.allurent.flexunit2.vfu.model
{
/**
* This class contains data that describes the differences between
* two pixels at the same location in two separate images. Most of
* its properties consist of the same four pieces of data for each of:
* - Its three colors
* - Its alpha value
* These four pieces of data are:
* - The value for the specified color or alpha for the first image:
* e.g. alpha1, red1, green1, blue1
* - The value for the specified color or alpha for the second image:
* e.g. alpha2, red2, green2, blue2
* - The difference between the values for the two images
* e.g. alphaDiff = alpha1 - alpha2
* e.g. redDiff = red1 - red2
* etc.
* - The absolute difference between the values for the two images
* e.g. alphaDiffAbs = Math.abs( alpha1 - alpha2 )
* e.g. redDiffAbs = Math.abs( red1 - red2 )
* etc.
*
* <p>This accounts for 16 of the properties below. The others are documented
* individually.</p>
*/
public class PixelDiff
{
/**
* The pixels' x value
*/
public var x:int;
/**
* The pixels' y value
*/
public var y:int;
/**
* The pixel's 32 bit color value in the first image
*/
public var color1:uint;
/**
* The pixel's 32 bit color value in the second image
*/
public var color2:uint;
/**
* absoluteColorDiff is the figure that one arrives at when one
* adds the absolute differences between the alpha, red, green and blue
* values for two pixels. Here's an example:
* Pixel A has the following color values: alpha:255, red:78, green:201, blue:21
* Pixel B has the following color values: alpha:255, red:76, green:203, blue:21
* Diff values: alpha:0, red:2, green:-2, blue:0
* absoluteColorDiff = 4</p>
*/
public var absoluteColorDiff:int;
public var alpha1:int;
public var alpha2:int;
public var alphaDiff:int;
public var alphaDiffAbs:int;
public var red1:int;
public var red2:int;
public var redDiff:int;
public var redDiffAbs:int;
public var green1:int;
public var green2:int;
public var greenDiff:int;
public var greenDiffAbs:int;
public var blue1:int;
public var blue2:int;
public var blueDiff:int;
public var blueDiffAbs:int;
}
} |
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.modules.phone.events
{
import flash.events.Event;
public class ConnectionStatusEvent extends Event
{
public static const SUCCESS:String = 'SUCCESS';
public static const FAILED:String = 'FAILED';
public static const CLOSED:String = 'CLOSED';
public static const REJECTED:String = 'REJECTED';
public static const UNKNOWN:String = 'UNKNOWN';
public static const CONNECTION_STATUS_EVENT:String = 'CONNECTION_STATUS_EVENT';
public var status:String = 'UNKNOWN';
public var reason:String = 'unknown';
public function ConnectionStatusEvent(bubbles:Boolean=false, cancelable:Boolean=false)
{
super(CONNECTION_STATUS_EVENT, bubbles, cancelable);
}
}
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.