CombinedText stringlengths 4 3.42M |
|---|
/*
Feathers
Copyright 2012-2014 Joshua Tynjala. 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 feathers.core
{
import feathers.core.FocusManager;
import feathers.events.FeathersEventType;
import flash.utils.Dictionary;
import starling.display.DisplayObject;
import starling.display.DisplayObjectContainer;
import starling.display.Quad;
import starling.display.Stage;
import starling.events.Event;
import starling.events.ResizeEvent;
/**
* The default <code>IPopUpManager</code> implementation.
*
* @see PopUpManager
*/
public class DefaultPopUpManager implements IPopUpManager
{
/**
* @copy PopUpManager#defaultOverlayFactory()
*/
public static function defaultOverlayFactory():DisplayObject
{
var quad:Quad = new Quad(100, 100, 0x000000);
quad.alpha = 0;
return quad;
}
/**
* Constructor.
*/
public function DefaultPopUpManager(root:DisplayObjectContainer = null)
{
this.root = root;
}
/**
* @private
*/
protected var _popUps:Vector.<DisplayObject> = new <DisplayObject>[];
/**
* @private
*/
protected var _popUpToOverlay:Dictionary = new Dictionary(true);
/**
* @private
*/
protected var _popUpToFocusManager:Dictionary = new Dictionary(true);
/**
* @private
*/
protected var _centeredPopUps:Vector.<DisplayObject> = new <DisplayObject>[];
/**
* @private
*/
protected var _overlayFactory:Function = defaultOverlayFactory;
/**
* @copy PopUpManager#overlayFactory
*/
public function get overlayFactory():Function
{
return this._overlayFactory;
}
/**
* @private
*/
public function set overlayFactory(value:Function):void
{
this._overlayFactory = value;
}
/**
* @private
*/
protected var _ignoreRemoval:Boolean = false;
/**
* @private
*/
protected var _root:DisplayObjectContainer;
/**
* @copy PopUpManager#root
*/
public function get root():DisplayObjectContainer
{
return this._root;
}
/**
* @private
*/
public function set root(value:DisplayObjectContainer):void
{
if(this._root == value)
{
return;
}
var popUpCount:int = this._popUps.length;
var oldIgnoreRemoval:Boolean = this._ignoreRemoval; //just in case
this._ignoreRemoval = true;
for(var i:int = 0; i < popUpCount; i++)
{
var popUp:DisplayObject = this._popUps[i];
var overlay:DisplayObject = DisplayObject(_popUpToOverlay[popUp]);
popUp.removeFromParent(false);
if(overlay)
{
overlay.removeFromParent(false);
}
}
this._ignoreRemoval = oldIgnoreRemoval;
this._root = value;
for(i = 0; i < popUpCount; i++)
{
popUp = this._popUps[i];
overlay = DisplayObject(_popUpToOverlay[popUp]);
if(overlay)
{
this._root.addChild(overlay);
}
this._root.addChild(popUp);
}
}
/**
* @copy PopUpManager#addPopUp()
*/
public function addPopUp(popUp:DisplayObject, isModal:Boolean = true, isCentered:Boolean = true, customOverlayFactory:Function = null):DisplayObject
{
if(isModal)
{
if(customOverlayFactory == null)
{
customOverlayFactory = this._overlayFactory;
}
if(customOverlayFactory == null)
{
customOverlayFactory = defaultOverlayFactory;
}
var overlay:DisplayObject = customOverlayFactory();
overlay.width = this._root.stage.stageWidth;
overlay.height = this._root.stage.stageHeight;
this._root.addChild(overlay);
this._popUpToOverlay[popUp] = overlay;
}
this._popUps.push(popUp);
this._root.addChild(popUp);
popUp.addEventListener(Event.REMOVED_FROM_STAGE, popUp_removedFromStageHandler);
if(this._popUps.length == 1)
{
this._root.stage.addEventListener(ResizeEvent.RESIZE, stage_resizeHandler);
}
if(isModal && FocusManager.isEnabled && popUp is DisplayObjectContainer)
{
this._popUpToFocusManager[popUp] = FocusManager.pushFocusManager(DisplayObjectContainer(popUp));
}
if(isCentered)
{
if(popUp is IFeathersControl)
{
popUp.addEventListener(FeathersEventType.RESIZE, popUp_resizeHandler);
}
this._centeredPopUps.push(popUp);
this.centerPopUp(popUp);
}
return popUp;
}
/**
* @copy PopUpManager#removePopUp()
*/
public function removePopUp(popUp:DisplayObject, dispose:Boolean = false):DisplayObject
{
var index:int = this._popUps.indexOf(popUp);
if(index < 0)
{
throw new ArgumentError("Display object is not a pop-up.");
}
popUp.removeFromParent(dispose);
return popUp;
}
/**
* @copy PopUpManager#isPopUp()
*/
public function isPopUp(popUp:DisplayObject):Boolean
{
return this._popUps.indexOf(popUp) >= 0;
}
/**
* @copy PopUpManager#isTopLevelPopUp()
*/
public function isTopLevelPopUp(popUp:DisplayObject):Boolean
{
var lastIndex:int = this._popUps.length - 1;
for(var i:int = lastIndex; i >= 0; i--)
{
var otherPopUp:DisplayObject = this._popUps[i];
if(otherPopUp == popUp)
{
//we haven't encountered an overlay yet, so it is top-level
return true;
}
var overlay:DisplayObject = this._popUpToOverlay[otherPopUp];
if(overlay)
{
//this is the first overlay, and we haven't found the pop-up
//yet, so it is not top-level
return false;
}
}
//pop-up was not found at all, so obviously, not top-level
return false;
}
/**
* @copy PopUpManager#centerPopUp()
*/
public function centerPopUp(popUp:DisplayObject):void
{
var stage:Stage = this._root.stage;
if(popUp is IValidating)
{
IValidating(popUp).validate();
}
popUp.x = Math.round((stage.stageWidth - popUp.width) / 2);
popUp.y = Math.round((stage.stageHeight - popUp.height) / 2);
}
/**
* @private
*/
protected function popUp_resizeHandler(event:Event):void
{
var popUp:DisplayObject = DisplayObject(event.currentTarget);
var index:int = this._centeredPopUps.indexOf(popUp);
if(index < 0)
{
return;
}
this.centerPopUp(popUp);
}
/**
* @private
*/
protected function popUp_removedFromStageHandler(event:Event):void
{
if(this._ignoreRemoval)
{
return;
}
var popUp:DisplayObject = DisplayObject(event.currentTarget);
popUp.removeEventListener(Event.REMOVED_FROM_STAGE, popUp_removedFromStageHandler);
var index:int = this._popUps.indexOf(popUp);
this._popUps.splice(index, 1);
var overlay:DisplayObject = DisplayObject(this._popUpToOverlay[popUp]);
if(overlay)
{
overlay.removeFromParent(true);
delete _popUpToOverlay[popUp];
}
var focusManager:IFocusManager = this._popUpToFocusManager[popUp];
if(focusManager)
{
delete this._popUpToFocusManager[popUp];
FocusManager.removeFocusManager(focusManager);
}
index = this._centeredPopUps.indexOf(popUp);
if(index >= 0)
{
if(popUp is IFeathersControl)
{
popUp.removeEventListener(FeathersEventType.RESIZE, popUp_resizeHandler);
}
this._centeredPopUps.splice(index, 1);
}
if(_popUps.length == 0)
{
this._root.stage.removeEventListener(ResizeEvent.RESIZE, stage_resizeHandler);
}
}
/**
* @private
*/
protected function stage_resizeHandler(event:ResizeEvent):void
{
var stage:Stage = this._root.stage;
var popUpCount:int = this._popUps.length;
for(var i:int = 0; i < popUpCount; i++)
{
var popUp:DisplayObject = this._popUps[i];
var overlay:DisplayObject = DisplayObject(this._popUpToOverlay[popUp]);
if(overlay)
{
overlay.width = stage.stageWidth;
overlay.height = stage.stageHeight;
}
}
popUpCount = this._centeredPopUps.length;
for(i = 0; i < popUpCount; i++)
{
popUp = this._centeredPopUps[i];
centerPopUp(popUp);
}
}
}
}
|
// =================================================================================================
//
// 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.utils
{
import flash.geom.Matrix;
import flash.geom.Point;
/** Uses a matrix to transform 2D coordinates into a different space. If you pass a
* 'resultPoint', the result will be stored in this point instead of creating a new object.*/
public function transformCoords(matrix:Matrix, x:Number, y:Number,
resultPoint:Point=null):Point
{
if (!deprecationNotified)
{
deprecationNotified = true;
trace("[Starling] The method 'transformCoords' is deprecated. " +
"Please use 'MatrixUtil.transformCoords' instead.");
}
if (resultPoint == null) resultPoint = new Point();
resultPoint.x = matrix.a * x + matrix.c * y + matrix.tx;
resultPoint.y = matrix.d * y + matrix.b * x + matrix.ty;
return resultPoint;
}
}
var deprecationNotified:Boolean = false; |
package utils.ratio {
import flash.geom.Rectangle;
/**
* Resizes an area to fill the bounding area while preserving aspect ratio.
* @param rect Area's width and height expressed as a Rectangle - the Rectangle's x and y values are ignored
* @param bounds Area to fill - the Rectangle's x and y values are ignored
* @param snapToPixel true to force the scale to whole pixels, or false to allow sub-pixels
* @author Aaron Clinger
* @author Shane McCartney
* @author David Nelson
*/
public function scaleToFill(rect:Rectangle, bounds:Rectangle, snapToPixel:Boolean = true):Rectangle {
var scaled:Rectangle = scaleHeight(rect, bounds.width, snapToPixel);
if(scaled.height < bounds.height) scaled = scaleWidth(rect, bounds.height, snapToPixel);
return scaled;
}
}
|
package com.tomseysdavies.ember.entitySystem.impl
{
import com.tomseysdavies.ember.entitySystem.api.ISystem;
import com.tomseysdavies.ember.entitySystem.api.ISystems;
import flash.utils.Dictionary;
import org.swiftsuspenders.Injector;
final public class Systems implements ISystems
{
private var _injector:Injector;
private var _systems:Dictionary;
public function Systems(injector:Injector)
{
_injector = injector;
_systems = new Dictionary();
}
public function add(systemClass:Class):ISystem
{
var system:ISystem = _systems[systemClass] as ISystem;
if (system) throw new Error("System "+ systemClass +"already registered");
system = new systemClass();
_injector.injectInto(system);
_systems[systemClass] = system;
system.initialize();
return system;
}
public function has(systemClass:Class):Boolean
{
return _systems[systemClass] != null;
}
public function get(systemClass:Class):ISystem
{
return _systems[systemClass];
}
public function remove(systemClass:Class):Boolean
{
var system:ISystem = _systems[systemClass] as ISystem;
if (!system)
return false;
delete _systems[systemClass];
system.destroy();
return true;
}
}
}
|
/**
* Copyright (c) 2007 Moses Gunesch
*
* 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.goasap.items {
import org.goasap.GoEngine;
import org.goasap.PlayableBase;
import org.goasap.interfaces.IUpdatable;
/**
* Abstract base animation class for other base classes like LinearGo and PhysicsGo.
*
* <p>This class extends PlayableBase to add features common to any animation item,
* either linear or physics (LinearGo and PhysicsGo both extend this class).
* Animation items add themselves to GoEngine to run on a pulse, so the IUpdatable
* interface is implemented here, although update() needs to be subclassed.</p>
*
* <p>Animation items should individually implement the standard <code>useRounding</code>
* and <code>useRelative</code> options. Three user-accessible class default settings
* are provided for those and <code>pulseInterval</code>, while play-state constants
* live in the superclass PlayableBase.</p>
*
* @author Moses Gunesch
*/
public class GoItem extends PlayableBase implements IUpdatable
{
// -== Settable Class Defaults ==-
/**
* Class default for the instance property <code>pulseInterval</code>.
*
* <p>GoEngine.ENTER_FRAME seems to run the smoothest in real-world contexts.
* The open-source TweenBencher utility shows that timer-based framerates like
* 33 milliseconds can perform best for thousands of simultaneous animations,
* but in practical contexts timer-based animations tend to stutter.</p>
*
* @default GoEngine.ENTER_FRAME
* @see #pulseInterval
*/
public static var defaultPulseInterval : Number = GoEngine.ENTER_FRAME;
/**
* Class default for the instance property <code>useRounding</code>.
* @default false
* @see #useRounding
*/
public static var defaultUseRounding : Boolean = false;
/**
* Class default for the instance property <code>useRelative</code>.
* @default false
* @see #useRelative
*/
public static var defaultUseRelative : Boolean = false;
/**
* Alters the play speed for instances of any subclass that factors
* this value into its calculations, such as LinearGo.
*
* <p>A setting of 2 should result in half-speed animations, while a setting
* of .5 should double animation speed. Note that changing this property at
* runtime does not usually affect already-playing items.</p>
*
* <p>This property is a Go convention, and all subclasses of GoItem (on the
* LinearGo base class level, but not on the item level extending LinearGo)
* need to implement it individually.</p>
* @default 1
*/
public static var timeMultiplier : Number = 1;
// -== Public Properties ==-
/**
* Required by IUpdatable: Defines the pulse on which <code>update</code> is called.
*
* <p>
* Can be a number of milliseconds for Timer-based updates or
* <code>GoEngine.ENTER_FRAME</code> (-1) for updates synced to the
* Flash Player's framerate. If not set manually, the class
* default <code>defaultPulseInterval</code> is adopted.
* </p>
*
* @see #defaultPulseInterval
* @see org.goasap.GoEngine#ENTER_FRAME GoEngine.ENTER_FRAME
*/
public function get pulseInterval() : int {
return _pulse;
}
public function set pulseInterval(interval:int) : void {
if (_state==STOPPED && (interval >= 0 || interval==GoEngine.ENTER_FRAME)) {
_pulse = interval;
}
}
/**
* CONVENTION ALERT: <i>This property is considered a Go convention, and subclasses must
* implement it individually by calling the correctValue() method on all calculated values
* before applying them to targets.</i>
*
* <p>The correctValue method fixes NaN's as 0 and applies Math.round if useRounding is active.</p>
*
* @see correctValue()
* @see LinearGo#onUpdate()
*/
public var useRounding : Boolean = defaultUseRounding;
/**
* CONVENTION ALERT: <i>This property is considered a Go convention, and subclasses must implement
* it individually.</i> Indicates that values should be treated as relative instead of absolute.
*
* <p>When true, user-set values should be calculated as
* relative to their existing value ("from" vs. "to"), when possible.
* See an example in the documentation for <code>LinearGo.start</code>.
* </p>
* <p>
* Items that handle more than one property at once, such as a bezier
* curve, might want to implement a useRelative option for each property
* instead of using this overall item property, which is included here
* to define a convention for standard single-property items.
* </p>
*
* @see #defaultUseRelative
*/
public var useRelative : Boolean = defaultUseRelative;
// -== Protected Properties ==-
/**
* @private
*/
protected var _pulse : int = defaultPulseInterval;
// -== Public Methods ==-
/**
* Constructor.
*/
public function GoItem() {
super();
}
/**
* IMPORTANT: <i>Subclasses need to implement this functionality
* individually</i>. When updating animation targets, always call
* <code>correctValue</code> on results first. This corrects any
* NaN's to 0 and applies Math.round if <code>useRounding</code>
* is active.
*
* <p>For example, a LinearGo <code>onUpdate</code> method might contain:</p>
* <pre>
* target[ prop ] = correctValue(start + (change * _position));
* </pre>
*
* @see #useRounding
* @see #defaultUseRounding
*/
public function correctValue(value:Number):Number
{
if (isNaN(value))
return 0;
if (useRounding) // thanks John Grden
return value = ((value%1==0)
? value
: ((value%1>=.5)
? int(value)+1
: int(value)));
return value;
}
/**
* Required by IUpdatable: Perform updates on a pulse.
*
* <p>The <i>currentTime</i> parameter enables tight visual syncing of groups of items.
* To ensure the tightest possible synchronization, do not set any internal start-time
* vars in the item until the first update() call is received, then set to the currentTime
* provided by GoEngine. This ensures that groups of items added in a for-loop all have the
* exact same start times, which may otherwise differ by a few milliseconds.</p>
*
* @param currentTime A clock time that should be used instead of getTimer
* to store any start-time vars on the first update call
* and for performing update calculations. The value is usually
* no more than a few milliseconds different than getTimer,
* but using it tightly syncs item groups visually.
*/
public function update(currentTime : Number) : void {
// override this method.
}
}
}
|
/*
* Copyright 2010-2011 Research In Motion Limited.
*
* 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 blackberry.media.camera
{
import flash.events.ErrorEvent;
import flash.events.Event;
import flash.events.MediaEvent;
import flash.filesystem.File;
import flash.media.CameraUI;
import flash.media.MediaPromise;
import flash.media.MediaType;
import flash.net.URLRequest;
import flash.net.navigateToURL;
import json.JSON;
import webworks.extension.DefaultExtension;
public class Camera extends DefaultExtension
{
private var PHOTO:String = "photo";
private var VIDEO:String = "video"
private var _jsOnCapturedId:String = "";
private var _jsOnCameraClosedId:String = "";
private var _jsOnErrorId:String = "";
public function Camera()
{
}
override public function getFeatureList():Array
{
return new Array("blackberry.media.camera");
}
public function invokeCamera(cameraMode:String, onCapturedId:String, onCameraClosedId:String, onErrorId:String):void
{
_jsOnCapturedId = onCapturedId;
_jsOnCameraClosedId = onCameraClosedId;
_jsOnErrorId = onErrorId;
var defaultDeviceCamera:CameraUI = new CameraUI();
defaultDeviceCamera.addEventListener(MediaEvent.COMPLETE, onCaptured);
defaultDeviceCamera.addEventListener(Event.CANCEL, onCameraClosed);
defaultDeviceCamera.addEventListener(ErrorEvent.ERROR, onError);
if (cameraMode == PHOTO)
{
defaultDeviceCamera.launch(MediaType.IMAGE);
}
else
{
defaultDeviceCamera.launch(MediaType.VIDEO);
}
}
public function takePicture(onCapturedId:String, onCameraClosedId:String, onErrorId:String):void
{
invokeCamera(PHOTO, onCapturedId, onCameraClosedId, onErrorId);
}
public function takeVideo(onCapturedId:String, onCameraClosedId:String, onErrorId:String):void
{
invokeCamera(VIDEO, onCapturedId, onCameraClosedId, onErrorId);
}
private function onCaptured(event:MediaEvent):void
{
var mediaPromise:MediaPromise = event.data;
var path:String = mediaPromise.relativePath;
var shared:File = File.userDirectory.resolvePath("shared");
var fileList:Array = shared.getDirectoryListing();
var filePath:String = mediaPromise.relativePath;
for (var i:uint = 0; i < fileList.length; i++)
{
var file:File = fileList[i] as File;
if (file.isDirectory)
{
if (file.name == "camera")
{
filePath = file.url + "/" + mediaPromise.relativePath;
}
}
}
this.evalJavaScriptEvent(_jsOnCapturedId, [filePath]);
// After saving the file, camera doens't fire closed camera event, this is why it called manually.
onCameraClosed(null);
}
private function onCameraClosed(event:Event):void
{
this.evalJavaScriptEvent(_jsOnCameraClosedId, []);
}
private function onError(error:ErrorEvent):void
{
this.evalJavaScriptEvent(_jsOnErrorId, []);
}
}
} |
package core
{
import flash.events.Event;
import flash.text.StyleSheet;
import model.Assets;
import model.Config;
import model.vo.ContentVO
import model.states.AppState;
import net.eriksjodin.arduino.Arduino;
import util.ArduinoSocket;
import view.Debug;
import view.UI;
/**
*
* @author Nina Pavlich
*
* @overview
*
* Everything is static in the Locator; creates static States, VOs, Config, Assets
* Used for globally referenced things
*
* States
* Config
* Assets
* Data
*/
public class Locator
{
protected static var _appState:AppState;
public static function get appState():AppState { return _appState }
protected static var _uiController:UIController;
public static function get uiController():UIController{return _uiController}
protected static var _content:ContentVO;
public static function get content():ContentVO { return _content }
protected static var _config:Config;
public static function get config():Config { return _config }
protected static var _assets:Assets;
public static function get assets():Assets { return _assets }
protected static var _styles:StyleSheet;
public static function get styles():StyleSheet { return _styles }
public static function set styles(inStyle:StyleSheet):void { _styles = inStyle }
protected static var _ui:UI;
public static function get ui():UI { return _ui }
public static function set ui(inui:UI):void{_ui = inui}
protected static var _debug:Debug;
public static function get debug():Debug{return _debug}
public static function set debug(inD:Debug):void{_debug = inD}
protected static var _arduino:ArduinoSocket;
public static function get arduino():ArduinoSocket{return _arduino}
public static function init():void
{
_appState = new AppState();
_content = new ContentVO();
_config = new Config();
_uiController = new UIController()
_assets = new Assets();
_arduino = new ArduinoSocket();
}
}
}
|
package com.ankamagames.jerakine.messages.events
{
import com.ankamagames.jerakine.messages.Frame;
import flash.events.Event;
public class FramePulledEvent extends Event
{
public static const EVENT_FRAME_PULLED:String = "event_frame_pulled";
private var _frame:Frame;
public function FramePulledEvent(frame:Frame)
{
super(EVENT_FRAME_PULLED,false,false);
this._frame = frame;
}
public function get frame() : Frame
{
return this._frame;
}
}
}
|
package dragonBones.errors
{
/**
* Copyright 2012-2013. DragonBones. All Rights Reserved.
* @playerversion Flash 10.0, Flash 10
* @langversion 3.0
* @version 2.0
*/
/**
* Thrown when dragonBones encounters an unknow error.
*/
public final class UnknownDataError extends Error
{
public function UnknownDataError(message:* = "", id:* = 0)
{
super(message, id);
}
}
} |
////////////////////////////////////////////////////////////////////////////////
//
// ADOBE SYSTEMS INCORPORATED
// Copyright 2005-2007 Adobe Systems Incorporated
// All Rights Reserved.
//
// NOTICE: Adobe permits you to use, modify, and distribute this file
// in accordance with the terms of the license agreement accompanying it.
//
////////////////////////////////////////////////////////////////////////////////
package mx.controls.dataGridClasses
{
import flash.display.DisplayObject;
import flash.geom.Point;
import flash.geom.Rectangle;
import flash.utils.getDefinitionByName;
import flash.utils.getQualifiedClassName;
import flash.utils.getQualifiedSuperclassName;
import mx.controls.DataGrid;
import mx.controls.listClasses.BaseListData;
import mx.controls.listClasses.IDropInListItemRenderer;
import mx.controls.listClasses.IListItemRenderer;
import mx.core.IDataRenderer;
import mx.core.IFlexDisplayObject;
import mx.core.IToolTip;
import mx.core.UIComponent;
import mx.core.UIComponentGlobals;
import mx.core.UITextField;
import mx.core.mx_internal;
import mx.events.FlexEvent;
import mx.events.InterManagerRequest;
import mx.events.ToolTipEvent;
import mx.managers.ILayoutManagerClient;
import mx.managers.ISystemManager;
import mx.styles.CSSStyleDeclaration;
import mx.styles.IStyleClient;
import mx.styles.StyleProtoChain;
import mx.utils.PopUpUtil;
use namespace mx_internal;
/**
* Dispatched when the <code>data</code> property changes.
*
* <p>When you use a component as an item renderer,
* the <code>data</code> property contains the data to display.
* You can listen for this event and update the component
* when the <code>data</code> property changes.</p>
*
* @eventType mx.events.FlexEvent.DATA_CHANGE
*
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
* @productversion Flex 3
*/
[Event(name="dataChange", type="mx.events.FlexEvent")]
/**
* The DataGridItemRenderer class defines the default item renderer for a DataGrid control.
* By default, the item renderer
* draws the text associated with each item in the grid.
*
* <p>You can override the default item renderer by creating a custom item renderer.</p>
*
* @see mx.controls.DataGrid
* @see mx.core.IDataRenderer
* @see mx.controls.listClasses.IDropInListItemRenderer
*
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
* @productversion Flex 3
*/
public class DataGridItemRenderer extends UITextField
implements IDataRenderer,
IDropInListItemRenderer, ILayoutManagerClient,
IListItemRenderer, IStyleClient
{
include "../../core/Version.as";
//--------------------------------------------------------------------------
//
// Constructor
//
//--------------------------------------------------------------------------
/**
* Constructor.
*
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
* @productversion Flex 3
*/
public function DataGridItemRenderer()
{
super();
tabEnabled = false;
mouseWheelEnabled = false;
ignorePadding = false;
addEventListener(ToolTipEvent.TOOL_TIP_SHOW, toolTipShowHandler);
inheritingStyles = nonInheritingStyles =
StyleProtoChain.STYLE_UNINITIALIZED;
}
//--------------------------------------------------------------------------
//
// Variables
//
//--------------------------------------------------------------------------
/**
* @private
*/
private var invalidatePropertiesFlag:Boolean = false;
/**
* @private
*/
private var invalidateSizeFlag:Boolean = false;
//--------------------------------------------------------------------------
//
// Overridden properties: UIComponent
//
//--------------------------------------------------------------------------
//----------------------------------
// nestLevel
//----------------------------------
/**
* @private
*/
override public function set nestLevel(value:int):void
{
super.nestLevel = value;
UIComponentGlobals.layoutManager.invalidateProperties(this);
invalidatePropertiesFlag = true;
UIComponentGlobals.layoutManager.invalidateSize(this);
invalidateSizeFlag = true;
}
//--------------------------------------------------------------------------
//
// Properties
//
//--------------------------------------------------------------------------
//----------------------------------
// data
//----------------------------------
/**
* @private
*/
private var _data:Object;
[Bindable("dataChange")]
/**
* The implementation of the <code>data</code> property as
* defined by the IDataRenderer interface.
*
* The value is ignored. Only the listData property is used.
* @see mx.core.IDataRenderer
*
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
* @productversion Flex 3
*/
public function get data():Object
{
return _data;
}
/**
* @private
*/
public function set data(value:Object):void
{
_data = value;
dispatchEvent(new FlexEvent(FlexEvent.DATA_CHANGE));
}
//----------------------------------
// listData
//----------------------------------
/**
* @private
*/
private var _listData:DataGridListData;
[Bindable("dataChange")]
/**
* The implementation of the <code>listData</code> property as
* defined by the IDropInListItemRenderer interface.
* The text of the renderer is set to the <code>label</code>
* property of the listData.
*
* @see mx.controls.listClasses.IDropInListItemRenderer
*
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
* @productversion Flex 3
*/
public function get listData():BaseListData
{
return _listData;
}
/**
* @private
*/
public function set listData(value:BaseListData):void
{
_listData = DataGridListData(value);
if (nestLevel && !invalidatePropertiesFlag)
{
UIComponentGlobals.layoutManager.invalidateProperties(this);
invalidatePropertiesFlag = true;
UIComponentGlobals.layoutManager.invalidateSize(this);
invalidateSizeFlag = true;
}
}
//----------------------------------
// styleDeclaration
//----------------------------------
/**
* @private
* Storage for the styleDeclaration property.
*/
private var _styleDeclaration:CSSStyleDeclaration;
/**
* Storage for the inline inheriting styles on this object.
* This CSSStyleDeclaration is created the first time that setStyle()
* is called on this component to set an inheriting style.
*
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
* @productversion Flex 3
*/
public function get styleDeclaration():CSSStyleDeclaration
{
return _styleDeclaration;
}
/**
* @private
*/
public function set styleDeclaration(value:CSSStyleDeclaration):void
{
_styleDeclaration = value;
}
//--------------------------------------------------------------------------
//
// Overridden methods: UITextField
//
//--------------------------------------------------------------------------
/**
* @private
*/
override public function initialize():void
{
regenerateStyleCache(false)
}
/**
* @private
*/
override public function validateNow():void
{
if (data && parent)
{
var newColor:Number;
if (DataGridBase(_listData.owner).isItemHighlighted(_listData.uid))
{
newColor = getStyle("textRollOverColor");
}
else if (DataGridBase(_listData.owner).isItemSelected(_listData.uid))
{
newColor = getStyle("textSelectedColor");
}
else
{
newColor = getStyle("color");
}
if (newColor != explicitColor)
{
styleChangedFlag = true;
explicitColor = newColor;
invalidateDisplayList();
}
}
super.validateNow();
}
/**
* @copy mx.core.UIComponent#getStyle()
*
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
* @productversion Flex 3
*/
override public function getStyle(styleProp:String):*
{
return (styleManager.inheritingStyles[styleProp]) ?
inheritingStyles[styleProp] : nonInheritingStyles[styleProp];
}
/**
* @copy mx.core.UIComponent#setStyle()
*
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
* @productversion Flex 3
*/
override public function setStyle(styleProp:String, newValue:*):void
{
if (styleProp == "styleName")
{
// Let the setter handle this one, see UIComponent.
styleName = newValue;
// Short circuit, because styleName isn't really a style.
return;
}
/*
if (styleProp == "themeColor")
{
// setThemeColor handles the side effects.
setThemeColor(newValue);
// Do not short circuit, because themeColor is a style.
// It just has side effects, too.
}
*/
// If this UIComponent didn't previously have any inline styles,
// then regenerate the UIComponent's proto chain (and the proto chains
// of this UIComponent's descendants).
var isInheritingStyle:Boolean =
styleManager.isInheritingStyle(styleProp);
var isProtoChainInitialized:Boolean =
inheritingStyles != StyleProtoChain.STYLE_UNINITIALIZED;
if (isInheritingStyle)
{
if (getStyle(styleProp) == newValue && isProtoChainInitialized)
return;
if (!styleDeclaration)
{
styleDeclaration = new CSSStyleDeclaration(null, styleManager);
styleDeclaration.setLocalStyle(styleProp, newValue);
// If inheritingStyles is undefined, then this object is being
// initialized and we haven't yet generated the proto chain. To
// avoid redundant work, don't bother to create the proto chain here.
if (isProtoChainInitialized)
regenerateStyleCache(true);
}
else
{
styleDeclaration.setLocalStyle(styleProp, newValue);
}
}
else
{
if (getStyle(styleProp) == newValue && isProtoChainInitialized)
return;
if (!styleDeclaration)
{
styleDeclaration = new CSSStyleDeclaration(null, styleManager);
styleDeclaration.setLocalStyle(styleProp, newValue);
// If nonInheritingStyles is undefined, then this object is being
// initialized and we haven't yet generated the proto chain. To
// avoid redundant work, don't bother to create the proto chain here.
if (isProtoChainInitialized)
regenerateStyleCache(false);
}
else
{
styleDeclaration.setLocalStyle(styleProp, newValue);
}
}
if (isProtoChainInitialized)
{
styleChanged(styleProp);
notifyStyleChangeInChildren(styleProp, isInheritingStyle);
}
}
//--------------------------------------------------------------------------
//
// Methods
//
//--------------------------------------------------------------------------
/**
* If Flex calls the <code>LayoutManager.invalidateProperties()</code>
* method on this ILayoutManagerClient, then
* this function is called when it's time to commit property values.
*
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
* @productversion Flex 3
*/
public function validateProperties():void
{
invalidatePropertiesFlag = false;
if (_listData)
{
var dg:DataGrid = DataGrid(_listData.owner);
var column:DataGridColumn =
dg.columns[_listData.columnIndex];
text = _listData.label;
if (_data is DataGridColumn)
wordWrap = dg.columnHeaderWordWrap(column);
else
wordWrap = dg.columnWordWrap(column);
if (DataGrid(_listData.owner).variableRowHeight)
multiline = true;
var dataTips:Boolean = dg.showDataTips;
if (column.showDataTips == true)
dataTips = true;
if (column.showDataTips == false)
dataTips = false;
if (dataTips)
{
if (!(_data is DataGridColumn) && (textWidth > width
|| column.dataTipFunction || column.dataTipField
|| dg.dataTipFunction || dg.dataTipField))
{
toolTip = column.itemToDataTip(_data);
}
else
{
toolTip = null;
}
}
else
{
toolTip = null;
}
}
else
{
text = " ";
toolTip = null;
}
}
/**
* If Flex calls the <code>LayoutManager.invalidateSize()</code>
* method on this ILayoutManagerClient, then
* this function is called when it's time to do measurements.
*
* @param recursive If <code>true</code>, call this method
* on the object's children.
*
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
* @productversion Flex 3
*/
public function validateSize(recursive:Boolean = false):void
{
invalidateSizeFlag = false;
validateNow();
}
/**
* If Flex calls <code>LayoutManager.invalidateDisplayList()</code>
* method on this ILayoutManagerClient, then
* this function is called when it's time to update the display list.
*
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
* @productversion Flex 3
*/
public function validateDisplayList():void
{
validateNow();
}
/**
* @copy mx.core.UIComponent#clearStyle()
*
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
* @productversion Flex 3
*/
public function clearStyle(styleProp:String):void
{
setStyle(styleProp, undefined);
}
/**
* @inheritDoc
*
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
* @productversion Flex 3
*/
public function notifyStyleChangeInChildren(
styleProp:String, recursive:Boolean):void
{
}
/**
* Sets up the <code>inheritingStyles</code>
* and <code>nonInheritingStyles</code> objects
* and their proto chains so that the <code>getStyle()</code> method can work.
*
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
* @productversion Flex 3
*/
public function initProtoChain():void
{
styleChangedFlag = true;
var classSelectors:Array = [];
if (styleName)
{
if (styleName is CSSStyleDeclaration)
{
// Get the style sheet referenced by the styleName property
classSelectors.push(CSSStyleDeclaration(styleName));
}
else if (styleName is IFlexDisplayObject)
{
// If the styleName property is a UIComponent, then there's a
// special search path for that case.
StyleProtoChain.initProtoChainForUIComponentStyleName(this);
return;
}
else if (styleName is String)
{
// Get the style sheet referenced by the styleName property
var styleNames:Array = styleName.split(/\s+/);
for (var c:int=0; c < styleNames.length; c++)
{
if (styleNames[c].length) {
classSelectors.push(styleManager.getMergedStyleDeclaration("." +
styleNames[c]));
}
}
}
}
// To build the proto chain, we start at the end and work forward.
// Referring to the list at the top of this function, we'll start by
// getting the tail of the proto chain, which is:
// - for non-inheriting styles, the global style sheet
// - for inheriting styles, my parent's style object
var nonInheritChain:Object = styleManager.stylesRoot;
var p:IStyleClient = parent as IStyleClient;
if (p)
{
var inheritChain:Object = p.inheritingStyles;
if (inheritChain == StyleProtoChain.STYLE_UNINITIALIZED)
inheritChain = nonInheritChain;
}
else
{
inheritChain = styleManager.stylesRoot;
}
// Working backwards up the list, the next element in the
// search path is the type selector
var typeSelectors:Array = getClassStyleDeclarations();
var n:int = typeSelectors.length;
for (var i:int = 0; i < n; i++)
{
var typeSelector:CSSStyleDeclaration = typeSelectors[i];
inheritChain = typeSelector.addStyleToProtoChain(inheritChain, this);
nonInheritChain = typeSelector.addStyleToProtoChain(nonInheritChain, this);
}
// Next are the class selectors
for (i = 0; i < classSelectors.length; i++)
{
var classSelector:CSSStyleDeclaration = classSelectors[i];
if (classSelector)
{
inheritChain = classSelector.addStyleToProtoChain(inheritChain, this);
nonInheritChain = classSelector.addStyleToProtoChain(nonInheritChain, this);
}
}
// Finally, we'll add the in-line styles
// to the head of the proto chain.
inheritingStyles = styleDeclaration ?
styleDeclaration.addStyleToProtoChain(inheritChain, this) :
inheritChain;
nonInheritingStyles = styleDeclaration ?
styleDeclaration.addStyleToProtoChain(nonInheritChain, this) :
nonInheritChain;
}
/**
* @inheritDoc
*
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
* @productversion Flex 3
*/
public function regenerateStyleCache(recursive:Boolean):void
{
initProtoChain();
}
/**
* @inheritDoc
*
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
* @productversion Flex 3
*/
public function registerEffects(effects:Array /* of String */):void
{
}
/**
* @inheritDoc
*
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
* @productversion Flex 3
*/
public function getClassStyleDeclarations():Array
{
var className:String = getQualifiedClassName(this)
className = className.replace("::", ".");
var decls:Array = [];
while (className != null &&
className != "mx.core.UIComponent" &&
className != "mx.core.UITextField")
{
var s:CSSStyleDeclaration =
styleManager.getMergedStyleDeclaration(className);
if (s)
{
decls.unshift(s);
}
try
{
className = getQualifiedSuperclassName(getDefinitionByName(className));
className = className.replace("::", ".");
}
catch(e:ReferenceError)
{
className = null;
}
}
return decls;
}
//--------------------------------------------------------------------------
//
// Event handlers
//
//--------------------------------------------------------------------------
/**
* The event handler to position the tooltip.
*
* @param event The event object.
*
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
* @productversion Flex 3
*/
protected function toolTipShowHandler(event:ToolTipEvent):void
{
var toolTip:IToolTip = event.toolTip;
// We need to position the tooltip at same x coordinate,
// center vertically and make sure it doesn't overlap the screen.
// Call the helper function to handle this for us.
var pt:Point = PopUpUtil.positionOverComponent(this,
systemManager,
toolTip.width,
toolTip.height,
height / 2);
toolTip.move(pt.x, pt.y);
}
}
}
|
package com.ankamagames.dofus.logic.game.common.actions
{
import com.ankamagames.berilia.Berilia;
import com.ankamagames.dofus.misc.utils.AbstractAction;
import com.ankamagames.jerakine.handlers.messages.Action;
import flash.utils.Dictionary;
public class ToggleShowUIAction extends AbstractAction implements Action
{
private var _beriliaInstance:Berilia;
public function ToggleShowUIAction(params:Array = null)
{
super(params);
}
public static function create() : ToggleShowUIAction
{
return new ToggleShowUIAction(arguments);
}
public function toggleUIs() : void
{
this._beriliaInstance = Berilia.getInstance();
if(Berilia.getInstance().hidenActiveUIs.length > 0)
{
this.unhide();
}
else
{
this.hide();
}
}
public function unhide() : void
{
var uiList:Dictionary = null;
var pop:String = null;
uiList = Berilia.getInstance().uiList;
while(Berilia.getInstance().hidenActiveUIs.length > 0)
{
pop = Berilia.getInstance().hidenActiveUIs.pop();
if(uiList[pop])
{
if(uiList[pop].uiClass.hasOwnProperty("visible"))
{
try
{
uiList[pop].uiClass.visible = true;
}
catch(e:ReferenceError)
{
uiList[pop].visible = true;
}
}
else
{
uiList[pop].visible = true;
}
}
}
}
private function hide() : void
{
var name:* = undefined;
var uiList:Dictionary = Berilia.getInstance().uiList;
for(name in uiList)
{
if((name as String).indexOf("tooltip_entity") == -1)
{
if((name as String).indexOf("gameMenu") == -1)
{
if((name as String).indexOf("mapInfo") == -1)
{
if((name as String).indexOf("cartography") == -1)
{
if(uiList[name].visible)
{
uiList[name].visible = false;
Berilia.getInstance().hidenActiveUIs.push(name);
}
}
}
}
}
}
}
}
}
|
package kabam.rotmg.messaging.impl.outgoing {
import flash.utils.IDataOutput;
public class SquareHit extends OutgoingMessage {
public var time_:int;
public var bulletId_:uint;
public var objectId_:int;
public function SquareHit(_arg_1:uint, _arg_2:Function) {
super(_arg_1, _arg_2);
}
override public function writeToOutput(_arg_1:IDataOutput):void {
_arg_1.writeInt(this.time_);
_arg_1.writeByte(this.bulletId_);
_arg_1.writeInt(this.objectId_);
}
override public function toString():String {
return (formatToString("SQUAREHIT", "time_", "bulletId_", "objectId_"));
}
}
}//package kabam.rotmg.messaging.impl.outgoing
|
package com.company.assembleegameclient.objects.particles {
import com.company.assembleegameclient.objects.GameObject;
import flash.geom.Point;
public class NovaEffect extends ParticleEffect {
public var start_:Point;
public var novaRadius_:Number;
public var color_:int;
public function NovaEffect(param1:GameObject, param2:Number, param3:int) {
super();
this.start_ = new Point(param1.x_,param1.y_);
this.novaRadius_ = param2;
this.color_ = param3;
}
override public function runNormalRendering(param1:int, param2:int) : Boolean {
var _local5:Number = NaN;
var _local8:Point = null;
var _local9:Particle = null;
x_ = this.start_.x;
y_ = this.start_.y;
var _local3:int = 200;
var _local6:int = 200;
var _local7:int = 4 + this.novaRadius_ * 2;
var _local4:int = 0;
while(_local4 < _local7) {
_local5 = _local4 * 6.28318530717959 / _local7;
_local8 = new Point(this.start_.x + this.novaRadius_ * Math.cos(_local5),this.start_.y + this.novaRadius_ * Math.sin(_local5));
_local9 = new SparkerParticle(_local3,this.color_,_local6,this.start_,_local8);
map_.addObj(_local9,x_,y_);
_local4++;
}
return false;
}
override public function runEasyRendering(param1:int, param2:int) : Boolean {
var _local5:Number = NaN;
var _local8:Point = null;
var _local9:Particle = null;
x_ = this.start_.x;
y_ = this.start_.y;
var _local3:int = 10;
var _local6:int = 200;
var _local7:int = this.novaRadius_ * 2;
var _local4:int = 0;
while(_local4 < _local7) {
_local5 = _local4 * 6.28318530717959 / _local7;
_local8 = new Point(this.start_.x + this.novaRadius_ * Math.cos(_local5),this.start_.y + this.novaRadius_ * Math.sin(_local5));
_local9 = new SparkerParticle(_local3,this.color_,_local6,this.start_,_local8);
map_.addObj(_local9,x_,y_);
_local4++;
}
return false;
}
}
}
|
package com.company.assembleegameclient.util {
import flash.display.DisplayObject;
public class DisplayHierarchy {
public function DisplayHierarchy() {
super();
}
public static function getParentWithType(param1:DisplayObject, param2:Class) : DisplayObject {
while(param1 && !(param1 is param2)) {
param1 = param1.parent;
}
return param1;
}
public static function getParentWithTypeArray(param1:DisplayObject, ... rest) : DisplayObject {
var _loc5_:int = 0;
var _loc4_:* = undefined;
var _loc3_:* = null;
while(param1) {
_loc5_ = 0;
_loc4_ = rest;
var _loc7_:int = 0;
var _loc6_:* = rest;
for each(_loc3_ in rest) {
if(param1 is _loc3_) {
return param1;
}
}
param1 = param1.parent;
}
return param1;
}
}
}
|
package com.playata.application.ui.elements.citymap
{
import com.greensock.easing.Back;
import com.playata.application.data.GameUtil;
import com.playata.application.data.user.User;
import com.playata.application.ui.elements.citymap.animations.ICitymapButtonClouds;
import com.playata.application.ui.elements.generic.textfield.UiTextTooltip;
import com.playata.application.ui.panels.PanelCitymap;
import com.playata.framework.application.Environment;
import com.playata.framework.display.IDisplayObjectContainer;
import com.playata.framework.display.InteractiveDisplayObject;
import com.playata.framework.input.InteractionEvent;
import com.playata.framework.localization.LocText;
public class UiCitymapButton
{
private var _button:IDisplayObjectContainer;
private var _clouds:ICitymapButtonClouds;
private var _stage:int;
private var _onClick:Function;
private var _locked:Boolean = true;
private var _clickArea:InteractiveDisplayObject;
private var _tooltip:UiTextTooltip;
private var _isCustomStage:Boolean;
public function UiCitymapButton(param1:IDisplayObjectContainer, param2:ICitymapButtonClouds, param3:int, param4:Function, param5:Boolean = false)
{
super();
_button = param1;
_clouds = param2;
_stage = param3;
_onClick = param4;
_isCustomStage = param5;
_clickArea = new InteractiveDisplayObject(param1.getChildByName("clickArea"));
_tooltip = new UiTextTooltip(_clickArea,LocText.current.text("screen/citymap/button_tooltip_locked",GameUtil.getQuestStageUnlockLevel(_stage),LocText.current.text("dialog/stage_unlocked/stage" + _stage + "_title")));
_tooltip.forceShowOnMobile = true;
_clickArea.onClick.add(buttonClickedHandler);
_clickArea.onInteractionOver.add(overHandler);
_clickArea.onInteractionOut.add(outHandler);
}
public function dispose() : void
{
}
public function outHandler(param1:InteractionEvent) : void
{
if(!_locked)
{
_button.getChildByName("locationGraphic").tweenTo(0.2,{
"ease":Back.easeIn,
"scaleX":1,
"scaleY":1,
"rotation":0
});
_button.getChildByName("shadow").tweenTo(0.2,{
"ease":Back.easeIn,
"scaleX":1,
"scaleY":1,
"rotation":0
});
_button.getChildByName("locationGraphic").tweenTo(0.3,{"glowFilter":{
"color":16777215,
"alpha":1,
"blurX":0,
"blurY":0,
"strength":0,
"remove":true
}});
}
}
public function overHandler(param1:InteractionEvent) : void
{
var _loc2_:* = NaN;
if(!_locked)
{
_loc2_ = 2.5;
_button.getChildByName("locationGraphic").tweenTo(0.4,{
"ease":Back.easeOut,
"scaleX":1.1,
"scaleY":1.1,
"rotation":_loc2_
});
_button.getChildByName("shadow").tweenTo(0.4,{
"ease":Back.easeOut,
"scaleX":1.05,
"scaleY":1.05,
"rotation":-_loc2_ * 0.5
});
_button.getChildByName("locationGraphic").tweenTo(0.6,{
"glowFilter":{
"color":16777215,
"alpha":1,
"blurX":20,
"blurY":20,
"strength":1.5
},
"yoyo":true,
"repeat":-1
});
}
}
private function buttonClickedHandler(param1:InteractionEvent) : void
{
if(!_locked)
{
_onClick(_stage);
}
}
public function refresh() : void
{
var _loc1_:int = 0;
if(_isCustomStage)
{
_locked = !GameUtil.isCustomStageUnlocked(User.current.character,_stage);
}
else
{
_loc1_ = User.current.character.maxQuestStage;
_locked = _loc1_ < _stage;
}
if(_locked || _loc1_ == _stage && PanelCitymap.unlockedStage == _stage)
{
_clouds.locked();
}
else
{
_clouds.available();
}
if(!_locked)
{
_tooltip.text = LocText.current.text("dialog/stage_unlocked/stage" + _stage + "_title");
}
else
{
_tooltip.text = LocText.current.text("screen/citymap/button_tooltip_locked",GameUtil.getQuestStageUnlockLevel(_stage),LocText.current.text("dialog/stage_unlocked/stage" + _stage + "_title"));
}
if(!_locked && Environment.info.isTouchScreen)
{
_tooltip.text = "";
}
}
public function playNewLocationAnimation() : void
{
Environment.audio.playFX("goal_collected.mp3");
_clouds.showing();
PanelCitymap.unlockedStage = 0;
}
}
}
|
/*
Copyright 2012-2013 Renaun Erickson
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.
@author Renaun Erickson / renaun.com / @renaun
*/
package flash.display3D
{
public class Context3DTriangleFace
{
public static const BACK:String = "back";
public static const FRONT:String = "front";
public static const FRONT_AND_BACK:String = "fontAndBack";
public static const NONE:String = "none";
public function Context3DTriangleFace()
{
}
}
} |
////////////////////////////////////////////////////////////////////////////////
//
// ADOBE SYSTEMS INCORPORATED
// Copyright 2007-2010 Adobe Systems Incorporated
// All Rights Reserved.
//
// NOTICE: Adobe permits you to use, modify, and distribute this file
// in accordance with the terms of the license agreement accompanying it.
//
////////////////////////////////////////////////////////////////////////////////
package flashx.textLayout.formats
{
/**
* Defines a constant for specifying that the value of the <code>backgroundColor</code> property
* of the <code>TextLayoutFormat</code> class is "transparent".
*
* @playerversion Flash 10
* @playerversion AIR 1.5
* @langversion 3.0
* @see flashx.textLayout.formats.TextLayoutFormat#backgroundColor TextLayoutFormat.backgroundColor
*/
public final class BackgroundColor
{
/** Transparent - no background color is applied.
*
* @playerversion Flash 10
* @playerversion AIR 1.5
* @langversion 3.0
*/
public static const TRANSPARENT:String = "transparent";
}
} |
package org.flexlite.domUI.effects.easing
{
/**
* Power 类通过使用多项式表达式定义缓动功能。<br/>
* 缓动包括两个阶段:加速,或缓入阶段,接着是减速,或缓出阶段。<br/>
* 加速和减速的速率基于 exponent 属性。exponent 属性的值越大,加速和减速的速率越快。<br/>
* 使用 easeInFraction 属性指定动画加速的百分比。
* @author dom
*/
public class Power extends EaseInOutBase
{
private var _exponent:Number;
/**
* 在缓动计算中使用的指数。exponent 属性的值越大,加速和减速的速率越快。
*/
public function get exponent():Number
{
return _exponent;
}
public function set exponent(value:Number):void
{
_exponent = value;
}
/**
* 构造函数
* @param easeInFraction 在加速阶段中整个持续时间的部分,在 0.0 和 1.0 之间。
* @param exponent 在缓动计算中使用的指数。exponent 属性的值越大,加速和减速的速率越快。
*
*/
public function Power(easeInFraction:Number = 0.5, exponent:Number = 2)
{
super(easeInFraction);
this.exponent = exponent;
}
/**
* @inheritDoc
*/
override protected function easeIn(fraction:Number):Number
{
return Math.pow(fraction, _exponent);
}
/**
* @inheritDoc
*/
override protected function easeOut(fraction:Number):Number
{
return 1 - Math.pow((1 - fraction), _exponent);
}
}
}
|
package
{
import flash.display.Sprite;
import mx.core.IFlexModuleFactory;
import mx.core.mx_internal;
import mx.styles.CSSStyleDeclaration;
import mx.styles.StyleManager;
import mx.skins.halo.ActivatorSkin;
import mx.skins.halo.MenuBarBackgroundSkin;
[ExcludeClass]
public class _MenuBarStyle
{
public static function init(fbs:IFlexModuleFactory):void
{
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration("MenuBar");
if (!style)
{
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration("MenuBar", style, false);
}
if (style.defaultFactory == null)
{
style.defaultFactory = function():void
{
this.itemUpSkin = mx.skins.halo.ActivatorSkin;
this.backgroundSkin = mx.skins.halo.MenuBarBackgroundSkin;
this.itemOverSkin = mx.skins.halo.ActivatorSkin;
this.itemDownSkin = mx.skins.halo.ActivatorSkin;
this.translucent = false;
};
}
}
}
}
|
/**
* View Section and Popup Manager (VSPM) <https://github.com/tluczyns/vspm>
* Frontend multilevel subpage manager developed according to MVC pattern.
* VSPM is (c) 2009-2017 Tomasz Luczynski
* Licensed under MIT License
*
* @author Tomasz Luczynski <tluczyns@gmail.com> <http://www.programuje.pl>
* @version 1.2
*/
package tl.vspm {
import flash.events.Event;
public class ViewPopupWithResize extends ViewPopup {
public function ViewPopupWithResize(description: DescriptionViewPopup): void {
super(description);
}
override public function init(): void {
super.init();
this.stage.addEventListener(Event.RESIZE, this.onStageResize);
this.onStageResize(null);
}
protected function onStageResize(e: Event): void {
throw new Error("onStageResize must be implemented");
}
override protected function hideComplete(): void {
this.stage.removeEventListener(Event.RESIZE, this.onStageResize);
super.hideComplete();
}
}
} |
package com.audioengine.format.tasks
{
import com.audioengine.core.AudioData;
import com.audioengine.format.EncoderSettings;
import com.audioengine.format.pcm.PCM16BitStereo44Khz;
import com.audioengine.format.pcm.PCM32BitFloatStereo44Khz;
import com.audioengine.format.pcm.PCMEncoder;
import com.thread.BaseRunnable;
import flash.utils.ByteArray;
public class PCMEncoder extends BaseRunnable implements IEncoder
{
private static const bytesPerChunk : int = EncoderSettings.BYTES_PER_CHUNK;
/**
* Исходные данные
*/
private var _rawData : ByteArray;
/**
* Текущий статус выполнения
*/
private var _status : int = EncoderStatus.NONE;
/**
* Кодер
*/
private var encoder : com.audioengine.format.pcm.PCMEncoder;
private var data : ByteArray;
private var dataSize : uint;
/**
* Кодированные данные
*/
private var _outputData : ByteArray;
public function PCMEncoder()
{
super();
}
public function calcTotal( rawDataLength : int ) : int
{
return rawDataLength;
}
public function set rawData( value : ByteArray ) : void
{
_rawData = value;
_total = calcTotal( _rawData.length );
}
public function get rawData() : ByteArray
{
return _rawData;
}
public function get outputData() : ByteArray
{
return _outputData;
}
public function get status() : int
{
return _status;
}
public function get statusString() : String
{
return 'Кодирование';
}
public function clear() : void
{
}
override public function process() : void
{
if ( _status == EncoderStatus.NONE )
{
encoder = new com.audioengine.format.pcm.PCMEncoder( /*new PCM16BitStereo44Khz()*/ new PCM32BitFloatStereo44Khz() );
data = new ByteArray();
_progress = 0;
_status = EncoderStatus.CODING;
}
if ( _status == EncoderStatus.CODING )
{
dataSize = Math.min( _rawData.length - _progress, bytesPerChunk );
data.position = 0;
data.writeBytes( _rawData, _progress, dataSize );
data.position = 0;
encoder.write32BitStereo44KHz( data, AudioData.bytesToFrames( dataSize ) );
_progress += dataSize;
if ( _progress == _rawData.length )
{
_outputData = encoder.bytes;
encoder = null;
data.clear();
data = null;
_status = EncoderStatus.DONE;
}
}
}
}
} |
package com.physic.event
{
import flash.events.Event;
import flash.geom.Rectangle;
/**
* Eventos de corpo Body
* @author Wenderson Pires da Silva - @wpdas
*/
public class BodyEvent extends Event
{
/**
* Quando clicar sobre um elemento Body
*/
public static const ON_TAP_CLICK:String = "bodyEvent_onTapClick";
/**
* Quando adicionar força horizontal
*/
public static const ON_ADD_HORIZONTAL_FORCE:String = "bodyEvent_onAddHorizontalForce";
/**
* Quando adicionar força vertical (sobre a gravidade)
*/
public static const ON_ADD_VERTICAL_FORCE:String = "bodyEvent_onAddVerticalForce";
/**
* Quando o corpo parar
*/
public static const ON_BODY_STOP:String = "bodyEvent_onBodyStop";
/**
* Quando o corpo subir
* @param type
*/
public static const ON_MOVE_UP:String = "bodyEvent_onMoveUp"
/**
* Quando o corpo descer
* @param type
*/
public static const ON_MOVE_DOWN:String = "bodyEvent_onMoveDown"
/**
* Quando ocorrer colisão com outro objeto
* @param type
*/
public static const ON_COLLISION:String = "bodyEvent_onCollision";
/**
* Quando o objeto entrar dentro do outro
*/
public static const ON_INTERSECTS:String = "bodyEvent_onIntersects";
private var _otherElement:Object;
private var _boundsOtherElement:Rectangle;
/**
*
* @param type Tipo de evento
* @param otherElement Elemento a qual teve interação com o corpo disparador (StaticBody, StaticBodyElement)
* @param boundsOtherElement Bordas do elemento a qual teve interação com o corpo disparador
*/
public function BodyEvent(type:String, otherElement:Object = null, boundsOtherElement:Rectangle = null)
{
this._otherElement = otherElement;
this._boundsOtherElement = boundsOtherElement;
super(type);
}
/**
* Elemento que sofreu interação com este corpo
*/
public function get otherElement():Object
{
return _otherElement;
}
/**
* Bordas do elemento que sofreu interação com este corpo
*/
public function get boundsOtherElement():Rectangle
{
return _boundsOtherElement;
}
}
} |
/*
* 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
{
import org.flintparticles.common.actions.Age;
import org.flintparticles.common.actions.ColorChange;
import org.flintparticles.common.actions.ScaleImage;
import org.flintparticles.common.counters.Steady;
import org.flintparticles.common.initializers.Lifetime;
import org.flintparticles.integration.away3d.v4.initializers.A3D4DisplayObject;
import org.flintparticles.threeD.actions.Accelerate;
import org.flintparticles.threeD.actions.LinearDrag;
import org.flintparticles.threeD.actions.Move;
import org.flintparticles.threeD.actions.RotateToDirection;
import org.flintparticles.threeD.emitters.Emitter3D;
import org.flintparticles.threeD.initializers.Position;
import org.flintparticles.threeD.initializers.Velocity;
import org.flintparticles.threeD.zones.DiscZone;
import flash.geom.Vector3D;
public class Fire extends Emitter3D
{
public function Fire()
{
counter = new Steady( 60 );
addInitializer( new Lifetime( 2, 3 ) );
addInitializer( new Velocity( new DiscZone( new Vector3D( 0, 0, 0 ), new Vector3D( 0, 1, 0 ), 20 ) ) );
addInitializer( new Position( new DiscZone( new Vector3D( 0, 0, 0 ), new Vector3D( 0, 1, 0 ), 3 ) ) );
addInitializer( new A3D4DisplayObject( new FireBlob(), true ) );
addAction( new Age( ) );
addAction( new Move( ) );
addAction( new LinearDrag( 1 ) );
addAction( new Accelerate( new Vector3D( 0, 40, 0 ) ) );
addAction( new ColorChange( 0xFEFFCC00, 0x00CC0000 ) );
addAction( new ScaleImage( 1, 1.5 ) );
addAction( new RotateToDirection() );
}
}
} |
#fileID<Const_as>
<DocumentInfo>
docID A_Spec_Constraint;
docVer 00;
docRev a;
</DocumentInfo>
#import<toolkit.al>
#import<Const/Const.al>
|
package kabam.rotmg.assets.EmbeddedAssets {
import mx.core.*;
[Embed(source="spritesheets/EmbeddedAssets_chars8x8dEncountersEmbed_.png")]
public class EmbeddedAssets_chars8x8dEncountersEmbed_ extends BitmapAsset {
public function EmbeddedAssets_chars8x8dEncountersEmbed_() {
super();
return;
}
}
}
|
package
{
import flash.display3D.Context3DBufferUsage;
[SWF(frameRate=60, width=800, height=600, backgroundColor=0x000000)]
public class DesktopByteArrayStatic extends DemoByteArray
{
public function DesktopByteArrayStatic()
{
super( 10000, 4, Context3DBufferUsage.STATIC_DRAW );
}
}
}
|
package com.company.assembleegameclient.ui.panels.itemgrids.forgeInventory {
import com.company.assembleegameclient.game.GameSprite;
import com.company.assembleegameclient.objects.ObjectLibrary;
import com.company.assembleegameclient.ui.Slot;
import com.company.util.MoreColorUtil;
import flash.display.Sprite;
import flash.events.Event;
import flash.events.MouseEvent;
import io.decagames.rotmg.ui.sliceScaling.SliceScalingBitmap;
import kabam.rotmg.constants.GeneralConstants;
import kabam.rotmg.messaging.impl.data.ForgeItem;
public class ForgeInventory extends Sprite {
private static const NO_CUT:Array = [0, 0, 0, 0];
private static const cuts:Array = [[1, 0, 0, 1], NO_CUT, NO_CUT, [0, 1, 1, 0], [1, 0, 0, 0], NO_CUT, NO_CUT, [0, 1, 0, 0], [0, 0, 0, 1], NO_CUT, NO_CUT, [0, 0, 1, 0]];
public function ForgeInventory(gs:GameSprite, items:Vector.<int>, backPack:Boolean) {
var inventory:ForgeSlot = null;
var itemXML:XML = null;
var backpackInv:ForgeSlot = null;
var itembackpackXML:XML = null;
this.slotId = new Vector.<int>();
this.slots_ = new Vector.<ForgeSlot>();
super();
this.gs_ = gs;
for (var i:int = 4; i < GeneralConstants.NUM_EQUIPMENT_SLOTS + GeneralConstants.NUM_INVENTORY_SLOTS; i++) {
inventory = new ForgeSlot(items[i], cuts, i);
inventory.x = int(i % 4) * (Slot.WIDTH + 4);
inventory.y = int(i / 4) * (Slot.HEIGHT + 4) + 46;
itemXML = ObjectLibrary.xmlLibrary_[items[i]];
if (itemXML != null) {
inventory.addEventListener(MouseEvent.MOUSE_DOWN, this.onSlotClick);
} else {
inventory.transform.colorTransform = MoreColorUtil.veryDarkCT;
}
this.slots_.push(inventory);
addChild(inventory);
if (backPack) {
backpackInv = new ForgeSlot(items[i + 8], cuts, i);
backpackInv.x = int(i % 4) * (Slot.WIDTH + 4);
backpackInv.y = inventory.y + 100;
itembackpackXML = ObjectLibrary.xmlLibrary_[items[i + 8]];
if (itembackpackXML != null) {
backpackInv.addEventListener(MouseEvent.MOUSE_DOWN, this.onSlotClick);
} else {
backpackInv.transform.colorTransform = MoreColorUtil.veryDarkCT;
}
this.slots_.push(backpackInv);
addChild(backpackInv);
}
this.slotId.push(i);
if (backPack) {
this.slotId.push(i + 8);
}
}
}
public var gs_:GameSprite;
public var slots_:Vector.<ForgeSlot>;
public var slotId:Vector.<int>;
public var boxInv:SliceScalingBitmap;
public var boxBackpack:SliceScalingBitmap;
public function getIncludedItems():Vector.<ForgeItem> {
var forgeItem:ForgeItem = null;
var included:Vector.<ForgeItem> = new Vector.<ForgeItem>();
for (var i:int = 0; i < this.slots_.length; i++) {
if (this.slots_[i].included_) {
forgeItem = new ForgeItem();
forgeItem.objectType_ = this.slots_[i].item_;
forgeItem.slotId_ = this.slotId[i];
forgeItem.included_ = this.slots_[i].included_;
included.push(forgeItem);
}
}
return included;
}
private function onSlotClick(event:MouseEvent):void {
var slot:ForgeSlot = event.currentTarget as ForgeSlot;
slot.setIncluded(!slot.included_);
dispatchEvent(new Event(Event.CHANGE));
}
}
}
|
package nt.ui.components
{
import nt.ui.core.Component;
import nt.ui.util.LayoutParser;
import nt.ui.util.PopUpManager;
public class Alert extends FramePanel
{
public static function show(text:String, onOK:Function = null):void
{
getInstance().show(text, onOK);
}
public static function confirm(text:String, onOK:Function):void
{
getInstance().confirm(text, onOK);
}
private static var _instance:Alert;
public static function getInstance():Alert
{
return _instance ||= new Alert();
}
public function Alert(skin:* = null)
{
super(skin);
this.width = 200;
this.height = 100;
this.title = "{Hint}";
this.isShowCloseButton = false;
}
private var content:Component;
private var onOK:Function;
public function onClickOK(target:Component):void
{
onClickCancel(target);
if (onOK != null)
{
onOK();
onOK = null;
}
}
public function onClickCancel(target:Component):void
{
PopUpManager.remove(this);
removeChild(content);
content = null;
}
public function show(text:*, onOK:Function):void
{
if (parent)
{
PopUpManager.remove(this);
}
PopUpManager.add(this, true, 0, true);
this.onOK = onOK;
content = LayoutParser.parse(LAYOUT_OK, this);
Label(content.get("text")).text = text;
addChild(content);
}
public function confirm(text:*, onOK:Function):void
{
if (parent)
{
PopUpManager.remove(this);
}
PopUpManager.add(this, true, 0, true);
this.onOK = onOK;
content = LayoutParser.parse(LAYOUT_OK_CANCLE, this);
Label(content.get("text")).text = text;
addChild(content);
}
}
}
const LAYOUT_OK_CANCLE:XML = <VBox x="8" y="37" id="box" width="180" height="60" align="center">
<Label id="text" text="" width="180" height="20"/>
<HBox><PushButton label="{OK}" onClick="onClickOK"/><PushButton label="{Cancel}" onClick="onClickCancel" /></HBox>
</VBox>
const LAYOUT_OK:XML = <VBox x="8" y="37" id="box" width="180" height="60" align="center">
<Label id="text" text="" width="180" height="20" />
<PushButton label="{OK}" onClick="onClickOK"/>
</VBox>
|
////////////////////////////////////////////////////////////////////////////////
//
// 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 spark.components.supportClasses
{
COMPILE::JS
{
import goog.DEBUG;
import org.apache.royale.core.WrappedHTMLElement;
import org.apache.royale.html.util.addElementToWrapper;
}
/*
import flash.events.Event;
import flash.events.FocusEvent;
import flash.events.KeyboardEvent;
import flash.events.MouseEvent;
import flash.events.TimerEvent;
import flash.ui.Keyboard;
import flash.utils.Timer;
import mx.core.IVisualElement;
import mx.core.InteractionMode;
import mx.core.mx_internal;
import mx.events.FlexEvent;
import mx.events.SandboxMouseEvent;
import mx.events.TouchInteractionEvent;
import spark.core.IDisplayText;
import spark.primitives.BitmapImage;
use namespace mx_internal;
*/
import org.apache.royale.core.ITextModel;
import mx.managers.IFocusManagerComponent;
//--------------------------------------
// Styles
//--------------------------------------
//include "../../styles/metadata/BasicInheritingTextStyles.as"
/**
* The radius of the corners of this component.
*
* @default 4
*
* @langversion 3.0
* @playerversion Flash 10
* @playerversion AIR 1.5
* @productversion Flex 4
*/
//[Style(name="cornerRadius", type="Number", format="Length", inherit="no", theme="spark", minValue="0.0")]
/**
* The alpha of the focus ring for this component.
*
* @default 0.5
*
* @langversion 3.0
* @playerversion Flash 10
* @playerversion AIR 1.5
* @productversion Flex 4
*/
//[Style(name="focusAlpha", type="Number", inherit="no", theme="spark, mobile", minValue="0.0", maxValue="1.0")]
/**
* @copy spark.components.supportClasses.GroupBase#style:focusColor
*
* @default 0x70B2EE
*
* @langversion 3.0
* @playerversion Flash 10
* @playerversion AIR 1.5
* @productversion Flex 4
*/
//[Style(name="focusColor", type="uint", format="Color", inherit="yes", theme="spark, mobile")]
/**
* Class or instance to use as the default icon.
* The icon can render from various graphical sources, including the following:
* <ul>
* <li>A Bitmap or BitmapData instance.</li>
* <li>A class representing a subclass of DisplayObject. The BitmapFill
* instantiates the class and creates a bitmap rendering of it.</li>
* <li>An instance of a DisplayObject. The BitmapFill copies it into a
* Bitmap for filling.</li>
* <li>The name of an external image file. </li>
* </ul>
*
* @default null
*
* @see spark.primitives.BitmapImage.source
*
* @langversion 3.0
* @playerversion Flash 10
* @playerversion AIR 2.5
* @productversion Flex 4.5
*/
//[Style(name="icon", type="Object", inherit="no")]
/**
* Orientation of the icon in relation to the label.
* Valid MXML values are <code>right</code>, <code>left</code>,
* <code>bottom</code>, and <code>top</code>.
*
* <p>In ActionScript, you can use the following constants
* to set this property:
* <code>IconPlacement.RIGHT</code>,
* <code>IconPlacement.LEFT</code>,
* <code>IconPlacement.BOTTOM</code>, and
* <code>IconPlacement.TOP</code>.</p>
*
* @default IconPlacement.LEFT
*
* @langversion 3.0
* @playerversion Flash 10
* @playerversion AIR 1.5
* @productversion Flex 4
*/
//[Style(name="iconPlacement", type="String", enumeration="top,bottom,right,left", inherit="no", theme="spark, mobile")]
/**
* Number of milliseconds to wait after the first <code>buttonDown</code>
* event before repeating <code>buttonDown</code> events at each
* <code>repeatInterval</code>.
*
* @default 500
*
* @langversion 3.0
* @playerversion Flash 10
* @playerversion AIR 1.5
* @productversion Flex 4
*/
//[Style(name="repeatDelay", type="Number", format="Time", inherit="no", minValue="0.0")]
/**
* Number of milliseconds between <code>buttonDown</code> events
* if the user presses and holds the mouse on a button.
*
* @default 35
*
* @langversion 3.0
* @playerversion Flash 10
* @playerversion AIR 1.5
* @productversion Flex 4
*/
//[Style(name="repeatInterval", type="Number", format="Time", inherit="no", minValueExclusive="0.0")]
/**
* When in touch interaction mode, the number of milliseconds to wait after the user
* interaction has occured before showing the component in a visually down state.
*
* <p>The reason for this delay is because when a user initiates a scroll gesture, we don't want
* components to flicker as they touch the screen. By having a reasonable delay, we make
* sure that the user still gets feedback when they press down on a component, but that the
* feedback doesn't come too quickly that it gets displayed during a scroll gesture
* operation.</p>
*
* <p>If the mobile theme is applied, the default value for this style is 100 ms for
* components inside of a Scroller and 0 ms for components outside of a Scroller.</p>
*
* @langversion 3.0
* @playerversion Flash 10.1
* @playerversion AIR 2.5
* @productversion Flex 4.5
*/
//[Style(name="touchDelay", type="Number", format="Time", inherit="yes", minValue="0.0")]
//[Style(name="direction", type="String", inherit="yes")]
//--------------------------------------
// Events
//--------------------------------------
/**
* Dispatched when the user presses the ButtonBase control.
* If the <code>autoRepeat</code> property is <code>true</code>,
* this event is dispatched repeatedly as long as the button stays down.
*
* @eventType mx.events.FlexEvent.BUTTON_DOWN
*
* @langversion 3.0
* @playerversion Flash 10
* @playerversion AIR 1.5
* @productversion Flex 4
*/
//[Event(name="buttonDown", type="mx.events.FlexEvent")]
//--------------------------------------
// Skin states
//--------------------------------------
/**
* Up State of the Button
*
* @langversion 3.0
* @playerversion Flash 10
* @playerversion AIR 1.5
* @productversion Flex 4
*/
//[SkinState("up")]
/**
* Over State of the Button
*
* @langversion 3.0
* @playerversion Flash 10
* @playerversion AIR 1.5
* @productversion Flex 4
*/
//[SkinState("over")]
/**
* Down State of the Button
*
* @langversion 3.0
* @playerversion Flash 10
* @playerversion AIR 1.5
* @productversion Flex 4
*/
//[SkinState("down")]
/**
* Disabled State of the Button
*
* @langversion 3.0
* @playerversion Flash 10
* @playerversion AIR 1.5
* @productversion Flex 4
*/
//[SkinState("disabled")]
//--------------------------------------
// Other metadata
//--------------------------------------
//[AccessibilityClass(implementation="spark.accessibility.ButtonBaseAccImpl")]
[DefaultTriggerEvent("click")]
[DefaultProperty("label")]
/**
* The ButtonBase class is the base class for the all Spark button components.
* The Button and ToggleButtonBase classes are subclasses of ButtonBase.
* ToggleButton.
* The CheckBox and RadioButton classes are subclasses of ToggleButtonBase.
*
* @mxml
*
* <p>The <code><s:ButtonBase></code> tag inherits all of the tag
* attributes of its superclass and adds the following tag attributes:</p>
*
* <pre>
* <s:ButtonBase
* <strong>Properties</strong>
* autoRepeat="false"
* content="null"
* label=""
* stickyHighlighting="false"
*
* <strong>Events</strong>
* buttonDown="<i>No default</i>"
*
* <strong>Styles</strong>
* alignmentBaseline="USE_DOMINANT_BASELINE"
* cffHinting="HORIZONTAL_STEM"
* color="0"
* cornerRadius="4"
* digitCase="DEFAULT"
* digitWidth="DEFAULT"
* direction="LTR"
* dominantBaseline="AUTO"
* focusAlpha="0.5"
* focusColor="0x70B2EE"
* fontFamily="Arial"
* fontLookup="DEVICE"
* fontSize="12"
* fontStyle="NORMAL"
* fontWeight="NORMAL"
* justificationRule="AUTO"
* justificationStyle="AUTO"
* kerning="AUTO"
* ligatureLevel="COMMON"
* lineHeight="120%"
* lineThrough="false"
* locale="en"
* renderingMode="CFF"
* repeatDelay="500"
* repeatInterval="35"
* textAlign="START"
* textAlignLast="START"
* textAlpha="1"
* textDecoration="NONE"
* textJustify="INTER_WORD"
* trackingLeft="0"
* trackingRight="0"
* typographicCase="DEFAULT"
* wordSpacing="100%"
* />
* </pre>
*
* @see spark.components.Button
* @see spark.components.supportClasses.ToggleButtonBase
* @see spark.components.ToggleButton
* @see spark.components.CheckBox
* @see spark.components.RadioButton
*
* @langversion 3.0
* @playerversion Flash 10
* @playerversion AIR 1.5
* @productversion Flex 4
*/
public class ButtonBase extends SkinnableComponent implements IFocusManagerComponent
{
// include "../../core/Version.as";
//--------------------------------------------------------------------------
//
// Constructor
//
//--------------------------------------------------------------------------
/**
* Constructor.
*
* @langversion 3.0
* @playerversion Flash 10
* @playerversion AIR 1.5
* @productversion Flex 4
*/
public function ButtonBase()
{
super();
// DisplayObjectContainer properties.
// Setting mouseChildren to false ensures that mouse events
// are dispatched from the Button itself,
// not from its skins, icons, or TextField.
// One reason for doing this is that if you press the mouse button
// while over the TextField and release the mouse button while over
// a skin or icon, we want the player to dispatch a "click" event.
// Another is that if mouseChildren were true and someone uses
// Sprites rather than Shapes for the skins or icons,
// then we we wouldn't get a click because the current skin or icon
// changes between the mouseDown and the mouseUp.
// (This doesn't happen even when mouseChildren is true if the skins
// and icons are Shapes, because Shapes never dispatch mouse events;
// they are dispatched from the Button in this case.)
COMPILE::SWF
{
mouseChildren = false;
}
}
//--------------------------------------------------------------------------
//
// Variables
//
//--------------------------------------------------------------------------
//----------------------------------
// label
//----------------------------------
[Bindable("contentChange")]
[Inspectable(category="General", defaultValue="")]
/**
* Text to appear on the ButtonBase control.
*
* <p>If the label is wider than the ButtonBase control,
* the label is truncated and terminated by an ellipsis (...).
* The full label displays as a tooltip
* when the user moves the mouse over the control.
* If you have also set a tooltip by using the <code>tooltip</code>
* property, the tooltip is displayed rather than the label text.</p>
*
* <p>This is the default ButtonBase property.</p>
*
* <p>This property is a <code>String</code> typed facade to the
* <code>content</code> property. This property is bindable and it shares
* dispatching the "contentChange" event with the <code>content</code>
* property.</p>
*
* @default ""
* @see #content
* @eventType contentChange
*
* @langversion 3.0
* @playerversion Flash 10
* @playerversion AIR 1.5
* @productversion Flex 4
*/
public function set label(value:String):void
{
ITextModel(model).text = value;
COMPILE::JS {
setInnerHTML();
}
}
/**
* @private
*/
public function get label():String
{
return ITextModel(model).text;
}
/**
* @royaleignorecoercion HTMLImageElement
*/
COMPILE::JS
protected function setInnerHTML():void
{
if (label != null) {
element.innerHTML = label;
}
measuredWidth = Number.NaN;
measuredHeight = Number.NaN;
};
/**
* @royaleignorecoercion org.apache.royale.core.WrappedHTMLElement
*/
COMPILE::JS
override protected function createElement():WrappedHTMLElement
{
addElementToWrapper(this,'button');
element.setAttribute('type', 'button');
return element;
}
public function set fontStyle(value:String):void
{
}
public function get fontStyle():String
{
return "NORMAL";
}
public function get lineThrough():Boolean
{
return true;
}
public function set lineThrough(val:Boolean):void
{
}
public function get textDecoration():String
{
return null;
}
public function set textDecoration(val:String):void
{
}
private var _direction:String = "LTR";
/**
* @private
*/
public function get direction():String{
return _direction;
}
public function set direction(value:String):void
{
_direction = value;
}
}
}
|
package
{
import UI.App;
import UI.abstract.resources.AnCategory;
import UI.abstract.resources.AnConst;
import UI.abstract.resources.ResourceUtil;
import UI.abstract.resources.item.JsonResource;
import UI.abstract.resources.loader.MultiLoader;
import UI.abstract.utils.CommonPool;
import proxy.PlayerProxy;
public class ChangeScene
{
public static var nowLoadScene:int = 0;
public function ChangeScene()
{
}
public static function changeScene(sceneId:int):void{
var proxy1:PlayerProxy = AppFacade.getInstance().retrieveProxy(PlayerProxy.NAME) as PlayerProxy;
proxy1.changeScene(sceneId);
//发过来的场景不对
/*
if(sceneId <= 0){
return;
}
//当前正在加载别的场景
if(nowLoadScene > 0){
var helpObj:Object = CommonPool.fromPoolObject();
helpObj.message = "正在进入场景";
AppFacade.getInstance().sendNotification(NotiConst.ADD_ERROR_MESSAGE,helpObj);
return;
}
nowLoadScene = sceneId;
var helpObj1:Object = CommonPool.fromPoolObject();
helpObj1.onField = onField;
App.loader.load("map/"+sceneId+".json",loadComplete,helpObj1);
*/
}
public static function loadingScene(sceneId:int,monsterId:int):void{
nowLoadScene = sceneId;
var monster:Object = GlobalData.monsterData[monsterId];
var skillArray:Array = monster["skill"];
var loadArray:Array = new Array();
var url:String;
var skill:Object;
var buff:Object;
for(var i:int = 0;i<skillArray.length;i++){
skill = GlobalData.skillData[skillArray[i]];
if(skill == null){
continue;
}
if(skill["src"] != ""){
url = ResourceUtil.getAnimationURL(AnCategory.EFFECT,skill["src"]);
if(loadArray.indexOf(url) == -1){
loadArray[loadArray.length] = url;
}
}
if(skill["hitEffect"] != ""){
url = ResourceUtil.getAnimationURL(AnCategory.EFFECT,skill["hitEffect"]);
if(loadArray.indexOf(url) == -1){
loadArray[loadArray.length] = url;
}
}
if(skill["readEffect"] != ""){
url = ResourceUtil.getAnimationURL(AnCategory.EFFECT,skill["readEffect"]);
if(loadArray.indexOf(url) == -1){
loadArray[loadArray.length] = url;
}
}
if(skill["bombEffect"] != ""){
url = ResourceUtil.getAnimationURL(AnCategory.EFFECT,skill["bombEffect"]);
if(loadArray.indexOf(url) == -1){
loadArray[loadArray.length] = url;
}
}
if(skill["icon"] != ""){
url = "skill/"+skill["icon"];
if(loadArray.indexOf(url) == -1){
loadArray[loadArray.length] = url;
}
}
if(skill["buffId"] != 0){
buff = GlobalData.buffData[skill["buffId"]];
if(buff["src"] != ""){
url = ResourceUtil.getAnimationURL(AnCategory.EFFECT,buff["src"]);
if(loadArray.indexOf(url) == -1){
loadArray[loadArray.length] = url;
}
}
}
}
loadArray[loadArray.length] = "map/"+sceneId+".json";
loadArray[loadArray.length] = ResourceUtil.getAnimationURL(AnCategory.USER,monster["src"],AnConst.STAND);
loadArray[loadArray.length] = ResourceUtil.getAnimationURL(AnCategory.USER,monster["src"],AnConst.WALK);
loadArray[loadArray.length] = ResourceUtil.getAnimationURL(AnCategory.USER,monster["src"],AnConst.ATTACK);
loadArray[loadArray.length] = ResourceUtil.getAnimationURL(AnCategory.USER,monster["src"],AnConst.ATTACK2);
loadArray[loadArray.length] = ResourceUtil.getAnimationURL(AnCategory.USER,monster["srcWeapon"],AnConst.STAND);
loadArray[loadArray.length] = ResourceUtil.getAnimationURL(AnCategory.USER,monster["srcWeapon"],AnConst.WALK);
loadArray[loadArray.length] = ResourceUtil.getAnimationURL(AnCategory.USER,monster["srcWeapon"],AnConst.ATTACK);
loadArray[loadArray.length] = ResourceUtil.getAnimationURL(AnCategory.USER,monster["srcWeapon"],AnConst.ATTACK2);
var helpObj1:Object = CommonPool.fromPoolObject();
helpObj1.onField = onField;
var multiLoader:MultiLoader = App.loader.loadList(loadArray,loadComplete,helpObj1,false);
GlobalData.loading.setProcess(multiLoader,"加载人物和技能资源");
multiLoader.load();
}
public static function loadComplete():void{
var resource:JsonResource = App.loader.getResource("map/"+nowLoadScene+".json") as JsonResource;
var mapData:Object = resource.object;
var wSize:int = Math.ceil(mapData["mapWidth"]/mapData["cutMapSize"]);
var hSize:int = Math.ceil(mapData["mapHeight"]/mapData["cutMapSize"]);
var loadArray:Array = new Array();
for(var i:int = 0;i<hSize;i++){
for(var j:int = 0;j<wSize;j++){
var str:String = "map/s"+mapData["id"]+"/s"+mapData["id"]+"_"+i+"_"+j+".jpg";
loadArray[loadArray.length] = str;
}
}
var helpObj1:Object = CommonPool.fromPoolObject();
helpObj1.onField = onField;
var multiLoader:MultiLoader = App.loader.loadList(loadArray,loadComplete1,helpObj1,false);
GlobalData.loading.setProcess(multiLoader,"加载地图资源");
multiLoader.load();
}
public static function loadComplete1():void{
var proxy1:PlayerProxy = AppFacade.getInstance().retrieveProxy(PlayerProxy.NAME) as PlayerProxy;
proxy1.loadingOk();
}
public static function onField():void{
}
//public static function loadComplete(jsonResource:JsonResource):void{
// var proxy1:PlayerProxy = AppFacade.getInstance().retrieveProxy(PlayerProxy.NAME) as PlayerProxy;
// proxy1.changeScene(nowLoadScene);
// nowLoadScene = 0;
//}
//public static function onField():void{
// nowLoadScene = 0;
// var helpObj:Object = CommonPool.fromPoolObject();
// helpObj.message = "没有此场景";
// AppFacade.getInstance().sendNotification(NotiConst.ADD_ERROR_MESSAGE,helpObj);
//}
}
} |
package cmodule.lua_wrapper
{
class AlchemyLibInit
{
public var rv:int;
function AlchemyLibInit(param1:int)
{
super();
this.rv = param1;
}
}
}
|
package {
import uidocument.commons.api.document.*;
public interface Configurable {
function setProperties(properties:Property):void;
function setPosition(position:Position):void;
function setBehavior(behavior:Behavior):void;
//function setLayout(properties:Property):void;
function setAction(action:Action):void;
}
} |
package com.playfab.ServerModels
{
public class GetTimeRequest
{
public function GetTimeRequest(data:Object=null)
{
if(data == null)
return;
}
}
}
|
package game.view.playerThumbnail
{
import com.pickgliss.ui.ComponentFactory;
import com.pickgliss.ui.core.Disposeable;
import com.pickgliss.ui.text.FilterFrameText;
import ddt.events.LivingEvent;
import flash.display.Bitmap;
import flash.display.Sprite;
import flash.filters.BitmapFilter;
import flash.filters.ColorMatrixFilter;
import flash.geom.Point;
import game.model.Living;
import game.model.SimpleBoss;
public class BossThumbnail extends Sprite implements Disposeable
{
private var _bg:Bitmap;
private var _living:Living;
private var _headFigure:HeadFigure;
private var _blood:BossBloodItem;
private var _name:FilterFrameText;
private var lightingFilter:BitmapFilter;
public function BossThumbnail(param1:Living)
{
super();
this._living = param1;
this.init();
this.initEvents();
}
public function init() : void
{
var _loc1_:Point = null;
this._bg = ComponentFactory.Instance.creatBitmap("asset.game.bossThumbnailBgAsset");
addChild(this._bg);
this._headFigure = new HeadFigure(62,62,this._living);
addChild(this._headFigure);
this._headFigure.y = 11;
this._headFigure.x = 4;
this._blood = new BossBloodItem(this._living.maxBlood);
addChild(this._blood);
_loc1_ = ComponentFactory.Instance.creatCustomObject("room.bossThumbnailHPPos");
this._blood.x = _loc1_.x;
this._blood.y = _loc1_.y;
this._name = ComponentFactory.Instance.creatComponentByStylename("asset.game.bossThumbnailNameTxt");
addChild(this._name);
this._name.text = this._living.name;
this.__updateBlood(null);
}
public function initEvents() : void
{
if(this._living)
{
this._living.addEventListener(LivingEvent.BLOOD_CHANGED,this.__updateBlood);
this._living.addEventListener(LivingEvent.DIE,this.__die);
}
}
public function __updateBlood(param1:LivingEvent) : void
{
this._blood.bloodNum = this._living.blood;
if(this._living.blood <= 0)
{
if(this._headFigure)
{
this._headFigure.gray();
}
}
}
public function __die(param1:LivingEvent) : void
{
if(this._headFigure)
{
this._headFigure.gray();
}
if(this._blood)
{
this._blood.visible = false;
}
}
private function __shineChange(param1:LivingEvent) : void
{
var _loc2_:SimpleBoss = this._living as SimpleBoss;
if(_loc2_ && _loc2_.isAttacking)
{
}
}
public function setUpLintingFilter() : void
{
var _loc1_:Array = new Array();
_loc1_ = _loc1_.concat([1,0,0,0,25]);
_loc1_ = _loc1_.concat([0,1,0,0,25]);
_loc1_ = _loc1_.concat([0,0,1,0,25]);
_loc1_ = _loc1_.concat([0,0,0,1,0]);
this.lightingFilter = new ColorMatrixFilter(_loc1_);
}
public function removeEvents() : void
{
if(this._living)
{
this._living.removeEventListener(LivingEvent.BLOOD_CHANGED,this.__updateBlood);
this._living.removeEventListener(LivingEvent.DIE,this.__die);
}
}
public function updateView() : void
{
if(!this._living)
{
this.visible = false;
}
else
{
if(this._headFigure)
{
this._headFigure.dispose();
this._headFigure = null;
}
if(this._blood)
{
this._blood = null;
}
this.init();
}
}
public function set info(param1:Living) : void
{
if(!param1)
{
this.removeEvents();
}
this._living = param1;
this.updateView();
}
public function get Id() : int
{
if(!this._living)
{
return -1;
}
return this._living.LivingID;
}
public function dispose() : void
{
this.removeEvents();
removeChild(this._bg);
this._bg.bitmapData.dispose();
this._bg = null;
this._living = null;
this._headFigure.dispose();
this._headFigure = null;
this._blood.dispose();
this._blood = null;
this._name.dispose();
this._name = null;
this.lightingFilter = null;
if(parent)
{
parent.removeChild(this);
}
}
}
}
|
///////////////////////////////////////////////////////////////////////////
// Copyright (c) 2013 Esri. All Rights Reserved.
//
// 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.esri.mobile.components.supportClasses
{
import flash.events.Event;
import flash.events.EventDispatcher;
import mx.core.IFactory;
import mx.core.IMXMLObject;
import mx.utils.NameUtil;
import mx.core.UIComponent;
//--------------------------------------
// Events
//--------------------------------------
[Event(name="click", type="flash.events.MouseEvent")]
[Event(name="propertyChange", type="mx.events.PropertyChangeEvent")]
[Event(name="expand", type="flash.events.Event")]
[Event(name="collapse", type="flash.events.Event")]
//--------------------------------------
// Other Metadata
//--------------------------------------
[DefaultProperty("actionViewClass")]
/**
*
*/
public class MenuItem extends EventDispatcher implements IMXMLObject
{
//--------------------------------------------------------------------------
//
// Class Constants
//
//--------------------------------------------------------------------------
/**
* @see http://developer.android.com/reference/android/view/MenuItem.html#SHOW_AS_ACTION_ALWAYS
*/
public static const SHOW_AS_ACTION_ALWAYS:uint = 0x000002;
public static const SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW:uint = 0x000008;
public static const SHOW_AS_ACTION_IF_ROOM:uint = 0x000001;
public static const SHOW_AS_ACTION_NEVER:uint = 0x000000;
public static const SHOW_AS_ACTION_WITH_TEXT:uint = 0x000004;
//--------------------------------------------------------------------------
//
// Constructor
//
//--------------------------------------------------------------------------
/**
* Constructor.
*
*/
public function MenuItem()
{
super();
}
//--------------------------------------------------------------------------
//
// Properties
//
//--------------------------------------------------------------------------
//----------------------------------
// uid
//----------------------------------
private var m_uid:String;
/**
* @private
*/
public function get uid():String
{
if (!m_uid)
{
m_uid = NameUtil.createUniqueName(this);
}
return m_uid;
}
//----------------------------------
// id
//----------------------------------
public var id:String;
//----------------------------------
// title
//----------------------------------
public var label:String;
//----------------------------------
// icon
//----------------------------------
public var icon:Object;
//----------------------------------
// data
//----------------------------------
public var data:Object;
//----------------------------------
// showAsAction
//----------------------------------
public var showAsAction:uint;
//----------------------------------
// actionViewClass
//----------------------------------
private var m_actionViewClass:IFactory;
public function get actionViewClass():IFactory
{
return m_actionViewClass;
}
public function set actionViewClass(value:IFactory):void
{
if (m_actionViewClass !== value)
{
var collapsed:Boolean = collapseActionView();
m_actionViewClass = value;
if (collapsed)
{
expandActionView();
}
}
}
//----------------------------------
// visible
//----------------------------------
public var visible:Boolean = true;
//--------------------------------------------------------------------------
//
// Public functions
//
//--------------------------------------------------------------------------
public function expandActionView():Boolean
{
var expanded:Boolean = false;
if (actionViewClass)
{
if (hasEventListener("expand"))
{
expanded = dispatchEvent(new Event("expand"));
}
}
else
{
trace("call expandActionView() failed.");
}
return expanded;
}
public function collapseActionView():Boolean
{
var collapsed:Boolean = false;
if (actionViewClass)
{
if (hasEventListener("collapse"))
{
collapsed = dispatchEvent(new Event("collapse"));
}
}
else
{
trace("call collapseActionView() failed.");
}
return collapsed;
}
//--------------------------------------------------------------------------
//
// Methods
//
//--------------------------------------------------------------------------
public function initialized(document:Object, id:String):void
{
this.id = id;
}
}
}
|
package emap.map3d.comman.logo
{
/**
*
* 显示图标的Plane
*
*/
import alternativa.engine3d.core.Object3D;
import alternativa.engine3d.resources.BitmapTextureResource;
import emap.core.em;
import emap.data.Transform;
import emap.map3d.utils.Map3DUtil;
import emap.map3d.tools.SourceEmap3D;
import emap.utils.PositionUtil;
import flash.display.BitmapData;
import flash.display.IBitmapDrawable;
import flash.display.Loader;
import flash.display.LoaderInfo;
import flash.events.Event;
import flash.events.IOErrorEvent;
import flash.geom.Matrix;
import flash.net.URLRequest;
import flash.utils.ByteArray;
import emap.map3d.comman.PixelTextureMaterial;
public class Logo extends Object3D
{
/**
*
* 构造函数
*
*/
public function Logo($maxWidth:Number, $maxHeight:Number, $color:uint = 0)
{
super();
initialize($maxWidth, $maxHeight, $color);
}
/**
*
* 应用LOGO
*
*/
protected function applyLogo($w:Number, $h:Number, $material:PixelTextureMaterial):void
{
}
/**
*
* 根据传入的宽高转换为二的倍数宽高
*
*/
protected function getBmdWH($value:Number):Number
{
return Map3DUtil.to2Square($value);
}
/**
* @private
*/
private function initialize($maxWidth:Number, $maxHeight:Number, $color:uint):void
{
color = $color;
maxWidth = $maxWidth;
maxHeight = $maxHeight;
}
/**
* @private
*/
private function createLoader():Loader
{
var loader:Loader = new Loader;
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, handlerDefault);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, handlerDefault);
return loader;
}
/**
* @private
*/
private function resolveContent($content:IBitmapDrawable):void
{
resolveMaterial(PositionUtil.restrictIcon($content, maxWidth, maxHeight), $content);
}
/**
* @private
*/
private function resolveMaterial($rect:Transform, $data:IBitmapDrawable):void
{
offsetX = .5 * $rect.width;
offsetY = .5 * $rect.height;
var w:uint = getBmdWH($rect.width);
var h:uint = getBmdWH($rect.height);
if (w && h && $data)
{
var bmd:BitmapData = new BitmapData(w, h, true, color);
var mat:Matrix = new Matrix;
mat.scale($rect.scaleX, $rect.scaleY);
bmd.draw($data, mat);
var res:BitmapTextureResource = new BitmapTextureResource(bmd);
var tex:PixelTextureMaterial = new PixelTextureMaterial(res, null, 1, false);
tex.alphaThreshold = 1;
applyLogo($rect.width, $rect.height, tex);
SourceEmap3D.uploadSource(res);
}
}
/**
* @private
*/
private function handlerDefault($e:Event):void
{
var loaderInfo:LoaderInfo = $e.target as LoaderInfo;
loaderInfo.removeEventListener(Event.COMPLETE, handlerDefault);
loaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, handlerDefault);
if ($e.type == Event.COMPLETE) resolveContent(loaderInfo.content);
}
/**
*
* 缩放比
*
*/
public function get scale():Number
{
return em::scale;
}
/**
* @private
*/
public function set scale($value:Number):void
{
if (scale!= $value)
{
em::scale = $value;
scaleX = scaleY = $value;
}
}
/**
*
* 资源路径
*
*/
public function get source():Object
{
return em::source;
}
/**
* @private
*/
public function set source($value:Object):void
{
if (source!= $value)
{
em::source = $value;
if (source is String)
createLoader().load(new URLRequest(source as String));
else if (source is ByteArray)
createLoader().loadBytes(source as ByteArray);
else if (source is IBitmapDrawable)
resolveContent(source as IBitmapDrawable);
}
}
/**
*
* 背景颜色
*
*/
public var color:uint;
/**
* @private
*/
protected var offsetX:Number;
/**
* @private
*/
protected var offsetY:Number;
/**
* @private
*/
protected var maxWidth:Number;
/**
* @private
*/
protected var maxHeight:Number;
/**
* @private
*/
em var scale:Number;
/**
* @private
*/
em var source:Object;
}
} |
package fr.manashield.flex.thex.blocks
{
import flash.display.Stage;
import flash.geom.Point;
/**
* @author Morgan Peyre (morgan@peyre.info)
* @author Paul Bonnet
*/
public class HexagonalCell
{
protected var _hexCoordinates:Point;
protected var _parent:HexagonalGrid;
protected var _isOccupied:Boolean;
protected var _block:Block;
public function HexagonalCell(position:Point, parent:HexagonalGrid = null, occupied:Boolean = false, block:Block = null)
{
_hexCoordinates = position;
_parent = parent;
_isOccupied = occupied;
_block = block;
}
public function get center():Point
{
return this.parent.hexToCartesian(_hexCoordinates);
}
public function get parent():HexagonalGrid
{
return _parent;
}
public function get hexCoordinates():Point
{
return _hexCoordinates;
}
public function get neighbors():Vector.<HexagonalCell>
{
var neighbors:Vector.<HexagonalCell> = new Vector.<HexagonalCell>();
for(var i:int=-1; i<=1; i+=2)
{
neighbors.push(this._parent.cell(new Point(_hexCoordinates.x + i, _hexCoordinates.y - i)));
neighbors.push(this._parent.cell(new Point(_hexCoordinates.x + i, _hexCoordinates.y)));
neighbors.push(this._parent.cell(new Point(_hexCoordinates.x, _hexCoordinates.y - i)));
}
return neighbors;
}
public function get nearestNeighborToCenter():HexagonalCell
{
if(this.hexCoordinates == new Point(0,0)) return this;
var closeCell:HexagonalCell;
var shortestSquareDistance:uint = uint.MAX_VALUE;
var candidateSquareDistance:uint;
for each(var cell:HexagonalCell in this.neighbors)
{
candidateSquareDistance = Math.pow(cell.center.x - _parent.stage.stageWidth/2, 2) + Math.pow(cell.center.y - _parent.stage.stageHeight/2, 2);
if(candidateSquareDistance < shortestSquareDistance)
{
shortestSquareDistance = candidateSquareDistance;
closeCell = cell;
}
}
return closeCell;
}
public function get distanceToCenter():Number
{
var stage:Stage = this.parent.stage;
var origin:Point = new Point(stage.stageWidth/2, stage.stageHeight/2);
return Point.distance(this.center, origin);
}
public function get clockwiseNeighbor():HexagonalCell
{
var x:Number = _hexCoordinates.x;
var y:Number = _hexCoordinates.y;
var sign:Number;
if(x*y > 0 || x == 0)
{
sign = (y>0?1:-1);
x+=sign;
y-=sign;
} else
{
sign = (x>0?1:-1);
Math.abs(x)>Math.abs(y)?y-=sign:x-=sign;
}
return this._parent.cell(new Point(x, y));
}
public function get counterClockwiseNeighbor():HexagonalCell
{
var x:Number = _hexCoordinates.x;
var y:Number = _hexCoordinates.y;
var sign:Number;
if(x*y > 0 || y == 0)
{
sign = (x>0?1:-1);
x-=sign;
y+=sign;
}
else
{
sign = (y>0?1:-1);
Math.abs(x)>=Math.abs(y)?y-=sign:x-=sign;
}
return this._parent.cell(new Point(x, y));
}
public function get occupied():Boolean
{
return this._isOccupied;
}
public function set occupied(newState:Boolean):void
{
this._isOccupied = newState;
}
public function get block():Block
{
return this._block;
}
public function set block(newBlock:Block):void
{
this._block = newBlock;
}
}
}
|
file f;
int r = f.open("scripts/TestExecuteScript.as", "r");
if( r >= 0 ) {
assert( f.getSize() > 0 );
string s1 = f.readString(10000);
assert( s1.length() == uint(f.getSize()) );
f.close();
f.open('scripts/TestExecuteScript.as', 'r');
string s2;
while( !f.isEndOfFile() )
{
string s3 = f.readLine();
s2 += s3;
}
assert( s1 == s2 );
f.close();
}
|
// vim: tabstop=4 shiftwidth=4
// Copyright (c) 2010 , NetEase.com,Inc. All rights reserved.
//
// Author: Yang Bo (pop.atry@gmail.com)
//
// Use, modification and distribution are subject to the "New BSD License"
// as listed at <url: http://www.opensource.org/licenses/bsd-license.php >.
package com.netease.protobuf {
import flash.net.*;
import flash.utils.*;
import flash.events.*;
/**
* A simple sample of RPC implementation.
*/
public final class SimpleWebRPC {
private var urlPrefix:String
public function SimpleWebRPC(urlPrefix:String) {
this.urlPrefix = urlPrefix
}
private static const REF:Dictionary = new Dictionary
public function send(qualifiedMethodName:String,
requestMessage:Message,
rpcResult:Function,
responseClass:Class):void {
const loader:URLLoader = new URLLoader
REF[loader] = true;
loader.dataFormat = URLLoaderDataFormat.BINARY
loader.addEventListener(Event.COMPLETE, function(event:Event):void {
delete REF[loader]
const responseMessage:Message = new responseClass
responseMessage.mergeFrom(loader.data)
rpcResult(responseMessage)
})
function errorEventHandler(event:Event):void {
delete REF[loader]
rpcResult(event)
}
loader.addEventListener(IOErrorEvent.IO_ERROR, errorEventHandler)
loader.addEventListener(
SecurityErrorEvent.SECURITY_ERROR, errorEventHandler)
const request:URLRequest = new URLRequest(
urlPrefix + qualifiedMethodName.replace(/\./g, "/").
replace(/^((com|org|net)\/\w+\/\w+\/)?(.*)$/, "$3"))
const requestContent:ByteArray = new ByteArray
requestMessage.writeTo(requestContent)
if (requestContent.length != 0)
{
request.data = requestContent
}
request.contentType = "application/x-protobuf"
request.method = URLRequestMethod.POST
loader.load(request)
}
}
}
|
/*
* Copyright 2008-2009 the original author or authors.
*
* 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 org.spicefactory.parsley.core.builder.ref {
import org.spicefactory.lib.reflect.ClassInfo;
import org.spicefactory.parsley.core.lifecycle.ManagedObject;
import org.spicefactory.parsley.core.registry.ObjectDefinition;
import org.spicefactory.parsley.core.registry.ResolvableValue;
/**
* Represent a reference to an object in the Parsley Context by type.
*
* @author Jens Halm
*/
public class ObjectTypeReferenceArray implements ResolvableValue {
private var type:ClassInfo;
/**
* Creates a new instance.
*
* @param id the type of the referenced objects
*/
function ObjectTypeReferenceArray (type:ClassInfo) {
this.type = type;
}
public function resolve (target:ManagedObject) : * {
var defs:Array = target.context.findAllDefinitionsByType(type.getClass());
var resolved:Array = new Array();
for each (var def:ObjectDefinition in defs) {
resolved.push(target.resolveObjectReference(def));
}
return resolved;
}
/**
* @private
*/
public function toString () : String {
return "{ArrayInjection(type=" + type.name + ")}";
}
}
}
|
// Action script...
// [Initial MovieClip Action of sprite 20574]
#initclip 95
if (!dofus.graphics.gapi.ui.Register)
{
if (!dofus)
{
_global.dofus = new Object();
} // end if
if (!dofus.graphics)
{
_global.dofus.graphics = new Object();
} // end if
if (!dofus.graphics.gapi)
{
_global.dofus.graphics.gapi = new Object();
} // end if
if (!dofus.graphics.gapi.ui)
{
_global.dofus.graphics.gapi.ui = new Object();
} // end if
var _loc1 = (_global.dofus.graphics.gapi.ui.Register = function ()
{
super();
}).prototype;
_loc1.init = function ()
{
super.init(false, dofus.graphics.gapi.ui.Register.CLASS_NAME);
this._oLoader = new LoadVars();
var ref = this;
this._lvHearAbout = new LoadVars();
this._lvHearAbout.onLoad = function (bSuccess)
{
ref.onHearAboutLoad(bSuccess);
};
this._lvHearAbout.load(this.api.lang.getConfigText("WHERE_HEAR_LINK"));
};
_loc1.callClose = function ()
{
this.dispatchEvent({type: "close", target: this});
this.unloadThis();
return (true);
};
_loc1.createChildren = function ()
{
this.addToQueue({object: this, method: this.switchToStep, params: [1]});
this.addToQueue({object: this, method: this.initTexts});
this.addToQueue({object: this, method: this.addListeners});
this.addToQueue({object: this, method: this.initData});
this.addToQueue({object: this, method: this.initCrypto});
this.addToQueue({object: this, method: this.selectCountry, params: [this.api.datacenter.Basics.aks_detected_country]});
};
_loc1.initTexts = function ()
{
this._winBackground.title = this.api.lang.getText("REGISTER_TITLE");
this._lblAccountNameTitle.text = this.api.lang.getText("REGISTER_SECTION1_TITLE");
this._lblAccountName.text = this.api.lang.getText("REGISTER_LOGIN");
this._lblPassword.text = this.api.lang.getText("REGISTER_PASSOWRD1");
this._lblConfirmPassword.text = this.api.lang.getText("REGISTER_PASSOWRD2");
this._lblEmail.text = this.api.lang.getText("REGISTER_EMAIL");
this._lblPersonalDataTitle.text = this.api.lang.getText("REGISTER_PERSONAL_DATAS");
this._lblLastName.text = this.api.lang.getText("REGISTER_LAST_NAME");
this._lblFirstName.text = this.api.lang.getText("REGISTER_FIRST_NAME");
this._lblBirthDate.text = this.api.lang.getText("REGISTER_BIRTHDAY");
this._lblGender.text = this.api.lang.getText("REGISTER_GENDER");
this._lblFemale.text = this.api.lang.getText("REGISTER_GENDER_FEMALE");
this._lblMale.text = this.api.lang.getText("REGISTER_GENDER_MALE");
this._lblKnowingDofus.text = this.api.lang.getText("REGISTER_HOW_HEAR_ABOUT");
this._lblNewsletter.text = this.api.lang.getText("REGISTER_NEWSLETTER");
this._lblSecretQuestionTitle.text = this.api.lang.getText("REGISTER_SECTION2_TITLE");
this._lblSecretQuestion.text = this.api.lang.getText("REGISTER_QUESTION");
this._lblSecretAnswer.text = this.api.lang.getText("REGISTER_ANSWER");
this._lblNoticeSecretQuestion.text = this.api.lang.getText("REGISTER_QUESTION_NOTICE");
this._lblVerificationCodeTitle.text = this.api.lang.getText("REGISTER_CRYPTO_TITLE");
this._lblCopyCode.text = this.api.lang.getText("REGISTER_CRYPTO");
this._lblLocalisationTitle.text = this.api.lang.getText("REGISTER_LOCALISATION");
this._lblCountry.text = this.api.lang.getText("REGISTER_COUNTRY");
this._lblCommunityNotice.text = this.api.lang.getText("REGISTER_COMMUNITY_NOTICE");
this._lblCommunity.text = this.api.lang.getText("REGISTER_COMMUNITY");
this._lblCGUValidated.text = this.api.lang.getText("REGISTER_CONDITIONS");
this._lblBackButton.text = this.api.lang.getText("BACK").toUpperCase();
};
_loc1.addListeners = function ()
{
this._btnClose.addEventListener("click", this);
var ref = this;
this._mcNewsletterTrigger.onRelease = function ()
{
ref.click({target: this});
};
this._mcMaleTrigger.onRelease = function ()
{
ref.click({target: this});
};
this._mcFemaleTrigger.onRelease = function ()
{
ref.click({target: this});
};
this._mcCGUTrigger.onRelease = function ()
{
ref.click({target: this});
};
this._btnFemale.addEventListener("stateChanged", this);
this._btnMale.addEventListener("stateChanged", this);
this._mcCrypto.onRelease = function ()
{
ref.initCrypto();
};
this._mcCrypto.onRollOver = function ()
{
ref.showCryptoTooltip();
};
this._mcCrypto.onRollOut = function ()
{
ref.hideTooltip();
};
this._mcValidateButton.onRelease = function ()
{
ref.click({target: this});
};
this._mcBackButton.onRelease = function ()
{
ref.click({target: this});
};
this._cbCountry.addEventListener("itemSelected", this);
this.api.kernel.KeyManager.addShortcutsListener("onShortcut", this);
};
_loc1.initData = function ()
{
this._tiPassword1.password = true;
this._tiPassword2.password = true;
this._btnMale.radio = true;
this._btnFemale.radio = true;
var _loc2 = new ank.utils.ExtendedArray();
_loc2.push({label: "-", data: "-1"});
var _loc3 = 1;
while (++_loc3, _loc3 < 32)
{
_loc2.push({label: _loc3, data: _loc3});
} // end while
this._cbDay.dataProvider = _loc2;
this._cbDay.selectedIndex = 0;
var _loc4 = new ank.utils.ExtendedArray();
_loc4.push({label: "-", data: "-1"});
var _loc5 = 1;
while (++_loc5, _loc5 < 13)
{
var _loc6 = new Date(0, _loc5, 0, 0, 0, 0, 0);
_loc4.push({label: org.utils.SimpleDateFormatter.formatDate(_loc6, "MMM", this.api.config.language), data: _loc5});
} // end while
this._cbMonth.dataProvider = _loc4;
this._cbMonth.selectedIndex = 0;
var _loc7 = new ank.utils.ExtendedArray();
_loc7.push({label: "-", data: "-1"});
var _loc8 = new Date().getFullYear() - 5;
while (--_loc8, _loc8 > new Date().getFullYear() - 105)
{
_loc7.push({label: _loc8, data: _loc8});
} // end while
this._cbYear.dataProvider = _loc7;
this._cbYear.selectedIndex = 0;
this.addToQueue({object: this, method: this.refreshHearingAbout});
var _loc9 = ank.utils.Countries.COUNTRIES[this.api.config.language];
if (_loc9 == undefined)
{
_loc9 = ank.utils.Countries.COUNTRIES.en;
} // end if
var _loc10 = new ank.utils.ExtendedArray();
_loc10.push({label: "", data: "--"});
for (var k in _loc9)
{
_loc10.push({label: _loc9[k], data: k});
} // end of for...in
this._cbCountry.dataProvider = _loc10;
this._cbCountry.selectedIndex = 0;
var _loc11 = this.api.lang.getServerCommunities();
var _loc12 = new ank.utils.ExtendedArray();
var _loc13 = 1;
_loc12.push({label: "", data: "--"});
var _loc14 = 0;
while (++_loc14, _loc14 < _loc11.length)
{
if (_loc11[_loc14].d)
{
_loc12.push({label: _loc11[_loc14].n, data: _loc11[_loc14].i, c: _loc11[_loc14].c, index: _loc13++});
} // end if
} // end while
this._cbCommunity.dataProvider = _loc12;
this._cbCommunity.selectedIndex = 0;
this._tiAccount.setFocus();
};
_loc1.initCrypto = function (bForce)
{
if (this._bCurrentlyLoading)
{
return;
} // end if
if (this._nCurrentStep != 2 && !bForce)
{
return;
} // end if
this._bCryptoAlreadyLoaded = true;
this._ldrCrypto.forceReload = true;
this._ldrCrypto.contentPath = this.api.lang.getConfigText("CRYPTO_LINK");
this._tiCopyCode.text = "";
};
_loc1.switchToStep = function (nStep)
{
switch (nStep)
{
case 1:
{
this._bgStep2._visible = false;
this._lblSecretQuestionTitle._visible = false;
this._lblVerificationCodeTitle._visible = false;
this._lblLocalisationTitle._visible = false;
this._lblNoticeSecretQuestion._visible = false;
this._lblSecretQuestion._visible = false;
this._lblSecretAnswer._visible = false;
this._lblCopyCode._visible = false;
this._lblCountry._visible = false;
this._lblCommunity._visible = false;
this._lblCommunityNotice._visible = false;
this._lblCGUValidated._visible = false;
this._tiQuestion._visible = false;
this._tiAnswer._visible = false;
this._tiCopyCode._visible = false;
this._cbCountry._visible = false;
this._cbCommunity._visible = false;
this._btnCGU._visible = false;
this._mcCGUTrigger._visible = false;
this._ldrCrypto._visible = false;
this._mcCrypto._visible = false;
this._bgStep1._visible = true;
this._lblAccountNameTitle._visible = true;
this._lblPersonalDataTitle._visible = true;
this._lblAccountName._visible = true;
this._lblPassword._visible = true;
this._lblConfirmPassword._visible = true;
this._lblEmail._visible = true;
this._lblLastName._visible = true;
this._lblFirstName._visible = true;
this._lblBirthDate._visible = true;
this._lblGender._visible = true;
this._lblFemale._visible = true;
this._lblMale._visible = true;
this._lblKnowingDofus._visible = true;
this._lblNewsletter._visible = true;
this._tiAccount._visible = true;
this._tiPassword1._visible = true;
this._tiPassword2._visible = true;
this._tiEmail._visible = true;
this._tiFirstName._visible = true;
this._tiLastName._visible = true;
this._cbDay._visible = true;
this._cbMonth._visible = true;
this._cbYear._visible = true;
this._btnFemale._visible = true;
this._mcFemaleTrigger._visible = true;
this._btnMale._visible = true;
this._mcMaleTrigger._visible = true;
this._cbKnowingDofus._visible = true;
this._btnNewsletter._visible = true;
this._mcNewsletterTrigger._visible = true;
if (this._lblNextStepButton.text != undefined)
{
this._lblNextStepButton.text = String(this.api.lang.getText("VALIDATE")).toUpperCase();
} // end if
this._lblBackButton._visible = false;
this._mcBackButton._visible = false;
this._tiAccount.tabIndex = 5;
this._tiPassword1.tabIndex = 6;
this._tiPassword2.tabIndex = 7;
this._tiEmail.tabIndex = 8;
this._tiLastName.tabIndex = 9;
this._tiFirstName.tabIndex = 10;
this._tiAccount.setFocus();
break;
}
case 2:
{
this._bgStep1._visible = false;
this._lblAccountNameTitle._visible = false;
this._lblPersonalDataTitle._visible = false;
this._lblAccountName._visible = false;
this._lblPassword._visible = false;
this._lblConfirmPassword._visible = false;
this._lblEmail._visible = false;
this._lblLastName._visible = false;
this._lblFirstName._visible = false;
this._lblBirthDate._visible = false;
this._lblGender._visible = false;
this._lblFemale._visible = false;
this._lblMale._visible = false;
this._lblKnowingDofus._visible = false;
this._lblNewsletter._visible = false;
this._tiAccount._visible = false;
this._tiPassword1._visible = false;
this._tiPassword2._visible = false;
this._tiEmail._visible = false;
this._tiFirstName._visible = false;
this._tiLastName._visible = false;
this._cbDay._visible = false;
this._cbMonth._visible = false;
this._cbYear._visible = false;
this._btnFemale._visible = false;
this._mcFemaleTrigger._visible = false;
this._btnMale._visible = false;
this._mcMaleTrigger._visible = false;
this._cbKnowingDofus._visible = false;
this._btnNewsletter._visible = false;
this._mcNewsletterTrigger._visible = false;
this._bgStep2._visible = true;
this._lblSecretQuestionTitle._visible = true;
this._lblVerificationCodeTitle._visible = true;
this._lblLocalisationTitle._visible = true;
this._lblNoticeSecretQuestion._visible = true;
this._lblSecretQuestion._visible = true;
this._lblSecretAnswer._visible = true;
this._lblCopyCode._visible = true;
this._lblCountry._visible = true;
this._lblCommunity._visible = true;
this._lblCommunityNotice._visible = true;
this._lblCGUValidated._visible = true;
this._tiQuestion._visible = true;
this._tiAnswer._visible = true;
this._tiCopyCode._visible = true;
this._cbCountry._visible = true;
this._cbCommunity._visible = true;
this._btnCGU._visible = true;
this._mcCGUTrigger._visible = true;
this._ldrCrypto._visible = true;
this._mcCrypto._visible = true;
if (this._lblNextStepButton.text != undefined)
{
this._lblNextStepButton.text = String(this.api.lang.getText("TERMINATE_WORD")).toUpperCase();
} // end if
this._lblBackButton._visible = true;
this._mcBackButton._visible = true;
if (!this._bCryptoAlreadyLoaded)
{
this.initCrypto(true);
} // end if
this._tiQuestion.tabIndex = 5;
this._tiAnswer.tabIndex = 6;
this._tiCopyCode.tabIndex = 7;
this._tiQuestion.setFocus();
break;
}
} // End of switch
this._nCurrentStep = nStep;
};
_loc1.selectCountry = function (sCountry)
{
switch (sCountry)
{
case "UK":
{
sCountry = "GB";
break;
}
} // End of switch
var _loc3 = this._cbCountry.dataProvider;
var _loc4 = 0;
while (++_loc4, _loc4 < _loc3.length)
{
if (_loc3[_loc4].data == sCountry)
{
this._cbCountry.selectedIndex = _loc4;
this.selectCommunityFromCountry(sCountry);
} // end if
} // end while
};
_loc1.selectCommunityFromCountry = function (sCountry)
{
var _loc3 = this._cbCommunity.dataProvider;
var _loc4 = 0;
var _loc5 = 0;
while (++_loc5, _loc5 < _loc3.length)
{
var _loc6 = _loc3[_loc5].c;
var _loc7 = 0;
while (++_loc7, _loc7 < _loc6.length)
{
if (_loc6[_loc7] == sCountry)
{
this._cbCommunity.selectedIndex = _loc3[_loc5].index;
return;
continue;
} // end if
if (_loc6[_loc7] == "XX")
{
_loc4 = _loc3[_loc5].index;
} // end if
} // end while
} // end while
this._cbCommunity.selectedIndex = _loc4;
};
_loc1.preValidateForm = function (nStep)
{
switch (nStep)
{
case 1:
{
if (this._tiAccount.text.length <= 0 || (this._tiPassword1.text.length <= 0 || (this._tiPassword2.text.length <= 0 || (this._tiEmail.text.length <= 0 || (this._tiLastName.text.length <= 0 || (this._tiFirstName.text.length <= 0 || (this._cbDay.selectedItem.data == -1 || (this._cbMonth.selectedItem.data == -1 || (this._cbYear.selectedItem.data == -1 || this._cbKnowingDofus.selectedItem.id == 0)))))))))
{
this.api.kernel.showMessage(this.api.lang.getText("LOGIN_SUBSCRIBE"), this.api.lang.getText("REGISTER_NOT_FULLFILLED"), "ERROR_BOX");
return (false);
}
else if (this._tiPassword1.text.length < 8 || this._tiPassword2.text.length < 8)
{
this.api.kernel.showMessage(this.api.lang.getText("LOGIN_SUBSCRIBE"), this.api.lang.getText("PASSWORD_TOO_SHORT"), "ERROR_BOX");
return (false);
} // end else if
break;
}
case 2:
{
if (this._tiQuestion.text.length <= 0 || (this._tiAnswer.text.length <= 0 || (this._tiCopyCode.text.length <= 0 || (this._cbCountry.selectedItem.data == "--" || this._cbCommunity.selectedItem.data == "--"))))
{
this.api.kernel.showMessage(this.api.lang.getText("LOGIN_SUBSCRIBE"), this.api.lang.getText("REGISTER_NOT_FULLFILLED"), "ERROR_BOX");
return (false);
} // end if
break;
}
} // End of switch
return (true);
};
_loc1.validateForm = function ()
{
this._oLoader.registerFrom = "game_dofus";
this._oLoader.lang = this.api.config.language;
this._oLoader.validRegister1 = true;
this._oLoader.loginAG = this._tiAccount.text;
this._oLoader.passAG = this._tiPassword1.text;
this._oLoader.passAG2 = this._tiPassword2.text;
this._oLoader.email = this._tiEmail.text;
this._oLoader.lastname = this._tiLastName.text;
this._oLoader.firstname = this._tiFirstName.text;
this._oLoader.datenaiss_d = this._cbDay.selectedItem.data;
this._oLoader.datenaiss_m = this._cbMonth.selectedItem.data;
this._oLoader.datenaiss_y = this._cbYear.selectedItem.data;
this._oLoader.sexe = this._btnFemale.selected ? ("F") : ("M");
this._oLoader.knowgameid = this._cbKnowingDofus.selectedItem.data;
if (this._btnNewsletter.selected)
{
this._oLoader.valid_newsletter = true;
} // end if
this._oLoader.question = this._tiQuestion.text;
this._oLoader.answer = this._tiAnswer.text;
this._oLoader.verifCode = this._tiCopyCode.text;
this._oLoader.pays = this._cbCountry.selectedItem.data;
this._oLoader.community_id = this._cbCommunity.selectedItem.data;
if (this._btnCGU.selected)
{
this._oLoader.valid_cgu = true;
} // end if
this._oResult = new LoadVars();
this._oResult.owner = this;
this._oResult.onLoad = function (bSuccess)
{
this.owner.onResultLoad(bSuccess);
};
this._oLoader.sendAndLoad(this.api.lang.getConfigText("REGISTER_LINK"), this._oResult, "POST");
this._lblNextStepButton.text = this.api.lang.getText("LOADING");
this._bCurrentlyLoading = true;
this.api.ui.loadUIComponent("CenterText", "CenterText", {text: this.api.lang.getText("WAITING_MSG_RECORDING"), timer: 0, background: true}, {bForceLoad: true});
};
_loc1.refreshHearingAbout = function ()
{
if (this._bHearAboutFailed)
{
this._cbKnowingDofus._visible = false;
this._lblKnowingDofus._visible = false;
return;
} // end if
if (this._aHearAboutStrings == undefined)
{
if (++this._nHearingAboutFailCount > dofus.graphics.gapi.ui.Register.LOAD_TIMEOUT)
{
return;
} // end if
this.addToQueue({object: this, method: this.refreshHearingAbout});
return;
}
else
{
var _loc2 = new ank.utils.ExtendedArray();
_loc2.push({label: this.api.lang.getText("PLEASE_SELECT"), id: 0});
var _loc3 = 0;
while (++_loc3, _loc3 < this._aHearAboutIDs.length)
{
_loc2.push({label: this._aHearAboutStrings["ID" + this._aHearAboutIDs[_loc3]], data: this._aHearAboutIDs[_loc3]});
} // end while
this._cbKnowingDofus.dataProvider = _loc2;
this._cbKnowingDofus.selectedIndex = 0;
} // end else if
};
_loc1.showCryptoTooltip = function ()
{
this.gapi.showTooltip(this.api.lang.getText("REGISTER_CLICK_TO_REGEN"), this._mcCrypto, 0, undefined);
};
_loc1.hideTooltip = function ()
{
this.gapi.hideTooltip();
};
_loc1.onShortcut = function (sShortcut)
{
if (sShortcut == "ACCEPT_CURRENT_DIALOG")
{
if (this._tiAccount.focused || (this._tiAnswer.focused || (this._tiCopyCode.focused || (this._tiEmail.focused || (this._tiFirstName.focused || (this._tiLastName.focused || (this._tiPassword1.focused || (this._tiPassword2.focused || this._tiQuestion.focused))))))))
{
this.click({target: this._mcValidateButton});
return (false);
} // end if
} // end if
return (true);
};
_loc1.itemSelected = function (oEvent)
{
switch (oEvent.target)
{
case this._cbCountry:
{
var _loc3 = this._cbCountry.selectedItem.data;
if (_loc3.length != 2)
{
return;
} // end if
this.selectCommunityFromCountry(_loc3);
break;
}
} // End of switch
};
_loc1.stateChanged = function (oEvent)
{
switch (oEvent.target)
{
case this._btnFemale:
{
this._btnMale.removeEventListener("stateChanged", this);
this._btnMale.selected = !oEvent.value;
this._btnMale.addEventListener("stateChanged", this);
break;
}
case this._btnMale:
{
this._btnFemale.removeEventListener("stateChanged", this);
this._btnFemale.selected = !oEvent.value;
this._btnFemale.addEventListener("stateChanged", this);
break;
}
} // End of switch
};
_loc1.click = function (oEvent)
{
if (this._bCurrentlyLoading)
{
return;
} // end if
switch (oEvent.target)
{
case this._mcNewsletterTrigger:
{
this._btnNewsletter.selected = !this._btnNewsletter.selected;
break;
}
case this._mcFemaleTrigger:
{
this._btnFemale.selected = true;
break;
}
case this._mcMaleTrigger:
{
this._btnMale.selected = true;
break;
}
case this._mcCGUTrigger:
{
this._btnCGU.selected = !this._btnCGU.selected;
break;
}
case this._btnClose:
{
this.callClose();
break;
}
case this._mcValidateButton:
{
switch (this._nCurrentStep)
{
case 1:
{
if (this.preValidateForm(1))
{
this.switchToStep(2);
} // end if
break;
}
case 2:
{
if (this.preValidateForm(2))
{
this.validateForm();
} // end if
break;
}
} // End of switch
break;
}
case this._mcBackButton:
{
this.switchToStep(1);
break;
}
} // End of switch
};
_loc1.onResultLoad = function (bSuccess)
{
this._lblNextStepButton.text = this.api.lang.getText("TERMINATE_WORD").toUpperCase();
this._bCurrentlyLoading = false;
this.api.ui.unloadUIComponent("CenterText");
if (!bSuccess)
{
this.api.kernel.showMessage(this.api.lang.getText("LOGIN_SUBSCRIBE"), this.api.lang.getText("REGISTRATION_ERROR"), "ERROR_BOX");
this.initCrypto(true);
}
else if (this._oResult.result != "")
{
this.api.kernel.showMessage(this.api.lang.getText("LOGIN_SUBSCRIBE"), this._oResult.result, "ERROR_BOX");
this.initCrypto(true);
}
else
{
this.api.kernel.showMessage(this.api.lang.getText("LOGIN_SUBSCRIBE"), this.api.lang.getText("REGISTRATION_DONE", [this._tiAccount.text, this._tiQuestion.text, this._tiAnswer.text, this._tiEmail.text]), "ERROR_BOX");
this.callClose();
} // end else if
};
_loc1.onHearAboutLoad = function (bSuccess)
{
if (bSuccess)
{
var _loc3 = Number(this._lvHearAbout.answer_count);
this._aHearAboutStrings = new Array();
this._aHearAboutIDs = new Array();
var _loc4 = 0;
while (++_loc4, _loc4 < _loc3)
{
var _loc5 = _loc4 + 1;
this._aHearAboutIDs.push(Number(this._lvHearAbout["answer_id" + _loc5]));
this._aHearAboutStrings["ID" + this._lvHearAbout["answer_id" + _loc5]] = this._lvHearAbout["answer_desc" + _loc5];
} // end while
}
else
{
this._bHearAboutFailed = true;
} // end else if
};
ASSetPropFlags(_loc1, null, 1);
(_global.dofus.graphics.gapi.ui.Register = function ()
{
super();
}).CLASS_NAME = "Register";
(_global.dofus.graphics.gapi.ui.Register = function ()
{
super();
}).LOAD_TIMEOUT = 100;
_loc1._nHearingAboutFailCount = 0;
_loc1._bHearAboutFailed = false;
_loc1._nCurrentStep = 0;
_loc1._bCryptoAlreadyLoaded = false;
_loc1._bCurrentlyLoading = false;
} // end if
#endinitclip
|
package com.tinyspeck.engine.net {
public class NetOutgoingHousesFloorSetVO extends NetOutgoingMessageVO {
public var floor_key:String;
public var floor_type:String;
public function NetOutgoingHousesFloorSetVO(floor_key:String, floor_type:String) {
super(MessageTypes.HOUSES_FLOOR_SET);
this.floor_key = floor_key;
this.floor_type = floor_type;
}
}
} |
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.*;
import view.image.common.AvatarItemImage;
import view.image.shop.*;
import view.image.item.*;
import view.scene.common.*;
import view.scene.item.PartInventoryClip;
import view.scene.BaseScene;
import view.scene.ModelWaitShowThread;
import view.*;
import view.utils.*;
import controller.LobbyCtrl;
import controller.*;
/**
* ShopClothListPanelの表示クラス
*
*/
public class ShopClothListPanel extends ShopBodyListPanel
{
// アイテムパネル
private var _shopInventoryPanelImage:ShopInventoryPanelImage = new ShopInventoryPanelImage(AvatarPart.PARTS_CLOTHES_TYPE);
/**
* コンストラクタ
*
*/
public function ShopClothListPanel(shopID:int =0)
{
super(shopID);
}
override protected function get tabTypes():Array
{
return AvatarPart.PARTS_CLOTHES_TYPE;
}
override protected function getItemTypeIdx(i:int):int
{
return i;
}
protected override function get itemInventoryPanelImage():BasePanelImage
{
return _shopInventoryPanelImage;
}
// インベントリからデータを生成する
override protected function inventoryToData():void
{
var i:int;
var itemNum:int = 0; // アイテムの個数
var items:Array = Shop.ID(_shopID).clothPartsList;
var prices:Array = Shop.ID(_shopID).clothPartsPriceList;
var coins:Array = Shop.ID(_shopID).clothPartsCoinList;
var part:AvatarPart;
log.writeLog(log.LV_INFO, this, "items", items);
log.writeLog(log.LV_INFO, this, "price", prices);
// データプロバイダーにタイプごとのアイテムを設定する
for(i = 0; i < items.length; i++)
{
part = items[i];
if (part && !checkPremiumCoin(coins[part.id]))
{
// アイテムのイメージを作成
setItem(part);
// アイテムの個数をインクリメント
_itemDic[part].price = prices[part.id];
_itemDic[part].coins = coins[part.id];
log.writeLog(log.LV_INFO, this, "dp p c",prices[part.id], coins[part.id]);
log.writeLog(log.LV_INFO, this, "dp dp",_dpList[part.type-part.genre]);
_dpList[part.type-AvatarPart.PARTS_GENRE_ID[part.genre]].push(_itemDic[part]);
}
}
log.writeLog(log.LV_INFO, this, "dp seted");
// アイテムの個数
var partsInvSet:Array = AvatarPartInventory.getGenreItems(AvatarPart.GENRE_CLOTH); /* of api */
for(i = 0; i < partsInvSet.length; i++)
{
part = partsInvSet[i].avatarPart;
// アイテムのイメージを作成
if (_itemDic[part] != null)
{
// setItem(part);
// アイテムの個数をインクリメント
_itemDic[part].count += 1;
}
}
}
// アイテム購入に成功した時のイベント
override protected function getAvatarPartSuccessHandler(e:AvatarPartEvent):void
{
if (AvatarPart.ID(e.id).genre == AvatarPart.GENRE_CLOTH)
{
var dp:Array = _dpList[AvatarPart.ID(e.id).type-AvatarPart.GENRE_CLOTH] as Array;
updateCount(dp, e.id);
}
}
}
}
|
package alternativa.a3d.systems.hud
{
import alternativa.engine3d.core.RayIntersectionData;
import arena.views.hud.ArenaHUD;
import ash.core.System;
import components.Pos;
import flash.geom.Vector3D;
import alternativa.a3d.rayorcollide.ITrajRaycastImpl;
import haxe.Log;
import util.geom.Vec3;
/**
* ...
* @author Glenn Ko
*/
public class TrajRaycastTester extends System
{
private var impl:ITrajRaycastImpl;
public var direction:Vector3D;
public var origin:Vector3D;
public function TrajRaycastTester(impl:ITrajRaycastImpl, origin:Vector3D, direction:Vector3D)
{
this.origin = origin;
this.direction = direction;
this.impl = impl;
}
override public function update(t:Number):void
{
var data:RayIntersectionData = impl.intersectRayTraj(origin, direction, 20.4318 * ArenaHUD.METER_UNIT_SCALE * .5, 255);
if (data != null) {
//Log.trace(data.time);
}
else {
// Log.trace("No hit");
}
}
}
} |
package com.hurlant.util.asn1.parser {
import com.hurlant.util.asn1.type.UTCTimeType;
public function utcTime():UTCTimeType {
return new UTCTimeType;
}
} |
package treefortress.spriter.core
{
public class ChildReference
{
public var id:int;
public var timeline:int;
public var key:int;
public var zIndex:int;
public function ChildReference(){
}
}
} |
// This first example, maintaining tradition, prints a "Hello World" message.
// Furthermore it shows:
// - Using the Sample utility functions as a base for the application
// - Adding a Text element to the graphical user interface
// - Subscribing to and handling of update events
#include "Scripts/Utilities/Sample.as"
void Start()
{
// Execute the common startup for samples
SampleStart();
// Create "Hello World" Text
CreateText();
// Finally, hook-up this HelloWorld instance to handle update events
SubscribeToEvents();
}
void CreateText()
{
// Construct new Text object
Text@ helloText = Text();
// Set String to display
helloText.text = "Hello World from Urho3D!";
// Set font and text color
helloText.SetFont(cache.GetResource("Font", "Fonts/Anonymous Pro.ttf"), 30);
helloText.color = Color(0.0f, 1.0f, 0.0f);
// Align Text center-screen
helloText.horizontalAlignment = HA_CENTER;
helloText.verticalAlignment = VA_CENTER;
// Add Text instance to the UI root element
ui.root.AddChild(helloText);
}
void SubscribeToEvents()
{
// Subscribe HandleUpdate() function for processing update events
SubscribeToEvent("Update", "HandleUpdate");
}
void HandleUpdate(StringHash eventType, VariantMap& eventData)
{
// Do nothing for now, could be extended to eg. animate the display
}
|
/*
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.core
{
import flash.utils.Dictionary;
import flash.utils.describeType;
import flash.utils.getDefinitionByName;
import starling.display.DisplayObject;
import starling.display.DisplayObjectContainer;
import starling.events.Event;
/**
* Watches a container on the display list. As new display objects are
* added, if they match a specific type, they will be passed to initializer
* functions to set properties, call methods, or otherwise modify them.
* Useful for initializing skins and styles on UI controls.
*
* <p>If a display object matches multiple types that have initializers, and
* <code>exactTypeMatching</code> is disabled, the initializers will be
* executed in order following the inheritance chain.</p>
*/
public class AddedWatcher
{
/**
* Constructor.
*/
public function AddedWatcher(root:DisplayObjectContainer)
{
this.root = root;
this.root.addEventListener(Event.ADDED, addedHandler);
}
/**
* The minimum base class required before the AddedWatcher will check
* to see if a particular display object has any initializers.
*/
public var requiredBaseClass:Class = FeathersControl;
/**
* Determines if only the object added should be processed or if its
* children should be processed recursively.
*/
public var processRecursively:Boolean = true;
/**
* The root of the display list that is watched for added children.
*/
protected var root:DisplayObjectContainer;
private var _noNameTypeMap:Dictionary = new Dictionary(true);
private var _nameTypeMap:Dictionary = new Dictionary(true);
private var _superTypeMap:Dictionary = new Dictionary(true);
private var _superTypes:Vector.<Class> = new <Class>[];
/**
* Sets the initializer for a specific class.
*/
public function setInitializerForClass(type:Class, initializer:Function, withName:String = null):void
{
if(!withName)
{
this._noNameTypeMap[type] = initializer;
return;
}
var nameTable:Object = this._nameTypeMap[type];
if(!nameTable)
{
this._nameTypeMap[type] = nameTable = {};
}
nameTable[withName] = initializer;
}
/**
* Sets an initializer for a specific class and any subclasses. This
* option can potentially hurt performance, so use sparingly.
*/
public function setInitializerForClassAndSubclasses(type:Class, initializer:Function):void
{
const index:int = this._superTypes.indexOf(type);
if(index < 0)
{
this._superTypes.push(type);
}
this._superTypeMap[type] = initializer;
}
/**
* If an initializer exists for a specific class, it will be returned.
*/
public function getInitializerForClass(type:Class, withName:String = null):Function
{
if(!withName)
{
return this._noNameTypeMap[type] as Function;
}
const nameTable:Object = this._nameTypeMap[type];
if(!nameTable)
{
return null;
}
return nameTable[withName] as Function;
}
/**
* If an initializer exists for a specific class and its subclasses, the initializer will be returned.
*/
public function getInitializerForClassAndSubclasses(type:Class):Function
{
return this._superTypeMap[type];
}
/**
* If an initializer exists for a specific class, it will be removed
* completely.
*/
public function clearInitializerForClass(type:Class, withName:String = null):void
{
if(!withName)
{
delete this._noNameTypeMap[type];
return;
}
const nameTable:Object = this._nameTypeMap[type];
if(!nameTable)
{
return;
}
delete nameTable[withName];
return;
}
/**
* If an initializer exists for a specific class and its subclasses, the
* initializer will be removed completely.
*/
public function clearInitializerForClassAndSubclasses(type:Class):void
{
delete this._superTypeMap[type];
const index:int = this._superTypes.indexOf(type);
if(index >= 0)
{
this._superTypes.splice(index, 1);
}
}
/**
* @private
*/
protected function applyAllStyles(target:DisplayObject):void
{
const superTypeCount:int = this._superTypes.length;
for(var i:int = 0; i < superTypeCount; i++)
{
var type:Class = this._superTypes[i];
if(target is type)
{
this.applyAllStylesForTypeFromMaps(target, type, this._superTypeMap);
}
}
type = Object(target).constructor;
this.applyAllStylesForTypeFromMaps(target, type, this._noNameTypeMap, this._nameTypeMap);
}
/**
* @private
*/
protected function applyAllStylesForTypeFromMaps(target:DisplayObject, type:Class, map:Dictionary, nameMap:Dictionary = null):void
{
var initializer:Function;
if(nameMap)
{
const nameTable:Object = nameMap[type];
if(nameTable)
{
if(target is FeathersControl)
{
const uiControl:FeathersControl = FeathersControl(target);
for(var name:String in nameTable)
{
if(uiControl.nameList.contains(name))
{
initializer = nameTable[name] as Function;
if(initializer != null)
{
initializer(target);
return;
}
}
}
}
}
}
initializer = map[type] as Function;
if(initializer != null)
{
initializer(target);
}
}
/**
* @private
*/
protected function addObject(target:DisplayObject):void
{
const targetAsRequiredBaseClass:DisplayObject = DisplayObject(target as requiredBaseClass);
if(targetAsRequiredBaseClass)
{
this.applyAllStyles(target);
}
if(this.processRecursively)
{
const targetAsContainer:DisplayObjectContainer = target as DisplayObjectContainer;
if(targetAsContainer)
{
const childCount:int = targetAsContainer.numChildren;
for(var i:int = 0; i < childCount; i++)
{
var child:DisplayObject = targetAsContainer.getChildAt(i);
this.addObject(child);
}
}
}
}
/**
* @private
*/
protected function addedHandler(event:Event):void
{
this.addObject(event.target as DisplayObject);
}
}
} |
/*
* FusionCharts Free v2
* http://www.fusioncharts.com/free
*
* Copyright (c) 2009 InfoSoft Global (P) Ltd.
* Dual licensed under the MIT (X11) and GNU GPL licenses.
* http://www.fusioncharts.com/free/license
*
* MIT License: http://www.opensource.org/licenses/mit-license.php
* GPL License: http://www.gnu.org/copyleft/gpl.html
*
* Date: 2009-08-21
*/
//--------------------------------------------------------------------------------
/*
Grid Class defined here.
We use the Grid class to render a draggable simple data table.
*/
Grid = function (depth, xPos, yPos, width, height, rows, columns, cellWidth, cellHeight, allowResize, borderColor, borderAlpha, resizeBarColor, resizeBarThickness, resizeBarAlpha) {
// Constructor function
// Details of parameters:
// Depth - Level in which the entire grid would be plotted
// xPos - Starting x Position of the grid (global perspective)
// yPos - Starting y Position of the grid (global perspective)
// Width - Width of the grid to be drawn
// Height - Height of the grid to be drawn
// Rows - Number of rows that the grid would plot
// Columns - Number of columns that the grid would plot
// CellWidth (Array) - A single dimension array consisting width of each column
// CellHeight (Array) - A single dimension array consisting required height for each row
// allowResize (Boolean) - Whether to allow the users to resize the grid
// borderColor, borderAlpha - Grid border properties
// resizeBarColor, resizeBarThickness, resizeBarAlpha - Resize bar properties
// Copy parameters to class objects
this.depth = depth;
this.xPos = xPos;
this.yPos = yPos;
this.gridWidth = width;
this.gridHeight = height;
this.rows = rows;
this.columns = columns;
this.allowResize = allowResize;
// Initialize cellwidth and height as arrays
this.cellWidth = new Array();
this.cellHeight = new Array();
if (cellWidth != null && cellWidth != undefined && cellWidth.length>0) {
this.cellWidth = cellWidth;
// Unshift the array to make it with base 1
this.cellWidth.unshift(0);
}
if (cellHeight != null && cellHeight != undefined && cellHeight.length>0) {
this.cellHeight = cellHeight;
// Unshift the array to make it with base 1
this.cellHeight.unshift(0);
}
this.borderColor = borderColor;
this.borderAlpha = borderAlpha;
// Resize bar details
this.resizeBarColor = resizeBarColor;
this.resizeBarThickness = resizeBarThickness;
this.resizeBarAlpha = resizeBarAlpha;
// Create the data container for the grid
this.cells = new Array(this.rows);
// Create rows x columns number of cells
for (i=1; i<=this.rows; i++) {
this.cells[i] = new Array();
}
// Now we can refer to any cell as this.cells[r][c].
// Create a depth counter
this.currDepth = 1;
// Instance reference
this.instance = this;
// CONSTANT - Padding between the drag resize bar and column end
this.resizePadding = 15;
// Initialize the grid
this.initialize();
};
//Create the cell object
Grid.cell = function(bgColor, bgAlpha, label, font, fontColor, fontSize, align, vAlign, isBold, isUnderLine, link) {
//Each cell object represents a particular cell
this.bgColor = bgColor;
this.bgAlpha = bgAlpha;
this.label = label;
this.font = font;
this.fontColor = fontColor;
this.fontSize = fontSize;
this.align = align;
this.vAlign = vAlign;
this.isBold = isBold;
this.isUnderLine =isUnderLine;
this.link = link;
//If it's underline add the <U> tags
if (this.isUnderLine==true)
{
this.label = "<U>" + this.label + "</U>";
}
//Add padding
//If the label is to be left aligned, add a space on the left to give padding effect
//Similarly, if it's to be right aligned, add padding on the right
switch (this.align.toUpperCase()) {
case "LEFT" :
this.label = " "+this.label;
break;
case "RIGHT" :
this.label = this.label+" ";
break;
}
};
Grid.prototype.initialize = function() {
//Initialization of grid basically refers to calculating the various positions
//and setting them as defaults if not explicitly set
//First, we work on cell width
//Convert all cell width to numbers
var unallocatedCellWidth = 0;
for (var i = 1; i<=this.columns; i++) {
if (this.cellWidth[i] == "" || this.cellWidth[i] == undefined || IsNaN(this.cellWidth[i]) == true) {
//Set it as 0 value
this.cellWidth[i] = 0;
//Increase the counter of cells whose width are unallocated
unallocatedCellWidth++;
} else {
//Convert the existing value into numbers (to be on safe side during calculations)
this.cellWidth[i] = Number(this.cellWidth[i]);
//If the cell width is more than the width of the grid, re-set
if (this.cellWidth[i]>this.gridWidth) {
//Set it to equal distance
this.cellWidth[i] = this.gridWidth/this.columns;
}
}
}
//Now, calculate the total cell width "explicitly" allotted by user
var cellWidthAllocation = 0;
var cellEquiWidth = 0;
for (var i = 1; i<=this.columns; i++) {
//Add to cellWidthAllocation
cellWidthAllocation = cellWidthAllocation+this.cellWidth[i];
}
//Now, divide the unallocated cell width into unallocated cells number
cellEquiWidth = Math.abs(this.gridWidth-cellWidthAllocation)/unallocatedCellWidth;
//Allot this equal width to cells having 0 values
for (var i = 1; i<=this.columns; i++) {
if (this.cellWidth[i] == 0) {
this.cellWidth[i] = cellEquiWidth;
}
}
//Do the same for height
//Convert all cell height to numbers
var unallocatedCellHeight = 0;
for (var i = 1; i<=this.rows; i++) {
if (this.cellHeight[i] == "" || this.cellHeight[i] == undefined || IsNaN(this.cellHeight[i]) == true) {
//Set it as 0 value
this.cellHeight[i] = 0;
//Increase the counter of cells whose height are unallocated
unallocatedCellHeight++;
} else {
//Convert the existing value into numbers (to be on safe side during calculations)
this.cellHeight[i] = Number(this.cellHeight[i]);
//If the cell height is more than the height of the grid, re-set
if (this.cellHeight[i]>this.gridHeight) {
//Set it to equal distance
this.cellHeight[i] = this.gridHeight/this.rows;
}
}
}
//Now, calculate the total cell height "explicitly" allotted by user
var cellHeightAllocation = 0;
var cellEquiHeight = 0;
for (var i = 1; i<=this.rows; i++) {
//Add to cellHeightAllocation
cellHeightAllocation = cellHeightAllocation+this.cellHeight[i];
}
//Now, divide the unallocated cell height into unallocated cells number
cellEquiHeight = Math.abs(this.gridHeight-cellHeightAllocation)/unallocatedCellHeight;
//Allot this equal height to cells having 0 values
for (var i = 1; i<=this.rows; i++) {
if (this.cellHeight[i] == 0) {
this.cellHeight[i] = cellEquiHeight;
}
}
};
Grid.prototype.setCellData = function(rowIndex, columnIndex, bgColor, bgAlpha, label, font, fontColor, fontSize, align, vAlign, isBold, isUnderLine, link) {
//This method sets the data for a paticular grid cell
//Create a temporary Cell Object to represent this grid's cell
var objCell = new Grid.cell(bgColor, bgAlpha, label, font, fontColor, fontSize, align, vAlign, isBold, isUnderLine, link);
//Set this object in the cells array
this.cells[rowIndex][columnIndex] = objCell;
delete objCell;
};
Grid.prototype.draw = function() {
//This function actually draws the grid.
//Create the container Movie clip first of all
createEmptyMovieClip("Grid_"+this.depth, this.depth);
//Get a reference to it
var mcGrid = eval("Grid_"+this.depth);
//Draw the grid background (cell & rows border line) - column wise
for (var i = 1; i<=this.columns; i++) {
//Create a new container for each column
mcGrid.createEmptyMovieClip("Column_"+i, this.currDepth++);
//Get reference
var mcColumn = eval(mcGrid+".Column_"+i);
//Move to initial position
mcColumn.moveTo(0, 0);
var currColWidth = this.cellWidth[i];
var currColHeight = 0;
//Draw the cells in it
for (var j = 1; j<=this.rows; j++) {
//Set the line style for cell border
mcColumn.lineStyle(0, parseInt(this.borderColor, 16), this.borderAlpha);
//If it's to be filled, set the background color
if (this.cells[j][i].bgColor != "" && this.cells[j][i].bgColor != undefined && this.cells[j][i].bgColor != null) {
mcColumn.beginFill(parseInt(this.cells[j][i].bgColor, 16), this.cells[j][i].bgAlpha);
}
mcColumn.moveTo(0, currColHeight);
mcColumn.lineTo(currColWidth, currColHeight);
mcColumn.lineTo(currColWidth, currColHeight+this.cellHeight[j]);
mcColumn.lineTo(0, currColHeight+this.cellHeight[j]);
mcColumn.lineTo(0, currColHeight);
mcColumn.endFill();
//Height
currColHeight = currColHeight+this.cellHeight[j];
//End fill
}
//x-Position the column
var columnXPos = 0;
for (var k = 1; k<=i-1; k++) {
columnXPos = columnXPos+this.cellWidth[k];
}
mcColumn._x = columnXPos;
delete mcColumn;
}
//Now, draw the resize bars only if there are more than 2 columns
//And we have to allow resize
if (this.columns>1 && this.allowResize == true) {
for (var i = 2; i<=this.columns; i++) {
//Create the resize bar containers
mcGrid.createEmptyMovieClip("ResizeBar_"+(i-1), this.currDepth++);
//Get the reference
mcResizeBar = eval(mcGrid+".ResizeBar_"+(i-1));
//Create the visible and invisible parts of the resize bar
//The invisible part is the one which responds to mouse events (drag)
//Visible part shows up while drawing
mcResizeBar.createEmptyMovieClip("HitArea", 1);
mcResizeBar.createEmptyMovieClip("Bar", 2);
//Get reference to both
mcRBHitArea = eval(mcResizeBar+".HitArea");
mcRBBar = eval(mcResizeBar+".Bar");
//Create the lines
//Hit Area
mcRBHitArea.lineStyle(6, 0x000000, 0);
mcRBHitArea.moveTo(0, 0);
mcRBHitArea.lineTo(0, currColHeight);
//Visible Bar
mcRBBar.lineStyle(this.resizeBarThickness, parseInt(this.resizeBarColor, 16), this.resizeBarAlpha);
mcRBBar.moveTo(0, 0);
mcRBBar.lineTo(0, currColHeight);
//By default the visible line won't be visible
mcRBBar._visible = false;
//Set the x-position of the resize bar
var barXPos = 0;
for (var k = 1; k<=i-1; k++) {
barXPos = barXPos+this.cellWidth[k];
}
mcResizeBar._x = barXPos;
//Set the internal properties
//Id specifies the column index it drags (column index on whose right side this is attached)
mcResizeBar.id = i-1;
//Start X specifies the start x position till where it will be allowed to drag
mcResizeBar.startX = barXPos-this.cellWidth[i-1];
//End X specifies the end x position till where it will be allowed to drag.
mcResizeBar.endX = barXPos+this.cellWidth[i];
//Center X specifies its current position
mcResizeBar.centerX = barXPos;
//Grid instance
mcResizeBar.gridInstance = this.instance;
//Now, set the event handlers.
mcResizeBar.onRollOver = function() {
// Hide mouse
Mouse.hide();
MovResizeCursor._visible = true;
MovResizeCursor._x = _xmouse;
MovResizeCursor._y = _ymouse;
this.onMouseMove = function() {
MovResizeCursor._x = _xmouse;
MovResizeCursor._y = _ymouse;
};
};
mcResizeBar.onRollOut = function() {
delete this.onMouseMove;
// Show mouse
Mouse.show();
MovResizeCursor._visible = false;
};
mcResizeBar.onPress = function() {
// Flag
this.dragging = true;
// Show the resize bar
this.Bar._visible = true;
// Start dragging
this.startDrag(false, this.startX+this.gridInstance.resizePadding, 0, this.endX-this.gridInstance.resizePadding, 0);
};
mcResizeBar.onRelease = mcResizeBar.onReleaseOutside=function () {
// Flag
this.dragging = false;
// Stop dragging
this.stopDrag();
// Set line visible false
this.Bar._visible = false;
// Make the size of the left column smaller
var mcColumnLeft = eval(mcGrid+".Column_"+(this.id));
var mcColumnRight = eval(mcGrid+".Column_"+(this.id+1));
mcColumnLeft._width += (this._x-this.centerX);
mcColumnRight._x += (this._x-this.centerX);
mcColumnRight._width -= (this._x-this.centerX);
// Update global cellwidth
this.gridInstance.cellWidth[this.id] += (this._x-this.centerX);
this.gridInstance.cellWidth[this.id+1] -= (this._x-this.centerX);
// Update indexes
this.centerX = this._x;
this.startX = mcColumnLeft._x;
this.endX = mcColumnRight._x+mcColumnRight._width;
// Get reference to previous resize bar
var mcPreviousLine = eval(mcGrid+".ResizeBar_"+(this.id-1));
// Set its endX position - as it can now only drag upto the centerX of the currently dragged resize bar
mcPreviousLine.endX = this.centerX;
// Get reference to next resize bar
var mcNextLine = eval(mcGrid+".ResizeBar_"+(this.id+1));
// Set its startX position - as it can now only drag from the centerX of the currently dragged resize bar
mcNextLine.startX = this.centerX;
// Re-draw the text for this column and the next column
this.gridInstance.drawText(this.id);
this.gridInstance.drawText(this.id+1);
};
}
}
//Shift the grid to required x and y position
mcGrid._x = this.xPos;
mcGrid._y = this.yPos;
//Set the depth index for labels
this.labelDepth = this.currDepth+1;
delete mcGrid;
//Draw the text for all the columns initially
for (var i = 1; i<=this.columns; i++) {
this.drawText(i);
}
};
Grid.prototype.drawText = function(columnId) {
//This function renders the text in the grid for a particular column
//First get the cumulative xPos of that column's center
var columnCenterX = 0;
//Variable to store the center y position of the row
var rowCenterY = 0;
for (var i = 1; i<columnId; i++) {
columnCenterX = columnCenterX+this.cellWidth[i];
}
//Add to the center of current column
columnCenterX = columnCenterX+(this.cellWidth[columnId]*.5);
//Now iterate through all rows and create the text
for (var i = 1; i<=this.rows; i++) {
//If the label is a link node
if (this.cells[i][columnId].link != "" && this.cells[i][columnId].link != undefined) {
//Create the linked label
this.createBoundedText(this.labelDepth+((i-1)*this.columns)+columnId, "<A HREF='"+this.cells[i][columnId].link+"'>"+this.cells[i][columnId].label+"</a>", columnCenterX, (rowCenterY+this.cellHeight[i]*0.5), this.cellWidth[columnId], this.cellHeight[i], this.cells[i][columnId].font, this.cells[i][columnId].fontSize, this.cells[i][columnId].fontColor, this.cells[i][columnId].isBold, this.cells[i][columnId].align, this.cells[i][columnId].vAlign, true);
} else {
//Create simple text label
this.createBoundedText(this.labelDepth+((i-1)*this.columns)+columnId, this.cells[i][columnId].label, columnCenterX, (rowCenterY+this.cellHeight[i]*0.5), this.cellWidth[columnId], this.cellHeight[i], this.cells[i][columnId].font, this.cells[i][columnId].fontSize, this.cells[i][columnId].fontColor, this.cells[i][columnId].isBold, this.cells[i][columnId].align, this.cells[i][columnId].vAlign, true);
}
//Add the row height
rowCenterY = rowCenterY+this.cellHeight[i];
}
};
Grid.prototype.createBoundedText = function(depth, strText, xPos, yPos, width, height, fontFamily, fontSize, fontColor, isBold, alignPos, vAlignPos, isHTML) {
//This function creates a text field according to the parameters passed
//Parameters
//--------------------------
//depth - movie clip depth - Number
//strText - text to be displayed in the text box - string
//xPos - x position of the text box - Number
//yPos - y position of the text box - Number
//fontFamily - font face of the text - string
//fontSize - size of the text - Number
//fontColor - color without # like FFFFDD, 000222 - string
//isBold - bold property - boolean
//alignPos - alignment position - "center", "left", or "right" - string
//vAlignPos- vertical alignment position - "center", "left", or "right" - string
//isHTML - option whether the text would be rendered as HTML or as text
//Returns - the width,height, xPos and yPos of the textbox created
//As an object with properties textWidth and textHeight
//--------------------------
//First up, we get the actual pixels (width) this text will take
var objT = createText(50000+depth, strText, xPos, yPos, fontFamily, fontSize, fontColor, isBold, alignPos, vAlignPos, null, isHTML);
var tWidth = objT.textWidth;
var tHeight = objT.textHeight;
deleteText(50000+depth);
//Set defaults for isBold, alignPos, vAlignPos, rotationAngle, isHTML
if (isBold == undefined || isBold == null || isBold == "") {
isBold = false;
}
alignPos = getFirstValue(alignPos, "center");
vAlignPos = getFirstValue(vAlignPos, "center");
//By default, we render all text as HTML
if (isHTML == undefined || isHTML == null || isHTML == "") {
isHTML = true;
}
//First, create a new Textformat object
var fcTextFormat = new TextFormat();
//Set the properties of the text format objects
fcTextFormat.font = fontFamily;
fcTextFormat.color = parseInt(fontColor, 16);
fcTextFormat.size = fontSize;
fcTextFormat.bold = isBold;
//Create a textProperties object which would be returned to the caller
//to represent the text width and height
var LTextProperties;
LTextProperties = new Object();
//Create the actual text field object now. - a & b are undefined variables
//We want the initial text field size to be flexible
//Get a reference to it
var mcGrid = eval("Grid_"+this.depth);
mcGrid.createTextField("ASMovText_"+depth, depth, xPos, yPos, width, height);
//Get a reference to the text field MC
var fcText = eval(mcGrid+".ASMovText_"+depth);
//Set the properties
fcText.multiLine = true;
fcText.selectable = false;
fcText.html = isHTML;
//Set the text
if (isHTML) {
//If it's HTML text, set as htmlText
fcText.htmlText = strText;
} else {
//Else, set as plain text
fcText.text = strText;
}
//Apply the text format
fcText.setTextFormat(fcTextFormat);
//Horizontal alignment
//If the textwidth is more than width available, we just left align
if (tWidth>width) {
fcText._x = xPos-(width/2);
} else {
//Else we do the proper alignment
switch (alignPos.toUpperCase()) {
case "LEFT" :
fcText._x = xPos-(width/2);
break;
case "CENTER" :
fcText._x = xPos-(tWidth/2);
break;
case "RIGHT" :
fcText._x = xPos+(width/2)-tWidth;
break;
}
}
//If the text height is greater than the height available, then just set it to center
if (tHeight>height) {
fcText._y = yPos-(height/2);
break;
} else {
//Vertical alignment
switch (vAlignPos.toUpperCase()) {
case "LEFT" :
//Left is equivalent to top (of the ypos mid line - virtual)
// TEXT HERE
//---------MID LINE---------
// (empty space)
fcText._y = yPos-height/2;
break;
case "CENTER" :
// (empty space)
//---------TEXT HERE---------
// (empty space)
fcText._y = yPos-(tHeight/2);
break;
case "RIGHT" :
//Right is equivalent to bottom
// (empty space)
//---------MID LINE---------
// TEXT HERE
fcText._y = yPos+height/2-tHeight;
break;
}
}
delete fcTextFormat;
delete fcText;
};
|
package flare.vis.data {
import flare.data.DataField;
import flare.data.DataSchema;
import flare.data.DataSet;
import flare.util.Property;
import flare.util.Sort;
import flare.util.Vectors;
import flare.vis.events.DataEvent;
import flash.events.EventDispatcher;
[Event(name="add", type="flare.vis.events.DataEvent")]
[Event(name="remove", type="flare.vis.events.DataEvent")]
/**
* Data structure for managing a collection of visual data objects. The
* Data class manages both unstructured data and data organized in a
* general graph (or network structure), maintaining collections of both
* nodes and edges. Collections of data sprites are maintained by
* <code>DataList</code> instances. The individual data lists provide
* methods for accessing, manipulating, sorting, and generating statistics
* about the visual data objects.
*
* <p>In addition to the required <code>nodes</code> and <code>edges</code>
* lists, clients can add new custom lists (for example, to manage a
* selected subset of the data) by using the <code>addGroup</code> method
* and then accessing the list with the <code>group</code> method.
* Individual data groups can be directly processed by many of the
* visualization operators in the <code>flare.vis.operator</code> package.
* </p>
*
* <p>While Data objects maintain a collection of visual DataSprites,
* they are not themselves visual object containers. Instead a Data
* instance is used as input to a <code>Visualization</code> that
* is responsible for processing the DataSprite instances and adding
* them to the Flash display list.</p>
*
* <p>The data class also manages the automatic generation of spanning
* trees over a graph when needed for tree-based operations (such as tree
* layout algorithms). This implemented by a
* <code>flare.analytics.graph.SpanningTree</code> operator which can be
* parameterized using the <code>treePolicy</code>,
* <code>treeEdgeWeight</code>, and <code>root</code> properties of this
* class. Alternatively, clients can create their own spanning trees as
* a <code>Tree</code instance and set this as the spanning tree.</p>
*
* @see flare.vis.data.DataList
* @see flare.analytics.graph.SpanningTree
*/
public class Data extends EventDispatcher
{
/** Constant indicating the nodes in a Data object. */
public static const NODES:String = "nodes";
/** Constant indicating the edges in a Data object. */
public static const EDGES:String = "edges";
/** Internal list of NodeSprites. */
protected var _nodes:DataList = new DataList(NODES);
/** Internal list of EdgeSprites. */
protected var _edges:DataList = new DataList(EDGES);
/** Internal set of data groups. */
protected var _groups:Object;
/** The total number of items (nodes and edges) in the data. */
public function get length():int { return _nodes.length + _edges.length; }
/** The collection of NodeSprites. */
public function get nodes():DataList { return _nodes; }
/** The collection of EdgeSprites. */
public function get edges():DataList { return _edges; }
/** The default directedness of new edges. */
public var directedEdges:Boolean;
// -- Methods ---------------------------------------------------------
/**
* Creates a new Data instance.
* @param directedEdges the default directedness of new edges
*/
public function Data(directedEdges:Boolean=false) {
this.directedEdges = directedEdges;
_groups = { nodes: _nodes, edges: _edges };
// add listeners to enforce type and connectivity constraints
_nodes.addEventListener(DataEvent.ADD, onAddNode);
_nodes.addEventListener(DataEvent.REMOVE, onRemoveNode);
_edges.addEventListener(DataEvent.ADD, onAddEdge);
_edges.addEventListener(DataEvent.REMOVE, onRemoveEdge);
}
/**
* Creates a new Data instance from an array of tuples. The object in
* the vector will become the data objects for NodeSprites.
* @param a an array of data objects
* @return a new Data instance, with NodeSprites populated with the
* input data.
*/
public static function fromArray(a:Array):Data {
var d:Data = new Data();
for each (var tuple:Object in a) {
d.addNode(tuple);
}
return d;
}
/**
* Creates a new Data instance from an object vector of tuples. The object in
* the vector will become the data objects for NodeSprites.
* @param a an Object Vector of data objects
* @return a new Data instance, with NodeSprites populated with the
* input data.
*/
public static function fromVector(a:Vector.<Object>):Data {
var d:Data = new Data();
for each (var tuple:Object in a) {
d.addNode(tuple);
}
return d;
}
/**
* Creates a new Data instance from a data set.
* @param ds a DataSet to visualize. For example, this data set may be
* loaded using a data converter in the flare.data library.
* @return a new Data instance, with NodeSprites and EdgeSprites
* populated with the input data.
*/
public static function fromDataSet(ds:DataSet):Data {
var d:Data = new Data(), i:int;
var schema:DataSchema, f:DataField;
// copy node data defaults
if ((schema = ds.nodes.schema)) {
for (i=0; i<schema.numFields; ++i) {
f = schema.getFieldAt(i);
if (f.defaultValue)
d.nodes.setDefault("data."+f.name, f.defaultValue);
}
}
// add node data
for each (var tuple:Object in ds.nodes.data) {
d.addNode(tuple);
}
// exit if there is no edge data
if (!ds.edges) return d;
var nodes:DataList = d.nodes, map:Object = {};
var id:String = "id"; // TODO: generalize these fields?
var src:String = "source";
var trg:String = "target";
var dir:String = "directed";
// build node map
for (i=0; i<nodes.length; ++i) {
map[nodes[i].data[id]] = nodes[i];
}
// copy edge data defaults
if ((schema = ds.edges.schema)) {
for (i=0; i<schema.numFields; ++i) {
f = schema.getFieldAt(i);
if (f.defaultValue)
d.edges.setDefault("data."+f.name, f.defaultValue);
}
if ((f = schema.getFieldByName(dir))) {
d.directedEdges = Boolean(f.defaultValue);
}
}
// add edge data
for each (tuple in ds.edges.data) {
var n1:NodeSprite = map[tuple[src]];
if (!n1) throw new Error("Missing node id="+tuple[src]);
var n2:NodeSprite = map[tuple[trg]];
if (!n2) throw new Error("Missing node id="+tuple[trg]);
d.addEdgeFor(n1, n2, tuple[dir], tuple);
}
return d;
}
// -- Group Management ---------------------------------
/**
* Adds a new data group. If a group of the same name already exists,
* it will be replaced, except for the groups "nodes" and "edges",
* which can not be replaced.
* @param name the name of the group to add
* @param group the data list to add, if null a new,
* empty <code>DataList</code> instance will be created.
* @return the added data group
*/
public function addGroup(name:String, group:DataList=null):DataList
{
if (name=="nodes" || name=="edges") {
throw new ArgumentError("Illegal group name. "
+ "\"nodes\" and \"edges\" are reserved names.");
}
if (group==null) group = new DataList(name);
_groups[name] = group;
return group;
}
/**
* Removes a data group. An error will be thrown if the caller
* attempts to remove the groups "nodes" or "edges".
* @param name the name of the group to remove
* @return the removed data group
*/
public function removeGroup(name:String):DataList
{
if (name=="nodes" || name=="edges") {
throw new ArgumentError("Illegal group name. "
+ "\"nodes\" and \"edges\" are reserved names.");
}
var group:DataList = _groups[name];
if (group) delete _groups[name];
return group;
}
/**
* Retrieves the data group with the given name.
* @param name the name of the group
* @return the data group
*/
public function group(name:String):DataList
{
return _groups[name] as DataList;
}
// -- Containment --------------------------------------
/**
* Indicates if this Data object contains the input DataSprite.
* @param d the DataSprite to check for containment
* @return true if the sprite is in this data collection, false
* otherwise.
*/
public function contains(d:DataSprite):Boolean
{
return (_nodes.contains(d) || _edges.contains(d));
}
// -- Add ----------------------------------------------
/**
* Adds a node to this data collection.
* @param d either a data tuple or NodeSprite object. If the input is
* a non-null data tuple, this will become the new node's
* <code>data</code> property. If the input is a NodeSprite, it will
* be directly added to the collection.
* @return the newly added NodeSprite
*/
public function addNode(d:Object=null):NodeSprite
{
var ns:NodeSprite = NodeSprite(d is NodeSprite ? d : newNode(d));
_nodes.add(ns);
return ns;
}
/**
* Add an edge to this data set. The input must be of type EdgeSprite,
* and must have both source and target nodes that are already in
* this data set. If any of these conditions are not met, this method
* will return null. Note that no exception will be thrown on failures.
* @param e the EdgeSprite to add
* @return the newly added EdgeSprite
*/
public function addEdge(e:EdgeSprite):EdgeSprite
{
return EdgeSprite(_edges.add(e));
}
/**
* Generates edges for this data collection that connect the nodes
* according to the input properties. The nodes are sorted by the
* sort argument and grouped by the group-by argument. All nodes
* with the same group are sequentially connected to each other in
* sorted order by new edges. This method is useful for generating
* line charts from a plot of nodes.
* <p>If an edge already exists between nodes, by default this method
* will not add a new edge. Use the <code>ignoreExistingEdges</code>
* argument to change this behavior. </p>
*
* @param sortBy the criteria for sorting the nodes, using the format
* of <code>flare.util.Sort</code>. The input can either be a string
* with a single property name, or an array of property names. Items
* are sorted in ascending order by default, prefix a property name
* with a "-" (minus) character to sort in descending order.
* @param groupBy the criteria for grouping the nodes, using the format
* of <code>flare.util.Sort</code>. The input can either be a string
* with a single property name, or an array of property names. Items
* are sorted in ascending order by default, prefix a property name
* with a "-" (minus) character to sort in descending order.
* @param ignoreExistingEdges if false (the default), this method will
* not create a new edge if one already exists between two nodes. If
* true, new edges will be created regardless.
*/
public function createEdges(sortBy:*=null, groupBy:*=null,
ignoreExistingEdges:Boolean=false):void
{
// create vectors and sort criteria
var a:Vector.<Object> = Vectors.copy(_nodes.list);
var g:Vector.<Object> = new Vector.<Object>;
// Workaround code as a result of initialization bug in the Vector class
if(groupBy){
if(groupBy is Vector.<Object>) g = groupBy as Vector.<Object>;
else if(groupBy is Array)g = Vectors.copyFromArray(groupBy);
else g.push(groupBy);
}
var len:int = g.length;
if (sortBy is Vector.<Object>) for each(var svi:Object in (sortBy as Vector.<Object>)) g.push(svi);
else if(sortBy is Array) for each(var sai:Object in (sortBy as Array)) g.push(sai);
else g.push(sortBy);
// sort to group by, then ordering
a.sort(Sort.$(g));
// get property instances for value operations
var p:Vector.<Object> = new Vector.<Object>();
for (var i:int=0; i<len; ++i) {
if (g[i] is String)
p.push(Property.$(g[i] as String));
}
var f:Property = p[p.length-1] as Property;
// connect all items who match on the last group by field
for (i=1; i<a.length; ++i) {
if (!f || f.getValue(a[i-1]) == f.getValue(a[i])) {
if (!ignoreExistingEdges && a[i].isConnected(a[i-1]))
continue;
var e:EdgeSprite = addEdgeFor(a[i-1] as NodeSprite, a[i] as NodeSprite, directedEdges);
// add data values from nodes
for (var j:uint=0; j<p.length; ++j) {
p[j].setValue(e, p[j].getValue(a[i]));
}
}
}
}
/**
* Creates a new edge between the given nodes and adds it to the
* data collection.
* @param source the source node (must already be in this data set)
* @param target the target node (must already be in this data set)
* @param directed indicates the directedness of the edge (null to
* use this Data's default, true for directed, false for undirected)
* @param data a data tuple containing data values for the edge
* instance. If non-null, this will become the EdgeSprite's
* <code>data</code> property.
* @return the newly added EdgeSprite
*/
public function addEdgeFor(source:NodeSprite, target:NodeSprite,
directed:Object=null, data:Object=null):EdgeSprite
{
if (!_nodes.contains(source) || !_nodes.contains(target)) {
return null;
}
var d:Boolean = directed==null ? directedEdges : Boolean(directed);
var e:EdgeSprite = newEdge(source, target, d, data);
if (data != null) e.data = data;
source.addOutEdge(e);
target.addInEdge(e);
return addEdge(e);
}
/**
* Internal function for creating a new node. Creates a NodeSprite,
* sets its data property, and applies default values.
* @param data the new node's data property
* @return the newly created node
*/
protected function newNode(data:Object):NodeSprite
{
var ns:NodeSprite = new NodeSprite();
_nodes.applyDefaults(ns);
if (data != null) { ns.data = data; }
return ns;
}
/**
* Internal function for creating a new edge. Creates an EdgeSprite,
* sets its data property, and applies default values.
* @param s the source node
* @param t the target node
* @param d the edge's directedness
* @param data the new edge's data property
* @return the newly created node
*/
protected function newEdge(s:NodeSprite, t:NodeSprite,
d:Boolean, data:Object):EdgeSprite
{
var es:EdgeSprite = new EdgeSprite(s,t,d);
_edges.applyDefaults(es);
if (data != null) { es.data = data; }
return es;
}
// -- Remove -------------------------------------------
/**
* Clears this data set, removing all nodes and edges.
*/
public function clear():void
{
_edges.clear();
_nodes.clear();
for (var name:String in _groups) {
_groups[name].clear();
}
}
/**
* Removes a DataSprite (node or edge) from this data collection.
* @param d the DataSprite to remove
* @return true if removed successfully, false if not found
*/
public function remove(d:DataSprite):Boolean
{
if (d is NodeSprite) return removeNode(d as NodeSprite);
if (d is EdgeSprite) return removeEdge(d as EdgeSprite);
return false;
}
/**
* Removes a node from this data set. All edges incident on this
* node will also be removed. If the node is not found in this
* data set, the method returns null.
* @param n the node to remove
* @returns true if sucessfully removed, false if not found in the data
*/
public function removeNode(n:NodeSprite):Boolean
{
return _nodes.remove(n);
}
/**
* Removes an edge from this data set. The nodes connected to
* this edge will have the edge removed from their edge lists.
* @param e the edge to remove
* @returns true if sucessfully removed, false if not found in the data
*/
public function removeEdge(e:EdgeSprite):Boolean
{
return _edges.remove(e);
}
// -- Events -------------------------------------------
/** @private */
protected function onAddNode(evt:DataEvent):void
{
for each (var d:DataSprite in evt.items) {
var n:NodeSprite = d as NodeSprite;
if (!n) {
evt.preventDefault();
return;
}
}
fireEvent(evt);
}
/** @private */
protected function onRemoveNode(evt:DataEvent):void
{
for each (var n:NodeSprite in evt.items) {
for (var i:uint=n.outDegree; --i>=0;)
removeEdge(n.getOutEdge(i));
for (i=n.inDegree; --i>=0;)
removeEdge(n.getInEdge(i));
}
fireEvent(evt);
}
/** @private */
protected function onAddEdge(evt:DataEvent):void
{
for each (var d:DataSprite in evt.items) {
var e:EdgeSprite = d as EdgeSprite;
if (!(e && _nodes.contains(e.source)
&& _nodes.contains(e.target)))
{
evt.preventDefault();
return;
}
}
fireEvent(evt);
}
/** @private */
protected function onRemoveEdge(evt:DataEvent):void
{
for each (var e:EdgeSprite in evt.items) {
e.source.removeOutEdge(e);
e.target.removeInEdge(e);
}
fireEvent(evt);
}
/** @private */
protected function fireEvent(evt:DataEvent):void
{
// reset the spanning tree on adds and removals
if (evt.type != DataEvent.UPDATE)
_tree = null;
// fire event, if anyone is listening
if (hasEventListener(evt.type)) {
dispatchEvent(evt);
}
}
// -- Visitors -----------------------------------------
/**
* Visit items, invoking a function on all visited elements.
* @param v the function to invoke on each element. If the function
* return true, the visitation is ended with an early exit
* @param group the data group to visit (e.g., NODES or EDGES). If this
* value is null, both nodes and edges will be visited.
* @param filter an optional predicate function indicating which
* elements should be visited. Only items for which this function
* returns true will be visited.
* @param reverse an optional parameter indicating if the visitation
* traversal should be done in reverse (the default is false).
* @return true if the visitation was interrupted with an early exit
*/
public function visit(v:Function, group:String=null,
filter:*=null, reverse:Boolean=false):Boolean
{
if (group == null) {
if (_edges.length > 0 && _edges.visit(v, filter, reverse))
return true;
if (_nodes.length > 0 && _nodes.visit(v, filter, reverse))
return true;
} else {
var list:DataList = _groups[group];
if (list.length > 0 && list.visit(v, filter, reverse))
return true;
}
return false;
}
// -- Spanning Tree ---------------------------------------------------
/** The spanning tree constructor class. */
protected var _span:TreeBuilder = new TreeBuilder();
/** The root node of the spanning tree. */
protected var _root:NodeSprite = null;
/** The the spanning tree. */
protected var _tree:Tree = null;
/** The spanning tree creation policy.
* @see flare.analytics.graph.SpanningTree */
public function get treePolicy():String { return _span.policy; }
public function set treePolicy(p:String):void {
if (_span.policy != p) {
_span.policy = p;
_tree = null;
}
}
/** The edge weight function for computing a minimum spanning tree.
* This function will only have an effect if the
* <code>treePolicy</code> is
* <code>SpanningTree.MINIMUM_SPAN</code> */
public function get treeEdgeWeight():Function {
return (_span ? _span.edgeWeight : null);
}
public function set treeEdgeWeight(w:*):void {
_span.edgeWeight = w;
}
/** The root node of the spanning tree. */
public function get root():NodeSprite { return _root; }
public function set root(n:NodeSprite):void {
if (n != null && !_nodes.contains(n))
throw new ArgumentError("Spanning tree root must be within the graph.");
if (_root != n) {
_tree = null;
_span.root = (_root = n);
}
}
/**
* A spanning tree for this graph. The spanning tree generated is
* determined by the <code>root</code>, <code>treePolicy</code>,
* and <code>treeEdgeWeight</code> properties. By default, the tree
* is built using a breadth-first spanning tree using the first node
* in the graph as the root.
*/
public function get tree():Tree
{
if (_tree == null) { // build tree if necessary
if (_root == null) _span.root = _nodes[0];
_span.calculate(this, _span.root);
_tree = _span.tree;
}
return _tree;
}
public function set tree(t:Tree):void
{
if (t==null) { _tree = null; return; }
var ok:Boolean;
ok = t.root.visitTreeDepthFirst(function(n:NodeSprite):Boolean {
return _nodes.contains(n);
});
if (ok) _tree = t;
}
} // end of class Data
} |
package cmodule.lua_wrapper
{
const __2E_str16266:int = gstaticInitter.alloc(6,1);
}
|
/* 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/. */
package org.mangui.hls.event {
/** playback metrics, notified when playback of a given fragment starts **/
public class HLSPlayMetrics {
public var level : int;
public var seqnum : int;
public var continuity_counter : int;
public var duration : Number;
public var audio_only : Boolean;
public var program_date : Number;
public var video_width : int;
public var video_height : int;
public var auto_level : Boolean;
public var tag_list : Array;
public var id3tag_list : Array;
public function HLSPlayMetrics(level : int, seqnum : int, cc : int, duration : Number, audio_only : Boolean, program_date : Number, video_width : int, video_height : int, auto_level : Boolean, tag_list : Array, id3tag_list : Array) {
this.level = level;
this.seqnum = seqnum;
this.continuity_counter = cc;
this.duration = duration;
this.audio_only = audio_only;
this.program_date = program_date;
this.video_width = video_width;
this.video_height = video_height;
this.auto_level = auto_level;
this.tag_list = tag_list;
this.id3tag_list = id3tag_list;
}
}
}
|
package game.net.data.c
{
import flash.utils.ByteArray;
import game.net.data.DataBase;
import game.net.data.vo.*;
import game.net.data.IData;
public class COversellItem extends DataBase
{
public var tab : int;
public var ids : Vector.<int>;
public static const CMD : int=13028;
public function COversellItem()
{
}
override public function deSerialize(data:ByteArray):void
{
super.deSerialize(data);
tab=data.readUnsignedByte();
ids=readArrayInt();
}
override public function serialize():ByteArray
{
var byte:ByteArray= new ByteArray();
byte.writeByte(tab);
writeInts(ids,byte);
return byte;
}
override public function getCmd():int
{
return CMD;
}
}
}
// vim: filetype=php :
|
package com.company.assembleegameclient.ui {
import com.company.assembleegameclient.objects.GameObject;
import com.company.assembleegameclient.parameters.Parameters;
import flash.display.Sprite;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.filters.DropShadowFilter;
import kabam.rotmg.text.view.TextFieldDisplayConcrete;
import kabam.rotmg.text.view.stringBuilder.LineBuilder;
import kabam.rotmg.text.view.stringBuilder.StaticStringBuilder;
import org.osflash.signals.Signal;
public class StatusBar extends Sprite {
public const DEFAULT_FILTER:DropShadowFilter = new DropShadowFilter(0, 0, 0);
public static var barTextSignal:Signal = new Signal(int);
public function StatusBar(param1:int, param2:int, param3:uint, param4:uint, param5:String = null, param6:Boolean = false, param7:GameObject = null, param8:Boolean = false, param9:Boolean = false) {
colorSprite = new Sprite();
super();
this.isProgressBar_ = param9;
addChild(this.colorSprite);
this.w_ = param1;
this.h_ = param2;
this.forceNumText_ = param6;
var _loc10_:* = param3;
this.color_ = _loc10_;
this.defaultForegroundColor = _loc10_;
_loc10_ = param4;
this.backColor_ = _loc10_;
this.defaultBackgroundColor = _loc10_;
this.textColor_ = 16777215;
if (param5 && param5.length != 0) {
this.labelText_ = new TextFieldDisplayConcrete().setSize(14).setColor(this.textColor_);
this.labelText_.setBold(true);
this.labelTextStringBuilder_ = new LineBuilder().setParams(param5);
this.labelText_.setStringBuilder(this.labelTextStringBuilder_);
this.centerVertically(this.labelText_);
this.labelText_.filters = [DEFAULT_FILTER];
addChild(this.labelText_);
}
if (param8) {
this.rightLabelText_ = new TextFieldDisplayConcrete().setSize(14).setColor(this.textColor_);
this.rightLabelText_.setBold(true);
this.rightLabelTextStringBuilder_ = new LineBuilder().setParams("0%");
this.rightLabelText_.setStringBuilder(this.labelTextStringBuilder_);
this.centerVertically(this.rightLabelText_);
this.rightLabelText_.filters = [DEFAULT_FILTER];
addChild(this.rightLabelText_);
}
this.valueText_ = new TextFieldDisplayConcrete().setSize(14).setColor(16777215);
this.valueText_.setBold(true);
this.valueText_.filters = [DEFAULT_FILTER];
this.centerVertically(this.valueText_);
this.valueTextStringBuilder_ = new StaticStringBuilder();
this.boostText_ = new TextFieldDisplayConcrete().setSize(14).setColor(this.textColor_);
this.boostText_.setBold(true);
this.boostText_.alpha = 0.6;
this.centerVertically(this.boostText_);
this.boostText_.filters = [DEFAULT_FILTER];
this.exaltValText = new TextFieldDisplayConcrete().setSize(14).setColor(1010609);
this.exaltValText.setBold(true);
this.exaltValText.alpha = 0.6;
this.centerVertically(this.exaltValText);
this.exaltValText.filters = [DEFAULT_FILTER];
this.multiplierIcon = new Sprite();
this.multiplierIcon.x = this.w_ - 25;
this.multiplierIcon.y = -3;
this.multiplierIcon.graphics.beginFill(16711935, 0);
this.multiplierIcon.graphics.drawRect(0, 0, 20, 20);
this.multiplierIcon.addEventListener("mouseOver", this.onMultiplierOver, false, 0, true);
this.multiplierIcon.addEventListener("mouseOut", this.onMultiplierOut, false, 0, true);
this.multiplierText = new TextFieldDisplayConcrete().setSize(14).setColor(9493531);
this.multiplierText.setBold(true);
this.multiplierText.setStringBuilder(new StaticStringBuilder("x2"));
this.multiplierText.filters = [DEFAULT_FILTER];
this.multiplierIcon.addChild(this.multiplierText);
if (!this.bTextEnabled(Parameters.data.toggleBarText)) {
addEventListener("rollOver", this.onMouseOver, false, 0, true);
addEventListener("rollOut", this.onMouseOut, false, 0, true);
}
quest = param7;
barTextSignal.add(this.setBarText);
}
public var w_:int;
public var h_:int;
public var color_:uint;
public var backColor_:uint;
public var pulseBackColor:uint;
public var textColor_:uint;
public var val_:int = -1;
public var max_:int = -1;
public var boost_:int = -1;
public var exalted:int = 0;
public var maxMax_:int = -1;
public var level_:int = 0;
public var multiplierIcon:Sprite;
public var mouseOver_:Boolean = false;
public var quest:GameObject = null;
private var labelText_:TextFieldDisplayConcrete;
private var labelTextStringBuilder_:LineBuilder;
private var rightLabelText_:TextFieldDisplayConcrete;
private var rightLabelTextStringBuilder_:LineBuilder;
private var valueText_:TextFieldDisplayConcrete;
private var valueTextStringBuilder_:StaticStringBuilder;
private var boostText_:TextFieldDisplayConcrete;
private var exaltValText:TextFieldDisplayConcrete;
private var multiplierText:TextFieldDisplayConcrete;
private var colorSprite:Sprite;
private var defaultForegroundColor:Number;
private var defaultBackgroundColor:Number;
private var isPulsing:Boolean = false;
private var forceNumText_:Boolean = false;
private var isProgressBar_:Boolean = false;
private var repetitions:int;
private var direction:int = -1;
private var speed:Number = 0.1;
public function centerVertically(param1:TextFieldDisplayConcrete):void {
param1.setVerticalAlign("middle");
param1.y = int(this.h_ / 2);
}
public function draw(param1:int, param2:int, param3:int, param4:int = -1, param5:int = 0, param6:int = 0):void {
if (param2 > 0) {
param1 = Math.min(param2, Math.max(0, param1));
}
if (param1 == this.val_ && param2 == this.max_ && param3 == this.boost_ && param4 == this.maxMax_ && param6 == this.exalted) {
return;
}
this.val_ = param1;
this.max_ = param2;
this.boost_ = param3;
this.exalted = param6;
this.maxMax_ = param4;
this.level_ = param5;
this.internalDraw();
}
public function setLabelText(param1:String, param2:Object = null):void {
this.labelTextStringBuilder_.setParams(param1, param2);
this.labelText_.setStringBuilder(this.labelTextStringBuilder_);
}
public function setBarText(param1:int):void {
this.mouseOver_ = false;
if (this.bTextEnabled(param1)) {
removeEventListener("rollOver", this.onMouseOver);
removeEventListener("rollOut", this.onMouseOut);
} else {
addEventListener("rollOver", this.onMouseOver);
addEventListener("rollOut", this.onMouseOut);
}
this.internalDraw();
}
public function drawWithMouseOver():void {
var _loc2_:* = null;
var _loc1_:int = 0;
var _loc3_:String = "";
if (Parameters.data.toggleToMaxText) {
_loc1_ = this.maxMax_ - (this.max_ - this.boost_);
if (this.level_ >= 20 && _loc1_ > 0) {
_loc3_ = _loc3_ + ("|" + Math.ceil(_loc1_ * 0.2));
}
}
if (this.max_ > 0) {
this.valueText_.setStringBuilder(this.valueTextStringBuilder_.setString(this.val_ + "/" + this.max_ + _loc3_));
} else {
this.valueText_.setStringBuilder(this.valueTextStringBuilder_.setString("" + this.val_));
}
if (!contains(this.valueText_)) {
this.valueText_.mouseEnabled = false;
this.valueText_.mouseChildren = false;
addChild(this.valueText_);
}
if (this.boost_ - this.exalted != 0 || this.exalted != 0) {
_loc2_ = "";
if (this.boost_ - this.exalted != 0) {
_loc2_ = _loc2_ + (" (" + (this.boost_ - this.exalted > 0 ? "+" : "") + (this.boost_ - this.exalted).toString() + ")");
}
this.boostText_.setStringBuilder(this.valueTextStringBuilder_.setString(_loc2_));
if (!contains(this.boostText_)) {
this.boostText_.mouseEnabled = false;
this.boostText_.mouseChildren = false;
addChild(this.boostText_);
}
if (this.exalted != 0) {
this.exaltValText.setStringBuilder(this.valueTextStringBuilder_.setString(" (+" + this.exalted + ")"));
if (!contains(this.exaltValText)) {
this.exaltValText.mouseEnabled = false;
this.exaltValText.mouseChildren = false;
addChild(this.exaltValText);
}
}
this.valueText_.x = this.w_ * 0.5 - (this.valueText_.width + (this.boostText_.width != 0 ? this.boostText_.width - 4 : 0) + (this.exaltValText.width != 0 ? this.exaltValText.width - 4 : 0)) * 0.5;
this.boostText_.x = this.valueText_.x + this.valueText_.width - 4;
this.exaltValText.x = !!contains(this.boostText_) ? this.boostText_.x + this.boostText_.width - 4 : Number(this.valueText_.x + this.valueText_.width - 4);
} else {
this.valueText_.x = this.w_ * 0.5 - this.valueText_.width * 0.5;
if (this.boost_ == 0 && contains(this.boostText_)) {
removeChild(this.boostText_);
}
if (this.exalted == 0 && contains(this.exaltValText)) {
removeChild(this.exaltValText);
}
}
}
public function showMultiplierText():void {
this.multiplierIcon.mouseEnabled = false;
this.multiplierIcon.mouseChildren = false;
addChild(this.multiplierIcon);
this.startPulse(3, 9493531, 16777215);
}
public function hideMultiplierText():void {
if (this.multiplierIcon.parent) {
removeChild(this.multiplierIcon);
}
}
public function startPulse(param1:Number, param2:Number, param3:Number):void {
this.isPulsing = true;
this.color_ = param2;
this.pulseBackColor = param3;
this.repetitions = param1;
this.internalDraw();
addEventListener("enterFrame", this.onPulse, false, 0, true);
}
private function setTextColor(param1:uint):void {
this.textColor_ = param1;
if (this.boostText_ != null) {
this.boostText_.setColor(this.textColor_);
}
this.valueText_.setColor(this.textColor_);
}
private function bTextEnabled(param1:int):Boolean {
return param1 && (param1 == 1 || param1 == 2 && this.isProgressBar_ || param1 == 3 && !this.isProgressBar_);
}
private function internalDraw():void {
graphics.clear();
this.colorSprite.graphics.clear();
var _loc1_:int = 16777215;
if (this.maxMax_ > 0 && this.max_ - this.boost_ == this.maxMax_) {
_loc1_ = 16572160;
} else if (this.boost_ > 0) {
_loc1_ = 6206769;
}
if (this.textColor_ != _loc1_) {
this.setTextColor(_loc1_);
}
graphics.beginFill(this.backColor_);
graphics.drawRect(0, 0, this.w_, this.h_);
graphics.endFill();
if (this.isPulsing) {
this.colorSprite.graphics.beginFill(this.pulseBackColor);
this.colorSprite.graphics.drawRect(0, 0, this.w_, this.h_);
}
this.colorSprite.graphics.beginFill(this.color_);
if (this.max_ > 0) {
this.colorSprite.graphics.drawRect(0, 0, this.w_ * (this.val_ / this.max_), this.h_);
} else {
this.colorSprite.graphics.drawRect(0, 0, this.w_, this.h_);
}
this.colorSprite.graphics.endFill();
if (this.bTextEnabled(Parameters.data.toggleBarText) || this.mouseOver_ && this.h_ > 4 || this.forceNumText_) {
this.drawWithMouseOver();
} else {
if (contains(this.valueText_)) {
removeChild(this.valueText_);
}
if (contains(this.boostText_)) {
removeChild(this.boostText_);
}
if (contains(this.exaltValText)) {
removeChild(this.exaltValText);
}
}
}
private function onMultiplierOver(param1:MouseEvent):void {
dispatchEvent(new Event("MULTIPLIER_OVER"));
}
private function onMultiplierOut(param1:MouseEvent):void {
dispatchEvent(new Event("MULTIPLIER_OUT"));
}
private function onPulse(param1:Event):void {
if (this.colorSprite.alpha > 1 || this.colorSprite.alpha < 0) {
this.direction = this.direction * -1;
if (this.colorSprite.alpha > 1) {
this.repetitions--;
if (!this.repetitions) {
this.isPulsing = false;
this.color_ = this.defaultForegroundColor;
this.backColor_ = this.defaultBackgroundColor;
this.colorSprite.alpha = 1;
this.internalDraw();
removeEventListener("enterFrame", this.onPulse);
}
}
}
this.colorSprite.alpha = this.colorSprite.alpha + this.speed * this.direction;
}
private function onMouseOver(param1:MouseEvent):void {
this.mouseOver_ = true;
this.internalDraw();
}
private function onMouseOut(param1:MouseEvent):void {
this.mouseOver_ = false;
this.internalDraw();
}
}
}
|
package axl.xdef.types.display
{
import flash.display.Stage;
import flash.events.Event;
import flash.events.NetStatusEvent;
import flash.events.SecurityErrorEvent;
import flash.media.SoundTransform;
import flash.media.Video;
import flash.net.NetConnection;
import flash.net.NetStream;
import flash.net.NetStreamPlayOptions;
import flash.utils.setTimeout;
import axl.utils.Counter;
import axl.utils.U;
import axl.xdef.XSupport;
/** Simple Video On Demand class that applies minimal mechanic for right net-events respnses and
* video display. Instantiated from <h3><code><vod/></code></h3>
* Class provides dynamic mechanic (takes care of setting up net connection, net stream, setting buffers),
* and turns it into easy API. Minimal setup requires to put <code>rtmp</code> property up and call <code>play()</code>.
* <br><br>There are few more playback options like AUTOPLAY, looping, pause(), restart(), volume etc.
* There's also set of callbacks that can be connected to this instance and withdrawn at any time. Class
* provides detailed info about playback state in terms of timing (percentage time, percentage buffer, percentage
* bytes).<br><br>All that together makes building video player easier than it would appear. <br><br>
* At the moment despite property <code>useStageVideo</code> presence, there's no stage video support. */
public class xVOD extends xSprite
{
public static const version:String = '0.91';
private var tname:String = '[xVOD ' + version +']';
private var xrtmp:String;
private var xvideoMeta:Object;
private var xloops:int=1;
private var xpercentTime:Number=0;
private var xpercentBuffer:Number=0;
private var xpercentBytes:Number=0;
private var xvideoAspectRatio:Number=0;
private var xbufferMax:Number = 1;
private var xheight:Number=0;
private var xwidth:Number=0;
private var xbufferPlayback:Number = 1;
private var xvolume:Number = 0.1;
private var xonFrame:Function;
private var infiniteLoop:Boolean = false;
private var xnc:NetConnection;
private var xvideo:Video;
private var xns:NetStream;
private var nso:NetStreamPlayOptions;
private var EMPTY_BUFFER:Boolean=true;
private var DESTROYED:Boolean=false;
private var FIRST_FILL:Boolean=true;
private var IS_PAUSED:Boolean=false;
/** Determines if video is going to start playing ASAP or stays paused waiting
* for play command. */
public var AUTOPLAY:Boolean = true;
/** Not supported yet */
public var useStageVideo:Boolean=false;
/** Determines if setting width / height should allow to squeeze video (false)
* or always maintain aspect ratio (true) @default true */
public var keepAspectRatio:Boolean=true;
/** Allows to define user actions on not covered cases in response to
* event.info.code of NetStatusEvent. Currently covered cases:
* <ul><li>NetConnection<ul><li>Connect.Success</li><li>Connect.Rejected</li>
* <li>Connect.Closed</li><li>Call.failed</li></ul></li>
* <li>NetStream<ul><li>Play.StreamNotFound</li><li>Play.Failed</li><li>Play.Start</li>
* <li>Play.Stop</li><li>Buffer.Full</li><li>Buffer.Empty</li>* <li>Pause.Notify</li>
* <li>Unause.Notify</li></ul></li> </ul> */
public var netStausEventFunctionMap:Object = {};
/** Sets the initial number of seconds of video that has to be loaded before it's available to play. */
public var bufferInitial:Number = 1;
/** Determines if instance should be disposed once video is finished. Disposed instances can not
* be re-used @default true*/
public var destroyOnEnd:Boolean=true;
/** Specifies number of miliseconds before re-connect if previous connection attempt failed and
* <code>reconnectAttemptsNo > 0</code> @see #reconnectAttemptsNo*/
public var reconnectGapMs:int = 2;
/** If server has rejected connection request or internet connection is down, player can try to re-connect.
* This property defines how many times the reconnect attempt should be made before giving up (destroy)
* @see #reconnectGapMs @see #destroy() */
public var reconnectAttemptsNo:int;
/** Function or portion of uncompiled code to execute when video playback reaches an end, before
* posible exit sequence. An argument for binCommand. * @see axl.xdef.types.display.xRoot#binCommand()*/
public var onComplete:Object;
/** Function or portion of uncompiled code to execute when an exit sequence occurs.
* This may happen for various reasons: video reaches an end, video has been removed from stage,
* <code>destroy</code> method has been called manually, security error on net connection occured, exceeded
* amount of re-connections, NetConnection.Call.Failed, NetConnection.Connect.Closed, NetStream.Play.StreamNotFound,
* NetStream.Play.Failed.<br>An argument for binCommand. * @see axl.xdef.types.display.xRoot#binCommand()*/
public var onExit:Object;
/** Function or portion of uncompiled code to execute when video starts playing. Both initial and unpause states.
* An argument for binCommand. * @see axl.xdef.types.display.xRoot#binCommand()*/
public var onPlayStart:Object;
/** Function or portion of uncompiled code to execute when video buffer reaches it's maximum value (
* <code>bufferInitial</code>, then switched to <code>bufferPlayback</code>). Tracking execution of
* this callback allows to increase buffer and if hit again - interpretate as sign of
* good bandwidth, hence potential juggle to better quality should be considered (if available).
* <br> An argument for binCommand. * @see axl.xdef.types.display.xRoot#binCommand()*/
public var onBufferFull:Object;
/** Function or portion of uncompiled code to execute when video buffer gets empty, typically bandwidth
* can't keep up, hence potential juggle to lower quality should be considered (if available).
* This may also happen as a consequence of internet connection loss.
* <br> An argument for binCommand. * @see axl.xdef.types.display.xRoot#binCommand()*/
public var onBufferEmpty:Object;
/** Function or portion of uncompiled code to execute when video is paused. First execution may occur
* right after video is available for play but <code>AUTOPLAY = false</code> (video is paused then).
* <br> An argument for binCommand. * @see axl.xdef.types.display.xRoot#binCommand()*/
public var onPlayStop:Object;
/** Function or portion of uncompiled code to execute when video meta data is first received.
* Accessible via <code>videoMeta</code>
* <br> An argument for binCommand. * @see axl.xdef.types.display.xRoot#binCommand()*/
public var onMeta:Object;
private var xcounter:Counter;
private var xtimePassed:String;
private var xtimeRemaining:String;
/** Format for requesting timeRemaing and timePassed. @see axl.utils.Counter#defaultFormat*/
public var timeFormat:String;
/** When duration of video is known, internal timer updates two properties:
* timePassed and timeRemaining accordong to timeFormat. Once this is done,
* Function or portion of uncompiled hold by this field can be executed.
* <br> An argument for binCommand. * @see axl.xdef.types.display.xRoot#binCommand()
* @see #timePassed @see #timeRemaining*/
public var onTimerUpdate:Object;
/** Simple Video On Demand class that applies minimal mechanic for right net-events respnses and
* video display. Instantiated from <vod/>
* @param definition - xml definition
* @param xroot - reference to parent xRoot object
* @see axl.xdef.types.display.xVOD
* @see axl.xdef.interfaces.ixDef#def
* @see axl.xdef.interfaces.ixDef#xroot
* @see axl.xdef.XSupport#getReadyType2() */
public function xVOD(definition:XML=null, xrootObj:xRoot=null)
{
super(definition, xrootObj);
xcounter = new Counter();
xcounter.autoStart = false;
xcounter.interval = 1;
}
private function xOnTimerUpdate():void
{
if(!ns || !videoMeta || !videoMeta.hasOwnProperty('duration'))
return;
xcounter.timing = [0, int(videoMeta.duration)];
xcounter.time = ns.time;
xtimeRemaining = xcounter.tillNext(timeFormat,-1);
xtimePassed = xcounter.tillNext(timeFormat,-2);
if(onTimerUpdate is String)
xroot.binCommand(onTimerUpdate,this);
if(onTimerUpdate is Function)
onTimerUpdate(xtimeRemaining);
}
private function dealWithStage():void
{
if(xroot.stage)
getStageVideos(xroot.stage);
else
{
xroot.addEventListener(Event.ADDED_TO_STAGE, function xrootObjOnStage(e:Event):void
{
xroot.removeEventListener(Event.ADDED_TO_STAGE, xrootObjOnStage);
getStageVideos(xroot.stage);
});
}
}
private function getStageVideos(stage:Stage):void
{
if(debug) U.log(tname + '[getStageVideos]', stage);
}
//------------------------------------------------------ END OF STAGE SECTION ------------------------------------------------------//
//------------------------------------------------------ CONNECTION SECTION ------------------------------------------------------//
private function build_netConnection():void
{
if(debug) U.log(tname +"[build_netConnection]");
if(nc && nc.connected && (nc.uri == rtmp))
{
if(debug) U.log(tname + 'already connected');
ON_CONNECTED();
}
else
{
destroyNC();
DESTROYED = false;
xnc = new NetConnection();
nc.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
nc.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
nc.connect(null);
if(debug) U.log(tname + rtmp);
}
}
private function build_netStream():void
{
if(debug) U.log(tname+"build_netStream", ns);
destroyNS();
FIRST_FILL = true;
xns = new NetStream(nc);
ns.soundTransform = new SoundTransform(xvolume);
ns.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
ns.videoReliable = false;
ns.audioReliable = false;
ns.client = {};
ns.client.onMetaData = onMetaData;
//ns.client.onCuePoint = onCuePoint;
ns.client.onPlayStatus = onPlayStatus;
ns.bufferTime = bufferInitial;
ns.bufferTimeMax = bufferMax;
nso = new NetStreamPlayOptions();
}
private function build_video():void
{
if(useStageVideo)
dealWithStage();
else
buildClassicVideo();
}
private function buildClassicVideo():void
{
if(video == null)
{
xvideo = new Video();
xvideo.smoothing = true;
updateDimensions();
}
if(ns)
video.attachNetStream(ns);
if(!this.contains(video))
this.addChild(video);
}
private function updateDimensions():void
{
if(xwidth > 0)
width = this.xwidth;
if(this.xheight > 0)
height = this.xheight;
}
//------------------------------------------------------ END OF CONNECTION SECTION ------------------------------------------------------//
//------------------------------------------------------ EVENT HANDLING SECTION ------------------------------------------------------//
override protected function addedToStageHandler(e:Event):void
{
super.addedToStageHandler(e);
}
override protected function removeFromStageHandler(e:Event):void
{
super.removeFromStageHandler(e);
EXIT_SEQUENCE();
}
/** Responds to enter frame function if <code>onFrame</code> is defined*/
protected function onEnterFrameHandler(e:Event=null):void
{
if(nc == null || ns == null)
return;
onFrame();
}
/** Responds to various NetStatusEvent's. General logic distribution is spread against 7 main functions:
* <i>ON_CONNECTED, tryReconnect, EXIT_SEQUENCE, ON_BUFER_FULL, ON_BUFFER_EMPTY, ON_PLAY_START, ON_PAUSE</i>*/
protected function netStatusHandler(event:NetStatusEvent):void
{
if(debug) U.log(tname +'+++++++++ netStatusHandler +++++++++', event.info.code);
switch (event.info.code)
{
//1
case "NetConnection.Connect.Success":
ON_CONNECTED();
break;
//2 + 3
case "NetConnection.Connect.Failed":
case "NetStream.Connect.Rejected":
tryReconnect();
break;
//4
case "NetConnection.Call.Failed":
EXIT_SEQUENCE();
break;
//5
case "NetConnection.Connect.Closed":
//onNetworkFail ? onNetworkFail() : EXIT_SEQUENCE();
EXIT_SEQUENCE();
break;
//6
case "NetStream.Play.StreamNotFound":
EXIT_SEQUENCE();
break;
//7
case "NetStream.Play.Failed":
EXIT_SEQUENCE();
break;
//8
case "NetStream.Play.Start":
IS_PAUSED = false;
ON_PLAY_START();
break;
//9
case "NetStream.Play.Stop":
//EXIT_SEQUENCE();
IS_PAUSED = true;
break;
//10
case "NetStream.Buffer.Full":
ON_BUFFER_FULL();
break;
//11
case "NetStream.Buffer.Empty":
ON_BUFFER_EMPTY();
break;
//14
case "NetStream.Pause.Notify":
ON_PAUSE();
break;
case "NetStream.Unpause.Notify":
ns.bufferTime = bufferPlayback;
ON_PLAY_START();
break;
default:
var f:Object = netStausEventFunctionMap[event.info.code];
if(f is Function) f();
else if(f is String) xroot.binCommand(f,this);
else if(debug) U.log(tname +"[netStatusHandler] no behaviour defined for", event.info.code);
break;
}
}
/** Responds to security error by calling EXIT_SEQUENCE*/
protected function securityErrorHandler(e:SecurityErrorEvent):void
{
if(debug) U.log(e);
EXIT_SEQUENCE();
}
/** Responds to NetStream.Play.Complete - resolves replay or exit */
protected function onPlayStatus(info:Object):void
{
if(debug) U.log(U.bin.structureToString(info))
if('code' in info)
{
switch(info.code)
{
case "NetStream.Play.Complete":
resolveVideoComplete();
break;
default:
if(debug) U.log(tname +"[onPlayStatus] no behaviour defined for", info.code);
break;
}
}
}
/** As soon as meta data is received, video dimensions and aspect ratio is parsed */
protected function onMetaData(info:Object):void
{
if(debug) U.log(tname + "onMetaData\n");
xvideoMeta = info;
var w:Number = info.width as Number;
var h:Number = info.height as Number;
if(debug) U.log('original dim', w + 'x' + h);
if(!isNaN(w) && !isNaN(h) && w > 0 && h > 0)
{
xvideoAspectRatio = w/h;
updateDimensions();
if(debug) U.log("videoAspectRatio", videoAspectRatio, "actual video object dimensions:", video ? (video.width + "x" + video.height) : '');
}
xcounter.timing = [0, int(xvideoMeta.duration)];
xcounter.time = ns.time;
xcounter.onUpdate = xOnTimerUpdate;
if(onMeta is String)
xroot.binCommand(onMeta,this);
if(onMeta is Function)
onMeta();
}
//-------------------------------------------------------------- END OF EVENT HANDLING SECTION ------------------------------------------------------//
//-------------------------------------------------------------- MECHANIC SECTION ------------------------------------------------------//
private function resolveVideoComplete():void
{
if(infiniteLoop || --xloops > 0)
restart();
else
{
if(onComplete is String) xroot.binCommand(onComplete,this);
else if(onComplete is Function) onComplete();
if(destroyOnEnd)
EXIT_SEQUENCE()
else if(debug) U.log(tname + "destroyOnEnd=false, call EXIT_SEQUENCE or destroy() to dispose this content");
}
}
private function ON_CONNECTED():void
{
if(debug) U.log("ON_CONNECTED");
if(DESTROYED)
{
if(debug) U.log("connected while destroyed, return");
EXIT_SEQUENCE();
return;
}
build_netStream(); // BUILDING NET STREAM
build_video(); // DECIDING WHICH AND BUILDING VIDEO
if(debug) U.log(tname +"NS PLAY!", rtmp);
ns.play(rtmp); // PLAY MEANS FILL THE BUFFER IN FACT. ACTUAL PLAY OCCURES ON_PLAY_START
}
private function ON_PLAY_START():void
{
if(debug) U.log("ON_PLAY_START");
xcounter.interval =1;
IS_PAUSED = false;
if(onPlayStart is String) xroot.binCommand(onPlayStart,this);
else if(onPlayStart is Function) onPlayStart();
if(FIRST_FILL)
{
if(AUTOPLAY)
{
if(debug) U.log(tname +"[ON_PLAY_START] AUTOPLAY = true - NOT PAUSING");
ns.bufferTime = bufferPlayback;
}
else
{
if(debug) U.log(tname +"[ON_PLAY_START] AUTOPLAY = false - PAUSING");
ns.pause();
}
}
else if(FIRST_FILL = false)
{
if(debug) U.log(tname +"[ON_PLAY_START] FIRST_FILL = false");
ns.bufferTime = bufferPlayback;
}
FIRST_FILL = false;
}
private function ON_PAUSE():void
{
IS_PAUSED = true;
if(onPlayStop is String) xroot.binCommand(onPlayStop,this);
else if(onPlayStop is Function) onPlayStop();
xcounter.timing = [0, int(xvideoMeta.duration)];
xcounter.time = ns.time;
}
private function ON_BUFFER_FULL():void
{
if(debug) U.log("ON_BUFFER_FULL");
EMPTY_BUFFER = false;
if(FIRST_FILL)
{
// THIS DOES NOT CHANGE BUFFER FROM INITIAL TO PLAYBACK BECAUSE ONLY PLAY CAN DO IT
//PLAY ON FIRST FILL SO FIRST_FILL ALSO REMAINS UNTOUCHED
if(debug) U.log(tname + "bufferInitialMs filled", bufferInitial);
if(AUTOPLAY)
{
if(debug) U.log(tname +"[ON_BUFFER_FULL] AUTOPLAY = true - NOT PAUSING");
}
else
{
if(debug) U.log(tname +"[ON_BUFFER_FULL] AUTOPLAY = false - PAUSING");
ns.pause();
}
}
else
{
if(debug) U.log(tname +"[ON_BUFFER_FULL] FIRST_FILL = false");
}
if(debug) U.log(tname +"NEW BUFFER TIME :", ns.bufferTime);
if(onBufferFull is String) xroot.binCommand(onBufferFull,this);
else if(onBufferFull is Function) onBufferFull();
}
private function ON_BUFFER_EMPTY():void
{
if(debug) U.log("ON_BUFFER_EMPTY");
EMPTY_BUFFER = true;
if(onBufferEmpty is String) xroot.binCommand(onBufferEmpty,this);
else if(onBufferEmpty is Function) onBufferEmpty();
}
private function tryReconnect():void
{
if(debug) U.log("tryReconnect",reconnectAttemptsNo);
if(--reconnectAttemptsNo > 0)
{
setTimeout(build_netConnection, reconnectGapMs);
}
else
{
if(debug) U.log(" ☠ ☠ ☠ "+reconnectAttemptsNo+" RECCONECTS FAIL ☠ ☠ ☠ ");
EXIT_SEQUENCE();
}
}
private function EXIT_SEQUENCE():void
{
if(!DESTROYED)
{
if(debug) U.log("EXIT_SEQUENCE");
onFrame = null;
destroyAll();
if(onExit is String) xroot.binCommand(onExit,this);
else if(onExit is Function) onExit();
}
}
//------------------------------------------------------ DESTROY SECTION ------------------------------------------------------//
private function destroyAll():void
{
if(debug) U.log(tname +"DESTROY ALL");
DESTROYED = true;
IS_PAUSED = false;
xvideoMeta = null;
destroyNC();
destroyNS();
destroyVideo();
xrtmp = null;
xcounter.stopAll();
}
private function destroyNC():void
{
if(nc)
{
if(debug) U.log(tname+"DESTROY NET CONNECTION");
nc.removeEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
nc.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
nc.close();
xnc = null;
}
xvideoAspectRatio = 0;
xvideoMeta = null;
}
private function destroyNS():void
{
if(ns)
{
if(debug) U.log(tname+"DESTROY NET STREAM");
ns.removeEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
try
{
ns.client = null;
ns.close();
ns.dispose();
}
catch(e:*) { }
xns = null;
}
nso= null;
xvideoAspectRatio = 0;
xvideoMeta = null;
}
private function destroyVideo():void
{
if(video)
{
if(debug) U.log(tname+"DESTROY VIDEO");
video.attachNetStream(null);
video.clear();
if(video.parent)
video.parent.removeChild(video);
xvideo = null;
}
xvideoAspectRatio = 0;
xvideoMeta = null;
}
//------------------------------------------------------ PUBLIC API ------------------------------------------------------//
/** Returns metadata object supplied by netstream (info about video) if available, null otherwise */
public function get videoMeta():Object { return xvideoMeta }
/** Returns video dimensions aspect ratio (w/h) if available, 0 otherwise */
public function get videoAspectRatio():Number { return xvideoAspectRatio }
/** Returns NetConnection instance used for NetSteeam if available, null otherwise */
public function get nc():NetConnection { return xnc }
/** Returns video instance itself */
public function get video():Video { return xvideo}
/** Returns NetStream instance used if available, null otherwise */
public function get ns():NetStream { return xns }
/** Video address to play. Eg. <i>http://ggl.com/v.mp4</i><br>Changing this property during playback causes
* closure of existing connection / stream instantly and building new one instead. */
public function get rtmp():String { return xrtmp }
public function set rtmp(v:String):void
{
if(v == xrtmp)
return;
if(debug) U.log(tname+"SETTING RTMP", v);
destroyAll();
xrtmp = v;
build_netConnection();
}
/** Determines how many times video will be played/restarted before <code>onComplete</code> sequence is fired */
public function get loops():int { return xloops }
public function set loops(v:int):void
{
xloops = v;
infiniteLoop = (v < 1);
}
/** Dettermines length of buffer (needed to start playing video) @see #bufferInitial */
public function get bufferPlayback():Number { return xbufferPlayback }
public function set bufferPlayback(v:Number):void
{
xbufferPlayback = v;
if(!FIRST_FILL && ns)
ns.bufferTime = v;
}
/** Specifies a maximum buffer length for live streaming content, in seconds.*/
public function get bufferMax():Number { return xbufferMax }
public function set bufferMax(v:Number):void
{
xbufferMax = v;
if(ns)
ns.bufferTimeMax = v;
}
/** Controlls video sound volume. 0 - 1 */
public function get volume():Number { return xvolume }
public function set volume(v:Number):void
{
xvolume = v > 1 ? 1 : (v < 0 ? 0 : v);
if(ns)
ns.soundTransform = new SoundTransform(xvolume);
}
/** Function to execute on every frame. (callback instead of event listener)*/
public function get onFrame():Function { return xonFrame }
public function set onFrame(v:Function):void
{
if(v == null)
this.removeEventListener(Event.ENTER_FRAME, onEnterFrameHandler);
else
{
this.addEventListener(Event.ENTER_FRAME, onEnterFrameHandler);
}
xonFrame = v;
}
/** Returns values 0-1, determining percentage of video played back.<br>If for whatever reason
* info can't be obtained - returns 0*/
public function get percentTime():Number
{
if(nc == null || ns == null || xvideoMeta == null)
return 0;
xpercentTime = (ns.time / xvideoMeta.duration);
if(xpercentTime < 0) xpercentTime = 0;
if(xpercentTime > 1) xpercentTime = 1;
return xpercentTime;
}
/** Returns values 0-1, determining percentage of sumaric video playback head and data in the buffer.
* <br>If for whatever reason info can't be obtained - returns 0 */
public function get percentBuffer():Number
{
if(nc == null || ns == null || xvideoMeta == null)
return 0;
xpercentBuffer = ((ns.bufferLength + ns.time) / xvideoMeta.duration);
if(xpercentBuffer < 0) xpercentBuffer = 0;
if(xpercentBuffer > 1) xpercentBuffer = 1;
return xpercentBuffer;
}
/** Returns values 0-1, determining percentage of bytes loaded against total bytes.<br>
* If for whatever reason info can't be obtained - returns 0 */
public function get percentBytes():Number
{
if(ns == null)
return 0;
xpercentBytes = ns.bytesLoaded / ns.bytesTotal;
if(xpercentBytes < 0) xpercentBytes = 0;
if(xpercentBytes > 1) xpercentBytes = 1;
return xpercentBytes;
}
/**Sets height of the video. If <code>keepAspectRatio=true</code> also sets width.*/
override public function set height(v:Number):void
{
xheight = v;
if(video)
{
video.height = xheight;
if(keepAspectRatio && videoAspectRatio > 0)
{
video.width = xheight * videoAspectRatio;
xwidth = video.width;
}
}
}
/**Sets width of the video. If <code>keepAspectRatio=true</code> also sets height.*/
override public function set width(v:Number):void
{
xwidth = v;
if(video)
{
video.width = xwidth;
if(keepAspectRatio && videoAspectRatio > 0)
{
video.height = xwidth / videoAspectRatio;
xheight = video.height;
}
}
}
/** Pauses video if available. Same result as <code>stop()</code> */
public function pause():void { ns ? ns.pause() : null }
/** Pauses video if available. Same result as <code>pause()</code> */
public function stop():void { ns ? ns.pause() : null }
/** Stops video, terminates all connections. Does not remove references. */
public function destroy():void { EXIT_SEQUENCE(); }
/** If connection is not yet established - starts build sequence. Otherwise attempts to unpause. */
public function play():void
{
if(!nc)
return build_netConnection();
if(nc && nc.connected)
{
if(ns)
ns.resume();
}
}
/** If connections are established - seeks for key frame 0 and dispatches onPlayStart, otherwise
* destroys instance and builds it again. */
public function restart():void
{
if(nc && nc.connected && ns)
{
ns.seek(0);
ON_PLAY_START(); // because seek dispatches SeekStart.Notify and Seek.Notify only (no Play.Start);
}
else
{
destroyAll();
XSupport.applyAttributes(def, this);
build_netConnection();
}
}
/** Returns formatted according to <code>timeFormat</code> String describing current video
* playback remaining till video end time @see #timeFormat */
public function get timeRemaining():String { return xtimeRemaining }
/** Returns formatted according to <code>timeFormat</code> String describing current video
* playback time @see #timeFormat */
public function get timePassed():String { return xtimeRemaining }
}
} |
#include "Object.as"
shared interface IHasParent
{
void SetParent(Object@ parent);
Object@ getParent();
bool hasParent();
}
|
package io.decagames.rotmg.seasonalEvent.popups {
import flash.events.MouseEvent;
import io.decagames.rotmg.ui.popups.signals.ClosePopupSignal;
import robotlegs.bender.bundles.mvcs.Mediator;
public class SeasonalEventComingPopupMediator extends Mediator {
[Inject]
public var view:SeasonalEventComingPopup;
[Inject]
public var closePopupSignal:ClosePopupSignal;
public function SeasonalEventComingPopupMediator() {
super();
}
override public function destroy() : void {
this.view.okButton.removeEventListener("click",this.onOK);
}
override public function initialize() : void {
this.view.okButton.addEventListener("click",this.onOK);
}
private function onOK(param1:MouseEvent) : void {
this.view.okButton.removeEventListener("click",this.onOK);
this.closePopupSignal.dispatch(this.view);
}
}
}
|
// Action script...
// [Initial MovieClip Action of sprite 20893]
#initclip 158
if (!ank.battlefield.VisualEffectHandler)
{
if (!ank)
{
_global.ank = new Object();
} // end if
if (!ank.battlefield)
{
_global.ank.battlefield = new Object();
} // end if
var _loc1 = (_global.ank.battlefield.VisualEffectHandler = function (b, c)
{
this.initialize(b, c);
}).prototype;
_loc1.initialize = function (b, c)
{
this._mcBattlefield = b;
this._mcContainer = c;
this.clear();
};
_loc1.clear = function (Void)
{
this._incIndex = 0;
};
_loc1.addEffect = function (sprite, oVisualEffect, nCellNum, displayType, targetSprite, bVisible)
{
if (displayType < 10)
{
return;
} // end if
var _loc8 = oVisualEffect.bInFrontOfSprite ? (1) : (-1);
var _loc9 = this.getNextIndex() + ank.battlefield.Constants.MAX_SPRITES_ON_CELL / 2 + 1;
this._mcContainer["eff" + _loc9].removeMovieClip();
this._mcContainer.createEmptyMovieClip("eff" + _loc9, nCellNum * 100 + 50 + _loc8 * _loc9);
var _loc10 = this._mcContainer["eff" + _loc9];
_loc10.createEmptyMovieClip("mc", 10);
_loc10._visible = bVisible == undefined ? (true) : (bVisible);
var _loc11 = new MovieClipLoader();
_loc11.addListener(this);
_loc10.sprite = sprite;
_loc10.targetSprite = targetSprite;
_loc10.cellNum = nCellNum;
_loc10.displayType = displayType;
_loc10.level = oVisualEffect.level;
_loc10.params = oVisualEffect.params;
if (oVisualEffect.bTryToBypassContainerColor == true)
{
var _loc12 = new Color(_loc10);
_loc12.setTransform({ra: 200, rb: 0, ga: 200, gb: 0, ba: 200, bb: 0});
} // end if
_loc11.loadClip(oVisualEffect.file, _loc10.mc);
ank.utils.Timer.setTimer(_loc10, "battlefield", _loc10, _loc10.removeMovieClip, ank.battlefield.Constants.VISUAL_EFFECT_MAX_TIMER);
};
_loc1.onLoadInit = function (mc)
{
var _loc3 = mc._parent.sprite;
var _loc4 = mc._parent.targetSprite;
var _loc5 = mc._parent.cellNum;
var displayType = mc._parent.displayType;
var _loc6 = mc._parent.level;
var _loc7 = mc._parent.params;
var _loc8 = mc._parent.ignoreTargetInHeight;
var _loc9 = _loc3.cellNum;
var _loc10 = this._mcBattlefield.mapHandler.getCellData(_loc9);
var _loc11 = this._mcBattlefield.mapHandler.getCellData(_loc5);
var _loc12 = !_loc3 ? ({x: _loc10.x, y: _loc10.y}) : ({x: _loc3.mc._x, y: _loc3.mc._y});
var _loc13 = !_loc4 ? ({x: _loc11.x, y: _loc11.y}) : ({x: _loc4.mc._x, y: _loc4.mc._y});
mc._ACTION = _loc3;
mc.level = _loc6;
mc.angle = Math.atan2(_loc13.y - _loc12.y, _loc13.x - _loc12.x) * 180 / Math.PI;
mc.params = _loc7;
switch (displayType)
{
case 10:
case 12:
{
mc._x = _loc12.x;
mc._y = _loc12.y;
break;
}
case 11:
{
mc._x = _loc13.x;
mc._y = _loc13.y;
break;
}
case 20:
case 21:
{
mc._x = _loc12.x;
mc._y = _loc12.y;
var _loc14 = Math.PI / 2;
var _loc15 = _loc13.x - _loc12.x;
var _loc16 = _loc13.y - _loc12.y;
mc.rotate._rotation = mc.angle;
var _loc17 = mc.attachMovie("shoot", "shoot", 10);
_loc17._x = _loc15;
_loc17._y = _loc16;
break;
}
case 30:
case 31:
{
mc._x = _loc12.x;
mc._y = _loc12.y - 10;
mc.level = _loc6;
var _loc18 = displayType == 31 || displayType == 33 ? (9.000000E-001) : (5.000000E-001);
var speed = displayType == 31 || displayType == 33 ? (4.000000E-001) : (5.000000E-001);
var _loc19 = Math.PI / 2;
var _loc20 = _loc13.x - _loc12.x;
var _loc21 = _loc13.y - _loc12.y;
var _loc22 = (Math.atan2(_loc21, Math.abs(_loc20)) + _loc19) * _loc18;
var _loc23 = _loc22 - _loc19;
var xDest = Math.abs(_loc20);
var yDest = _loc21;
mc.startangle = _loc23;
if (_loc20 <= 0)
{
if (_loc20 == 0 && _loc21 < 0)
{
mc._yscale = -mc._yscale;
yDest = -yDest;
} // end if
mc._xscale = -mc._xscale;
} // end if
mc.attachMovie("move", "move", 2);
var vyi;
var x;
var y;
var g = 9.810000E+000;
var halfg = g / 2;
var t = 0;
var vx = Math.sqrt(Math.abs(halfg * Math.pow(xDest, 2) / Math.abs(yDest - Math.tan(_loc23) * xDest)));
var vy = Math.tan(_loc23) * vx;
mc.onEnterFrame = function ()
{
vyi = vy + g * t;
x = t * vx;
y = halfg * Math.pow(t, 2) + vy * t;
t = t + speed;
if (Math.abs(y) >= Math.abs(yDest) && x >= xDest || x > xDest)
{
this.attachMovie("shoot", "shoot", 2);
this.shoot._x = xDest;
this.shoot._y = yDest;
this.shoot._rotation = Math.atan(vyi / vx) * 180 / Math.PI;
this.end();
delete this.onEnterFrame;
}
else
{
this.move._x = x;
this.move._y = y;
this.move._rotation = Math.atan(vyi / vx) * 180 / Math.PI;
} // end else if
};
break;
}
case 40:
case 41:
{
mc._x = _loc12.x;
mc._y = _loc12.y;
var _loc24 = 20;
var xStart = _loc12.x;
var yStart = _loc12.y;
var xDest = _loc13.x;
var yDest = _loc13.y;
var rot = Math.atan2(yDest - yStart, xDest - xStart);
var fullDist = Math.sqrt(Math.pow(xStart - xDest, 2) + Math.pow(yStart - yDest, 2));
var interval = fullDist / Math.floor(fullDist / _loc24);
var dist = 0;
var inc = 1;
mc.onEnterFrame = function ()
{
dist = dist + interval;
if (dist > fullDist)
{
this.end();
if (displayType == 41)
{
this.attachMovie("shoot", "shoot", 10);
this.shoot._x = xDest - xStart;
this.shoot._y = yDest - yStart;
} // end if
delete this.onEnterFrame;
}
else
{
var _loc2 = this.attachMovie("duplicate", "duplicate" + inc, inc);
_loc2._x = dist * Math.cos(rot);
_loc2._y = dist * Math.sin(rot);
++inc;
} // end else if
};
break;
}
case 50:
case 51:
{
mc.cellFrom = _loc12;
mc.cellTo = _loc13;
break;
}
} // End of switch
};
_loc1.getNextIndex = function (Void)
{
++this._incIndex;
if (this._incIndex > ank.battlefield.VisualEffectHandler.MAX_INDEX)
{
this._incIndex = 0;
} // end if
return (this._incIndex);
};
ASSetPropFlags(_loc1, null, 1);
(_global.ank.battlefield.VisualEffectHandler = function (b, c)
{
this.initialize(b, c);
}).MAX_INDEX = 21;
} // end if
#endinitclip
|
package {
import flash.display.Sprite;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.events.Event;
import flash.geom.Rectangle;
import starling.core.Starling;
import starling.events.Event;
import starling.events.ResizeEvent;
[SWF(width = "1280", height = "720", frameRate = "60", backgroundColor = "#121314")]
public class Main extends Sprite {
// Don't skip the "embedAsCFF"-part!
[Embed(source="../fonts/Roboto-Medium.ttf", embedAsCFF="false", fontFamily="Roboto-Medium")]
private static const Roboto:Class;
public var mStarling:Starling;
public function Main() {
super();
stage.align = StageAlign.TOP_LEFT;
stage.scaleMode = StageScaleMode.NO_SCALE;
Starling.multitouchEnabled = true; // useful on mobile devices
var viewPort:Rectangle = new Rectangle(0,0,stage.fullScreenWidth,stage.fullScreenHeight);
mStarling = new Starling(StarlingRoot, stage, viewPort,null,"auto","auto");
mStarling.stage.stageWidth = stage.fullScreenWidth;
mStarling.stage.stageHeight = stage.fullScreenHeight;
mStarling.simulateMultitouch = false;
mStarling.showStatsAt("right","bottom");
mStarling.enableErrorChecking = false;
mStarling.antiAliasing = 16;
mStarling.skipUnchangedFrames = false;
mStarling.addEventListener(starling.events.Event.ROOT_CREATED,
function onRootCreated(event:Object, app:StarlingRoot):void {
mStarling.removeEventListener(starling.events.Event.ROOT_CREATED, onRootCreated);
app.start();
mStarling.start();
stage.addEventListener(ResizeEvent.RESIZE, onResize);
});
}
private function onResize(event:flash.events.Event):void {
trace(event);
}
}
} |
package com.ankamagames.dofus.network.types.game.friend
{
import com.ankamagames.dofus.network.ProtocolTypeManager;
import com.ankamagames.dofus.network.enums.PlayableBreedEnum;
import com.ankamagames.dofus.network.types.common.AccountTagInformation;
import com.ankamagames.dofus.network.types.game.character.status.PlayerStatus;
import com.ankamagames.dofus.network.types.game.context.roleplay.GuildInformations;
import com.ankamagames.jerakine.network.ICustomDataInput;
import com.ankamagames.jerakine.network.ICustomDataOutput;
import com.ankamagames.jerakine.network.INetworkType;
import com.ankamagames.jerakine.network.utils.BooleanByteWrapper;
import com.ankamagames.jerakine.network.utils.FuncTree;
public class FriendOnlineInformations extends FriendInformations implements INetworkType
{
public static const protocolId:uint = 552;
public var playerId:Number = 0;
public var playerName:String = "";
public var level:uint = 0;
public var alignmentSide:int = 0;
public var breed:int = 0;
public var sex:Boolean = false;
public var guildInfo:GuildInformations;
public var moodSmileyId:uint = 0;
public var status:PlayerStatus;
public var havenBagShared:Boolean = false;
private var _guildInfotree:FuncTree;
private var _statustree:FuncTree;
public function FriendOnlineInformations()
{
this.guildInfo = new GuildInformations();
this.status = new PlayerStatus();
super();
}
override public function getTypeId() : uint
{
return 552;
}
public function initFriendOnlineInformations(accountId:uint = 0, accountTag:AccountTagInformation = null, playerState:uint = 99, lastConnection:uint = 0, achievementPoints:int = 0, leagueId:int = 0, ladderPosition:int = 0, playerId:Number = 0, playerName:String = "", level:uint = 0, alignmentSide:int = 0, breed:int = 0, sex:Boolean = false, guildInfo:GuildInformations = null, moodSmileyId:uint = 0, status:PlayerStatus = null, havenBagShared:Boolean = false) : FriendOnlineInformations
{
super.initFriendInformations(accountId,accountTag,playerState,lastConnection,achievementPoints,leagueId,ladderPosition);
this.playerId = playerId;
this.playerName = playerName;
this.level = level;
this.alignmentSide = alignmentSide;
this.breed = breed;
this.sex = sex;
this.guildInfo = guildInfo;
this.moodSmileyId = moodSmileyId;
this.status = status;
this.havenBagShared = havenBagShared;
return this;
}
override public function reset() : void
{
super.reset();
this.playerId = 0;
this.playerName = "";
this.level = 0;
this.alignmentSide = 0;
this.breed = 0;
this.sex = false;
this.guildInfo = new GuildInformations();
this.status = new PlayerStatus();
}
override public function serialize(output:ICustomDataOutput) : void
{
this.serializeAs_FriendOnlineInformations(output);
}
public function serializeAs_FriendOnlineInformations(output:ICustomDataOutput) : void
{
super.serializeAs_FriendInformations(output);
var _box0:uint = 0;
_box0 = BooleanByteWrapper.setFlag(_box0,0,this.sex);
_box0 = BooleanByteWrapper.setFlag(_box0,1,this.havenBagShared);
output.writeByte(_box0);
if(this.playerId < 0 || this.playerId > 9007199254740992)
{
throw new Error("Forbidden value (" + this.playerId + ") on element playerId.");
}
output.writeVarLong(this.playerId);
output.writeUTF(this.playerName);
if(this.level < 0)
{
throw new Error("Forbidden value (" + this.level + ") on element level.");
}
output.writeVarShort(this.level);
output.writeByte(this.alignmentSide);
output.writeByte(this.breed);
this.guildInfo.serializeAs_GuildInformations(output);
if(this.moodSmileyId < 0)
{
throw new Error("Forbidden value (" + this.moodSmileyId + ") on element moodSmileyId.");
}
output.writeVarShort(this.moodSmileyId);
output.writeShort(this.status.getTypeId());
this.status.serialize(output);
}
override public function deserialize(input:ICustomDataInput) : void
{
this.deserializeAs_FriendOnlineInformations(input);
}
public function deserializeAs_FriendOnlineInformations(input:ICustomDataInput) : void
{
super.deserialize(input);
this.deserializeByteBoxes(input);
this._playerIdFunc(input);
this._playerNameFunc(input);
this._levelFunc(input);
this._alignmentSideFunc(input);
this._breedFunc(input);
this.guildInfo = new GuildInformations();
this.guildInfo.deserialize(input);
this._moodSmileyIdFunc(input);
var _id9:uint = input.readUnsignedShort();
this.status = ProtocolTypeManager.getInstance(PlayerStatus,_id9);
this.status.deserialize(input);
}
override public function deserializeAsync(tree:FuncTree) : void
{
this.deserializeAsyncAs_FriendOnlineInformations(tree);
}
public function deserializeAsyncAs_FriendOnlineInformations(tree:FuncTree) : void
{
super.deserializeAsync(tree);
tree.addChild(this.deserializeByteBoxes);
tree.addChild(this._playerIdFunc);
tree.addChild(this._playerNameFunc);
tree.addChild(this._levelFunc);
tree.addChild(this._alignmentSideFunc);
tree.addChild(this._breedFunc);
this._guildInfotree = tree.addChild(this._guildInfotreeFunc);
tree.addChild(this._moodSmileyIdFunc);
this._statustree = tree.addChild(this._statustreeFunc);
}
private function deserializeByteBoxes(input:ICustomDataInput) : void
{
var _box0:uint = input.readByte();
this.sex = BooleanByteWrapper.getFlag(_box0,0);
this.havenBagShared = BooleanByteWrapper.getFlag(_box0,1);
}
private function _playerIdFunc(input:ICustomDataInput) : void
{
this.playerId = input.readVarUhLong();
if(this.playerId < 0 || this.playerId > 9007199254740992)
{
throw new Error("Forbidden value (" + this.playerId + ") on element of FriendOnlineInformations.playerId.");
}
}
private function _playerNameFunc(input:ICustomDataInput) : void
{
this.playerName = input.readUTF();
}
private function _levelFunc(input:ICustomDataInput) : void
{
this.level = input.readVarUhShort();
if(this.level < 0)
{
throw new Error("Forbidden value (" + this.level + ") on element of FriendOnlineInformations.level.");
}
}
private function _alignmentSideFunc(input:ICustomDataInput) : void
{
this.alignmentSide = input.readByte();
}
private function _breedFunc(input:ICustomDataInput) : void
{
this.breed = input.readByte();
if(this.breed < PlayableBreedEnum.Feca || this.breed > PlayableBreedEnum.Ouginak)
{
throw new Error("Forbidden value (" + this.breed + ") on element of FriendOnlineInformations.breed.");
}
}
private function _guildInfotreeFunc(input:ICustomDataInput) : void
{
this.guildInfo = new GuildInformations();
this.guildInfo.deserializeAsync(this._guildInfotree);
}
private function _moodSmileyIdFunc(input:ICustomDataInput) : void
{
this.moodSmileyId = input.readVarUhShort();
if(this.moodSmileyId < 0)
{
throw new Error("Forbidden value (" + this.moodSmileyId + ") on element of FriendOnlineInformations.moodSmileyId.");
}
}
private function _statustreeFunc(input:ICustomDataInput) : void
{
var _id:uint = input.readUnsignedShort();
this.status = ProtocolTypeManager.getInstance(PlayerStatus,_id);
this.status.deserializeAsync(this._statustree);
}
}
}
|
/*
* Copyright (c) 2006-2007 Erin Catto http://www.gphysics.com
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
*/
package Box2D.Dynamics{
/**
* @private
*/
public class b2TimeStep
{
public function b2TimeStep() {}
public function Set(step:b2TimeStep):void
{
dt = step.dt;
inv_dt = step.inv_dt;
positionIterations = step.positionIterations;
velocityIterations = step.velocityIterations;
warmStarting = step.warmStarting;
}
public var dt:Number; // time step
public var inv_dt:Number; // inverse time step (0 if dt == 0).
public var dtRatio:Number; // dt * inv_dt0
public var velocityIterations:int;
public var positionIterations:int;
public var warmStarting:Boolean;
};
} |
package com.xgame.godwar.common.commands
{
import flash.errors.IllegalOperationError;
public class CommandList extends CommandCollector
{
private static var _instance: CommandList;
private static var _allowInstance: Boolean = false;
public function CommandList()
{
super();
if(!_allowInstance)
{
throw new IllegalOperationError("不能直接实例化");
}
}
public static function get instance(): CommandList
{
if(_instance == null)
{
_allowInstance = true;
_instance = new CommandList();
_allowInstance = false;
}
return _instance;
}
public function bind(protocolId: uint, protocolRef: Class): void
{
if(_commandList[protocolId] != null)
{
return;
}
_commandList[protocolId] = protocolRef;
}
public function unbind(protocolId: uint): void
{
if(_commandList[protocolId] != null)
{
_commandList[protocolId] = null;
delete _commandList[protocolId];
}
}
override public function dispose():void
{
super.dispose();
_instance = null;
}
}
} |
package com.ankamagames.dofus.network.messages.game.actions
{
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 GameActionNoopMessage extends NetworkMessage implements INetworkMessage
{
public static const protocolId:uint = 8877;
public function GameActionNoopMessage()
{
super();
}
override public function get isInitialized() : Boolean
{
return true;
}
override public function getMessageId() : uint
{
return 8877;
}
public function initGameActionNoopMessage() : GameActionNoopMessage
{
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_GameActionNoopMessage(output:ICustomDataOutput) : void
{
}
public function deserialize(input:ICustomDataInput) : void
{
}
public function deserializeAs_GameActionNoopMessage(input:ICustomDataInput) : void
{
}
public function deserializeAsync(tree:FuncTree) : void
{
}
public function deserializeAsyncAs_GameActionNoopMessage(tree:FuncTree) : void
{
}
}
}
|
package neatunit {
//异常测试
public final class TestException extends TestCase {
//方法运行时抛出ArgumentError,该异常将被捕捉输出为测试异常,不影响后续测试,期间的断言失败输出将被忽略
public function testMethodWithException(info:String):void { //异常位置1
throw new Error("position 2") //异常位置2
assertFalse(true);
throw new Error("position 3") //异常位置3
}
//异步测试
}
} |
package game.view.luckyStar {
import com.dialog.Dialog;
import com.utils.Constants;
import flash.geom.Rectangle;
import feathers.display.Scale9Image;
import feathers.textures.Scale9Textures;
import game.manager.AssetMgr;
import starling.display.Button;
import starling.display.Image;
import starling.text.TextField;
import starling.textures.Texture;
public class LuckyStarDlgBase extends Dialog {
public var box10Image:Image;
public var box11Image:Image;
public var box12Image:Image;
public var box13Image:Image;
public var diamondTxt:TextField;
public var no1_1Txt:TextField;
public var box2Image:Image;
public var box3Image:Image;
public var box4Image:Image;
public var box5Image:Image;
public var box6Image:Image;
public var box7Image:Image;
public var box8Image:Image;
public var box9Image:Image;
public var startButton:Button;
public var startCTxt:TextField;
public var startETxt:TextField;
public var no2_1Txt:TextField;
public var no2_2Txt:TextField;
public var no1_2Txt:TextField;
public var no3_2Txt:TextField;
public var box14Image:Image;
public var no1_3Txt:TextField;
public var no2_3Txt:TextField;
public var closeButton:Button;
public var box1Image:Image;
public var no3_1Txt:TextField;
public var awardTxt:TextField;
public var nameTxt:TextField;
public var diamondImage:Image;
public var buyButton:Button;
public function LuckyStarDlgBase() {
var ui_gongyong_jinbibaizidi427Texture:Texture = AssetMgr.instance.getTexture('ui_gongyong_jinbibaizidi');
var ui_gongyong_jinbibaizidi427Image:Image = new Image(ui_gongyong_jinbibaizidi427Texture);
ui_gongyong_jinbibaizidi427Image.x = 4;
ui_gongyong_jinbibaizidi427Image.y = 27;
ui_gongyong_jinbibaizidi427Image.width = 166;
ui_gongyong_jinbibaizidi427Image.height = 51;
ui_gongyong_jinbibaizidi427Image.smoothing = Constants.smoothing;
ui_gongyong_jinbibaizidi427Image.touchable = false;
this.addQuiackChild(ui_gongyong_jinbibaizidi427Image);
var ui_gongyong_lashenkuang4391Texture:Texture = AssetMgr.instance.getTexture('ui_gongyong_lashenkuang4');
var ui_gongyong_lashenkuang4391Rect:Rectangle = new Rectangle(16, 16, 33, 33);
var ui_gongyong_lashenkuang43919ScaleTexture:Scale9Textures = new Scale9Textures(ui_gongyong_lashenkuang4391Texture,
ui_gongyong_lashenkuang4391Rect);
var ui_gongyong_lashenkuang43919Scale:Scale9Image = new Scale9Image(ui_gongyong_lashenkuang43919ScaleTexture);
ui_gongyong_lashenkuang43919Scale.x = 3;
ui_gongyong_lashenkuang43919Scale.y = 91;
ui_gongyong_lashenkuang43919Scale.width = 597;
ui_gongyong_lashenkuang43919Scale.height = 350;
this.addQuiackChild(ui_gongyong_lashenkuang43919Scale);
var ui_gongyong_lashenkuang4622476Texture:Texture = AssetMgr.instance.getTexture('ui_gongyong_lashenkuang4');
var ui_gongyong_lashenkuang4622476Rect:Rectangle = new Rectangle(16, 16, 33, 33);
var ui_gongyong_lashenkuang46224769ScaleTexture:Scale9Textures = new Scale9Textures(ui_gongyong_lashenkuang4622476Texture,
ui_gongyong_lashenkuang4622476Rect);
var ui_gongyong_lashenkuang46224769Scale:Scale9Image = new Scale9Image(ui_gongyong_lashenkuang46224769ScaleTexture);
ui_gongyong_lashenkuang46224769Scale.x = 622;
ui_gongyong_lashenkuang46224769Scale.y = 476;
ui_gongyong_lashenkuang46224769Scale.width = 297;
ui_gongyong_lashenkuang46224769Scale.height = 145;
this.addQuiackChild(ui_gongyong_lashenkuang46224769Scale);
var ui_gongyong_lashenkuang1620474Texture:Texture = AssetMgr.instance.getTexture('ui_gongyong_lashenkuang1');
var ui_gongyong_lashenkuang1620474Image:Image = new Image(ui_gongyong_lashenkuang1620474Texture);
ui_gongyong_lashenkuang1620474Image.x = 620;
ui_gongyong_lashenkuang1620474Image.y = 474;
ui_gongyong_lashenkuang1620474Image.width = 14;
ui_gongyong_lashenkuang1620474Image.height = 16;
ui_gongyong_lashenkuang1620474Image.smoothing = Constants.smoothing;
ui_gongyong_lashenkuang1620474Image.touchable = false;
this.addQuiackChild(ui_gongyong_lashenkuang1620474Image);
var ui_gongyong_lashenkuang1920474Texture:Texture = AssetMgr.instance.getTexture('ui_gongyong_lashenkuang1');
var ui_gongyong_lashenkuang1920474Image:Image = new Image(ui_gongyong_lashenkuang1920474Texture);
ui_gongyong_lashenkuang1920474Image.x = 920;
ui_gongyong_lashenkuang1920474Image.y = 474;
ui_gongyong_lashenkuang1920474Image.width = 14;
ui_gongyong_lashenkuang1920474Image.height = 16;
ui_gongyong_lashenkuang1920474Image.scaleX = -1;
ui_gongyong_lashenkuang1920474Image.smoothing = Constants.smoothing;
ui_gongyong_lashenkuang1920474Image.touchable = false;
this.addQuiackChild(ui_gongyong_lashenkuang1920474Image);
var ui_gongyong_lashenkuang2627474Texture:Texture = AssetMgr.instance.getTexture('ui_gongyong_lashenkuang2');
var ui_gongyong_lashenkuang2627474Rect:Rectangle = new Rectangle(9, 1, 19, 1);
var ui_gongyong_lashenkuang26274749ScaleTexture:Scale9Textures = new Scale9Textures(ui_gongyong_lashenkuang2627474Texture,
ui_gongyong_lashenkuang2627474Rect);
var ui_gongyong_lashenkuang26274749Scale:Scale9Image = new Scale9Image(ui_gongyong_lashenkuang26274749ScaleTexture);
ui_gongyong_lashenkuang26274749Scale.x = 627;
ui_gongyong_lashenkuang26274749Scale.y = 474;
ui_gongyong_lashenkuang26274749Scale.width = 287;
ui_gongyong_lashenkuang26274749Scale.height = 2;
this.addQuiackChild(ui_gongyong_lashenkuang26274749Scale);
var ui_gongyong_lashenkuang3620481Texture:Texture = AssetMgr.instance.getTexture('ui_gongyong_lashenkuang3');
var ui_gongyong_lashenkuang3620481Rect:Rectangle = new Rectangle(1, 6, 1, 12);
var ui_gongyong_lashenkuang36204819ScaleTexture:Scale9Textures = new Scale9Textures(ui_gongyong_lashenkuang3620481Texture,
ui_gongyong_lashenkuang3620481Rect);
var ui_gongyong_lashenkuang36204819Scale:Scale9Image = new Scale9Image(ui_gongyong_lashenkuang36204819ScaleTexture);
ui_gongyong_lashenkuang36204819Scale.x = 620;
ui_gongyong_lashenkuang36204819Scale.y = 481;
ui_gongyong_lashenkuang36204819Scale.width = 2;
ui_gongyong_lashenkuang36204819Scale.height = 136;
this.addQuiackChild(ui_gongyong_lashenkuang36204819Scale);
var ui_gongyong_lashenkuang3920481Texture:Texture = AssetMgr.instance.getTexture('ui_gongyong_lashenkuang3');
var ui_gongyong_lashenkuang3920481Rect:Rectangle = new Rectangle(1, 6, 1, 12);
var ui_gongyong_lashenkuang39204819ScaleTexture:Scale9Textures = new Scale9Textures(ui_gongyong_lashenkuang3920481Texture,
ui_gongyong_lashenkuang3920481Rect);
var ui_gongyong_lashenkuang39204819Scale:Scale9Image = new Scale9Image(ui_gongyong_lashenkuang39204819ScaleTexture);
ui_gongyong_lashenkuang39204819Scale.x = 920;
ui_gongyong_lashenkuang39204819Scale.y = 481;
ui_gongyong_lashenkuang39204819Scale.width = 2;
ui_gongyong_lashenkuang39204819Scale.height = 136;
this.addQuiackChild(ui_gongyong_lashenkuang39204819Scale);
var ui_gongyong_lashenkuang4621121Texture:Texture = AssetMgr.instance.getTexture('ui_gongyong_lashenkuang4');
var ui_gongyong_lashenkuang4621121Rect:Rectangle = new Rectangle(16, 16, 33, 33);
var ui_gongyong_lashenkuang46211219ScaleTexture:Scale9Textures = new Scale9Textures(ui_gongyong_lashenkuang4621121Texture,
ui_gongyong_lashenkuang4621121Rect);
var ui_gongyong_lashenkuang46211219Scale:Scale9Image = new Scale9Image(ui_gongyong_lashenkuang46211219ScaleTexture);
ui_gongyong_lashenkuang46211219Scale.x = 621;
ui_gongyong_lashenkuang46211219Scale.y = 121;
ui_gongyong_lashenkuang46211219Scale.width = 297;
ui_gongyong_lashenkuang46211219Scale.height = 316;
this.addQuiackChild(ui_gongyong_lashenkuang46211219Scale);
var ui_gongyong_lashenkuang1619119Texture:Texture = AssetMgr.instance.getTexture('ui_gongyong_lashenkuang1');
var ui_gongyong_lashenkuang1619119Image:Image = new Image(ui_gongyong_lashenkuang1619119Texture);
ui_gongyong_lashenkuang1619119Image.x = 619;
ui_gongyong_lashenkuang1619119Image.y = 119;
ui_gongyong_lashenkuang1619119Image.width = 14;
ui_gongyong_lashenkuang1619119Image.height = 16;
ui_gongyong_lashenkuang1619119Image.smoothing = Constants.smoothing;
ui_gongyong_lashenkuang1619119Image.touchable = false;
this.addQuiackChild(ui_gongyong_lashenkuang1619119Image);
var ui_gongyong_lashenkuang1619439Texture:Texture = AssetMgr.instance.getTexture('ui_gongyong_lashenkuang1');
var ui_gongyong_lashenkuang1619439Image:Image = new Image(ui_gongyong_lashenkuang1619439Texture);
ui_gongyong_lashenkuang1619439Image.x = 619;
ui_gongyong_lashenkuang1619439Image.y = 439;
ui_gongyong_lashenkuang1619439Image.width = 14;
ui_gongyong_lashenkuang1619439Image.height = 16;
ui_gongyong_lashenkuang1619439Image.scaleY = -1;
ui_gongyong_lashenkuang1619439Image.smoothing = Constants.smoothing;
ui_gongyong_lashenkuang1619439Image.touchable = false;
this.addQuiackChild(ui_gongyong_lashenkuang1619439Image);
var ui_gongyong_lashenkuang1920438Texture:Texture = AssetMgr.instance.getTexture('ui_gongyong_lashenkuang1');
var ui_gongyong_lashenkuang1920438Image:Image = new Image(ui_gongyong_lashenkuang1920438Texture);
ui_gongyong_lashenkuang1920438Image.x = 920;
ui_gongyong_lashenkuang1920438Image.y = 438;
ui_gongyong_lashenkuang1920438Image.width = 14;
ui_gongyong_lashenkuang1920438Image.height = 16;
ui_gongyong_lashenkuang1920438Image.scaleX = -1;
ui_gongyong_lashenkuang1920438Image.scaleY = -1;
ui_gongyong_lashenkuang1920438Image.smoothing = Constants.smoothing;
ui_gongyong_lashenkuang1920438Image.touchable = false;
this.addQuiackChild(ui_gongyong_lashenkuang1920438Image);
var box10Texture:Texture = AssetMgr.instance.getTexture('ui_button_wupinkuang');
box10Image = new Image(box10Texture);
box10Image.x = 12;
box10Image.y = 326;
box10Image.width = 107;
box10Image.height = 110;
this.addQuiackChild(box10Image);
var box11Texture:Texture = AssetMgr.instance.getTexture('ui_button_wupinkuang');
box11Image = new Image(box11Texture);
box11Image.x = 130;
box11Image.y = 326;
box11Image.width = 107;
box11Image.height = 110;
this.addQuiackChild(box11Image);
var box12Texture:Texture = AssetMgr.instance.getTexture('ui_button_wupinkuang');
box12Image = new Image(box12Texture);
box12Image.x = 249;
box12Image.y = 326;
box12Image.width = 107;
box12Image.height = 110;
this.addQuiackChild(box12Image);
var box13Texture:Texture = AssetMgr.instance.getTexture('ui_button_wupinkuang');
box13Image = new Image(box13Texture);
box13Image.x = 367;
box13Image.y = 326;
box13Image.width = 107;
box13Image.height = 110;
this.addQuiackChild(box13Image);
var ui_gongyong_lashenkuang40455Texture:Texture = AssetMgr.instance.getTexture('ui_gongyong_lashenkuang4');
var ui_gongyong_lashenkuang40455Rect:Rectangle = new Rectangle(16, 16, 33, 33);
var ui_gongyong_lashenkuang404559ScaleTexture:Scale9Textures = new Scale9Textures(ui_gongyong_lashenkuang40455Texture,
ui_gongyong_lashenkuang40455Rect);
var ui_gongyong_lashenkuang404559Scale:Scale9Image = new Scale9Image(ui_gongyong_lashenkuang404559ScaleTexture);
ui_gongyong_lashenkuang404559Scale.x = 0;
ui_gongyong_lashenkuang404559Scale.y = 455;
ui_gongyong_lashenkuang404559Scale.width = 597;
ui_gongyong_lashenkuang404559Scale.height = 165;
this.addQuiackChild(ui_gongyong_lashenkuang404559Scale);
var ui_gongyong_lashenkuang1599455Texture:Texture = AssetMgr.instance.getTexture('ui_gongyong_lashenkuang1');
var ui_gongyong_lashenkuang1599455Image:Image = new Image(ui_gongyong_lashenkuang1599455Texture);
ui_gongyong_lashenkuang1599455Image.x = 599;
ui_gongyong_lashenkuang1599455Image.y = 455;
ui_gongyong_lashenkuang1599455Image.width = 14;
ui_gongyong_lashenkuang1599455Image.height = 16;
ui_gongyong_lashenkuang1599455Image.scaleX = -1;
ui_gongyong_lashenkuang1599455Image.smoothing = Constants.smoothing;
ui_gongyong_lashenkuang1599455Image.touchable = false;
this.addQuiackChild(ui_gongyong_lashenkuang1599455Image);
var ui_gongyong_lashenkuang10621Texture:Texture = AssetMgr.instance.getTexture('ui_gongyong_lashenkuang1');
var ui_gongyong_lashenkuang10621Image:Image = new Image(ui_gongyong_lashenkuang10621Texture);
ui_gongyong_lashenkuang10621Image.x = 0;
ui_gongyong_lashenkuang10621Image.y = 621;
ui_gongyong_lashenkuang10621Image.width = 14;
ui_gongyong_lashenkuang10621Image.height = 16;
ui_gongyong_lashenkuang10621Image.scaleY = -1;
ui_gongyong_lashenkuang10621Image.smoothing = Constants.smoothing;
ui_gongyong_lashenkuang10621Image.touchable = false;
this.addQuiackChild(ui_gongyong_lashenkuang10621Image);
var ui_gongyong_lashenkuang10455Texture:Texture = AssetMgr.instance.getTexture('ui_gongyong_lashenkuang1');
var ui_gongyong_lashenkuang10455Image:Image = new Image(ui_gongyong_lashenkuang10455Texture);
ui_gongyong_lashenkuang10455Image.x = 0;
ui_gongyong_lashenkuang10455Image.y = 455;
ui_gongyong_lashenkuang10455Image.width = 14;
ui_gongyong_lashenkuang10455Image.height = 16;
ui_gongyong_lashenkuang10455Image.smoothing = Constants.smoothing;
ui_gongyong_lashenkuang10455Image.touchable = false;
this.addQuiackChild(ui_gongyong_lashenkuang10455Image);
var ui_xingyunxing_beijingtu4458Texture:Texture = AssetMgr.instance.getTexture('ui_xingyunxing_beijingtu');
var ui_xingyunxing_beijingtu4458Image:Image = new Image(ui_xingyunxing_beijingtu4458Texture);
ui_xingyunxing_beijingtu4458Image.x = 4;
ui_xingyunxing_beijingtu4458Image.y = 458;
ui_xingyunxing_beijingtu4458Image.width = 278;
ui_xingyunxing_beijingtu4458Image.height = 160;
ui_xingyunxing_beijingtu4458Image.smoothing = Constants.smoothing;
ui_xingyunxing_beijingtu4458Image.touchable = false;
this.addQuiackChild(ui_xingyunxing_beijingtu4458Image);
diamondTxt = new TextField(131, 41, '', '', 24, 0xFFFFFF, false);
diamondTxt.touchable = false;
diamondTxt.hAlign = 'left';
diamondTxt.x = 51;
diamondTxt.y = 34;
this.addQuiackChild(diamondTxt);
no1_1Txt = new TextField(273, 59, '', '', 20, 0xFFFFFF, false);
no1_1Txt.touchable = false;
no1_1Txt.hAlign = 'left';
no1_1Txt.x = 310;
no1_1Txt.y = 458;
this.addQuiackChild(no1_1Txt);
var box2Texture:Texture = AssetMgr.instance.getTexture('ui_button_wupinkuang');
box2Image = new Image(box2Texture);
box2Image.x = 130;
box2Image.y = 96;
box2Image.width = 107;
box2Image.height = 110;
this.addQuiackChild(box2Image);
var box3Texture:Texture = AssetMgr.instance.getTexture('ui_button_wupinkuang');
box3Image = new Image(box3Texture);
box3Image.x = 249;
box3Image.y = 96;
box3Image.width = 107;
box3Image.height = 110;
this.addQuiackChild(box3Image);
var box4Texture:Texture = AssetMgr.instance.getTexture('ui_button_wupinkuang');
box4Image = new Image(box4Texture);
box4Image.x = 367;
box4Image.y = 96;
box4Image.width = 107;
box4Image.height = 110;
this.addQuiackChild(box4Image);
var box5Texture:Texture = AssetMgr.instance.getTexture('ui_button_wupinkuang');
box5Image = new Image(box5Texture);
box5Image.x = 485;
box5Image.y = 96;
box5Image.width = 107;
box5Image.height = 110;
this.addQuiackChild(box5Image);
var box6Texture:Texture = AssetMgr.instance.getTexture('ui_button_wupinkuang');
box6Image = new Image(box6Texture);
box6Image.x = 12;
box6Image.y = 210;
box6Image.width = 107;
box6Image.height = 110;
this.addQuiackChild(box6Image);
var box7Texture:Texture = AssetMgr.instance.getTexture('ui_button_wupinkuang');
box7Image = new Image(box7Texture);
box7Image.x = 130;
box7Image.y = 210;
box7Image.width = 107;
box7Image.height = 110;
this.addQuiackChild(box7Image);
var box8Texture:Texture = AssetMgr.instance.getTexture('ui_button_wupinkuang');
box8Image = new Image(box8Texture);
box8Image.x = 367;
box8Image.y = 210;
box8Image.width = 107;
box8Image.height = 110;
this.addQuiackChild(box8Image);
var box9Texture:Texture = AssetMgr.instance.getTexture('ui_button_wupinkuang');
box9Image = new Image(box9Texture);
box9Image.x = 485;
box9Image.y = 210;
box9Image.width = 107;
box9Image.height = 110;
this.addQuiackChild(box9Image);
var startTexture:Texture = AssetMgr.instance.getTexture('ui_butten_sifanganniu');
startButton = new Button(startTexture);
startButton.x = 243;
startButton.y = 209;
this.addQuiackChild(startButton);
startCTxt = new TextField(104, 57, '', '', 40, 0xFFFFFF, false);
startCTxt.touchable = false;
startCTxt.hAlign = 'center';
startCTxt.x = 251;
startCTxt.y = 225;
this.addQuiackChild(startCTxt);
startETxt = new TextField(104, 36, '', '', 24, 0xFFFFFF, false);
startETxt.touchable = false;
startETxt.hAlign = 'center';
startETxt.x = 251;
startETxt.y = 270;
this.addQuiackChild(startETxt);
var ui_gongyong_lashenkuang1920119Texture:Texture = AssetMgr.instance.getTexture('ui_gongyong_lashenkuang1');
var ui_gongyong_lashenkuang1920119Image:Image = new Image(ui_gongyong_lashenkuang1920119Texture);
ui_gongyong_lashenkuang1920119Image.x = 920;
ui_gongyong_lashenkuang1920119Image.y = 119;
ui_gongyong_lashenkuang1920119Image.width = 14;
ui_gongyong_lashenkuang1920119Image.height = 16;
ui_gongyong_lashenkuang1920119Image.scaleX = -1;
ui_gongyong_lashenkuang1920119Image.smoothing = Constants.smoothing;
ui_gongyong_lashenkuang1920119Image.touchable = false;
this.addQuiackChild(ui_gongyong_lashenkuang1920119Image);
no2_1Txt = new TextField(251, 30, '', '', 20, 0xFFFFFF, false);
no2_1Txt.touchable = false;
no2_1Txt.hAlign = 'left';
no2_1Txt.x = 310;
no2_1Txt.y = 524;
this.addQuiackChild(no2_1Txt);
no2_2Txt = new TextField(127, 49, '', '', 34, 0xFFFF00, false);
no2_2Txt.touchable = false;
no2_2Txt.hAlign = 'left';
no2_2Txt.x = 331;
no2_2Txt.y = 516;
this.addQuiackChild(no2_2Txt);
var ui_gongyong_lashenkuang1599621Texture:Texture = AssetMgr.instance.getTexture('ui_gongyong_lashenkuang1');
var ui_gongyong_lashenkuang1599621Image:Image = new Image(ui_gongyong_lashenkuang1599621Texture);
ui_gongyong_lashenkuang1599621Image.x = 599;
ui_gongyong_lashenkuang1599621Image.y = 621;
ui_gongyong_lashenkuang1599621Image.width = 14;
ui_gongyong_lashenkuang1599621Image.height = 16;
ui_gongyong_lashenkuang1599621Image.scaleX = -1;
ui_gongyong_lashenkuang1599621Image.scaleY = -1;
ui_gongyong_lashenkuang1599621Image.smoothing = Constants.smoothing;
ui_gongyong_lashenkuang1599621Image.touchable = false;
this.addQuiackChild(ui_gongyong_lashenkuang1599621Image);
var ui_xingyunxing_wenzidi1624480Texture:Texture = AssetMgr.instance.getTexture('ui_xingyunxing_wenzidi1');
var ui_xingyunxing_wenzidi1624480Image:Image = new Image(ui_xingyunxing_wenzidi1624480Texture);
ui_xingyunxing_wenzidi1624480Image.x = 624;
ui_xingyunxing_wenzidi1624480Image.y = 480;
ui_xingyunxing_wenzidi1624480Image.width = 293;
ui_xingyunxing_wenzidi1624480Image.height = 28;
ui_xingyunxing_wenzidi1624480Image.smoothing = Constants.smoothing;
ui_xingyunxing_wenzidi1624480Image.touchable = false;
this.addQuiackChild(ui_xingyunxing_wenzidi1624480Image);
var ui_gongyong_lashenkuang1620621Texture:Texture = AssetMgr.instance.getTexture('ui_gongyong_lashenkuang1');
var ui_gongyong_lashenkuang1620621Image:Image = new Image(ui_gongyong_lashenkuang1620621Texture);
ui_gongyong_lashenkuang1620621Image.x = 620;
ui_gongyong_lashenkuang1620621Image.y = 621;
ui_gongyong_lashenkuang1620621Image.width = 14;
ui_gongyong_lashenkuang1620621Image.height = 16;
ui_gongyong_lashenkuang1620621Image.scaleY = -1;
ui_gongyong_lashenkuang1620621Image.smoothing = Constants.smoothing;
ui_gongyong_lashenkuang1620621Image.touchable = false;
this.addQuiackChild(ui_gongyong_lashenkuang1620621Image);
var ui_gongyong_lashenkuang1920621Texture:Texture = AssetMgr.instance.getTexture('ui_gongyong_lashenkuang1');
var ui_gongyong_lashenkuang1920621Image:Image = new Image(ui_gongyong_lashenkuang1920621Texture);
ui_gongyong_lashenkuang1920621Image.x = 920;
ui_gongyong_lashenkuang1920621Image.y = 621;
ui_gongyong_lashenkuang1920621Image.width = 14;
ui_gongyong_lashenkuang1920621Image.height = 16;
ui_gongyong_lashenkuang1920621Image.scaleX = -1;
ui_gongyong_lashenkuang1920621Image.scaleY = -1;
ui_gongyong_lashenkuang1920621Image.smoothing = Constants.smoothing;
ui_gongyong_lashenkuang1920621Image.touchable = false;
this.addQuiackChild(ui_gongyong_lashenkuang1920621Image);
var ui_gongyong_zuanshi67549Texture:Texture = AssetMgr.instance.getTexture('ui_gongyong_zuanshi');
var ui_gongyong_zuanshi67549Image:Image = new Image(ui_gongyong_zuanshi67549Texture);
ui_gongyong_zuanshi67549Image.x = 67;
ui_gongyong_zuanshi67549Image.y = 549;
ui_gongyong_zuanshi67549Image.width = 48;
ui_gongyong_zuanshi67549Image.height = 46;
ui_gongyong_zuanshi67549Image.smoothing = Constants.smoothing;
ui_gongyong_zuanshi67549Image.touchable = false;
this.addQuiackChild(ui_gongyong_zuanshi67549Image);
no1_2Txt = new TextField(62, 49, '', '', 34, 0xFFFF00, false);
no1_2Txt.touchable = false;
no1_2Txt.hAlign = 'center';
no1_2Txt.x = 424;
no1_2Txt.y = 478;
this.addQuiackChild(no1_2Txt);
no3_2Txt = new TextField(303, 35, '', '', 20, 0xFFFFFF, false);
no3_2Txt.touchable = false;
no3_2Txt.hAlign = 'left';
no3_2Txt.x = 312;
no3_2Txt.y = 586;
this.addQuiackChild(no3_2Txt);
var ui_gongyong_xinxidikuang_tiekou_luosi291462Texture:Texture = AssetMgr.instance.getTexture('ui_gongyong_xinxidikuang_tiekou_luosi');
var ui_gongyong_xinxidikuang_tiekou_luosi291462Image:Image = new Image(ui_gongyong_xinxidikuang_tiekou_luosi291462Texture);
ui_gongyong_xinxidikuang_tiekou_luosi291462Image.x = 291;
ui_gongyong_xinxidikuang_tiekou_luosi291462Image.y = 462;
ui_gongyong_xinxidikuang_tiekou_luosi291462Image.width = 18;
ui_gongyong_xinxidikuang_tiekou_luosi291462Image.height = 15;
ui_gongyong_xinxidikuang_tiekou_luosi291462Image.smoothing = Constants.smoothing;
ui_gongyong_xinxidikuang_tiekou_luosi291462Image.touchable = false;
this.addQuiackChild(ui_gongyong_xinxidikuang_tiekou_luosi291462Image);
var ui_gongyong_xinxidikuang_tiekou_luosi291533Texture:Texture = AssetMgr.instance.getTexture('ui_gongyong_xinxidikuang_tiekou_luosi');
var ui_gongyong_xinxidikuang_tiekou_luosi291533Image:Image = new Image(ui_gongyong_xinxidikuang_tiekou_luosi291533Texture);
ui_gongyong_xinxidikuang_tiekou_luosi291533Image.x = 291;
ui_gongyong_xinxidikuang_tiekou_luosi291533Image.y = 533;
ui_gongyong_xinxidikuang_tiekou_luosi291533Image.width = 18;
ui_gongyong_xinxidikuang_tiekou_luosi291533Image.height = 15;
ui_gongyong_xinxidikuang_tiekou_luosi291533Image.smoothing = Constants.smoothing;
ui_gongyong_xinxidikuang_tiekou_luosi291533Image.touchable = false;
this.addQuiackChild(ui_gongyong_xinxidikuang_tiekou_luosi291533Image);
var ui_gongyong_xinxidikuang_tiekou_luosi291572Texture:Texture = AssetMgr.instance.getTexture('ui_gongyong_xinxidikuang_tiekou_luosi');
var ui_gongyong_xinxidikuang_tiekou_luosi291572Image:Image = new Image(ui_gongyong_xinxidikuang_tiekou_luosi291572Texture);
ui_gongyong_xinxidikuang_tiekou_luosi291572Image.x = 291;
ui_gongyong_xinxidikuang_tiekou_luosi291572Image.y = 572;
ui_gongyong_xinxidikuang_tiekou_luosi291572Image.width = 18;
ui_gongyong_xinxidikuang_tiekou_luosi291572Image.height = 15;
ui_gongyong_xinxidikuang_tiekou_luosi291572Image.smoothing = Constants.smoothing;
ui_gongyong_xinxidikuang_tiekou_luosi291572Image.touchable = false;
this.addQuiackChild(ui_gongyong_xinxidikuang_tiekou_luosi291572Image);
var ui_chaojixingyunxing2565Texture:Texture = AssetMgr.instance.getTexture('ui_chaojixingyunxing');
var ui_chaojixingyunxing2565Image:Image = new Image(ui_chaojixingyunxing2565Texture);
ui_chaojixingyunxing2565Image.x = 256;
ui_chaojixingyunxing2565Image.y = -5;
ui_chaojixingyunxing2565Image.width = 419;
ui_chaojixingyunxing2565Image.height = 97;
ui_chaojixingyunxing2565Image.smoothing = Constants.smoothing;
ui_chaojixingyunxing2565Image.touchable = false;
this.addQuiackChild(ui_chaojixingyunxing2565Image);
var ui_xingyunxing_huojiangmingdan619441Texture:Texture = AssetMgr.instance.getTexture('ui_xingyunxing_huojiangmingdan');
var ui_xingyunxing_huojiangmingdan619441Image:Image = new Image(ui_xingyunxing_huojiangmingdan619441Texture);
ui_xingyunxing_huojiangmingdan619441Image.x = 619;
ui_xingyunxing_huojiangmingdan619441Image.y = 441;
ui_xingyunxing_huojiangmingdan619441Image.width = 160;
ui_xingyunxing_huojiangmingdan619441Image.height = 31;
ui_xingyunxing_huojiangmingdan619441Image.smoothing = Constants.smoothing;
ui_xingyunxing_huojiangmingdan619441Image.touchable = false;
this.addQuiackChild(ui_xingyunxing_huojiangmingdan619441Image);
var ui_xingyunxing_caifubang61785Texture:Texture = AssetMgr.instance.getTexture('ui_xingyunxing_caifubang');
var ui_xingyunxing_caifubang61785Image:Image = new Image(ui_xingyunxing_caifubang61785Texture);
ui_xingyunxing_caifubang61785Image.x = 617;
ui_xingyunxing_caifubang61785Image.y = 85;
ui_xingyunxing_caifubang61785Image.width = 82;
ui_xingyunxing_caifubang61785Image.height = 33;
ui_xingyunxing_caifubang61785Image.smoothing = Constants.smoothing;
ui_xingyunxing_caifubang61785Image.touchable = false;
this.addQuiackChild(ui_xingyunxing_caifubang61785Image);
var ui_xuanzhong10559Texture:Texture = AssetMgr.instance.getTexture('ui_xuanzhong');
var ui_xuanzhong10559Image:Image = new Image(ui_xuanzhong10559Texture);
ui_xuanzhong10559Image.x = 10;
ui_xuanzhong10559Image.y = 559;
ui_xuanzhong10559Image.width = 58;
ui_xuanzhong10559Image.height = 32;
ui_xuanzhong10559Image.smoothing = Constants.smoothing;
ui_xuanzhong10559Image.touchable = false;
this.addQuiackChild(ui_xuanzhong10559Image);
var ui_jikehuodefanli117561Texture:Texture = AssetMgr.instance.getTexture('ui_jikehuodefanli');
var ui_jikehuodefanli117561Image:Image = new Image(ui_jikehuodefanli117561Texture);
ui_jikehuodefanli117561Image.x = 117;
ui_jikehuodefanli117561Image.y = 561;
ui_jikehuodefanli117561Image.width = 158;
ui_jikehuodefanli117561Image.height = 34;
ui_jikehuodefanli117561Image.smoothing = Constants.smoothing;
ui_jikehuodefanli117561Image.touchable = false;
this.addQuiackChild(ui_jikehuodefanli117561Image);
var ui_gongyong_lashenkuang1289Texture:Texture = AssetMgr.instance.getTexture('ui_gongyong_lashenkuang1');
var ui_gongyong_lashenkuang1289Image:Image = new Image(ui_gongyong_lashenkuang1289Texture);
ui_gongyong_lashenkuang1289Image.x = 2;
ui_gongyong_lashenkuang1289Image.y = 89;
ui_gongyong_lashenkuang1289Image.width = 14;
ui_gongyong_lashenkuang1289Image.height = 16;
ui_gongyong_lashenkuang1289Image.smoothing = Constants.smoothing;
ui_gongyong_lashenkuang1289Image.touchable = false;
this.addQuiackChild(ui_gongyong_lashenkuang1289Image);
var ui_gongyong_lashenkuang21689Texture:Texture = AssetMgr.instance.getTexture('ui_gongyong_lashenkuang2');
var ui_gongyong_lashenkuang21689Rect:Rectangle = new Rectangle(9, 1, 19, 1);
var ui_gongyong_lashenkuang216899ScaleTexture:Scale9Textures = new Scale9Textures(ui_gongyong_lashenkuang21689Texture,
ui_gongyong_lashenkuang21689Rect);
var ui_gongyong_lashenkuang216899Scale:Scale9Image = new Scale9Image(ui_gongyong_lashenkuang216899ScaleTexture);
ui_gongyong_lashenkuang216899Scale.x = 16;
ui_gongyong_lashenkuang216899Scale.y = 89;
ui_gongyong_lashenkuang216899Scale.width = 578;
ui_gongyong_lashenkuang216899Scale.height = 2;
this.addQuiackChild(ui_gongyong_lashenkuang216899Scale);
var ui_gongyong_lashenkuang212441Texture:Texture = AssetMgr.instance.getTexture('ui_gongyong_lashenkuang2');
var ui_gongyong_lashenkuang212441Rect:Rectangle = new Rectangle(9, 1, 19, 1);
var ui_gongyong_lashenkuang2124419ScaleTexture:Scale9Textures = new Scale9Textures(ui_gongyong_lashenkuang212441Texture,
ui_gongyong_lashenkuang212441Rect);
var ui_gongyong_lashenkuang2124419Scale:Scale9Image = new Scale9Image(ui_gongyong_lashenkuang2124419ScaleTexture);
ui_gongyong_lashenkuang2124419Scale.x = 12;
ui_gongyong_lashenkuang2124419Scale.y = 441;
ui_gongyong_lashenkuang2124419Scale.width = 578;
ui_gongyong_lashenkuang2124419Scale.height = 2;
this.addQuiackChild(ui_gongyong_lashenkuang2124419Scale);
var ui_gongyong_lashenkuang12441Texture:Texture = AssetMgr.instance.getTexture('ui_gongyong_lashenkuang1');
var ui_gongyong_lashenkuang12441Image:Image = new Image(ui_gongyong_lashenkuang12441Texture);
ui_gongyong_lashenkuang12441Image.x = 2;
ui_gongyong_lashenkuang12441Image.y = 441;
ui_gongyong_lashenkuang12441Image.width = 14;
ui_gongyong_lashenkuang12441Image.height = 16;
ui_gongyong_lashenkuang12441Image.scaleY = -1;
ui_gongyong_lashenkuang12441Image.smoothing = Constants.smoothing;
ui_gongyong_lashenkuang12441Image.touchable = false;
this.addQuiackChild(ui_gongyong_lashenkuang12441Image);
var ui_gongyong_lashenkuang32103Texture:Texture = AssetMgr.instance.getTexture('ui_gongyong_lashenkuang3');
var ui_gongyong_lashenkuang32103Rect:Rectangle = new Rectangle(1, 6, 1, 12);
var ui_gongyong_lashenkuang321039ScaleTexture:Scale9Textures = new Scale9Textures(ui_gongyong_lashenkuang32103Texture,
ui_gongyong_lashenkuang32103Rect);
var ui_gongyong_lashenkuang321039Scale:Scale9Image = new Scale9Image(ui_gongyong_lashenkuang321039ScaleTexture);
ui_gongyong_lashenkuang321039Scale.x = 2;
ui_gongyong_lashenkuang321039Scale.y = 103;
ui_gongyong_lashenkuang321039Scale.width = 2;
ui_gongyong_lashenkuang321039Scale.height = 324;
this.addQuiackChild(ui_gongyong_lashenkuang321039Scale);
var ui_gongyong_lashenkuang3601103Texture:Texture = AssetMgr.instance.getTexture('ui_gongyong_lashenkuang3');
var ui_gongyong_lashenkuang3601103Rect:Rectangle = new Rectangle(1, 6, 1, 12);
var ui_gongyong_lashenkuang36011039ScaleTexture:Scale9Textures = new Scale9Textures(ui_gongyong_lashenkuang3601103Texture,
ui_gongyong_lashenkuang3601103Rect);
var ui_gongyong_lashenkuang36011039Scale:Scale9Image = new Scale9Image(ui_gongyong_lashenkuang36011039ScaleTexture);
ui_gongyong_lashenkuang36011039Scale.x = 601;
ui_gongyong_lashenkuang36011039Scale.y = 103;
ui_gongyong_lashenkuang36011039Scale.width = 2;
ui_gongyong_lashenkuang36011039Scale.height = 324;
this.addQuiackChild(ui_gongyong_lashenkuang36011039Scale);
var ui_gongyong_lashenkuang160189Texture:Texture = AssetMgr.instance.getTexture('ui_gongyong_lashenkuang1');
var ui_gongyong_lashenkuang160189Image:Image = new Image(ui_gongyong_lashenkuang160189Texture);
ui_gongyong_lashenkuang160189Image.x = 601;
ui_gongyong_lashenkuang160189Image.y = 89;
ui_gongyong_lashenkuang160189Image.width = 14;
ui_gongyong_lashenkuang160189Image.height = 16;
ui_gongyong_lashenkuang160189Image.scaleX = -1;
ui_gongyong_lashenkuang160189Image.smoothing = Constants.smoothing;
ui_gongyong_lashenkuang160189Image.touchable = false;
this.addQuiackChild(ui_gongyong_lashenkuang160189Image);
var ui_gongyong_lashenkuang1601441Texture:Texture = AssetMgr.instance.getTexture('ui_gongyong_lashenkuang1');
var ui_gongyong_lashenkuang1601441Image:Image = new Image(ui_gongyong_lashenkuang1601441Texture);
ui_gongyong_lashenkuang1601441Image.x = 601;
ui_gongyong_lashenkuang1601441Image.y = 441;
ui_gongyong_lashenkuang1601441Image.width = 14;
ui_gongyong_lashenkuang1601441Image.height = 16;
ui_gongyong_lashenkuang1601441Image.scaleX = -1;
ui_gongyong_lashenkuang1601441Image.scaleY = -1;
ui_gongyong_lashenkuang1601441Image.smoothing = Constants.smoothing;
ui_gongyong_lashenkuang1601441Image.touchable = false;
this.addQuiackChild(ui_gongyong_lashenkuang1601441Image);
var ui_gongyong_lashenkuang214455Texture:Texture = AssetMgr.instance.getTexture('ui_gongyong_lashenkuang2');
var ui_gongyong_lashenkuang214455Rect:Rectangle = new Rectangle(9, 1, 19, 1);
var ui_gongyong_lashenkuang2144559ScaleTexture:Scale9Textures = new Scale9Textures(ui_gongyong_lashenkuang214455Texture,
ui_gongyong_lashenkuang214455Rect);
var ui_gongyong_lashenkuang2144559Scale:Scale9Image = new Scale9Image(ui_gongyong_lashenkuang2144559ScaleTexture);
ui_gongyong_lashenkuang2144559Scale.x = 14;
ui_gongyong_lashenkuang2144559Scale.y = 455;
ui_gongyong_lashenkuang2144559Scale.width = 578;
ui_gongyong_lashenkuang2144559Scale.height = 2;
this.addQuiackChild(ui_gongyong_lashenkuang2144559Scale);
var ui_gongyong_lashenkuang30459Texture:Texture = AssetMgr.instance.getTexture('ui_gongyong_lashenkuang3');
var ui_gongyong_lashenkuang30459Rect:Rectangle = new Rectangle(1, 6, 1, 12);
var ui_gongyong_lashenkuang304599ScaleTexture:Scale9Textures = new Scale9Textures(ui_gongyong_lashenkuang30459Texture,
ui_gongyong_lashenkuang30459Rect);
var ui_gongyong_lashenkuang304599Scale:Scale9Image = new Scale9Image(ui_gongyong_lashenkuang304599ScaleTexture);
ui_gongyong_lashenkuang304599Scale.x = 0;
ui_gongyong_lashenkuang304599Scale.y = 459;
ui_gongyong_lashenkuang304599Scale.width = 2;
ui_gongyong_lashenkuang304599Scale.height = 155;
this.addQuiackChild(ui_gongyong_lashenkuang304599Scale);
var ui_gongyong_lashenkuang3599459Texture:Texture = AssetMgr.instance.getTexture('ui_gongyong_lashenkuang3');
var ui_gongyong_lashenkuang3599459Rect:Rectangle = new Rectangle(1, 6, 1, 12);
var ui_gongyong_lashenkuang35994599ScaleTexture:Scale9Textures = new Scale9Textures(ui_gongyong_lashenkuang3599459Texture,
ui_gongyong_lashenkuang3599459Rect);
var ui_gongyong_lashenkuang35994599Scale:Scale9Image = new Scale9Image(ui_gongyong_lashenkuang35994599ScaleTexture);
ui_gongyong_lashenkuang35994599Scale.x = 599;
ui_gongyong_lashenkuang35994599Scale.y = 459;
ui_gongyong_lashenkuang35994599Scale.width = 2;
ui_gongyong_lashenkuang35994599Scale.height = 155;
this.addQuiackChild(ui_gongyong_lashenkuang35994599Scale);
var ui_gongyong_lashenkuang214621Texture:Texture = AssetMgr.instance.getTexture('ui_gongyong_lashenkuang2');
var ui_gongyong_lashenkuang214621Rect:Rectangle = new Rectangle(9, 1, 19, 1);
var ui_gongyong_lashenkuang2146219ScaleTexture:Scale9Textures = new Scale9Textures(ui_gongyong_lashenkuang214621Texture,
ui_gongyong_lashenkuang214621Rect);
var ui_gongyong_lashenkuang2146219Scale:Scale9Image = new Scale9Image(ui_gongyong_lashenkuang2146219ScaleTexture);
ui_gongyong_lashenkuang2146219Scale.x = 14;
ui_gongyong_lashenkuang2146219Scale.y = 621;
ui_gongyong_lashenkuang2146219Scale.width = 578;
ui_gongyong_lashenkuang2146219Scale.height = 2;
this.addQuiackChild(ui_gongyong_lashenkuang2146219Scale);
var ui_gongyong_lashenkuang2627119Texture:Texture = AssetMgr.instance.getTexture('ui_gongyong_lashenkuang2');
var ui_gongyong_lashenkuang2627119Rect:Rectangle = new Rectangle(9, 1, 19, 1);
var ui_gongyong_lashenkuang26271199ScaleTexture:Scale9Textures = new Scale9Textures(ui_gongyong_lashenkuang2627119Texture,
ui_gongyong_lashenkuang2627119Rect);
var ui_gongyong_lashenkuang26271199Scale:Scale9Image = new Scale9Image(ui_gongyong_lashenkuang26271199ScaleTexture);
ui_gongyong_lashenkuang26271199Scale.x = 627;
ui_gongyong_lashenkuang26271199Scale.y = 119;
ui_gongyong_lashenkuang26271199Scale.width = 287;
ui_gongyong_lashenkuang26271199Scale.height = 2;
this.addQuiackChild(ui_gongyong_lashenkuang26271199Scale);
var ui_gongyong_lashenkuang2634438Texture:Texture = AssetMgr.instance.getTexture('ui_gongyong_lashenkuang2');
var ui_gongyong_lashenkuang2634438Rect:Rectangle = new Rectangle(9, 1, 19, 1);
var ui_gongyong_lashenkuang26344389ScaleTexture:Scale9Textures = new Scale9Textures(ui_gongyong_lashenkuang2634438Texture,
ui_gongyong_lashenkuang2634438Rect);
var ui_gongyong_lashenkuang26344389Scale:Scale9Image = new Scale9Image(ui_gongyong_lashenkuang26344389ScaleTexture);
ui_gongyong_lashenkuang26344389Scale.x = 634;
ui_gongyong_lashenkuang26344389Scale.y = 438;
ui_gongyong_lashenkuang26344389Scale.width = 272;
ui_gongyong_lashenkuang26344389Scale.height = 2;
this.addQuiackChild(ui_gongyong_lashenkuang26344389Scale);
var ui_gongyong_lashenkuang3619126Texture:Texture = AssetMgr.instance.getTexture('ui_gongyong_lashenkuang3');
var ui_gongyong_lashenkuang3619126Rect:Rectangle = new Rectangle(1, 6, 1, 12);
var ui_gongyong_lashenkuang36191269ScaleTexture:Scale9Textures = new Scale9Textures(ui_gongyong_lashenkuang3619126Texture,
ui_gongyong_lashenkuang3619126Rect);
var ui_gongyong_lashenkuang36191269Scale:Scale9Image = new Scale9Image(ui_gongyong_lashenkuang36191269ScaleTexture);
ui_gongyong_lashenkuang36191269Scale.x = 619;
ui_gongyong_lashenkuang36191269Scale.y = 126;
ui_gongyong_lashenkuang36191269Scale.width = 2;
ui_gongyong_lashenkuang36191269Scale.height = 306;
this.addQuiackChild(ui_gongyong_lashenkuang36191269Scale);
var ui_gongyong_lashenkuang3920126Texture:Texture = AssetMgr.instance.getTexture('ui_gongyong_lashenkuang3');
var ui_gongyong_lashenkuang3920126Rect:Rectangle = new Rectangle(1, 6, 1, 12);
var ui_gongyong_lashenkuang39201269ScaleTexture:Scale9Textures = new Scale9Textures(ui_gongyong_lashenkuang3920126Texture,
ui_gongyong_lashenkuang3920126Rect);
var ui_gongyong_lashenkuang39201269Scale:Scale9Image = new Scale9Image(ui_gongyong_lashenkuang39201269ScaleTexture);
ui_gongyong_lashenkuang39201269Scale.x = 920;
ui_gongyong_lashenkuang39201269Scale.y = 126;
ui_gongyong_lashenkuang39201269Scale.width = 2;
ui_gongyong_lashenkuang39201269Scale.height = 306;
this.addQuiackChild(ui_gongyong_lashenkuang39201269Scale);
var ui_gongyong_lashenkuang2631621Texture:Texture = AssetMgr.instance.getTexture('ui_gongyong_lashenkuang2');
var ui_gongyong_lashenkuang2631621Rect:Rectangle = new Rectangle(9, 1, 19, 1);
var ui_gongyong_lashenkuang26316219ScaleTexture:Scale9Textures = new Scale9Textures(ui_gongyong_lashenkuang2631621Texture,
ui_gongyong_lashenkuang2631621Rect);
var ui_gongyong_lashenkuang26316219Scale:Scale9Image = new Scale9Image(ui_gongyong_lashenkuang26316219ScaleTexture);
ui_gongyong_lashenkuang26316219Scale.x = 631;
ui_gongyong_lashenkuang26316219Scale.y = 621;
ui_gongyong_lashenkuang26316219Scale.width = 277;
ui_gongyong_lashenkuang26316219Scale.height = 2;
this.addQuiackChild(ui_gongyong_lashenkuang26316219Scale);
var box14Texture:Texture = AssetMgr.instance.getTexture('ui_button_wupinkuang');
box14Image = new Image(box14Texture);
box14Image.x = 485;
box14Image.y = 326;
box14Image.width = 107;
box14Image.height = 110;
this.addQuiackChild(box14Image);
no1_3Txt = new TextField(107, 30, '', '', 20, 0xFFFFFF, false);
no1_3Txt.touchable = false;
no1_3Txt.hAlign = 'left';
no1_3Txt.x = 480;
no1_3Txt.y = 487;
this.addQuiackChild(no1_3Txt);
no2_3Txt = new TextField(104, 30, '', '', 20, 0xFFFFFF, false);
no2_3Txt.touchable = false;
no2_3Txt.hAlign = 'left';
no2_3Txt.x = 426;
no2_3Txt.y = 524;
this.addQuiackChild(no2_3Txt);
var closeTexture:Texture = AssetMgr.instance.getTexture('ui_gongyong_tuichuanniiu');
closeButton = new Button(closeTexture);
closeButton.x = 799;
closeButton.y = -35;
this.addQuiackChild(closeButton);
var box1Texture:Texture = AssetMgr.instance.getTexture('ui_button_wupinkuang');
box1Image = new Image(box1Texture);
box1Image.x = 12;
box1Image.y = 96;
box1Image.width = 107;
box1Image.height = 110;
this.addQuiackChild(box1Image);
no3_1Txt = new TextField(141, 38, '', '', 20, 0xFFFFFF, false);
no3_1Txt.touchable = false;
no3_1Txt.hAlign = 'left';
no3_1Txt.x = 315;
no3_1Txt.y = 555;
this.addQuiackChild(no3_1Txt);
awardTxt = new TextField(164, 37, '', '', 20, 0xFFFFFF, false);
awardTxt.touchable = false;
awardTxt.hAlign = 'center';
awardTxt.x = 754;
awardTxt.y = 475;
this.addQuiackChild(awardTxt);
nameTxt = new TextField(119, 31, '', '', 20, 0xFFFFFF, false);
nameTxt.touchable = false;
nameTxt.hAlign = 'center';
nameTxt.x = 618;
nameTxt.y = 475;
this.addQuiackChild(nameTxt);
var ui_wudixingyunxing_xingxing1131Texture:Texture = AssetMgr.instance.getTexture('ui_wudixingyunxing_xingxing');
var ui_wudixingyunxing_xingxing1131Image:Image = new Image(ui_wudixingyunxing_xingxing1131Texture);
ui_wudixingyunxing_xingxing1131Image.x = 11;
ui_wudixingyunxing_xingxing1131Image.y = 31;
ui_wudixingyunxing_xingxing1131Image.width = 41;
ui_wudixingyunxing_xingxing1131Image.height = 40;
ui_wudixingyunxing_xingxing1131Image.smoothing = Constants.smoothing;
ui_wudixingyunxing_xingxing1131Image.touchable = false;
this.addQuiackChild(ui_wudixingyunxing_xingxing1131Image);
var diamondTexture:Texture = AssetMgr.instance.getTexture('ui_dianjuan');
diamondImage = new Image(diamondTexture);
diamondImage.x = 216;
diamondImage.y = 507;
diamondImage.width = 55;
diamondImage.height = 27;
this.addQuiackChild(diamondImage);
var buyTexture:Texture = AssetMgr.instance.getTexture('ui_button_buy');
buyButton = new Button(buyTexture);
buyButton.x = 190;
buyButton.y = 21;
this.addQuiackChild(buyButton);
}
override public function dispose():void {
startButton.dispose();
closeButton.dispose();
buyButton.dispose();
super.dispose();
}
}
}
|
/*
Adobe Systems Incorporated(r) Source Code License Agreement
Copyright(c) 2005 Adobe Systems Incorporated. All rights reserved.
Please read this Source Code License Agreement carefully before using
the source code.
Adobe Systems Incorporated 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, and
distribute this source code and such derivative works in source or
object code form without any attribution requirements.
The name "Adobe Systems Incorporated" must not be used to endorse or promote products
derived from the source code without prior written permission.
You agree to indemnify, hold harmless and defend Adobe Systems Incorporated from and
against any loss, damage, claims or lawsuits, including attorney's
fees that arise or result from your use or distribution of the source
code.
THIS SOURCE CODE IS PROVIDED "AS IS" AND "WITH ALL FAULTS", WITHOUT
ANY TECHNICAL SUPPORT OR ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING,
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ALSO, THERE IS NO WARRANTY OF
NON-INFRINGEMENT, TITLE OR QUIET ENJOYMENT. IN NO EVENT SHALL MACROMEDIA
OR ITS SUPPLIERS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOURCE CODE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.adobe.xml.syndication.generic
{
import com.adobe.xml.syndication.rss.RSS20;
import com.adobe.xml.syndication.rss.Channel20;
import com.adobe.xml.syndication.rss.Image20;
/**
* Class that abstracts out the specific characteristics of an RSS 2.0 feed
* into generic metadata. In this case, metadata refers to any data not
* contained in an item (in other words, data about the feed itself).
* You create an instance using an RSS20 object, then you can access it
* in a generic way.
*
* @langversion ActionScript 3.0
* @playerversion Flash 8.5
* @tiptext
*/
public class RSS20Metadata
implements IMetadata
{
private var rss20:RSS20;
private var channel:Channel20;
/**
* Create a new RSS10Metadata instance.
*
* @param rss20 An RSS20 object.
*
* @langversion ActionScript 3.0
* @playerversion Flash 8.5
* @tiptext
*/
public function RSS20Metadata(rss20:RSS20)
{
this.rss20 = rss20;
this.channel = Channel20(rss20.channel);
}
/**
* This feed's title.
*
* @langversion ActionScript 3.0
* @playerversion Flash 8.5
* @tiptext
*/
public function get title():String
{
return this.channel.title;
}
/**
* An array of authors.
*
* @langversion ActionScript 3.0
* @playerversion Flash 8.5
* @tiptext
*/
public function get authors():Array
{
var author:Author = new Author();
author.email = this.channel.managingEditor;
return [author];
}
/**
* This feed's link.
*
* @langversion ActionScript 3.0
* @playerversion Flash 8.5
* @tiptext
*/
public function get link():String
{
return this.channel.link;
}
/**
* Who ownes the rights to this feed.
*
* @langversion ActionScript 3.0
* @playerversion Flash 8.5
* @tiptext
*/
public function get rights():String
{
return this.channel.copyright;
}
/**
* An image associated with this feed.
*
* @langversion ActionScript 3.0
* @playerversion Flash 8.5
* @tiptext
*/
public function get image():Image
{
var image:Image = new Image();
var rss20Image:Image20 = Image20(this.rss20.image);
image.url = rss20Image.url;
image.title = rss20Image.title;
image.link = rss20Image.link;
image.width = rss20Image.width;
image.height = rss20Image.height;
image.description = rss20Image.description;
return image;
}
/**
* The date this feed was last published.
*
* @langversion ActionScript 3.0
* @playerversion Flash 8.5
* @tiptext
*/
public function get date():Date
{
return this.channel.pubDate;
}
/**
* A description of this feed.
*
* @langversion ActionScript 3.0
* @playerversion Flash 8.5
* @tiptext
*/
public function get description():String
{
return this.channel.description;
}
}
} |
/*
CASA Lib for ActionScript 3.0
Copyright (c) 2011, Aaron Clinger & Contributors of CASA Lib
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
- Neither the name of the CASA Lib nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
package org.casalib.errors {
import ArgumentError;
/**
@author Aaron Clinger
@version 08/06/08
*/
public class ArguementTypeError extends ArgumentError {
/**
Creates a new ArguementTypeError.
@param paramName: The name of the parameter with the incorrect type.
*/
public function ArguementTypeError(paramName:String = null) {
super((paramName == null) ? 'You passed an argument with an incorrect type to this method.' : 'The argument type you passed for parameter "' + paramName + '" is not allowed by this method.');
}
}
} |
package socialContact.copyBitmap
{
public class BitString
{
public var len:int = 0;
public var val:int = 0;
public function BitString()
{
super();
}
}
}
|
package serverProto.family
{
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 ProtoWaterWishTreeRsp extends Message
{
public static const RET:FieldDescriptor$TYPE_MESSAGE = new FieldDescriptor$TYPE_MESSAGE("serverProto.family.ProtoWaterWishTreeRsp.ret","ret",1 << 3 | WireType.LENGTH_DELIMITED,ProtoRetInfo);
public static const CAN_WISH:FieldDescriptor$TYPE_INT32 = new FieldDescriptor$TYPE_INT32("serverProto.family.ProtoWaterWishTreeRsp.can_wish","canWish",2 << 3 | WireType.VARINT);
public static const WISH_TREE_LEVELUP:FieldDescriptor$TYPE_INT32 = new FieldDescriptor$TYPE_INT32("serverProto.family.ProtoWaterWishTreeRsp.wish_tree_levelup","wishTreeLevelup",3 << 3 | WireType.VARINT);
public static const WISH_TREE_STATE:FieldDescriptor$TYPE_MESSAGE = new FieldDescriptor$TYPE_MESSAGE("serverProto.family.ProtoWaterWishTreeRsp.wish_tree_state","wishTreeState",4 << 3 | WireType.LENGTH_DELIMITED,ProtoWishTreeState);
public var ret:ProtoRetInfo;
private var can_wish$field:int;
private var hasField$0:uint = 0;
private var wish_tree_levelup$field:int;
private var wish_tree_state$field:serverProto.family.ProtoWishTreeState;
public function ProtoWaterWishTreeRsp()
{
super();
}
public function clearCanWish() : void
{
this.hasField$0 = this.hasField$0 & 4.294967294E9;
this.can_wish$field = new int();
}
public function get hasCanWish() : Boolean
{
return (this.hasField$0 & 1) != 0;
}
public function set canWish(param1:int) : void
{
this.hasField$0 = this.hasField$0 | 1;
this.can_wish$field = param1;
}
public function get canWish() : int
{
return this.can_wish$field;
}
public function clearWishTreeLevelup() : void
{
this.hasField$0 = this.hasField$0 & 4.294967293E9;
this.wish_tree_levelup$field = new int();
}
public function get hasWishTreeLevelup() : Boolean
{
return (this.hasField$0 & 2) != 0;
}
public function set wishTreeLevelup(param1:int) : void
{
this.hasField$0 = this.hasField$0 | 2;
this.wish_tree_levelup$field = param1;
}
public function get wishTreeLevelup() : int
{
return this.wish_tree_levelup$field;
}
public function clearWishTreeState() : void
{
this.wish_tree_state$field = null;
}
public function get hasWishTreeState() : Boolean
{
return this.wish_tree_state$field != null;
}
public function set wishTreeState(param1:serverProto.family.ProtoWishTreeState) : void
{
this.wish_tree_state$field = param1;
}
public function get wishTreeState() : serverProto.family.ProtoWishTreeState
{
return this.wish_tree_state$field;
}
override final function writeToBuffer(param1:WritingBuffer) : void
{
var _loc2_:* = undefined;
WriteUtils.writeTag(param1,WireType.LENGTH_DELIMITED,1);
WriteUtils.write$TYPE_MESSAGE(param1,this.ret);
if(this.hasCanWish)
{
WriteUtils.writeTag(param1,WireType.VARINT,2);
WriteUtils.write$TYPE_INT32(param1,this.can_wish$field);
}
if(this.hasWishTreeLevelup)
{
WriteUtils.writeTag(param1,WireType.VARINT,3);
WriteUtils.write$TYPE_INT32(param1,this.wish_tree_levelup$field);
}
if(this.hasWishTreeState)
{
WriteUtils.writeTag(param1,WireType.LENGTH_DELIMITED,4);
WriteUtils.write$TYPE_MESSAGE(param1,this.wish_tree_state$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: 4, Size: 4)
*/
throw new flash.errors.IllegalOperationError("Not decompiled due to error");
}
}
}
|
package com.ankamagames.dofus.logic.game.common.misc
{
import avmplus.getQualifiedClassName;
import com.ankamagames.dofus.kernel.Kernel;
import com.ankamagames.dofus.kernel.net.ConnectionType;
import com.ankamagames.dofus.logic.game.fight.frames.FightEntitiesFrame;
import com.ankamagames.dofus.network.enums.ChatActivableChannelsEnum;
import com.ankamagames.dofus.network.messages.common.basic.*;
import com.ankamagames.dofus.network.messages.game.achievement.*;
import com.ankamagames.dofus.network.messages.game.alliance.*;
import com.ankamagames.dofus.network.messages.game.basic.*;
import com.ankamagames.dofus.network.messages.game.character.status.*;
import com.ankamagames.dofus.network.messages.game.chat.*;
import com.ankamagames.dofus.network.messages.game.chat.channel.*;
import com.ankamagames.dofus.network.messages.game.chat.smiley.*;
import com.ankamagames.dofus.network.messages.game.context.mount.*;
import com.ankamagames.dofus.network.messages.game.context.notification.*;
import com.ankamagames.dofus.network.messages.game.context.roleplay.fight.arena.GameRolePlayArenaFightAnswerMessage;
import com.ankamagames.dofus.network.messages.game.context.roleplay.fight.arena.GameRolePlayArenaRegisterMessage;
import com.ankamagames.dofus.network.messages.game.context.roleplay.fight.arena.GameRolePlayArenaUnregisterMessage;
import com.ankamagames.dofus.network.messages.game.context.roleplay.job.*;
import com.ankamagames.dofus.network.messages.game.context.roleplay.npc.*;
import com.ankamagames.dofus.network.messages.game.context.roleplay.party.*;
import com.ankamagames.dofus.network.messages.game.context.roleplay.quest.*;
import com.ankamagames.dofus.network.messages.game.context.roleplay.stats.*;
import com.ankamagames.dofus.network.messages.game.context.roleplay.treasureHunt.*;
import com.ankamagames.dofus.network.messages.game.friend.*;
import com.ankamagames.dofus.network.messages.game.guild.*;
import com.ankamagames.dofus.network.messages.game.guild.tax.*;
import com.ankamagames.dofus.network.messages.game.house.HouseTeleportRequestMessage;
import com.ankamagames.dofus.network.messages.game.inventory.*;
import com.ankamagames.dofus.network.messages.game.inventory.exchanges.*;
import com.ankamagames.dofus.network.messages.game.look.*;
import com.ankamagames.dofus.network.messages.game.prism.*;
import com.ankamagames.dofus.network.messages.game.social.*;
import com.ankamagames.dofus.network.messages.game.tinsel.*;
import com.ankamagames.dofus.network.messages.security.*;
import com.ankamagames.dofus.network.types.common.PlayerSearchCharacterNameInformation;
import com.ankamagames.dofus.network.types.game.context.fight.GameFightFighterNamedInformations;
import com.ankamagames.jerakine.logger.Log;
import com.ankamagames.jerakine.logger.Logger;
import com.ankamagames.jerakine.network.IMessageRouter;
import com.ankamagames.jerakine.network.INetworkMessage;
public class KoliseumMessageRouter implements IMessageRouter
{
protected static const _log:Logger = Log.getLogger(getQualifiedClassName(KoliseumMessageRouter));
private var _fightersIds:Vector.<Number>;
private var _fightersNames:Vector.<String>;
public function KoliseumMessageRouter()
{
super();
}
public function getConnectionId(msg:INetworkMessage) : String
{
var ccmmsg:ChatClientMultiMessage = null;
var ccpmsg:ChatClientPrivateMessage = null;
var bwirmsg:BasicWhoIsRequestMessage = null;
var nwirmsg:NumericWhoIsRequestMessage = null;
var clrblmsg:ContactLookRequestByNameMessage = null;
var clrbimsg:ContactLookRequestByIdMessage = null;
var returnType:String = ConnectionType.TO_KOLI_SERVER;
switch(true)
{
case msg is ChatClientMultiMessage:
case msg is ChatClientMultiWithObjectMessage:
ccmmsg = msg as ChatClientMultiMessage;
if(ccmmsg.channel != ChatActivableChannelsEnum.CHANNEL_ARENA && ccmmsg.channel != ChatActivableChannelsEnum.CHANNEL_GLOBAL && ccmmsg.channel != ChatActivableChannelsEnum.CHANNEL_TEAM)
{
returnType = ConnectionType.TO_GAME_SERVER;
}
break;
case msg is ChatClientPrivateMessage:
case msg is ChatClientPrivateWithObjectMessage:
ccpmsg = msg as ChatClientPrivateMessage;
if(!this.isPlayerNameInFight(PlayerSearchCharacterNameInformation(ccpmsg.receiver).name))
{
returnType = ConnectionType.TO_GAME_SERVER;
}
break;
case msg is BasicWhoIsRequestMessage:
bwirmsg = msg as BasicWhoIsRequestMessage;
if(!this.isPlayerNameInFight(PlayerSearchCharacterNameInformation(bwirmsg.target).name))
{
returnType = ConnectionType.TO_GAME_SERVER;
}
break;
case msg is NumericWhoIsRequestMessage:
nwirmsg = msg as NumericWhoIsRequestMessage;
if(!this.isPlayerIdInFight(nwirmsg.playerId))
{
returnType = ConnectionType.TO_GAME_SERVER;
}
break;
case msg is ContactLookRequestByNameMessage:
clrblmsg = msg as ContactLookRequestByNameMessage;
if(!this.isPlayerNameInFight(clrblmsg.playerName))
{
returnType = ConnectionType.TO_GAME_SERVER;
}
break;
case msg is ContactLookRequestByIdMessage:
clrbimsg = msg as ContactLookRequestByIdMessage;
if(!this.isPlayerIdInFight(clrbimsg.playerId))
{
returnType = ConnectionType.TO_GAME_SERVER;
}
break;
case msg is ChannelEnablingMessage:
case msg is PlayerStatusUpdateRequestMessage:
case msg is StatsUpgradeRequestMessage:
case msg is MountSetXpRatioRequestMessage:
returnType = ConnectionType.TO_ALL_SERVERS;
break;
case msg is MoodSmileyRequestMessage:
case msg is ClientKeyMessage:
case msg is BasicStatMessage:
case msg is BasicStatWithDataMessage:
case msg is AchievementDetailsRequestMessage:
case msg is AchievementDetailedListRequestMessage:
case msg is AchievementRewardRequestMessage:
case msg is FriendGuildSetWarnOnAchievementCompleteMessage:
case msg is PartyInvitationRequestMessage:
case msg is PartyInvitationDungeonRequestMessage:
case msg is PartyInvitationArenaRequestMessage:
case msg is PartyInvitationDetailsRequestMessage:
case msg is PartyAcceptInvitationMessage:
case msg is PartyRefuseInvitationMessage:
case msg is PartyCancelInvitationMessage:
case msg is PartyAbdicateThroneMessage:
case msg is PartyFollowMemberRequestMessage:
case msg is PartyFollowThisMemberRequestMessage:
case msg is PartyStopFollowRequestMessage:
case msg is PartyLocateMembersRequestMessage:
case msg is PartyLeaveRequestMessage:
case msg is PartyKickRequestMessage:
case msg is PartyPledgeLoyaltyRequestMessage:
case msg is PartyNameSetRequestMessage:
case msg is DungeonPartyFinderAvailableDungeonsRequestMessage:
case msg is DungeonPartyFinderListenRequestMessage:
case msg is DungeonPartyFinderRegisterRequestMessage:
case msg is SpouseGetInformationsMessage:
case msg is FriendSetWarnOnConnectionMessage:
case msg is FriendSetWarnOnLevelGainMessage:
case msg is FriendJoinRequestMessage:
case msg is FriendSpouseJoinRequestMessage:
case msg is FriendSpouseFollowWithCompassRequestMessage:
case msg is HouseTeleportRequestMessage:
case msg is AllianceCreationValidMessage:
case msg is AllianceModificationEmblemValidMessage:
case msg is AllianceModificationNameAndTagValidMessage:
case msg is AllianceModificationValidMessage:
case msg is AllianceInvitationMessage:
case msg is AllianceInvitationAnswerMessage:
case msg is AllianceKickRequestMessage:
case msg is AllianceFactsRequestMessage:
case msg is AllianceChangeGuildRightsMessage:
case msg is AllianceInsiderInfoRequestMessage:
case msg is AllianceMotdSetRequestMessage:
case msg is AllianceBulletinSetRequestMessage:
case msg is GuildGetInformationsMessage:
case msg is GuildModificationNameValidMessage:
case msg is GuildModificationEmblemValidMessage:
case msg is GuildModificationValidMessage:
case msg is GuildCreationValidMessage:
case msg is GuildInvitationMessage:
case msg is GuildInvitationSearchMessage:
case msg is GuildInvitationAnswerMessage:
case msg is GuildKickRequestMessage:
case msg is GuildChangeMemberParametersMessage:
case msg is GuildSpellUpgradeRequestMessage:
case msg is GuildCharacsUpgradeRequestMessage:
case msg is GuildPaddockTeleportRequestMessage:
case msg is GuildMemberSetWarnOnConnectionMessage:
case msg is GuildMotdSetRequestMessage:
case msg is GuildBulletinSetRequestMessage:
case msg is GuildFactsRequestMessage:
case msg is GameRolePlayTaxCollectorFightRequestMessage:
case msg is GuildFightJoinRequestMessage:
case msg is GuildFightTakePlaceRequestMessage:
case msg is GuildFightLeaveRequestMessage:
case msg is PrismFightJoinLeaveRequestMessage:
case msg is PrismSetSabotagedRequestMessage:
case msg is PrismFightSwapRequestMessage:
case msg is PrismInfoJoinLeaveRequestMessage:
case msg is PrismUseRequestMessage:
case msg is PrismAttackRequestMessage:
case msg is PrismsListRegisterMessage:
case msg is PrismSettingsRequestMessage:
case msg is PrismModuleExchangeRequestMessage:
case msg is QuestListRequestMessage:
case msg is QuestStartRequestMessage:
case msg is QuestStepInfoRequestMessage:
case msg is QuestObjectiveValidationMessage:
case msg is GuidedModeReturnRequestMessage:
case msg is GuidedModeQuitRequestMessage:
case msg is NotificationUpdateFlagMessage:
case msg is NotificationResetMessage:
case msg is NpcGenericActionRequestMessage:
case msg is NpcDialogReplyMessage:
case msg is JobCrafterDirectoryListRequestMessage:
case msg is JobCrafterDirectoryDefineSettingsMessage:
case msg is JobCrafterDirectoryEntryRequestMessage:
case msg is JobBookSubscribeRequestMessage:
case msg is ObjectAveragePricesGetMessage:
case msg is MountInformationRequestMessage:
case msg is MountHarnessDissociateRequestMessage:
case msg is MountHarnessColorsUpdateRequestMessage:
case msg is TitleSelectRequestMessage:
case msg is OrnamentSelectRequestMessage:
case msg is AccessoryPreviewRequestMessage:
case msg is TreasureHuntLegendaryRequestMessage:
case msg is TreasureHuntDigRequestMessage:
case msg is TreasureHuntFlagRequestMessage:
case msg is TreasureHuntFlagRemoveRequestMessage:
case msg is TreasureHuntGiveUpRequestMessage:
case msg is PortalUseRequestMessage:
case msg is GameRolePlayArenaRegisterMessage:
case msg is GameRolePlayArenaUnregisterMessage:
case msg is GameRolePlayArenaFightAnswerMessage:
returnType = ConnectionType.TO_GAME_SERVER;
}
return returnType;
}
private function isPlayerNameInFight(name:String) : Boolean
{
if(!this._fightersNames || this._fightersNames.length == 0)
{
this.updateFighters();
}
if(this._fightersNames.indexOf(name.toLocaleUpperCase()) != -1)
{
return true;
}
return false;
}
private function isPlayerIdInFight(id:Number) : Boolean
{
if(!this._fightersNames || this._fightersNames.length == 0)
{
this.updateFighters();
}
if(this._fightersIds.indexOf(id) != -1)
{
return true;
}
return false;
}
private function updateFighters() : void
{
var entityId:Number = NaN;
var fighter:GameFightFighterNamedInformations = null;
this._fightersIds = new Vector.<Number>();
this._fightersNames = new Vector.<String>();
var entitiesFrame:FightEntitiesFrame = Kernel.getWorker().getFrame(FightEntitiesFrame) as FightEntitiesFrame;
if(entitiesFrame)
{
this._fightersIds = entitiesFrame.getEntitiesIdsList();
for each(entityId in this._fightersIds)
{
fighter = entitiesFrame.getEntityInfos(entityId) as GameFightFighterNamedInformations;
if(fighter)
{
this._fightersNames.push(fighter.name.toLocaleUpperCase());
}
}
}
}
}
}
|
package org.spicefactory.lib.xml.model {
/**
* @author Jens Halm
*/
public class ClassWithChild {
[Required]
public var child:ChildA;
[Required]
public var intProp:int;
}
}
|
package gov.lbl.aercalc.events
{
import flash.events.Event;
public class SimulationEvent extends Event
{
public static const START_SIMULATION:String = "startSimulation";
public static const STOP_SIMULATION:String = "stopSimulation";
public static const SIMULATION_COMPLETE:String = "simulationComplete";
public static const SIMULATION_STATUS:String = "simulationStatus";
public var selectedItems:Array;
public var statusMessage:String;
public function SimulationEvent(type:String, bubbles:Boolean = false, cancelable:Boolean = false)
{
super(type, bubbles, cancelable);
}
}
} |
package FireTrucksDriver_2012_08_22_dubl_fla
{
import flash.display.MovieClip;
public dynamic class fara_stop_51 extends MovieClip
{
public function fara_stop_51()
{
var _loc1_:* = false;
var _loc2_:* = true;
if(!_loc1_)
{
super();
if(_loc1_)
{
}
return;
}
addFrameScript(0,this.frame1,2,this.frame3,29,this.frame30);
}
function frame1() : *
{
var _loc1_:* = true;
var _loc2_:* = false;
if(_loc1_ || (_loc1_))
{
stop();
}
}
function frame3() : *
{
var _loc1_:* = false;
var _loc2_:* = true;
if(!_loc1_)
{
stop();
}
}
function frame30() : *
{
var _loc1_:* = true;
var _loc2_:* = false;
if(!(_loc2_ && (this)))
{
gotoAndPlay("blink");
}
}
}
}
|
package com.yahoo.infographics.axes
{
import com.yahoo.infographics.data.AxisData;
/**
* Algorithms for creating label text for a Category axis.
*/
public class CategoryMode extends BaseAxisMode implements IAxisMode
{
/**
* Constructor
*/
public function CategoryMode(value:AxisData, props:Object)
{
super(value, props);
}
/**
* @copy com.yahoo.infographics.IAxisMode#getLabelAtPosition()
*/
public function getLabelAtPosition(position:Number, length:Number):String
{
var count:int = int(this._data.data.length) - 1;
var index:int = int(position/(length/count));
return this.labelFunction[this.props.func](this._data.data[index]);
}
/**
* @copy com.yahoo.infographics.axes.IAxisMode#getLabelByKey()
*/
public function getLabelByIndex(key:String, index:int):String
{
return this.labelFunction[this.props.func](this._data.data[index]);
}
/**
* @copy com.yahoo.infographics.IAxisMode#getTotalMajorUnits()
*/
override public function getTotalMajorUnits(majorUnit:Object, length:Number):int
{
return int(this._data.data.length);
}
/**
* @private
*/
private function augmentText(value:Object):String
{
var label:String = this.props.prefix ? String(this.props.prefix) : "";
label += String(value);
if(this.props.suffix) label += String(this.props.suffix);
return label;
}
/**
* @private
* Map of label formatting functions.
*/
private var labelFunction:Object = {
defaultFunction:returnRaw,
augmentText:augmentText
}
}
}
|
package com.renaun.embeds
{
import flash.display.BitmapData;
[Embed(source="/assets_embed/BoxRed9.png")]
public class EmbedBoxRed9 extends BitmapData
{
public function EmbedBoxRed9(width:int, height:int, transparent:Boolean=true, fillColor:uint=4.294967295E9)
{
super(width, height, transparent, fillColor);
}
}
} |
package ro.ciacob.desktop.assets.graphic {
public final class Images {
[Embed(source = "../../../../../assets/graphic/icons/blank.png")]
public static const BLANK:Class;
[Embed(source = "../../../../../assets/graphic/icons/close-16.png")]
public static const CLOSE_16:Class;
[Embed(source = "../../../../../assets/graphic/icons/key-16.png")]
public static const KEY_16:Class;
[Embed(source = "../../../../../assets/graphic/icons/key-32.png")]
public static const KEY_32:Class;
[Embed(source = "../../../../../assets/graphic/icons/downward-32.png")]
public static const DOWNWARD_32:Class;
[Embed(source = "../../../../../assets/graphic/icons/edit-32.png")]
public static const EDIT_32:Class;
[Embed(source = "../../../../../assets/graphic/icons/exclamation-mark-16.png")]
public static const EXCLAMATION_MARK_16:Class;
[Embed(source = "../../../../../assets/graphic/icons/file-32.png")]
public static const FILE_32:Class;
[Embed(source = "../../../../../assets/graphic/icons/folder-32.png")]
public static const FOLDER_32:Class;
[Embed(source = "../../../../../assets/graphic/icons/home-32.png")]
public static const HOME_32:Class;
[Embed(source = "../../../../../assets/graphic/icons/hourglass-16.png")]
public static const HOURGLASS_16:Class;
[Embed(source = "../../../../../assets/graphic/icons/info-32.png")]
public static const INFO_32:Class;
[Embed(source = "../../../../../assets/graphic/icons/link-32.png")]
public static const LINK_32:Class;
[Embed(source = "../../../../../assets/graphic/icons/exit-32.png")]
public static const EXIT_32:Class;
[Embed(source = "../../../../../assets/graphic/icons/magnifying-glass-16.png")]
public static const MAGNIFYING_GLASS_16:Class;
[Embed(source = "../../../../../assets/graphic/icons/up-and-left-disabled-16.png")]
public static const UP_LEFT_DISABLED_16:Class;
[Embed(source = "../../../../../assets/graphic/icons/up-and-left-16.png")]
public static const UP_LEFT:Class;
[Embed(source = "../../../../../assets/graphic/icons/settings-32.png")]
public static const SETTINGS_32:Class;
[Embed(source = "../../../../../assets/graphic/icons/gear-32.png")]
public static const GEAR_32:Class;
[Embed(source = "../../../../../assets/graphic/icons/down-16.png")]
public static const DOWN_16:Class;
[Embed(source = "../../../../../assets/graphic/icons/up-16.png")]
public static const UP_16:Class;
[Embed(source = "../../../../../assets/graphic/icons/upward-32.png")]
public static const UPWARD_32:Class;
[Embed(source = "../../../../../assets/graphic/icons/question-16.png")]
public static const QUESTION_MARK_16:Class;
[Embed(source = "../../../../../assets/graphic/icons/undo-16.png")]
public static const UNDO_16:Class;
[Embed(source = "../../../../../assets/graphic/icons/redo-16.png")]
public static const REDO_16:Class;
[Embed(source = "../../../../../assets/graphic/icons/up-16-nobg.png")]
public static const UP_16_NOBG:Class;
[Embed(source = "../../../../../assets/graphic/icons/down-16-nobg.png")]
public static const DOWN_16_NOBG:Class;
[Embed(source = "../../../../../assets/graphic/icons/add-16.png")]
public static const ADD_16:Class;
[Embed(source = "../../../../../assets/graphic/icons/trash-16.png")]
public static const TRASH_16:Class;
[Embed(source = "../../../../../assets/graphic/icons/cart-32.png")]
public static const CART_32:Class;
[Embed(source = "../../../../../assets/graphic/icons/cart-16.png")]
public static const CART_16:Class;
}
}
|
package skins {
/**
* Spis embedowanych skórek.
*
* @author Jakub Gemel
*/
[Bindable]
public class SkinAssets {
[Embed(source="skin.swf", symbol="Button_downSkin")]
public static const Button_downSkin:Class;
[Embed(source="skin.swf", symbol="Button_upSkin")]
public static const Button_upSkin:Class;
[Embed(source="skin.swf", symbol="Button_orangeDownSkin")]
public static const Button_orangeDownSkin:Class;
[Embed(source="skin.swf", symbol="Button_orangeUpSkin")]
public static const Button_orangeUpSkin:Class;
}
} |
// =================================================================================================
//
// 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.display
{
import flash.errors.IllegalOperationError;
import flash.media.Sound;
import starling.animation.IAnimatable;
import starling.events.Event;
import starling.textures.Texture;
/** Dispatched whenever the movie has displayed its last frame. */
[Event(name="complete", type="starling.events.Event")]
/** A MovieClip is a simple way to display an animation depicted by a list of textures.
*
* <p>Pass the frames of the movie in a vector of textures to the constructor. The movie clip
* will have the width and height of the first frame. If you group your frames with the help
* of a texture atlas (which is recommended), use the <code>getTextures</code>-method of the
* atlas to receive the textures in the correct (alphabetic) order.</p>
*
* <p>You can specify the desired framerate via the constructor. You can, however, manually
* give each frame a custom duration. You can also play a sound whenever a certain frame
* appears.</p>
*
* <p>The methods <code>play</code> and <code>pause</code> control playback of the movie. You
* will receive an event of type <code>Event.COMPLETE</code> when the movie finished
* playback. If the movie is looping, the event is dispatched once per loop.</p>
*
* <p>As any animated object, a movie clip has to be added to a juggler (or have its
* <code>advanceTime</code> method called regularly) to run. The movie will dispatch
* an event of type "Event.COMPLETE" whenever it has displayed its last frame.</p>
*
* @see starling.textures.TextureAtlas
*/
public class MovieClip extends Image implements IAnimatable
{
private var mTextures:Vector.<Texture>;
private var mSounds:Vector.<Sound>;
private var mDurations:Vector.<Number>;
private var mStartTimes:Vector.<Number>;
private var mDefaultFrameDuration:Number;
private var mCurrentTime:Number;
private var mCurrentFrame:int;
private var mLoop:Boolean;
private var mPlaying:Boolean;
private var mMuted:Boolean;
/** Creates a movie clip from the provided textures and with the specified default framerate.
* The movie will have the size of the first frame. */
public function MovieClip(textures:Vector.<Texture>, fps:Number=12)
{
if (textures.length > 0)
{
super(textures[0]);
init(textures, fps);
}
else
{
throw new ArgumentError("Empty texture array");
}
}
private function init(textures:Vector.<Texture>, fps:Number):void
{
if (fps <= 0) throw new ArgumentError("Invalid fps: " + fps);
var numFrames:int = textures.length;
mDefaultFrameDuration = 1.0 / fps;
mLoop = true;
mPlaying = true;
mCurrentTime = 0.0;
mCurrentFrame = 0;
mTextures = textures.concat();
mSounds = new Vector.<Sound>(numFrames);
mDurations = new Vector.<Number>(numFrames);
mStartTimes = new Vector.<Number>(numFrames);
for (var i:int=0; i<numFrames; ++i)
{
mDurations[i] = mDefaultFrameDuration;
mStartTimes[i] = i * mDefaultFrameDuration;
}
}
// frame manipulation
/** Adds an additional frame, optionally with a sound and a custom duration. If the
* duration is omitted, the default framerate is used (as specified in the constructor). */
public function addFrame(texture:Texture, sound:Sound=null, duration:Number=-1):void
{
addFrameAt(numFrames, texture, sound, duration);
}
/** Adds a frame at a certain index, optionally with a sound and a custom duration. */
public function addFrameAt(frameID:int, texture:Texture, sound:Sound=null,
duration:Number=-1):void
{
if (frameID < 0 || frameID > numFrames) throw new ArgumentError("Invalid frame id");
if (duration < 0) duration = mDefaultFrameDuration;
mTextures.splice(frameID, 0, texture);
mSounds.splice(frameID, 0, sound);
mDurations.splice(frameID, 0, duration);
if (frameID > 0 && frameID == numFrames)
mStartTimes[frameID] = mStartTimes[int(frameID-1)] + mDurations[int(frameID-1)];
else
updateStartTimes();
}
/** Removes the frame at a certain ID. The successors will move down. */
public function removeFrameAt(frameID:int):void
{
if (frameID < 0 || frameID >= numFrames) throw new ArgumentError("Invalid frame id");
if (numFrames == 1) throw new IllegalOperationError("Movie clip must not be empty");
mTextures.splice(frameID, 1);
mSounds.splice(frameID, 1);
mDurations.splice(frameID, 1);
updateStartTimes();
}
/** Returns the texture of a certain frame. */
public function getFrameTexture(frameID:int):Texture
{
if (frameID < 0 || frameID >= numFrames) throw new ArgumentError("Invalid frame id");
return mTextures[frameID];
}
/** Sets the texture of a certain frame. */
public function setFrameTexture(frameID:int, texture:Texture):void
{
if (frameID < 0 || frameID >= numFrames) throw new ArgumentError("Invalid frame id");
mTextures[frameID] = texture;
}
/** Returns the sound of a certain frame. */
public function getFrameSound(frameID:int):Sound
{
if (frameID < 0 || frameID >= numFrames) throw new ArgumentError("Invalid frame id");
return mSounds[frameID];
}
/** Sets the sound of a certain frame. The sound will be played whenever the frame
* is displayed. */
public function setFrameSound(frameID:int, sound:Sound):void
{
if (frameID < 0 || frameID >= numFrames) throw new ArgumentError("Invalid frame id");
mSounds[frameID] = sound;
}
/** Returns the duration of a certain frame (in seconds). */
public function getFrameDuration(frameID:int):Number
{
if (frameID < 0 || frameID >= numFrames) throw new ArgumentError("Invalid frame id");
return mDurations[frameID];
}
/** Sets the duration of a certain frame (in seconds). */
public function setFrameDuration(frameID:int, duration:Number):void
{
if (frameID < 0 || frameID >= numFrames) throw new ArgumentError("Invalid frame id");
mDurations[frameID] = duration;
updateStartTimes();
}
// playback methods
/** Starts playback. Beware that the clip has to be added to a juggler, too! */
public function play():void
{
mPlaying = true;
}
/** Pauses playback. */
public function pause():void
{
mPlaying = false;
}
/** Stops playback, resetting "currentFrame" to zero. */
public function stop():void
{
mPlaying = false;
currentFrame = 0;
}
// helpers
private function updateStartTimes():void
{
var numFrames:int = this.numFrames;
mStartTimes.length = 0;
mStartTimes[0] = 0;
for (var i:int=1; i<numFrames; ++i)
mStartTimes[i] = mStartTimes[int(i-1)] + mDurations[int(i-1)];
}
// IAnimatable
/** @inheritDoc */
public function advanceTime(passedTime:Number):void
{
if (!mPlaying || passedTime <= 0.0) return;
var finalFrame:int;
var previousFrame:int = mCurrentFrame;
var restTime:Number = 0.0;
var breakAfterFrame:Boolean = false;
var dispatchCompleteEvent:Boolean = false;
var totalTime:Number = this.totalTime;
if (mLoop && mCurrentTime >= totalTime)
{
mCurrentTime = 0.0;
mCurrentFrame = 0;
}
if (mCurrentTime < totalTime)
{
mCurrentTime += passedTime;
finalFrame = mTextures.length - 1;
while (mCurrentTime > mStartTimes[mCurrentFrame] + mDurations[mCurrentFrame])
{
if (mCurrentFrame == finalFrame)
{
if (mLoop && !hasEventListener(Event.COMPLETE))
{
mCurrentTime -= totalTime;
mCurrentFrame = 0;
}
else
{
breakAfterFrame = true;
restTime = mCurrentTime - totalTime;
dispatchCompleteEvent = true;
mCurrentFrame = finalFrame;
mCurrentTime = totalTime;
}
}
else
{
mCurrentFrame++;
}
var sound:Sound = mSounds[mCurrentFrame];
if (sound && !mMuted) sound.play();
if (breakAfterFrame) break;
}
// special case when we reach *exactly* the total time.
if (mCurrentFrame == finalFrame && mCurrentTime == totalTime)
dispatchCompleteEvent = true;
}
if (mCurrentFrame != previousFrame)
texture = mTextures[mCurrentFrame];
if (dispatchCompleteEvent)
dispatchEventWith(Event.COMPLETE);
if (mLoop && restTime > 0.0)
advanceTime(restTime);
}
// properties
/** The total duration of the clip in seconds. */
public function get totalTime():Number
{
var numFrames:int = mTextures.length;
return mStartTimes[int(numFrames-1)] + mDurations[int(numFrames-1)];
}
/** The time that has passed since the clip was started (each loop starts at zero). */
public function get currentTime():Number { return mCurrentTime; }
/** The total number of frames. */
public function get numFrames():int { return mTextures.length; }
/** Indicates if the clip should loop. */
public function get loop():Boolean { return mLoop; }
public function set loop(value:Boolean):void { mLoop = value; }
/** If enabled, no new sounds will be started during playback. Sounds that are already
* playing are not affected. */
public function get muted():Boolean { return mMuted; }
public function set muted(value:Boolean):void { mMuted = value; }
/** The index of the frame that is currently displayed. */
public function get currentFrame():int { return mCurrentFrame; }
public function set currentFrame(value:int):void
{
mCurrentFrame = value;
mCurrentTime = 0.0;
for (var i:int=0; i<value; ++i)
mCurrentTime += getFrameDuration(i);
texture = mTextures[mCurrentFrame];
if (!mMuted && mSounds[mCurrentFrame]) mSounds[mCurrentFrame].play();
}
/** The default number of frames per second. Individual frames can have different
* durations. If you change the fps, the durations of all frames will be scaled
* relatively to the previous value. */
public function get fps():Number { return 1.0 / mDefaultFrameDuration; }
public function set fps(value:Number):void
{
if (value <= 0) throw new ArgumentError("Invalid fps: " + value);
var newFrameDuration:Number = 1.0 / value;
var acceleration:Number = newFrameDuration / mDefaultFrameDuration;
mCurrentTime *= acceleration;
mDefaultFrameDuration = newFrameDuration;
for (var i:int=0; i<numFrames; ++i)
mDurations[i] *= acceleration;
updateStartTimes();
}
/** Indicates if the clip is still playing. Returns <code>false</code> when the end
* is reached. */
public function get isPlaying():Boolean
{
if (mPlaying)
return mLoop || mCurrentTime < totalTime;
else
return false;
}
/** Indicates if a (non-looping) movie has come to its end. */
public function get isComplete():Boolean
{
return !mLoop && mCurrentTime >= totalTime;
}
}
} |
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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;
var gTestfile = 'regress-230216-1.js';
//-----------------------------------------------------------------------------
var BUGNUMBER = 230216;
var summary = 'check for numerical overflow in regexps in back reference and bounds for {} quantifier';
var actual = '';
var expect = '';
var status = '';
function inSection(x) {
return "Section "+x+" of test -";
}
status = inSection(1) + ' check for overflow in backref';
actual = 'undefined';
expect = false;
try {
actual = /(a)\21474836481/.test("aa");
} catch(e) {
status += ' Error: ' + e;
}
Assert.expectEq(status, expect, actual);
status = inSection(1.1) + ' check for overflow in backref';
actual = 'undefined';
expect = false;
try {
var i = 21474836481;
actual = new RegExp('(a)\\' + i).test("aa");
} catch(e) {
status += ' Error: ' + e;
}
Assert.expectEq(status, expect, actual);
status = inSection(1.2) + ' check for overflow in backref';
actual = 'undefined';
expect = false;
try {
actual = /a{21474836481}/.test("a")
} catch(e) {
status += ' Error: ' + e;
}
Assert.expectEq(status, expect, actual);
status = inSection(2) + ' check for overflow in backref';
actual = 'undefined';
expect = false;
try {
actual = /a\21474836480/.test("");
} catch(e) {
status += ' Error: ' + e;
}
Assert.expectEq(status, expect, actual);
status = inSection(3) + ' check for overflow in backref';
actual = 'undefined';
expect = ["ax", "ax", "", "a"].toString();
try {
pattern = /((\3|b)\2(a)x)+/;
string = 'aaxabxbaxbbx';
actual = pattern(string).toString();
} catch(e) {
status += ' Error: ' + e;
}
Assert.expectEq(status, expect, actual);
|
package kabam.rotmg.startup.control {
import kabam.lib.tasks.TaskMonitor;
public class StartupCommand {
[Inject]
public var startup:StartupSequence;
[Inject]
public var monitor:TaskMonitor;
public function execute():void {
this.monitor.add(this.startup);
this.startup.start();
}
}
}//package kabam.rotmg.startup.control
|
package reprise.external
{
import asunit.framework.TestSuite;
/**
* @author tschneidereit
*/
public class ResourceTests extends TestSuite
{
public function ResourceTests()
{
addTest(new CancelledResourceLoaderTest());
addTest(new ResourceLoaderTest());
}
}
}
|
package com.profusiongames.items
{
import starling.core.Starling;
import starling.display.MovieClip;
import starling.textures.Texture;
import starling.textures.TextureAtlas;
/**
* ...
* @author UnknownGuardian
*/
public class GoldCoin extends Coin
{
[Embed(source = "../../../../lib/Graphics/char/boy_frames.png")]private var _animTexture:Class;
[Embed(source = "../../../../lib/Graphics/char/boy_frames.xml", mimeType = "application/octet-stream")]private var _animXML:Class;
private var _animation:MovieClip;
public function GoldCoin()
{
var texture:Texture = Texture.fromBitmap(new _animTexture());
var xmlData:XML = XML(new _animXML());
var textureAtlas:TextureAtlas = new TextureAtlas(texture, xmlData);
_animation = new MovieClip(textureAtlas.getTextures("coin_"), 30);
_animation.play();
addChild(_animation);
Starling.juggler.add(_animation);
pivotX = int(_animation.width / 2);
pivotY = int(_animation.height / 2);
monetaryValue = 5;
}
}
} |
/**
* 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.main.model.modules
{
import flash.utils.Dictionary;
import mx.collections.ArrayCollection;
import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger;
public class DependancyResolver
{
private static const LOGGER:ILogger = getClassLogger(DependancyResolver);
private var _modules:Dictionary;
/**
* Creates a dependency tree for modules using a topological sort algorithm
* (Khan, 1962, http://portal.acm.org/beta/citation.cfm?doid=368996.369025)
*/
public function buildDependencyTree(modules:Dictionary):ArrayCollection{
this._modules = modules;
var sorted:ArrayCollection = new ArrayCollection();
var independent:ArrayCollection = getModulesWithNoDependencies();
for (var i:int = 0; i<independent.length; i++) (independent.getItemAt(i) as ModuleDescriptor).resolved = true;
while(independent.length > 0){
var n:ModuleDescriptor = independent.removeItemAt(0) as ModuleDescriptor;
sorted.addItem(n);
for (var key:Object in _modules){
var m:ModuleDescriptor = _modules[key] as ModuleDescriptor;
m.removeDependancy(n.getName());
if ((m.unresolvedDependancies.length == 0) && (!m.resolved)){
independent.addItem(m);
m.resolved = true;
}
}
}
//Debug Information
for (var key2:Object in _modules) {
var m2:ModuleDescriptor = _modules[key2] as ModuleDescriptor;
if (m2.unresolvedDependancies.length != 0){
throw new Error("Modules have circular dependancies, please check your config file. Unresolved: " +
m2.getName() + " depends on " + m2.unresolvedDependancies.toString());
}
}
return sorted;
}
private function getModulesWithNoDependencies():ArrayCollection{
var returnArray:ArrayCollection = new ArrayCollection();
for (var key:Object in _modules) {
var m:ModuleDescriptor = _modules[key] as ModuleDescriptor;
if (m.unresolvedDependancies.length == 0) {
returnArray.addItem(m);
}
}
return returnArray;
}
}
}
|
/*
Copyright (c) 2008, Adobe Systems Incorporated
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of Adobe Systems Incorporated nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.common.json {
/**
*
*
*/
public class JSONParseError extends Error {
/** The location in the string where the error occurred */
private var _location:int;
/** The string in which the parse error occurred */
private var _text:String;
/**
* Constructs a new JSONParseError.
*
* @param message The error message that occured during parsing
* @langversion ActionScript 3.0
* @playerversion Flash 9.0
* @tiptext
*/
public function JSONParseError( message:String = "", location:int = 0, text:String = "") {
super( message );
name = "JSONParseError";
_location = location;
_text = text;
}
/**
* Provides read-only access to the location variable.
*
* @return The location in the string where the error occurred
* @langversion ActionScript 3.0
* @playerversion Flash 9.0
* @tiptext
*/
public function get location():int {
return _location;
}
/**
* Provides read-only access to the text variable.
*
* @return The string in which the error occurred
* @langversion ActionScript 3.0
* @playerversion Flash 9.0
* @tiptext
*/
public function get text():String {
return _text;
}
}
} |
package com.arsec.ui
{
import com.arsec.ui.*;
import com.arsec.system.*;
import flash.display.MovieClip;
import flash.geom.Point;
public class SchedulerSegment extends Gadget
{
public static const GRAD_NORMAL:Array = new Array(0x995C00, 0xFEF700, 0x995C00);
public static const GRAD_ALARM:Array = new Array(0x6F0F27, 0xFE321B, 0x6F0F27);
public static const MODE_NORMAL:int = 0;
public static const MODE_ALARM:int = 1;
public static const MODE_ERASE:int = 2;
private var rect:RoundRect;
private var scheduler:Scheduler;
public var defMode:int = -1;
public var mode:int = MODE_NORMAL;
public var id:Array;
//this object is not actor itself, there is a hotspot in scheduler so it translates all events to matrix segment
public function SchedulerSegment(sc:Scheduler, x:Number, y:Number, m:int, id:Array)
{
this.id = id;
rect = new RoundRect(0, 0, 12, 28, 0, 0, Osd.COLOR_SELECTED);
rect.setPos(x,y);
scheduler = sc;
setMode(m);
addChild(rect);
scheduler.addChild(this);
}
public override function hover()
{
scheduler.notify(id, true);
super.hover();
}
public override function unfocus()
{
scheduler.notify(id, false);
super.unfocus();
}
//this function simulates double click
public override function pressRight()
{
scheduler.getTimeTable(id[0]);
super.pressRight();
}
public override function hold()
{
scheduler.beginWatch(id);
super.hold();
}
public override function unhold()
{
scheduler.stopWatch();
super.unhold();
}
public function setMode(m:int)
{
mode = m;
if (defMode < 0) defMode = m;
switch(mode)
{
case(MODE_NORMAL):
rect.setGradient(GRAD_NORMAL, [1, 1, 1], [0, 105, 255], Math.PI/2);
alpha = 1.0;
break;
case(MODE_ALARM):
rect.setGradient(GRAD_ALARM, [1, 1, 1], [0, 105, 255], Math.PI/2);
alpha = 1.0;
break;
case(MODE_ERASE):
alpha = 0;
break;
}
}
}
} |
package com.netease.protobuf.fieldDescriptors
{
import com.netease.protobuf.FieldDescriptor;
import flash.utils.IDataInput;
import com.netease.protobuf.ReadUtils;
import com.netease.protobuf.WritingBuffer;
import com.netease.protobuf.WriteUtils;
public final class FieldDescriptor$TYPE_DOUBLE extends FieldDescriptor
{
public function FieldDescriptor$TYPE_DOUBLE(param1:String, param2:String, param3:uint)
{
super();
this.fullName = param1;
this._name = param2;
this.tag = param3;
}
override public function get type() : Class
{
return Number;
}
override public function readSingleField(param1:IDataInput) : *
{
return ReadUtils.read$TYPE_DOUBLE(param1);
}
override public function writeSingleField(param1:WritingBuffer, param2:*) : void
{
WriteUtils.write$TYPE_DOUBLE(param1,param2);
}
override public function autoSetNull() : void
{
if(super.hasOwnProperty("autoSetNull"))
{
super.["autoSetNull"]();
}
}
}
}
|
// Compiler options: -psstrict+
//
// Mono.CSharp.InternalErrorException: /Users/administrator/Documents/Code/playscript/playscriptredux/playscript/mcs/class/pscorlib/flash/filesystem/File.play(184,21): flash.filesystem.File.getDirectoryListing() ---> Mono.CSharp.InternalErrorException: /Users/administrator/Documents/Code/playscript/playscriptredux/playscript/mcs/class/pscorlib/flash/filesystem/File.play(185,5): ---> Mono.CSharp.InternalErrorException: Already created variable `name'
// at Mono.CSharp.LocalVariable.CreateBuilder (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0
package {
public class Foo {
public static function Main():int {
var name_of_array = new Array("value1","value2","value3");
for each (var name:String in name_of_array)
{
trace(name);
}
for each (name in name_of_array)
{
trace(name);
}
return 0;
}
}
}
|
package interactive.apartment.items
{
import bluekarma.assets.sound.SoundAssets;
import bluekarma.interactive.base.Item;
import assets.ItemAssets;
import starling.display.Image;
/**
* ...
* @author Shaun Stone
*/
public class KitchenWaterGlass extends Item
{
private const GLASS_ID:String = "kitchen_glass";
private var image:Image;
private var imageInventory:Image;
private var containsWater:Boolean = false;
public function KitchenWaterGlass(id:String, pickable:Boolean = false)
{
super(id, pickable);
setTrashable(false);
setCombinable(true);
}
override protected function drawItem():void
{
image = new Image(ItemAssets.getAtlas().getTexture(ItemAssets.KITCHEN_GLASS));
image.width = 27;
image.height = 34;
addChild(image);
imageInventory = new Image(ItemAssets.getAtlas().getTexture(ItemAssets.KITCHEN_GLASS));
imageInventory.x = 10;
addChild(imageInventory);
imageInventory.visible = false;
}
/**
* The image we show on the level may not be suitable
* for the inventory (too long, wide) so we swap the image
* with something more fitting
* @param inInventory
*/
override public function changeItemImage(inInventory:Boolean = true):void
{
if (inInventory) {
image.visible = false;
imageInventory.visible = true;
} else {
image.visible = true;
imageInventory.visible = false;
}
}
public function addWater():void
{
this.containsWater = true;
SoundAssets.fillUpGlassWithWater.play();
}
public function hasWater():Boolean
{
return containsWater;
}
}
} |
////////////////////////////////////////////////////////////////////////////////
//
// 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 flexUnitTests.binding.support.bindings.bindables
{
[Bindable]
public class TaskVO_on_top_of_class implements ITaskVO
{
public function TaskVO_on_top_of_class(label:String = null, data:String = null, tooltip:String = null)
{
this.label = label;
this.data = data;
this.tooltip = tooltip;
}
private var _label:String;
public function get label():String
{
return _label;
}
public function set label(value:String):void
{
_label = value;
}
private var _data:String;
public function get data():String
{
return _data;
}
public function set data(value:String):void
{
_data = value;
}
private var _tooltip:String;
public function get tooltip():String
{
return _tooltip;
}
public function set tooltip(value:String):void
{
_tooltip = value;
}
private var _selected:Boolean
public function get selected():Boolean{
return _selected;
}
public function set selected(value:Boolean):void{
_selected = value;
}
}
} |
package ui {
import flash.display.Sprite;
import flash.events.Event;
import flash.text.TextField;
/**
* ...
* @author Adam Vernon
*/
public class EntryCube extends Sprite {
//--In FLA--//
public var inputTF:TextField;
//----------//
public static const CHAR_ENTERED:String = "CHAR_ENTERED";
public function EntryCube() {
ui_init();
}
private function ui_init():void {
inputTF.restrict = "A-z";
inputTF.addEventListener(Event.CHANGE, inputTF_change);
}
private function inputTF_change(evt:Event):void {
inputTF.text = inputTF.text.toUpperCase();
if (inputTF.text.charAt(0) == "Q") inputTF.text = "Qu";
else inputTF.text = inputTF.text.charAt(0);
dispatchEvent(new Event(CHAR_ENTERED));
}
}
} |
////////////////////////////////////////////////////////////////////////////////
//
// 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 spark.layouts
{
/**
* The RowAlign class defines the possible values for the
* <code>rowAlign</code> property of the TileLayout class.
*
* @see TileLayout#rowAlign
*
* @langversion 3.0
* @playerversion Flash 10
* @playerversion AIR 1.5
* @productversion Flex 4
*/
public final class RowAlign
{
/**
* Do not justify the rows.
*
* @langversion 3.0
* @playerversion Flash 10
* @playerversion AIR 1.5
* @productversion Flex 4
*/
public static const TOP:String = "top";
/**
* Justify the rows by increasing the vertical gap.
*
* @langversion 3.0
* @playerversion Flash 10
* @playerversion AIR 1.5
* @productversion Flex 4
*/
public static const JUSTIFY_USING_GAP:String = "justifyUsingGap";
/**
* Justify the rows by increasing the row height.
*
* @langversion 3.0
* @playerversion Flash 10
* @playerversion AIR 1.5
* @productversion Flex 4
*/
public static const JUSTIFY_USING_HEIGHT:String = "justifyUsingHeight";
}
}
|
/**
* Morn UI Version 3.0 http://www.mornui.com/
* Feedback yungzhu@gmail.com http://weibo.com/newyung
*/
package ktv.morn.core.managers
{
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.display.Loader;
import flash.events.Event;
import flash.events.HTTPStatusEvent;
import flash.events.IOErrorEvent;
import flash.events.ProgressEvent;
import flash.events.SecurityErrorEvent;
import flash.net.LocalConnection;
import flash.net.URLLoader;
import flash.net.URLLoaderDataFormat;
import flash.net.URLRequest;
import flash.system.ApplicationDomain;
import flash.system.LoaderContext;
import flash.utils.ByteArray;
import flash.utils.clearInterval;
import flash.utils.setInterval;
import ktv.gifv.GIFBoy;
import ktv.morn.core.handlers.Handler;
/**资源加载器*/
public class ResLoader
{
/**加载swf文件,返回1*/
public static const SWF:uint=0;
/**加载位图,返回Bitmapdata*/
public static const BMD:uint=1;
/**加载TXT文本,返回String*/
public static const TXT:uint=3;
/**加载经过压缩的ByteArray,返回Object*/
public static const DB:uint=4;
/**加载未压缩的ByteArray,返回ByteArray*/
public static const BYTE:uint=5;
/**加载GIF图片,返回GIFBoy*/
public static const GIF:uint=6;
/**5秒钟加载的最小字节数,如果小于此字节数,则停止加载(LoaderManager内会进行重试加载),默认为5秒钟最少下载1K*/
public static var minBytePre5Second:int=1024;
public static var _loadedMap:Object={};
private var _loader:Loader=new Loader();
private var _urlLoader:URLLoader=new URLLoader();
private var _urlRequest:URLRequest=new URLRequest();
private var _loaderContext:LoaderContext=new LoaderContext(false, ApplicationDomain.currentDomain);
private var _url:String;
private var _type:int;
private var _complete:Handler;
private var _progress:Handler;
private var _isCache:Boolean;
private var _isLoading:Boolean;
private var _loaded:Number;
private var _lastLoaded:Number;
public static var applicationDomainDic:Object;
public static var headURL:String="";
private var checkLoadID:int=0;
public function ResLoader()
{
ResLoader.applicationDomainDic={app:new LoaderContext(false,new ApplicationDomain())};// 存储swf 加载所在域
LoaderContext(ResLoader.applicationDomainDic.app).allowCodeImport=true;
}
public function init():void
{
// _loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgress);
_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete);
_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, onError);
_loader.contentLoaderInfo.addEventListener(HTTPStatusEvent.HTTP_STATUS, onStatus);
_urlLoader.addEventListener(ProgressEvent.PROGRESS, onProgress);
_urlLoader.addEventListener(Event.COMPLETE, onComplete);
_urlLoader.addEventListener(IOErrorEvent.IO_ERROR, onError);
_urlLoader.addEventListener(HTTPStatusEvent.HTTP_STATUS, onStatus);
_urlLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onError);
}
/**中止加载*/
public function tryToCloseLoad():void
{
try
{
_loader.unloadAndStop();
_urlLoader.close();
clearInterval(checkLoadID);
_isLoading=false;
}
catch (e:Error)
{
}
}
private function doLoad():void
{
_isLoading=true;
_urlRequest.url=_url;
if (_type == BMD || _type == DB || _type == BYTE || _type == SWF)
{
_urlLoader.dataFormat=URLLoaderDataFormat.BINARY;
_urlLoader.load(_urlRequest);
return;
}
if (_type == TXT)
{
_urlLoader.dataFormat=URLLoaderDataFormat.TEXT;
_urlLoader.load(_urlRequest);
return;
}
}
private function onStatus(e:HTTPStatusEvent):void
{
}
private function onError(e:Event):void
{
LogManager.log.error("Load Error:", e.toString());
endLoad(null);
}
private function onProgress(e:ProgressEvent):void
{
if (_progress != null)
{
var value:Number=e.bytesLoaded / e.bytesTotal;
_progress.executeWith([value]);
}
_loaded=e.bytesLoaded;
}
private function onComplete(e:Event):void
{
var content:*=null;
if (_type == SWF || _type == BMD)
{
if (_urlLoader.data != null)
{
_loader.loadBytes(_urlLoader.data, applicationDomainDic.app);
_urlLoader.data=null;
return;
}
if (_type == SWF)
{
content=_loader.content;
trace("加载的swf文件:" + _urlRequest.url, "帧频", _loader.contentLoaderInfo.frameRate);
_loader.unloadAndStop();
// content = 1;
}
else
{
content=Bitmap(_loader.content).bitmapData;
_loader.unloadAndStop();
}
}
else if (_type == DB)
{
var bytes:ByteArray=_urlLoader.data as ByteArray;
bytes.uncompress();
content=bytes.readObject();
}
else if (_type == BYTE)
{
content=_urlLoader.data as ByteArray;
}
else if (_type == TXT)
{
content=_urlLoader.data;
}else if (_type == GIF)
{
var gifLoader:GIFBoy=new GIFBoy();
gifLoader.loadBytes(_urlLoader.data);
content=gifLoader;
}
saveContent(content);
}
private function saveContent(content:*):void
{
if (_isCache)
{
_loadedMap[_url]=content;
}
endLoad(content);
}
private function endLoad(content:*):void
{
clearInterval(checkLoadID);
_isLoading=false;
_progress=null;
if (_complete != null)
{
var handler:Handler=_complete;
_complete=null;
handler.executeWith([content]);
}
}
/**加载资源*/
public function load(url:String, type:int, complete:Handler, progress:Handler, isCache:Boolean=true):void
{
if (_isLoading)
{
LogManager.log.warn("Loader is try to close.", _url);
tryToCloseLoad();
}
_url=url;
_type=type;
_complete=complete;
_progress=progress;
_isCache=isCache;
var content:*=getResLoaded(url);
if (content != null)
{
return endLoad(content);
}
_loaded=_lastLoaded=0;
clearInterval(checkLoadID);
checkLoadID=setInterval(checkLoad,5000);
doLoad();
}
/**如果5秒钟下载小于1k,则停止下载*/
private function checkLoad():void
{
if (_loaded - _lastLoaded < minBytePre5Second)
{
LogManager.log.warn("load time out:" + _url, "加载进度" + _loaded);
tryToCloseLoad();
endLoad(null);
}
else
{
_lastLoaded=_loaded;
}
}
/**获取已加载的资源*/
public static function getResLoaded(url:String):*
{
return _loadedMap[url];
}
/**设置资源*/
public static function setResLoaded(url:String, content:*):void
{
_loadedMap[url]=content;
}
/**删除已加载的资源*/
public static function clearResLoaded(url:String, isDispose:Boolean=true):void
{
var res:Object=_loadedMap[url];
if(!res) return;
if (isDispose)
{
if (res is BitmapData)
{
BitmapData(res).dispose();
}
else if (res is Bitmap)
{
Bitmap(res).bitmapData.dispose();
}
}
delete _loadedMap[url];
trace("删除已加载的资源" + url);
}
/**加载资源的地址*/
public function get url():String
{
return _url;
}
public static function removeAll():void
{
for (var key:String in _loadedMap)
{
clearResLoaded(key);
}
_loadedMap={};
for (key in ResLoader.applicationDomainDic)
{
delete ResLoader.applicationDomainDic[key];
}
ResLoader.applicationDomainDic={};
}
public function dispose():void
{
_loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, onComplete);
_loader.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, onError);
_loader.contentLoaderInfo.removeEventListener(HTTPStatusEvent.HTTP_STATUS, onStatus);
_loader.unload();
_loader.unloadAndStop();
_urlLoader.removeEventListener(ProgressEvent.PROGRESS, onProgress);
_urlLoader.removeEventListener(Event.COMPLETE, onComplete);
_urlLoader.removeEventListener(IOErrorEvent.IO_ERROR, onError);
_urlLoader.removeEventListener(HTTPStatusEvent.HTTP_STATUS, onStatus);
_urlLoader.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, onError);
}
/**
*检查文件类型
* @param url
* @return
*/
public static function checkType(url:String):int
{
var type:int=0;
var suffix:String=url.substr(url.lastIndexOf("."));
switch(suffix)
{
case ".zip":
type=ResLoader.BYTE;
break;
case ".png":
case ".jpg":
type=ResLoader.BMD;
break;
case ".swf":
type=ResLoader.SWF;
break;
case ".txt":
case ".xml":
case ".json":
case ".ini":
type=ResLoader.TXT;
break;
default:
type=ResLoader.TXT;
break;
}
return type;
}
/**
*强制清除内存
*/
public static function clearRam():void
{
trace("强制清除内存!");
try
{
new LocalConnection().connect("foo");
new LocalConnection().connect("foo");
}
catch(error : Error)
{
}
}
}
}
|
let mutable a: uint8 = 10;
let mutable b: byte = 10;
b = a;
a = b;
let mutable ptr_a = &mutable a;
let mutable ptr_b = &mutable b;
ptr_a = ptr_b;
ptr_b = ptr_a;
let mutable arr_a = [a];
let mutable arr_b = [b];
arr_a = arr_b;
arr_b = arr_a;
|
////////////////////////////////////////////////////////////////////////////////
//
// 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.rpc.remoting
{
import mx.core.mx_internal;
import mx.messaging.Channel;
import mx.messaging.ChannelSet;
import mx.messaging.channels.AMFChannel;
import mx.messaging.channels.SecureAMFChannel;
import mx.rpc.AbstractOperation;
import mx.rpc.AbstractService;
import mx.rpc.mxml.Concurrency;
use namespace mx_internal;
/**
* The RemoteObject class gives you access to classes on a remote application server.
*
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
* @productversion Flex 3
*/
public dynamic class RemoteObject extends AbstractService
{
//-------------------------------------------------------------------------
//
// Constructor
//
//-------------------------------------------------------------------------
/**
* Creates a new RemoteObject.
* @param destination [optional] Destination of the RemoteObject; should match a destination name in the services-config.xml file.
*
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
* @productversion Flex 3
*/
public function RemoteObject(destination:String = null)
{
super(destination);
concurrency = Concurrency.MULTIPLE;
makeObjectsBindable = false; // change this for now since Royale tries to create ObejctProxy that still is not implemented and make things fail. This can be reverted when ObjectProxy works
showBusyCursor = false;
}
//--------------------------------------------------------------------------
//
// Variables
//
//--------------------------------------------------------------------------
private var _concurrency:String;
private var _endpoint:String;
private var _source:String;
private var _makeObjectsBindable:Boolean;
private var _showBusyCursor:Boolean;
//--------------------------------------------------------------------------
//
// Properties
//
//--------------------------------------------------------------------------
[Inspectable(enumeration="multiple,single,last", defaultValue="multiple", category="General")]
/**
* Value that indicates how to handle multiple calls to the same service. The default
* value is multiple. The following values are permitted:
* <ul>
* <li>multiple - Existing requests are not cancelled, and the developer is
* responsible for ensuring the consistency of returned data by carefully
* managing the event stream. This is the default.</li>
* <li>single - Making only one request at a time is allowed on the method; additional requests made
* while a request is outstanding are immediately faulted on the client and are not sent to the server.</li>
* <li>last - Making a request causes the client to ignore a result or fault for any current outstanding request.
* Only the result or fault for the most recent request will be dispatched on the client.
* This may simplify event handling in the client application, but care should be taken to only use
* this mode when results or faults for requests may be safely ignored.</li>
* </ul>
*
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
* @productversion Flex 3
*/
public function get concurrency():String
{
return _concurrency;
}
/**
* @private
*/
public function set concurrency(c:String):void
{
_concurrency = c;
}
//----------------------------------
// endpoint
//----------------------------------
[Inspectable(category="General")]
/**
* This property allows the developer to quickly specify an endpoint for a RemoteObject
* destination without referring to a services configuration file at compile time or programmatically creating
* a ChannelSet. It also overrides an existing ChannelSet if one has been set for the RemoteObject service.
*
* <p>If the endpoint url starts with "https" a SecureAMFChannel will be used, otherwise an AMFChannel will
* be used. Two special tokens, {server.name} and {server.port}, can be used in the endpoint url to specify
* that the channel should use the server name and port that was used to load the SWF. </p>
*
* <p><b>Note:</b> This property is required when creating AIR applications.</p>
*
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
* @productversion Flex 3
*/
public function get endpoint():String
{
return _endpoint;
}
public function set endpoint(url:String):void
{
// If endpoint has changed, null out channelSet to force it
// to be re-initialized on the next Operation send
if (_endpoint != url || url == null)
{
_endpoint = url;
channelSet = null;
}
}
//----------------------------------
// makeObjectsBindable
//----------------------------------
[Inspectable(category="General", defaultValue="true")]
/**
* When this value is true, anonymous objects returned are forced to bindable objects.
*
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
* @productversion Flex 3
*/
public function get makeObjectsBindable():Boolean
{
return _makeObjectsBindable;
}
public function set makeObjectsBindable(b:Boolean):void
{
_makeObjectsBindable = b;
}
//----------------------------------
// showBusyCursor
//----------------------------------
[Inspectable(defaultValue="false", category="General")]
/**
* If <code>true</code>, a busy cursor is displayed while a service is executing. The default
* value is <code>false</code>.
*
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
* @productversion Flex 3
*/
public function get showBusyCursor():Boolean
{
return _showBusyCursor;
}
public function set showBusyCursor(sbc:Boolean):void
{
_showBusyCursor = sbc;
}
//----------------------------------
// source
//----------------------------------
[Inspectable(category="General")]
/**
* Lets you specify a source value on the client; not supported for destinations that use the JavaAdapter. This allows you to provide more than one source
* that can be accessed from a single destination on the server.
*
*
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
* @productversion Flex 3
*/
public function get source():String
{
return _source;
}
public function set source(s:String):void
{
_source = s;
}
/**
* An optional function, primarily intended for framework developers who need to install
* a function to get called with the parameters passed to each remote object invocation.
* The function takes an array of parameters and returns the potentially altered array.
*
* The function definition should look like:
* <code>
* function myParametersFunction(parameters:Array):Array
* </code>
*
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
* @productversion Flex 3
*
* @royalesuppresspublicvarwarning
*/
public var convertParametersHandler:Function;
/**
* An optional function, primarily intended for framework developers who need to install
* a hook to process the results of an operation before notifying the result handlers.
*
* The function definition should look like:
* <code>
* function myConvertResultsFunction(result:*, operation:AbstractOperation):*
* </code>
*
* It is passed the result just after the makeObjectsBindable conversion has been done
* but before the result event is created.
*
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
* @productversion Flex 3
*
* @royalesuppresspublicvarwarning
*/
public var convertResultHandler:Function;
//-------------------------------------------------------------------------
//
// Internal Methods
//
//-------------------------------------------------------------------------
/**
*@private
*/
mx_internal function initEndpoint():void
{
if (endpoint != null)
{
var chan:Channel;
if (endpoint.indexOf("https") == 0)
{
chan = new SecureAMFChannel(null, endpoint);
}
else
{
chan = new AMFChannel(null, endpoint);
}
// Propagate requestTimeout.
chan.requestTimeout = requestTimeout;
channelSet = new ChannelSet();
channelSet.addChannel(chan);
}
}
//--------------------------------------------------------------------------
//
// Methods
//
//--------------------------------------------------------------------------
/**
* Returns an Operation of the given name. If the Operation wasn't
* created beforehand, a new <code>mx.rpc.remoting.Operation</code> is
* created during this call. Operations are usually accessible by simply
* naming them after the service variable
* (<code>myService.someOperation</code>), but if your Operation name
* happens to match a defined method on the service
* (like <code>setCredentials</code>), you can use this method to get the
* Operation instead.
* @param name Name of the Operation.
* @return Operation that executes for this name.
*
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
* @productversion Flex 3
*/
override public function getOperation(name:String):AbstractOperation
{
var op:AbstractOperation = super.getOperation(name);
if (op == null)
{
op = new Operation(this, name);
_operations[name] = op;
op.asyncRequest = asyncRequest;
op.setKeepLastResultIfNotSet(_keepLastResult);
}
return op;
}
/**
* If a remote object is managed by an external service, such a ColdFusion Component (CFC),
* a username and password can be set for the authentication mechanism of that remote service.
*
* @param remoteUsername the username to pass to the remote endpoint
* @param remotePassword the password to pass to the remote endpoint
* @param charset The character set encoding to use while encoding the
* remote credentials. The default is null, which implies the legacy charset
* of ISO-Latin-1. The only other supported charset is "UTF-8".
*
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
* @productversion Flex 3
*/
override public function setRemoteCredentials(remoteUsername:String, remotePassword:String, charset:String=null):void
{
super.setRemoteCredentials(remoteUsername, remotePassword, charset);
}
/**
* Represents an instance of RemoteObject as a String, describing
* important properties such as the destination id and the set of
* channels assigned.
*
* @return Returns a String representing an instance of a RemoteObject.
*
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
* @productversion Flex 3
*/
COMPILE::JS {override}
public function toString():String
{
var s:String = "[RemoteObject ";
s += " destination=\"" + destination + "\"";
if (source)
s += " source=\"" + source + "\"";
s += " channelSet=\"" + channelSet + "\"]";
return s;
}
}
}
|
package format.swf.data.actions.swf5
{
import format.swf.data.actions.*;
class ActionNewMethod extends Action implements IAction
{
public static inline var CODE:Int = 0x53;
public function ActionNewMethod(code:Int, length:Int, pos:Int) {
super(code, length, pos);
}
override public function toString(indent:Int = 0):String {
return "[ActionNewMethod]";
}
}
}
|
//
// $Id$
package com.threerings.msoy.world.client {
import flash.display.Sprite;
import mx.core.UIComponent;
import com.threerings.crowd.client.LocationAdapter;
import com.threerings.display.DisplayUtil;
import com.threerings.flex.FlexWrapper;
import com.threerings.msoy.client.MsoyClient;
import com.threerings.msoy.data.Address;
import com.threerings.msoy.data.Page;
import com.threerings.msoy.item.data.all.MsoyItemType;
import com.threerings.msoy.room.client.RoomView;
import com.threerings.msoy.tutorial.client.TutorialItemBuilder;
import com.threerings.msoy.tutorial.client.TutorialSequenceBuilder;
public class DjTutorial
{
public function DjTutorial (ctx :WorldContext)
{
_ctx = ctx;
var originalHome :int = ctx.getMemberObject().homeSceneId;
_locObserver = new LocationAdapter(null, function (..._) :void {
if (_ctx.getWorldController().getCurrentSceneId() != originalHome) {
_ctx.getTutorialDirector().dismiss();
_ctx.getLocationDirector().removeLocationObserver(_locObserver);
}
});
_ctx.getLocationDirector().addLocationObserver(_locObserver);
var tutorialName :String = "djTutorial";
var seq :TutorialSequenceBuilder = _ctx.getTutorialDirector().newSequence(tutorialName)
.showAlways();
// Step 0
step(seq.newSuggestion("Hello, welcome to my night club! Ok, it's not much to look at... yet."))
.button("Next", null)
.queue();
// Step 1
waitForPage(seq.newSuggestion("Help a tofu out, would you? I need someone with fine" +
" musical taste to pick out a song over in the shop."), Page.SHOP)
.onShow(function () :void {
// Show the arrow while no tabs are open
arrowUp(-512, 0, function (address :Address) :Boolean { return address == null });
})
.queue();
// Step 2
waitForPage(seq.newSuggestion("The shop is stuffed with all sorts of useful goodies. Click" +
" on the music section to look for songs."), Page.SHOP, MsoyItemType.AUDIO.toByte())
.onShow(function () :void {
arrowRight(-0.01, 123, function (address :Address) :Boolean {
return address.page == Page.SHOP && address.args.length == 0 });
})
.queue();
// Step 3
waitForPage(seq.newSuggestion(
"If you've got a song or genre in mind, you can search for it. Or just pick whatever" +
" catches your eye. You can keep it afterwards!"),
Page.SHOP, "l", MsoyItemType.AUDIO.toByte())
.queue();
// Step 4
waitForCondition(seq.newSuggestion("This one? I can't say it would have been my first" +
" choice, but it's catchy... Once you've decided, buy it then add it to the room."),
function () :Boolean {
return !_ctx.getMemberObject().tracks.isEmpty();
})
.queue();
// Step 5
waitForCondition(seq.newSuggestion("Not bad! That livens this place up a bit." +
" You can press the X button on the very right to close the shop now."),
function () :Boolean {
return _ctx.getMsoyClient().getAddress() == null;
})
.onShow(clearArrows)
.queue();
// TODO(bruno): Explain the music widget?
// Step 6
step(seq.newSuggestion("Maybe you can own your own club one day... try exploring," +
" DJ-ing with other people and building your reputation. Off you go!"))
.onShow(function () :void {
// Tutorial complete, open the blast doors
_ctx.getWorldDirector().completeDjTutorial();
var obs :LocationAdapter = new LocationAdapter(null, function (..._) :void {
_ctx.getWorldController().trackEvent("tutorial", tutorialName + ":7");
_ctx.getLocationDirector().removeLocationObserver(obs);
});
_ctx.getLocationDirector().addLocationObserver(obs);
})
.queue();
seq.activate();
}
protected function arrow (x :Number, y :Number, showIf :Function, displayClass :Class) :void
{
if (_arrow == null) {
var sprite :Sprite = new Sprite();
sprite.graphics.beginFill(0xff0000);
sprite.graphics.drawCircle(0, 0, 50);
_arrow = new FlexWrapper(sprite);
_ctx.getTopPanel().addChild(_arrow);
_ctx.getClient().addEventListener(MsoyClient.GWT_PAGE_CHANGED, invalidateArrow);
}
_arrowStates.push(new ArrowState(x, y, showIf, displayClass));
invalidateArrow();
}
protected function arrowUp (x :Number, y :Number, showIf :Function = null) :void
{
arrow(x, y, showIf, ARROW_UP);
}
protected function arrowRight (x :Number, y :Number, showIf :Function = null) :void
{
arrow(x, y, showIf, ARROW_RIGHT);
}
protected function invalidateArrow (_:*=null) :void
{
if (_arrow == null) {
return;
}
var address :Address = _ctx.getMsoyClient().getAddress();
var visible :Boolean = false;
for each (var state :ArrowState in _arrowStates) {
if (state.showIf == null || state.showIf(address)) {
_arrow.setStyle(state.pos.x < 0 ? "right" : "left", Math.abs(state.pos.x));
_arrow.setStyle(state.pos.y < 0 ? "bottom" : "top", Math.abs(state.pos.y));
DisplayUtil.removeAllChildren(_arrow);
_arrow.addChild(new state.displayClass());
visible = true;
break;
}
}
_arrow.visible = visible;
}
protected function clearArrows () :void
{
if (_arrow == null) {
return;
}
_arrowStates.length = 0;
_ctx.getClient().removeEventListener(MsoyClient.GWT_PAGE_CHANGED, invalidateArrow);
DisplayUtil.detach(_arrow);
_arrow = null;
}
protected function waitForPage (
item :TutorialItemBuilder, page :Page, ...args) :TutorialItemBuilder
{
return step(item)
.limit(function () :Boolean {
var address :Address = _ctx.getMsoyClient().getAddress();
if (address == null && page == null) {
return false;
}
if (address != null && address.page == page) {
if (address.args.length < args.length) {
return true;
}
for (var ii :int = 0; ii < args.length; ++ii) {
if (address.args[ii] != args[ii]) {
return true;
}
}
return false;
}
return true;
});
}
protected function waitForCondition (
item :TutorialItemBuilder, cond :Function) :TutorialItemBuilder
{
return step(item)
.limit(function () :Boolean { return !cond() });
}
protected function step (item :TutorialItemBuilder) :TutorialItemBuilder
{
var action :String = item.getId();
return item
.onShow(function () :void {
_ctx.getWorldController().trackEvent("tutorial", action);
})
.buttonCloses(true);
}
[Embed(source="../../../../../../../rsrc/media/arrows.swf", symbol="arrow_up")]
protected static const ARROW_UP :Class;
[Embed(source="../../../../../../../rsrc/media/arrows.swf", symbol="arrow_right")]
protected static const ARROW_RIGHT :Class;
protected var _ctx :WorldContext;
protected var _locObserver :LocationAdapter;
protected var _arrow :UIComponent;
protected var _arrowStates :Array = []; // of ArrowState
}
}
import flash.geom.Point;
class ArrowState
{
public var pos :Point;
public var showIf :Function;
public var displayClass :Class;
public function ArrowState (x :Number, y :Number, showIf :Function, displayClass :Class)
{
this.pos = new Point(x, y);
this.showIf = showIf;
this.displayClass = displayClass;
}
}
|
/*
Copyright (c) 2008, Adobe Systems Incorporated
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of Adobe Systems Incorporated nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.adobe.serialization.json {
/**
*
*
*/
public class JSONParseError extends Error {
/** The location in the string where the error occurred */
private var _location:int;
/** The string in which the parse error occurred */
private var _text:String;
/**
* Constructs a new JSONParseError.
*
* @param message The error message that occured during parsing
* @langversion ActionScript 3.0
* @playerversion Flash 9.0
* @tiptext
*/
public function JSONParseError( message:String = "", location:int = 0, text:String = "") {
super( message );
name = "JSONParseError";
_location = location;
_text = text;
}
/**
* Provides read-only access to the location variable.
*
* @return The location in the string where the error occurred
* @langversion ActionScript 3.0
* @playerversion Flash 9.0
* @tiptext
*/
public function get location():int {
return _location;
}
/**
* Provides read-only access to the text variable.
*
* @return The string in which the error occurred
* @langversion ActionScript 3.0
* @playerversion Flash 9.0
* @tiptext
*/
public function get text():String {
return _text;
}
}
} |
package it.gotoandplay.smartfoxserver.http
{
import flash.events.Event;
import flash.events.EventDispatcher;
import flash.events.IOErrorEvent;
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.net.URLRequestMethod;
import flash.net.URLVariables;
public class HttpConnection extends EventDispatcher
{
private static const HANDSHAKE:String = "connect";
private static const DISCONNECT:String = "disconnect";
private static const CONN_LOST:String = "ERR#01";
public static const HANDSHAKE_TOKEN:String = "#";
private static const servletUrl:String = "BlueBox/HttpBox.do";
private static const paramName:String = "sfsHttp";
private var sessionId:String;
private var connected:Boolean = false;
private var ipAddr:String;
private var port:int;
private var webUrl:String;
private var urlLoaderFactory:LoaderFactory;
private var urlRequest:URLRequest;
private var codec:IHttpProtocolCodec;
public function HttpConnection()
{
super();
this.codec = new RawProtocolCodec();
this.urlLoaderFactory = new LoaderFactory(this.handleResponse,this.handleIOError);
}
public function getSessionId() : String
{
return this.sessionId;
}
public function isConnected() : Boolean
{
return this.connected;
}
public function connect(param1:String, param2:int = 8080) : void
{
this.ipAddr = param1;
this.port = param2;
this.webUrl = "http://" + this.ipAddr + ":" + this.port + "/" + servletUrl;
this.sessionId = null;
this.urlRequest = new URLRequest(this.webUrl);
this.urlRequest.method = URLRequestMethod.POST;
this.send(HANDSHAKE);
}
public function close() : void
{
this.send(DISCONNECT);
}
public function send(param1:String) : void
{
var _loc2_:URLVariables = null;
var _loc3_:URLLoader = null;
if(this.connected || !this.connected && param1 == HANDSHAKE || !this.connected && param1 == "poll")
{
_loc2_ = new URLVariables();
_loc2_[paramName] = this.codec.encode(this.sessionId,param1);
this.urlRequest.data = _loc2_;
if(param1 != "poll")
{
trace("[ Send ]: " + this.urlRequest.data);
}
_loc3_ = this.urlLoaderFactory.getLoader();
_loc3_.data = _loc2_;
_loc3_.load(this.urlRequest);
}
}
private function handleResponse(param1:Event) : void
{
var _loc4_:HttpEvent = null;
var _loc2_:URLLoader = param1.target as URLLoader;
var _loc3_:String = _loc2_.data as String;
var _loc5_:Object = {};
if(_loc3_.charAt(0) == HANDSHAKE_TOKEN)
{
if(this.sessionId == null)
{
this.sessionId = this.codec.decode(_loc3_);
this.connected = true;
_loc5_.sessionId = this.sessionId;
_loc5_.success = true;
_loc4_ = new HttpEvent(HttpEvent.onHttpConnect,_loc5_);
dispatchEvent(_loc4_);
}
else
{
trace("**ERROR** SessionId is being rewritten");
}
}
else
{
if(_loc3_.indexOf(CONN_LOST) == 0)
{
_loc5_.data = {};
_loc4_ = new HttpEvent(HttpEvent.onHttpClose,_loc5_);
}
else
{
_loc5_.data = _loc3_;
_loc4_ = new HttpEvent(HttpEvent.onHttpData,_loc5_);
}
dispatchEvent(_loc4_);
}
}
private function handleIOError(param1:IOErrorEvent) : void
{
var _loc2_:Object = {};
_loc2_.message = param1.text;
var _loc3_:HttpEvent = new HttpEvent(HttpEvent.onHttpError,_loc2_);
dispatchEvent(_loc3_);
}
}
}
|
////////////////////////////////////////////////////////////////////////////////
//
// 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.controls.menuClasses
{
import org.apache.royale.core.IBorderPaddingMarginValuesImpl;
import org.apache.royale.core.ValuesManager;
import org.apache.royale.core.layout.EdgeData;
import org.apache.royale.html.supportClasses.StringItemRenderer;
/**
* The ListItemRenderer is the default renderer for mx.controls.List
*
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
* @productversion Flex 3
*/
public class MenuBarItemRenderer extends StringItemRenderer
{
override public function set text(value:String):void
{
super.text = value;
COMPILE::SWF
{
var edge:EdgeData = (ValuesManager.valuesImpl as IBorderPaddingMarginValuesImpl).getPaddingMetrics(this);
var h:Number = textField.textHeight + edge.top + edge.bottom;
textField.autoSize = "none";
textField.height = h;
}
}
override protected function dataToString(value:Object):String
{
if (value is XML)
{
var xml:XML = value as XML;
return xml.attribute(labelField).toString();
}
return super.dataToString(value);
}
}
}
|
package flashexporter.data
{
import actionlib.common.events.EventSender;
import actionlib.common.query.from;
import flash.events.TimerEvent;
import flash.filesystem.File;
import flash.utils.Timer;
import flashexporter.abstracts.AppContext;
public class AppData extends AppContext
{
public static function getDescription(symbols:Object):String
{
var result:Array = [];
for each (var symbol:Symbol in symbols)
{
result.push(symbol.getDescription());
}
return result.join("\n---\n");
}
public var fileChangedEvent:EventSender = new EventSender(this);
[Bindable]
public var autoGenerateEnabled:Boolean = false;
[Bindable]
public var projectDir:File;
[Bindable]
public var generateTextures:Boolean = false;
[Bindable]
public var showStats:Boolean = false;
public var files:Vector.<Swf> = new <Swf>[];
public var symbols:Vector.<Symbol> = new <Symbol>[];
public var isProcessingFailed:Boolean;
public function AppData()
{
reset();
var timer:Timer = new Timer(1000);
timer.addEventListener(TimerEvent.TIMER, onTimer);
timer.start();
}
public function getSwfByPath(nativePath:String):Swf
{
for each (var swf:Swf in files)
{
if (swf.file.nativePath == nativePath)
return swf;
}
return null;
}
public function getChangedFiles():Vector.<Swf>
{
var result:Vector.<Swf> = new <Swf>[];
for each (var swf:Swf in files)
{
if (swf.isChanged)
result.push(swf);
}
return result;
}
public function getAllSymbols(fromFiles:Vector.<Swf>):Vector.<Symbol>
{
var result:Vector.<Symbol> = new <Symbol>[];
for each (var file:Swf in fromFiles)
{
result = result.concat(file.symbols);
}
return result;
}
public function reset():void
{
files = new <Swf>[];
symbols = new <Symbol>[];
}
private function onTimer(event:TimerEvent):void
{
if (!autoGenerateEnabled)
return;
if (getChangedFiles().length > 0)
fileChangedEvent.dispatch();
}
public function getFileByBundleName(bundleName:String):Swf
{
return from(appData.files)
.where(function(it:Swf):Boolean {
return it.bundleName == bundleName })
.findFirst();
}
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.