CombinedText stringlengths 4 3.42M |
|---|
////////////////////////////////////////////////////////////////////////////////
//
// Licensed to the Apache Software Foundation (ASF) under one or more
// contributor license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright ownership.
// The ASF licenses this file to You under the Apache License, Version 2.0
// (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////
package org.apache.royale.binding
{
import org.apache.royale.core.IBead;
import org.apache.royale.core.IStrand;
import org.apache.royale.core.IDocument;
import org.apache.royale.events.IEventDispatcher;
import org.apache.royale.events.Event;
import org.apache.royale.events.ValueChangeEvent;
import org.apache.royale.core.IBinding;
/**
* The SimpleBinding class is lightweight data-binding class that
* is optimized for simple assignments of one object's property to
* another object's property.
*
* @langversion 3.0
* @playerversion Flash 10.2
* @playerversion AIR 2.6
* @productversion Royale 0.0
*/
public class SimpleBinding implements IBead, IDocument, IBinding
{
/**
* Constructor.
*
* @langversion 3.0
* @playerversion Flash 10.2
* @playerversion AIR 2.6
* @productversion Royale 0.0
*/
public function SimpleBinding(isStatic:Boolean=false)
{
_isStatic = isStatic;
}
private var _isStatic:Boolean;
private var _destination:Object;
private var _sourceID:String;
private var _destinationPropertyName:String;
private var _sourcePropertyName:String;
/**
* The event dispatcher that dispatches an event
* when the source property changes. This can
* be different from the source (example: static bindables)
*
* @langversion 3.0
* @playerversion Flash 10.2
* @playerversion AIR 2.6
* @productversion Royale 0.0
*/
protected var dispatcher:IEventDispatcher;
/**
* The source object that dispatches an event
* when the property changes
*
* @langversion 3.0
* @playerversion Flash 10.2
* @playerversion AIR 2.6
* @productversion Royale 0.0
*/
protected var source:Object;
/**
* The host mxml document for the source and
* destination objects. The source object
* is either this document for simple bindings
* like {foo} where foo is a property on
* the mxml documnet, or found as document[sourceID]
* for simple bindings like {someid.someproperty}
* It may be the document class for local static
* bindables (e.g. from a script block)
*
* @langversion 3.0
* @playerversion Flash 10.2
* @playerversion AIR 2.6
* @productversion Royale 0.0
*/
protected var document:Object;
private var _eventName:String;
/**
* The event name that is dispatched when the source
* property changes.
*
* @langversion 3.0
* @playerversion Flash 10.2
* @playerversion AIR 2.6
* @productversion Royale 0.0
*/
public function get eventName():String
{
return _eventName;
}
public function set eventName(value:String):void
{
_eventName = value;
}
/**
* @copy org.apache.royale.core.IBinding#destination;
*
* @langversion 3.0
* @playerversion Flash 10.2
* @playerversion AIR 2.6
* @productversion Royale 0.0
*/
public function get destination():Object
{
return _destination;
}
public function set destination(value:Object):void
{
_destination = value;
}
/**
* @copy org.apache.royale.core.IBinding#sourceID
*
* @langversion 3.0
* @playerversion Flash 10.2
* @playerversion AIR 2.6
* @productversion Royale 0.0
*/
public function get sourceID():String
{
return _sourceID;
}
public function set sourceID(value:String):void
{
_sourceID = value;
}
/**
* @copy org.apache.royale.core.IBinding#destinationPropertyName
*
* @langversion 3.0
* @playerversion Flash 10.2
* @playerversion AIR 2.6
* @productversion Royale 0.0
*/
public function get destinationPropertyName():String
{
return _destinationPropertyName;
}
public function set destinationPropertyName(value:String):void
{
_destinationPropertyName = value;
}
/**
* @copy org.apache.royale.core.IBinding#sourcePropertyName
*
* @langversion 3.0
* @playerversion Flash 10.2
* @playerversion AIR 2.6
* @productversion Royale 0.0
*/
public function get sourcePropertyName():String
{
return _sourcePropertyName;
}
public function set sourcePropertyName(value:String):void
{
_sourcePropertyName = value;
}
/**
* @copy org.apache.royale.core.IBead#strand
*
* @langversion 3.0
* @playerversion Flash 10.2
* @playerversion AIR 2.6
* @productversion Royale 0.0
* @royaleignorecoercion org.apache.royale.events.IEventDispatcher
*/
public function set strand(value:IStrand):void
{
if (dispatcher) dispatcher.removeEventListener(eventName, changeHandler);
if (destination == null)
destination = value;
if (_isStatic) {
source = document;
dispatcher = source.staticEventDispatcher as IEventDispatcher;
} else {
if (sourceID != null)
{
source = dispatcher = document[sourceID] as IEventDispatcher;
if (source == null)
{
document.addEventListener("valueChange",
sourceChangeHandler);
return;
}
} else
source = dispatcher = document as IEventDispatcher;
}
dispatcher.addEventListener(eventName, changeHandler);
try
{
destination[destinationPropertyName] = source[sourcePropertyName];
}
catch (e:Error) {}
}
/**
* @copy org.apache.royale.core.IDocument#setDocument()
*
* @langversion 3.0
* @playerversion Flash 10.2
* @playerversion AIR 2.6
* @productversion Royale 0.0
*/
public function setDocument(document:Object, id:String = null):void
{
this.document = document;
}
/**
* @royaleignorecoercion org.apache.royale.events.ValueChangeEvent
*/
private function changeHandler(event:Event):void
{
if (event.type == ValueChangeEvent.VALUE_CHANGE)
{
var vce:ValueChangeEvent = event as ValueChangeEvent;
if (vce.propertyName != sourcePropertyName)
return;
}
destination[destinationPropertyName] = source[sourcePropertyName];
}
/**
* @royaleignorecoercion org.apache.royale.events.IEventDispatcher
*/
private function sourceChangeHandler(event:ValueChangeEvent):void
{
if (event.propertyName != sourceID)
return;
if (dispatcher)
dispatcher.removeEventListener(eventName, changeHandler);
source = dispatcher = document[sourceID] as IEventDispatcher;
if (source)
{
dispatcher.addEventListener(eventName, changeHandler);
destination[destinationPropertyName] = source[sourcePropertyName];
}
}
}
}
|
/**
* VERSION: 0.9991
* DATE: 9/22/2009
* AS3
* UPDATES AND DOCUMENTATION AT: http://blog.greensock.com/liquidstage/
**/
package com.greensock.layout {
import com.greensock.TweenLite;
import flash.display.*;
import flash.events.Event;
import flash.events.EventDispatcher;
import flash.geom.Point;
import flash.text.TextField;
/**
* LiquidStage allows you to "pin" DisplayObjects to reference points on the stage or in other DisplayObjects so that when the stage is resized,
* the DisplayObjects are repositioned and stay exactly the same distance from the reference point(s) they're registered to. It also allows you to
* define another pin point horizontally and/or vertically which will change the width/height of the DisplayObject when the stage is resized, stretching
* it visually. For example, maybe you want a logo Sprite to always maintain a particular distance from the bottom right corner. Or maybe you'd like a bar to snap to
* the bottom of the screen and stretch horizontally to fill the bottom of the stage. <br /><br />
*
* LiquidStage is <b>NOT</b> a layout manager. It just takes your original layout, remembers how far your pinned DisplayObjects are from their respective pins,
* and alters the x/y coordinates when the stage resizes (and their width/height if you use the LiquidStage.stretchObject() method) so that they
* maintain their relative distance regardless of nesting. It sounds pretty simple, but there are some handy features like:
* <ul>
* <li> Your DisplayObjects do not need to be at the root level - LiquidStage will compensate for nesting even if the DisplayObject's
* anscestors are offset (not at the 0,0 position). </li>
* <li> Repositioning/Resizing values are relative so if you pin an object and then move it, LiquidStage will honor that new position.</li>
* <li> Not only can you pin things to the TOP_LEFT, TOP_CENTER, TOP_RIGHT, RIGHT_CENTER, BOTTOM_RIGHT, BOTTOM_CENTER, BOTTOM_LEFT, LEFT_CENTER,
* and CENTER, but you can create your own custom PinPoints in any DisplayObject. </li>
* <li> LiquidStage leverages the TweenLite engine to allow for animated transitions. You can define the duration of the transition and
* the easing equation for each DisplayObject individually.</li>
* <li> If there are any TweenLite/Max instances that are tweening the x/y coordinates of an object, LiquidStage will
* seamlessly integrate itself with the existing tween(s) by updating their end values on the fly.</li>
* <li> x and y coordinates are always snapped to whole pixel values, so you don't need to worry about mushy text or distorted images.</li>
* <li> LiquidStage does NOT force you to align the stage to the upper left corner - it will honor whatever StageAlign you choose.</li>
* <li> Optionally define a minimum/maximum width/height to prevent objects from repositioning when the stage gets too small.</li>
* <li> LiquidStage only does its work when the stage resizes, so it's not constantly draining CPU cycles and hurting performance.</li>
* </ul>
*
*
* <b>EXAMPLES:</b><br />
* To make the logo_mc Sprite pin itself to the bottom right corner of your SWF that's built to a 550x400 dimension, you'd do:<br /><br /><code>
*
* import com.greensock.layout.LiquidStage;<br /><br />
*
* LiquidStage.init(this.stage, 550, 400);<br />
* LiquidStage.pinObject(logo_mc, LiquidStage.BOTTOM_RIGHT);<br /><br /></code>
*
* To pin the logo_mc as mentioned above and make the bottomBar_mc Sprite pin itself to both the bottom left and bottom right corners
* so that it stretches as the window resizes in a SWF that's built to a 550x400 dimension, and set the minimum width and height to
* that base size (550x400) so that it cannot collapse to a smaller size than that, and animate the transition over the course of
* 1.5 seconds with an <code>Elastic.easeOut</code> ease, do:<br /><br /><code>
*
* import com.greensock.layout.LiquidStage;<br />
* import com.greensock.easing.Elastic;<br />
* import flash.display.StageAlign;<br /><br />
*
* this.stage.align = StageAlign.TOP_LEFT;<br />
* LiquidStage.init(this.stage, 550, 400, 550, 400);<br />
* LiquidStage.pinObject(logo_mc, LiquidStage.BOTTOM_RIGHT);<br />
* LiquidStage.stretchObject(bottomBar_mc, LiquidStage.BOTTOM_LEFT, LiquidStage.BOTTOM_RIGHT, null, true, 1.5, Elastic.easeOut);<br /><br /></code>
*
* To create a custom PinPoint in the "videoDisplay" Sprite and pin the "videoControls" to that custom point so that videoControls
* always maintains the same distance from its registration point to the PinPoint inside videoDisplay, you'd do:<br /><br /><code>
*
* import com.greensock.layout.LiquidStage;<br />
* import com.greensock.layout.PinPoint;<br /><br />
*
* LiquidStage.init(this.stage, 550, 400);<br />
* var myCustomPinPoint:PinPoint = new PinPoint(100, 200, videoDisplay);<br />
* LiquidStage.pinObject(videoControls, myCustomPinPoint);<br /><br /></code>
*
*
* <b>NOTES:</b>
* <ul>
* <li> This class will add about 5k to your SWF + 4.2k from TweenLite for a total of roughly 9k.</li>
* <li> When testing in the Flash IDE, please be aware of the fact that there is a BUG in Flash that can cause it to incorrectly
* report the height of the SWF as 100 pixels LESS than what it should be, but this ONLY affects testing in the IDE. When
* you test the same SWF in a browser or in the standalone projector, it will render correctly.</li>
* <li> You need to set up your objects on the stage initially with the desired relative distance between them; LiquidStage doesn't
* completely reposition them initially. For example, if you want a bar that spans the width of the stage, but you set it up
* on the stage so that there are 20 pixels on each side of it and then do LiquidStage.stretchObject(), it'll always have 20 pixels
* on each side of it.</li>
* <li> If a DisplayObject is not in the display list (has no parent), LiquidStage will ignore it until it is back in the display list.</li>
* </ul>
*
* <b>Copyright 2009, GreenSock. All rights reserved.</b> This work is subject to the license that came with your Club GreenSock membership and is <b>ONLY</b> to be used by corporate or "Shockingly Green" Club GreenSock members. To learn more about Club GreenSock, visit <a href="http://blog.greensock.com/club/">http://blog.greensock.com/club/</a>.
*
* @author Jack Doyle, jack@greensock.com
*/
public class LiquidStage {
/** @private **/
public static const VERSION:Number = 0.9991;
/** @private **/
private static var _stageBox:Sprite = new Sprite();
public static var TOP_LEFT:PinPoint = new PinPoint(0, 0, _stageBox);
public static var TOP_CENTER:PinPoint = new PinPoint(0, 0, _stageBox);
public static var TOP_RIGHT:PinPoint = new PinPoint(0, 0, _stageBox);
public static var BOTTOM_LEFT:PinPoint = new PinPoint(0, 0, _stageBox);
public static var BOTTOM_CENTER:PinPoint = new PinPoint(0, 0, _stageBox);
public static var BOTTOM_RIGHT:PinPoint = new PinPoint(0, 0, _stageBox);
public static var LEFT_CENTER:PinPoint = new PinPoint(0, 0, _stageBox);
public static var RIGHT_CENTER:PinPoint = new PinPoint(0, 0, _stageBox);
public static var CENTER:PinPoint = new PinPoint(0, 0, _stageBox);
public static var NONE:PinPoint = new PinPoint(0, 0, _stageBox); //To avoid errors where parameters require a Point and Flash won't allow simply null.
/** @private **/
private static var _points:Object = {}; //contains a property for each point (topLeft, bottomRight, etc.), each having current, previous, and base properties indicating the offsets from the stage registration point.
/** @private **/
private static var _dispatcher:EventDispatcher = new EventDispatcher();
/** @private **/
private static var _pending:Array = [];
/** @private **/
private static var _initted:Boolean;
/** @private **/
private static var _items:Array = [];
/** @private **/
private static var _updateables:Array = [];
/** @private **/
private static var _xStageAlign:uint; //0 = left, 1 = center, 2 = right
/** @private **/
private static var _yStageAlign:uint; //0 = top, 1 = center, 2 = bottom
/** @private **/
private static var _hasListener:Boolean; //to improve performance, don't dispatch events unless addEventListener() has been called.
/** Minimum width of the LiquidStage area **/
public static var minWidth:uint;
/** Minimum height of the LiquidStage area **/
public static var minHeight:uint;
/** Maximum width of the LiquidStage area **/
public static var maxWidth:uint;
/** Maximum height of the LiquidStage area **/
public static var maxHeight:uint;
/** Reference to the stage to which LiquidStage is applied **/
public static var stage:Stage;
/**
* Initializes LiquidStage - must be run once BEFORE any objects are pinned/stretched to LiquidStage.
*
* @param stage The Stage to which LiquidStage is applied
* @param baseWidth The width of the SWF as it was built in the IDE (NOT the width that it is stretched to in the browser or standalone player).
* @param baseHeight The height of the SWF as it was built in the IDE (NOT the height that it is stretched to in the browser or standalone player).
* @param minWidth Minimum width (if you never want the width of LiquidStage to go below a certain amount, use minWidth).
* @param minHeight Minimum height (if you never want the height of LiquidStage to go below a certain amount, use minHeight).
* @param maxWidth Maximum width (if you never want the width of LiquidStage to exceed a certain amount, use maxWidth).
* @param maxHeight Maximum height (if you never want the height of LiquidStage to exceed a certain amount, use maxHeight).
*/
public static function init(stage:Stage, baseWidth:uint, baseHeight:uint, minWidth:uint=0, minHeight:uint=0, maxWidth:uint=99999999, maxHeight:uint=99999999):void {
if (!_initted && stage != null) {
if (TweenLite.version < 11.0999) {
trace("ERROR: Please update your TweenLite class to at least version 11.09.");
}
LiquidStage.stage = stage;
LiquidStage.minWidth = minWidth;
LiquidStage.minHeight = minHeight;
LiquidStage.maxWidth = maxWidth;
LiquidStage.maxHeight = maxHeight;
_stageBox.graphics.beginFill(0x0000FF, 0.5);
_stageBox.graphics.drawRect(0, 0, baseWidth, baseHeight);
_stageBox.graphics.endFill();
_stageBox.name = "__stageBox_mc";
_stageBox.visible = false;
TOP_CENTER.init(baseWidth / 2, 0);
TOP_RIGHT.init(baseWidth, 0);
RIGHT_CENTER.init(baseWidth, baseHeight / 2);
BOTTOM_RIGHT.init(baseWidth, baseHeight);
BOTTOM_CENTER.init(baseWidth / 2, baseHeight);
BOTTOM_LEFT.init(0, baseHeight);
LEFT_CENTER.init(0, baseHeight / 2);
CENTER.init(baseWidth / 2, baseHeight / 2);
_updateables = [TOP_LEFT, TOP_CENTER, TOP_RIGHT, RIGHT_CENTER, BOTTOM_RIGHT, BOTTOM_CENTER, BOTTOM_LEFT, LEFT_CENTER, CENTER].concat(_updateables);
LiquidStage.stage.addEventListener(Event.RESIZE, update, false, 0, true);
LiquidStage.stage.scaleMode = StageScaleMode.NO_SCALE;
switch (LiquidStage.stage.align) {
case StageAlign.TOP_LEFT:
_xStageAlign = 0;
_yStageAlign = 0;
break;
case "":
_xStageAlign = 1;
_yStageAlign = 1;
break;
case StageAlign.TOP:
_xStageAlign = 1;
_yStageAlign = 0;
break;
case StageAlign.BOTTOM:
_xStageAlign = 1;
_yStageAlign = 2;
break;
case StageAlign.BOTTOM_LEFT:
_xStageAlign = 0;
_yStageAlign = 2;
break;
case StageAlign.BOTTOM_RIGHT:
_xStageAlign = 2;
_yStageAlign = 2;
break;
case StageAlign.LEFT:
_xStageAlign = 0;
_yStageAlign = 1;
break;
case StageAlign.RIGHT:
_xStageAlign = 2;
_yStageAlign = 1;
break;
case StageAlign.TOP_RIGHT:
_xStageAlign = 2;
_yStageAlign = 0;
break;
}
stage.invalidate();
stage.addEventListener(Event.RENDER, onFirstRender);
}
}
private static function onFirstRender(e:Event):void {
stage.removeEventListener(Event.RENDER, onFirstRender);
_initted = true;
var o:Object;
var i:int = _pending.length;
while (i--) {
o = _pending[i];
addObject(o.object, o.primaryPoint, o.xStretchPoint, o.yStretchPoint, o.accordingToBase, o.duration, o.ease);
_pending.splice(i, 1);
}
refreshLevels();
_dispatcher.dispatchEvent(new Event(Event.INIT));
}
/**
* Creates a custom PinPoint (other than TOP_LEFT, TOP_CENTER, etc.) to which you can pin objects.
*
* @param x x-coordinate of the PinPoint
* @param y y-coordinate of the PinPoint
* @param parent The DisplayObject whose coordinate space was used to define the x/y position of the PinPoint. By default, the stage's coordinate system is used (based on the original size that it was built at in the IDE)
* @return PinPoint
*/
public static function createPinPoint(x:Number, y:Number, parent:DisplayObject=null):PinPoint {
return new PinPoint(x, y, parent || _stageBox);
}
/**
* Same as pinObject(), but allows multiple objects to be pinned at once.
*
* @param objects An Array of objects to be pinned
* @param point The PinPoint to which the objects should be pinned.
* @param accordingToBase If true, the PinPoint coordinates will be interpreted according to the original (unscaled) SWF size as it was built in the IDE. Otherwise, the coordinates will be interpreted according to the current stage size, whatever it happens to be at the time this method is called. In most situations, accordingToBase should be true.
* @param duration Normally, objects move to their new positions/sizes immediately, but if you prefer that they tween to the new position, simply define the duration of the tween here (in seconds).
* @param ease If duration is non-zero, objects will tween to their new position/size and the <code>ease</code> parameter allows you to define the easing equation that will be used for the TweenLite tween (for example, <code>Strong.easeOut</code> or <code>Elastic.easeOut</code>)
*/
public static function pinObjects(objects:Array, point:PinPoint, accordingToBase:Boolean=true, duration:Number=0, ease:Function=null):void {
for (var i:uint = 0; i < objects.length; i++) {
addObject(objects[i], point, null, null, accordingToBase, duration, ease);
}
}
/**
* Pins a DisplayObject to a particular point on the stage, relative to the overall size of the stage. As the stage
* is resized, that point may move and LiquidStage will move the object with that point. If you need the object to
* change its width and/or height as well, use the <code>stretchObject()</code> method instead.
*
* @param object The DisplayObject to be pinned.
* @param point The PinPoint to which the object should be pinned.
* @param accordingToBase If true, the PinPoint coordinates will be interpreted according to the original (unscaled) SWF size as it was built in the IDE. Otherwise, the coordinates will be interpreted according to the current stage size, whatever it happens to be at the time this method is called. In most situations, accordingToBase should be true.
* @param duration Normally, objects move to their new positions/sizes immediately, but if you prefer that they tween to the new position, simply define the duration of the tween here (in seconds).
* @param ease If duration is non-zero, objects will tween to their new position/size and the <code>ease</code> parameter allows you to define the easing equation that will be used for the TweenLite tween (for example, <code>Strong.easeOut</code> or <code>Elastic.easeOut</code>)
*/
public static function pinObject(object:DisplayObject, point:PinPoint=null, accordingToBase:Boolean=true, duration:Number=0, ease:Function=null):void {
addObject(object, point, null, null, accordingToBase, duration, ease);
}
/**
* Provides a way to pin an object to multiple points which will cause it to be stretched/squished as the stage
* resizes (altering its width/height properties). You <b>EITHER</b> use pinObject() <b>OR</b> stretchObject() on
* a particular DisplayObject, not both.
*
* @param object The DisplayObject to be pinned.
* @param primaryPoint The primary PinPoint to which the object should be pinned (often LiquidStage.TOP_LEFT)
* @param xStretchPoint The PinPoint that defines the stretching point on the x-axis. The object's width property will be altered based on the change in distance between the primaryPoint and the xStretchPoint (often LiquidStage.TOP_RIGHT).
* @param yStretchPoint The PinPoint that defines the stretching point on the y-axis. The object's height property will be altered based on the change in distance between the primaryPoint and the yStretchPoint (often LiquidStage.BOTTOM_LEFT).
* @param accordingToBase If true, the PinPoint coordinates will be interpreted according to the original (unscaled) SWF size as it was built in the IDE. Otherwise, the coordinates will be interpreted according to the current stage size, whatever it happens to be at the time this method is called. In most situations, accordingToBase should be true.
* @param duration Normally, objects move to their new positions/sizes immediately, but if you prefer that they tween to the new position, simply define the duration of the tween here (in seconds).
* @param ease If duration is non-zero, objects will tween to their new position/size and the <code>ease</code> parameter allows you to define the easing equation that will be used for the TweenLite tween (for example, <code>Strong.easeOut</code> or <code>Elastic.easeOut</code>)
*/
public static function stretchObject(object:DisplayObject, primaryPoint:PinPoint=null, xStretchPoint:PinPoint=null, yStretchPoint:PinPoint=null, accordingToBase:Boolean=true, duration:Number=0, ease:Function=null):void {
addObject(object, primaryPoint, xStretchPoint, yStretchPoint, accordingToBase, duration, ease);
}
/** @private **/
private static function addObject(object:DisplayObject, primaryPoint:PinPoint, xStretchPoint:PinPoint, yStretchPoint:PinPoint, accordingToBase:Boolean=true, duration:Number=0, ease:Function=null):void {
if (primaryPoint == null) {
primaryPoint = LiquidStage.NONE;
}
if (xStretchPoint == null) {
xStretchPoint = LiquidStage.NONE;
}
if (yStretchPoint == null) {
yStretchPoint = LiquidStage.NONE;
}
if (_initted) {
var item:LiquidItem = findObject(object);
if (item == null) {
item = new LiquidItem(object, primaryPoint, xStretchPoint, yStretchPoint, accordingToBase, duration, ease);
_items.push(item);
_updateables.push(item);
} else {
item.init(primaryPoint, xStretchPoint, yStretchPoint, accordingToBase, duration, ease);
}
refreshLevels();
update();
} else {
_pending.push({object:object, primaryPoint:primaryPoint, xStretchPoint:xStretchPoint, yStretchPoint:yStretchPoint, accordingToBase:accordingToBase, duration:duration, ease:ease});
}
}
/**
* Releases control of a particular DisplayObject that has been pinned/stretched with LiquidStage.
*
* @param object DisplayObject to release from LiquidStage's control.
*/
public static function releaseObject(object:DisplayObject):void {
for (var i:int = _items.length - 1; i > -1; i--) {
if (_items[i].target == object) {
_items.splice(i, 1);
}
}
for (i = _updateables.length - 1; i > -1; i--) {
if (_updateables[i] is LiquidItem && _updateables[i].target == object) {
_updateables.splice(i, 1);
}
}
}
/** @private **/
public static function update(e:Event=null):void {
if (_initted) {
var w:Number = LiquidStage.stage.stageWidth, h:Number = LiquidStage.stage.stageHeight;
/* //only for troubleshooting
var tf:TextField = (stage.getChildAt(0) as DisplayObjectContainer).getChildByName("tf") as TextField;
tf.appendText("\nw: "+LiquidStage.stage.stageWidth+", "+LiquidStage.stage.stageHeight);
}
*/
if (w < LiquidStage.minWidth) {
w = LiquidStage.minWidth;
} else if (w > LiquidStage.maxWidth) {
w = LiquidStage.maxWidth;
}
if (h < LiquidStage.minHeight) {
h = LiquidStage.minHeight;
} else if (h > LiquidStage.maxHeight) {
h = LiquidStage.maxHeight;
}
if (_xStageAlign == 1) {
_stageBox.x = (TOP_RIGHT.x - w) / 2;
} else if (_xStageAlign == 2) {
_stageBox.x = TOP_RIGHT.x - w;
}
if (_yStageAlign == 1) {
_stageBox.y = (BOTTOM_LEFT.y - h) / 2;
} else if (_yStageAlign == 2) {
_stageBox.y = BOTTOM_LEFT.y - h;
}
_stageBox.width = w;
_stageBox.height = h;
LiquidStage.stage.addChild(_stageBox);
for (var i:int = _updateables.length - 1; i > -1; i--) {
_updateables[i].update();
}
LiquidStage.stage.removeChild(_stageBox);
if (_hasListener) {
_dispatcher.dispatchEvent(new Event(Event.RESIZE));
}
}
}
/** @private **/
public static function refreshLevels():void { //nesting levels are extremely important in terms of the order in which we update LiquidItems and PinPoints...
for (var i:int = _updateables.length - 1; i > -1; i--) {
_updateables[i].refreshLevel();
}
_updateables.sortOn("level", Array.NUMERIC | Array.DESCENDING); //to ensure that nested objects are updated AFTER their parents.
var curLevel:int = _updateables[0].level;
var row:Array = [];
var all:Array = [row];
for (i = 0; i < _updateables.length; i++) {
if (_updateables[i].level == curLevel) {
row[row.length] = _updateables[i];
} else {
curLevel = _updateables[i].level;
row = [_updateables[i]];
all[all.length] = row;
}
}
_updateables = [];
for (i = 0; i < all.length; i++) {
row = all[i];
row.sortOn("nestedLevel", Array.NUMERIC | Array.DESCENDING);
_updateables = _updateables.concat(row);
}
}
/** @private **/
public static function findObject(target:DisplayObject):LiquidItem {
var i:int = _items.length;
while (i--) {
if (_items[i].target == target) {
return _items[i];
}
}
return null;
}
/** @private **/
public static function addPinPoint(p:PinPoint):void {
_updateables.push(p);
}
/**
* Adds an Event listener to LiquidStage, like Event.RESIZE or Event.INIT. The RESIZE event can be
* particularly handy if you need to run other functions AFTER LiquidStage does all its repositioning/stretching.
*
* @param type Event type (Event.RESIZE or Event.INIT)
* @param listener Listener function
* @param useCapture useCapture
* @param priority Priority level
* @param useWeakReference Use weak references
*/
public static function addEventListener(type:String, listener:Function, useCapture:Boolean=false, priority:int=0, useWeakReference:Boolean=false):void {
_hasListener = true;
_dispatcher.addEventListener(type, listener, useCapture, priority, useWeakReference);
}
/**
* Removes an Event listener.
*
* @param type type
* @param listener listener
* @param useCapture useCapture
*/
public static function removeEventListener(type:String, listener:Function, useCapture:Boolean=false):void {
_dispatcher.removeEventListener(type, listener, useCapture);
}
/** @private **/
public static function get stageBox():Sprite {
return _stageBox;
}
/** @private **/
public static function get initted():Boolean {
return _initted;
}
}
}
import flash.display.*;
import flash.geom.*;
import flash.events.Event;
import com.greensock.layout.*;
import com.greensock.core.*;
import com.greensock.*;
internal class LiquidItem {
private static var _nullPoint:Point; //To avoid errors where parameters require a Point and Flash won't allow simply null.
private var _duration:Number;
private var _ease:Function;
private var _pin:PinPoint; //the point that the target's registration point should be pinned to (top left, top center, top right, bottom left, etc.)
private var _xStretch:PinPoint; //the point (if any) that the target should be stretched to on the x-axis
private var _yStretch:PinPoint; //the point (if any) that the target should be stretched to on the y-axis
private var _pinOffset:Point; // offest pixels from the _pin point
private var _xStretchOffset:Point; //offset pixels from the _xStretch point
private var _yStretchOffset:Point; //offset pixels from the _yStretch point
private var _regOffset:Point; //reflects the position of the registration point inside the bounds of the target. x and y represent the 1-based percent of the total width/height. So if the registration point is centered, this would be new Point(0.5, 0.5)
private var _accordingToBase:Boolean; //If true, offset measurements should be based on the baseWidth and baseHeight as determined in LiquidStage.init(). Otherwise, they're based on the current stage size.
private var _xRemainder:Number; //when we update(), we round x coordinate down to the closest pixel and store the remainder here so we can add it back on the next update to keep things from drifting.
private var _yRemainder:Number; //when we update(), we round y coordinate down to the closest pixel and store the remainder here so we can add it back on the next update to keep things from drifting.
private var _tween:TweenLite;
private var _parentMovement:Point;
private var _needsFirstRender:Boolean;
public var pinMovement:Point;
public var level:int = 0;// takes into consideration the nesting depth as well as the _pin.level, _xStretch.level, and _yStretch.level. (maximum depth is used)
public var nestedLevel:int = 0; //ignores all other factors besides how deep the target is nested
public var target:DisplayObject;
public function LiquidItem(target:DisplayObject, pin:PinPoint=null, xStretch:PinPoint=null, yStretch:PinPoint=null, accordingToBase:Boolean=true, duration:Number=0, ease:Function=null) {
this.target = target;
if (_nullPoint == null) {
_nullPoint = LiquidStage.NONE;
}
init(pin, xStretch, yStretch, accordingToBase, duration, ease);
}
public function init(pin:PinPoint, xStretch:PinPoint=null, yStretch:PinPoint=null, accordingToBase:Boolean=true, duration:Number=0, ease:Function=null):void {
_pin = pin;
_xStretch = xStretch;
_yStretch = yStretch;
_accordingToBase = accordingToBase;
_duration = duration;
_ease = ease;
_xRemainder = _yRemainder = 0;
this.pinMovement = new Point(0, 0);
initOffsets();
}
public function update():void {
var p:DisplayObjectContainer = this.target.parent;
if (p != null) {
var pin:Point = _pin.global, xStretch:Point = _xStretch.global, yStretch:Point = _yStretch.global;
var pinOld:Point, xStretchOld:Point, yStretchOld:Point;
if (_needsFirstRender) {
pinOld = _pin.baseGlobal;
xStretchOld = _xStretch.baseGlobal;
yStretchOld = _yStretch.baseGlobal;
_needsFirstRender = false;
} else {
pinOld = _pin.previous;
xStretchOld = _xStretch.previous;
yStretchOld = _yStretch.previous;
}
if (this.target.parent != this.target.root) {
pin = p.globalToLocal(pin);
pinOld = p.globalToLocal(pinOld);
if (_xStretch != _nullPoint) {
xStretch = p.globalToLocal(xStretch);
xStretchOld = p.globalToLocal(xStretchOld);
}
if (_yStretch != _nullPoint) {
yStretch = p.globalToLocal(yStretch);
yStretchOld = p.globalToLocal(yStretchOld);
}
}
var x:Number = pin.x - pinOld.x + _xRemainder, y:Number = pin.y - pinOld.y + _yRemainder, width:Number = 0, height:Number = 0;
if (_xStretch != _nullPoint) {
width = (xStretch.x - pin.x) - (xStretchOld.x - pinOld.x);
x += _regOffset.x * width;
}
if (_yStretch != _nullPoint) {
height = (yStretch.y - pin.y) - (yStretchOld.y - pinOld.y);
y += _regOffset.y * height;
}
this.pinMovement.x = int(x);
this.pinMovement.y = int(y);
if (_parentMovement != null) {
x -= _parentMovement.x;
y -= _parentMovement.y;
}
_xRemainder = x % 1;
_yRemainder = y % 1;
var tweens:Object = getExistingTweens(), i:int, tween:TweenLite;
if (_duration != 0) {
var createTweenX:Boolean = Boolean(tweens.x.length == 0);
var createTweenY:Boolean = Boolean(tweens.y.length == 0);
var obj:Object;
if (_tween != null) {
obj = _tween.vars;
_tween.setEnabled(false, false); //kills the tween
} else {
obj = this.target;
}
var vars:Object = {ease:_ease, delay:0.25, overwrite:0, onComplete:onCompleteTween};
if (createTweenX) {
vars.x = int(x) + obj.x;
}
if (createTweenY) {
vars.y = int(y) + obj.y;
}
if (_xStretch != _nullPoint) {
vars.width = width + obj.width;
}
if (_yStretch != _nullPoint) {
vars.height = height + obj.height;
}
if (createTweenX || createTweenY || _xStretch != _nullPoint || _yStretch != _nullPoint) {
_tween = new TweenLite(this.target, _duration, vars);
}
} else {
this.target.x += int(x);
this.target.y += int(y);
if (xStretch != _nullPoint) {
this.target.width += width;
}
if (yStretch != _nullPoint) {
this.target.height += height;
}
}
//look for other competing tweens (of x on this.target) and adjust their end values
var pt:PropTween, j:int, factor:Number, endValue:Number;
i = tweens.x.length;
while (i--) {
tween = tweens.x[i];
tween.vars.x += int(x);
if (tween.initted) {
factor = 1 / (1 - tween.ratio);
pt = tween.propTweenLookup.x;
if (pt.target == this.target && int(x) != 0) {
pt.change += int(x);
if (tween.cachedTime != 0) { //adjust starting values so that there's not a jump during the in-progress tween!
endValue = pt.start + pt.change;
pt.change = (endValue - this.target.x) * factor;
pt.start = endValue - pt.change;
}
}
}
}
//look for other competing tweens (of y on this.target) and adjust their end values
i = tweens.y.length;
while (i--) {
tween = tweens.y[i];
tween.vars.y += int(y);
if (tween.initted) {
factor = 1 / (1 - tween.ratio);
pt = tween.propTweenLookup.y;
if (pt.target == this.target && int(y) != 0) {
pt.change += int(y);
if (tween.cachedTime != 0) { //adjust starting values so that there's not a jump during the in-progress tween!
endValue = pt.start + pt.change;
pt.change = (endValue - this.target.y) * factor;
pt.start = endValue - pt.change;
}
}
}
}
}
}
//returns an Object with x and y properties, each populated with an Array of existing tween instances that affect the x and/or y property of this.target.
private function getExistingTweens():Object {
var xOverlaps:Array = [], yOverlaps:Array = [], targetTweens:Array = TweenLite.masterList[this.target];
if (targetTweens != null) {
var i:int = targetTweens.length, tween:TweenLite, hasX:Boolean, hasY:Boolean;
while (i--) {
tween = targetTweens[i];
hasX = Boolean("x" in tween.propTweenLookup);
hasY = Boolean("y" in tween.propTweenLookup);
if (tween == _tween || tween.gc || (!hasX && !hasY)) {
//ignore
} else {
if (hasX) {
xOverlaps[xOverlaps.length] = tween;
}
if (hasY) {
yOverlaps[yOverlaps.length] = tween;
}
}
}
}
return {x:xOverlaps, y:yOverlaps};
}
private function onCompleteTween():void {
_tween = null;
}
private function onAddToStage(e:Event):void {
this.target.removeEventListener(Event.ADDED_TO_STAGE, onAddToStage);
initOffsets();
}
private function onLiquidStageInit(e:Event):void {
LiquidStage.removeEventListener(Event.INIT, onLiquidStageInit);
initOffsets();
}
private function initOffsets():void {
if (!LiquidStage.initted) {
LiquidStage.addEventListener(Event.INIT, onLiquidStageInit, false, 0, true);
} else if (this.target.parent == null) {
this.target.addEventListener(Event.ADDED_TO_STAGE, onAddToStage, false, 0, true);
} else {
LiquidStage.refreshLevels();
//if (_pin == _nullPoint) {
//_pin = getClosestPoint(this.target, _accordingToBase);
//}
var pin:Point, xStretch:Point, yStretch:Point;
if (_accordingToBase) {
pin = _pin.baseGlobal;
xStretch = _xStretch.baseGlobal;
yStretch = _yStretch.baseGlobal;
} else {
pin = _pin.global;
xStretch = _xStretch.global;
yStretch = _yStretch.global;
}
if (this.target.parent != this.target.root) {
pin = this.target.parent.globalToLocal(pin);
xStretch = this.target.parent.globalToLocal(xStretch);
yStretch = this.target.parent.globalToLocal(yStretch);
}
_pinOffset = new Point(this.target.x - pin.x, this.target.y - pin.y);
var b:Rectangle = this.target.getBounds(this.target);
_regOffset = new Point(-b.x / b.width, -b.y / b.height);
if (_xStretch != _nullPoint) {
_xStretchOffset = new Point((this.target.x + ((1 - _regOffset.x) * this.target.width)) - xStretch.x, this.target.y - xStretch.y);
_pinOffset.x -= _regOffset.x * this.target.width;
}
if (_yStretch != _nullPoint) {
_yStretchOffset = new Point(this.target.x - yStretch.x, this.target.y + ((1 - _regOffset.y) * this.target.height) - yStretch.y);
_pinOffset.y -= _regOffset.y * this.target.height;
}
if (_accordingToBase) {
_needsFirstRender = true;
}
LiquidStage.update();
}
}
public function refreshLevel():void {
_parentMovement = null;
this.nestedLevel = 0;
var li:LiquidItem;
var curParent:DisplayObject = this.target;
while (curParent != this.target.stage) {
this.nestedLevel += 2;
li = LiquidStage.findObject(curParent.parent);
if (li != null && _parentMovement == null) {
_parentMovement = li.pinMovement;
}
curParent = curParent.parent;
}
var a:Array = [this.nestedLevel, _pin.level + 1, _xStretch.level + 1, _yStretch.level + 1]; //if one of the points has a higher level (updated later), we need to push this up one level higher than any of those so that it gives them a chance to update first.
a.sort(Array.NUMERIC | Array.DESCENDING);
this.level = a[0];
}
}
|
package starling.extensions.camera
{
import flash.events.Event;
import starling.core.Starling;
import flash.display.Sprite;
/**
* This and the MainView provide a basic tutorial on how to use the StarlingCamera
*
* @author mtanenbaum
*/
[SWF(width="550", height="400", frameRate="30", backgroundColor="#1199EF")]
public class Main extends Sprite
{
public function Main()
{
super();
addEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
}
private function onAddedToStage(event:Event):void
{
removeEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
//Init Starling
Starling.handleLostContext = true;
var starling:Starling = new Starling(MainView, stage);
starling.antiAliasing = 1;
starling.start();
}
}
}
|
import org.caleb.core.CoreObject;
import org.caleb.loader.LoaderView;
import org.caleb.event.ObservableObject;
import org.caleb.util.ObjectUtil;
import org.caleb.event.Event;
import org.caleb.event.EventDispatcher;
/**
*
* @see ObservableObject
*/
class org.caleb.loader.Loader extends ObservableObject{
private var $target:MovieClip;
private var $views:Array;
private var $timeLimit:Number;
private var $loadCheckInterval:Number;
private var $retries:Number;
private var $frequency:Number;
private var $previousBytesLoaded:Number;
private var $previousTime:Number;
private var $filePath:String;
private var $loadAttempts:Number;
public function Loader(Void){
super();
this.setClassDescription('org.caleb.loader.Loader');
this.$views = new Array();
this.$eventDispatcher = new EventDispatcher();
this.setTimeLimit(1000);
this.setRetries(2);
this.setFrequency(80);
this.reset();
}
private function reset(Void):Void{
this.$filePath = '';
this.$loadAttempts = 0;
}
// accessor for private $target var.
// @returns MovieClip.
public function getTarget():MovieClip{
return this.$target;
}
// mutator for private $target var.
// @argument arg MovieClip
/**
*
* @param arg
*/
public function setTarget(arg:MovieClip):Void{
this.$target = arg;
}
// accessor for private $views var.
// @returns Array.
public function getViews():Array{
return this.$views;
}
// mutator for private $views var.
// @argument arg Array
/**
*
* @param arg
*/
public function setViews(arg:Array):Void{
this.$views = arg;
}
/**
*
* @param view
*/
public function addView(view:LoaderView):Void{
this.$views.push(view);
this.addEventObserver(view, 'LoaderDidChange');
this.addEventObserver(view, 'LoaderDidComplete');
this.addEventObserver(view, 'LoaderDidFail');
}
// accessor for private $frequency var.
// @returns Number.
public function getFrequency():Number{
return this.$frequency;
}
// mutator for private $frequency var.
// @argument arg Number
/**
*
* @param arg
*/
public function setFrequency(arg:Number):Void{
this.$frequency = arg;
}
// accessor for private $timeLimit var.
// @returns Number.
public function getTimeLimit():Number{
return this.$timeLimit;
}
// mutator for private $timeLimit var.
// @argument arg Number
/**
*
* @param arg
*/
public function setTimeLimit(arg:Number):Void{
this.$timeLimit = arg;
}
// accessor for private $retries var.
// @returns Number.
public function getRetries():Number{
return this.$retries;
}
// mutator for private $retries var.
// @argument arg Number
/**
*
* @param arg
*/
public function setRetries(arg:Number):Void{
this.$retries = arg;
}
public function checkLoad(Void):Void{
var bl = this.$target.getBytesLoaded();
var bt = this.$target.getBytesTotal();
if(bl < 100 || this.$previousBytesLoaded == bl){
var test = getTimer();
if((test-this.$previousTime) > this.$timeLimit){
this.retryLoad();
}
return;
}
if(bl >= bt){
this.loadChange(bl, bt);
this.loadComplete(bl, bt);
}else{
this.loadChange(bl, bt);
}
}
private function loadFailed(Void):Void{
clearInterval(this.$loadCheckInterval);
var e = new org.caleb.event.Event('LoaderDidFail');
e.addArgument('filepath', this.$filePath);
this.dispatchEvent(e);
this.reset();
}
private function loadComplete(bl:Number, bt:Number):Void{
clearInterval(this.$loadCheckInterval);
var e = new org.caleb.event.Event('LoaderDidComplete');
e.addArgument('bl', bl);
e.addArgument('bt', bt);
e.addArgument('filepath', this.$filePath);
this.dispatchEvent(e);
this.reset();
}
private function loadChange(bl:Number, bt:Number):Void{
var e = new org.caleb.event.Event('LoaderDidChange');
e.addArgument('bl', bl);
e.addArgument('bt', bt);
e.addArgument('filepath', this.$filePath);
this.dispatchEvent(e);
}
private function startLoadCheck(Void):Void{
clearInterval(this.$loadCheckInterval);
this.$previousBytesLoaded = -1;
this.$previousTime = getTimer();
this.$loadCheckInterval = setInterval(this, 'checkLoad', this.getFrequency());
}
private function retryLoad(Void):Void{
if(++this.$loadAttempts >= this.$retries){
this.loadFailed();
return;
}
if(ObjectUtil.isTypeOf(this.$target, 'movieclip') == false || ObjectUtil.isEmpty(this.$filePath)){
return;
}
this.startLoadCheck();
this.$target.loadMovie(this.$filePath);
}
/**
*
* @param filePath
*/
public function load(filePath:String):Void{
if(ObjectUtil.isTypeOf(this.$target, 'movieclip') == false || ObjectUtil.isEmpty(filePath)){
return;
}
this.$previousBytesLoaded = 0;
this.$filePath = filePath;
this.$loadAttempts = 0;
this.startLoadCheck();
this.$target.loadMovie(filePath);
}
}
|
/**
* TLSConnectionState
*
* This class encapsulates the read or write state of a TLS connection,
* and implementes the encrypting and hashing of packets.
* Copyright (c) 2007 Henri Torgemane
*
* See LICENSE.txt for full license information.
*/
package hurlant.crypto.tls {
import flash.utils.IDataInput;
import flash.utils.ByteArray;
import hurlant.crypto.hash.MD5;
import hurlant.crypto.hash.HMAC;
import hurlant.crypto.hash.IHash;
import hurlant.crypto.symmetric.ICipher;
import hurlant.crypto.symmetric.IVMode;
import hurlant.util.Hex;
import hurlant.util.ArrayUtil;
public class TLSConnectionState {
// compression state
// cipher state
private var bulkCipher:uint;
private var cipherType:uint;
private var CIPHER_key:ByteArray;
private var CIPHER_IV:ByteArray;
private var cipher:ICipher;
private var ivmode:IVMode;
// mac secret
private var macAlgorithm:uint;
private var MAC_write_secret:ByteArray;
private var hmac:HMAC;
// sequence number. uint64
private var seq_lo:uint;
private var seq_hi:uint;
public function TLSConnectionState(
bulkCipher:uint=0, cipherType:uint=0, macAlgorithm:uint=0,
mac:ByteArray=null, key:ByteArray=null, IV:ByteArray=null) {
this.bulkCipher = bulkCipher;
this.cipherType = cipherType;
this.macAlgorithm = macAlgorithm;
MAC_write_secret = mac;
hmac = MACs.getHMAC(macAlgorithm);
CIPHER_key = key;
CIPHER_IV = IV;
cipher = BulkCiphers.getCipher(bulkCipher, key);
if (cipher is IVMode) {
ivmode = cipher as IVMode;
ivmode.IV = IV;
}
}
public function decrypt(type:uint, length:uint, p:ByteArray):ByteArray {
// decompression is a nop.
if (cipherType == BulkCiphers.STREAM_CIPHER) {
if (bulkCipher == BulkCiphers.NULL) {
// no-op
} else {
cipher.decrypt(p);
}
} else {
// block cipher
var nextIV:ByteArray = new ByteArray;
nextIV.writeBytes(p, p.length-CIPHER_IV.length, CIPHER_IV.length);
cipher.decrypt(p);
CIPHER_IV = nextIV;
ivmode.IV = nextIV;
}
if (macAlgorithm!=MACs.NULL) {
var data:ByteArray = new ByteArray;
var len:uint = p.length - hmac.getHashSize();
data.writeUnsignedInt(seq_hi);
data.writeUnsignedInt(seq_lo);
data.writeByte(type);
data.writeShort(TLSEngine.TLS_VERSION);
data.writeShort(len);
if (len!=0) {
data.writeBytes(p, 0, len);
}
var mac:ByteArray = hmac.compute(MAC_write_secret, data);
// compare "mac" with the last X bytes of p.
var mac_received:ByteArray = new ByteArray;
mac_received.writeBytes(p, len, hmac.getHashSize());
if (ArrayUtil.equals(mac, mac_received)) {
// happy happy joy joy
} else {
throw new TLSError("Bad Mac Data", TLSError.bad_record_mac);
}
p.length = len;
p.position = 0;
}
// increment seq
seq_lo++;
if (seq_lo==0) seq_hi++;
return p;
}
public function encrypt(type:uint, p:ByteArray):ByteArray {
var mac:ByteArray = null;
if (macAlgorithm!=MACs.NULL) {
var data:ByteArray = new ByteArray;
data.writeUnsignedInt(seq_hi);
data.writeUnsignedInt(seq_lo);
data.writeByte(type);
data.writeShort(TLSEngine.TLS_VERSION);
data.writeShort(p.length);
if (p.length!=0) {
data.writeBytes(p, 0, p.length);
}
mac = hmac.compute(MAC_write_secret, data);
p.position = p.length;
p.writeBytes(mac);
}
p.position = 0;
if (cipherType == BulkCiphers.STREAM_CIPHER) {
// stream cipher
if (bulkCipher == BulkCiphers.NULL) {
// no-op
} else {
cipher.encrypt(p);
}
} else {
// block cipher
cipher.encrypt(p);
// adjust IV
var nextIV:ByteArray = new ByteArray;
nextIV.writeBytes(p, p.length-CIPHER_IV.length, CIPHER_IV.length);
CIPHER_IV = nextIV;
ivmode.IV = nextIV;
}
// increment seq
seq_lo++;
if (seq_lo==0) seq_hi++;
// compression is a nop.
return p;
}
}
} |
/*
* Copyright 2015-2018 Marcel Piestansky
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*/
package feathers.themes {
import starling.textures.Texture;
import starling.textures.TextureAtlas;
/**
* Icons for the Uniflat theme. These icons are initialized by
* <code>UniflatMobileThemeWithIcons</code> and <code>UniflatMobileThemeWithAssetManagerAndIcons</code>.
*/
public class UniflatMobileThemeIcons {
public static var _3DRotationTexture:Texture;
public static var accessibilityTexture:Texture;
public static var accountBalanceTexture:Texture;
public static var accountBalanceWalletTexture:Texture;
public static var accountBoxTexture:Texture;
public static var accountChildTexture:Texture;
public static var accountCircleTexture:Texture;
public static var addBoxTexture:Texture;
public static var addCircleTexture:Texture;
public static var addCircleOutlineTexture:Texture;
public static var addTexture:Texture;
public static var addShoppingCartTexture:Texture;
public static var alarmAddTexture:Texture;
public static var alarmTexture:Texture;
public static var alarmOffTexture:Texture;
public static var alarmOnTexture:Texture;
public static var androidTexture:Texture;
public static var announcementTexture:Texture;
public static var appsTexture:Texture;
public static var archiveTexture:Texture;
public static var arrowBackTexture:Texture;
public static var arrowDropDownCircleTexture:Texture;
public static var arrowDropDownTexture:Texture;
public static var arrowDropUpTexture:Texture;
public static var arrowForwardTexture:Texture;
public static var aspectRatioTexture:Texture;
public static var assessmentTexture:Texture;
public static var assignmentTexture:Texture;
public static var assignmentIndTexture:Texture;
public static var assignmentLateTexture:Texture;
public static var assignmentReturnTexture:Texture;
public static var assignmentReturnedTexture:Texture;
public static var assignmentTurnedInTexture:Texture;
public static var autoRenewTexture:Texture;
public static var backspaceTexture:Texture;
public static var backupTexture:Texture;
public static var blockTexture:Texture;
public static var bookTexture:Texture;
public static var bookmarkTexture:Texture;
public static var bookmarkOutlineTexture:Texture;
public static var bugReportTexture:Texture;
public static var cachedTexture:Texture;
public static var cakeTexture:Texture;
public static var cancelTexture:Texture;
public static var checkCircleTexture:Texture;
public static var checkTexture:Texture;
public static var chevronLeftTexture:Texture;
public static var chevronRightTexture:Texture;
public static var classTexture:Texture;
public static var clearTexture:Texture;
public static var closeTexture:Texture;
public static var contentCopyTexture:Texture;
public static var contentCutTexture:Texture;
public static var contentPasteTexture:Texture;
public static var createTexture:Texture;
public static var creditCardTexture:Texture;
public static var dashboardTexture:Texture;
public static var deleteTexture:Texture;
public static var descriptionTexture:Texture;
public static var dnsTexture:Texture;
public static var domainTexture:Texture;
public static var doneAllTexture:Texture;
public static var doneTexture:Texture;
public static var draftsTexture:Texture;
public static var errorTexture:Texture;
public static var eventTexture:Texture;
public static var exitToAppTexture:Texture;
public static var expandLessTexture:Texture;
public static var expandMoreTexture:Texture;
public static var exploreTexture:Texture;
public static var extensionTexture:Texture;
public static var faceTexture:Texture;
public static var favoriteTexture:Texture;
public static var favoriteOutlineTexture:Texture;
public static var filterListTexture:Texture;
public static var findInPageTexture:Texture;
public static var findReplaceTexture:Texture;
public static var flagTexture:Texture;
public static var flipToBackTexture:Texture;
public static var flipToFrontTexture:Texture;
public static var forwardTexture:Texture;
public static var fullscreenExitTexture:Texture;
public static var fullscreenTexture:Texture;
public static var gestureTexture:Texture;
public static var getAppTexture:Texture;
public static var gradeTexture:Texture;
public static var groupAddTexture:Texture;
public static var groupTexture:Texture;
public static var groupWorkTexture:Texture;
public static var helpTexture:Texture;
public static var highlightRemoveTexture:Texture;
public static var historyTexture:Texture;
public static var homeTexture:Texture;
public static var httpsTexture:Texture;
public static var inboxTexture:Texture;
public static var infoTexture:Texture;
public static var infoOutlineTexture:Texture;
public static var inputTexture:Texture;
public static var invertColorsTexture:Texture;
public static var labelTexture:Texture;
public static var labelOutlineTexture:Texture;
public static var languageTexture:Texture;
public static var launchTexture:Texture;
public static var linkTexture:Texture;
public static var listTexture:Texture;
public static var locationCityTexture:Texture;
public static var lockTexture:Texture;
public static var lockOpenTexture:Texture;
public static var lockOutlineTexture:Texture;
public static var loyaltyTexture:Texture;
public static var mailTexture:Texture;
public static var markUnreadMailboxTexture:Texture;
public static var markUnreadTexture:Texture;
public static var menuTexture:Texture;
public static var moodTexture:Texture;
public static var moreHorizontalTexture:Texture;
public static var moreVerticalTexture:Texture;
public static var noteAddTexture:Texture;
public static var notificationsTexture:Texture;
public static var notificationsNoneTexture:Texture;
public static var notificationsOffTexture:Texture;
public static var notificationsOnTexture:Texture;
public static var notificationsPausedTexture:Texture;
public static var openInBrowserTexture:Texture;
public static var openInNewTexture:Texture;
public static var openWithTexture:Texture;
public static var pageViewTexture:Texture;
public static var pagesTexture:Texture;
public static var partyModeTexture:Texture;
public static var paymentTexture:Texture;
public static var peopleTexture:Texture;
public static var peopleOutlineTexture:Texture;
public static var permCameraMicTexture:Texture;
public static var permContactCalTexture:Texture;
public static var permDataSettingTexture:Texture;
public static var permDeviceInfoTexture:Texture;
public static var permIdentityTexture:Texture;
public static var permMediaTexture:Texture;
public static var permPhoneMsgTexture:Texture;
public static var permScanWifiTexture:Texture;
public static var personAddTexture:Texture;
public static var personTexture:Texture;
public static var personOutlineTexture:Texture;
public static var pictureInPictureTexture:Texture;
public static var plusOneTexture:Texture;
public static var pollTexture:Texture;
public static var polymerTexture:Texture;
public static var printTexture:Texture;
public static var publicTexture:Texture;
public static var queryBuilderTexture:Texture;
public static var questionAnswerTexture:Texture;
public static var receiptTexture:Texture;
public static var redeemTexture:Texture;
public static var redoTexture:Texture;
public static var refreshTexture:Texture;
public static var removeCircleTexture:Texture;
public static var removeCircleOutlineTexture:Texture;
public static var removeTexture:Texture;
public static var reorderTexture:Texture;
public static var replyAllTexture:Texture;
public static var replyTexture:Texture;
public static var reportTexture:Texture;
public static var reportProblemTexture:Texture;
public static var restoreTexture:Texture;
public static var roomTexture:Texture;
public static var saveTexture:Texture;
public static var scheduleTexture:Texture;
public static var schoolTexture:Texture;
public static var searchTexture:Texture;
public static var selectAllTexture:Texture;
public static var sendTexture:Texture;
public static var settingsApplicationsTexture:Texture;
public static var settingsBackupRestoreTexture:Texture;
public static var settingsBluetoothTexture:Texture;
public static var settingsCellTexture:Texture;
public static var settingsDisplayTexture:Texture;
public static var settingsEthernetTexture:Texture;
public static var settingsTexture:Texture;
public static var settingsInputAntennaTexture:Texture;
public static var settingsInputComponentTexture:Texture;
public static var settingsInputCompositeTexture:Texture;
public static var settingsInputHDMITexture:Texture;
public static var settingsInputSVideoTexture:Texture;
public static var settingsOverscanTexture:Texture;
public static var settingsPhoneTexture:Texture;
public static var settingsPowerTexture:Texture;
public static var settingsRemoteTexture:Texture;
public static var settingsVoiceTexture:Texture;
public static var shareTexture:Texture;
public static var shopTexture:Texture;
public static var shopTwoTexture:Texture;
public static var shoppingBasketTexture:Texture;
public static var shoppingCartTexture:Texture;
public static var sortTexture:Texture;
public static var speakerNotesTexture:Texture;
public static var spellCheckTexture:Texture;
public static var starRateTexture:Texture;
public static var starsTexture:Texture;
public static var storeTexture:Texture;
public static var subjectTexture:Texture;
public static var supervisorAccountTexture:Texture;
public static var swapHorizontalTexture:Texture;
public static var swapVerticalCircleTexture:Texture;
public static var swapVerticalTexture:Texture;
public static var systemUpdateTvTexture:Texture;
public static var tabTexture:Texture;
public static var tabUnselectedTexture:Texture;
public static var textFormatTexture:Texture;
public static var theatersTexture:Texture;
public static var thumbDownTexture:Texture;
public static var thumbUpTexture:Texture;
public static var thumbsUpDownTexture:Texture;
public static var tocTexture:Texture;
public static var todayTexture:Texture;
public static var trackChangesTexture:Texture;
public static var translateTexture:Texture;
public static var trendingDownTexture:Texture;
public static var trendingNeutralTexture:Texture;
public static var trendingUpTexture:Texture;
public static var turnedInTexture:Texture;
public static var turnedInNotTexture:Texture;
public static var undoTexture:Texture;
public static var unfoldLessTexture:Texture;
public static var unfoldMoreTexture:Texture;
public static var verifiedUserTexture:Texture;
public static var videocamTexture:Texture;
public static var viewAgendaTexture:Texture;
public static var viewArrayTexture:Texture;
public static var viewCarouselTexture:Texture;
public static var viewColumnTexture:Texture;
public static var viewDayTexture:Texture;
public static var viewHeadlineTexture:Texture;
public static var viewListTexture:Texture;
public static var viewModuleTexture:Texture;
public static var viewQuiltTexture:Texture;
public static var viewStreamTexture:Texture;
public static var viewWeekTexture:Texture;
public static var visibilityTexture:Texture;
public static var visibilityOffTexture:Texture;
public static var walletGiftCardTexture:Texture;
public static var walletMembershipTexture:Texture;
public static var walletTravelTexture:Texture;
public static var warningTexture:Texture;
public static var whatsHotTexture:Texture;
public static var workTexture:Texture;
internal static function initialize( atlas:TextureAtlas ):void {
_3DRotationTexture = getTextureForIcon( atlas, "3d-rotation-icon" );
accessibilityTexture = getTextureForIcon( atlas, "accessibility-icon" );
accountBalanceTexture = getTextureForIcon( atlas, "account-balance-icon" );
accountBalanceWalletTexture = getTextureForIcon( atlas, "account-balance-wallet-icon" );
accountBoxTexture = getTextureForIcon( atlas, "account-box-icon" );
accountChildTexture = getTextureForIcon( atlas, "account-child-icon" );
accountCircleTexture = getTextureForIcon( atlas, "account-circle-icon" );
addBoxTexture = getTextureForIcon( atlas, "add-box-icon" );
addCircleTexture = getTextureForIcon( atlas, "add-circle-icon" );
addCircleOutlineTexture = getTextureForIcon( atlas, "add-circle-outline-icon" );
addTexture = getTextureForIcon( atlas, "add-icon" );
addShoppingCartTexture = getTextureForIcon( atlas, "add-shopping-cart-icon" );
alarmAddTexture = getTextureForIcon( atlas, "alarm-add-icon" );
alarmTexture = getTextureForIcon( atlas, "alarm-icon" );
alarmOffTexture = getTextureForIcon( atlas, "alarm-off-icon" );
alarmOnTexture = getTextureForIcon( atlas, "alarm-on-icon" );
androidTexture = getTextureForIcon( atlas, "android-icon" );
announcementTexture = getTextureForIcon( atlas, "announcement-icon" );
appsTexture = getTextureForIcon( atlas, "apps-icon" );
archiveTexture = getTextureForIcon( atlas, "archive-icon" );
arrowBackTexture = getTextureForIcon( atlas, "arrow-back-icon" );
arrowDropDownCircleTexture = getTextureForIcon( atlas, "arrow-drop-down-circle-icon" );
arrowDropDownTexture = getTextureForIcon( atlas, "arrow-drop-down-icon" );
arrowDropUpTexture = getTextureForIcon( atlas, "arrow-drop-up-icon" );
arrowForwardTexture = getTextureForIcon( atlas, "arrow-forward-icon" );
aspectRatioTexture = getTextureForIcon( atlas, "aspect-ratio-icon" );
assessmentTexture = getTextureForIcon( atlas, "assessment-icon" );
assignmentTexture = getTextureForIcon( atlas, "assignment-icon" );
assignmentIndTexture = getTextureForIcon( atlas, "assignment-ind-icon" );
assignmentLateTexture = getTextureForIcon( atlas, "assignment-late-icon" );
assignmentReturnTexture = getTextureForIcon( atlas, "assignment-return-icon" );
assignmentReturnedTexture = getTextureForIcon( atlas, "assignment-returned-icon" );
assignmentTurnedInTexture = getTextureForIcon( atlas, "assignment-turned-in-icon" );
autoRenewTexture = getTextureForIcon( atlas, "auto-renew-icon" );
backspaceTexture = getTextureForIcon( atlas, "backspace-icon" );
backupTexture = getTextureForIcon( atlas, "backup-icon" );
blockTexture = getTextureForIcon( atlas, "block-icon" );
bookTexture = getTextureForIcon( atlas, "book-icon" );
bookmarkTexture = getTextureForIcon( atlas, "bookmark-icon" );
bookmarkOutlineTexture = getTextureForIcon( atlas, "bookmark-outline-icon" );
bugReportTexture = getTextureForIcon( atlas, "bug-report-icon" );
cachedTexture = getTextureForIcon( atlas, "cached-icon" );
cakeTexture = getTextureForIcon( atlas, "cake-icon" );
cancelTexture = getTextureForIcon( atlas, "cancel-icon" );
checkCircleTexture = getTextureForIcon( atlas, "check-circle-icon" );
checkTexture = getTextureForIcon( atlas, "check-icon" );
chevronLeftTexture = getTextureForIcon( atlas, "chevron-left-icon" );
chevronRightTexture = getTextureForIcon( atlas, "chevron-right-icon" );
classTexture = getTextureForIcon( atlas, "class-icon" );
clearTexture = getTextureForIcon( atlas, "clear-icon" );
closeTexture = getTextureForIcon( atlas, "close-icon" );
contentCopyTexture = getTextureForIcon( atlas, "content-copy-icon" );
contentCutTexture = getTextureForIcon( atlas, "content-cut-icon" );
contentPasteTexture = getTextureForIcon( atlas, "content-paste-icon" );
createTexture = getTextureForIcon( atlas, "create-icon" );
creditCardTexture = getTextureForIcon( atlas, "credit-card-icon" );
dashboardTexture = getTextureForIcon( atlas, "dashboard-icon" );
deleteTexture = getTextureForIcon( atlas, "delete-icon" );
descriptionTexture = getTextureForIcon( atlas, "description-icon" );
dnsTexture = getTextureForIcon( atlas, "dns-icon" );
domainTexture = getTextureForIcon( atlas, "domain-icon" );
doneAllTexture = getTextureForIcon( atlas, "done-all-icon" );
doneTexture = getTextureForIcon( atlas, "done-icon" );
draftsTexture = getTextureForIcon( atlas, "drafts-icon" );
errorTexture = getTextureForIcon( atlas, "error-icon" );
eventTexture = getTextureForIcon( atlas, "event-icon" );
exitToAppTexture = getTextureForIcon( atlas, "exit-to-app-icon" );
expandLessTexture = getTextureForIcon( atlas, "expand-less-icon" );
expandMoreTexture = getTextureForIcon( atlas, "expand-more-icon" );
exploreTexture = getTextureForIcon( atlas, "explore-icon" );
extensionTexture = getTextureForIcon( atlas, "extension-icon" );
faceTexture = getTextureForIcon( atlas, "face-icon" );
favoriteTexture = getTextureForIcon( atlas, "favorite-icon" );
favoriteOutlineTexture = getTextureForIcon( atlas, "favorite-outline-icon" );
filterListTexture = getTextureForIcon( atlas, "filter-list-icon" );
findInPageTexture = getTextureForIcon( atlas, "find-in-page-icon" );
findReplaceTexture = getTextureForIcon( atlas, "find-replace-icon" );
flagTexture = getTextureForIcon( atlas, "flag-icon" );
flipToBackTexture = getTextureForIcon( atlas, "flip-to-back-icon" );
flipToFrontTexture = getTextureForIcon( atlas, "flip-to-front-icon" );
forwardTexture = getTextureForIcon( atlas, "forward-icon" );
fullscreenExitTexture = getTextureForIcon( atlas, "fullscreen-exit-icon" );
fullscreenTexture = getTextureForIcon( atlas, "fullscreen-icon" );
gestureTexture = getTextureForIcon( atlas, "gesture-icon" );
getAppTexture = getTextureForIcon( atlas, "get-app-icon" );
gradeTexture = getTextureForIcon( atlas, "grade-icon" );
groupAddTexture = getTextureForIcon( atlas, "group-add-icon" );
groupTexture = getTextureForIcon( atlas, "group-icon" );
groupWorkTexture = getTextureForIcon( atlas, "group-work-icon" );
helpTexture = getTextureForIcon( atlas, "help-icon" );
highlightRemoveTexture = getTextureForIcon( atlas, "highlight-remove-icon" );
historyTexture = getTextureForIcon( atlas, "history-icon" );
homeTexture = getTextureForIcon( atlas, "home-icon" );
httpsTexture = getTextureForIcon( atlas, "https-icon" );
inboxTexture = getTextureForIcon( atlas, "inbox-icon" );
infoTexture = getTextureForIcon( atlas, "info-icon" );
infoOutlineTexture = getTextureForIcon( atlas, "info-outline-icon" );
inputTexture = getTextureForIcon( atlas, "input-icon" );
invertColorsTexture = getTextureForIcon( atlas, "invert-colors-icon" );
labelTexture = getTextureForIcon( atlas, "label-icon" );
labelOutlineTexture = getTextureForIcon( atlas, "label-outline-icon" );
languageTexture = getTextureForIcon( atlas, "language-icon" );
launchTexture = getTextureForIcon( atlas, "launch-icon" );
linkTexture = getTextureForIcon( atlas, "link-icon" );
listTexture = getTextureForIcon( atlas, "list-icon" );
locationCityTexture = getTextureForIcon( atlas, "location-city-icon" );
lockTexture = getTextureForIcon( atlas, "lock-icon" );
lockOpenTexture = getTextureForIcon( atlas, "lock-open-icon" );
lockOutlineTexture = getTextureForIcon( atlas, "lock-outline-icon" );
loyaltyTexture = getTextureForIcon( atlas, "loyalty-icon" );
mailTexture = getTextureForIcon( atlas, "mail-icon" );
markUnreadMailboxTexture = getTextureForIcon( atlas, "mark-unread-mailbox-icon" );
markUnreadTexture = getTextureForIcon( atlas, "mark-unread-icon" );
menuTexture = getTextureForIcon( atlas, "menu-icon" );
moodTexture = getTextureForIcon( atlas, "mood-icon" );
moreHorizontalTexture = getTextureForIcon( atlas, "more-horizontal-icon" );
moreVerticalTexture = getTextureForIcon( atlas, "more-vertical-icon" );
noteAddTexture = getTextureForIcon( atlas, "note-add-icon" );
notificationsTexture = getTextureForIcon( atlas, "notifications-icon" );
notificationsNoneTexture = getTextureForIcon( atlas, "notifications-none-icon" );
notificationsOffTexture = getTextureForIcon( atlas, "notifications-off-icon" );
notificationsOnTexture = getTextureForIcon( atlas, "notifications-on-icon" );
notificationsPausedTexture = getTextureForIcon( atlas, "notifications-paused-icon" );
openInBrowserTexture = getTextureForIcon( atlas, "open-in-browser-icon" );
openInNewTexture = getTextureForIcon( atlas, "open-in-new-icon" );
openWithTexture = getTextureForIcon( atlas, "open-with-icon" );
pageViewTexture = getTextureForIcon( atlas, "page-view-icon" );
pagesTexture = getTextureForIcon( atlas, "pages-icon" );
partyModeTexture = getTextureForIcon( atlas, "party-mode-icon" );
paymentTexture = getTextureForIcon( atlas, "payment-icon" );
peopleTexture = getTextureForIcon( atlas, "people-icon" );
peopleOutlineTexture = getTextureForIcon( atlas, "people-outline-icon" );
permCameraMicTexture = getTextureForIcon( atlas, "perm-camera-mic-icon" );
permContactCalTexture = getTextureForIcon( atlas, "perm-contact-cal-icon" );
permDataSettingTexture = getTextureForIcon( atlas, "perm-data-setting-icon" );
permDeviceInfoTexture = getTextureForIcon( atlas, "perm-device-info-icon" );
permIdentityTexture = getTextureForIcon( atlas, "perm-identity-icon" );
permMediaTexture = getTextureForIcon( atlas, "perm-media-icon" );
permPhoneMsgTexture = getTextureForIcon( atlas, "perm-phone-msg-icon" );
permScanWifiTexture = getTextureForIcon( atlas, "perm-scan-wifi-icon" );
personAddTexture = getTextureForIcon( atlas, "person-add-icon" );
personTexture = getTextureForIcon( atlas, "person-icon" );
personOutlineTexture = getTextureForIcon( atlas, "person-outline-icon" );
pictureInPictureTexture = getTextureForIcon( atlas, "picture-in-picture-icon" );
plusOneTexture = getTextureForIcon( atlas, "plus-one-icon" );
pollTexture = getTextureForIcon( atlas, "poll-icon" );
polymerTexture = getTextureForIcon( atlas, "polymer-icon" );
printTexture = getTextureForIcon( atlas, "print-icon" );
publicTexture = getTextureForIcon( atlas, "public-icon" );
queryBuilderTexture = getTextureForIcon( atlas, "query-builder-icon" );
questionAnswerTexture = getTextureForIcon( atlas, "question-answer-icon" );
receiptTexture = getTextureForIcon( atlas, "receipt-icon" );
redeemTexture = getTextureForIcon( atlas, "redeem-icon" );
redoTexture = getTextureForIcon( atlas, "redo-icon" );
refreshTexture = getTextureForIcon( atlas, "refresh-icon" );
removeCircleTexture = getTextureForIcon( atlas, "remove-circle-icon" );
removeCircleOutlineTexture = getTextureForIcon( atlas, "remove-circle-outline-icon" );
removeTexture = getTextureForIcon( atlas, "remove-icon" );
reorderTexture = getTextureForIcon( atlas, "reorder-icon" );
replyAllTexture = getTextureForIcon( atlas, "reply-all-icon" );
replyTexture = getTextureForIcon( atlas, "reply-icon" );
reportTexture = getTextureForIcon( atlas, "report-icon" );
reportProblemTexture = getTextureForIcon( atlas, "report-problem-icon" );
restoreTexture = getTextureForIcon( atlas, "restore-icon" );
roomTexture = getTextureForIcon( atlas, "room-icon" );
saveTexture = getTextureForIcon( atlas, "save-icon" );
scheduleTexture = getTextureForIcon( atlas, "schedule-icon" );
schoolTexture = getTextureForIcon( atlas, "school-icon" );
searchTexture = getTextureForIcon( atlas, "search-icon" );
selectAllTexture = getTextureForIcon( atlas, "select-all-icon" );
sendTexture = getTextureForIcon( atlas, "send-icon" );
settingsApplicationsTexture = getTextureForIcon( atlas, "settings-applications-icon" );
settingsBackupRestoreTexture = getTextureForIcon( atlas, "settings-backup-restore-icon" );
settingsBluetoothTexture = getTextureForIcon( atlas, "settings-bluetooth-icon" );
settingsCellTexture = getTextureForIcon( atlas, "settings-cell-icon" );
settingsDisplayTexture = getTextureForIcon( atlas, "settings-display-icon" );
settingsEthernetTexture = getTextureForIcon( atlas, "settings-ethernet-icon" );
settingsTexture = getTextureForIcon( atlas, "settings-icon" );
settingsInputAntennaTexture = getTextureForIcon( atlas, "settings-input-antenna-icon" );
settingsInputComponentTexture = getTextureForIcon( atlas, "settings-input-component-icon" );
settingsInputCompositeTexture = getTextureForIcon( atlas, "settings-input-composite-icon" );
settingsInputHDMITexture = getTextureForIcon( atlas, "settings-input-hdmi-icon" );
settingsInputSVideoTexture = getTextureForIcon( atlas, "settings-input-svideo-icon" );
settingsOverscanTexture = getTextureForIcon( atlas, "settings-overscan-icon" );
settingsPhoneTexture = getTextureForIcon( atlas, "settings-phone-icon" );
settingsPowerTexture = getTextureForIcon( atlas, "settings-power-icon" );
settingsRemoteTexture = getTextureForIcon( atlas, "settings-remote-icon" );
settingsVoiceTexture = getTextureForIcon( atlas, "settings-voice-icon" );
shareTexture = getTextureForIcon( atlas, "share-icon" );
shopTexture = getTextureForIcon( atlas, "shop-icon" );
shopTwoTexture = getTextureForIcon( atlas, "shop-two-icon" );
shoppingBasketTexture = getTextureForIcon( atlas, "shopping-basket-icon" );
shoppingCartTexture = getTextureForIcon( atlas, "shopping-cart-icon" );
sortTexture = getTextureForIcon( atlas, "sort-icon" );
speakerNotesTexture = getTextureForIcon( atlas, "speaker-notes-icon" );
spellCheckTexture = getTextureForIcon( atlas, "spell-check-icon" );
starRateTexture = getTextureForIcon( atlas, "star-rate-icon" );
starsTexture = getTextureForIcon( atlas, "stars-icon" );
storeTexture = getTextureForIcon( atlas, "store-icon" );
subjectTexture = getTextureForIcon( atlas, "subject-icon" );
supervisorAccountTexture = getTextureForIcon( atlas, "supervisor-account-icon" );
swapHorizontalTexture = getTextureForIcon( atlas, "swap-horizontal-icon" );
swapVerticalCircleTexture = getTextureForIcon( atlas, "swap-vertical-circle-icon" );
swapVerticalTexture = getTextureForIcon( atlas, "swap-vertical-icon" );
systemUpdateTvTexture = getTextureForIcon( atlas, "system-update-tv-icon" );
tabTexture = getTextureForIcon( atlas, "tab-icon" );
tabUnselectedTexture = getTextureForIcon( atlas, "tab-unselected-icon" );
textFormatTexture = getTextureForIcon( atlas, "text-format-icon" );
theatersTexture = getTextureForIcon( atlas, "theaters-icon" );
thumbDownTexture = getTextureForIcon( atlas, "thumb-down-icon" );
thumbUpTexture = getTextureForIcon( atlas, "thumb-up-icon" );
thumbsUpDownTexture = getTextureForIcon( atlas, "thumbs-up-down-icon" );
tocTexture = getTextureForIcon( atlas, "toc-icon" );
todayTexture = getTextureForIcon( atlas, "today-icon" );
trackChangesTexture = getTextureForIcon( atlas, "track-changes-icon" );
translateTexture = getTextureForIcon( atlas, "translate-icon" );
trendingDownTexture = getTextureForIcon( atlas, "trending-down-icon" );
trendingNeutralTexture = getTextureForIcon( atlas, "trending-neutral-icon" );
trendingUpTexture = getTextureForIcon( atlas, "trending-up-icon" );
turnedInTexture = getTextureForIcon( atlas, "turned-in-icon" );
turnedInNotTexture = getTextureForIcon( atlas, "turned-in-not-icon" );
undoTexture = getTextureForIcon( atlas, "undo-icon" );
unfoldLessTexture = getTextureForIcon( atlas, "unfold-less-icon" );
unfoldMoreTexture = getTextureForIcon( atlas, "unfold-more-icon" );
verifiedUserTexture = getTextureForIcon( atlas, "verified-user-icon" );
videocamTexture = getTextureForIcon( atlas, "videocam-icon" );
viewAgendaTexture = getTextureForIcon( atlas, "view-agenda-icon" );
viewArrayTexture = getTextureForIcon( atlas, "view-array-icon" );
viewCarouselTexture = getTextureForIcon( atlas, "view-carousel-icon" );
viewColumnTexture = getTextureForIcon( atlas, "view-column-icon" );
viewDayTexture = getTextureForIcon( atlas, "view-day-icon" );
viewHeadlineTexture = getTextureForIcon( atlas, "view-headline-icon" );
viewListTexture = getTextureForIcon( atlas, "view-list-icon" );
viewModuleTexture = getTextureForIcon( atlas, "view-module-icon" );
viewQuiltTexture = getTextureForIcon( atlas, "view-quilt-icon" );
viewStreamTexture = getTextureForIcon( atlas, "view-stream-icon" );
viewWeekTexture = getTextureForIcon( atlas, "view-week-icon" );
visibilityTexture = getTextureForIcon( atlas, "visibility-icon" );
visibilityOffTexture = getTextureForIcon( atlas, "visibility-off-icon" );
walletGiftCardTexture = getTextureForIcon( atlas, "wallet-gift-card-icon" );
walletMembershipTexture = getTextureForIcon( atlas, "wallet-membership-icon" );
walletTravelTexture = getTextureForIcon( atlas, "wallet-travel-icon" );
warningTexture = getTextureForIcon( atlas, "warning-icon" );
whatsHotTexture = getTextureForIcon( atlas, "whats-hot-icon" );
workTexture = getTextureForIcon( atlas, "work-icon" );
}
private static function getTextureForIcon( atlas:TextureAtlas, name:String ):Texture {
const texture:Texture = atlas.getTexture( name );
if( !texture ) {
trace("[UniflatThemeIcons - Warning] Texture for icon '" + name + "' not found.");
}
return texture;
}
}
}
|
package ai.spawngrid.emitters {
public class Treasure {
private var _amount:int;
public function Treasure(x:int, y:int):void {
super(x, y);
}
override public function update():void {
}
}
} |
////////////////////////////////////////////////////////////////////////////////
//
// ADOBE SYSTEMS INCORPORATED
// Copyright 2009 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 graphite.skins
{
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.display.IBitmapDrawable;
import flash.events.Event;
import flash.filters.GlowFilter;
import flash.geom.Matrix;
import flash.geom.Matrix3D;
import flash.geom.Point;
import flash.geom.Rectangle;
import mx.core.mx_internal;
use namespace mx_internal;
/**
* The ErrorSkin class defines the error skin for Spark components.
* Flex displays the error skin when a validation error occurs.
*
* @see mx.validators.Validator
*
* @langversion 3.0
* @playerversion Flash 10
* @playerversion AIR 1.5
* @productversion Flex 4
*/
public class ErrorSkin extends HighlightBitmapCaptureSkin
{
//--------------------------------------------------------------------------
//
// Class constants
//
//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
//
// Class variables
//
//--------------------------------------------------------------------------
private static var glowFilter:GlowFilter = new GlowFilter(
0xFF0000, 0.85, 2, 2, 3, 1, false, true);
private static var rect:Rectangle = new Rectangle();;
private static var filterPt:Point = new Point();
//--------------------------------------------------------------------------
//
// Constructor
//
//--------------------------------------------------------------------------
/**
* Constructor.
*
* @langversion 3.0
* @playerversion Flash 10
* @playerversion AIR 1.5
* @productversion Flex 4
*/
public function ErrorSkin()
{
super();
mouseEnabled = false;
mouseChildren = false;
}
//--------------------------------------------------------------------------
//
// Variables
//
//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
//
// Overridden methods
//
//--------------------------------------------------------------------------
/**
* @private
*/
override protected function processBitmap() : void
{
// Apply the glow filter
rect.x = rect.y = 0;
rect.width = bitmap.bitmapData.width;
rect.height = bitmap.bitmapData.height;
glowFilter.color = target.getStyle("errorColor");
bitmap.bitmapData.applyFilter(bitmap.bitmapData, rect, filterPt, glowFilter);
}
/**
* @inheritDoc
*/
override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
{
// Early exit if we don't have a target object
if (!target)
return;
super.updateDisplayList(unscaledWidth, unscaledHeight);
// Set the size of the bitmap to be the size of the component. This has the effect
// of overlaying the error skin on the border of the component.
bitmap.x = bitmap.y = 0;
bitmap.width = target.width;
bitmap.height = target.height;
}
}
}
|
package flash.text
{
import flash.events.*;
dynamic public class StyleSheet extends EventDispatcher
{
public function get styleNames():Array
{
}
public function StyleSheet()
{
}
public function parseCSS(CSSText:String):void
{
}
public function clear():void
{
}
public function transform(formatObject:Object):TextFormat
{
}
public function setStyle(styleName:String, styleObject:Object):void
{
}
public function getStyle(styleName:String):Object
{
}
}
}
|
/* See LICENSE for copyright and terms of use */
import org.actionstep.color.view.ASWheelColorPickerView;
import org.actionstep.NSColorPanel;
import org.actionstep.NSColorPicker;
import org.actionstep.NSColorPicking;
import org.actionstep.NSControl;
import org.actionstep.NSImage;
import org.actionstep.NSSize;
/**
* Implementation of the wheel color picker.
*
* @author Scott Hyndman
*/
class org.actionstep.color.ASWheelColorPicker extends NSColorPicker {
//******************************************************
//* Constants
//******************************************************
private static var MIN_CONTENT_WIDTH:Number = 250;
private static var MIN_CONTENT_HEIGHT:Number = 180;
//******************************************************
//* Members
//******************************************************
/** View used internally */
private var m_view:ASWheelColorPickerView;
//******************************************************
//* Initializing an NSColorPicker
//******************************************************
/**
* Sets the receiver’s color panel to <code>owningColorPanel</code>, caching
* the <code>owningColorPanel</code> value so it can later be returned by
* the {@link #colorPanel} method.
*
* @see #colorPanel
*/
public function initWithPickerMaskColorPanel(mask:Number,
owningColorPanel:NSColorPanel):NSColorPicking {
super.initWithPickerMaskColorPanel(mask, owningColorPanel);
m_mode = NSColorPanel.NSWheelModeColorPanel;
return this;
}
//******************************************************
//* Current Color
//******************************************************
/**
* Invoked when the color changes.
*/
private function colorChanged(sender:Object):Void {
if (sender == this) {
m_view.setColor(m_color);
} else {
super.colorChanged(sender);
}
}
//******************************************************
//* Getting the identifier
//******************************************************
/**
* <p>Returns a unique name for this picker.</p>
*/
public function identifier():String {
return "ASWheelColorPicker";
}
//******************************************************
//* Getting the view
//******************************************************
/**
* Returns the slider picker's minimum content size.
*/
public function minContentSize():NSSize {
return new NSSize(MIN_CONTENT_WIDTH, MIN_CONTENT_HEIGHT);
}
/**
* Returns the ASSliderColorPickerView instance.
*/
public function pickerView():NSControl {
if (m_view == null) {
m_view = (new ASWheelColorPickerView()).initWithPicker(this);
}
return m_view;
}
//******************************************************
//* Button stuff
//******************************************************
/**
* <p>Returns the button image for the receiver.</p>
*
* <p>The color panel will place this image in the mode button the user uses
* to select this picker.</p>
*
* @see #insertNewButtonImageIn
*/
public function provideNewButtonImage():NSImage {
return (new NSImage()).initWithContentsOfURL("test/picker_wheel.png");
}
/**
* <p>Returns the tool tip text for this picker's button.</p>
*/
public function buttonToolTip():String {
return "Color Wheel";
}
//******************************************************
//* Class construction
//******************************************************
/**
* Adds a slider color picker to the global definitions.
*/
private static function initialize():Void {
var picker:NSColorPicking = new ASWheelColorPicker();
NSColorPicker._addPicker(picker);
}
} |
package cmodule.lua_wrapper
{
public const _panic:int = regFunc(FSM_panic.start);
}
|
/*
* Copyright 2010 Swiz Framework Contributors
*
* 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. 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.apache.royale.crux.factories
{
import org.apache.royale.crux.reflection.IMetadataHost;
import org.apache.royale.crux.reflection.MetadataHostClass;
import org.apache.royale.crux.reflection.MetadataHostMethod;
import org.apache.royale.crux.reflection.MetadataHostProperty;
import org.apache.royale.crux.reflection.MethodParameter;
import org.apache.royale.reflection.DefinitionWithMetaData;
import org.apache.royale.reflection.MethodDefinition;
import org.apache.royale.reflection.ParameterDefinition;
import org.apache.royale.reflection.TypeDefinition;
import org.apache.royale.reflection.VariableDefinition;
import org.apache.royale.reflection.getDefinitionByName;
import org.apache.royale.reflection.getQualifiedClassName;
/**
* Simple factory to create the different kinds of metadata
* hosts and to encapsulate the logic for determining which type
* should be created.
*/
public class MetadataHostFactory
{
public function MetadataHostFactory()
{
}
/**
* Returns an <code>IMetadataHost</code> instance representing a property,
* method or class that is decorated with metadata.
*
* @param hostNode DefinitionWithMetaData node representing a property, method or class
* @return <code>IMetadataHost</code> instance
*
* @see org.apache.royale.crux.reflection.MetadataHostClass
* @see org.apache.royale.crux.reflection.MetadataHostMethod
* @see org.apache.royale.crux.reflection.MetadataHostProperty
*/
public static function getMetadataHost(hostNode:DefinitionWithMetaData):IMetadataHost
{
var host:IMetadataHost;
// property, method or class?
if( hostNode is TypeDefinition )
{
host = new MetadataHostClass();
host.type = getDefinitionByName(TypeDefinition(hostNode).qualifiedName) as Class;
}
else if( hostNode is MethodDefinition )
{
var metadataHostMethod:MetadataHostMethod = new MetadataHostMethod();
host = metadataHostMethod;
var method:MethodDefinition = hostNode as MethodDefinition;
if( method.returnType.qualifiedName != "void" && method.returnType.qualifiedName != "*" )
{
metadataHostMethod.returnType = Class( getDefinitionByName( method.returnType.qualifiedName ) );
}
for each( var pNode:ParameterDefinition in method.parameters )
{
var pType:Class = pNode.type.qualifiedName == "*" ? Object : Class( getDefinitionByName( pNode.type.qualifiedName ) );
metadataHostMethod.parameters.push( new MethodParameter( pNode.index, pType, pNode.optional ) );
}
metadataHostMethod.sourceDefinition = method;
}
else
{
//it is either an VariableDefinition or an AccessorDefinition (which is a subclass of VariableDefinition)
var varDef:VariableDefinition = hostNode as VariableDefinition;
var metadataHostProperty:MetadataHostProperty = new MetadataHostProperty();
host = metadataHostProperty;
metadataHostProperty.sourceDefinition = varDef;
metadataHostProperty.type = varDef.type.qualifiedName == "*" ? Object : Class( getDefinitionByName( varDef.type.qualifiedName ) );
}
host.name = hostNode.name;
return host;
}
}
}
|
////////////////////////////////////////////////////////////////////////////////
//
// 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
{
import mx.core.UIComponent;
import mx.effects.IEffect;
import spark.components.Group;
/*
import flash.display.DisplayObject;
import mx.core.FlexVersion;
import mx.core.UIComponent;
import mx.core.mx_internal;
import spark.components.Group;
import spark.core.DisplayObjectSharingMode;
import spark.core.IGraphicElement;
import spark.skins.IHighlightBitmapCaptureClient;
use namespace mx_internal;
*/
/**
* The Skin class defines the base class for all skins used by skinnable components.
* The SkinnableComponent class defines the base class for skinnable components.
*
* <p>You typically write the skin classes in MXML, as the followiong example shows:</p>
*
* <pre> <?xml version="1.0"?>
* <Skin xmlns="http://ns.adobe.com/mxml/2009">
*
* <Metadata>
* <!-- Specify the component that uses this skin class. -->
* [HostComponent("my.component.MyComponent")]
* </Metadata>
*
* <states>
* <!-- Specify the states controlled by this skin. -->
* </states>
*
* <!-- Define skin. -->
*
* </Skin></pre>
*
* @see mx.core.SkinnableComponent
*
* @langversion 3.0
* @playerversion Flash 10
* @playerversion AIR 1.5
* @productversion Flex 4
*/
public class Skin extends Group //implements IHighlightBitmapCaptureClient
{
//include "../../core/Version.as";
//--------------------------------------------------------------------------
//
// Constructor
//
//--------------------------------------------------------------------------
/**
* Constructor.
*
* @langversion 3.0
* @playerversion Flash 10
* @playerversion AIR 1.5
* @productversion Flex 4
*/
public function Skin()
{
super();
}
public function set addedEffect(value:Object):void {} // not implemented
public function set removedEffect(value:Object):void {} // not implemented
public function get focusSkinExclusions() : Array {return []} // not implemented
}
}
|
package net.wooga.selectors.matching.matchers.implementations.combinators {
public class CombinatorType {
private var _value:String;
public function CombinatorType(value:String) {
_value = value;
}
public static const CHILD:CombinatorType = new CombinatorType("CHILD");
public static const DESCENDANT:CombinatorType = new CombinatorType("DESCENDANT");
public static const GENERAL_SIBLING:CombinatorType = new CombinatorType("GENERAL_SIBLING");
public static const ADJACENT_SIBLING:CombinatorType = new CombinatorType("ADJACENT_SIBLING");
public function toString():String {
return _value;
}
}
}
|
package com.tinyspeck.engine.view.gameoverlay {
import com.tinyspeck.tstweener.TSTweener;
import com.tinyspeck.core.beacon.StageBeacon;
import com.tinyspeck.debug.Console;
import com.tinyspeck.engine.control.TSFrontController;
import com.tinyspeck.engine.data.client.ConfirmationDialogVO;
import com.tinyspeck.engine.data.prompt.Prompt;
import com.tinyspeck.engine.model.TSModelLocator;
import com.tinyspeck.engine.net.NetOutgoingPromptChoiceVO;
import com.tinyspeck.engine.port.AssetManager;
import com.tinyspeck.engine.port.CSSManager;
import com.tinyspeck.engine.port.ConfirmationDialog;
import com.tinyspeck.engine.port.WindowBorder;
import com.tinyspeck.engine.sound.SoundMaster;
import com.tinyspeck.engine.util.StringUtil;
import com.tinyspeck.engine.util.TFUtil;
import com.tinyspeck.engine.view.AbstractTSView;
import com.tinyspeck.engine.view.gameoverlay.maps.MiniMapView;
import com.tinyspeck.engine.view.ui.Button;
import com.tinyspeck.engine.view.ui.TSLinkedTextField;
import com.tinyspeck.engine.view.util.StaticFilters;
import flash.display.DisplayObject;
import flash.display.Graphics;
import flash.display.Sprite;
import flash.events.MouseEvent;
import flash.text.TextField;
public class PromptView extends AbstractTSView {
/* singleton boilerplate */
public static const instance:PromptView = new PromptView();
private const MAX_BUTTON_WIDTHS:uint = 100;
private var model:TSModelLocator;
private var padd:int = 7;
private var overall_w:int = 300;
private var all_holder:Sprite = new Sprite();
private var active_holder:Sprite = new Sprite();
private var deleted_holder:Sprite = new Sprite();
private var removeables:Array = [];
private var over:Boolean = false;
private var out_timer:uint;
public function PromptView():void {
CONFIG::god {
if(instance) throw new Error('Singleton');
}
model = TSModelLocator.instance;
addChild(all_holder);
all_holder.addChild(deleted_holder);
all_holder.addChild(active_holder);
model.activityModel.registerCBProp(checkForNewPrompts, "prompts");
model.activityModel.registerCBProp(removePromptByUid, "prompt_del");
this.addEventListener(MouseEvent.ROLL_OVER, onRollOver);
this.addEventListener(MouseEvent.ROLL_OUT, onRollOut);
StageBeacon.setInterval(checkForNewPrompts, 5000);
}
public function startFakingPrompts():void {
if (model.flashVarModel.fake_prompts) {
var c:int = 0;
var text:String = "In that flash example, be sure to roll over the blue part of the button to really see the difference(note that the blue rectangle is inside the black rectangle movieClip, not just over). In the MOUSE_OVER example, the event is fired for every children of the display object that the listener was added to.";
StageBeacon.setInterval(function():void {
/*model.activityModel.addPrompt(Prompt.fromAnonymous({
uid: new Date().getTime()+c,
timeout: 4,
txt: (c++)+text.substr(0, Math.ceil(Math.random()*text.length-1)),
icon_buttons: true,
timeout_value: '',
choices: [{
value: 'yes',
label: 'Yes'
}, {
value: 'no',
label: 'No'
}]
}));
*/model.activityModel.addPrompt(Prompt.fromAnonymous({
uid: new Date().getTime()+c,
timeout: 0,
is_modal: true,
escape_value:'fucj',
txt: (c++)+text.substr(0, Math.ceil(Math.random()*text.length-1)),
icon_buttons: false,
choices: [{
value: 'yes',
label: 'Yes'
}, {
value: 'no',
label: 'No'
}]
}));
/*model.activityModel.addPrompt(Prompt.fromAnonymous({
uid: new Date().getTime()+c,
timeout: 3,
txt: (c++)+text.substr(0, Math.ceil(Math.random()*text.length-1)),
icon_buttons: true,
timeout_value: 'DID TIMEOUT',
choices: [{
value: 'yes',
label: 'Yes'
}, {
value: 'no',
label: 'No'
}]
}))*/
}, 5000);
}
}
private function onRollOut(e:MouseEvent):void {
over = false;
out_timer = StageBeacon.setTimeout(function():void {
while (removeables.length) {
removePromptAndSendChoice(removeables.shift());
}
}, 2000);
}
private function onRollOver(e:MouseEvent):void {
TipDisplayManager.instance.goAway();
over = true;
StageBeacon.clearTimeout(out_timer);
}
private function clickHandler(e:MouseEvent):void {
if (e.target is Button) {
TipDisplayManager.instance.goAway();
var bt:Button = Button(e.target);
var sp:Sprite = bt.parent as Sprite;
if (sp.parent == deleted_holder) {
SoundMaster.instance.playSound('CLICK_FAILURE');
return;
} else {
SoundMaster.instance.playSound('CLICK_SUCCESS');
}
//model.activityModel.removePrompt(sp.name);
var prompt:Prompt = model.activityModel.getPromptByUid(sp.name);
var choice:Object = prompt.choices[int(bt.name)];
removePromptAndSendChoice(sp, choice.value);
}
}
private function removePromptIfNotOver(sp:Sprite):void {
if (over) {
if (removeables.indexOf(sp) == -1) removeables.push(sp);
} else {
removePromptAndSendChoice(sp);
}
}
private function removePromptByUid(uid:String):void {
var sp:Sprite = active_holder.getChildByName(uid) as Sprite;
if (sp) {
removePrompt(sp)
}
}
private function sendChoice(prompt:Prompt, value_to_send:String):void {
if (!prompt) { // it might have been removed
return;
}
// we were not passed a value_to_send, so let's get the default value from the prompt
if (value_to_send === null) {
value_to_send = prompt.timeout_value;
}
// if we have any value, send it
if (value_to_send) {
TSFrontController.instance.genericSend(new NetOutgoingPromptChoiceVO(prompt.uid, value_to_send));
} else {
; // satisfy compiler
CONFIG::debugging {
Console.warn('not sending value');
}
}
}
private function removePromptAndSendChoice(sp:Sprite, value_to_send:String = null):void {
var prompt:Prompt = model.activityModel.getPromptByUid(sp.name);
sendChoice(prompt, value_to_send);
if (sp && sp.parent) removePrompt(sp);
}
private function removePrompt(sp:Sprite):void {
deleted_holder.addChild(sp);
if (sp.parent) TSTweener.addTween(sp, {alpha:0, time:.1, transition:'linear'});
StageBeacon.setTimeout(function():void {
if (sp.parent) sp.parent.removeChild(sp);
sp.removeEventListener(MouseEvent.MOUSE_OVER, overHandler);
sp.removeEventListener(MouseEvent.MOUSE_OUT, outHandler);
reflow();
checkForNewPrompts();
}, 200);
}
private function addPrompt(prompt:Prompt):void {
if(!prompt.txt) {
CONFIG::debugging {
Console.warn('WTF null prompt');
}
return;
}
prompt.displayed = true;
var sp:Sprite = new Sprite();
sp.y = 0;
sp.name = String(prompt.uid);
var tf:TSLinkedTextField = new TSLinkedTextField();
TFUtil.prepTF(tf);
tf.name = 'tf';
sp.addChild(tf);
sp.addEventListener(MouseEvent.CLICK, clickHandler);
var prompt_txt:String = prompt.txt;
const vag_ok:Boolean = StringUtil.VagCanRender(prompt_txt);
if(!vag_ok){
prompt_txt = '<font face="Arial">'+prompt_txt+'</font>';
}
tf.embedFonts = vag_ok;
tf.width = overall_w-(padd*2);
tf.htmlText = '<span class="prompt_default">'+prompt_txt+'</span>';
tf.x = padd;
tf.y = padd;
tf.borderColor = 0xffffff;
tf.border = false;
tf.filters = StaticFilters.prompt_DropShadowA;
var icon_button_w:int = 24;
var icon_button_h:int = CSSManager.instance.getNumberValueFromStyle('button_tiny', 'height', 25);
var shadow_offset:int = CSSManager.instance.getNumberValueFromStyle('button_tiny', 'shadowOffset', 1);
shadow_offset = shadow_offset < 0 ? -shadow_offset : shadow_offset; //make sure it's possitive
var choice:Object;
var i:int;
var bt:Button;
var button_widths:int;
if (prompt.icon_buttons && prompt.choices.length == 2) {
// make some space at the right for the icon buttons
tf.width = tf.width-((icon_button_w*2)+(padd*2));
// add the icon buttons
for (i=prompt.choices.length-1;i>-1;i--) {
choice = prompt.choices[int(i)];
bt = new Button({
tip: {
txt: ''+choice.label+'',
pointer: WindowBorder.POINTER_BOTTOM_CENTER
},
graphic: (i==0) ? new AssetManager.instance.assets.prompt_check() : new AssetManager.instance.assets.prompt_x(),
name: i,
value: choice.value,
w: icon_button_w,
y: int(Math.max(padd, tf.y+tf.height-icon_button_h)),
x: int(overall_w - padd - shadow_offset - ((icon_button_w-2)*(2-i))),
size: Button.SIZE_TINY,
type: (i==0) ? Button.TYPE_LEFT : Button.TYPE_RIGHT
});
sp.addChild(bt);
if(i == 0){
var icon_div:Sprite = createButtonDivider(icon_button_h-2);
icon_div.x = overall_w - padd - icon_button_w + 2;
icon_div.y = bt.y+1;
sp.addChild(icon_div);
}
}
} else {
// add normal buttons
var start_x:int = overall_w;
var bt_type:String = Button.TYPE_MIDDLE;
for (i=prompt.choices.length-1;i>-1;i--) {
if(prompt.choices.length == 1){
bt_type = Button.TYPE_SINGLE;
}else if(i == 0){
bt_type = Button.TYPE_LEFT;
}else if(i == prompt.choices.length - 1){
bt_type = Button.TYPE_RIGHT;
}
choice = prompt.choices[int(i)];
bt = new Button({
label: choice.label,
name: i,
value: choice.value,
size: Button.SIZE_TINY,
type: bt_type
});
button_widths += bt.width;
bt.y = int(tf.y + tf.height - bt.height + padd*2);
bt.x = start_x-padd-bt.width-shadow_offset;
sp.addChild(bt);
start_x = bt.x + 7;
if(i < prompt.choices.length - 1 && prompt.choices.length > 1){
var norm_div:Sprite = createButtonDivider(icon_button_h-2);
norm_div.x = bt.x + bt.width + 1;
norm_div.y = bt.y + 1;
norm_div.name = 'divider'+i;
sp.addChild(norm_div);
}
}
tf.width = tf.width-(button_widths+padd*2);
}
//re-position text and buttons if the width of the buttons is big
if(button_widths > MAX_BUTTON_WIDTHS){
tf.width = overall_w-(padd*2);
for (i=prompt.choices.length-1;i>-1;i--) {
bt = sp.getChildByName(i.toString()) as Button;
bt.y = Math.round(tf.y+tf.height+padd);
var divider:Sprite = sp.getChildByName('divider'+i) as Sprite;
if(divider) divider.y = bt.y + 1;
}
}
//play a sound if there is one
if(prompt.sound) SoundMaster.instance.playSound(prompt.sound);
drawNotification(sp);
sp.addEventListener(MouseEvent.MOUSE_OVER, overHandler);
sp.addEventListener(MouseEvent.MOUSE_OUT, outHandler);
sp.alpha = .1;
TSTweener.addTween(sp, {alpha:1, time:.1, delay:0, transition:'linear'});
active_holder.addChildAt(sp, 0);
reflow();
var ms:int = prompt.timeout*1000;
if (ms) {
StageBeacon.setTimeout(removePromptIfNotOver, ms, sp);
}
}
private function overHandler(e:*):void {
drawNotification(Sprite(e.currentTarget), true);
}
private function outHandler(e:*):void {
drawNotification(Sprite(e.currentTarget), false);
}
private function drawNotification(sp:Sprite, over:Boolean = false):void {
var tf:TextField = TextField(sp.getChildByName('tf'));
var back_color:uint = CSSManager.instance.getUintColorValueFromStyle('prompt_background', 'color', 0x393b32);
var back_alpha:Number = CSSManager.instance.getNumberValueFromStyle('prompt_background', 'alpha', .9);
sp.graphics.clear();
var h:int = sp.height+(padd*2);
sp.graphics.beginFill(back_color, back_alpha);
sp.graphics.drawRoundRect(0, 0, overall_w, h, 12);
}
private function reflow():void {
var sp:DisplayObject;
var next_y:int = 0;
for (var i:int=0;i<active_holder.numChildren;i++) {
if (sp) next_y+= sp.height+padd;
sp = active_holder.getChildAt(i);
TSTweener.addTween(sp, {y:next_y, time:.1, transition:'easeOutCubic'});
}
var dest_y:int = 0;
if (sp) {
dest_y = -(next_y+sp.height);
}
TSTweener.removeTweens(all_holder);
TSTweener.addTween(all_holder, {y:dest_y, time:.1, transition:'easeOutCubic'});
var g:Graphics = this.graphics;
g.clear();
g.beginFill(0x000000, 0);
g.drawRect(0, 0, overall_w, dest_y);
refresh();
//if we have any active prompts, we need to hide the gps
MiniMapView.instance.showHideGPS(active_holder.numChildren > 0);
}
private function createButtonDivider(h:int):Sprite {
var divider:Sprite = new Sprite();
divider.mouseEnabled = false;
var g:Graphics = divider.graphics;
g.beginFill(0x838383, 1);
g.drawRect(0, 0, 1, h);
g.beginFill(0xFFFFFF, 1);
g.drawRect(1, 0, 1, h);
return divider;
}
public function refresh():void {
x = model.layoutModel.loc_vp_w-overall_w-30;
y = model.layoutModel.loc_vp_h-30;
visible = (!model.moveModel.moving);
CONFIG::god {
visible &&= (!model.stateModel.editing && !model.stateModel.hand_of_god);
}
CONFIG::perf {
if (model.flashVarModel.run_automated_tests) {
visible = false;
}
}
}
public function checkForNewPrompts(prompts:Array = null):void {
prompts = prompts || model.activityModel.prompts;
var prompt:Prompt;
for (var i:int;i<prompts.length;i++) {
prompt = prompts[int(i)];
// always do modal ones
if (prompt.is_modal) {
if (!prompt.displayed && !ConfirmationDialog.instance.parent && !model.moveModel.moving) {
// here do a modal dialog
var cdVO:ConfirmationDialogVO = new ConfirmationDialogVO();
cdVO.item_class = prompt.item_class || cdVO.item_class;
cdVO.callback = function(value:*):void {
//get the prompt based on the dialog name because the 'prompt' could be changed before the dialog
//has a parent. race conditions FTW.
prompt = model.activityModel.getPromptByUid(ConfirmationDialog.instance.uid);
if(prompt && prompt.displayed){
sendChoice(prompt, value);
}
else if(!prompt){
;//weeee
CONFIG::debugging {
Console.warn('Could not find prompt for UID: '+ConfirmationDialog.instance.uid);
}
}
};
cdVO.txt = prompt.txt;
cdVO.choices = prompt.choices;
cdVO.escape_value = prompt.escape_value;
cdVO.max_w = prompt.max_w;
if (prompt.title) cdVO.title = prompt.title;
if (TSFrontController.instance.confirm(cdVO)) {
prompt.displayed = true;
//store the UID in the dialog
ConfirmationDialog.instance.uid = prompt.uid;
}
}
continue;
}
// only do normal ones if there is room
if (height<model.layoutModel.loc_vp_h/2 || prompt.is_modal) {
if (!prompt.displayed) {
addPrompt(prompt);
}
};
}
}
}
} |
package starling.display.materials
{
public class FlatColorMaterial extends StandardMaterial
{
public function FlatColorMaterial(color:uint = 0xFFFFFF)
{
this.color = color;
}
}
} |
/* AS3
Copyright 2008
*/
package com.neopets.projects.np9.vendorInterface
{
import com.neopets.projects.gameEngine.gui.Interface.GameOverScreen;
import com.neopets.projects.gameEngine.gui.Interface.GameScreen;
import com.neopets.projects.gameEngine.gui.Interface.InstructionScreen;
import com.neopets.projects.gameEngine.gui.Interface.OpeningScreen;
import com.neopets.projects.gameEngine.gui.MenuManager;
import com.neopets.projects.np9.system.NP9_Evar;
import com.neopets.util.events.CustomEvent;
import flash.display.MovieClip;
import flash.events.Event;
import virtualworlds.lang.TranslationData;
import virtualworlds.lang.TranslationManager;
/**
* This is some Neopets Functions that you will need for translation and Menu Control
* You Should Have your Main Game Engine Extend this Class
*
* @langversion ActionScript 3.0
* @playerversion Flash 9.0
* @Pattern Neopets Game System
*
* @author Clive Henrick
* @since 7.10.2009
*/
public class NP9_VendorGameExtension extends MovieClip
{
//--------------------------------------
// CLASS CONSTANTS
//--------------------------------------
//--------------------------------------
// PRIVATE VARIABLES
//--------------------------------------
protected var mTranslationInfo:TranslationData;
protected var mMenuManager:MenuManager;
protected var mDocumentClass:MovieClip;
protected var mScore:NP9_Evar;
//--------------------------------------
// CONSTRUCTOR
//--------------------------------------
/**
* @Constructor
*/
public function NP9_VendorGameExtension():void{
super();
setVars();
}
//--------------------------------------
// GETTER/SETTERS
//--------------------------------------
//--------------------------------------
// PUBLIC METHODS
//--------------------------------------
/**
* @Note: Starts the Game Init Process.
* >> First it Sets up the Translation by Sending your TranslationList to the Engine and Waits for the Translation Engine to Tell it is loaded
*
* @Param pRoot The Document Class of your Project
*/
public function init (pRoot:MovieClip):void
{
trace ("vendor extension init called");
mDocumentClass = pRoot;
mDocumentClass.addEventListener(mDocumentClass.TRANSLATION_COMPLETE, setupTranslationComplete);
var tTranslationURL:String = mDocumentClass.neopets_GS.getFlashParam("sBaseURL");
mDocumentClass.setupTranslation(mTranslationInfo,tTranslationURL);
}
//--------------------------------------
// EVENT HANDLERS
//--------------------------------------
/**
* @Note When TranslationManager has contected to PHP and Translation is Complete.
* @Note: If you Have In game Items Needed for Translation, You should have them in them translated after this event
*/
protected function setupTranslationComplete(evt:Event):void
{
var translationManager : TranslationManager = TranslationManager.instance;
mDocumentClass.removeEventListener(mDocumentClass.TRANSLATION_COMPLETE, setupTranslationComplete);
mTranslationInfo = TranslationData(translationManager.translationData);
mMenuManager.init(mDocumentClass,mTranslationInfo);
setupMenus();
addChild(mMenuManager.menusDisplayObj);
startGameSetup();
}
/**
* @Note Events from the Menus that are from Buttons that can effect the Game
* @param evt.oData.EVENT String The Name of the Button that was pressed in the Menus
*/
protected function onMenuButtonEvent (evt:CustomEvent):void
{
switch (evt.oData.EVENT)
{
case "startGameButton": // INTRO Scene
startGame();
break;
case "quitGameButton": // GAME SCENE
quitGame();
break;
case "playAgainBtn": // Game Over SCENE
restartGame();
break;
case "reportScoreBtn": // Game Over SCENE
reportScore();
break;
case "musicToggleBtn": // INTRO SCENE
toggleMusic();
break;
case "soundToggleBtn": // INTRO SCENE
toggleSound();
break;
}
extraMenuButtons (evt.oData.EVENT);
}
/**
* @Note Events from the Menus that Effect The Game
* @param evt.oData.EVENT String The Name of the Function that you want called
*/
protected function onMenuEvent (evt:CustomEvent):void
{
switch (evt.oData.EVENT)
{
case "restartGame": // From when the Restart Game Button on the Score Report Box has been Pressed
restartGame();
break;
}
}
/**
* @Menu Navigation can trigger Events if Needed
* @param evt.oData.MENU String The Name of the Menu you have navigated to
*/
protected function onMenuNavigationEvent (evt:CustomEvent):void
{
switch (evt.oData.MENU)
{
case MenuManager.MENU_GAMEOVER_SCR: // FIRST TIME GOING TO THE END SCREEN , NEED TO SEND GAME OVER TO SERVER
mDocumentClass.neopets_GS.sendTag (mDocumentClass.END_GAME_MSG);
var tGameOverScreen:GameOverScreen = mMenuManager.getMenuScreen(MenuManager.MENU_GAMEOVER_SCR) as GameOverScreen;
tGameOverScreen.toggleInterfaceButtons(true);
break;
}
}
//--------------------------------------
// PRIVATE & PROTECTED INSTANCE METHODS
//--------------------------------------
/**
* @Note: This is all the Startup Vars
*/
protected function setVars():void
{
mMenuManager =MenuManager.instance;
mMenuManager.addEventListener(mMenuManager.MENU_EVENT, onMenuEvent, false, 0, true);
mMenuManager.addEventListener(mMenuManager.MENU_BUTTON_EVENT, onMenuButtonEvent, false, 0, true);
mMenuManager.addEventListener(mMenuManager.MENU_NAVIGATION_EVENT, onMenuNavigationEvent, false, 0, true);
mScore = new NP9_Evar(0);
}
/**
* @Note: Send Your Score to Neopets
*/
protected function reportScore():void
{
mDocumentClass.neopets_GS.sendScore(mScore.show());
}
/**
* @Note: Handles Standard Translation for Menus
*
* @Note: One Centeral Location to have all the TextFiles Converted for all the Menus These are the default values for the Default Objects.
* @Note: If you wish to override these feel free to in your Game class that Extends VendorGameExtension
* @Note: If you just want to add Menus or Translation of Text, override extendMenus function instead.
*/
protected function setupMenus():void
{
var translationManager : TranslationManager = TranslationManager.instance;
var tIntroScreen:OpeningScreen = OpeningScreen(mMenuManager.createMenu("mcOpeningScreen", MenuManager.MENU_INTRO_SCR));
var tGameScreen:GameScreen = GameScreen(mMenuManager.createMenu("mcGameScreen", MenuManager.MENU_GAME_SCR));
var tGameOverScreen:GameOverScreen = GameOverScreen(mMenuManager.createMenu("mcGameOverScreen", MenuManager.MENU_GAMEOVER_SCR));
var tInstructionScreen:InstructionScreen = InstructionScreen(mMenuManager.createMenu("mcInstructionScreen", MenuManager.MENU_INSTRUCT_SCR));
//Intro Screen
translationManager.setTextField(tIntroScreen.instructionsButton.label_txt, mTranslationInfo.IDS_BTN_INSTRUCTION);
translationManager.setTextField(tIntroScreen.startGameButton.label_txt, mTranslationInfo.IDS_BTN_START);
translationManager.setTextField(tIntroScreen.txtFld_copyright, mTranslationInfo.IDS_COPYRIGHT_TXT);
translationManager.setTextField(tIntroScreen.txtFld_title, mTranslationInfo.IDS_TITLE_NAME);
//Instruction Screen
translationManager.setTextField(tInstructionScreen.returnBtn.label_txt, mTranslationInfo.IDS_BTN_BACK);
translationManager.setTextField(tInstructionScreen.instructionTextField, mTranslationInfo.IDS_INSTRUCTION_TXT);
//In Game Screen
translationManager.setTextField(tGameScreen.quitGameButton.label_txt, mTranslationInfo.IDS_BTN_QUIT);
//Game Over Screen
translationManager.setTextField(tGameOverScreen.playAgainBtn.label_txt, mTranslationInfo.IDS_BTN_PLAYAGAIN);
translationManager.setTextField(tGameOverScreen.reportScoreBtn.label_txt, mTranslationInfo.IDS_BTN_SENDSCORE);
extendMenus();
}
//--------------------------------------
// PROTECTED OVERRIDE METHODS
//--------------------------------------
/**
* @Note: If you need to Extend Menus instead of override setupMenus, just add you Menus and Translation Here.
* @NOTE: This should be OVERRIDED in your Main Game
*/
protected function extendMenus():void
{
}
/**
* @Note: If you need to Extend Menus instead of override setupMenus, just add you Menus and Translation Here.
* @Note: Use this to add Btn Cmds to the new Menus.
* @NOTE: This should be OVERRIDED in your Main Game Class
*/
protected function extraMenuButtons (pBtnName:String):void
{
}
/**
* @NOTE: This should be OVERRIDED in your Main Game
*/
protected function restartGame():void
{
}
/**
* @Note: Starts the Game with all the Code you need to start at this Moment
* @NOTE: This should be OVERRIDED in your Main Game
*/
protected function startGame():void
{
}
/**
* @Note: Starts Setting up your Game
* @NOTE: This should be OVERRIDED in your Main Game
*/
protected function startGameSetup():void
{
}
/**
* @Note: Quit for your Game
* @NOTE: This should be OVERRIDED in your Main Game
*/
protected function quitGame():void
{
}
/**
* @Note: Toggle off the Background Music
* @NOTE: This should be OVERRIDED in your Main Game
*/
protected function toggleMusic():void
{
}
/**
* @Note: Toggle off the all Sounds
* @NOTE: This should be OVERRIDED in your Main Game
*/
protected function toggleSound():void
{
}
}
}
|
package com.tourism_in_lviv.air.net.async
{
public interface IPromiseStatus
{
function toString():String;
}
}
|
package gfw.core
{
import flash.events.Event;
import flash.display.*;
import flash.events.TimerEvent;
import flash.geom.*;
import flash.utils.Timer;
import gfw.sound.SoundManager;
import mx.collections.*;
import mx.core.UIComponent;
import spark.components.Group;
import spark.components.SkinnableContainer;
import spark.core.SpriteVisualElement;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import gfw.input.Input;
import gfw.core.GameObjectManager;
import gfw.sound.SoundManager;
/**
* ...
* @author jk
*/
public class Game
{
static public const WndWidth:int = 700;
static public const WndHeight:int = 500;
static public const m_physScale:Number = 1;
public function Game(sprite:Group) {
m_Sprite = sprite;
m_input = new Input(sprite);
m_SoundManager = new SoundManager();
m_BackBuffer = new BitmapData(m_Sprite.width, m_Sprite.height, false,m_ClearColor);
//setupWorld();
//setupDebugDraw();
//SetupHud();
//NewLevel();
//ShowMainMenu();
}
public function ShowMainMenu():void {
/*m_Screen = null;
m_Screen = new ScreenMainMenu(this);
m_Sprite.addChild(m_Screen);
m_Screen.CenterScreen(); */
}
public function ShowGameOver():void {
/*m_Screen = null;
m_Screen = new ScreenGameOver(this);
m_Sprite.addChild(m_Screen);
m_Screen.CenterScreen();*/
}
public function Shutdown():void {
m_LoopTimer.stop();
m_LoopTimer = null;
}
public function NewLevel():void {
if (m_Level != null) {
m_Level.Shutdown();
m_Level = null;
}
}
public function MouseDrag():void {
if (IsGamePaused() || IsGameRunning()) return;
Input.mouseDragX
}
public function MousePress():void {
if (IsGamePaused() || !IsGameRunning()) return;
//toogle pause on p
if ( Input.isKeyReleased(80) ) {
ShowMainMenu();
}
}
public function UpdateMouseWorld():void{
mouseXWorldPhys = (Input.mouseX)/m_physScale;
mouseYWorldPhys = (Input.mouseY)/m_physScale;
mouseXWorld = (Input.mouseX);
mouseYWorld = (Input.mouseY);
}
public function PauseGame(Flag:Boolean):void {
m_GamePaused = Flag;
if (!Flag) {
m_LastFrame = new Date();
}
}
public function IsGamePaused():Boolean {
return m_GamePaused;
}
public function IsLevelCompleted():Boolean {
var result:Boolean = true;
//??
return result;
}
public function IsGameRunning():Boolean {
if (m_Level != null) return true;
return false;
}
public function IsGameOver():Boolean {
if ( m_GameOver) return true;
if ( IsGameRunning()) {
//??
}
return false;
}
public function Tick(e:Event):void {
if (IsGameOver()) {
m_Level.Shutdown();
m_Level = null;
m_GameOver = false;
ShowGameOver();
}
if(IsGameRunning()) UpdateGame(e);
}
protected function RenderGame(e:Event):void {
m_BackBuffer.lock();
m_BackBuffer.fillRect(m_BackBuffer.rect,0xFFFFFF);
var cursor:IViewCursor= GameObjectManager.Instance.CreateCursor();
while (cursor.current != null ) {
cursor.current.Render(null);
cursor.current.CopyToBackBuffer(m_BackBuffer);
cursor.moveNext();
}
cursor = null;
m_BackBuffer.unlock();
m_Sprite.graphics.clear(); //if clear is not called, we get a memory leak
m_Sprite.graphics.beginBitmapFill(m_BackBuffer,null,false,false);
m_Sprite.graphics.drawRect(0, 0, m_BackBuffer.width, m_BackBuffer.height);
m_Sprite.graphics.endFill();
/*testsprite.graphics.clear(); //if clear is not called, we get a memory leak
testsprite.graphics.beginBitmapFill(m_BackBuffer,null,false,false);
testsprite.graphics.drawRect(0, 0, m_BackBuffer.width, m_BackBuffer.height);
testsprite.graphics.endFill();*/
}
protected function UpdateGame(e:Event):void {
MousePress();
if (!IsGamePaused() ) {
// Calculate the time since the last frame
var thisFrame:Date = new Date();
var _seconds:Number = (thisFrame.getTime() - m_LastFrame.getTime())/1000.0;
m_LastFrame = thisFrame;
UpdateMouseWorld();
MouseDrag();
//
m_Level.Tick(_seconds);
if (IsGameOver()) {
m_GameOver = true;
}
}
Input.update();
}
public function GetView():Group {
return m_Sprite;
}
public function GetSoundMngr():SoundManager {
return m_SoundManager;
}
protected var m_Sprite:Group = null;
protected var m_Level:Level = null;
protected var m_GamePaused:Boolean = false;
protected var m_GameOver:Boolean = false;
protected var m_LoopTimer:Timer = null;
protected var m_input:Input;
protected var m_SoundManager:SoundManager = null;
// world mouse position
static public var mouseXWorldPhys:Number;
static public var mouseYWorldPhys:Number;
static public var mouseXWorld:Number;
static public var mouseYWorld:Number;
static public var timeStep:Number = 1.0 / 40.0; //??
// double buffer
private var m_BackBuffer:BitmapData;
// colour to use to clear backbuffer with
private var m_ClearColor:uint = 0xFFFFFF;
// static instance
//??protected static var instance:GameObjectManager = null;
// the last frame time
protected var m_LastFrame:Date;
}
} |
////////////////////////////////////////////////////////////////////////////////
//
// 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 bxf.ui.inspectors
{
import flash.events.MouseEvent;
import mx.containers.HBox;
import mx.controls.CheckBox;
import mx.controls.Spacer;
public class CheckboxPropertyEditor extends PropertyEditorBase implements IPropertyEditor
{
private var mChangeNotify:ValueChangeNotifier;
private var mSelected:Boolean;
private var mCheckbox:CheckBox;
private var mHangingIndent:Boolean;
private var mAlternateLabel:String; // valid if hanging indent trick mode is on
public function CheckboxPropertyEditor(inLabel:String, inPropName:String, inHangingIndent:Boolean = false, inSectionLabel:String = " ")
{
super(inHangingIndent ? inSectionLabel : inLabel);
setStyle("verticalAlign", "middle");
mChangeNotify = new ValueChangeNotifier(inPropName, this);
mHangingIndent = inHangingIndent;
mAlternateLabel = inLabel;
}
override protected function createChildren():void
{
super.createChildren();
if (mCheckbox == null) {
mCheckbox = new CheckBox();
if (!mHangingIndent)
{
addChild(mCheckbox);
}
else
{
mCheckbox.label = mAlternateLabel;
var newHBox:HBox = new HBox();
newHBox.setStyle("horizontalGap", 0);
var s:Spacer = new Spacer();
s.width = 4;
newHBox.addChild(s);
newHBox.addChild(mCheckbox);
addChild(newHBox);
}
mCheckbox.selected = mSelected;
mCheckbox.addEventListener(MouseEvent.CLICK, onMouseClick);
}
}
public function onMouseClick(inEvt:MouseEvent):void {
mChangeNotify.ValueCommitted(mCheckbox.selected ? "true" : "false");
}
public function setValueAsString(inValue:String, inProperty:String):void {
mSelected = Boolean(inValue == "true");
if (mCheckbox)
mCheckbox.selected = mSelected;
}
public function setMultiValue(inValues:Array, inProperty:String):void {
trace(this.className + ": Multivalue not supported yet.");
setValueAsString(inValues[0], inProperty);
}
}
}
|
package com.greensock.plugins
{
import com.greensock.TweenLite;
public class AutoAlphaPlugin extends TweenPlugin
{
public static const API:Number = 1;
protected var _target:Object;
protected var _ignoreVisible:Boolean;
public function AutoAlphaPlugin()
{
super();
this.propName = "autoAlpha";
this.overwriteProps = ["alpha","visible"];
}
override public function onInitTween(param1:Object, param2:*, param3:TweenLite) : Boolean
{
this._target = param1;
addTween(param1,"alpha",param1.alpha,param2,"alpha");
return true;
}
override public function killProps(param1:Object) : void
{
super.killProps(param1);
this._ignoreVisible = Boolean("visible" in param1);
}
override public function set changeFactor(param1:Number) : void
{
updateTweens(param1);
if(!this._ignoreVisible)
{
this._target.visible = Boolean(this._target.alpha != 0);
}
}
override public function autoSetNull() : void
{
if(super.hasOwnProperty("autoSetNull"))
{
super.["autoSetNull"]();
}
this._target = null;
}
}
}
|
/**
* VERSION: 3.0
* DATE: 9/14/2009
* AS2
* UPDATES AND DOCUMENTATION AT: http://www.greensock.com
**/
import com.greensock.events.Event;
/**
* EventDispatcher mimics the event model in AS3. Just extend this class to make your AS2 class
* able to dispatch events.
*
* <b>Copyright 2014, GreenSock. All rights reserved.</b> This work is subject to the terms in <a href="http://www.greensock.com/terms_of_use.html">http://www.greensock.com/terms_of_use.html</a> or for <a href="http://www.greensock.com/club/">Club GreenSock</a> members, the software agreement that was issued with the membership.
*
* @author Jack Doyle, jack@greensock.com
*/
class com.greensock.events.EventDispatcher {
private var _listeners:Array;
public function EventDispatcher() {
_listeners = [];
}
public function addEventListener(type:String, listener:Function, scope:Object):Void {
var i:Number = _listeners.length;
while (i--) {
if (_listeners[i].listener == listener && _listeners[i].type == type) {
return;
}
}
_listeners[_listeners.length] = {type:type, listener:listener, scope:scope};
}
public function removeEventListener(type:String, listener:Function):Void {
var i:Number = _listeners.length;
while (i--) {
if (_listeners[i].listener == listener && _listeners[i].type == type) {
_listeners.splice(i, 1);
return;
}
}
}
public function dispatchEvent(event:Event):Void {
event.target = this;
var type:String = event.type;
var l:Number = _listeners.length;
for (var i:Number = 0; i < l; i++) {
if (_listeners[i].type == type) {
if (_listeners[i].scope) {
_listeners[i].listener.apply(_listeners[i].scope, [event]);
} else {
_listeners[i].listener(event);
}
}
}
}
} |
//------------------------------------------------------------------------------
// Copyright (c) 2011 the original author or authors. All Rights Reserved.
//
// NOTICE: You are permitted to use, modify, and distribute this file
// in accordance with the terms of the license agreement accompanying it.
//------------------------------------------------------------------------------
package org.robotlegs.adapters
{
import flash.system.ApplicationDomain;
import org.robotlegs.core.IReflector;
import org.swiftsuspenders.reflection.DescribeTypeJSONReflector;
/**
* SwiftSuspender <code>IReflector</code> adpater - See: <a href="http://github.com/tschneidereit/SwiftSuspenders">SwiftSuspenders</a>
*
* @author tschneidereit
*/
public class SwiftSuspendersReflector implements IReflector
{
/*============================================================================*/
/* Private Properties */
/*============================================================================*/
private const _reflector:DescribeTypeJSONReflector = new DescribeTypeJSONReflector();
/*============================================================================*/
/* Public Functions */
/*============================================================================*/
public function classExtendsOrImplements(classOrClassName:Object, superclass:Class, applicationDomain:ApplicationDomain = null):Boolean
{
return _reflector.typeImplements(classOrClassName as Class, superclass);
}
public function getClass(value:*, applicationDomain:ApplicationDomain = null):Class
{
return _reflector.getClass(value);
}
public function getFQCN(value:*, replaceColons:Boolean = false):String
{
return _reflector.getFQCN(value, replaceColons);
}
}
}
|
import empire_ai.weasel.ImportData;
import resources;
// This would have been in the Resources component but the Resources of
// the resources file and the Resources of the Resources file have a name
// clash.
/**
* Infers the dummy resources from a given Resources class and the
* native/imported resources
*/
class ResourcesShim {
array<ResourceSpec@> inferDummyResources(const Object& obj) {
Resources availableResources;
availableResources.clear();
receive(obj.getResourceAmounts(), availableResources);
array<Resource> resources;
resources.syncFrom(obj.getAvailableResources());
// subtract each resource the planet has from the resource
// amounts the planet has, which will leave the dummy resources
// (or remove everything, if availableResources had been used
// as negative dummy resourcing, but that shouldn't happen and
// won't cause anything bad here if it does)
for (uint i = 0, cnt = resources.length; i < cnt; ++i) {
Resource@ resource = resources[i];
if (resource is null || resource.type is null) {
continue;
}
if (availableResources.getAmount(resource.type) > 0) {
availableResources.modAmount(resource.type, -1);
}
}
array<ResourceSpec@> inferredDummyResourceSpecs;
for (uint i = 0, cnt = availableResources.types.length; i < cnt; ++i) {
uint id = availableResources.types[i];
int amount = availableResources.amounts[i];
auto@ type = getResource(id);
//print("Found dummy resource of type "+type.name+" and amount "+amount);
for (int j = 0; j < amount; ++j) {
// assume dummy resources are always used for levelling, as
// otherwise they would have no purpose
ResourceSpec spec;
spec.isLevelRequirement = true;
// assume dummy resource was used for a level requirement or as
// a class requirement, as again otherwise it would have had
// no purpose
if (type.cls !is null) {
spec.type = RST_Class;
@spec.cls = type.cls;
} else {
spec.type = RST_Level_Specific;
spec.level = type.level;
}
inferredDummyResourceSpecs.insertLast(spec);
}
}
return inferredDummyResourceSpecs;
}
}
|
package org.casalib.load
{
import flash.display.AVM1Movie;
import flash.display.MovieClip;
import flash.system.LoaderContext;
import flash.utils.ByteArray;
import org.casalib.util.ClassUtil;
public class SwfLoad extends CasaLoader
{
protected var _classRequest:Class;
public function SwfLoad(param1:*, param2:LoaderContext = null)
{
super(param1,param2);
}
public function get contentAsMovieClip() : MovieClip
{
if(this.loaderInfo.contentType != CasaLoader.FLASH_CONTENT_TYPE)
{
throw new Error("Cannot convert content to a MovieClip.");
}
return this.content as MovieClip;
}
public function get contentAsAvm1Movie() : AVM1Movie
{
if(this.loaderInfo.contentType != CasaLoader.FLASH_CONTENT_TYPE)
{
throw new Error("Cannot convert content to an AVM1Movie.");
}
return this.content as AVM1Movie;
}
public function getDefinition(param1:String) : Object
{
if(!this.loaded)
{
throw new Error("Cannot access an external asset until the SWF has loaded.");
}
return this.loaderInfo.applicationDomain.getDefinition(param1);
}
public function hasDefinition(param1:String) : Boolean
{
if(!this.loaded)
{
throw new Error("Cannot access an external asset until the SWF has loaded.");
}
return this.loaderInfo.applicationDomain.hasDefinition(param1);
}
public function getClassByName(param1:String) : Class
{
return this.getDefinition(param1) as Class;
}
public function createClassByName(param1:String, param2:Array = null) : *
{
param2 = param2 || new Array();
param2.unshift(this.getClassByName(param1));
return ClassUtil.construct.apply(null,param2);
}
override protected function _load() : void
{
if(this._classRequest == null)
{
this._loadItem.load(this._request,this._context);
}
else
{
this._loadItem.loadBytes(new this._classRequest() as ByteArray,this._context);
}
}
override protected function _createRequest(param1:*) : void
{
if(param1 is Class)
{
this._classRequest = param1;
}
else
{
super._createRequest(param1);
}
}
}
}
|
package sandy.math
{
import flash.geom.Matrix;
import sandy.core.data.Vertex;
import sandy.errors.SingletonError;
/**
* Math functions for vertex manipulation.
*
* @author Thomas Pfeiffer - kiroukou
* @since 0.2
* @version 3.1
* @date 26.07.2007
*/
public class VertexMath extends Point3DMath
{
private static var instance:VertexMath;
private static var create:Boolean;
/**
* Creates a VertexMath object.
*
* <p>This is a singleton constructor, and should not be called directly.<br />
* If called from outside the ColorMath class, it throws a SingletonError.</p>
* <p>[<strong>ToDo</strong>: Why instantiate this at all? - all methods are class methods! ]</p>
*/
public function VertexMath(){
if ( !create )
{
throw new SingletonError();
}
}
/**
* Returns an instance of this class.
*
* <p>Call this method to get an instance of VertexMath.</p>
*/
public static function getInstance():VertexMath
{
if (instance == null)
{
create = true;
instance = new VertexMath();
create = false;
}
return instance;
}
/**
* Computes the opposite of a vertex.
*
* <p>The opposite vertex is a vertex where all components are multiplied by <code>-1</code>.</p>
*
* @param p_oV The vertex.
*
* @return The opposite vertex.
*/
public static function negate( p_oV:Vertex ): Vertex
{
return new Vertex (
- p_oV.x,
- p_oV.y,
- p_oV.z
);
}
/**
* Computes the dot product of the two vertices.
*
* @param p_oV The first vertex.
* @param p_oW The second vertex.
*
* @return The dot procuct.
*/
public static function dot( p_oV: Vertex, p_oW: Vertex):Number
{
return ( p_oV.wx * p_oW.wx + p_oV.wy * p_oW.wy + p_oW.wz * p_oV.wz );
}
/**
* Adds the two vertices.
*
* <p>[<strong>ToDo</strong>: Check here! We should add all the properties of the vertices! ]</p>
*
* @param p_oV The first vertex.
* @param p_oW The second vertex.
*
* @return The resulting vertex.
*/
public static function addVertex( p_oV:Vertex, p_oW:Vertex ): Vertex
{
return new Vertex( p_oV.x + p_oW.x ,
p_oV.y + p_oW.y ,
p_oV.z + p_oW.z,
p_oV.wx + p_oW.wx ,
p_oV.wy + p_oW.wy ,
p_oV.wz + p_oW.wz );
}
/**
* Substracts one vertices from another.
*
* @param p_oV The vertex to subtract from.
* @param p_oW The vertex to subtract.
*
* @return The resulting vertex.
*/
public static function sub( p_oV:Vertex, p_oW:Vertex ): Vertex
{
return new Vertex(
p_oV.x - p_oW.x ,
p_oV.y - p_oW.y ,
p_oV.z - p_oW.z ,
p_oV.wx - p_oW.wx ,
p_oV.wy - p_oW.wy ,
p_oV.wz - p_oW.wz
);
}
/**
* Computes the cross product the two vertices.
*
* @param p_oV The first vertex.
* @param p_oW The second vertex.
*
* @return The resulting cross product.
*/
public static function cross(p_oW:Vertex, p_oV:Vertex):Vertex
{
// cross product Point3D that will be returned
return new Vertex ( (p_oW.y * p_oV.z) - (p_oW.z * p_oV.y) ,
(p_oW.z * p_oV.x) - (p_oW.x * p_oV.z) ,
(p_oW.x * p_oV.y) - (p_oW.y * p_oV.x)
);
}
/**
* Clones a vertex.
*
* @param p_oV A vertex to clone.
*
* @return The clone.
*/
public static function clone( p_oV:Vertex ): Vertex
{
return new Vertex( p_oV.x, p_oV.y, p_oV.z );
}
/**
* Calculates linear gradient matrix from three vertices and ratios.
*
* <p>This function expects vertices to be ordered in such a way that p_nR0 < p_nR1 < p_n2.
* Ratios can be scaled by any positive factor.</p>
* <p>See flash.display.Graphics.beginGradientFill() documentation for ratios meaning.</p>
*
* @param p_oV0 The leftmost vertex in a gradient.
* @param p_oV1 The inner vertex in a gradient.
* @param p_oV2 The rightmost vertex in a gradient.
* @param p_nR0 The ratio for the leftmost vertext.
* @param p_nR1 The ratio for the inner vertex.
* @param p_nR2 The ratio for the rightmost.
* @param p_oMatrix The matrix to use.
*
* @return The transformation matrix to use with beginGradientFill (GradientType.LINEAR only).
*/
public static function linearGradientMatrix (p_oV0:Vertex, p_oV1:Vertex, p_oV2:Vertex,
p_nR0:Number, p_nR1:Number, p_nR2:Number, p_oMatrix:Matrix = null):Matrix
{
const coef:Number = (p_nR1 - p_nR0) / (p_nR2 - p_nR0);
const p3x:Number = p_oV0.sx + coef * (p_oV2.sx - p_oV0.sx);
const p3y:Number = p_oV0.sy + coef * (p_oV2.sy - p_oV0.sy);
const p4x:Number = p_oV2.sx - p_oV0.sx;
const p4y:Number = p_oV2.sy - p_oV0.sy;
const p4len:Number = Math.sqrt (p4x*p4x + p4y*p4y);
const d:Number = Math.atan2 (p3x - p_oV1.sx, -(p3y - p_oV1.sy));
if (p_oMatrix != null)
p_oMatrix.identity ();
else
p_oMatrix = new Matrix ();
p_oMatrix.a = Math.cos (Math.atan2 (p4y, p4x) - d) * p4len / (32768 * 0.05);
p_oMatrix.rotate (d);
p_oMatrix.translate ((p_oV2.sx + p_oV0.sx) / 2, (p_oV2.sy + p_oV0.sy) / 2);
return p_oMatrix;
}
}
} |
package com.swfwire.decompiler.abc.instructions
{
import com.swfwire.decompiler.abc.*;
public class Instruction_inclocal implements IInstruction
{
public var index:uint;
}
} |
class Converter {
static function convert(pt:Object, mc1:MovieClip, mc2:MovieClip):Object{
mc1.localToGlobal(pt)
if(mc2) mc2.globalToLocal(pt)
return pt
}
} |
package asunit.framework {
import flash.events.Event;
public class ErrorEvent extends Event {
public static const ERROR:String = 'error';
protected var _error:Error;
public function ErrorEvent(type:String, error:Error) {
super(type);
this._error = error;
}
override public function clone():Event {
return new ErrorEvent(type, _error);
}
public function get error():Error { return _error; }
}
}
|
interface Pink extends Red {
}
|
package kabam.rotmg.errors {
import kabam.rotmg.application.api.ApplicationSetup;
import kabam.rotmg.errors.control.ErrorSignal;
import kabam.rotmg.errors.control.LogErrorCommand;
import kabam.rotmg.errors.control.ReportErrorToAppEngineCommand;
import kabam.rotmg.errors.view.ErrorMediator;
import org.swiftsuspenders.Injector;
import robotlegs.bender.extensions.mediatorMap.api.IMediatorMap;
import robotlegs.bender.extensions.signalCommandMap.api.ISignalCommandMap;
import robotlegs.bender.framework.api.IConfig;
public class ErrorConfig implements IConfig {
[Inject]
public var injector:Injector;
[Inject]
public var mediatorMap:IMediatorMap;
[Inject]
public var commandMap:ISignalCommandMap;
[Inject]
public var setup:ApplicationSetup;
public function configure():void {
this.mediatorMap.map(WebMain).toMediator(ErrorMediator);
this.mapErrorCommand();
}
private function mapErrorCommand():void {
if (this.setup.areErrorsReported()) {
this.commandMap.map(ErrorSignal).toCommand(ReportErrorToAppEngineCommand);
}
else {
this.commandMap.map(ErrorSignal).toCommand(LogErrorCommand);
}
}
}
}//package kabam.rotmg.errors
|
package com.playfab.MultiplayerModels
{
public class DeleteAssetRequest
{
public var FileName:String;
public function DeleteAssetRequest(data:Object=null)
{
if(data == null)
return;
FileName = data.FileName;
}
}
}
|
package visuals.ui.elements.slotmachine
{
import com.playata.framework.display.Sprite;
import com.playata.framework.display.lib.flash.FlashDisplayObjectContainer;
import com.playata.framework.display.lib.flash.FlashSprite;
import flash.display.MovieClip;
public class SymbolSlotmachineAnimationLightsRedGeneric extends Sprite
{
private var _nativeObject:SymbolSlotmachineAnimationLightsRed = null;
public var lampLeft:SymbolSlotmachineLightRedLeftGeneric = null;
public var lampRight:SymbolSlotmachineLightRedRightGeneric = null;
public function SymbolSlotmachineAnimationLightsRedGeneric(param1:MovieClip = null)
{
if(param1)
{
_nativeObject = param1 as SymbolSlotmachineAnimationLightsRed;
}
else
{
_nativeObject = new SymbolSlotmachineAnimationLightsRed();
}
super(null,FlashSprite.fromNative(_nativeObject));
var _loc2_:FlashDisplayObjectContainer = _sprite as FlashDisplayObjectContainer;
lampLeft = new SymbolSlotmachineLightRedLeftGeneric(_nativeObject.lampLeft);
lampRight = new SymbolSlotmachineLightRedRightGeneric(_nativeObject.lampRight);
}
public function setNativeInstance(param1:SymbolSlotmachineAnimationLightsRed) : void
{
FlashSprite.setNativeInstance(_sprite,param1);
_nativeObject = param1;
syncInstances();
}
public function syncInstances() : void
{
if(_nativeObject.lampLeft)
{
lampLeft.setNativeInstance(_nativeObject.lampLeft);
}
if(_nativeObject.lampRight)
{
lampRight.setNativeInstance(_nativeObject.lampRight);
}
}
}
}
|
/////////////////////////////////////////////////////////////////////////////////////
//
// Simplified BSD License
// ======================
//
// Copyright 2013-2014 Pascal ECHEMANN. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
//
// 2. 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.
//
// 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.
//
// The views and conclusions contained in the software and documentation are those
// of the authors and should not be interpreted as representing official policies,
// either expressed or implied, of the copyright holders.
//
/////////////////////////////////////////////////////////////////////////////////////
package hummingbird.project.orchestrators {
// -----------------------------------------------------------
// BasicOrchestrator.as
// -----------------------------------------------------------
/**
* @author Pascal ECHEMANN
* @version 1.0.0, 28/10/2013 09:58
* @see http://www.flashapi.org/
*/
import hummingbird.project.models.IBasicModel;
import org.flashapi.hummingbird.orchestrator.AbstractOrchestrator;
/**
* A basic orchestrator for all valid testing cases.
*/
[Qualifier(alias="BasicOrchestrator")]
public class BasicOrchestrator extends AbstractOrchestrator implements IBasicOrchestrator {
//--------------------------------------------------------------------------
//
// Dependencies injections
//
//--------------------------------------------------------------------------
[Model(alias="BasicModel")]
public var model:IBasicModel;
}
} |
package com.as3nui.nativeExtensions.air.kinect.frameworks.openni.data
{
import com.as3nui.nativeExtensions.air.kinect.data.UserFrame;
public class OpenNIUserFrame extends UserFrame
{
public function OpenNIUserFrame()
{
}
}
} |
// Action script...
// [Initial MovieClip Action of sprite 20735]
#initclip 256
if (!ank.utils.ConsoleUtils)
{
if (!ank)
{
_global.ank = new Object();
} // end if
if (!ank.utils)
{
_global.ank.utils = new Object();
} // end if
var _loc1 = (_global.ank.utils.ConsoleUtils = function ()
{
}).prototype;
(_global.ank.utils.ConsoleUtils = function ()
{
}).autoCompletion = function (aList, sCmd)
{
var _loc4 = ank.utils.ConsoleUtils.removeAndGetLastWord(sCmd);
var _loc5 = _loc4.lastWord;
sCmd = _loc4.leftCmd;
_loc5 = _loc5.toLowerCase();
var _loc6 = ank.utils.ConsoleUtils.getStringsStartWith(aList, _loc5);
if (_loc6.length > 1)
{
var _loc7 = "";
var _loc8 = 0;
while (++_loc8, _loc8 < _loc6.length)
{
_loc7 = String(_loc6[_loc8]).charAt(_loc5.length);
if (_loc7 != "")
{
break;
} // end if
} // end while
if (_loc7 == "")
{
return ({result: sCmd + _loc5, full: false});
}
else
{
return (ank.utils.ConsoleUtils.autoCompletionRecurcive(_loc6, sCmd, _loc5 + _loc7));
} // end else if
}
else if (_loc6.length != 0)
{
return ({result: sCmd + _loc6[0], isFull: true});
}
else
{
return ({result: sCmd + _loc5, list: _loc6, isFull: false});
} // end else if
};
(_global.ank.utils.ConsoleUtils = function ()
{
}).removeAndGetLastWord = function (sCmd)
{
var _loc3 = sCmd.split(" ");
if (_loc3.length == 0)
{
return ({leftCmd: "", lastWord: ""});
} // end if
var _loc4 = String(_loc3.pop());
return ({leftCmd: _loc3.length == 0 ? ("") : (_loc3.join(" ") + " "), lastWord: _loc4});
};
(_global.ank.utils.ConsoleUtils = function ()
{
}).autoCompletionRecurcive = function (aList, sLeftCmd, sPattern)
{
sPattern = sPattern.toLowerCase();
var _loc5 = ank.utils.ConsoleUtils.getStringsStartWith(aList, sPattern);
if (_loc5.length > 1 && _loc5.length == aList.length)
{
var _loc6 = "";
var _loc7 = 0;
while (++_loc7, _loc7 < _loc5.length)
{
_loc6 = String(_loc5[_loc7]).charAt(sPattern.length);
if (_loc6 != "")
{
break;
} // end if
} // end while
if (_loc6 == "")
{
return ({result: sLeftCmd + sPattern, isFull: false});
}
else
{
return (ank.utils.ConsoleUtils.autoCompletionRecurcive(_loc5, sLeftCmd, sPattern + _loc6));
} // end else if
}
else if (_loc5.length != 0)
{
return ({result: sLeftCmd + sPattern.substr(0, sPattern.length - 1), list: aList, isFull: false});
}
else
{
return ({result: sLeftCmd + sPattern, list: aList, isFull: false});
} // end else if
};
(_global.ank.utils.ConsoleUtils = function ()
{
}).getStringsStartWith = function (aList, sPattern)
{
var _loc4 = new Array();
var _loc5 = 0;
while (++_loc5, _loc5 < aList.length)
{
var _loc6 = String(aList[_loc5]).toLowerCase().split(sPattern);
if (_loc6[0] == "" && (_loc6.length != 0 && String(aList[_loc5]).length >= sPattern.length))
{
_loc4.push(aList[_loc5]);
} // end if
} // end while
return (_loc4);
};
ASSetPropFlags(_loc1, null, 1);
} // end if
#endinitclip
|
////////////////////////////////////////////////////////////////////////////////
//
// 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.skins.mobile
{
import flash.display.DisplayObject;
import mx.core.DPIClassification;
import spark.components.Button;
import spark.skins.mobile.supportClasses.MobileSkin;
import spark.skins.mobile120.assets.HSliderTrack;
import spark.skins.mobile160.assets.HSliderTrack;
import spark.skins.mobile240.assets.HSliderTrack;
import spark.skins.mobile320.assets.HSliderTrack;
import spark.skins.mobile480.assets.HSliderTrack;
import spark.skins.mobile640.assets.HSliderTrack;
/**
* ActionScript-based skin for the HSlider track skin part in mobile applications.
*
* @langversion 3.0
* @playerversion Flash 10
* @playerversion AIR 2.5
* @productversion Flex 4.5
*/
public class HSliderTrackSkin extends MobileSkin
{
//--------------------------------------------------------------------------
//
// Constructor
//
//--------------------------------------------------------------------------
/**
* Constructor.
*
* @langversion 3.0
* @playerversion Flash 10
* @playerversion AIR 2.5
* @productversion Flex 4.5
*
*/
public function HSliderTrackSkin()
{
super();
// set the right assets and dimensions to use based on the screen density
switch (applicationDPI)
{
case DPIClassification.DPI_640:
{
// Note provisional may need changes
trackWidth = 1200;
trackHeight = 36;
visibleTrackOffset = 40;
trackClass = spark.skins.mobile640.assets.HSliderTrack;
break;
}
case DPIClassification.DPI_480:
{
// Note provisional may need changes
trackWidth = 880;
trackHeight = 26;
visibleTrackOffset = 32;
trackClass = spark.skins.mobile480.assets.HSliderTrack;
break;
}
case DPIClassification.DPI_320:
{
trackWidth = 600;
trackHeight = 18;
visibleTrackOffset = 20;
trackClass = spark.skins.mobile320.assets.HSliderTrack;
break;
}
case DPIClassification.DPI_240:
{
trackWidth = 440;
trackHeight = 13;
visibleTrackOffset = 16;
trackClass = spark.skins.mobile240.assets.HSliderTrack;
break;
}
case DPIClassification.DPI_120:
{
trackWidth = 220;
trackHeight = 7;
visibleTrackOffset = 8;
trackClass = spark.skins.mobile120.assets.HSliderTrack;
break;
}
default:
{
// default DPI_160
trackWidth = 300;
trackHeight = 10;
visibleTrackOffset = 10;
trackClass = spark.skins.mobile160.assets.HSliderTrack;
break;
}
}
}
//--------------------------------------------------------------------------
//
// Properties
//
//--------------------------------------------------------------------------
/**
* @copy spark.skins.spark.ApplicationSkin#hostComponent
*/
public var hostComponent:Button;
//--------------------------------------------------------------------------
//
// Variables
//
//--------------------------------------------------------------------------
/**
* Specifies the FXG class to use for the track image
*
* @langversion 3.0
* @playerversion Flash 10
* @playerversion AIR 2.5
* @productversion Flex 4.5
*/
protected var trackClass:Class;
/**
* Specifies the DisplayObject for the track image
*
* @langversion 3.0
* @playerversion Flash 10
* @playerversion AIR 2.5
* @productversion Flex 4.5
*/
protected var trackSkin:DisplayObject;
/**
* Specifies the track image width
*
* @langversion 3.0
* @playerversion Flash 10
* @playerversion AIR 2.5
* @productversion Flex 4.5
*/
protected var trackWidth:int;
/**
* Specifies the track image height
*
* @langversion 3.0
* @playerversion Flash 10
* @playerversion AIR 2.5
* @productversion Flex 4.5
*/
protected var trackHeight:int;
/**
* Specifies the offset from the left and right edge to where
* the visible track begins. This should match the offset in the FXG assets.
*
* @langversion 3.0
* @playerversion Flash 10
* @playerversion AIR 2.5
* @productversion Flex 4.5
*/
protected var visibleTrackOffset:int;
//--------------------------------------------------------------------------
//
// Overridden methods
//
//--------------------------------------------------------------------------
/**
* @private
*/
override protected function createChildren():void
{
trackSkin = new trackClass();
addChild(trackSkin);
}
/**
* @private
*/
override protected function measure():void
{
measuredWidth = trackWidth;
measuredHeight = trackHeight;
}
/**
* @private
*/
override protected function layoutContents(unscaledWidth:Number, unscaledHeight:Number):void
{
super.layoutContents(unscaledWidth, unscaledHeight);
setElementSize(trackSkin, unscaledWidth, unscaledHeight);
setElementPosition(trackSkin, 0, 0);
}
/**
* @private
*/
override protected function drawBackground(unscaledWidth:Number, unscaledHeight:Number):void
{
super.drawBackground(unscaledWidth, unscaledHeight);
var unscaledTrackWidth:int = unscaledWidth - (2 * visibleTrackOffset);
// draw the round rect
graphics.beginFill(getStyle("chromeColor"), 1);
graphics.drawRoundRect(visibleTrackOffset, 0,
unscaledTrackWidth, trackHeight,
trackHeight, trackHeight);
graphics.endFill();
}
}
} |
////////////////////////////////////////////////////////////////////////////////
//
// Licensed to the Apache Software Foundation (ASF) under one or more
// contributor license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright ownership.
// The ASF licenses this file to You under the Apache License, Version 2.0
// (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////
package org.apache.royale.fa
{
COMPILE::JS
{
import org.apache.royale.core.WrappedHTMLElement;
import org.apache.royale.html.util.addElementToWrapper;
}
import org.apache.royale.core.UIBase;
/**
* Provide common features for all FontAwesome icons type
* Usage example:
* <fa:FontAwesomeIcon iconType="{FontAwesomeIconType.TWITTER}" />
*
* @langversion 3.0
* @playerversion Flash 10.2
* @playerversion AIR 2.6
* @productversion Royale 0.0
*
*
*/
public class FontAwesomeIcon extends UIBase
{
/**
* constructor.
*
* @langversion 3.0
* @playerversion Flash 10.2
* @playerversion AIR 2.6
* @productversion Royale 0.0
*
* @royaleignorecoercion HTMLElement
* <inject_script>
* var link = document.createElement("link");
* link.setAttribute("rel", "stylesheet");
* link.setAttribute("type", "text/css");
* link.setAttribute("href", "http://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css");
* document.head.appendChild(link);
* </inject_script>
*/
public function FontAwesomeIcon()
{
super();
className = ""; //set to empty string avoid 'undefined' output when no class selector is assigned by user;
}
COMPILE::JS
protected var textNode:Text;
protected var _iconType:String;
protected var _size:String;
protected var _fixedWidth:Boolean;
protected var _showBorder:Boolean;
protected var _rotation:String;
/**
* @royaleignorecoercion org.apache.royale.core.WrappedHTMLElement
* @royaleignorecoercion Text
*/
COMPILE::JS
override protected function createElement():WrappedHTMLElement
{
typeNames = "fa";
var i:WrappedHTMLElement = addElementToWrapper(this,'i');
textNode = document.createTextNode(iconType) as Text;
textNode.textContent = '';
i.appendChild(textNode);
return element;
}
public function get iconType():String
{
return _iconType;
}
public function set iconType(value:String):void
{
COMPILE::JS
{
element.classList.remove(value);
}
_iconType = value;
COMPILE::JS
{
element.classList.add(_iconType);
}
}
/**
* To increase icon sizes relative to their container,
* use the X1 (33% increase), X2, X3, X4, or X5.
*
* @langversion 3.0
* @playerversion Flash 10.2
* @playerversion AIR 2.6
* @productversion Royale 0.0
*
*/
public function get size():String
{
return _size;
}
public function set size(value:String):void
{
COMPILE::JS
{
element.classList.remove(value);
}
_size = value;
COMPILE::JS
{
element.classList.add(value);
}
}
/**
*
* Set icons at a fixed width.
* Great to use when different icon widths throw off alignment.
* Especially useful in things like nav lists & list groups.
*
* @langversion 3.0
* @playerversion Flash 10.2
* @playerversion AIR 2.6
* @productversion Royale 0.0
*
*/
public function get fixedWidth():Boolean
{
return _fixedWidth;
}
public function set fixedWidth(value:Boolean):void
{
_fixedWidth = value;
COMPILE::JS
{
element.classList.toggle('fa-fw',_fixedWidth);
}
}
/**
* Show a border around the icon
*
* @langversion 3.0
* @playerversion Flash 10.2
* @playerversion AIR 2.6
* @productversion Royale 0.0
*
*/
public function get showBorder():Boolean
{
return _showBorder;
}
public function set showBorder(value:Boolean):void
{
_showBorder = value;
COMPILE::JS
{
element.classList.toggle('fa-border',_showBorder)
}
}
/**
* Rotate icon
*
* @langversion 3.0
* @playerversion Flash 10.2
* @playerversion AIR 2.6
* @productversion Royale 0.0
*
*/
COMPILE::JS
public function get rotation():String
{
return _rotation;
}
COMPILE::JS
public function set rotation(value:String):void
{
COMPILE::JS
{
element.classList.remove(value)
}
_rotation = value;
COMPILE::JS
{
element.classList.add(value)
}
}
}
}
|
/*
Copyright aswing.org, see the LICENCE.txt.
*/
package org.aswing.plaf.basic{
import flash.display.InteractiveObject;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.ui.Keyboard;
import org.aswing.Insets;
import org.aswing.JButton;
import org.aswing.lookandfeel.plaf.BaseComponentUI;
import devoron.aswing3d.*;
import org.aswing.event.*;
import org.aswing.geom.*;
import org.aswing.graphics.*;
import org.aswing.plaf.*;
import org.aswing.plaf.basic.icon.ArrowIcon;
import org.aswing.util.ASTimer;
/**
* Basic stepper ui imp.
* @private
*/
public class BasicStepperUI extends BaseComponentUI{
protected var upButton:Component;
protected var downButton:Component;
protected var inputText:JTextField;
protected var stepper:JStepper;
private static var continueSpeedThrottle:int = 60; // delay in milli seconds
private static var initialContinueSpeedThrottle:int = 500; // first delay in milli seconds
private var continueTimer:ASTimer;
public function BasicStepperUI() {
super();
inputText = new JTextField("", 3);
}
override public function installUI(c:Component):void{
stepper = JStepper(c);
installDefaults();
installComponents();
installListeners();
}
override public function uninstallUI(c:Component):void{
stepper = JStepper(c);
uninstallDefaults();
uninstallComponents();
uninstallListeners();
}
override public function getColor(key:String):ASColor
{
switch(key) {
case "Stepper.background":
return new ASColor();
break;
case "Stepper.foreground":
return new ASColor(0xE1E2D6, 0.4);
break;
case "Stepper.mideground":
return new ASColor(0x000000, 0.24);
break;
}
return super.getColor(key);
}
protected function getPropertyPrefix():String {
return "Stepper.";
}
protected function installDefaults():void{
var pp:String = getPropertyPrefix();
//LookAndFeel.installBorderAndBFDecorators(stepper, pp);
LookAndFeel.installColorsAndFont(stepper, pp);
LookAndFeel.installBasicProperties(stepper, pp);
}
protected function uninstallDefaults():void{
LookAndFeel.uninstallBorderAndBFDecorators(stepper);
}
protected function installComponents():void{
upButton = createButton( -Math.PI / 2);
downButton = createButton(Math.PI/2);
inputText.setBackgroundDecorator(null);
inputText.setBorder(null);
//make it proxy to the stepper
inputText.setForeground(null);
inputText.setBackground(null);
inputText.setMideground(null);
inputText.setStyleTune(null);
upButton.setUIElement(true);
downButton.setUIElement(true);
inputText.setUIElement(true);
upButton.setFocusable(false);
downButton.setFocusable(false);
inputText.setFocusable(false);
stepper.addChild(inputText);
stepper.addChild(upButton);
stepper.addChild(downButton);
}
protected function uninstallComponents():void{
stepper.removeChild(inputText);
stepper.removeChild(upButton);
stepper.removeChild(downButton);
}
protected function installListeners():void{
stepper.addStateListener(__onValueChanged);
stepper.addEventListener(FocusKeyEvent.FOCUS_KEY_DOWN, __onInputTextKeyDown);
stepper.addEventListener(AWEvent.FOCUS_GAINED, __onFocusGained);
stepper.addEventListener(AWEvent.FOCUS_LOST, __onFocusLost);
inputText.addEventListener(MouseEvent.MOUSE_WHEEL, __onInputTextMouseWheel);
inputText.getTextField().addEventListener(Event.CHANGE, __textChanged);
upButton.addEventListener(MouseEvent.MOUSE_DOWN, __onUpButtonPressed);
upButton.addEventListener(ReleaseEvent.RELEASE, __onUpButtonReleased);
downButton.addEventListener(MouseEvent.MOUSE_DOWN, __onDownButtonPressed);
downButton.addEventListener(ReleaseEvent.RELEASE, __onDownButtonReleased);
continueTimer = new ASTimer(continueSpeedThrottle);
continueTimer.setInitialDelay(initialContinueSpeedThrottle);
continueTimer.addActionListener(__continueTimerPerformed);
}
protected function uninstallListeners():void{
stepper.removeStateListener(__onValueChanged);
stepper.removeEventListener(FocusKeyEvent.FOCUS_KEY_DOWN, __onInputTextKeyDown);
stepper.removeEventListener(AWEvent.FOCUS_GAINED, __onFocusGained);
stepper.removeEventListener(AWEvent.FOCUS_LOST, __onFocusLost);
inputText.removeEventListener(MouseEvent.MOUSE_WHEEL, __onInputTextMouseWheel);
inputText.getTextField().removeEventListener(Event.CHANGE, __textChanged);
upButton.removeEventListener(MouseEvent.MOUSE_DOWN, __onUpButtonPressed);
upButton.removeEventListener(ReleaseEvent.RELEASE, __onUpButtonReleased);
downButton.removeEventListener(MouseEvent.MOUSE_DOWN, __onDownButtonPressed);
downButton.removeEventListener(ReleaseEvent.RELEASE, __onDownButtonReleased);
continueTimer.stop();
continueTimer = null;
}
override public function paint(c:Component, g:Graphics2D, b:IntRectangle):void{
super.paint(c, g, b);
layoutStepper();
upButton.setEnabled(stepper.isEnabled());
downButton.setEnabled(stepper.isEnabled());
inputText.setFont(stepper.getFont());
inputText.setForeground(stepper.getForeground());
inputText.setMaxChars(stepper.getMaxChars());
inputText.setRestrict(stepper.getRestrict());
inputText.setEditable(stepper.isEditable());
inputText.setEnabled(stepper.isEnabled());
fillInputTextWithCurrentValue();
}
override protected function paintBackGround(c:Component, g:Graphics2D, b:IntRectangle):void{
//do nothing, background decorator will paint it
}
/**
* Just override this method if you want other LAF drop down buttons.
*/
protected function createButton(direction:Number):Component{
var btn:JButton = new JButton("", new ArrowIcon(
direction, 15
));
btn.buttonMode = true;
btn.setFocusable(false);
btn.setPreferredSize(new IntDimension(15, 15));
btn.setBackgroundDecorator(null);
btn.setMargin(new Insets());
btn.setBorder(null);
//make it proxy to the stepper
btn.setMideground(null);
btn.setStyleTune(null);
return btn;
}
/**
* Returns the input text to receive the focus for the component.
* @param c the component
* @return the object to receive the focus.
*/
override public function getInternalFocusObject(c:Component):InteractiveObject{
return inputText.getTextField();
}
protected function fillInputTextWithCurrentValue():void{
inputText.setText(getShouldFilledText());
}
protected function getShouldFilledText():String{
var value:int = stepper.getValue();
var text:String = stepper.getValueTranslator()(value);
return text;
}
//--------------------- handlers--------------------
private function __onValueChanged(e:Event):void{
if(!textInputing){
fillInputTextWithCurrentValue();
}
}
private function __onInputTextMouseWheel(e:MouseEvent):void{
stepper.setValue(
stepper.getValue()+e.delta*stepper.getUnitIncrement(),
false
);
}
private var textInputing:Boolean = false;
private function __textChanged(e:Event):void{
textInputing = true;
var text:String = inputText.getText();
var value:int = stepper.getValueParser()(text);
stepper.setValue(value, false);
textInputing = false;
}
private function __inputTextAction(fireActOnlyIfChanged:Boolean=false):void{
var text:String = inputText.getText();
var value:int = stepper.getValueParser()(text);
stepper.setValue(value, false);
if(!fireActOnlyIfChanged){
fireActionEvent();
}else if(value != startEditingValue){
fireActionEvent();
}
}
protected var startEditingValue:int;
protected function fireActionEvent():void{
startEditingValue = stepper.getValue();
fillInputTextWithCurrentValue();
stepper.dispatchEvent(new AWEvent(AWEvent.ACT));
}
private function __onFocusGained(e:AWEvent):void{
startEditingValue = stepper.getValue();
}
private function __onFocusLost(e:AWEvent):void{
__inputTextAction(true);
}
private function __onInputTextKeyDown(e:FocusKeyEvent):void{
var code:uint = e.keyCode;
var unit:int = stepper.getUnitIncrement();
var delta:int = 0;
if(code == Keyboard.ENTER){
__inputTextAction(false);
return;
}
if(code == Keyboard.HOME){
stepper.setValue(stepper.getMinimum(), false);
return;
}else if(code == Keyboard.END){
stepper.setValue(stepper.getMaximum() - stepper.getExtent(), false);
return;
}
if(code == Keyboard.UP){
delta = unit;
}else if(code == Keyboard.DOWN){
delta = -unit;
}else if(code == Keyboard.PAGE_UP){
delta = unit;
}else if(code == Keyboard.PAGE_DOWN){
delta = -unit;
}
makeStepper(delta);
}
private function makeStepper(step:int):void{
stepper.setValue(stepper.getValue() + step, false);
}
private var timerIncrement:int;
private var timerContinued:int;
private function __onUpButtonPressed(e:Event):void{
timerIncrement = stepper.getUnitIncrement();
makeStepper(timerIncrement);
continueTimer.restart();
timerContinued = 0;
}
private function __onUpButtonReleased(e:Event):void{
continueTimer.stop();
fireActionEvent();
}
private function __onDownButtonPressed(e:Event):void{
timerIncrement = -stepper.getUnitIncrement();
makeStepper(timerIncrement);
continueTimer.restart();
timerContinued = 0;
}
private function __onDownButtonReleased(e:Event):void{
continueTimer.stop();
fireActionEvent();
}
private function __continueTimerPerformed(e:AWEvent):void{
makeStepper(timerIncrement);
timerContinued++;
if(timerContinued >= 5){
timerContinued = 0;
timerIncrement *= 2;
}
}
//---------------------Layout Implementation---------------------------
protected function layoutStepper():void{
var td:IntDimension = stepper.getSize();
var insets:Insets = stepper.getInsets();
var top:int = insets.top;
var left:int = insets.left;
var right:int = td.width - insets.right;
var height:int = td.height - insets.top - insets.bottom;
var buttonSize:IntDimension = upButton.getPreferredSize();
upButton.setSizeWH(buttonSize.width, height/2);
upButton.setLocationXY(right - buttonSize.width, top);
downButton.setSizeWH(buttonSize.width, height/2);
downButton.setLocationXY(right - buttonSize.width, top+height/2);
inputText.setLocationXY(left, top);
inputText.setSizeWH(td.width-insets.left-insets.right- buttonSize.width, height);
}
override public function getPreferredSize(c:Component):IntDimension{
var insets:Insets = stepper.getInsets();
inputText.setColumns(stepper.getColumns());
var inputSize:IntDimension = inputText.getPreferredSize();
var buttonSize:IntDimension = upButton.getPreferredSize();
inputSize.width += buttonSize.width;
return insets.getOutsideSize(inputSize);
}
override public function getMinimumSize(c:Component):IntDimension{
var buttonSize:IntDimension = upButton.getPreferredSize();
buttonSize.height *= 2;
return stepper.getInsets().getOutsideSize(buttonSize);
}
override public function getMaximumSize(c:Component):IntDimension{
return IntDimension.createBigDimension();
}
}
} |
/*
ADOBE SYSTEMS INCORPORATED
Copyright 2008 Adobe Systems Incorporated
All Rights Reserved.
NOTICE: Adobe permits you to use, modify, and distribute this file in accordance with the
terms of the Adobe license agreement accompanying it. If you have received this file from a
source other than Adobe, then your use, modification, or distribution of it requires the prior
written permission of Adobe.
*/
package components
{
import mx.core.WindowedApplication;
public class ApplicationUpdaterApplication extends WindowedApplication
{
}
} |
////////////////////////////////////////////////////////////////////////////////
//
// 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.managers
{
import flash.display.Stage;
import flash.events.Event;
import flash.events.EventDispatcher;
import flash.events.IEventDispatcher;
import mx.core.UIComponent;
import mx.core.mx_internal;
import mx.events.FlexEvent;
import mx.managers.layoutClasses.PriorityQueue;
use namespace mx_internal;
/**
* The LayoutManager is the engine behind
* Flex's measurement and layout strategy.
* Layout is performed in three phases; commit, measurement, and layout.
*
* <p>Each phase is distinct from the others and all UIComponents of
* one phase are processed prior to moving on to the next phase.
* During the processing of UIComponents in a phase, requests for
* UIComponents to get re-processed by some phase may occur.
* These requests are queued and are only processed
* during the next run of the phase.</p>
*
* <p>The <b>commit</b> phase begins with a call to
* <code>validateProperties()</code>, which walks through a list
* (reverse sorted by nesting level) of objects calling each object's
* <a href="../core/UIComponent.html#validateProperties()">
* <code>validateProperties()</code></a>method.</p>
*
* <p>The objects in the list are processed in reversed nesting order,
* with the <b>least</b> deeply nested object accessed first.
* This can also be referred to as top-down or outside-in ordering.</p>
*
* <p>This phase allows components whose contents depend on property
* settings to configure themselves prior to the measurement
* and the layout phases.
* For the sake of performance, sometimes a component's property setter
* method does not do all the work to update to the new property value.
* Instead, the property setter calls the <code>invalidateProperties()</code>
* method, deferring the work until this phase runs.
* This prevents unnecessary work if the property is set multiple times.</p>
*
* <p>The <b>measurement</b> phase begins with a call to
* <code>validateSize()</code>, which walks through a list
* (sorted by nesting level) of objects calling each object's
* <a href="../core/UIComponent.html#validateSize()"><code>validateSize()</code></a>
* method to determine if the object has changed in size.</p>
*
* <p>If an object's <a href="../core/UIComponent.html#invalidateSize()">
* <code>invalidateSize()</code></a> method was previously called,
* then the <code>validateSize()</code> method is called.
* If the size or position of the object was changed as a result of the
* <code>validateSize()</code> call, then the object's
* <a href="../core/UIComponent.html#invalidateDisplayList()">
* <code>invalidateDisplayList()</code></a> method is called, thus adding
* the object to the processing queue for the next run of the layout phase.
* Additionally, the object's parent is marked for both measurement
* and layout phases, by calling
* <a href="../core/UIComponent.html#invalidateSize()">
* <code>invalidateSize()</code></a> and
* <a href="../core/UIComponent.html#invalidateDisplayList()">
* <code>invalidateDisplayList()</code></a> respectively.</p>
*
* <p>The objects in the list are processed by nesting order,
* with the <b>most</b> deeply nested object accessed first.
* This can also be referred to as bottom-up inside-out ordering.</p>
*
* <p>The <b>layout</b> phase begins with a call to the
* <code>validateDisplayList()</code> method, which walks through a list
* (reverse sorted by nesting level) of objects calling each object's
* <a href="../core/UIComponent.html#validateDisplayList()">
* <code>validateDisplayList()</code></a> method to request the object to size
* and position all components contained within it (i.e. its children).</p>
*
* <p>If an object's <a href="../core/UIComponent.html#invalidateDisplayList()">
* <code>invalidateDisplayList()</code></a> method was previously called,
* then <code>validateDisplayList()</code> method for the object is called.</p>
*
* <p>The objects in the list are processed in reversed nesting order,
* with the <b>least</b> deeply nested object accessed first.
* This can also be referred to as top-down or outside-in ordering.</p>
*
* <p>In general, components do not override the <code>validateProperties()</code>,
* <code>validateSize()</code>, or <code>validateDisplayList()</code> methods.
* In the case of UIComponents, most components override the
* <code>commitProperties()</code>, <code>measure()</code>, or
* <code>updateDisplayList()</code> methods, which are called
* by the <code>validateProperties()</code>,
* <code>validateSize()</code>, or
* <code>validateDisplayList()</code> methods, respectively.</p>
*
* <p>At application startup, a single instance of the LayoutManager is created
* and stored in the <code>UIComponent.layoutManager</code> property.
* All components are expected to use that instance.
* If you do not have access to the UIComponent object,
* you can also access the LayoutManager using the static
* <code>LayoutManager.getInstance()</code> method.</p>
*
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
* @productversion Flex 3
*/
public interface ILayoutManager extends IEventDispatcher
{
//--------------------------------------------------------------------------
//
// Properties
//
//--------------------------------------------------------------------------
//----------------------------------
// usePhasedInstantiation
//----------------------------------
/**
* A flag that indicates whether the LayoutManager allows screen updates
* between phases.
* If <code>true</code>, measurement and layout are done in phases, one phase
* per screen update.
* All components have their <code>validateProperties()</code>
* and <code>commitProperties()</code> methods
* called until all their properties are validated.
* The screen will then be updated.
*
* <p>Then all components will have their <code>validateSize()</code>
* and <code>measure()</code>
* methods called until all components have been measured, then the screen
* will be updated again. </p>
*
* <p>Finally, all components will have their
* <code>validateDisplayList()</code> and
* <code>updateDisplayList()</code> methods called until all components
* have been validated, and the screen will be updated again.
* If in the validation of one phase, an earlier phase gets invalidated,
* the LayoutManager starts over.
* This is more efficient when large numbers of components
* are being created an initialized. The framework is responsible for setting
* this property.</p>
*
* <p>If <code>false</code>, all three phases are completed before the screen is updated.</p>
*
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
* @productversion Flex 3
*/
function get usePhasedInstantiation():Boolean;
/**
* @private
*/
function set usePhasedInstantiation(value:Boolean):void;
//--------------------------------------------------------------------------
//
// Methods: Invalidation
//
//--------------------------------------------------------------------------
/**
* Adds an object to the list of components that want their
* <code>validateProperties()</code> method called.
* A component should call this method when a property changes.
* Typically, a property setter method
* stores a the new value in a temporary variable and calls
* the <code>invalidateProperties()</code> method
* so that its <code>validateProperties()</code>
* and <code>commitProperties()</code> methods are called
* later, when the new value will actually be applied to the component and/or
* its children. The advantage of this strategy is that often, more than one
* property is changed at a time and the properties may interact with each
* other, or repeat some code as they are applied, or need to be applied in
* a specific order. This strategy allows the most efficient method of
* applying new property values.
*
* @param obj The object whose property changed.
*
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
* @productversion Flex 3
*/
function invalidateProperties(obj:ILayoutManagerClient ):void;
/**
* Adds an object to the list of components that want their
* <code>validateSize()</code> method called.
* Called when an object's size changes.
*
* <p>An object's size can change for two reasons:</p>
*
* <ol>
* <li>The content of the object changes. For example, the size of a
* button changes when its <code>label</code> is changed.</li>
* <li>A script explicitly changes one of the following properties:
* <code>minWidth</code>, <code>minHeight</code>,
* <code>explicitWidth</code>, <code>explicitHeight</code>,
* <code>maxWidth</code>, or <code>maxHeight</code>.</li>
* </ol>
*
* <p>When the first condition occurs, it's necessary to recalculate
* the measurements for the object.
* When the second occurs, it's not necessary to recalculate the
* measurements because the new size of the object is known.
* However, it's necessary to remeasure and relayout the object's
* parent.</p>
*
* @param obj The object whose size changed.
*
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
* @productversion Flex 3
*/
function invalidateSize(obj:ILayoutManagerClient ):void;
/**
* Called when a component changes in some way that its layout and/or visuals
* need to be changed.
* In that case, it is necessary to run the component's layout algorithm,
* even if the component's size hasn't changed. For example, when a new child component
* is added, or a style property changes or the component has been given
* a new size by its parent.
*
* @param obj The object that changed.
*
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
* @productversion Flex 3
*/
function invalidateDisplayList(obj:ILayoutManagerClient ):void;
//--------------------------------------------------------------------------
//
// Methods: Commitment, measurement, layout, and drawing
//
//--------------------------------------------------------------------------
/**
* When properties are changed, components generally do not apply those changes immediately.
* Instead the components usually call one of the LayoutManager's invalidate methods and
* apply the properties at a later time. The actual property you set can be read back
* immediately, but if the property affects other properties in the component or its
* children or parents, those other properties may not be immediately updated. To
* guarantee that the values are updated, you can call the <code>validateNow()</code> method.
* It updates all properties in all components before returning.
* Call this method only when necessary as it is a computationally intensive call.
*
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
* @productversion Flex 3
*/
function validateNow():void;
/**
* When properties are changed, components generally do not apply those changes immediately.
* Instead the components usually call one of the LayoutManager's invalidate methods and
* apply the properties at a later time. The actual property you set can be read back
* immediately, but if the property affects other properties in the component or its
* children or parents, those other properties may not be immediately updated.
*
* <p>To guarantee that the values are updated,
* you can call the <code>validateClient()</code> method.
* It updates all properties in all components whose nest level is greater than or equal
* to the target component before returning.
* Call this method only when necessary as it is a computationally intensive call.</p>
*
* @param target The component passed in is used to test which components
* should be validated. All components contained by this component will have their
* <code>validateProperties()</code>, <code>commitProperties()</code>,
* <code>validateSize()</code>, <code>measure()</code>,
* <code>validateDisplayList()</code>,
* and <code>updateDisplayList()</code> methods called.
*
* @param skipDisplayList If <code>true</code>,
* does not call the <code>validateDisplayList()</code>
* and <code>updateDisplayList()</code> methods.
*
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
* @productversion Flex 3
*/
function validateClient(target:ILayoutManagerClient, skipDisplayList:Boolean = false):void;
/**
* Returns <code>true</code> if there are components that need validating;
* <code>false</code> if all components have been validated.
*
* @return Returns <code>true</code> if there are components that need validating;
* <code>false</code> if all components have been validated.
*
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
* @productversion Flex 3
*/
function isInvalid():Boolean;
}
}
|
/*
Copyright 2012 DotComIt, LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Additional Documentation, Samples, and Support may be available at http://www.flextras.com
*/
package com.flextras.calendar
{
/**
* This defines the interface for any class that contains overrides for moving to, or from, the day state of the Flextras Calendar Component.
*
* @author DotComIt / Flextras
*
* @see com.flextras.calendar.Calendar
* @see com.flextras.calendar.DayDisplay
*/
public interface ICalendarDayStateOverrides
{
/**
* This property contains a collection of overrides that should execute when moving to, or from the Calendar.DAY_VIEW state.
*
* State changes will be handled by the Calendar class.
*/
function get dayStateOverrides():Array
}
} |
package net.psykosoft.psykopaint2.core.services
{
import flash.utils.describeType;
import net.psykosoft.psykopaint2.core.models.*;
public class AMFGalleryService implements GalleryService
{
[Inject]
public var amfBridge : AMFBridge;
[Inject]
public var userProxy : LoggedInUserProxy;
private var _targetUserID:int;
public function AMFGalleryService()
{
}
// used for views to set the user ID that should be used for subsequent user painting requests
// dirty, but the navigation system doesn't allow us to pass along optional props like these properly
public function get targetUserID():int
{
return _targetUserID;
}
public function set targetUserID(value:int):void
{
_targetUserID = value;
}
public function fetchImages(source : int, index : int, amount : int, onSuccess : Function, onFailure : Function) : void
{
switch (source) {
case GalleryType.YOURS:
getLoggedInUserImages(index, amount, onSuccess, onFailure);
break;
case GalleryType.FOLLOWING:
getFollowedUserImages(index, amount, onSuccess, onFailure);
break;
case GalleryType.MOST_LOVED:
getMostLovedImages(index, amount, onSuccess, onFailure);
break;
case GalleryType.MOST_RECENT:
getMostRecentPaintings(index, amount, onSuccess, onFailure);
break;
case GalleryType.USER:
getUserImages(index, amount, onSuccess, onFailure);
}
}
private function getMostRecentPaintings(index : int, amount : int, onSuccess : Function, onFailure : Function) : void
{
var failFunction : Function = function(data : Object) : void { onFailure(AMFErrorCode.CALL_FAILED); }
var callback : Function = function(data : Object) : void
{
translateImages(GalleryType.MOST_RECENT, data, index, onSuccess, onFailure);
}
amfBridge.getMostRecentPaintings(userProxy.sessionID, index, amount, callback, failFunction);
}
private function getMostLovedImages(index : int, amount : int, onSuccess : Function, onFailure : Function) : void
{
var failFunction : Function = function(data : Object) : void { onFailure(AMFErrorCode.CALL_FAILED); }
var callback : Function = function(data : Object) : void
{
translateImages(GalleryType.MOST_LOVED, data, index, onSuccess, onFailure);
}
amfBridge.getMostLovedImages(userProxy.sessionID, index, amount, callback, failFunction);
}
private function getFollowedUserImages(index : int, amount : int, onSuccess : Function, onFailure : Function) : void
{
var failFunction : Function = function(data : Object) : void { onFailure(AMFErrorCode.CALL_FAILED); }
var callback : Function = function (data : Object) : void
{
translateImages(GalleryType.FOLLOWING, data, index, onSuccess, onFailure);
};
amfBridge.getFollowedUserImages(userProxy.sessionID, index, amount, callback, failFunction);
}
private function getLoggedInUserImages(index : int, amount : int, onSuccess : Function, onFailure : Function) : void
{
var failFunction : Function = function(data : Object) : void { onFailure(AMFErrorCode.CALL_FAILED); }
var callback : Function = function (data : Object) : void
{
translateImages(GalleryType.YOURS, data, index, onSuccess, onFailure);
}
amfBridge.getUserImages(userProxy.sessionID, userProxy.userID, index, amount, callback, failFunction);
}
private function getUserImages(index : int, amount : int, onSuccess : Function, onFailure : Function) : void
{
var failFunction : Function = function(data : Object) : void { onFailure(AMFErrorCode.CALL_FAILED); }
var callback : Function = function (data : Object) : void
{
translateImages(GalleryType.USER, data, index, onSuccess, onFailure);
}
amfBridge.getUserImages(userProxy.sessionID, _targetUserID, index, amount, callback, failFunction);
}
private function translateImages(type : uint, data : Object, index : int, onSuccess : Function, onFailure : Function) : void
{
if (data["status_code"] != 1) {
trace("gallery AMF error with status_code " + data["status_code"]);
onFailure(data["status_code"]);
return;
}
var array : Array = data["response"].items;
var collection : GalleryImageCollection = new GalleryImageCollection();
collection.numTotalPaintings = data["response"].num_available;
collection.type = type;
collection.index = index;
var len : int = array.length;
for (var i : int = 0; i < len; ++i) {
var obj : Object = array[i];
// for(var prop:* in obj) trace("property: " + prop + ", value: " + obj[prop]); // Uncomment to see dynamic props of incoming object
var vo : FileGalleryImageProxy = new FileGalleryImageProxy();
vo.paintingMode = obj["is_photo_painting"] == "1" ? PaintMode.PHOTO_MODE : PaintMode.COLOR_MODE;
vo.id = obj["id"];
vo.index = index + i;
vo.collectionType = type;
vo.title = obj["title"];
vo.normalSpecularMapURL = obj["normalmapdata_url"];
vo.colorMapURL = obj["colordata_url"];
vo.sourceThumbnailURL = obj["source_thumbnail_url"];
vo.tinySizeURL = obj["composite_tiny_url"];
vo.smallSizeURL = obj["composite_small_url"];
vo.mediumSizeURL = obj["composite_medium_url"];
vo.fullsizeURL = obj["composite_fullsize_url"];
vo.userName = obj["firstname"] + " " + obj["lastname"];
vo.numLikes = obj["num_favorite"];
vo.numComments = obj["num_comments"];
vo.userID = obj["user_id"];
vo.userThumbnailURL = obj["user_thumbnail_url"];
vo.isFavorited = obj.hasOwnProperty("is_favorited")? obj["is_favorited"] : false;
collection.images.push(vo);
}
onSuccess(collection);
}
public function addComment(paintingID : int, text : String, onSuccess : Function, onFailure : Function) : void
{
trace(this+"paintingID:"+paintingID+" text:"+text);
amfBridge.addCommentToPainting(userProxy.sessionID, paintingID, text, emptyCallBack(onSuccess), onFailure);
}
public function favorite(paintingID : int, onSuccess : Function, onFailure : Function) : void
{
trace(this+"favorite "+paintingID);
amfBridge.favoritePainting(userProxy.sessionID, paintingID, emptyCallBack(onSuccess), onFailure);
}
public function removePainting(paintingID : int, onSuccess : Function, onFailure : Function) : void
{
trace(this+"removePainting "+paintingID);
amfBridge.removePainting(userProxy.sessionID, paintingID, emptyCallBack(onSuccess), onFailure);
}
public function unfavorite(paintingID : int, onSuccess : Function, onFailure : Function) : void
{
trace(this+"unfavorite "+paintingID);
amfBridge.unfavoritePainting(userProxy.sessionID, paintingID, emptyCallBack(onSuccess), onFailure);
}
private function emptyCallBack(callback : Function) : Function
{
return function(data : Object) : void { callback(); }
}
}
}
|
package gs.http
{
import flash.utils.Dictionary;
/**
* The HTTPService class is a simple wrapper around
* sending HTTPCalls to the same server.
*
* <p>This class spawns HTTPCall instances internally.</p>
*
* <p><b>Examples</b> are in the guttershark repository.</p>
*
* @see gs.http.HTTPCall
*/
public class HTTPService
{
/**
* Internal HTTPService lookup.
*/
private static var _hts:Dictionary=new Dictionary();
/**
* @private
* service id.
*/
public var id:String;
/**
* Base url.
*/
private var baseurl:String;
/**
* Timeouts
*/
private var timeout:int;
/**
* Retries.
*/
private var retries:int;
/**
* Get an http service.
*
* @param id The http service id.
*/
public static function get(id:String):HTTPService
{
return _hts[id];
}
/**
* Save an http service.
*
* @param id The service id.
* @param hs The http service.
*/
public static function set(id:String,hs:HTTPService):void
{
if(!id||!hs)return;
if(!hs.id)hs.id=id;
_hts[id]=hs;
}
/**
* Unset (delete) an http service.
*
* @param id The http service id.
*/
public static function unset(id:String):void
{
if(!id)return;
HTTPService(_hts[id]).id=null;
delete _hts[id];
}
/**
* Constructor for HTTPService instances.
*
* @param _baseurl The base url for the service - usually the domain like http://www.google.com/.
* @param _timeout The time to allow each call.
* @param _retries The number of retries allowed for each call.
*/
public function HTTPService(_baseurl:String,_timeout:int=3000,_retries:int=1):void
{
if(!_baseurl || _baseurl == "") throw new ArgumentError("ERROR: Parameter {_baseurl} cannot be null.");
baseurl=_baseurl;
timeout=_timeout;
retries=_retries;
}
/**
* Send an http call.
*
* <p>This method returns the HTTPCall instance that's doing the work for
* you. You only need to hold onto the reference if for some
* reason you need to close the http call.</p>
*
* <p>The call props object supports these properties:</p>
*
* <ul>
* <li>method (String) (required) - Either GET or POST</li>
* <li>data (Object) - The data to submit for either get or post operations</li>
* <li>timeout (int) - The amount of time to allow each call</li>
* <li>retries (int) - The number of retries to allow</li>
* <li>resFormat (String) - The response format (see HTTPCallResponseFormat).</li>
* <li>responseFormat (String) - The response format (see HTTPCallResponseFormat).</li>
* <li>resultHandler (Class) - A result handler class. See HTTPCallResultHandler.</li>
* <li>onResult (Function) - The on result handler.</li>
* <li>onFault (Function) - The on fault handler.</li>
* <li>onTimeout (Function) - The timeout handler.</li>
* <li>onRetry (Function) - The on retry handler.</li>
* <li>onFirstCall (Function) - The on first call handler.</li>
* <li>onProgress (Function) - The on progress handler.</li>
* <li>onHTTPStatus (Function) - The on http status handler.</li>
* <li>onOpen (Function) - The on open handler.</li>
* <li>onClose (Function) - The on close handler.</li>
* <li>onIOError (Function) - The on io error handler.</li>
* <li>onSecurityError (Function) - The on security error handler.</li>
* </ul>
*/
public function send(urlpath:String,callProps:Object):HTTPCall
{
if(!urlpath||urlpath=="")throw new ArgumentError("ERROR: Parameter {urlpath} cannot be null.");
if(!callProps.method)throw new ArgumentError("ERROR: The callProps arguments must have a 'method' property set to either GET or POST.");
var path:String=baseurl+urlpath;
var time:int=callProps.timeout||timeout;
var retry:int=callProps.retries||retries;
var hc:HTTPCall=new HTTPCall(path,callProps.method,callProps.data,time,retry,callProps.responseFormat||callProps.resFormat,callProps.resultHandler);
hc.setCallbacks(callProps);
hc.send();
return hc;
}
/**
* Dispose of this http service.
*/
public function dispose():void
{
HTTPService.unset(id);
id=null;
baseurl=null;
timeout=0;
retries=0;
}
}
} |
/*
* Temple Library for ActionScript 3.0
* Copyright © MediaMonks B.V.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. 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.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by MediaMonks B.V.
* 4. Neither the name of MediaMonks B.V. 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 MEDIAMONKS B.V. ''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 MEDIAMONKS B.V. 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.
*
*
* Note: This license does not apply to 3rd party classes inside the Temple
* repository with their own license!
*/
package temple.ui.labels
{
/**
* Interface for labels which have an <code>autoSize</code> property.
*
* @author Thijs Broerse
*/
public interface IAutoSizableLabel extends ILabel
{
/**
* Enables or disables automatic sizing and alignment of text field.
*
* Enabling this value to will also disable the mouseWheel on the TextField.
*/
function get autoSize():Boolean;
/**
* @private
*/
function set autoSize(value:Boolean):void;
/**
* Indicates whether field is a multiline text field.
*/
function get multiline():Boolean;
/**
* @private
*/
function set multiline(value:Boolean):void;
/**
* A Boolean value that indicates whether the text field has word wrap.
*/
function get wordWrap():Boolean;
/**
* @private
*/
function set wordWrap(value:Boolean):void;
}
}
|
/***********************************************************************************************************************
* Copyright (c) 2010. Vaclav Vancura.
* Contact me at vaclav@vancura.org or see my homepage at vaclav.vancura.org
* Project's GIT repo: http://github.com/vancura/vancura-as3-libs
* Documentation: http://doc.vaclav.vancura.org/vancura-as3-libs
*
* 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.vancura.vaclav.far {
import br.com.stimuli.string.printf;
import flash.events.Event;
import flash.events.EventDispatcher;
import flash.events.IOErrorEvent;
import flash.events.ProgressEvent;
import flash.events.SecurityErrorEvent;
import org.vancura.vaclav.far.events.FarHelperEvent;
import org.vancura.vaclav.far.events.FarHelperProgressEvent;
import org.vanrijkom.far.FarStream;
/**
* FAR Helper class.
*
* @author Vaclav Vancura (http://vaclav.vancura.org)
*/
public class FarHelper extends EventDispatcher {
private var _stream:FarStream;
private var _itemList:Array = new Array();
private var _url:String;
private var _isLoading:Boolean;
private var _isLoaded:Boolean;
/**
* Constructor.
*/
public function FarHelper() {
// create new stream
_stream = new FarStream();
// add event listeners
_stream.addEventListener(IOErrorEvent.IO_ERROR, _onFarIOError, false, 0, true);
_stream.addEventListener(SecurityErrorEvent.SECURITY_ERROR, _onFarSecurityError, false, 0, true);
_stream.addEventListener(Event.COMPLETE, _onFarDownloadDone, false, 0, true);
_stream.addEventListener(ProgressEvent.PROGRESS, _onStreamLoadProgress, false, 0, true);
// TODO: Unhandled IOError when 404 (should be fine now, test it)
}
/**
* Destructor.
*/
public function destroy():void {
// unload if loading
unload();
// remove event listeners
_stream.removeEventListener(IOErrorEvent.IO_ERROR, _onFarIOError);
_stream.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, _onFarSecurityError);
_stream.removeEventListener(Event.COMPLETE, _onFarDownloadDone);
_stream.removeEventListener(ProgressEvent.PROGRESS, _onStreamLoadProgress);
}
/**
* Load a FAR.
*
* @param url FAR url
*/
public function load(url:String):void {
if(!_isLoading && !_isLoaded) {
_url = url;
_isLoading = true;
_stream.loadFromURL(_url);
}
}
/**
* Unload a FAR.
*/
public function unload():void {
// reset flags
_isLoading = false;
_isLoaded = false;
_url = null;
// remove event listeners from all items and destroy them
for each(var i:FarHelperItem in _itemList) {
i.removeEventListener(FarHelperEvent.ITEM_LOAD_COMPLETE, _onItemLoadComplete);
i.removeEventListener(FarHelperProgressEvent.ITEM_LOAD_PROGRESS, _onItemLoadProgress);
i.removeEventListener(FarHelperEvent.ITEM_LOAD_FAILED, _onItemLoadIOError);
i.destroy();
}
_itemList = new Array();
// close stream
if(_stream.connected) {
_stream.close();
}
}
/**
* Load item by its index name.
*
* @param index Index name
*/
//noinspection FunctionWithMultipleReturnPointsJS
public function loadItem(index:String):void {
// check out if the item was already loaded
for each(var i:FarHelperItem in _itemList) {
if(i.index == index && i.isLoaded) {
// yeah, it was. just get data
i.getData(index);
return;
}
}
// no, the item was not loaded yet
// add it
var helperItem:FarHelperItem = new FarHelperItem(_stream);
// add event listeners
helperItem.addEventListener(FarHelperEvent.ITEM_LOAD_COMPLETE, _onItemLoadComplete, false, 0, true);
helperItem.addEventListener(FarHelperProgressEvent.ITEM_LOAD_PROGRESS, _onItemLoadProgress, false, 0, true);
helperItem.addEventListener(FarHelperEvent.ITEM_LOAD_FAILED, _onItemLoadIOError, false, 0, true);
// store reference
_itemList.push(helperItem);
// get data
helperItem.getData(index);
}
/**
* Get the item by its index name.
*
* @param index Index name
* @return Helper item
* @see FarHelper
* @throws Error if item is not registered
*/
public function getItem(index:String):FarHelperItem {
// try to find the item
for each(var i:FarHelperItem in _itemList) {
if(i.index == index) {
return i;
}
}
// item not found
var message:String = printf('Item "%s" not registered, use loadItem(index)', index);
throw new Error(message);
}
// Getters & setters
// -----------------
/**
* Get Stream pointer.
*
* @return Stream pointer
*/
public function get stream():FarStream {
return _stream;
}
/**
* Get loaded flag.
*
* @return Loaded flag
*/
public function get isLoaded():Boolean {
return _stream.loaded;
}
/**
* Get loading flag.
*
* @return Loading flag
*/
public function get isLoading():Boolean {
return _isLoading;
}
/**
* Get FAR URL.
*
* @return FAR URL
*/
public function get url():String {
return _url;
}
// Event listeners
// ---------------
private function _onFarSecurityError(event:SecurityErrorEvent):void {
_isLoading = false;
_isLoaded = false;
dispatchEvent(new FarHelperEvent(FarHelperEvent.STREAM_SECURITY_ERROR, false, false, null, event.text));
}
private function _onFarIOError(event:IOErrorEvent):void {
_isLoading = false;
_isLoaded = false;
dispatchEvent(new FarHelperEvent(FarHelperEvent.STREAM_IO_ERROR, false, false, null, event.text));
}
private function _onFarDownloadDone(event:Event):void {
_isLoading = false;
_isLoaded = true;
dispatchEvent(new FarHelperEvent(FarHelperEvent.STREAM_DOWNLOAD_DONE, false, false));
}
private function _onItemLoadIOError(event:FarHelperEvent):void {
dispatchEvent(event.clone());
}
private function _onItemLoadProgress(event:FarHelperProgressEvent):void {
dispatchEvent(event.clone());
}
private function _onItemLoadComplete(event:FarHelperEvent):void {
dispatchEvent(event.clone());
}
private function _onStreamLoadProgress(event:ProgressEvent):void {
var p:Number = 1 / (event.bytesTotal / event.bytesLoaded);
dispatchEvent(new FarHelperProgressEvent(FarHelperProgressEvent.STREAM_LOAD_PROGRESS, false, false, null, p));
}
}
}
|
package org.axgl.util {
/**
* A class representing a sprite's animation.
*/
public class AxAnimation {
/** The name of the animation, used when you want to play the animation. */
public var name:String;
/** The list of frames in the animation. */
public var frames:Vector.<uint>;
/** The framerate the animation should play at. */
public var framerate:uint;
/** Whether or not this animation is looped.*/
public var looped:Boolean;
/**
* Creates a new animation.
*
* @param name The name of the animation.
* @param frames The list of frames in the animation.
* @param framerate The framerate the animation should play at.
* @param looped Whether or not this animation is looped.
*/
public function AxAnimation(name:String, frames:Array, framerate:uint, looped:Boolean = true) {
this.name = name;
this.frames = Vector.<uint>(frames);
this.framerate = framerate;
this.looped = looped;
}
public function dispose():void {
frames = null;
}
}
}
|
package com.example
{
import flash.events.EventDispatcher;
import flash.external.ExtensionContext;
import flash.system.Capabilities;
public class HelloWorldExtension extends EventDispatcher
{
private var context:ExtensionContext;
public function HelloWorldExtension()
{
//ネイティブ拡張コンテキストを生成
context = ExtensionContext.createExtensionContext("example.ane.HelloWorld", "type");
}
public function getHelloWorld():String
{
return context.call("GetHelloWorld") as String;
}
public function dispose():void
{
return context.dispose();
}
}
}
|
/*
* Copyright (c) 2014-2022 Object Builder <https://github.com/ottools/ObjectBuilder>
*
* 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 otlib.things
{
/**
* Writer for versions 8.60 - 9.86
*/
public class MetadataWriter5 extends MetadataWriter
{
//--------------------------------------------------------------------------
// CONSTRUCTOR
//--------------------------------------------------------------------------
public function MetadataWriter5()
{
}
//--------------------------------------------------------------------------
// METHODS
//--------------------------------------------------------------------------
//--------------------------------------
// Public Override
//--------------------------------------
public override function writeProperties(type:ThingType):Boolean
{
if (type.category == ThingCategory.ITEM)
return false;
if (type.hasLight) {
writeByte(MetadataFlags5.HAS_LIGHT);
writeShort(type.lightLevel);
writeShort(type.lightColor);
}
if (type.hasOffset) {
writeByte(MetadataFlags5.HAS_OFFSET);
writeShort(type.offsetX);
writeShort(type.offsetY);
}
if (type.animateAlways)
writeByte(MetadataFlags5.ANIMATE_ALWAYS);
writeByte(MetadataFlags5.LAST_FLAG);
return true;
}
public override function writeItemProperties(type:ThingType):Boolean
{
if (type.category != ThingCategory.ITEM)
return false;
if (type.isGround) {
writeByte(MetadataFlags5.GROUND);
writeShort(type.groundSpeed);
} else if (type.isGroundBorder)
writeByte(MetadataFlags5.GROUND_BORDER);
else if (type.isOnBottom)
writeByte(MetadataFlags5.ON_BOTTOM);
else if (type.isOnTop)
writeByte(MetadataFlags5.ON_TOP);
if (type.isContainer)
writeByte(MetadataFlags5.CONTAINER);
if (type.stackable)
writeByte(MetadataFlags5.STACKABLE);
if (type.forceUse)
writeByte(MetadataFlags5.FORCE_USE);
if (type.multiUse)
writeByte(MetadataFlags5.MULTI_USE);
if (type.writable) {
writeByte(MetadataFlags5.WRITABLE);
writeShort(type.maxTextLength);
}
if (type.writableOnce) {
writeByte(MetadataFlags5.WRITABLE_ONCE);
writeShort(type.maxTextLength);
}
if (type.isFluidContainer)
writeByte(MetadataFlags5.FLUID_CONTAINER);
if (type.isFluid)
writeByte(MetadataFlags5.FLUID);
if (type.isUnpassable)
writeByte(MetadataFlags5.UNPASSABLE);
if (type.isUnmoveable)
writeByte(MetadataFlags5.UNMOVEABLE);
if (type.blockMissile)
writeByte(MetadataFlags5.BLOCK_MISSILE);
if (type.blockPathfind)
writeByte(MetadataFlags5.BLOCK_PATHFIND);
if (type.pickupable)
writeByte(MetadataFlags5.PICKUPABLE);
if (type.hangable)
writeByte(MetadataFlags5.HANGABLE);
if (type.isVertical)
writeByte(MetadataFlags5.VERTICAL);
if (type.isHorizontal)
writeByte(MetadataFlags5.HORIZONTAL);
if (type.rotatable)
writeByte(MetadataFlags5.ROTATABLE);
if (type.hasLight) {
writeByte(MetadataFlags5.HAS_LIGHT);
writeShort(type.lightLevel);
writeShort(type.lightColor);
}
if (type.dontHide)
writeByte(MetadataFlags5.DONT_HIDE);
if (type.isTranslucent)
writeByte(MetadataFlags5.TRANSLUCENT);
if (type.hasOffset) {
writeByte(MetadataFlags5.HAS_OFFSET);
writeShort(type.offsetX);
writeShort(type.offsetY);
}
if (type.hasElevation) {
writeByte(MetadataFlags5.HAS_ELEVATION);
writeShort(type.elevation);
}
if (type.isLyingObject)
writeByte(MetadataFlags5.LYING_OBJECT);
if (type.animateAlways)
writeByte(MetadataFlags5.ANIMATE_ALWAYS);
if (type.miniMap) {
writeByte(MetadataFlags5.MINI_MAP);
writeShort(type.miniMapColor);
}
if (type.isLensHelp) {
writeByte(MetadataFlags5.LENS_HELP);
writeShort(type.lensHelp);
}
if (type.isFullGround)
writeByte(MetadataFlags5.FULL_GROUND);
if (type.ignoreLook)
writeByte(MetadataFlags5.IGNORE_LOOK);
if (type.cloth) {
writeByte(MetadataFlags5.CLOTH);
writeShort(type.clothSlot);
}
if (type.isMarketItem) {
writeByte(MetadataFlags5.MARKET_ITEM);
writeShort(type.marketCategory);
writeShort(type.marketTradeAs);
writeShort(type.marketShowAs);
writeShort(type.marketName.length);
writeMultiByte(type.marketName, MetadataFlags5.STRING_CHARSET);
writeShort(type.marketRestrictProfession);
writeShort(type.marketRestrictLevel);
}
writeByte(MetadataFlags5.LAST_FLAG);
return true;
}
}
}
|
package flash.display {
// import flash.display3D.Context3DMipFilter;
// import flash.display3D.Context3DTextureFilter;
// import flash.display3D.Context3DWrapMode;
/**
* @externs
*/
final public class ShaderInput /*implements Dynamic*/ {
public function get channels ():int { return 0; }
public var filter:String;
public var height:int;
public function get index ():int { return 0; }
public var input:Object;
public var mipFilter:String;
public var width:int;
public var wrap:String;
public function ShaderInput () {}
}
}
|
package com.codeazur.as3swf.data
{
import com.codeazur.as3swf.SWFData;
import com.codeazur.as3swf.utils.ColorUtils;
public class SWFMorphGradientRecord
{
public var startRatio:uint;
public var startColor:uint;
public var endRatio:uint;
public var endColor:uint;
public function SWFMorphGradientRecord(data:SWFData = null) {
if (data != null) {
parse(data);
}
}
public function parse(data:SWFData):void {
startRatio = data.readUI8();
startColor = data.readRGBA();
endRatio = data.readUI8();
endColor = data.readRGBA();
}
public function publish(data:SWFData):void {
data.writeUI8(startRatio);
data.writeRGBA(startColor);
data.writeUI8(endRatio);
data.writeRGBA(endColor);
}
public function getMorphedGradientRecord(ratio:Number = 0):SWFGradientRecord {
var gradientRecord:SWFGradientRecord = new SWFGradientRecord();
gradientRecord.color = ColorUtils.interpolate(startColor, endColor, ratio);
gradientRecord.ratio = startRatio + (endRatio - startRatio) * ratio;
return gradientRecord;
}
public function toString():String {
return "[" + startRatio + "," + ColorUtils.rgbaToString(startColor) + "," + endRatio + "," + ColorUtils.rgbaToString(endColor) + "]";
}
}
}
|
import empire_ai.weasel.WeaselAI;
import empire_ai.weasel.race.Race;
import empire_ai.weasel.Designs;
import empire_ai.weasel.Development;
import empire_ai.weasel.Planets;
import buildings;
class Verdant : Race, RaceDesigns {
Designs@ designs;
IDevelopment@ development; // [[ MODIFY BASE GAME ]]
Planets@ planets;
array<const Design@> defaultDesigns;
array<uint> defaultGoals;
const SubsystemDef@ sinewSubsystem;
const SubsystemDef@ supportSinewSubsystem;
const BuildingType@ stalk;
void create() override {
@designs = cast<Designs>(ai.designs);
@development = cast<IDevelopment>(ai.development); // [[ MODIFY BASE GAME ]]
@planets = cast<Planets>(ai.planets);
@sinewSubsystem = getSubsystemDef("VerdantSinew");
@supportSinewSubsystem = getSubsystemDef("VerdantSupportSinew");
@stalk = getBuildingType("Stalk");
}
void start() override {
ReadLock lock(ai.empire.designMutex);
for(uint i = 0, cnt = ai.empire.designCount; i < cnt; ++i) {
const Design@ dsg = ai.empire.getDesign(i);
if(dsg.newer !is null)
continue;
if(dsg.updated !is null)
continue;
uint goal = designs.classify(dsg, DP_Unknown);
if(goal == DP_Unknown)
continue;
defaultDesigns.insertLast(dsg);
defaultGoals.insertLast(goal);
}
}
void save(SaveFile& file) override {
uint cnt = defaultDesigns.length;
file << cnt;
for(uint i = 0; i < cnt; ++i) {
file << defaultDesigns[i];
file << defaultGoals[i];
}
}
void load(SaveFile& file) override {
uint cnt = 0;
file >> cnt;
defaultDesigns.length = cnt;
defaultGoals.length = cnt;
for(uint i = 0; i < cnt; ++i) {
file >> defaultDesigns[i];
file >> defaultGoals[i];
}
}
uint plCheck = 0;
void focusTick(double time) override {
//Check if we need to build stalks anywhere
// [[ MODIFY BASE GAME START ]]
for(uint i = 0, cnt = development.Focuses.length; i < cnt; ++i)
checkForStalk(development.Focuses[i].plAI);
// [[ MODIFY BASE GAME END ]]
uint plCnt = planets.planets.length;
if(plCnt != 0) {
for(uint n = 0; n < min(plCnt, 5); ++n) {
plCheck = (plCheck+1) % plCnt;
auto@ plAI = planets.planets[plCheck];
checkForStalk(plAI);
}
}
}
void checkForStalk(PlanetAI@ plAI) {
if(plAI is null)
return;
Planet@ pl = plAI.obj;
// [[ MODIFY BASE GAME START ]]
// Planets can get a bit of pressure cap from resources too!
// Build a stalk anyway since we still need it to use the pressure on any planet
if((pl.pressureCap <= 0 && pl.totalPressure >= 1) || (pl.totalPressure >= 1 && int(pl.pressureCap) < pl.totalPressure)) {
// [[ MODIFY BASE GAME END ]]
if(planets.isBuilding(plAI.obj, stalk))
return;
if(pl.getBuildingCount(stalk.id) != 0)
return;
planets.requestBuilding(plAI, stalk, expire=180.0);
}
}
bool preCompose(DesignTarget@ target) override {
return false;
}
bool postCompose(DesignTarget@ target) override {
// auto@ d = target.designer;
// //Add an extra engine
// if(target.purpose == DP_Combat)
// d.composition.insertAt(0, Exhaust(tag("Engine") & tag("GivesThrust"), 0.25, 0.35));
// //Remove armor layers we don't need
// for(uint i = 0, cnt = d.composition.length; i < cnt; ++i) {
// if(cast<ArmorLayer>(d.composition[i]) !is null) {
// d.composition.removeAt(i);
// --i; --cnt;
// }
// }
return false;
}
bool design(DesignTarget@ target, int size, const Design@& output) {
//All designs are rescales of default designs
const Design@ baseDesign;
uint possible = 0;
for(uint i = 0, cnt = defaultDesigns.length; i < cnt; ++i) {
if(defaultGoals[i] == target.purpose) {
possible += 1;
if(randomd() < 1.0 / double(possible))
@baseDesign = defaultDesigns[i];
}
}
if(baseDesign is null)
return false;
//if(target.designer !is null) {
// @target.designer.baseOffDesign = baseDesign;
// if(target.purpose != DP_Support)
// @target.designer.baseOffSubsystem = sinewSubsystem;
// else
// @target.designer.baseOffSubsystem = supportSinewSubsystem;
// @output = target.designer.design();
//}
if(output is null)
@output = scaleDesign(baseDesign, size);
return true;
}
};
AIComponent@ createVerdant() {
return Verdant();
}
|
package com.ankamagames.berilia.managers
{
import com.ankamagames.berilia.types.graphic.ExternalUi;
import com.ankamagames.jerakine.utils.display.StageShareManager;
import flash.desktop.NativeApplication;
import flash.display.NativeWindow;
import flash.events.Event;
import flash.events.NativeWindowDisplayStateEvent;
public class ExternalUiManager
{
private static var _instance:ExternalUiManager;
public function ExternalUiManager()
{
super();
NativeApplication.nativeApplication.addEventListener(Event.ACTIVATE,this.onWindowFocus,false,0,true);
StageShareManager.stage.nativeWindow.addEventListener(Event.ACTIVATE,this.onWindowFocus,false,0,true);
StageShareManager.stage.nativeWindow.addEventListener(Event.CLOSING,this.onMainWindowClose,false,0,true);
StageShareManager.stage.nativeWindow.addEventListener(NativeWindowDisplayStateEvent.DISPLAY_STATE_CHANGE,this.onWindowFocus,false,0,true);
}
public static function getInstance() : ExternalUiManager
{
if(!_instance)
{
_instance = new ExternalUiManager();
}
return _instance;
}
protected function onMainWindowClose(event:Event) : void
{
var w:NativeWindow = null;
var windows:Array = NativeApplication.nativeApplication.openedWindows;
for each(w in windows)
{
if(!w.closed)
{
w.close();
}
}
}
public function registerExternalUi(eui:ExternalUi) : void
{
eui.addEventListener(Event.ACTIVATE,this.onWindowFocus,false,0,true);
eui.addEventListener(NativeWindowDisplayStateEvent.DISPLAY_STATE_CHANGE,this.onWindowFocus,false,0,true);
}
public function unregisterExternalUi(eui:ExternalUi) : void
{
eui.removeEventListener(Event.ACTIVATE,this.onWindowFocus);
eui.removeEventListener(NativeWindowDisplayStateEvent.DISPLAY_STATE_CHANGE,this.onWindowFocus);
}
protected function onWindowFocus(event:Event) : void
{
var w:NativeWindow = null;
var windows:Array = NativeApplication.nativeApplication.openedWindows;
for each(w in windows)
{
if(w != StageShareManager.stage.nativeWindow)
{
w.orderInFrontOf(StageShareManager.stage.nativeWindow);
}
}
}
}
}
|
package idv.cjcat.stardust.twoD.actions {
import idv.cjcat.stardust.common.emitters.Emitter;
import idv.cjcat.stardust.common.particles.Particle;
import idv.cjcat.stardust.common.xml.XMLBuilder;
import idv.cjcat.stardust.twoD.particles.Particle2D;
/**
* Causes a particle's rotation to change according to it's omega value (angular velocity).
*
* <p>
* Default priority = -4;
* </p>
*/
public class Spin extends Action2D {
/**
* The multiplier of spinning, 1 by default.
*
* <p>
* For instance, a multiplier value of 2 causes a particle to spin twice as fast as normal.
* </p>
*/
public var multiplier:Number;
public function Spin(multiplier:Number = 1) {
priority = -4;
this.multiplier = multiplier;
}
override public function preUpdate(emitter:Emitter, time:Number):void {
factor = time * multiplier;
}
private var p2D:Particle2D;
private var factor:Number;
override public function update(emitter:Emitter, particle:Particle, time:Number):void {
p2D = Particle2D(particle);
p2D.rotation += p2D.omega * factor;
}
//XML
//------------------------------------------------------------------------------------------------
override public function getXMLTagName():String {
return "Spin";
}
override public function toXML():XML {
var xml:XML = super.toXML();
xml.@multiplier = multiplier;
return xml;
}
override public function parseXML(xml:XML, builder:XMLBuilder = null):void {
super.parseXML(xml, builder);
if (xml.@multiplier.length()) multiplier = parseFloat(xml.@multiplier);
}
//------------------------------------------------------------------------------------------------
//end of XML
}
} |
/*
The MIT License
Copyright (c) 2010 Mike Chambers
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.
*/
import flash.events.Event;
import flash.events.IOErrorEvent;
import flash.events.ProgressEvent;
import flash.events.SecurityErrorEvent;
import flash.net.Socket;
import flash.utils.Endian;
private static const PORT:uint = 5331;
private static const SERVER_ADDRESS:String = "127.0.0.1";
private var socket:Socket;
private function onApplicationComplete():void
{
//only allow numbers, period and minus sign
numberInput.restrict = ".0-9\\-";
socket = new Socket()
socket.addEventListener(Event.CONNECT, onConnect);
socket.addEventListener(Event.CLOSE, onClose);
socket.addEventListener( IOErrorEvent.IO_ERROR, onIOError );
socket.addEventListener( SecurityErrorEvent.SECURITY_ERROR, onSecurityError );
socket.addEventListener( ProgressEvent.SOCKET_DATA, onSocketData );
//disable until we connect
this.enabled = false;
//this is important! If you dont set this to
//little endian, then arduino wont understand
//the bytes
socket.endian = Endian.LITTLE_ENDIAN;
socket.connect(SERVER_ADDRESS, PORT);
}
private function onSendClick():void
{
//get the number that the user input
var out:Number = Number(numberInput.text);
//write it as a float to the server.
//this is important.
socket.writeFloat(out);
//if number is too big, then it will overflow on
//the arduino, and probably come back as 0.00000
}
private function onSocketData(e:ProgressEvent):void
{
//note, you need to watch that the entire message from the server is here
//it might not have all arrived.
//We should be fine here since we are only receiving 4 bytes
var data:String = socket.readUTFBytes( socket.bytesAvailable );
log("onSocketData : " + data);
}
/***** socket handlers *******/
private function onConnect(e:Event):void
{
log("Connected");
this.enabled = true;
}
private function onClose(e:Event):void
{
log("Socket Closed");
this.enabled = false;
}
private function onIOError(e:IOErrorEvent):void
{
log("onIOError : " + e.text);
this.enabled = false;
}
private function onSecurityError(e:SecurityErrorEvent):void
{
log("onSecurityError : " + e.text);
this.enabled = false;
}
private function log(msg:String):void
{
outputField.text += msg + "\n";
}
|
/*
Copyright (c) 2006. 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 flexlib.scheduling.scheduleClasses.renderers
{
import flash.display.GradientType;
import flash.geom.Matrix;
import mx.containers.Box;
import mx.controls.Label;
import mx.controls.Text;
import mx.core.FlexGlobals;
import mx.core.ScrollPolicy;
import mx.core.mx_internal;
import mx.formatters.DateFormatter;
import mx.styles.CSSStyleDeclaration;
import mx.styles.IStyleManager2;
import mx.styles.StyleManager;
import mx.utils.ColorUtil;
import flexlib.scheduling.scheduleClasses.IScheduleEntry;
import flexlib.scheduling.scheduleClasses.SimpleScheduleEntry;
public class AbstractGradientScheduleEntryRenderer extends Box implements IScheduleEntryRenderer
{
public var contentLabel:Label;
public var contentText:Text;
private var defaultLabel:String = "";
private var formatter:DateFormatter;
private var formatString:String = "L:NNAA";
private var origFillColors:Array;
private var changeSelection:Boolean;
private var _entry:IScheduleEntry;
private var _selected:Boolean = false;
private var gradientChanged:Boolean = true;
public function get entry():IScheduleEntry
{
return _entry;
}
public function set entry(value:IScheduleEntry):void
{
_entry = value;
}
public function get selected():Boolean
{
return _selected;
}
public function set selected(value:Boolean):void
{
_selected = value;
updateSelected();
}
public function AbstractGradientScheduleEntryRenderer()
{
super();
formatter = new DateFormatter();
formatter.formatString = formatString;
horizontalScrollPolicy = ScrollPolicy.OFF;
verticalScrollPolicy = ScrollPolicy.OFF;
// our style settings
// initialize component styles
if (!this.styleDeclaration)
{
this.styleDeclaration = new CSSStyleDeclaration();
}
this.styleDeclaration.defaultFactory = function():void
{
this.borderStyle = "applicationControlBar";
};
mx_internal::initStyles();
// properties
this.styleName = "defaultEntryStyle";
this.verticalScrollPolicy = "off";
this.horizontalScrollPolicy = "off";
}
mx_internal var stylesInitialized:Boolean = false;
mx_internal function initStyles():void
{
// only add our style defs to the StyleManager once
if (mx_internal::stylesInitialized)
{
return;
}
else
{
mx_internal::stylesInitialized = true;
}
var style:CSSStyleDeclaration;
var effects:Array;
// defaultTimeStyle
style = IStyleManager2(FlexGlobals.topLevelApplication.styleManager).getStyleDeclaration(".defaultTimeStyle");
if (!style)
{
style = new CSSStyleDeclaration();
IStyleManager2(FlexGlobals.topLevelApplication.styleManager).setStyleDeclaration(".defaultTimeStyle", style, false);
}
if (style.factory == null)
{
style.factory = function():void
{
this.fontWeight = "bold";
this.color = 0x000000;
this.fontSize = 9;
};
}
// defaultEntryStyle
style = IStyleManager2(FlexGlobals.topLevelApplication.styleManager).getStyleDeclaration(".defaultEntryStyle");
if (!style)
{
style = new CSSStyleDeclaration();
IStyleManager2(FlexGlobals.topLevelApplication.styleManager).setStyleDeclaration(".defaultEntryStyle", style, false);
}
if (style.factory == null)
{
style.factory = function():void
{
this.borderStyle = "default";
this.timeStyleName = "defaultTimeStyle";
this.paddingTop = 5;
this.shadowDistance = 2;
this.cornerRadius = 6;
this.fontSize = 11;
this.verticalGap = -2;
this.fillAlphas = [1, 1];
this.paddingLeft = 5;
this.paddingRight = 5;
this.fontWeight = "normal";
this.dropShadowEnabled = true;
this.color = 0xffffff;
this.borderThickness = 1;
this.highlightAlphas = [0.08, 0];
this.fillColors = [0x7aa4bc, 0x53839f];
this.paddingBottom = 5;
};
}
}
override protected function createChildren():void
{
super.createChildren();
contentLabel = new Label();
addChild(contentLabel);
contentText = new Text();
addChild(contentText);
}
/**
* @private
*/
override public function styleChanged(styleProp:String):void
{
super.styleChanged(styleProp);
if (styleProp != null)
{
if (styleProp == "fillColors" && !changeSelection)
{
origFillColors = getStyle(styleProp);
}
else if (changeSelection)
{
changeSelection = false;
}
if (styleProp == "fillColors")
{
gradientChanged = true;
invalidateDisplayList();
}
}
}
private function updateSelected():void
{
var newColor1:uint;
var newColor2:uint;
if (origFillColors == null)
{
origFillColors = getStyle("fillColors");
}
if (_selected)
{
setStyle("dropShadowEnabled", true);
changeSelection = true;
newColor1 = ColorUtil.adjustBrightness2(origFillColors[0], 25);
newColor2 = ColorUtil.adjustBrightness2(origFillColors[1], 25);
setStyle("fillColors", [newColor1, newColor2]);
}
else
{
setStyle("dropShadowEnabled", false);
changeSelection = true;
newColor1 = ColorUtil.adjustBrightness2(origFillColors[0], 0);
newColor2 = ColorUtil.adjustBrightness2(origFillColors[1], 0);
setStyle("fillColors", [newColor1, newColor2]);
}
}
protected function setTextContent(content:SimpleScheduleEntry):void
{
if (content.label == null)
{
content.label = defaultLabel;
}
formatter.error = "";
var time:String = formatter.format(content.startDate)
+ " - " + formatter.format(content.endDate);
toolTip = time + "\n" + content.label;
contentLabel.text = time;
contentLabel.styleName = getStyle("timeStyleName");
contentText.text = content.label;
updateSelected();
}
FLEX_TARGET_VERSION::flex4
{
override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
{
super.updateDisplayList(unscaledWidth, unscaledHeight);
if (gradientChanged)
{
var fillColors:Array = getStyle("fillColors");
var cornerRadius:int = getStyle("cornerRadius");
var matrix:Matrix = new Matrix();
matrix.createGradientBox(unscaledWidth, unscaledHeight, 90);
graphics.beginGradientFill(GradientType.LINEAR, fillColors, [1, 1], [0, 255], matrix);
graphics.drawRoundRect(0, 0, unscaledWidth, unscaledHeight, cornerRadius + 4);
gradientChanged = false;;
}
}
}
}
} |
package com.rokannon.math.raycast
{
import com.rokannon.core.pool.IPoolObject;
public class Voxel implements IPoolObject
{
public const gridObjects:Vector.<GridObject> = new <GridObject>[];
public var index:int;
public function Voxel()
{
}
public function resetPoolObject():void
{
gridObjects.length = 0;
index = 0;
}
}
} |
package components.managers.events
{
import flash.events.Event;
import mx.core.IFlexDisplayObject;
public class PopUpEvent extends Event
{
public static const OPEN : String = 'open';
public static const CLOSE : String = 'close';
/**
* Общщее количество открытых окон
*/
public var numWindows : uint;
/**
* Текущее окно с которым происходит какое-либо действие
*/
public var window : IFlexDisplayObject;
public function PopUpEvent( type : String, numWindows : uint, window : IFlexDisplayObject )
{
super( type );
this.numWindows = numWindows;
this.window = window;
}
override public function clone():Event
{
return new PopUpEvent( type, numWindows, window );
}
}
} |
function normal
assertEqual "a" ("abcd" 0)
assertEqual "b" ("abcd" 1)
assertEqual "c" ("abcd" 2)
assertEqual "d" ("abcd" 3)
assertEqual "a" ("abcd" -4)
assertEqual "b" ("abcd" -3)
assertEqual "c" ("abcd" -2)
assertEqual "d" ("abcd" -1)
@throws_type function type
return ("abcd" "a")
@throws_oob function oob1
return ("abcd" 4)
@throws_oob function oob2
return ("abcd" -5)
|
package fl.video
{
import flash.net.NetConnection;
public interface INCManager
{
function get videoPlayer():VideoPlayer;
function set videoPlayer(v:VideoPlayer):void;
function get timeout():uint;
function set timeout(t:uint):void;
function get netConnection():NetConnection;
function get bitrate():Number;
function set bitrate(b:Number):void;
function get streamName():String;
function get isRTMP():Boolean;
function get streamLength():Number;
function get streamWidth():int;
function get streamHeight():int;
function connectToURL(url:String):Boolean;
function connectAgain():Boolean;
function reconnect():void;
function helperDone(helper:Object, success:Boolean):void;
function close():void;
function getProperty(propertyName:String):*;
function setProperty(propertyName:String, value:*):void;
}
}
|
package Characters.States
{
import Engine.Input.InputHandler;
internal interface IState
{
function enter():void;
function update(inputHandler:InputHandler):void;
function exit():void;
}
} |
////////////////////////////////////////////////////////////////////////////////
//
// Licensed to the Apache Software Foundation (ASF) under one or more
// contributor license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright ownership.
// The ASF licenses this file to You under the Apache License, Version 2.0
// (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////
package org.apache.royale.mdl.supportClasses
{
import org.apache.royale.html.supportClasses.MXMLItemRenderer;;
COMPILE::JS
{
import org.apache.royale.core.CSSClassList;
}
/**
* Base class for Tabs item renderers
*
* @langversion 3.0
* @playerversion Flash 10.2
* @playerversion AIR 2.6
* @productversion Royale 0.8
*/
public class TabItemRendererBase extends MXMLItemRenderer implements ITabItemRenderer
{
/**
* constructor.
*
* @langversion 3.0
* @playerversion Flash 10.2
* @playerversion AIR 2.6
* @productversion Royale 0.8
*/
public function TabItemRendererBase()
{
super();
COMPILE::JS
{
_classList = new CSSClassList();
}
}
COMPILE::JS
private var _classList:CSSClassList;
private var _tabIdField:String;
/**
* @copy org.apache.royale.mdl.supportClasses.ITabItemRenderer#tabIdField
*
* @langversion 3.0
* @playerversion Flash 10.2
* @playerversion AIR 2.6
* @productversion Royale 0.8
*/
public function get tabIdField():String
{
return _tabIdField;
}
public function set tabIdField(value:String):void
{
_tabIdField = value;
}
private var _isActive:Boolean;
/**
* @copy org.apache.royale.mdl.supportClasses.ITabItemRenderer#isActive
*
* @langversion 3.0
* @playerversion Flash 10.2
* @playerversion AIR 2.6
* @productversion Royale 0.8
*/
public function get isActive():Boolean
{
return _isActive;
}
public function set isActive(value:Boolean):void
{
if (_isActive != value)
{
_isActive = value;
COMPILE::JS
{
var classVal:String = "is-active";
value ? _classList.add(classVal) : _classList.remove(classVal);
setClassName(computeFinalClassNames());
}
}
}
/**
* Sets the data value and uses the String version of the data for display.
*
* @param Object data The object being displayed by the itemRenderer instance.
*
* @langversion 3.0
* @playerversion Flash 10.2
* @playerversion AIR 2.6
* @productversion Royale 0.8
*/
override public function set data(value:Object):void
{
super.data = value;
COMPILE::JS
{
if (tabIdField)
{
element.id = String(value[tabIdField]);
}
else
{
throw new Error("tabIdField cannot be empty.");
}
}
}
COMPILE::JS
override protected function computeFinalClassNames():String
{
return _classList.compute() + super.computeFinalClassNames();
}
}
}
|
package
{
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.display.Sprite;
import flash.events.Event;
import flash.geom.Matrix;
import flash.geom.Point;
import flash.geom.Rectangle;
import hansune.loader.BitmapLoader;
import hansune.viewer.ImageViewer;
[SWF(width='800', height='600', backgroundColor='#000000', frameRate='60')]
public class bitmapLoaderEx extends Sprite
{
private var loader:BitmapLoader;
public function bitmapLoaderEx()
{
loader = new BitmapLoader();
loader.addEventListener(Event.COMPLETE, _onLoad);
loader.load("data/kim.jpg");
}
private function _onLoad(e:Event):void{
var bm:Bitmap = (e.target as BitmapLoader).bitmap;
addChild(bm);
var bmd:BitmapData = new BitmapData(bm.width, bm.height);
var mat:Matrix = new Matrix();
//mat.translate(0, -100);
bmd.draw(bm, mat, null, null, new Rectangle(0, 100, bm.width, bm.height - 100));
var newbmd:BitmapData = new BitmapData(bm.width, bm.height - 100);
newbmd.copyPixels(bmd, new Rectangle(0, 100, bm.width, bm.height - 100), new Point(0,0));
//bmd.scroll(0, -100);
var nbm:Bitmap = new Bitmap(newbmd);
nbm.x = bm.width;
addChild(nbm);
///*
// var im:ImageViewer;
// im = new ImageViewer();
// im.containerWidth = 800;
// im.containerHeight = 600;
// im.initPosition = 0;
// im.view(bm);
// addChild(im);
//*/
}
}
} |
package punk.ui.skin
{
/**
* Base class that all Skin elements extend from
*/
public class PunkSkinElement
{
/**
* Constructor.
*/
public function PunkSkinElement()
{
}
}
} |
//----------------------------------------------------------------------------------------------------
// class for Noise simulator generator
// Copyright (c) 2008 keim All rights reserved.
// Distributed under BSD-style license (see org.si.license.txt).
//----------------------------------------------------------------------------------------------------
package org.si.sion.sequencer.simulator {
import org.si.sion.module.SiOPMTable;
/** Noise generator simulator */
public class SiMMLSimulatorNoise extends SiMMLSimulatorBase
{
function SiMMLSimulatorNoise()
{
super(MT_NOISE, 1, new SiMMLSimulatorVoiceSet(16, SiOPMTable.PG_NOISE_WHITE));
}
}
}
|
void calc(int &in a, int &out b)
{
b = a;
}
void main()
{
int foo = 123;
calc(10, foo);
print(foo);
}
|
package ru.nacid.base.view.component.button
{
import flash.display.DisplayObject;
import ru.nacid.base.view.component.text.Label;
import ru.nacid.base.view.component.text.enum.LabelFormat;
import ru.nacid.base.view.component.text.interfaces.ILabel;
public class LabelButton extends AnimatedButton implements ILabel
{
private var _label:ILabel;
public function LabelButton($skin:String, $text:String=null, $format:LabelFormat=null)
{
super($skin);
defaultContent($format);
if ($text)
text=$text;
}
override public function arrange():void {
content.width = currentWidth;
content.height = currentHeight;
super.arrange();
}
override public function set content(value:DisplayObject):void
{
if (value is ILabel)
{
_label=ILabel(value);
super.content=value;
}
else
{
throw new TypeError('content must implement ILabel interface');
}
}
protected function defaultContent($format:LabelFormat):void
{
content=new Label($format);
}
// interface -------------
public function getFormat():LabelFormat
{
return _label.getFormat();
}
public function setFormat($format:LabelFormat):void
{
_label.setFormat($format);
}
public function set text(value:String):void
{
_label.text=value;
arrange();
}
public function get text():String
{
return _label.text;
}
}
}
|
// Decompiled by AS3 Sorcerer 6.08
// www.as3sorcerer.com
//kabam.rotmg.account.kabam.services.KabamLoadAccountTask
package kabam.rotmg.account.kabam.services
{
import kabam.lib.tasks.BaseTask;
import kabam.rotmg.account.core.services.LoadAccountTask;
import kabam.rotmg.account.core.Account;
import kabam.rotmg.account.kabam.model.KabamParameters;
import kabam.rotmg.dialogs.control.OpenDialogSignal;
import kabam.rotmg.appengine.api.AppEngineClient;
import kabam.rotmg.account.kabam.KabamAccount;
import kabam.rotmg.account.kabam.view.AccountLoadErrorDialog;
public class KabamLoadAccountTask extends BaseTask implements LoadAccountTask
{
[Inject]
public var account:Account;
[Inject]
public var parameters:KabamParameters;
[Inject]
public var openDialog:OpenDialogSignal;
[Inject]
public var client:AppEngineClient;
private var kabam:KabamAccount;
override protected function startTask():void
{
this.kabam = (this.account as KabamAccount);
this.kabam.signedRequest = this.parameters.getSignedRequest();
this.kabam.userSession = this.parameters.getUserSession();
if (this.kabam.userSession == null)
{
this.openDialog.dispatch(new AccountLoadErrorDialog());
completeTask(false);
}
else
{
this.sendRequest();
}
}
private function sendRequest():void
{
var _local_1:Object = {
"signedRequest":this.kabam.signedRequest,
"entrytag":this.account.getEntryTag()
}
this.client.setMaxRetries(2);
this.client.complete.addOnce(this.onComplete);
this.client.sendRequest("/kabam/getcredentials", _local_1);
}
private function onComplete(_arg_1:Boolean, _arg_2:*):void
{
((_arg_1) && (this.onGetCredentialsDone(_arg_2)));
completeTask(_arg_1, _arg_2);
}
private function onGetCredentialsDone(_arg_1:String):void
{
var _local_2:XML = new XML(_arg_1);
this.account.updateUser(_local_2.GUID, _local_2.Secret, "");
this.account.setPlatformToken(_local_2.PlatformToken);
}
}
}//package kabam.rotmg.account.kabam.services
|
package
{
import flash.display.Sprite;
import flash.net.URLLoader;
import flash.text.TextField;
/**
* ...
* @author lizhi
*/
public class SpriteFlexjsMain extends Sprite
{
public function SpriteFlexjsMain()
{
var cs:Array = [TextField,URLLoader];
}
}
} |
package widgets.PO.Class
{
import com.esri.ags.FeatureSet;
public class Generica
{
public function Generica()
{
}
}
} |
package com.playata.application.ui.dialogs
{
import com.playata.application.data.GameUtil;
import com.playata.application.data.guild.GuildBattleAttackTime;
import com.playata.application.data.user.User;
import com.playata.application.messaging.Message;
import com.playata.application.messaging.MessageRouter;
import com.playata.application.ui.ViewManager;
import com.playata.application.ui.elements.generic.button.UiButton;
import com.playata.application.ui.elements.generic.button.UiTextButton;
import com.playata.application.ui.elements.generic.checkbox.UiCheckBox;
import com.playata.application.ui.elements.generic.dialog.UiDialog;
import com.playata.application.ui.elements.generic.dialog.UiInfoDialog;
import com.playata.application.ui.elements.guild.UiGuildChatTab;
import com.playata.framework.application.Environment;
import com.playata.framework.application.request.ActionRequestResponse;
import com.playata.framework.core.Runtime;
import com.playata.framework.display.ui.controls.Button;
import com.playata.framework.display.ui.controls.ILabelArea;
import com.playata.framework.input.InteractionEvent;
import com.playata.framework.localization.LocText;
import visuals.ui.dialogs.SymbolDialogGuildBattleCreateGeneric;
public class DialogGuildBattleCreate extends UiDialog
{
private var _guildId:int = 0;
private var _btnClose:UiButton = null;
private var _btnAttack:UiTextButton = null;
private var _checkTime1:UiCheckBox = null;
private var _checkTime2:UiCheckBox = null;
private var _checkTime3:UiCheckBox = null;
private var _checkTime4:UiCheckBox = null;
private var _checkTime5:UiCheckBox = null;
public function DialogGuildBattleCreate(param1:int)
{
_guildId = param1;
var _loc2_:SymbolDialogGuildBattleCreateGeneric = new SymbolDialogGuildBattleCreateGeneric();
super(_loc2_);
_queued = false;
_loc2_.txtDialogTitle.text = LocText.current.text("dialog/guild_battle_create/title");
_loc2_.txtTimeCaption.text = LocText.current.text("dialog/guild_battle_create/time_caption");
_loc2_.txtCostCaption.text = LocText.current.text("dialog/guild_battle_create/cost_caption");
_loc2_.txtCoins.text = LocText.current.formatHugeNumber(GameUtil.guildBattleCost(User.current.character.guild.totalImprovementPercentage()));
_btnClose = new UiButton(_loc2_.btnClose,"",onClickClose);
_btnAttack = new UiTextButton(_loc2_.btnAttack,LocText.current.text("dialog/guild_battle_create/button_attack"),"",onClickAttack);
_checkTime1 = new UiCheckBox(_loc2_.checkTime1,true,"",onCheckedChanged1,null,_loc2_.txtTime1);
_checkTime2 = new UiCheckBox(_loc2_.checkTime2,false,"",onCheckedChanged2,null,_loc2_.txtTime2);
_checkTime3 = new UiCheckBox(_loc2_.checkTime3,false,"",onCheckedChanged3,null,_loc2_.txtTime3);
_checkTime4 = new UiCheckBox(_loc2_.checkTime4,false,"",onCheckedChanged4,null,_loc2_.txtTime4);
_checkTime5 = new UiCheckBox(_loc2_.checkTime5,false,"",onCheckedChanged5,null,_loc2_.txtTime5);
updateAttackTimes();
MessageRouter.addListener("ViewMessage.notifyNeededGuildDonationMade",handleMessages);
}
private function updateAttackTimes() : void
{
var _loc1_:SymbolDialogGuildBattleCreateGeneric = _vo as SymbolDialogGuildBattleCreateGeneric;
var _loc2_:Vector.<GuildBattleAttackTime> = new Vector.<GuildBattleAttackTime>();
_loc2_.push(new GuildBattleAttackTime(1));
_loc2_.push(new GuildBattleAttackTime(2));
_loc2_.push(new GuildBattleAttackTime(3));
_loc2_.push(new GuildBattleAttackTime(4));
_loc2_.push(new GuildBattleAttackTime(5));
_loc2_.sort(sortByLocalTimestamp);
_loc1_.txtTime1.text = _loc2_[0].battleAttackTimeString;
_loc1_.txtTime2.text = _loc2_[1].battleAttackTimeString;
_loc1_.txtTime3.text = _loc2_[2].battleAttackTimeString;
_loc1_.txtTime4.text = _loc2_[3].battleAttackTimeString;
_loc1_.txtTime5.text = _loc2_[4].battleAttackTimeString;
_checkTime1.tooltip = LocText.current.text("dialog/guild_battle_create/time_tooltip",_loc2_[0].battleAttackTimeStringEventLog);
_checkTime2.tooltip = LocText.current.text("dialog/guild_battle_create/time_tooltip",_loc2_[1].battleAttackTimeStringEventLog);
_checkTime3.tooltip = LocText.current.text("dialog/guild_battle_create/time_tooltip",_loc2_[2].battleAttackTimeStringEventLog);
_checkTime4.tooltip = LocText.current.text("dialog/guild_battle_create/time_tooltip",_loc2_[3].battleAttackTimeStringEventLog);
_checkTime5.tooltip = LocText.current.text("dialog/guild_battle_create/time_tooltip",_loc2_[4].battleAttackTimeStringEventLog);
_checkTime1.tag = _loc2_[0].guildBattleTime;
_checkTime2.tag = _loc2_[1].guildBattleTime;
_checkTime3.tag = _loc2_[2].guildBattleTime;
_checkTime4.tag = _loc2_[3].guildBattleTime;
_checkTime5.tag = _loc2_[4].guildBattleTime;
}
override public function dispose() : void
{
MessageRouter.removeAllListeners(handleMessages);
if(_btnClose == null)
{
return;
}
_btnClose.dispose();
_btnClose = null;
_btnAttack.dispose();
_btnAttack = null;
_checkTime1.dispose();
_checkTime1 = null;
_checkTime2.dispose();
_checkTime2 = null;
_checkTime3.dispose();
_checkTime3 = null;
_checkTime4.dispose();
_checkTime4 = null;
_checkTime5.dispose();
_checkTime5 = null;
super.dispose();
}
private function onClickClose(param1:InteractionEvent) : void
{
close();
}
private function onClickAttack(param1:InteractionEvent) : void
{
attackGuild();
}
private function attackGuild() : void
{
var _loc4_:ILabelArea = null;
var _loc3_:int = 0;
var _loc1_:SymbolDialogGuildBattleCreateGeneric = _vo as SymbolDialogGuildBattleCreateGeneric;
if(_checkTime1.checked)
{
_loc3_ = _checkTime1.tagAsInt;
_loc4_ = _loc1_.txtTime1;
}
else if(_checkTime2.checked)
{
_loc3_ = _checkTime2.tagAsInt;
_loc4_ = _loc1_.txtTime2;
}
else if(_checkTime3.checked)
{
_loc3_ = _checkTime3.tagAsInt;
_loc4_ = _loc1_.txtTime3;
}
else if(_checkTime4.checked)
{
_loc3_ = _checkTime4.tagAsInt;
_loc4_ = _loc1_.txtTime4;
}
else if(_checkTime5.checked)
{
_loc3_ = _checkTime5.tagAsInt;
_loc4_ = _loc1_.txtTime5;
}
var _loc2_:GuildBattleAttackTime = new GuildBattleAttackTime(_loc3_);
if(_loc2_.battleAttackTimeString != _loc4_.text)
{
Environment.panelManager.showDialog(new UiInfoDialog(LocText.current.text("dialog/guild_battle_create_times_changed/title"),LocText.current.text("dialog/guild_battle_create_times_changed/text"),LocText.current.text("general/button_ok")));
updateAttackTimes();
}
else
{
Environment.application.sendActionRequest("attackGuild",{
"guild_id":_guildId,
"time":_loc3_
},handleRequests);
}
}
private function closeDialog() : void
{
close();
}
private function onCheckedChanged1(param1:Boolean) : void
{
refreshTimeOptions(1);
}
private function onCheckedChanged2(param1:Boolean) : void
{
refreshTimeOptions(2);
}
private function onCheckedChanged3(param1:Boolean) : void
{
refreshTimeOptions(3);
}
private function onCheckedChanged4(param1:Boolean) : void
{
refreshTimeOptions(4);
}
private function onCheckedChanged5(param1:Boolean) : void
{
refreshTimeOptions(5);
}
private function refreshTimeOptions(param1:int) : void
{
_checkTime1.checked = param1 == 1;
_checkTime2.checked = param1 == 2;
_checkTime3.checked = param1 == 3;
_checkTime4.checked = param1 == 4;
_checkTime5.checked = param1 == 5;
}
private function handleRequests(param1:ActionRequestResponse) : void
{
var _loc2_:* = null;
var _loc3_:* = param1.action;
if("attackGuild" !== _loc3_)
{
throw new Error("Unsupported request action \'" + param1.action + "\'!");
}
if(param1.error == "")
{
Environment.application.updateData(param1.data);
close();
ViewManager.instance.showPanel("guild");
UiGuildChatTab.instance.refreshGuildLog();
}
else if(param1.error == "errCreateInvalidGuild")
{
Environment.panelManager.showDialog(new UiInfoDialog(LocText.current.text("dialog/guild_battle_create_invalid_guild/title"),LocText.current.text("dialog/guild_battle_create_invalid_guild/text"),LocText.current.text("general/button_ok")));
close();
}
else if(param1.error == "errCreateNoPermission")
{
Environment.panelManager.showDialog(new UiInfoDialog(LocText.current.text("dialog/guild_battle_create_no_permission/title"),LocText.current.text("dialog/guild_battle_create_no_permission/text"),LocText.current.text("general/button_ok")));
close();
}
else if(param1.error == "errRemoveGameCurrencyNotEnough")
{
ViewManager.instance.showGuildNotEnoughGameCurrencyPremiumCurrencyDialog(GameUtil.guildBattleCost(User.current.character.guild.totalImprovementPercentage()),0,closeDialog);
}
else if(param1.error == "errCreateAlreadyAttacking")
{
Environment.panelManager.showDialog(new UiInfoDialog(LocText.current.text("dialog/guild_battle_create_already_attacking/title"),LocText.current.text("dialog/guild_battle_create_already_attacking/text"),LocText.current.text("general/button_ok")));
close();
}
else if(param1.error == "errCreateAttackingUs")
{
Environment.panelManager.showDialog(new UiInfoDialog(LocText.current.text("dialog/guild_battle_create_attacking_us/title"),LocText.current.text("dialog/guild_battle_create_attacking_us/text"),LocText.current.text("general/button_ok")));
close();
}
else if(param1.error == "errCreateAlreadyAttacked")
{
Environment.panelManager.showDialog(new UiInfoDialog(LocText.current.text("dialog/guild_battle_create_already_attacked/title"),LocText.current.text("dialog/guild_battle_create_already_attacked/text"),LocText.current.text("general/button_ok")));
close();
}
else if(param1.error == "errCreateNotYetAvailable")
{
Environment.panelManager.showDialog(new UiInfoDialog(LocText.current.text("dialog/guild_battle_create_not_yet_available/title"),LocText.current.text("dialog/guild_battle_create_not_yet_available/text"),LocText.current.text("general/button_ok")));
}
else if(param1.error.indexOf("errCreateCooldown_") != -1)
{
_loc2_ = param1.error.substr("errCreateCooldown_".length);
Environment.panelManager.showDialog(new UiInfoDialog(LocText.current.text("dialog/guild_battle_create_cooldown/title"),LocText.current.text("dialog/guild_battle_create_cooldown/text",_loc2_),LocText.current.text("general/button_ok")));
}
else if(param1.error == "errCreateSameGuild")
{
Environment.panelManager.showDialog(new UiInfoDialog(LocText.current.text("dialog/guild_battle_create_same_guild/title"),LocText.current.text("dialog/guild_battle_create_same_guild/text"),LocText.current.text("general/button_ok")));
close();
}
else if(param1.error == "errCreateNoHonorTooStrong")
{
Environment.panelManager.showDialog(new UiInfoDialog(LocText.current.text("dialog/guild_battle_create_too_strong/title"),LocText.current.text("dialog/guild_battle_create_too_strong/text"),LocText.current.text("general/button_ok")));
}
else if(param1.error == "errCreateNoHonorTooWeak")
{
Environment.panelManager.showDialog(new UiInfoDialog(LocText.current.text("dialog/guild_battle_create_too_weak/title"),LocText.current.text("dialog/guild_battle_create_too_weak/text"),LocText.current.text("general/button_ok")));
}
else if(param1.error == "errCreateAlreadyFought")
{
Environment.panelManager.showDialog(new UiInfoDialog(LocText.current.text("dialog/guild_battle_character_already_fought/title"),LocText.current.text("dialog/guild_battle_character_already_fought/text"),LocText.current.text("general/button_ok")));
}
else
{
Environment.reportError(param1.error,param1.request);
}
}
private function handleMessages(param1:Message) : void
{
var _loc2_:* = param1.type;
if("ViewMessage.notifyNeededGuildDonationMade" !== _loc2_)
{
throw new Error("Encountered unknown message type! type=" + param1.type);
}
_btnAttack.buttonEnabled = false;
Runtime.delayFunction(attackGuild,0.3);
}
override public function get defaultButton() : Button
{
return _btnAttack;
}
override public function onEscape() : void
{
close();
}
private function sortByLocalTimestamp(param1:GuildBattleAttackTime, param2:GuildBattleAttackTime) : int
{
if(param1.serverTimestamp < param2.serverTimestamp)
{
return -1;
}
if(param1.serverTimestamp > param2.serverTimestamp)
{
return 1;
}
return 0;
}
}
}
|
/**
* Apache License
* Version 2.0, January 2004
* http://www.apache.org/licenses/
*
* TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
*
* 1. Definitions.
*
* "License" shall mean the terms and conditions for use, reproduction,
* and distribution as defined by Sections 1 through 9 of this document.
*
* "Licensor" shall mean the copyright owner or entity authorized by
* the copyright owner that is granting the License.
*
* "Legal Entity" shall mean the union of the acting entity and all
* other entities that control, are controlled by, or are under common
* control with that entity. For the purposes of this definition,
* "control" means (i) the power, direct or indirect, to cause the
* direction or management of such entity, whether by contract or
* otherwise, or (ii) ownership of fifty percent (50%) or more of the
* outstanding shares, or (iii) beneficial ownership of such entity.
*
* "You" (or "Your") shall mean an individual or Legal Entity
* exercising permissions granted by this License.
*
* "Source" form shall mean the preferred form for making modifications,
* including but not limited to software source code, documentation
* source, and configuration files.
*
* "Object" form shall mean any form resulting from mechanical
* transformation or translation of a Source form, including but
* not limited to compiled object code, generated documentation,
* and conversions to other media types.
*
* "Work" shall mean the work of authorship, whether in Source or
* Object form, made available under the License, as indicated by a
* copyright notice that is included in or attached to the work
* (an example is provided in the Appendix below).
*
* "Derivative Works" shall mean any work, whether in Source or Object
* form, that is based on (or derived from) the Work and for which the
* editorial revisions, annotations, elaborations, or other modifications
* represent, as a whole, an original work of authorship. For the purposes
* of this License, Derivative Works shall not include works that remain
* separable from, or merely link (or bind by name) to the interfaces of,
* the Work and Derivative Works thereof.
*
* "Contribution" shall mean any work of authorship, including
* the original version of the Work and any modifications or additions
* to that Work or Derivative Works thereof, that is intentionally
* submitted to Licensor for inclusion in the Work by the copyright owner
* or by an individual or Legal Entity authorized to submit on behalf of
* the copyright owner. For the purposes of this definition, "submitted"
* means any form of electronic, verbal, or written communication sent
* to the Licensor or its representatives, including but not limited to
* communication on electronic mailing lists, source code control systems,
* and issue tracking systems that are managed by, or on behalf of, the
* Licensor for the purpose of discussing and improving the Work, but
* excluding communication that is conspicuously marked or otherwise
* designated in writing by the copyright owner as "Not a Contribution."
*
* "Contributor" shall mean Licensor and any individual or Legal Entity
* on behalf of whom a Contribution has been received by Licensor and
* subsequently incorporated within the Work.
*
* 2. Grant of Copyright License. Subject to the terms and conditions of
* this License, each Contributor hereby grants to You a perpetual,
* worldwide, non-exclusive, no-charge, royalty-free, irrevocable
* copyright license to reproduce, prepare Derivative Works of,
* publicly display, publicly perform, sublicense, and distribute the
* Work and such Derivative Works in Source or Object form.
*
* 3. Grant of Patent License. Subject to the terms and conditions of
* this License, each Contributor hereby grants to You a perpetual,
* worldwide, non-exclusive, no-charge, royalty-free, irrevocable
* (except as stated in this section) patent license to make, have made,
* use, offer to sell, sell, import, and otherwise transfer the Work,
* where such license applies only to those patent claims licensable
* by such Contributor that are necessarily infringed by their
* Contribution(s) alone or by combination of their Contribution(s)
* with the Work to which such Contribution(s) was submitted. If You
* institute patent litigation against any entity (including a
* cross-claim or counterclaim in a lawsuit) alleging that the Work
* or a Contribution incorporated within the Work constitutes direct
* or contributory patent infringement, then any patent licenses
* granted to You under this License for that Work shall terminate
* as of the date such litigation is filed.
*
* 4. Redistribution. You may reproduce and distribute copies of the
* Work or Derivative Works thereof in any medium, with or without
* modifications, and in Source or Object form, provided that You
* meet the following conditions:
*
* (a) You must give any other recipients of the Work or
* Derivative Works a copy of this License; and
*
* (b) You must cause any modified files to carry prominent notices
* stating that You changed the files; and
*
* (c) You must retain, in the Source form of any Derivative Works
* that You distribute, all copyright, patent, trademark, and
* attribution notices from the Source form of the Work,
* excluding those notices that do not pertain to any part of
* the Derivative Works; and
*
* (d) If the Work includes a "NOTICE" text file as part of its
* distribution, then any Derivative Works that You distribute must
* include a readable copy of the attribution notices contained
* within such NOTICE file, excluding those notices that do not
* pertain to any part of the Derivative Works, in at least one
* of the following places: within a NOTICE text file distributed
* as part of the Derivative Works; within the Source form or
* documentation, if provided along with the Derivative Works; or,
* within a display generated by the Derivative Works, if and
* wherever such third-party notices normally appear. The contents
* of the NOTICE file are for informational purposes only and
* do not modify the License. You may add Your own attribution
* notices within Derivative Works that You distribute, alongside
* or as an addendum to the NOTICE text from the Work, provided
* that such additional attribution notices cannot be construed
* as modifying the License.
*
* You may add Your own copyright statement to Your modifications and
* may provide additional or different license terms and conditions
* for use, reproduction, or distribution of Your modifications, or
* for any such Derivative Works as a whole, provided Your use,
* reproduction, and distribution of the Work otherwise complies with
* the conditions stated in this License.
*
* 5. Submission of Contributions. Unless You explicitly state otherwise,
* any Contribution intentionally submitted for inclusion in the Work
* by You to the Licensor shall be under the terms and conditions of
* this License, without any additional terms or conditions.
* Notwithstanding the above, nothing herein shall supersede or modify
* the terms of any separate license agreement you may have executed
* with Licensor regarding such Contributions.
*
* 6. Trademarks. This License does not grant permission to use the trade
* names, trademarks, service marks, or product names of the Licensor,
* except as required for reasonable and customary use in describing the
* origin of the Work and reproducing the content of the NOTICE file.
*
* 7. Disclaimer of Warranty. Unless required by applicable law or
* agreed to in writing, Licensor provides the Work (and each
* Contributor provides its Contributions) on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
* implied, including, without limitation, any warranties or conditions
* of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
* PARTICULAR PURPOSE. You are solely responsible for determining the
* appropriateness of using or redistributing the Work and assume any
* risks associated with Your exercise of permissions under this License.
*
* 8. Limitation of Liability. In no event and under no legal theory,
* whether in tort (including negligence), contract, or otherwise,
* unless required by applicable law (such as deliberate and grossly
* negligent acts) or agreed to in writing, shall any Contributor be
* liable to You for damages, including any direct, indirect, special,
* incidental, or consequential damages of any character arising as a
* result of this License or out of the use or inability to use the
* Work (including but not limited to damages for loss of goodwill,
* work stoppage, computer failure or malfunction, or any and all
* other commercial damages or losses), even if such Contributor
* has been advised of the possibility of such damages.
*
* 9. Accepting Warranty or Additional Liability. While redistributing
* the Work or Derivative Works thereof, You may choose to offer,
* and charge a fee for, acceptance of support, warranty, indemnity,
* or other liability obligations and/or rights consistent with this
* License. However, in accepting such obligations, You may act only
* on Your own behalf and on Your sole responsibility, not on behalf
* of any other Contributor, and only if You agree to indemnify,
* defend, and hold each Contributor harmless for any liability
* incurred by, or claims asserted against, such Contributor by reason
* of your accepting any such warranty or additional liability.
*
* END OF TERMS AND CONDITIONS
*
* APPENDIX: How to apply the Apache License to your work.
*
* To apply the Apache License to your work, attach the following
* boilerplate notice, with the fields enclosed by brackets "{}"
* replaced with your own identifying information. (Don't include
* the brackets!) The text should be enclosed in the appropriate
* comment syntax for the file format. We also recommend that a
* file or class name and description of purpose be included on the
* same "printed page" as the copyright notice for easier
* identification within third-party archives.
*
* Copyright {yyyy} {name of copyright owner}
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.deleidos.rtws.commons.tenantutils.service.alerting.ctxt
{
import com.deleidos.rtws.commons.tenantutils.model.alerting.Filter;
import mx.collections.ArrayList;
public class FilterServiceOpContext
{
public static const UPDATE_FILTER:String = "updateFilter";
public static const CREATE_FILTER:String = "createFilter";
public static const REMOVE_FILTER:String = "removeFilter";
private var _opType:String;
private var _opTrackingToken:Object;
private var _requestData:Object;
private var _filter:Filter;
public function FilterServiceOpContext()
{
super();
}
public function get opType():String
{
return _opType;
}
public function set opType(value:String):void
{
_opType = value;
}
public function get opTrackingToken():Object
{
return _opTrackingToken;
}
public function set opTrackingToken(value:Object):void
{
_opTrackingToken = value;
}
public function get requestData():Object
{
return _requestData;
}
public function set requestData(value:Object):void
{
_requestData = value;
}
public function get filter():Filter
{
return _filter;
}
public function set filter(value:Filter):void
{
_filter = value;
}
}
} |
package code
{
import flash.display.MovieClip;
public class Board extends MovieClip
{
private var m_board:DynamicMovie;
private var m_data:Array = new Array(Config.boardSize*Config.boardSize);
public static const E_OK:Number = 0;
public static const E_OUT_OF_BOARD:Number = 1;
public static const E_BUSY:Number = 2;
public function Board()
{
for (var i:Number = 0; i < m_data.length; i++)
m_data[i] = 1;
m_board = FigureRender.renderFigure(m_data);
addChild(m_board);
m_board.setRegistration(0, 0);
m_board.x2 = Config.boardPosX;
m_board.y2 = Config.boardPosY;
resetBoard();
}
public function get x2():Number
{
return m_board.x2;
}
public function get y2():Number
{
return m_board.y2;
}
public function set alpha2(value:Number):void
{
m_board.alpha = value;
}
public function resetBoard()
{
for (var i:Number = 0; i < m_data.length; i++)
m_data[i] = 0;
}
public function checkFigure(stageX:Number, stageY:Number, dt:Array):Number
{
var rc:Number = E_OK;
// adjust figure UL to board UL
if (stageX < m_board.x && stageX > (m_board.x - Config.cellSize/2))
stageX = m_board.x;
if (stageY < m_board.y && stageY > (m_board.y - Config.cellSize/2))
stageY = m_board.y;
// check out of board case
if (stageX < m_board.x || stageX > (m_board.x + m_board.width))
return E_OUT_OF_BOARD;
if (stageY < m_board.y || stageY > (m_board.y + m_board.height))
return E_OUT_OF_BOARD;
var xdb:Number = Math.floor((stageX - m_board.x)/Config.cellSize);
var ydb:Number = Math.floor((stageY - m_board.y)/Config.cellSize);
if ((stageX - m_board.x) % Config.cellSize >= Config.cellSize/2) xdb++;
if ((stageY - m_board.y) % Config.cellSize >= Config.cellSize/2) ydb++;
for (var ix:Number = 0; ix < Config.boardSize; ix++)
{
for (var iy:Number = 0; iy < Config.boardSize; iy++)
{
if (dt[iy*Config.boardSize + ix] == 1)
{
if ((xdb + ix) >= Config.boardSize || (ydb + iy) >=Config.boardSize) {
rc = E_BUSY;
break;
}
if (m_data[(ydb + iy)*Config.boardSize + (xdb + ix)] == 1) {
rc = E_BUSY;
break;
}
}
}
}
return rc;
}
public function setFigure(figure:MovieClip, stageX:Number, stageY:Number, dt:Array):void
{
// adjust figure UL to board UL
if (stageX < m_board.x && stageX > (m_board.x - Config.cellSize/2))
stageX = m_board.x;
if (stageY < m_board.y && stageY > (m_board.y - Config.cellSize/2))
stageY = m_board.y;
var xdb:Number = Math.floor((stageX - m_board.x)/Config.cellSize);
var ydb:Number = Math.floor((stageY - m_board.y)/Config.cellSize);
if ((stageX - m_board.x) % Config.cellSize >= Config.cellSize/2) xdb++;
if ((stageY - m_board.y) % Config.cellSize >= Config.cellSize/2) ydb++;
for (var ix:Number = 0; ix < Config.boardSize; ix++)
{
for (var iy:Number = 0; iy < Config.boardSize; iy++)
{
if (dt[iy*Config.boardSize + ix] == 1)
m_data[(ydb + iy)*Config.boardSize + (xdb + ix)] = 1;
}
}
// set aligned to the board coordinate for the figure
figure.x2 = xdb*Config.cellSize + m_board.x + Math.floor(figure.width/2);
figure.y2 = ydb*Config.cellSize + m_board.y + Math.floor(figure.height/2);
// check if all board has been filled
checkBoard();
}
private function checkBoard():void
{
var bFilled:Boolean = true;
for (var ix:Number = 0; ix < Config.boardSize && bFilled; ix++)
{
for (var iy:Number = 0; iy < Config.boardSize && bFilled; iy++)
{
if (m_data[iy*Config.boardSize + ix] == 0)
bFilled = false;
}
}
if (bFilled)
{
MovieClip(root).gotoAndPlay(20);
}
}
public function clearFigure(stageX:Number, stageY:Number, dt:Array):void
{
var xdb:Number = Math.floor((stageX - m_board.x)/Config.cellSize);
var ydb:Number = Math.floor((stageY - m_board.y)/Config.cellSize);
if ((stageX - m_board.x) % Config.cellSize >= Config.cellSize/2) xdb++;
if ((stageY - m_board.y) % Config.cellSize >= Config.cellSize/2) ydb++;
for (var ix:Number = 0; ix < Config.boardSize; ix++)
{
for (var iy:Number = 0; iy < Config.boardSize; iy++)
{
if (dt[iy*Config.boardSize + ix] == 1)
m_data[(ydb + iy)*Config.boardSize + (xdb + ix)] = 0;
}
}
}
}
} |
package idv.cjcat.stardust.twoD.zones {
import idv.cjcat.stardust.common.math.Random;
import idv.cjcat.stardust.common.math.StardustMath;
import idv.cjcat.stardust.common.math.UniformRandom;
import idv.cjcat.stardust.common.xml.XMLBuilder;
import idv.cjcat.stardust.twoD.geom.MotionData2D;
/**
* Sector-shaped zone.
*/
public class SectorZone extends Zone {
/**
* The X coordinate of the center of the sector.
*/
public var x:Number;
/**
* The Y coordinate of the center of the sector.
*/
public var y:Number;
//private var _randomR:Random;
private var _randomT:Random;
private var _minRadius:Number;
private var _maxRadius:Number;
private var _minAngle:Number;
private var _maxAngle:Number;
private var _minAngleRad:Number;
private var _maxAngleRad:Number;
private var _r1SQ:Number;
private var _r2SQ:Number;
public function SectorZone(x:Number = 0, y:Number = 0, minRadius:Number = 0, maxRadius:Number = 100, minAngle:Number = 0, maxAngle:Number = 360) {
_randomT = new UniformRandom();
this.x = x;
this.y = y;
this._minRadius = minRadius;
this._maxRadius = maxRadius;
this._minAngle = minAngle;
this._maxAngle = maxAngle;
//this.randomR = randomR;
updateArea();
}
/**
* The minimum radius of the sector.
*/
public function get minRadius():Number { return _minRadius; }
public function set minRadius(value:Number):void {
_minRadius = value;
updateArea();
}
/**
* The maximum radius of the sector.
*/
public function get maxRadius():Number { return _maxRadius; }
public function set maxRadius(value:Number):void {
_maxRadius = value;
updateArea();
}
/**
* The minimum angle of the sector.
*/
public function get minAngle():Number { return _minAngle; }
public function set minAngle(value:Number):void {
_minAngle = value;
updateArea();
}
/**
* The maximum angle of the sector.
*/
public function get maxAngle():Number { return _maxAngle; }
public function set maxAngle(value:Number):void {
_maxAngle = value;
updateArea();
}
//public function get randomR():Random { return _randomR; }
//public function set randomR(value:Random):void {
//if (!value) value = new UniformRandom();
//_randomR = value;
//}
override public function calculateMotionData2D():MotionData2D {
if (_maxRadius == 0) return new MotionData2D(x, y);
//_randomR.setRange(_minRadius, _maxRadius);
_randomT.setRange(_minAngleRad, _maxAngleRad);
var theta:Number = _randomT.random();
var r:Number = StardustMath.interpolate(0, _minRadius, 1, _maxRadius, Math.sqrt(Math.random()));
return new MotionData2D(r * Math.cos(theta) + x, r * Math.sin(theta) + y);
}
override protected function updateArea():void {
_minAngleRad = _minAngle * StardustMath.DEGREE_TO_RADIAN;
_maxAngleRad = _maxAngle * StardustMath.DEGREE_TO_RADIAN;
var dT:Number = _maxAngleRad - _minAngleRad;
_r1SQ = _minRadius * _minRadius;
_r2SQ = _maxRadius * _maxRadius;
var dRSQ:Number = _r2SQ - _r1SQ;
area = Math.abs(dRSQ * dT);
}
override public function contains(x:Number, y:Number):Boolean {
return false;
}
//XML
//------------------------------------------------------------------------------------------------
override public function getRelatedObjects():Array {
return [];
//return [_randomR];
}
override public function getXMLTagName():String {
return "SectorZone";
}
override public function toXML():XML {
var xml:XML = super.toXML();
xml.@x = x;
xml.@y = y;
xml.@minRadius = minRadius;
xml.@maxRadius = maxRadius;
xml.@minAngle = minAngle;
xml.@maxAngle = maxAngle;
//xml.@randomR = randomR.name;
return xml;
}
override public function parseXML(xml:XML, builder:XMLBuilder = null):void {
super.parseXML(xml, builder);
if (xml.@x.length()) x = parseFloat(xml.@x);
if (xml.@y.length()) y = parseFloat(xml.@y);
if (xml.@minRadius.length()) minRadius = parseFloat(xml.@minRadius);
if (xml.@maxRadius.length()) maxRadius = parseFloat(xml.@maxRadius);
if (xml.@minAngle.length()) minAngle = parseFloat(xml.@minAngle);
if (xml.@maxAngle.length()) maxAngle = parseFloat(xml.@maxAngle);
//randomR = builder.getElementByName(xml.@randomR) as Random;
}
//------------------------------------------------------------------------------------------------
//end of XML
}
} |
/*
VERSION: 7.12
DATE: 4/27/2008
ACTIONSCRIPT VERSION: 3.0 (AS2 version is available)
UPDATES & MORE DETAILED DOCUMENTATION AT: http://www.TweenFilterLite.com (has link to AS3 version)
DESCRIPTION:
TweenFilterLite extends the extremely lightweight (about 3k), powerful TweenLite "core" class, adding the ability to tween filters (like blurs,
glows, drop shadows, bevels, etc.) as well as image effects like contrast, colorization, brightness, saturation, hue, and threshold (combined size: about 6k).
The syntax is identical to the TweenLite class. If you're unfamiliar with TweenLite, I'd highly recommend that you check it out.
It provides easy way to tween multiple object properties over time including a MovieClip's position, alpha, volume, color, etc.
Just like the TweenLite class, TweenFilterLite allows you to build in a delay, call any function when the tween starts or has completed
(even passing any number of parameters you define), automatically kill other tweens that are affecting the same object (to avoid conflicts),
tween arrays, etc. One of the big benefits of this class (and the reason "Lite" is in the name) is that it was carefully built to
minimize file size. There are several other Tweening engines out there, but in my experience, they required more than triple the
file size which was unacceptable when dealing with strict file size requirements (like banner ads). I haven't been able to find a
faster tweening engine either. The syntax is simple and the class doesn't rely on complicated prototype alterations that can cause
problems with certain compilers. TweenFilterLite is simple, very fast, and extremely lightweight.
If you're looking for more features, check out TweenFilterLite's big brother, TweenMax at www.TweenMax.com
ARGUMENTS:
1) $target : Object - Target whose properties we're tweening
2) $duration : Number - Duration (in seconds) of the effect
3) $vars : Object - An object containing the end values of all the properties you'd like to have tweened (or if you're using the
TweenFilterLite.from() method, these variables would define the BEGINNING values). Pass in one object for each filter
(named appropriately, like blurFilter, glowFilter, colorMatrixFilter, etc.) Filter objects can contain any number of
properties specific to that filter, like blurX, blurY, contrast, color, distance, colorize, brightness, highlightAlpha, etc.
SPECIAL PROPERTIES:
delay : Number - Amount of delay before the tween should begin (in seconds).
ease : Function - You can specify a function to use for the easing with this variable. For example,
fl.motion.easing.Elastic.easeOut. The Default is Regular.easeOut.
easeParams : Array - An array of extra parameters to feed the easing equation. This can be useful when you
use an equation like Elastic and want to control extra parameters like the amplitude and period.
Most easing equations, however, don't require extra parameters so you won't need to pass in any easeParams.
autoAlpha : Number - Use it instead of the alpha property to gain the additional feature of toggling
the visible property to false when alpha reaches 0. It will also toggle visible
to true before the tween starts if the value of autoAlpha is greater than zero.
volume : Number - To change a MovieClip's or SoundChannel's volume, just set this to the value you'd like the
MovieClip/SoundChannel to end up at (or begin at if you're using TweenFilterLite.from()).
tint : Number - To change a DisplayObject's tint/color, set this to the hex value of the tint you'd like
to end up at(or begin at if you're using TweenFilterLite.from()). An example hex value would be 0xFF0000.
If you'd like to remove the color, just pass null as the value of tint.
frame : Number - Use this to tween a MovieClip to a particular frame.
onStart : Function - If you'd like to call a function as soon as the tween begins, pass in a reference to it here.
This is useful for when there's a delay.
onStartParams : Array - An array of parameters to pass the onStart function. (this is optional)
onUpdate : Function - If you'd like to call a function every time the property values are updated (on every frame during
the time the tween is active), pass a reference to it here.
onUpdateParams : Array - An array of parameters to pass the onUpdate function (this is optional)
onComplete : Function - If you'd like to call a function when the tween has finished, use this.
onCompleteParams : Array - An array of parameters to pass the onComplete function (this is optional)
renderOnStart : Boolean - If you're using TweenFilterLite.from() with a delay and want to prevent the tween from rendering until it
actually begins, set this to true. By default, it's false which causes TweenFilterLite.from() to render
its values immediately, even before the delay has expired.
overwrite : Boolean - If you do NOT want the tween to automatically overwrite all other tweens that are
affecting the same target, make sure this value is false.
blurFilter : Object - To apply a BlurFilter, pass an object with one or more of the following properties:
blurX, blurY, quality
glowFilter : Object - To apply a GlowFilter, pass an object with one or more of the following properties:
alpha, blurX, blurY, color, strength, quality, inner, knockout
colorMatrixFilter : Object - To apply a ColorMatrixFilter, pass an object with one or more of the following properties:
colorize, amount, contrast, brightness, saturation, hue, threshold, relative, matrix
dropShadowFilter : Object - To apply a ColorMatrixFilter, pass an object with one or more of the following properties:
alpha, angle, blurX, blurY, color, distance, strength, quality
bevelFilter : Object - To apply a BevelFilter, pass an object with one or more of the following properties:
angle, blurX, blurY, distance, highlightAlpha, highlightColor, shadowAlpha, shadowColor, strength, quality
EXAMPLES:
As a simple example, you could tween the blur of clip_mc from where it's at now to 20 over the course of 1.5 seconds by:
import gs.TweenFilterLite;
TweenFilterLite.to(clip_mc, 1.5, {blurFilter:{blurX:20, blurY:20}});
To set up a sequence where we colorize a MovieClip red over the course of 2 seconds, and then blur it over the course of 1 second,:
import gs.TweenFilterLite;
TweenFilterLite.to(clip_mc, 2, {colorMatrixFilter:{colorize:0xFF0000, amount:1}});
TweenFilterLite.to(clip_mc, 1, {blurFilter:{blurX:20, blurY:20}, delay:2, overwrite:false});
If you want to get more advanced and tween the clip_mc MovieClip over 5 seconds, changing the saturation to 0,
delay starting the whole tween by 2 seconds, and then call a function named "onFinishTween" when it has
completed and pass in a few arguments to that function (a value of 5 and a reference to the clip_mc), you'd
do so like:
import gs.TweenFilterLite;
import fl.motion.easing.Back;
TweenFilterLite.to(clip_mc, 5, {colorMatrixFilter:{saturation:0}, delay:2, onComplete:onFinishTween, onCompleteParams:[5, clip_mc]});
function onFinishTween(argument1:Number, argument2:MovieClip):void {
trace("The tween has finished! argument1 = " + argument1 + ", and argument2 = " + argument2);
}
If you have a MovieClip on the stage that already has the properties you'd like to end at, and you'd like to
start with a colorized version (red: 0xFF0000) and tween to the current properties, you could:
import gs.TweenFilterLite;
TweenFilterLite.from(clip_mc, 5, {type:"color", colorize:0xFF0000});
NOTES:
- This class (along with the TweenLite class which it extends) will add about 6kb total to your Flash file.
- Requires that you target Flash 9 Player or later (ActionScript 3.0).
- Quality defaults to a level of "2" for all filters, but you can pass in a value to override it.
- The image filter (colorMatrixFilter) functions were built so that you can leverage this class to manipulate matrixes for the
ColorMatrixFilter by calling the static functions directly (so you don't necessarily have to be tweening
anything). For example, you could colorize a matrix by:
var myNewMatrix:Array = TweenFilterLite.colorize(myOldMatrix, 0xFF0000, 1);
- Special thanks to Mario Klingemann (http://www.quasimondo.com) for the work he did on his ColorMatrix class.
It was very helpful for the image effects.
CHANGE LOG:
7.11:
- Fixed 1009 error in from() calls that was introduced in version 7.1
7.1:
- Enhanced speed by tweaking some internal code.
7.04:
- Added ability to define a "matrix" property for colorMatrixFilters.
7.03:
- Fixed to() and from() methods to accept an Object as the target instead of only DisplayObjects
7.01:
- SIGNIFICANT: Changed the syntax for defining filters. OLD: TweenFilterLite.to(mc, 2, {type:"blur", blurX:20, blurY:20}), NEW: TweenFilterLite.to(mc, 2, {blurFilter:{blurX:20, blurY:20}})
6.05:
- Rearranged some code to make the class more flexible and easier to extend.
6.04:
- Made it possible to tween the object's alpha when the filter type doesn't contain an "alpha" property. (like blur, bevel, etc.)
6.03:
- Fixed bug that could cause script timeouts
6.02:
- Fixed bug that could cause 1010 errors when TweenFilterLite is used without a filter (example: TweenFilterLite.to(my_mc, 2, {alpha:0.5}).
6.01:
- Reduced size
6.0:
- Reworked to conform to the changes in TweenLite 6.0
- Reduced file size and improved speed
- Fixed a bug that could cause ColorMatrixFilter tweens not to terminate properly
5.86 and 5.87 and 5.88:
- Fixed potential 1010 errors when an onUpdate() calls a killTweensOf() for an object.
- Minor formatting changes
5.85:
- Fixed 1010 and 1009 errors that popped up sometimes when TweenFilterLite was used for non-filter tweens.
5.84:
- Fixed an issue that prevented TextField filters from being applied properly.
5.81:
- Added the ability to define extra easing parameters using easeParams.
- Changed "mcColor" to "tint" in order to make it more intuitive. Using mcColor for tweening color values is deprecated and will be removed eventually.
5.7:
- Improved speed
5.6 and 5.5:
- Fixed very rare, intermittent 1010 errors
5.3:
- Added onUpdate and onUpdateParams features
- Finally removed extra/duplicated (deprecated) constructor parameters that had been left in for almost a year simply for backwards compatibility.
CODED BY: Jack Doyle, jack@greensock.com
Copyright 2008, GreenSock (This work is subject to the terms in http://www.greensock.com/terms_of_use.html.)
*/
package gs {
import gs.TweenLite;
import flash.filters.*;
import flash.display.DisplayObject;
import flash.utils.getTimer;
public class TweenFilterLite extends TweenLite {
public static var version:Number = 7.12;
public static var delayedCall:Function = TweenLite.delayedCall; //Otherwise TweenFilterLite.delayedCall() would throw errors (it's a static method of TweenLite)
public static var killTweensOf:Function = TweenLite.killTweensOf; //Otherwise TweenFilterLite.killTweensOf() would throw errors (it's a static method of TweenLite)
public static var killDelayedCallsTo:Function = TweenLite.killTweensOf; //Otherwise TweenFilterLite.killDelayedCallsTo() would throw errors (it's a static method of TweenLite)
public static var defaultEase:Function = TweenLite.defaultEase;
private static var _idMatrix:Array = [1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0];
private static var _lumR:Number = 0.212671; //Red constant - used for a few color matrix filter functions
private static var _lumG:Number = 0.715160; //Green constant - used for a few color matrix filter functions
private static var _lumB:Number = 0.072169; //Blue constant - used for a few color matrix filter functions
private var _matrix:Array;
private var _endMatrix:Array;
private var _cmf:ColorMatrixFilter;
private var _clrsa:Array; //Array that pertains to any color properties (like "color", "highlightColor", "shadowColor", etc.)
private var _hf:Boolean = false; //Has filters
private var _filters:Array = []; //Contains objects, one for each filter that's being tweened. Each object contains the following properties: filter, type
public function TweenFilterLite($target:Object, $duration:Number, $vars:Object) {
super($target, $duration, $vars);
if (TweenLite.version < 6.21 || isNaN(TweenLite.version)) {
trace("ERROR! Please update your TweenLite class. TweenFilterLite requires a more recent version. Download updates at http://www.TweenLite.com.");
}
if ($vars.type != undefined) {
trace("TweenFilterLite error: " + $target + " is using deprecated syntax. Please update to the new syntax. See http://www.TweenFilterLite.com for details.");
}
}
public static function to($mc:Object, $duration:Number, $vars:Object):TweenFilterLite {
return new TweenFilterLite($mc, $duration, $vars);
}
//This function really helps if there are MovieClips whose filters we want to animate into place (they are already in their end state on the stage for example).
public static function from($mc:Object, $duration:Number, $vars:Object):TweenFilterLite {
$vars.runBackwards = true;
return new TweenFilterLite($mc, $duration, $vars);
}
override public function initTweenVals($hrp:Boolean = false, $reservedProps:String = ""):void {
_clrsa = [];
_filters = [];
_matrix = _idMatrix.slice();
$reservedProps += " blurFilter glowFilter colorMatrixFilter dropShadowFilter bevelFilter ";
if (this.target is DisplayObject) {
var i:int, fv:Object; //filter vars
if (this.vars.blurFilter != undefined) {
fv = this.vars.blurFilter;
addFilter("blur", fv, BlurFilter, ["blurX", "blurY", "quality"], new BlurFilter(0, 0, fv.quality || 2));
}
if (this.vars.glowFilter != undefined) {
fv = this.vars.glowFilter;
addFilter("glow", fv, GlowFilter, ["alpha", "blurX", "blurY", "color", "quality", "strength", "inner", "knockout"], new GlowFilter(0xFFFFFF, 0, 0, 0, fv.strength || 1, fv.quality || 2, fv.inner, fv.knockout));
}
if (this.vars.colorMatrixFilter != undefined) {
fv = this.vars.colorMatrixFilter;
var cmf:Object = addFilter("colorMatrix", fv, ColorMatrixFilter, [], new ColorMatrixFilter(_matrix));
_cmf = cmf.filter;
_matrix = ColorMatrixFilter(_cmf).matrix;
if (fv.matrix != undefined && fv.matrix is Array) {
_endMatrix = fv.matrix;
} else {
if (fv.relative == true) {
_endMatrix = _matrix.slice();
} else {
_endMatrix = _idMatrix.slice();
}
_endMatrix = setBrightness(_endMatrix, fv.brightness);
_endMatrix = setContrast(_endMatrix, fv.contrast);
_endMatrix = setHue(_endMatrix, fv.hue);
_endMatrix = setSaturation(_endMatrix, fv.saturation);
_endMatrix = setThreshold(_endMatrix, fv.threshold);
if (!isNaN(fv.colorize)) {
_endMatrix = colorize(_endMatrix, fv.colorize, fv.amount);
} else if (!isNaN(fv.color)) { //Just in case they define "color" instead of "colorize"
_endMatrix = colorize(_endMatrix, fv.color, fv.amount);
}
}
for (i = 0; i < _endMatrix.length; i++) {
if (_matrix[i] != _endMatrix[i] && _matrix[i] != undefined) {
this.tweens.push({o:_matrix, p:i.toString(), s:_matrix[i], c:_endMatrix[i] - _matrix[i]});
}
}
}
if (this.vars.dropShadowFilter != undefined) {
fv = this.vars.dropShadowFilter;
addFilter("dropShadow", fv, DropShadowFilter, ["alpha", "angle", "blurX", "blurY", "color", "distance", "quality", "strength", "inner", "knockout", "hideObject"], new DropShadowFilter(0, 45, 0x000000, 0, 0, 0, 1, fv.quality || 2, fv.inner, fv.knockout, fv.hideObject));
}
if (this.vars.bevelFilter != undefined) {
fv = this.vars.bevelFilter;
addFilter("bevel", fv, BevelFilter, ["angle", "blurX", "blurY", "distance", "highlightAlpha", "highlightColor", "quality", "shadowAlpha", "shadowColor", "strength"], new BevelFilter(0, 0, 0xFFFFFF, 0.5, 0x000000, 0.5, 2, 2, 0, fv.quality || 2));
}
/*
*/
if (this.vars.runBackwards == true) {
var tp:Object;
for (i = _clrsa.length - 1; i > -1; i--) {
tp = _clrsa[i];
tp.sr += tp.cr;
tp.cr *= -1;
tp.sg += tp.cg;
tp.cg *= -1;
tp.sb += tp.cb;
tp.cb *= -1;
tp.f[tp.p] = (tp.sr << 16 | tp.sg << 8 | tp.sb); //Translates RGB to HEX
}
}
super.initTweenVals(true, $reservedProps);
} else {
super.initTweenVals($hrp, $reservedProps);
}
}
private function addFilter($name:String, $fv:Object, $filterType:Class, $props:Array, $defaultFilter:BitmapFilter):Object {
var f:Object = {type:$filterType};
var fltrs:Array = this.target.filters;
var i:int;
for (i = 0; i < fltrs.length; i++) {
if (fltrs[i] is $filterType) {
f.filter = fltrs[i];
break;
}
}
if (f.filter == undefined) {
f.filter = $defaultFilter;
fltrs.push(f.filter);
this.target.filters = fltrs;
}
var prop:String, valChange:Number, begin:Object, end:Object;
for (i = 0; i < $props.length; i++) {
prop = $props[i];
if ($fv[prop] != undefined) {
if (prop == "color" || prop == "highlightColor" || prop == "shadowColor") {
begin = HEXtoRGB(f.filter[prop]);
end = HEXtoRGB($fv[prop]);
_clrsa.push({f:f.filter, p:prop, sr:begin.rb, cr:end.rb - begin.rb, sg:begin.gb, cg:end.gb - begin.gb, sb:begin.bb, cb:end.bb - begin.bb});
} else if (prop == "quality" || prop == "inner" || prop == "knockout" || prop == "hideObject") {
f.filter[prop] = $fv[prop];
} else {
if (typeof($fv[prop]) == "number") {
valChange = $fv[prop] - f.filter[prop];
} else {
valChange = Number($fv[prop]);
}
this.tweens.push({o:f.filter, p:prop, s:f.filter[prop], c:valChange});
}
}
}
_filters.push(f);
_hf = true;
return f;
}
override public function render($t:uint):void {
var time:Number = ($t - this.startTime) / 1000;
if (time > this.duration) {
time = this.duration;
}
var factor:Number = this.vars.ease(time, 0, 1, this.duration);
var tp:Object, i:int;
for (i = this.tweens.length - 1; i > -1; i--) {
tp = this.tweens[i];
tp.o[tp.p] = tp.s + (factor * tp.c);
}
if (_hf) { //has filters
var r:Number, g:Number, b:Number, j:int;
for (i = _clrsa.length - 1; i > -1; i--) {
tp = _clrsa[i];
r = tp.sr + (factor * tp.cr);
g = tp.sg + (factor * tp.cg);
b = tp.sb + (factor * tp.cb);
tp.f[tp.p] = (r << 16 | g << 8 | b); //Translates RGB to HEX
}
if (_cmf != null) {
ColorMatrixFilter(_cmf).matrix = _matrix;
}
var f:Array = this.target.filters;
for (i = 0; i < _filters.length; i++) {
for (j = f.length - 1; j > -1; j--) {
if (f[j] is _filters[i].type) {
f.splice(j, 1, _filters[i].filter);
break;
}
}
}
this.target.filters = f;
}
if (_hst) { //has sub-tweens
for (i = _subTweens.length - 1; i > -1; i--) {
_subTweens[i].proxy(_subTweens[i]);
}
}
if (this.vars.onUpdate != null) {
this.vars.onUpdate.apply(this.vars.onUpdateScope, this.vars.onUpdateParams);
}
if (time == this.duration) { //Check to see if we're done
super.complete(true);
}
}
public function HEXtoRGB($n:Number):Object {
return {rb:$n >> 16, gb:($n >> 8) & 0xff, bb:$n & 0xff};
}
//---- COLOR MATRIX FILTER FUNCTIONS -----------------------------------------------------------------------------------------------------------------------
public static function colorize($m:Array, $color:Number, $amount:Number = 100):Array { //You can use
if (isNaN($color)) {
return $m;
} else if (isNaN($amount)) {
$amount = 1;
}
var r:Number = (($color >> 16) & 0xff) / 255;
var g:Number = (($color >> 8) & 0xff) / 255;
var b:Number = ($color & 0xff) / 255;
var inv:Number = 1 - $amount;
var temp:Array = [inv + $amount * r * _lumR, $amount * r * _lumG, $amount * r * _lumB, 0, 0,
$amount * g * _lumR, inv + $amount * g * _lumG, $amount * g * _lumB, 0, 0,
$amount * b * _lumR, $amount * b * _lumG, inv + $amount * b * _lumB, 0, 0,
0, 0, 0, 1, 0];
return applyMatrix(temp, $m);
}
public static function setThreshold($m:Array, $n:Number):Array {
if (isNaN($n)) {
return $m;
}
var temp:Array = [_lumR * 256, _lumG * 256, _lumB * 256, 0, -256 * $n,
_lumR * 256, _lumG * 256, _lumB * 256, 0, -256 * $n,
_lumR * 256, _lumG * 256, _lumB * 256, 0, -256 * $n,
0, 0, 0, 1, 0];
return applyMatrix(temp, $m);
}
public static function setHue($m:Array, $n:Number):Array {
if (isNaN($n)) {
return $m;
}
$n *= Math.PI / 180;
var c:Number = Math.cos($n);
var s:Number = Math.sin($n);
var temp:Array = [(_lumR + (c * (1 - _lumR))) + (s * (-_lumR)), (_lumG + (c * (-_lumG))) + (s * (-_lumG)), (_lumB + (c * (-_lumB))) + (s * (1 - _lumB)), 0, 0, (_lumR + (c * (-_lumR))) + (s * 0.143), (_lumG + (c * (1 - _lumG))) + (s * 0.14), (_lumB + (c * (-_lumB))) + (s * -0.283), 0, 0, (_lumR + (c * (-_lumR))) + (s * (-(1 - _lumR))), (_lumG + (c * (-_lumG))) + (s * _lumG), (_lumB + (c * (1 - _lumB))) + (s * _lumB), 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1];
return applyMatrix(temp, $m);
}
public static function setBrightness($m:Array, $n:Number):Array {
if (isNaN($n)) {
return $m;
}
$n = ($n * 100) - 100;
return applyMatrix([1,0,0,0,$n,
0,1,0,0,$n,
0,0,1,0,$n,
0,0,0,1,0,
0,0,0,0,1], $m);
}
public static function setSaturation($m:Array, $n:Number):Array {
if (isNaN($n)) {
return $m;
}
var inv:Number = 1 - $n;
var r:Number = inv * _lumR;
var g:Number = inv * _lumG;
var b:Number = inv * _lumB;
var temp:Array = [r + $n, g , b , 0, 0,
r , g + $n, b , 0, 0,
r , g , b + $n, 0, 0,
0 , 0 , 0 , 1, 0];
return applyMatrix(temp, $m);
}
public static function setContrast($m:Array, $n:Number):Array {
if (isNaN($n)) {
return $m;
}
$n += 0.01;
var temp:Array = [$n,0,0,0,128 * (1 - $n),
0,$n,0,0,128 * (1 - $n),
0,0,$n,0,128 * (1 - $n),
0,0,0,1,0];
return applyMatrix(temp, $m);
}
public static function applyMatrix($m:Array, $m2:Array):Array {
if (!($m is Array) || !($m2 is Array)) {
return $m2;
}
var temp:Array = [];
var i:int = 0;
var z:int = 0;
var y:int, x:int;
for (y = 0; y < 4; y++) {
for (x = 0; x < 5; x++) {
if (x == 4) {
z = $m[i + 4];
} else {
z = 0;
}
temp[i + x] = $m[i] * $m2[x] +
$m[i+1] * $m2[x + 5] +
$m[i+2] * $m2[x + 10] +
$m[i+3] * $m2[x + 15] +
z;
}
i += 5;
}
return temp;
}
}
} |
package game.view.achievement {
import com.sound.SoundManager;
import game.view.achievement.data.AchievementData;
import game.view.uitils.DisplayMemoryMrg;
import starling.display.DisplayObject;
import starling.display.Sprite;
/**
* 创建 不同的成就显示
* @author litao
*
*/
public class Section extends Sprite {
public var face:DisplayObject;
public function Section() {
AchievementData.instance.onUpate.add(onUpdate);
}
/**
* @param type 1 = 总览, 2=日常,3=战斗,4=英雄,5=功能,6=技能
*/
public function createSection(type:int):void {
if (numChildren > 0)
face = getChildAt(0);
face && face.removeFromParent();
face = null;
switch (type) {
case 1:
face = DisplayMemoryMrg.instance.getMemory("overall", Overall);
AchievementData.instance.currentSection = 6;
(face as Overall).Rest();
break;
case 3:
face = DisplayMemoryMrg.instance.getMemory("daily", TaskList);
(face as TaskList).inits();
(face as TaskList).restItemRender(AchievementData.instance.SectionList(1));
AchievementData.instance.currentSection = 1;
break;
case 4:
face = DisplayMemoryMrg.instance.getMemory("daily", TaskList);
(face as TaskList).inits();
(face as TaskList).restItemRender(AchievementData.instance.SectionList(2));
AchievementData.instance.currentSection = 2;
break;
case 5:
face = DisplayMemoryMrg.instance.getMemory("daily", TaskList);
(face as TaskList).inits();
(face as TaskList).restItemRender(AchievementData.instance.SectionList(3));
AchievementData.instance.currentSection = 3;
break;
case 6:
face = DisplayMemoryMrg.instance.getMemory("daily", TaskList);
(face as TaskList).inits();
(face as TaskList).restItemRender(AchievementData.instance.SectionList(4));
AchievementData.instance.currentSection = 4;
break;
default :
break;
}
face && addChild(face);
}
private function onUpdate():void {
if (this.numChildren == 0)
return;
var face:Object = getChildAt(0);
SoundManager.instance.playSound("chengjiulingqu");
if (AchievementData.instance.currentSection == 5) {
face.restItemRender(AchievementData.instance.SectionList(6).concat(AchievementData.instance.SectionList(7).concat(AchievementData.instance.SectionList(8))));
} else if (AchievementData.instance.currentSection == 6) {
(face as Overall).Rest();
} else if (AchievementData.instance.currentSection < 5) {
face.restItemRender(AchievementData.instance.SectionList(AchievementData.instance.currentSection));
}
}
override public function dispose():void {
AchievementData.instance.onUpate.removeAll();
DisplayMemoryMrg.instance.removeToMemory("overall");
DisplayMemoryMrg.instance.removeToMemory("daily");
DisplayMemoryMrg.instance.removeToMemory("fight");
DisplayMemoryMrg.instance.removeToMemory("hero");
DisplayMemoryMrg.instance.removeToMemory("function");
DisplayMemoryMrg.instance.removeToMemory("arena");
super.dispose();
}
}
}
|
package com.company.assembleegameclient.account.ui.components {
public class SelectionGroup {
private var selectables:Vector.<Selectable>;
private var selected:Selectable;
public function SelectionGroup(_arg1:Vector.<Selectable>) {
this.selectables = _arg1;
}
public function setSelected(_arg1:String):void {
var _local2:Selectable;
for each (_local2 in this.selectables) {
if (_local2.getValue() == _arg1) {
this.replaceSelected(_local2);
return;
}
}
}
public function getSelected():Selectable {
return (this.selected);
}
private function replaceSelected(_arg1:Selectable):void {
if (this.selected != null) {
this.selected.setSelected(false);
}
this.selected = _arg1;
this.selected.setSelected(true);
}
}
}
|
package devoron.sdk.aslc.core.utils.compare
{
import org.as3commons.asblocks.utils.ASTUtilities;
//import org.as3commons.asblocks.ASTUtilities;
//import org.as3commons.asblocks.utils.ASTUtilities;
import devoron.sdk.aslc.core.utils.compare.FieldNodeCompareResult;
import flash.utils.ByteArray;
import org.as3commons.asblocks.api.IMethod;
import org.as3commons.asblocks.api.IParameter;
import org.as3commons.asblocks.api.IStatement;
import org.as3commons.asblocks.api.IStatementContainer;
import org.as3commons.asblocks.impl.DeclarationStatementNode;
import org.as3commons.asblocks.impl.FieldNode;
import org.as3commons.asblocks.impl.MethodNode;
import org.as3commons.bytecode.abc.MethodInfo;
import org.aswing.util.HashMap;
/**
* ScriptNodeComparator
* @author Devoron
*/
public class ScriptNodeComparator
{
private var methodsHash:HashMap;
private var iStatementContainer;
private var methodQName:String;
private var methodsParametersHash:HashMap;
private var methodsStatememtsHash:HashMap;
public function ScriptNodeComparator()
{
}
public function compareFields(newMethod:FieldNode, oldMethod:FieldNode):FieldNodeCompareResult
{
return null;
}
private function compareStatementContainers(statementsA:Vector.<IStatement>, statementsB:Vector.<IStatement>):Boolean {
return true;
var allStatements = new Vector.<String>();
iStatementContainer.statements.length = 0;
//var stat:IStatement = iStatementContainer.addStatement("var MEssAGE:String");
var statements:Vector.<IStatement> = iStatementContainer.statements;
// именно здесь должны быть изъяты выражения в теле функции заменены на новые
var statementsContainer:Vector.<IStatement> = new Vector.<IStatement>();
//this.statementsHash.put(methodNode.qualifiedName, statementsContainer);
// итак, я получил содержимое функции
allStatements = this.methodsStatememtsHash.get(methodQName);
var methodBody:String;
var oldMethodBody:String = methodsHash.get(methodQName);
// если выражения уже есть, то произвести сравнение содержимого функции
if (oldMethodBody != null /* && oldMethodBody!=""*/)
{
// произвести сравнение тел прежнего и нового метода
allStatements = new Vector.<String>();
methodsStatememtsHash.put(methodQName, allStatements);
// массив байтов - я действительно могу перегнать allStatements в байты и отдать их через событие
for each (var statementNode:IStatement in statements)
{
allStatements.push(ASTUtilities.initText(statementNode.node));
statementsContainer.push(statementNode);
throw new Error("process statement");
//processStatement(statementNode);
}
methodBody = allStatements.join("\n");
// все выражения метода заменить на реферс к методу из лив-хранилища
// если тело было метода было изменено
if (methodBody != oldMethodBody)
{
methodsHash.put(methodQName, methodBody);
var ba:ByteArray = new ByteArray();
ba.writeMultiByte(methodBody, "utf-8");
//LiveServerDomain
//generateScriptForMethod
//GlobalEventDispatcher.instance.dispatchEvent(new CodeEvent(CodeEvent.CHANGE_METHOD, "", methodQName, ba));
}
}
// если нет, то создать новые
else
{
statements = iStatementContainer.statements;
allStatements = new Vector.<String>();
methodsStatememtsHash.put(methodQName, allStatements);
// массив байтов - я действительно могу перегнать allStatements в байты и отдать их через событие
var numb:int = 0;
for each (var statementNode:IStatement in statements)
{
if (statementNode is DeclarationStatementNode)
{
trace("numb " + numb);
}
//allStatements.push(ASTUtilities.initText(statementNode.node));
statementsContainer.push(statementNode);
//processStatement(statementNode);
throw new Error("process statement");
numb++;
}
methodBody = allStatements.join("\n");
methodsHash.put(methodQName, methodBody);
var ba2:ByteArray = new ByteArray();
ba2.writeMultiByte(methodBody, "utf-8");
ba2.position = 0;
//trace("ДОСТУПНО БАЙТ " + ba2.length);
//trace("вывод тела " + methodBody);
//processedMethodHash.put(methodQName,
//GlobalEventDispatcher.instance.dispatchEvent(new CodeEvent(CodeEvent.ADD_METHOD, "", methodQName, methodNode.visibility.toString(), ba2));
//GlobalEventDispatcher.instance.dispatchEvent(new CodeEvent(CodeEvent.ADD_METHOD, "", methodQName, ba2));
}
//result.methodInfo = new MethodInfo();
//methodInfo.
//fillParameters(newMethod.parameters);
// если поля идентичны, то ничего предпринимат не нужно
/*if (constEquals && typesEquals && staticEquals && initializerEquals && visibilityEquals)
{
gtrace("5:Поля идентичны " + filedName);
}
else
{
gtrace("5:Поле изменилось " + filedName);
//istory
// установить новое поле
fieldsHash.put(filedQName, fieldNode);
History.registerFieldPoint(fieldNode, constEquals, typesEquals, staticEquals, visibilityEquals, oldInitializer, initializerEquals);
// скомпилировать поле и всё такое
}*/
//var old
// должно быть произведено сравнение прежних и новых параметров
//var paramsProxy:ScopeProxy = new ScopeProxy(null, null);
//LiveControllerCodeStrategy.localScopeCollector.put(methodQName, paramsProxy);
/*var oldParams:Object = methodsParametersHash.get(methodQName);
if (!oldParams)
{
methodsParametersHash.put(methodQName, json.params);
}
else
{
//ObjectUtils.compare(oldParams)
}
if (allParams != "" && oldParams != allParams)
{
var string:String = JSON.stringify(json);
var ba4:ByteArray = new ByteArray();
ba4.writeMultiByte(string, "utf-8");
GlobalEventDispatcher.instance.dispatchEvent(new CodeEvent(CodeEvent.CHANGE_METHOD_ARGUMENTS, "", methodQName, ba4));
methodsParametersHash.put(methodQName, allParams);
}*/
return true;
}
/**
* Сравнение методов
* @param newMethod
* @param oldMethod
* @return
*/
public function compareMethods(methodNode:MethodNode, oldMethod:MethodNode):MethodNodeCompareResult
{
var result:MethodNodeCompareResult = new MethodNodeCompareResult();
// compare return types
result.returnTypesEquals = methodNode.qualifiedReturnType == oldMethod.qualifiedReturnType; // возврвщаемый тим
// compare static flags
result.staticEquals = methodNode.isStatic == oldMethod.isStatic; // статический метод
// compare visibilies
result.visibilityEquals = methodNode.visibility.toString() == oldMethod.visibility.toString(); // видимость метода
//result.paramsEquals = compareParams(newMethod.parameters, oldMethod.parameters);
result.paramsEquals = true; // заглушка на параметры
// compare statements
result.statementsEquals = ASTUtilities.initText(methodNode.node) == ASTUtilities.initText(oldMethod.node); // сравнение текста функции
result.statementsEquals = compareStatementContainers(methodNode.statements, oldMethod.statements);
var iFunction:IMethod = methodNode as IMethod;
var iStatementContainer:IStatementContainer = methodNode as IStatementContainer;
return result;
}
/**
* Сравнение методов
* @param newMethod
* @param oldMethod
* @return
*/
protected function compareMethods(newMethod:MethodNode, oldMethod:MethodNode):Boolean
{
//var comparator:ScriptNodeComparator = new ScriptNodeComparator();
//var compareResult:MethodNodeCompareResult = comparator.compareMethods(newMethod, oldMethod);
/*if (compareResult.result)
{
return true;
}
else
{
if (codeHistoryAPI)
codeHistoryAPI.registerMethodPoint2(newMethod, oldMethod, compareResult);
//codeHistoryAPI.registerMethodPoint(newMethod, oldMethod, returnTypesEquals, staticEquals, visibilityEquals, paramsEquals, statementsEquals);
}
return false;*/
var allParams:String = "";
var json:Object = new Object();
json.params = [];
// если длина массивов одинаковая, то перебрать их параллельно
// если длина разная, то изменения в параметрах метода однозначно есть
var paramId:uint = 0;
var additionalCode:String = "";
for each (var param:IParameter in newMethod.parameters)
{
gtrace("********** PARAMETER ***********");
//gtrace(ASTUtilities.initText(param.node));
var stringParam:String = ASTUtilities.initText(param.node);
allParams += "\n" + stringParam;
var paramObj:Object = new Object();
paramObj.name = param.name;
paramObj.type = param.type;
paramObj.qualifiedType = param.qualifiedType;
paramObj.defaultValue = param.defaultValue;
paramObj.hasDefaultValue = param.hasDefaultValue;
json.params.push(paramObj);
// добавочный код в самом начале функции представлет собой доступ к аргументам, переданным в функцию
additionalCode += "var " + param.name + ":" + param.type + " = arguments[" + paramId + "]";
paramId++;
}
// для каждого параметра должен быть добавлен код в самом начале
var methodQName:String = newMethod.qualifiedName;
var oldParams:Object = methodsParametersHash.get(methodQName);
if (!oldParams)
{
this.methodsParametersHash.put(methodQName, json.params);
}
else
{
//ObjectUtils.compare(oldParams)
}
// если поля идентичны, то ничего предпринимат не нужно
/*if (constEquals && typesEquals && staticEquals && initializerEquals && visibilityEquals)
{
gtrace("5:Поля идентичны " + filedName);
}
else
{
gtrace("5:Поле изменилось " + filedName);
//istory
// установить новое поле
fieldsHash.put(filedQName, fieldNode);
History.registerFieldPoint(fieldNode, constEquals, typesEquals, staticEquals, visibilityEquals, oldInitializer, initializerEquals);
// скомпилировать поле и всё такое
}*/
//var old
// должно быть произведено сравнение прежних и новых параметров
//var paramsProxy:ScopeProxy = new ScopeProxy(null, null);
//LiveControllerCodeStrategy.localScopeCollector.put(methodQName, paramsProxy);
/*var oldParams:Object = methodsParametersHash.get(methodQName);
if (!oldParams)
{
methodsParametersHash.put(methodQName, json.params);
}
else
{
//ObjectUtils.compare(oldParams)
}
if (allParams != "" && oldParams != allParams)
{
var string:String = JSON.stringify(json);
var ba4:ByteArray = new ByteArray();
ba4.writeMultiByte(string, "utf-8");
GlobalEventDispatcher.instance.dispatchEvent(new CodeEvent(CodeEvent.CHANGE_METHOD_ARGUMENTS, "", methodQName, ba4));
methodsParametersHash.put(methodQName, allParams);
}*/
return false;
}
private function compareParams(newParams:Vector.<IParameter>, oldParams:Vector.<IParameter>):void
{
if (newParams.length != oldParams.length)
{
// если параметры не равны, то новые параметры должны быть зарегистрированы в LocalScope
// хотя следует уточнить, какие именно параметры были изменены/добавлены/удалены
for each (var oldParam:IParameter in oldParams)
{
var oldParamName:String = oldParam.name;
for each (var newParam:IParameter in newParams)
{
//MethodInfo
/*oldParamName != newParam.name
oldParamName != newParam.hasType
oldParamName != newParam.defaultValue
oldParamName != newParam.isRest*/
}
}
}
// если длина одинакова, то сравнение по списку
else
{
}
// мы должны точно знать, какой параметр изменился
}
/*public function equals(other:Object):Boolean {
var otherMethod:MethodInfo = other as MethodInfo;
if (otherMethod != null) {
if (flags != otherMethod.flags) {
return false;
}
if (methodName != otherMethod.methodName) {
return false;
}
if (!returnType.equals(otherMethod.returnType)) {
return false;
}
if (scopeName != otherMethod.scopeName) {
return false;
}
if (argumentCollection.length != otherMethod.argumentCollection.length) {
return false;
}
var len:int = argumentCollection.length;
var i:int;
var arg:Argument;
var otherArg:Argument;
for (i = 0; i < len; ++i) {
arg = argumentCollection[i];
otherArg = otherMethod.argumentCollection[i];
if (!arg.equals(otherArg)) {
return false;
}
}
return true;
}
return false;
}*/
}
} |
package com.playata.framework.core.util
{
import com.playata.framework.core.error.Exception;
import flash.xml.XMLDocument;
import flash.xml.XMLNode;
public class StringUtil
{
public function StringUtil()
{
super();
throw new Exception("This class may not be instantiated directly. Use its static functions instead.");
}
public static function replace(param1:String, param2:String, param3:String) : String
{
var _loc7_:int = 0;
var _loc8_:int = 0;
if(param1 === null || param2 === null || param3 === null)
{
return param1;
}
if(param1 && param1.indexOf(param2) == -1)
{
return param1;
}
var _loc9_:String = new String();
var _loc4_:Boolean = false;
var _loc5_:int = param1.length;
var _loc6_:int = param2.length;
_loc7_ = 0;
for(; _loc7_ < _loc5_; _loc7_++)
{
if(param1.charAt(_loc7_) == param2.charAt(0))
{
_loc4_ = true;
_loc8_ = 0;
while(_loc8_ < _loc6_)
{
if(param1.charAt(_loc7_ + _loc8_) != param2.charAt(_loc8_))
{
_loc4_ = false;
break;
}
_loc8_++;
}
if(_loc4_)
{
_loc9_ = _loc9_ + param3;
_loc7_ = _loc7_ + (_loc6_ - 1);
continue;
}
}
_loc9_ = _loc9_ + param1.charAt(_loc7_);
}
return _loc9_;
}
public static function trim(param1:String) : String
{
if(param1 === null)
{
return param1;
}
return StringUtil.ltrim(StringUtil.rtrim(param1));
}
public static function ltrim(param1:String) : String
{
var _loc3_:int = 0;
if(param1 === null)
{
return param1;
}
var _loc2_:int = param1.length;
_loc3_ = 0;
while(_loc3_ < _loc2_)
{
if(param1.charCodeAt(_loc3_) > 32)
{
return param1.substring(_loc3_);
}
_loc3_++;
}
return "";
}
public static function rtrim(param1:String) : String
{
var _loc3_:* = 0;
if(param1 === null)
{
return param1;
}
var _loc2_:int = param1.length;
_loc3_ = _loc2_;
while(_loc3_ > 0)
{
if(param1.charCodeAt(_loc3_ - 1) > 32)
{
return param1.substring(0,_loc3_);
}
_loc3_--;
}
return "";
}
public static function remove(param1:String, param2:String) : String
{
if(param1 === null || param2 === null)
{
return param1;
}
return StringUtil.replace(param1,param2,"");
}
public static function isEmpty(param1:String) : Boolean
{
if(param1 === null)
{
return true;
}
return StringUtil.trim(param1) == "";
}
public static function startsWith(param1:String, param2:String) : Boolean
{
if(param1 === null || param2 === null)
{
return false;
}
return param1.indexOf(param2) === 0;
}
public static function endsWith(param1:String, param2:String) : Boolean
{
if(param1 === null || param2 === null)
{
return false;
}
return param2 == param1.substring(param1.length - param2.length);
}
public static function cutLength(param1:String, param2:int) : String
{
if(param1 === null)
{
return param1;
}
if(param1.length <= param2 + 3)
{
return param1;
}
return param1.substr(0,param2) + "...";
}
public static function countOccurences(param1:String, param2:String) : Number
{
var _loc4_:int = 0;
if(param1 === null || param2 === null)
{
return 0;
}
var _loc3_:* = 0;
_loc4_ = 0;
while(_loc4_ < param1.length)
{
if(param1.charAt(_loc4_) == param2)
{
_loc3_++;
}
_loc4_++;
}
return _loc3_;
}
public static function replaceHtmlTagPart(param1:String, param2:String, param3:String, param4:String, param5:String, param6:String) : String
{
var _loc10_:int = 0;
var _loc8_:* = null;
var _loc9_:* = null;
var _loc7_:int = param1.indexOf(param2);
while(_loc7_ != -1)
{
_loc10_ = param1.indexOf(param3,_loc7_);
if(_loc10_ != -1)
{
_loc8_ = param1.substring(_loc7_,_loc10_ + param3.length);
if(_loc8_)
{
_loc9_ = _loc8_;
_loc9_ = StringUtil.replace(_loc9_,param2,param5);
_loc9_ = StringUtil.replace(_loc9_,param3,param6);
param1 = param1.replace(_loc8_,_loc9_);
_loc7_ = param1.indexOf(param2);
continue;
}
break;
}
break;
}
param1 = StringUtil.replace(param1,param4,"");
return param1;
}
public static function replaceHtmlFontColorTagPart(param1:String, param2:String, param3:String, param4:String, param5:String = "[[color=", param6:String = "]]") : String
{
var _loc11_:int = 0;
var _loc9_:* = null;
var _loc10_:* = null;
var _loc8_:int = param1.indexOf(param2);
var _loc12_:int = -1;
var _loc7_:Vector.<String> = new Vector.<String>();
while(_loc8_ != -1)
{
_loc11_ = param1.indexOf(param3,_loc8_);
if(_loc11_ != -1)
{
_loc9_ = param1.substring(_loc8_,_loc11_ + param3.length);
if(_loc9_)
{
_loc10_ = _loc9_;
_loc10_ = StringUtil.replace(_loc10_,param2,param5);
_loc10_ = StringUtil.replace(_loc10_,param3,param6);
param1 = param1.replace(_loc9_,_loc10_);
_loc8_ = param1.indexOf(param2);
_loc7_.push(_loc10_);
_loc12_ = param1.indexOf(param4);
if(_loc12_ != -1 && _loc12_ < _loc8_ && _loc7_.length > 1)
{
_loc7_.pop();
param1 = param1.replace(param4,_loc7_[_loc7_.length - 1]);
_loc8_ = param1.indexOf(param2);
}
continue;
}
break;
}
break;
}
while(_loc12_ != -1 && _loc7_.length > 1)
{
_loc7_.pop();
param1 = param1.replace(param4,_loc7_[_loc7_.length - 1]);
_loc12_ = param1.indexOf(param4);
}
param1 = StringUtil.replace(param1,param4,"");
return param1;
}
public static function removeHtmlTag(param1:String, param2:String, param3:String, param4:String) : String
{
var _loc7_:int = 0;
var _loc6_:* = null;
var _loc5_:int = param1.indexOf(param2);
while(_loc5_ != -1)
{
_loc7_ = param1.indexOf(param3,_loc5_);
if(_loc7_ != -1)
{
_loc6_ = param1.substring(_loc5_,_loc7_ + param3.length);
if(_loc6_)
{
param1 = param1.replace(_loc6_,"");
_loc5_ = param1.indexOf(param2);
continue;
}
break;
}
break;
}
param1 = StringUtil.replace(param1,param4,"");
return param1;
}
public static function leftPad(param1:String, param2:int, param3:String = " ") : String
{
var _loc4_:* = null;
if(param1.length < param2)
{
_loc4_ = "";
while(_loc4_.length + param1.length < param2)
{
_loc4_ = _loc4_ + param3;
}
return _loc4_ + param1;
}
return param1;
}
public static function rightPad(param1:String, param2:int, param3:String = " ") : String
{
while(param1.length < param2)
{
param1 = param1 + param3;
}
return param1;
}
public static function hexColorToUint(param1:String) : uint
{
var _loc2_:RegExp = new RegExp(/#/g);
var _loc3_:uint = String(param1).replace(_loc2_,"0x");
return _loc3_;
}
public static function htmlEscape(param1:String) : String
{
return XML(new XMLNode(3,param1)).toXMLString();
}
public static function htmlUnescape(param1:String) : String
{
return new XMLDocument(param1).firstChild.nodeValue;
}
public static function capitaliseFirstLetter(param1:String) : String
{
return param1.substring(0,1).toUpperCase() + param1.substr(1,param1.length - 1);
}
public static function isValidEmail(param1:String) : Boolean
{
var _loc2_:RegExp = /^[a-z0-9][-._a-z0-9]*@([a-z0-9][-_a-z0-9]*\.)+[a-z]{2,10}$/;
return _loc2_.test(param1);
}
public static function formatBytes(param1:uint, param2:int = 1) : String
{
var _loc3_:Vector.<String> = new <String>["B","KB","MB","GB","TB"];
var _loc5_:int = 0;
var _loc4_:Number = param1;
while(_loc4_ >= 1024 && _loc5_ < _loc3_.length)
{
_loc4_ = _loc4_ / 1024;
_loc5_++;
}
_loc4_ = NumberUtil.roundDecimal(_loc4_,param2);
return _loc4_ + _loc3_[_loc5_];
}
}
}
|
/*
* Copyright (c) 2006-2010 the original author or authors
*
* Permission is hereby granted to use, modify, and distribute this file
* in accordance with the terms of the license agreement accompanying it.
*/
package reprise.css
{
import reprise.external.URLLoaderResource;
internal class CSSImport extends URLLoaderResource
{
/***************************************************************************
* public properties *
***************************************************************************/
protected var m_owner : CSS;
/***************************************************************************
* public methods *
***************************************************************************/
public function CSSImport(owner:CSS, url:String = null)
{
m_owner = owner;
setURL(url);
}
/***************************************************************************
* protected methods *
***************************************************************************/
protected override function notifyComplete(success:Boolean) : void
{
if (success)
{
m_owner.resolveImport(this);
}
super.notifyComplete(success);
}
}
} |
package com.yahoo.renderers
{
import flash.display.Stage;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.events.Event;
import com.yahoo.util.YUIBridge;
import com.yahoo.renderers.layout.Container;
/**
* Abstract class used for creating flash applications
*/
public class Application extends Container
{
/**
* Constructor
*/
public function Application()
{
this.initializeApplicationGlobals();
super();
}
/**
* @private
* Reference to the yuibridge instance.
*/
protected var _yuiBridge:YUIBridge;
/**
* @private
*/
private var _appname:String = "application";
/**
* Name of application
*/
public function get appname():String
{
return this._appname;
}
/**
* @private (setter)
*/
public function set appname(value:String):void
{
this._appname = value;
this._yuiBridge.setInstance(value, this);
}
/**
* @private
*/
private var _flashvars:Object;
/**
* Reference to the global flashvars
*/
public function get flashvars():Object
{
return this._flashvars;
}
/**
* @private (setter)
*/
public function set flashvars(value:Object):void
{
this._flashvars = value;
}
/**
* @private (override)
*/
override protected function initializeRenderer():void
{
super.initializeRenderer();
this.stage.addEventListener(Event.RESIZE, stageResizeHandler);
this.width = this.stage.stageWidth;
this.height = this.stage.stageHeight;
this._yuiBridge = new YUIBridge(this.stage);
this.parseFlashVars();
this._yuiBridge.setInstance(this._appname, this);
this._yuiBridge.addClasses(this.getCompiledClasses());
}
/**
* @private (protected)
*/
protected function getCompiledClasses():Object
{
return {};
}
/**
* @private (protected)
*/
protected function initializeApplicationGlobals():void
{
this.stage.scaleMode = StageScaleMode.NO_SCALE;
this.stage.align = StageAlign.TOP_LEFT;
this._globalApp = ApplicationGlobals.getInstance();
this._globalApp.stage = this.stage;
}
/**
* @private (protected)
*/
protected function parseFlashVars():void
{
this._flashvars = this._globalApp.flashvars = this._yuiBridge.flashvars;
if(this._flashvars.appname) this._appname = this._flashvars.appname;
}
/**
* @private
*/
private function stageResizeHandler(event:Event):void
{
if(this.width == this.stage.stageWidth && this.height == this.stage.stageHeight) return;
this.width = this.stage.stageWidth;
this.height = this.stage.stageHeight;
}
}
}
|
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.modules.broadcast.services
{
import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger;
import org.bigbluebutton.core.BBB;
import org.bigbluebutton.core.managers.ConnectionManager;
import org.bigbluebutton.core.managers.UserManager;
public class MessageSender {
private static const LOGGER:ILogger = getClassLogger(MessageSender);
public function playStream(uri:String, streamId:String, streamName:String):void {
var message:Object = new Object();
message["messageID"] = "BroadcastPlayStreamCommand";
message["uri"] = uri;
message["streamID"] = streamId;
message["streamName"] = streamName;
var _nc:ConnectionManager = BBB.initConnectionManager();
_nc.sendMessage("bigbluebutton.sendMessage",
function(result:String):void { // On successful result
LOGGER.debug(result);
},
function(status:String):void { // status - On error occurred
LOGGER.error(status);
},
message
);
}
public function stopStream():void {
var message:Object = new Object();
message["messageID"] = "BroadcastStopStreamCommand";
var _nc:ConnectionManager = BBB.initConnectionManager();
_nc.sendMessage("bigbluebutton.sendMessage",
function(result:String):void { // On successful result
LOGGER.debug(result);
},
function(status:String):void { // status - On error occurred
LOGGER.error(status);
},
message
);
}
public function sendWhatIsTheCurrentStreamRequest():void {
var message:Object = new Object();
message["messageID"] = "BroadcastWhatIsTheCurrentStreamRequest";
message["requestedBy"] = UserManager.getInstance().getConference().getMyUserId();
var _nc:ConnectionManager = BBB.initConnectionManager();
_nc.sendMessage("bigbluebutton.sendMessage",
function(result:String):void { // On successful result
LOGGER.debug(result);
},
function(status:String):void { // status - On error occurred
LOGGER.error(status);
},
message
);
}
public function sendWhatIsTheCurrentStreamReply(requestedByUserID:String, streamID:String):void {
var message:Object = new Object();
message["messageID"] = "BroadcastWhatIsTheCurrentStreamReply";
message["requestedBy"] = requestedByUserID;
message["streamID"] = streamID;
LOGGER.debug("MessageSender:: sendWhatIsTheCurrentStreamReply [{0},{1}]", [message["requestedBy"], message["streamID"]]);
var _nc:ConnectionManager = BBB.initConnectionManager();
_nc.sendMessage("bigbluebutton.sendMessage",
function(result:String):void { // On successful result
LOGGER.debug(result);
},
function(status:String):void { // status - On error occurred
LOGGER.error(status);
},
message
);
}
}
} |
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2003-2006 Adobe Macromedia Software LLC and its licensors.
// All Rights Reserved. The following is Source Code and is subject to all
// restrictions on such code as contained in the End User License Agreement
// accompanying this product.
//
////////////////////////////////////////////////////////////////////////////////
package com.adobe.formatters
{
/**
* The Formatter class is the base class for all data formatters.
* Any subclass of Formatter must override the <code>format()</code> method.
*
* @mxml
*
* <p>The Formatter class defines the following tag attributes,
* which all of its subclasses inherit:</p>
*
* <pre>
* <mx:<i>tagname</i>
* <b>Properties</b>
* error=""
* />
* </pre>
*
* @includeExample examples/SimpleFormatterExample.mxml
*/
public class Formatter
{
//--------------------------------------------------------------------------
//
// Class resources
//
//--------------------------------------------------------------------------
/**
* A ResourceBundle object containing all symbols
* from <code>formatters.properties</code>.
*/
// protected static var packageResources:ResourceBundle;
//--------------------------------------------------------------------------
//
// Class properties
//
//--------------------------------------------------------------------------
/**
* Error message for an invalid value specified to the formatter.
*
* @default "Invalid value"
*/
protected var defaultInvalidValueError:String = "Invalid value";
/**
* Error message for an invalid format string specified to the formatter.
*
* @default "Invalid format"
*/
protected var defaultInvalidFormatError:String = "Invalid format";
//--------------------------------------------------------------------------
//
// Constructor
//
//--------------------------------------------------------------------------
/**
* Constructor.
*/
public function Formatter()
{
super();
}
//--------------------------------------------------------------------------
//
// Properties
//
//--------------------------------------------------------------------------
//----------------------------------
// error
//----------------------------------
[Inspectable(category="General", defaultValue="null")]
/**
* Description saved by the formatter when an error occurs.
* For the possible values of this property,
* see the description of each formatter.
* <p>Subclasses must set this value
* in the <code>format()</code> method.</p>
*/
public var error:String;
//--------------------------------------------------------------------------
//
// Methods
//
//--------------------------------------------------------------------------
/**
* Formats a value and returns a String
* containing the new, formatted, value.
* All subclasses must override this method to implement the formatter.
*
* @param value Value to be formatted.
*
* @return The formatted string.
*/
public function format(value:Object):String
{
error = "This format function is abstract. " +
"Subclasses must override it.";
return "";
}
}
}
|
////////////////////////////////////////////////////////////////////////////////
//
// 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
//
// No warranty of merchantability or fitness of any kind.
// Use this software at your own risk.
//
////////////////////////////////////////////////////////////////////////////////
package actionScripts.plugins.build
{
import actionScripts.factory.FileLocation;
import actionScripts.plugin.IPlugin;
import actionScripts.plugin.PluginBase;
import actionScripts.plugin.actionscript.as3project.vo.AS3ProjectVO;
import actionScripts.plugin.java.javaproject.vo.JavaProjectVO;
import actionScripts.utils.OSXBookmarkerNotifiers;
import actionScripts.valueObjects.ProjectVO;
public class CompilerPluginBase extends PluginBase implements IPlugin
{
private var invalidPaths:Array;
protected function checkProjectForInvalidPaths(project:ProjectVO):void
{
if (project is AS3ProjectVO)
{
validateAS3VOPaths(project as AS3ProjectVO);
}
else if (project is JavaProjectVO)
{
validateJavaVOPaths(project as JavaProjectVO);
}
}
protected function onProjectPathsValidated(paths:Array):void
{
}
private function validateAS3VOPaths(project:AS3ProjectVO):void
{
var tmpLocation:FileLocation;
invalidPaths = [];
checkPathFileLocation(project.folderLocation, "Location");
if (project.sourceFolder) checkPathFileLocation(project.sourceFolder, "Source Folder");
if (project.visualEditorSourceFolder) checkPathFileLocation(project.visualEditorSourceFolder, "Source Folder");
if (project.buildOptions.customSDK)
{
checkPathFileLocation(project.buildOptions.customSDK, "Custom SDK");
}
for each (tmpLocation in project.classpaths)
{
checkPathFileLocation(tmpLocation, "Classpath");
}
for each (tmpLocation in project.resourcePaths)
{
checkPathFileLocation(tmpLocation, "Resource");
}
for each (tmpLocation in project.externalLibraries)
{
checkPathFileLocation(tmpLocation, "External Library");
}
for each (tmpLocation in project.libraries)
{
checkPathFileLocation(tmpLocation, "Library");
}
for each (tmpLocation in project.nativeExtensions)
{
checkPathFileLocation(tmpLocation, "Extension");
}
for each (tmpLocation in project.runtimeSharedLibraries)
{
checkPathFileLocation(tmpLocation, "Shared Library");
}
onProjectPathsValidated((invalidPaths.length > 0) ? invalidPaths : null);
}
private function validateJavaVOPaths(project:JavaProjectVO):void
{
var tmpLocation:FileLocation;
invalidPaths = [];
checkPathFileLocation(project.folderLocation, "Location");
if (project.sourceFolder) checkPathFileLocation(project.sourceFolder, "Source Folder");
for each (tmpLocation in project.classpaths)
{
checkPathFileLocation(tmpLocation, "Classpath");
}
onProjectPathsValidated((invalidPaths.length > 0) ? invalidPaths : null);
}
private function checkPathString(value:String, type:String):void
{
if (!model.fileCore.isPathExists(value))
{
invalidPaths.push(type +": "+ value);
}
}
private function checkPathFileLocation(value:FileLocation, type:String):void
{
if (value.fileBridge.nativePath.indexOf("{locale}") != -1)
{
var localePath:String = OSXBookmarkerNotifiers.isValidLocalePath(value);
if (!localePath || !model.fileCore.isPathExists(localePath))
{
storeInvalidPath(localePath);
}
}
else if (!value.fileBridge.exists)
{
storeInvalidPath(value.fileBridge.nativePath);
}
/*
* @local
*/
function storeInvalidPath(path:String):void
{
invalidPaths.push(type +": "+ path);
}
}
}
} |
package kabam.lib.resizing {
import robotlegs.bender.extensions.mediatorMap.MediatorMapExtension;
import robotlegs.bender.framework.api.IContext;
import robotlegs.bender.framework.api.IExtension;
public class ResizeExtension implements IExtension {
public function ResizeExtension() {
super();
}
public function extend(_arg_1:IContext):void {
_arg_1.extend(MediatorMapExtension);
_arg_1.configure(ResizeConfig);
}
}
}
|
package pong.game.sys.physics
{
import pong.game.attr.PhysicalComponent;
public class PhysicsNode
{
public var prev:PhysicsNode;
public var next:PhysicsNode;
[Ember(required)]
public var physical:PhysicalComponent;
}
}
|
package visuals.ui.base
{
import com.playata.framework.display.MovieClip;
import com.playata.framework.display.lib.flash.FlashDisplayObjectContainer;
import com.playata.framework.display.lib.flash.FlashMovieClip;
import visuals.ui.elements.backgrounds.SymbolSlice9BackgroundButtonGeneric;
public class SymbolIconButtonRefreshDuelEnemiesGeneric extends com.playata.framework.display.MovieClip
{
private var _nativeObject:SymbolIconButtonRefreshDuelEnemies = null;
public var bg:SymbolSlice9BackgroundButtonGeneric = null;
public function SymbolIconButtonRefreshDuelEnemiesGeneric(param1:flash.display.MovieClip = null)
{
if(param1)
{
_nativeObject = param1 as SymbolIconButtonRefreshDuelEnemies;
}
else
{
_nativeObject = new SymbolIconButtonRefreshDuelEnemies();
}
super(null,FlashMovieClip.fromNative(_nativeObject));
var _loc2_:FlashDisplayObjectContainer = _sprite as FlashDisplayObjectContainer;
bg = new SymbolSlice9BackgroundButtonGeneric(_nativeObject.bg);
}
public function setNativeInstance(param1:SymbolIconButtonRefreshDuelEnemies) : void
{
FlashMovieClip.setNativeInstance(_movieClip,param1);
_nativeObject = param1;
syncInstances();
}
override public function play() : void
{
super.play();
syncInstances();
}
override public function stop() : void
{
super.stop();
syncInstances();
}
override public function gotoAndStop(param1:Object) : void
{
super.gotoAndStop(param1);
syncInstances();
}
override public function gotoAndPlay(param1:Object) : void
{
_movieClip.gotoAndPlay(param1);
syncInstances();
}
public function syncInstances() : void
{
if(_nativeObject.bg)
{
bg.setNativeInstance(_nativeObject.bg);
}
}
}
}
|
package cn.geckos.shuttle.property
{
import flash.events.Event;
import flash.events.EventDispatcher;
import mx.controls.ComboBase;
import mx.controls.RadioButtonGroup;
public class EnumEditor extends BasePropertyEditor
{
public function EnumEditor(display:Object)
{
super(display);
if( display is EventDispatcher ) {
display.addEventListener(Event.CHANGE, applyHandler);
}
}
override public function applyProperty():void
{
if( display is RadioButtonGroup ) {
model.value = RadioButtonGroup(display).selectedValue;
}
else if( display is ComboBase ) {
model.value = ComboBase(display).selectedItem.value;
}
}
override public function bindTo(model:IPropertyModel):void
{
super.bindTo(model);
if( display is RadioButtonGroup ) {
RadioButtonGroup(display).selectedValue = model.value;
}
else if( display is ComboBase ) {
var combo:ComboBase = ComboBase(display);
var dp:Object = combo.dataProvider;
for each( var data:Object in dp )
{
if( data.value == model.value ) {
combo.selectedItem = data;
return;
}
}
}
}
}
}
|
package ddt.states
{
import academy.AcademyController;
import auctionHouse.controller.AuctionHouseController;
import church.controller.ChurchRoomController;
import church.controller.ChurchRoomListController;
import civil.CivilController;
import com.pickgliss.events.UIModuleEvent;
import com.pickgliss.loader.UIModuleLoader;
import com.pickgliss.utils.StringUtils;
import consortion.ConsortionControl;
import ddt.data.UIModuleTypes;
import ddt.manager.PlayerManager;
import ddt.view.UIModuleSmallLoading;
import fightLib.FightLibState;
import fightLib.view.FightLibGameView;
import flash.events.Event;
import flash.utils.Dictionary;
import game.view.GameView;
import hall.HallStateView;
import hotSpring.controller.HotSpringRoomController;
import hotSpring.controller.HotSpringRoomListController;
import littleGame.LittleHall;
import login.LoginStateView;
import lottery.LotteryContorller;
import lottery.contorller.CardLotteryContorller;
import room.view.states.ChallengeRoomState;
import room.view.states.DungeonRoomState;
import room.view.states.FreshmanRoomState;
import room.view.states.MatchRoomState;
import room.view.states.MissionRoomState;
import roomList.pveRoomList.DungeonListController;
import roomList.pvpRoomList.RoomListController;
import roomLoading.RoomLoadingState;
import shop.ShopController;
import tofflist.TofflistController;
import trainer.view.TrainerGameView;
public class StateCreater implements IStateCreator
{
private var _state:Dictionary;
private var _currentStateType:String;
public function StateCreater()
{
this._state = new Dictionary();
super();
}
public function create(param1:String) : BaseStateView
{
switch(param1)
{
case StateType.LOGIN:
return new LoginStateView();
case StateType.MAIN:
return new HallStateView();
case StateType.ROOM_LOADING:
return new RoomLoadingState();
case StateType.ROOM_LIST:
return new RoomListController();
case StateType.TOFFLIST:
return new TofflistController();
case StateType.DUNGEON_LIST:
return new DungeonListController();
case StateType.CONSORTIA:
return new ConsortionControl();
case StateType.CHURCH_ROOM_LIST:
return new ChurchRoomListController();
case StateType.CHURCH_ROOM:
return new ChurchRoomController();
case StateType.SHOP:
return new ShopController();
case StateType.MATCH_ROOM:
return new MatchRoomState();
case StateType.DUNGEON_ROOM:
return new DungeonRoomState();
case StateType.CHALLENGE_ROOM:
return new ChallengeRoomState();
case StateType.TRAINER:
return new TrainerGameView();
case StateType.MISSION_ROOM:
return new MissionRoomState();
case StateType.FIGHTING:
return new GameView();
case StateType.CIVIL:
return new CivilController();
case StateType.HOT_SPRING_ROOM_LIST:
return new HotSpringRoomListController();
case StateType.HOT_SPRING_ROOM:
return new HotSpringRoomController();
case StateType.FRESHMAN_ROOM:
return new FreshmanRoomState();
case StateType.ACADEMY_REGISTRATION:
return new AcademyController();
case StateType.FIGHT_LIB:
return new FightLibState();
case StateType.FIGHT_LIB_GAMEVIEW:
return new FightLibGameView();
case StateType.LITTLEHALL:
return new LittleHall();
case StateType.AUCTION:
return new AuctionHouseController();
case StateType.LOTTERY_HALL:
return new LotteryContorller();
case StateType.LOTTERY_CARD:
return new CardLotteryContorller();
default:
return null;
}
}
public function createAsync(param1:String, param2:Function) : void
{
var _loc4_:int = 0;
var _loc3_:StateLoadingInfo = this.getStateLoadingInfo(param1,this.getNeededUIModuleByType(param1),param2);
this._currentStateType = param1;
if(_loc3_.isComplete)
{
param2(this.create(param1));
}
else
{
UIModuleSmallLoading.Instance.progress = 0;
UIModuleSmallLoading.Instance.show();
UIModuleSmallLoading.Instance.addEventListener(Event.CLOSE,this.__onCloseLoading);
UIModuleLoader.Instance.addEventListener(UIModuleEvent.UI_MODULE_COMPLETE,this.__onUimoduleLoadComplete);
UIModuleLoader.Instance.addEventListener(UIModuleEvent.UI_MODULE_PROGRESS,this.__onUimoduleLoadProgress);
_loc4_ = 0;
while(_loc4_ < _loc3_.neededUIModule.length)
{
UIModuleLoader.Instance.addUIModuleImp(_loc3_.neededUIModule[_loc4_],param1);
_loc4_++;
}
}
}
private function __onCloseLoading(param1:Event) : void
{
if(PlayerManager.Instance.Self.Grade >= 2)
{
UIModuleSmallLoading.Instance.hide();
UIModuleSmallLoading.Instance.removeEventListener(Event.CLOSE,this.__onCloseLoading);
UIModuleLoader.Instance.removeEventListener(UIModuleEvent.UI_MODULE_COMPLETE,this.__onUimoduleLoadComplete);
UIModuleLoader.Instance.removeEventListener(UIModuleEvent.UI_MODULE_PROGRESS,this.__onUimoduleLoadProgress);
}
}
private function getStateLoadingInfo(param1:String, param2:String = null, param3:Function = null) : StateLoadingInfo
{
var _loc4_:StateLoadingInfo = null;
var _loc5_:Array = null;
var _loc6_:int = 0;
_loc4_ = this._state[param1];
if(_loc4_ == null)
{
_loc4_ = new StateLoadingInfo();
if(param2 != null && param2 != "")
{
_loc5_ = param2.split(",");
_loc6_ = 0;
while(_loc6_ < _loc5_.length)
{
_loc4_.neededUIModule.push(_loc5_[_loc6_]);
_loc6_++;
}
}
else
{
_loc4_.isComplete = true;
}
_loc4_.state = param1;
_loc4_.callBack = param3;
this._state[param1] = _loc4_;
}
return _loc4_;
}
private function __onUimoduleLoadComplete(param1:UIModuleEvent) : void
{
var _loc5_:BaseStateView = null;
if(StringUtils.isEmpty(param1.state))
{
return;
}
var _loc2_:StateLoadingInfo = this.getStateLoadingInfo(param1.state);
if(_loc2_.completeedUIModule.indexOf(param1.module) == -1)
{
_loc2_.completeedUIModule.push(param1.module);
}
var _loc3_:Boolean = true;
var _loc4_:int = 0;
while(_loc4_ < _loc2_.neededUIModule.length)
{
if(_loc2_.completeedUIModule.indexOf(_loc2_.neededUIModule[_loc4_]) == -1)
{
_loc3_ = false;
}
_loc4_++;
}
_loc2_.isComplete = _loc3_;
if(_loc2_.isComplete && this._currentStateType == _loc2_.state)
{
UIModuleLoader.Instance.removeEventListener(UIModuleEvent.UI_MODULE_COMPLETE,this.__onUimoduleLoadComplete);
UIModuleLoader.Instance.removeEventListener(UIModuleEvent.UI_MODULE_PROGRESS,this.__onUimoduleLoadProgress);
UIModuleSmallLoading.Instance.hide();
_loc5_ = this.create(param1.state);
if(_loc2_.callBack != null)
{
_loc2_.callBack(_loc5_);
}
}
}
private function __onUimoduleLoadError(param1:UIModuleEvent) : void
{
}
private function __onUimoduleLoadProgress(param1:UIModuleEvent) : void
{
var _loc2_:StateLoadingInfo = null;
var _loc3_:StateLoadingInfo = null;
var _loc4_:int = 0;
var _loc5_:int = 0;
var _loc6_:Number = NaN;
for each(_loc2_ in this._state)
{
if(_loc2_.neededUIModule.indexOf(param1.module) != -1)
{
_loc2_.progress[param1.module] = param1.loader.progress;
}
}
_loc3_ = this.getStateLoadingInfo(param1.state);
_loc4_ = 0;
_loc5_ = 0;
while(_loc5_ < _loc3_.neededUIModule.length)
{
if(_loc3_.progress[_loc3_.neededUIModule[_loc5_]] != null)
{
_loc6_ = _loc3_.progress[_loc3_.neededUIModule[_loc5_]];
_loc4_ = _loc4_ + _loc6_ * 100 / _loc3_.neededUIModule.length;
}
_loc5_++;
}
if(this._currentStateType == _loc3_.state)
{
UIModuleSmallLoading.Instance.progress = _loc4_;
}
}
public function getNeededUIModuleByType(param1:String) : String
{
if(param1 == StateType.MAIN)
{
return UIModuleTypes.HALL;
}
if(param1 == StateType.TOFFLIST)
{
return UIModuleTypes.TOFFLIST;
}
if(param1 == StateType.CONSORTIA)
{
return UIModuleTypes.CONSORTIA + "," + UIModuleTypes.CONSORTIACLUB + "," + UIModuleTypes.CONSORTIAII;
}
if(param1 == StateType.SHOP)
{
return UIModuleTypes.SHOP;
}
if(param1 == StateType.ROOM_LIST || param1 == StateType.DUNGEON_LIST || param1 == StateType.DUNGEON_ROOM || param1 == StateType.MATCH_ROOM || param1 == StateType.FRESHMAN_ROOM)
{
return UIModuleTypes.ROOM_LIST + "," + UIModuleTypes.ROOM + "," + UIModuleTypes.GAME + "," + UIModuleTypes.GAMEII + "," + UIModuleTypes.GAMEOVER;
}
if(param1 == StateType.MATCH_ROOM || param1 == StateType.DUNGEON_ROOM)
{
return UIModuleTypes.ROOM + "," + UIModuleTypes.CHAT_BALL;
}
if(param1 == StateType.CHALLENGE_ROOM)
{
return UIModuleTypes.CHALLENGE_ROOM;
}
if(param1 == StateType.CHURCH_ROOM_LIST)
{
return UIModuleTypes.CHURCH_ROOM_LIST;
}
if(param1 == StateType.CHURCH_ROOM)
{
return UIModuleTypes.CHURCH_ROOM;
}
if(param1 == StateType.CIVIL)
{
return UIModuleTypes.CIVIL;
}
if(param1 == StateType.HOT_SPRING_ROOM_LIST)
{
return UIModuleTypes.HOT_SPRING_ROOM_LIST;
}
if(param1 == StateType.HOT_SPRING_ROOM)
{
return UIModuleTypes.HOT_SPRING_ROOM;
}
if(param1 == StateType.FIGHTING)
{
return UIModuleTypes.GAME + "," + UIModuleTypes.GAMEII + "," + UIModuleTypes.GAMEOVER + "," + UIModuleTypes.CHAT_BALL;
}
if(param1 == StateType.TRAINER)
{
return UIModuleTypes.GAME + "," + UIModuleTypes.GAMEII + "," + UIModuleTypes.GAMEOVER + "," + UIModuleTypes.ROOM + "," + UIModuleTypes.CHAT_BALL;
}
if(param1 == StateType.ACADEMY_REGISTRATION)
{
return UIModuleTypes.ACADEMY;
}
if(param1 == StateType.FIGHT_LIB)
{
return UIModuleTypes.FIGHT_LIB;
}
if(param1 == StateType.AUCTION)
{
return UIModuleTypes.AUCTION;
}
if(param1 == StateType.LOTTERY_CARD || param1 == StateType.LOTTERY_HALL)
{
return UIModuleTypes.LOTTERY;
}
return "";
}
}
}
|
package com.playata.application.ui.elements.stream
{
import com.playata.application.data.stream.PrivateConversation;
import com.playata.application.data.stream.PrivateConversationMessage;
import com.playata.application.data.user.User;
import com.playata.application.ui.ViewManager;
import com.playata.application.ui.dialogs.DialogPrivateConversationInvitation;
import com.playata.application.ui.dialogs.DialogPrivateConversationRename;
import com.playata.application.ui.elements.generic.button.UiButton;
import com.playata.application.ui.elements.generic.dialog.UiInfoDialog;
import com.playata.application.ui.elements.generic.dialog.UiTwoChoiceDialog;
import com.playata.application.ui.elements.generic.scrollbar.UiScrollBar;
import com.playata.framework.application.Environment;
import com.playata.framework.application.request.ActionRequestResponse;
import com.playata.framework.core.Runtime;
import com.playata.framework.core.util.StringUtil;
import com.playata.framework.display.ui.Direction;
import com.playata.framework.display.ui.controls.ITextInput;
import com.playata.framework.display.ui.controls.ScrollList;
import com.playata.framework.input.InteractionEvent;
import com.playata.framework.localization.LocText;
import visuals.ui.elements.stream.SymbolPrivateConversationMessageContainerGeneric;
public class UiPrivateConversationMessageContainer extends ScrollList
{
private var _content:SymbolPrivateConversationMessageContainerGeneric = null;
private var _btnSend:UiButton = null;
private var _btnDismiss:UiButton = null;
private var _btnRename:UiButton = null;
private var _btnInvite:UiButton = null;
private var _btnLeave:UiButton = null;
private var _moreMembers:UiPrivateConversationMemberMore = null;
private var _initFooterY:Number = 0;
private var _initHeight:Number = 0;
private var _initScrollbarHeight:Number = 0;
private var _lockSyncMessages:Boolean = false;
private var _privateConversation:PrivateConversation = null;
private var _members:Vector.<UiPrivateConversationMember>;
private var _originalTitleWidth:int = 0;
public function UiPrivateConversationMessageContainer(param1:SymbolPrivateConversationMessageContainerGeneric)
{
_members = new Vector.<UiPrivateConversationMember>(0);
_content = param1;
_moreMembers = new UiPrivateConversationMemberMore(_content.header.moreMembers);
_content.header.members.removeAllChildren();
_content.header.txtTitle.autoFontSize = true;
_content.footer.inputMessage.onKeyDown.add(handleMessageKeyDown);
_content.footer.inputMessage.onChange.add(handleMessageChange);
_btnSend = new UiButton(_content.footer.btnSend,LocText.current.text("panel_streams/private_conversation_message/send_tooltip"),onClickSend);
_btnDismiss = new UiButton(_content.header.btnDelete,LocText.current.text("panel_streams/private_conversation_message/hide_tooltip"),onClickDismiss);
_btnRename = new UiButton(_content.header.btnRename,LocText.current.text("panel_streams/private_conversation_message/rename_tooltip"),onClickRename);
_btnInvite = new UiButton(_content.header.btnInvite,LocText.current.text("panel_streams/private_conversation_message/invite_tooltip"),onClickInvite);
_btnLeave = new UiButton(_content.header.btnLeave,LocText.current.text("panel_streams/private_conversation_message/leave_tooltip"),onClickLeave);
_btnRename.visible = false;
_btnInvite.visible = false;
_btnLeave.visible = false;
_content.header.txtTitle.autoFontSize = true;
_originalTitleWidth = int(_content.header.txtTitle.width);
super(_content.listContainer,UiPrivateConversationMessage,Direction.VERTICAL,new UiScrollBar(_content.scrollBarKnob,_content.scrollBarLine,this),null,null,false,false,sortById);
if(Environment.info.isTouchScreen)
{
appendFromEnd = true;
appendFromEndPadding = 5;
}
}
public function refreshLocalization() : void
{
_btnSend.tooltip = LocText.current.text("panel_streams/private_conversation_message/send_tooltip");
_btnDismiss.tooltip = LocText.current.text("panel_streams/private_conversation_message/hide_tooltip");
_btnRename.tooltip = LocText.current.text("panel_streams/private_conversation_message/rename_tooltip");
_btnInvite.tooltip = LocText.current.text("panel_streams/private_conversation_message/invite_tooltip");
_btnLeave.tooltip = LocText.current.text("panel_streams/private_conversation_message/leave_tooltip");
var _loc3_:int = 0;
var _loc2_:* = _lines;
for each(var _loc1_ in _lines)
{
_loc1_.refreshLocalization();
}
}
public function get content() : SymbolPrivateConversationMessageContainerGeneric
{
return _content;
}
public function get privateConversation() : PrivateConversation
{
return _privateConversation;
}
public function init() : void
{
_content.footer.inputMessage.text = "";
}
public function reset() : void
{
_moreMembers.clear();
_content.visible = false;
clear();
_members.length = 0;
_privateConversation = null;
}
public function refresh() : void
{
if(!_content.visible)
{
return;
}
if(_privateConversation.hasPendingSync)
{
_privateConversation.sync(function():void
{
open(_privateConversation);
});
return;
}
_content.header.txtTitle.text = privateConversation.title;
syncMessages();
}
public function open(param1:PrivateConversation) : void
{
var _loc2_:* = null;
if(_initHeight == 0)
{
_initHeight = _content.height;
_initFooterY = _content.footer.y;
_initScrollbarHeight = _content.scrollBarLine.height;
}
_privateConversation = param1;
_content.visible = true;
_moreMembers.closeMembers();
_moreMembers.clear();
_moreMembers.visible = false;
_content.header.txtTitle.text = param1.title;
_content.header.members.removeAllChildren(true);
_members.length = 0;
_content.footer.visible = _privateConversation.isGroup || !_privateConversation.singleConversationMember.isDeleted;
_btnRename.visible = _content.footer.visible && _privateConversation.isGroup;
_btnInvite.visible = _content.footer.visible && _privateConversation.isGroup;
_btnLeave.visible = _content.footer.visible && _privateConversation.isGroup && _privateConversation.memberCount >= 1;
if(_btnLeave.visible)
{
_content.header.txtTitle.width = _originalTitleWidth;
}
else
{
_content.header.txtTitle.width = _originalTitleWidth + (_btnDismiss.x - _btnLeave.x);
}
var _loc3_:* = 0;
var _loc6_:int = 0;
var _loc5_:* = param1.members.keys;
for each(var _loc4_ in param1.members.keys)
{
if(!param1.members.getData(_loc4_).isMe)
{
_loc2_ = new UiPrivateConversationMember(param1,param1.members.getData(_loc4_),onMemberActionBarOpen);
_loc2_.x = _loc3_;
_members.push(_loc2_);
_loc3_ = Number(_loc3_ + (_loc2_.width + 5));
if(_loc3_ > 340)
{
if(!_moreMembers.visible)
{
_moreMembers.x = _loc3_ - _loc2_.width;
_moreMembers.visible = true;
}
_moreMembers.addMember(_loc2_);
}
else
{
_content.header.members.addChild(_loc2_);
}
}
}
syncMessages(true);
}
private function syncMessages(param1:Boolean = false) : void
{
forceToEnd = param1;
if(_lockSyncMessages)
{
return;
}
var toEnd:Boolean = forceToEnd || isAtScrollMax(_direction);
syncItemsFromCollection(privateConversation.messages);
if(toEnd)
{
Runtime.delayFunction(function():void
{
scrollToEnd(_direction,0);
},0.05);
}
}
private function onMemberActionBarOpen(param1:UiPrivateConversationMember) : void
{
var _loc4_:int = 0;
var _loc3_:* = _members;
for each(var _loc2_ in _members)
{
if(_loc2_ != param1)
{
_loc2_.closeActionBar();
}
}
}
private function handleMessageKeyDown(param1:InteractionEvent) : void
{
if(param1.charCode == 13 && param1.controlKey)
{
sendMessage();
}
else if(param1.charCode == 27)
{
_content.footer.inputMessage.text = "";
}
else if(param1.charCode != 9)
{
if(param1.charCode == 8)
{
Runtime.delayFunction(updateFooterHeight,0.001);
}
}
}
private function handleMessageChange(param1:ITextInput) : void
{
Runtime.delayFunction(updateFooterHeight,0.001);
}
private function updateFooterHeight() : void
{
var _loc3_:Number = NaN;
var _loc4_:int = Math.min(_content.footer.inputMessage.numLines,4);
var _loc2_:* = 20.25;
var _loc1_:Number = _loc2_ * _loc4_;
if(_content.footer.inputMessage.height != _loc1_)
{
_loc3_ = _content.footer.inputMessage.height - _loc1_;
_content.footer.inputMessage.height = _loc1_;
_content.footer.inputMessage.y = _content.footer.inputMessage.y + _loc3_;
_content.footer.textFieldBackground.height = _content.footer.textFieldBackground.height - _loc3_;
_content.footer.textFieldBackground.y = _content.footer.textFieldBackground.y + _loc3_;
_content.background.height = _content.background.height + _loc3_;
_scrollContainer.height = _scrollContainer.height + _loc3_;
_content.scrollBarLine.height = _content.scrollBarLine.height + _loc3_;
refresh();
}
}
private function onClickSend(param1:InteractionEvent) : void
{
sendMessage();
}
private function onClickDismiss(param1:InteractionEvent) : void
{
dismissPrivateConversation();
}
private function onClickRename(param1:InteractionEvent) : void
{
Environment.panelManager.showDialog(new DialogPrivateConversationRename(_privateConversation.id));
}
private function onClickInvite(param1:InteractionEvent) : void
{
Environment.panelManager.showDialog(new DialogPrivateConversationInvitation(_privateConversation.id));
}
private function onClickLeave(param1:InteractionEvent) : void
{
interactionEvent = param1;
var leaveCallback:Function = function():void
{
Environment.application.sendActionRequest("leavePrivateConversation",{"private_conversation_id":_privateConversation.id},handleRequests);
};
Environment.panelManager.showDialog(new UiTwoChoiceDialog(LocText.current.text("panel_streams/private_conversation_message/confirm_leave_title"),LocText.current.text("panel_streams/private_conversation_message/confirm_leave_text"),LocText.current.text("general/button_yes"),LocText.current.text("general/button_no"),leaveCallback));
}
private function sendMessage() : void
{
if(StringUtil.isEmpty(_content.footer.inputMessage.text))
{
Environment.display.focus = _content.footer.inputMessage;
return;
}
Environment.application.sendActionRequest("sendStreamMessage",{
"stream_type":"p",
"stream_id":_privateConversation.id,
"message":_content.footer.inputMessage.text
},handleRequests);
_content.footer.inputMessage.text = "";
updateFooterHeight();
}
private function dismissPrivateConversation() : void
{
Environment.application.sendActionRequest("dismissStream",{
"stream_type":"p",
"stream_id":_privateConversation.id,
"last_read_message_id":_privateConversation.maxMessageId
},handleRequests);
}
private function sortById(param1:PrivateConversationMessage, param2:PrivateConversationMessage) : int
{
if(param1.id < param2.id)
{
return -1;
}
if(param1.id > param2.id)
{
return 1;
}
return 0;
}
private function loadMoreMessages() : void
{
Environment.application.sendActionRequest("getStreamMessages",{
"stream_type":"p",
"stream_id":_privateConversation.id,
"start_message_id":_privateConversation.minMessageId - 1
},handleRequests);
}
private function handleRequests(param1:ActionRequestResponse) : void
{
var _loc4_:* = param1.action;
switch(_loc4_)
{
case "sendStreamMessage":
if(param1.error == "")
{
_lockSyncMessages = true;
Environment.application.updateData(param1.data);
_lockSyncMessages = false;
open(_privateConversation);
User.current.character.streams.privateConversations.hasUpdates = true;
ViewManager.instance.baseUserPanel.streamsPanel.privateConversationStreamList.sync();
}
else if(param1.error == "errCreateNotAllowed")
{
if(_privateConversation.isGroup)
{
Environment.panelManager.showDialog(new UiInfoDialog(LocText.current.text("error/private_conversation_not_allowed/title"),LocText.current.text("error/private_conversation_not_allowed_group/text"),LocText.current.text("general/button_ok")));
}
else
{
Environment.panelManager.showDialog(new UiInfoDialog(LocText.current.text("error/private_conversation_not_allowed/title"),LocText.current.text("error/private_conversation_not_allowed/text",_privateConversation.membersString),LocText.current.text("general/button_ok")));
}
}
else
{
Environment.reportError(param1.error,param1.request);
}
break;
case "dismissStream":
if(param1.error == "")
{
Environment.application.updateData(param1.data);
try
{
User.current.character.streams.privateConversations.removePrivateConversation(_privateConversation.id);
ViewManager.instance.baseUserPanel.streamsPanel.privateConversationStreamList.sync();
reset();
}
catch(e:Error)
{
}
}
else if(param1.error == "errDismissNewMessages")
{
Environment.panelManager.showDialog(new UiInfoDialog(LocText.current.text("general/error"),LocText.current.text("mobile/notification/new_message/text"),LocText.current.text("general/button_ok")));
}
else
{
Environment.reportError(param1.error,param1.request);
}
break;
case "getStreamMessages":
if(param1.error == "")
{
Environment.application.updateData(param1.data);
syncMessages();
}
else
{
Environment.reportError(param1.error,param1.request);
}
break;
case "leavePrivateConversation":
if(param1.error == "")
{
Environment.application.updateData(param1.data);
User.current.character.streams.privateConversations.removePrivateConversation(param1.request.getInt("private_conversation_id"));
ViewManager.instance.baseUserPanel.streamsPanel.privateConversationStreamList.sync();
reset();
}
else if(param1.error == "errRemoveMemberInvalidMember")
{
User.current.character.streams.privateConversations.removePrivateConversation(param1.request.getInt("private_conversation_id"));
ViewManager.instance.baseUserPanel.streamsPanel.privateConversationStreamList.sync();
reset();
}
else if(param1.error == "errLeavePrivateConversationNoPermission")
{
User.current.character.streams.privateConversations.removePrivateConversation(param1.request.getInt("private_conversation_id"));
ViewManager.instance.baseUserPanel.streamsPanel.privateConversationStreamList.sync();
reset();
}
else
{
Environment.reportError(param1.error,param1.request);
}
break;
default:
throw new Error("Unsupported request action \'" + param1.action + "\'!");
}
}
}
}
|
package dragonBones.objects
{
import dragonBones.core.DragonBones;
import dragonBones.core.dragonBones_internal;
import dragonBones.utils.ConstValues;
import dragonBones.utils.DBDataUtil;
import flash.geom.ColorTransform;
import flash.geom.Point;
import flash.utils.Dictionary;
/**
* ...
* @author sukui
*/
final public class XML3DataParser
{
private static var tempDragonBonesData:DragonBonesData;
use namespace dragonBones_internal;
public function XML3DataParser()
{
}
/**
* Parse the SkeletonData.
* @param xml The SkeletonData xml to parse.
* @return A SkeletonData instance.
*/
public static function parseSkeletonData(rawData:XML, ifSkipAnimationData:Boolean = false, outputAnimationDictionary:Dictionary = null):DragonBonesData
{
if(!rawData)
{
throw new ArgumentError();
}
var version:String = rawData.@[ConstValues.A_VERSION];
switch (version)
{
case "2.3":
//Update2_3To3_0.format(rawData as XML);
break;
case "3.0":
break;
default:
throw new Error("Nonsupport version!");
}
var frameRate:uint = int(rawData.@[ConstValues.A_FRAME_RATE]);
var data:DragonBonesData = new DragonBonesData();
tempDragonBonesData = data;
data.name = rawData.@[ConstValues.A_NAME];
var isGlobalData:Boolean = rawData.@[ConstValues.A_IS_GLOBAL] == "0" ? false : true;
for each(var armatureXML:XML in rawData[ConstValues.ARMATURE])
{
data.addArmatureData(parseArmatureData(armatureXML, data, frameRate, isGlobalData, ifSkipAnimationData, outputAnimationDictionary));
}
return data;
}
private static function parseArmatureData(armatureXML:XML, data:DragonBonesData, frameRate:uint, isGlobalData:Boolean, ifSkipAnimationData:Boolean, outputAnimationDictionary:Dictionary):ArmatureData
{
var armatureData:ArmatureData = new ArmatureData();
armatureData.name = armatureXML.@[ConstValues.A_NAME];
for each(var boneXML:XML in armatureXML[ConstValues.BONE])
{
armatureData.addBoneData(parseBoneData(boneXML, isGlobalData));
}
for each( var skinXml:XML in armatureXML[ConstValues.SKIN])
{
for each(var slotXML:XML in skinXml[ConstValues.SLOT])
{
armatureData.addSlotData(parseSlotData(slotXML));
}
}
for each(var skinXML:XML in armatureXML[ConstValues.SKIN])
{
armatureData.addSkinData(parseSkinData(skinXML, data));
}
if(isGlobalData)
{
DBDataUtil.transformArmatureData(armatureData);
}
armatureData.sortBoneDataList();
var animationXML:XML;
if(ifSkipAnimationData)
{
//if(outputAnimationDictionary!= null)
//{
//outputAnimationDictionary[armatureData.name] = new Dictionary();
//}
//
//var index:int = 0;
//for each(animationXML in armatureXML[ConstValues.ANIMATION])
//{
//if(index == 0)
//{
//armatureData.addAnimationData(parseAnimationData(animationXML, armatureData, frameRate, isGlobalData));
//}
//else if(outputAnimationDictionary != null)
//{
//outputAnimationDictionary[armatureData.name][animationXML.@[ConstValues.A_NAME]] = animationXML;
//}
//index++;
//}
}
else
{
for each(animationXML in armatureXML[ConstValues.ANIMATION])
{
//var animationData:AnimationData = parseAnimationData(animationXML, frameRate);
//DBDataUtil.addHideTimeline(animationData, outputArmatureData);
//DBDataUtil.transformAnimationData(animationData, outputArmatureData, tempDragonBonesData.isGlobalData);
//outputArmatureData.addAnimationData(animationData);
armatureData.addAnimationData(parseAnimationData(animationXML, armatureData, frameRate, isGlobalData));
}
}
//for each(var rectangleXML:XML in armatureXML[ConstValues.RECTANGLE])
//{
//armatureData.addAreaData(parseRectangleData(rectangleXML));
//}
//
//for each(var ellipseXML:XML in armatureXML[ConstValues.ELLIPSE])
//{
//armatureData.addAreaData(parseEllipseData(ellipseXML));
//}
return armatureData;
}
private static function parseBoneData(boneXML:XML, isGlobalData:Boolean):BoneData
{
var boneData:BoneData = new BoneData();
boneData.name = boneXML.@[ConstValues.A_NAME];
boneData.parent = boneXML.@[ConstValues.A_PARENT];
boneData.length = Number(boneXML.@[ConstValues.A_LENGTH]);
boneData.inheritRotation = getBoolean(boneXML, ConstValues.A_INHERIT_ROTATION, true);
boneData.inheritScale = getBoolean(boneXML, ConstValues.A_INHERIT_SCALE, true);
parseTransform(boneXML[ConstValues.TRANSFORM][0], boneData.transform);
if(isGlobalData)//绝对数据
{
boneData.global.copy(boneData.transform);
}
//for each(var rectangleXML:XML in boneXML[ConstValues.RECTANGLE])
//{
//boneData.addAreaData(parseRectangleData(rectangleXML));
//}
//
//for each(var ellipseXML:XML in boneXML[ConstValues.ELLIPSE])
//{
//boneData.addAreaData(parseEllipseData(ellipseXML));
//}
return boneData;
}
private static function parseRectangleData(rectangleXML:XML):RectangleData
{
var rectangleData:RectangleData = new RectangleData();
rectangleData.name = rectangleXML.@[ConstValues.A_NAME];
rectangleData.width = Number(rectangleXML.@[ConstValues.A_WIDTH]);
rectangleData.height = Number(rectangleXML.@[ConstValues.A_HEIGHT]);
parseTransform(rectangleXML[ConstValues.TRANSFORM][0], rectangleData.transform, rectangleData.pivot);
return rectangleData;
}
private static function parseEllipseData(ellipseXML:XML):EllipseData
{
var ellipseData:EllipseData = new EllipseData();
ellipseData.name = ellipseXML.@[ConstValues.A_NAME];
ellipseData.width = Number(ellipseXML.@[ConstValues.A_WIDTH]);
ellipseData.height = Number(ellipseXML.@[ConstValues.A_HEIGHT]);
parseTransform(ellipseXML[ConstValues.TRANSFORM][0], ellipseData.transform, ellipseData.pivot);
return ellipseData;
}
private static function parseSlotData(slotXML:XML):SlotData
{
var slotData:SlotData = new SlotData();
slotData.name = slotXML.@[ConstValues.A_NAME];
slotData.parent = slotXML.@[ConstValues.A_PARENT];
slotData.zOrder = getNumber(slotXML,ConstValues.A_Z_ORDER,0)||0;
slotData.blendMode = slotXML.@[ConstValues.A_BLENDMODE];
slotData.displayIndex = 0;
return slotData;
}
private static function parseSkinData(skinXML:XML, data:DragonBonesData):SkinData
{
var skinData:SkinData = new SkinData();
skinData.name = skinXML.@[ConstValues.A_NAME];
for each(var slotXML:XML in skinXML[ConstValues.SLOT])
{
skinData.addSlotData(parseSkinSlotData(slotXML, data));
}
return skinData;
}
private static function parseSkinSlotData(slotXML:XML, data:DragonBonesData):SlotData
{
var slotData:SlotData = new SlotData();
slotData.name = slotXML.@[ConstValues.A_NAME];
slotData.parent = slotXML.@[ConstValues.A_PARENT];
slotData.zOrder = getNumber(slotXML, ConstValues.A_Z_ORDER, 0) || 0;
slotData.blendMode = slotXML.@[ConstValues.A_BLENDMODE];
for each(var displayXML:XML in slotXML[ConstValues.DISPLAY])
{
slotData.addDisplayData(parseDisplayData(displayXML, data));
}
return slotData;
}
private static function parseDisplayData(displayXML:XML, data:DragonBonesData):DisplayData
{
var displayData:DisplayData = new DisplayData();
displayData.name = displayXML.@[ConstValues.A_NAME];
displayData.type = displayXML.@[ConstValues.A_TYPE];
displayData.pivot = new Point();
//displayData.pivot = data.addSubTexturePivot(
//0,
//0,
//displayData.name
//);
parseTransform(displayXML[ConstValues.TRANSFORM][0], displayData.transform, displayData.pivot);
if (tempDragonBonesData)
{
tempDragonBonesData.addDisplayData(displayData);
}
return displayData;
}
/** @private */
dragonBones_internal static function parseAnimationData(animationXML:XML, armatureData:ArmatureData, frameRate:uint, isGlobalData:Boolean):AnimationData
{
var animationData:AnimationData = new AnimationData();
animationData.name = animationXML.@[ConstValues.A_NAME];
animationData.frameRate = frameRate;
animationData.duration = Math.round((int(animationXML.@[ConstValues.A_DURATION]) || 1) * 1000 / frameRate);
animationData.playTimes = int(getNumber(animationXML, ConstValues.A_LOOP, 1));
animationData.fadeTime = getNumber(animationXML, ConstValues.A_FADE_IN_TIME, 0) || 0;
animationData.scale = getNumber(animationXML, ConstValues.A_SCALE, 1) || 0;
//use frame tweenEase, NaN
//overwrite frame tweenEase, [-1, 0):ease in, 0:line easing, (0, 1]:ease out, (1, 2]:ease in out
animationData.tweenEasing = getNumber(animationXML, ConstValues.A_TWEEN_EASING, NaN);
animationData.autoTween = getBoolean(animationXML, ConstValues.A_AUTO_TWEEN, true);
for each(var frameXML:XML in animationXML[ConstValues.FRAME])
{
var frame:Frame = parseTransformFrame(frameXML, frameRate, isGlobalData);
animationData.addFrame(frame);
}
parseTimeline(animationXML, animationData);
var lastFrameDuration:int = animationData.duration;
for each(var timelineXML:XML in animationXML[ConstValues.TIMELINE])
{
var timeline:TransformTimeline = parseTransformTimeline(timelineXML, animationData.duration, frameRate, isGlobalData);
lastFrameDuration = Math.min(lastFrameDuration, timeline.frameList[timeline.frameList.length - 1].duration);
animationData.addTimeline(timeline);
var slotTimeline:SlotTimeline = parseSlotTimeline(timelineXML, animationData.duration, frameRate, isGlobalData);
if (slotTimeline.frameList.length > 0)
{
lastFrameDuration = Math.min(lastFrameDuration, slotTimeline.frameList[slotTimeline.frameList.length - 1].duration);
animationData.addSlotTimeline(slotTimeline);
}
}
if(animationData.frameList.length > 0)
{
lastFrameDuration = Math.min(lastFrameDuration, animationData.frameList[animationData.frameList.length - 1].duration);
}
animationData.lastFrameDuration = lastFrameDuration;
DBDataUtil.addHideTimeline(animationData, armatureData);
DBDataUtil.transformAnimationData(animationData, armatureData, isGlobalData);
return animationData;
}
private static function parseSlotTimeline(timelineXML:XML, duration:int, frameRate:uint, isGlobalData:Boolean):SlotTimeline
{
var timeline:SlotTimeline = new SlotTimeline();
timeline.name = timelineXML.@[ConstValues.A_NAME];
timeline.scale = getNumber(timelineXML, ConstValues.A_SCALE, 1) || 0;
timeline.offset = getNumber(timelineXML, ConstValues.A_OFFSET, 0) || 0;
timeline.duration = duration;
for each(var frameXML:XML in timelineXML[ConstValues.FRAME])
{
var frame:SlotFrame = parseSlotFrame(frameXML, frameRate, isGlobalData);
timeline.addFrame(frame);
}
parseTimeline(timelineXML, timeline);
return timeline;
}
private static function parseSlotFrame(frameXML:XML, frameRate:uint, isGlobalData:Boolean):SlotFrame
{
var frame:SlotFrame = new SlotFrame();
parseFrame(frameXML, frame, frameRate);
frame.visible = !getBoolean(frameXML, ConstValues.A_HIDE, false);
//NaN:no tween, 10:auto tween, [-1, 0):ease in, 0:line easing, (0, 1]:ease out, (1, 2]:ease in out
frame.tweenEasing = getNumber(frameXML, ConstValues.A_TWEEN_EASING, 10);
frame.displayIndex = int(getNumber(frameXML,ConstValues.A_DISPLAY_INDEX,0));
//如果为NaN,则说明没有改变过zOrder
frame.zOrder = getNumber(frameXML, ConstValues.A_Z_ORDER, isGlobalData ? NaN:0);
var colorTransformXML:XML = frameXML[ConstValues.COLOR_TRANSFORM][0];
if(colorTransformXML)
{
frame.color = new ColorTransform();
parseColorTransform(colorTransformXML, frame.color);
}
return frame;
}
private static function parseTransformTimeline(timelineXML:XML, duration:int, frameRate:uint, isGlobalData:Boolean):TransformTimeline
{
var timeline:TransformTimeline = new TransformTimeline();
timeline.name = timelineXML.@[ConstValues.A_NAME];
timeline.scale = getNumber(timelineXML, ConstValues.A_SCALE, 1) || 0;
timeline.offset = getNumber(timelineXML, ConstValues.A_OFFSET, 0) || 0;
timeline.originPivot.x = getNumber(timelineXML, ConstValues.A_PIVOT_X, 0) || 0;
timeline.originPivot.y = getNumber(timelineXML, ConstValues.A_PIVOT_Y, 0) || 0;
timeline.duration = duration;
for each(var frameXML:XML in timelineXML[ConstValues.FRAME])
{
var frame:TransformFrame = parseTransformFrame(frameXML, frameRate, isGlobalData);
timeline.addFrame(frame);
}
parseTimeline(timelineXML, timeline);
return timeline;
}
private static function parseMainFrame(frameXML:XML, frameRate:uint):Frame
{
var frame:Frame = new Frame();
parseFrame(frameXML, frame, frameRate);
return frame;
}
private static function parseTransformFrame(frameXML:XML, frameRate:uint, isGlobalData:Boolean):TransformFrame
{
var frame:TransformFrame = new TransformFrame();
parseFrame(frameXML, frame, frameRate);
frame.visible = !getBoolean(frameXML, ConstValues.A_HIDE, false);
//NaN:no tween, 10:auto tween, [-1, 0):ease in, 0:line easing, (0, 1]:ease out, (1, 2]:ease in out
frame.tweenEasing = getNumber(frameXML, ConstValues.A_TWEEN_EASING, 10);
frame.tweenRotate = int(getNumber(frameXML, ConstValues.A_TWEEN_ROTATE,0));
frame.tweenScale = getBoolean(frameXML, ConstValues.A_TWEEN_SCALE, true);
//frame.displayIndex = int(getNumber(frameXML, ConstValues.A_DISPLAY_INDEX, 0));
//如果为NaN,则说明没有改变过zOrder
//frame.zOrder = getNumber(frameXML, ConstValues.A_Z_ORDER, isGlobalData ? NaN : 0);
parseTransform(frameXML[ConstValues.TRANSFORM][0], frame.transform, frame.pivot);
if(isGlobalData)//绝对数据
{
frame.global.copy(frame.transform);
}
frame.scaleOffset.x = getNumber(frameXML, ConstValues.A_SCALE_X_OFFSET, 0) || 0;
frame.scaleOffset.y = getNumber(frameXML, ConstValues.A_SCALE_Y_OFFSET, 0) || 0;
//var colorTransformXML:XML = frameXML[ConstValues.COLOR_TRANSFORM][0];
//if(colorTransformXML)
//{
//frame.color = new ColorTransform();
//parseColorTransform(colorTransformXML, frame.color);
//}
return frame;
}
private static function parseTimeline(timelineXML:XML, timeline:Timeline):void
{
var position:int = 0;
var frame:Frame;
for each(frame in timeline.frameList)
{
frame.position = position;
position += frame.duration;
}
if(frame)
{
frame.duration = timeline.duration - frame.position;
}
}
private static function parseFrame(frameXML:XML, frame:Frame, frameRate:uint):void
{
frame.duration = Math.round((int(frameXML.@[ConstValues.A_DURATION]) || 1) * 1000 / frameRate);
frame.action = frameXML.@[ConstValues.A_ACTION];
frame.event = frameXML.@[ConstValues.A_EVENT];
frame.sound = frameXML.@[ConstValues.A_SOUND];
}
private static function parseTransform(transformXML:XML, transform:DBTransform, pivot:Point = null):void
{
if(transformXML)
{
if(transform)
{
transform.x = getNumber(transformXML, ConstValues.A_X, 0) || 0;
transform.y = getNumber(transformXML, ConstValues.A_Y, 0) || 0;
transform.skewX = getNumber(transformXML, ConstValues.A_SKEW_X, 0) * ConstValues.ANGLE_TO_RADIAN || 0;
transform.skewY = getNumber(transformXML, ConstValues.A_SKEW_Y, 0) * ConstValues.ANGLE_TO_RADIAN || 0;
transform.scaleX = getNumber(transformXML, ConstValues.A_SCALE_X, 1) || 0;
transform.scaleY = getNumber(transformXML, ConstValues.A_SCALE_Y, 1) || 0;
}
if(pivot)
{
pivot.x = getNumber(transformXML, ConstValues.A_PIVOT_X, 0) || 0;
pivot.y = getNumber(transformXML, ConstValues.A_PIVOT_Y, 0) || 0;
}
}
}
private static function parseColorTransform(colorTransformXML:XML, colorTransform:ColorTransform):void
{
if(colorTransformXML)
{
if(colorTransform)
{
colorTransform.alphaOffset = int(colorTransformXML.@[ConstValues.A_ALPHA_OFFSET]);
colorTransform.redOffset = int(colorTransformXML.@[ConstValues.A_RED_OFFSET]);
colorTransform.greenOffset = int(colorTransformXML.@[ConstValues.A_GREEN_OFFSET]);
colorTransform.blueOffset = int(colorTransformXML.@[ConstValues.A_BLUE_OFFSET]);
colorTransform.alphaMultiplier = int(getNumber(colorTransformXML, ConstValues.A_ALPHA_MULTIPLIER, 100) || 100) * 0.01;
colorTransform.redMultiplier = int(getNumber(colorTransformXML, ConstValues.A_RED_MULTIPLIER, 100) || 100) * 0.01;
colorTransform.greenMultiplier = int(getNumber(colorTransformXML, ConstValues.A_GREEN_MULTIPLIER, 100) || 100) * 0.01;
colorTransform.blueMultiplier = int(getNumber(colorTransformXML, ConstValues.A_BLUE_MULTIPLIER, 100) || 100) * 0.01;
}
}
}
private static function getBoolean(data:XML, key:String, defaultValue:Boolean):Boolean
{
if(data && data.@[key].length() > 0)
{
switch(String(data.@[key]))
{
case "0":
case "NaN":
case "":
case "false":
case "null":
case "undefined":
return false;
case "1":
case "true":
default:
return true;
}
}
return defaultValue;
}
private static function getNumber(data:XML, key:String, defaultValue:Number):Number
{
if(data && data.@[key].length() > 0)
{
switch(String(data.@[key]))
{
case "NaN":
case "":
case "false":
case "null":
case "undefined":
return NaN;
default:
return Number(data.@[key]);
}
}
return defaultValue;
}
}
} |
package maryfisher.view.ui.button {
import maryfisher.framework.view.IDisplayObject;
import maryfisher.view.ui.component.BaseSprite;
import maryfisher.view.ui.interfaces.IButton;
import maryfisher.view.ui.interfaces.IButtonContainer;
import maryfisher.view.ui.interfaces.ITooltip;
import maryfisher.view.ui.mediator.button.SpriteButtonMediator;
/**
* ...
* @author ...
*/
public class BaseSpriteButton extends BaseSprite implements IButtonContainer {
protected var _button:SpriteButtonMediator;
public function BaseSpriteButton(id:String) {
_button = new SpriteButtonMediator(this, id);
}
/* INTERFACE maryfisher.view.ui.interfaces.IButtonContainer */
public function set selected(value:Boolean):void {
_button.selected = value;
}
public function set enabled(value:Boolean):void {
_button.enabled = value;
}
public function get id():String{
return _button.id;
}
public function attachTooltip(t:ITooltip):void{
_button.attachTooltip(t);
}
public function destroy():void{
_button.destroy();
}
public function setButtonStates(defaultS:IDisplayObject, overS:IDisplayObject, downS:IDisplayObject, disabledS:IDisplayObject = null, selectedS:IDisplayObject = null):void {
_button.defaultState = defaultS;
CONFIG::mouse {
_button.overState = overS;
}
_button.downState = downS;
disabledS && (_button.disabledState = disabledS);
selectedS && (_button.selectedState = selectedS);
}
public function fadeState(state:IDisplayObject):void {
}
public function get button():IButton {
return _button;
}
}
} |
/**
* __ __ __
* ____/ /_ ____/ /______ _ ___ / /_
* / __ / / ___/ __/ ___/ / __ `/ __/
* / /_/ / (__ ) / / / / / /_/ / /
* \__,_/_/____/_/ /_/ /_/\__, /_/
* / /
* \/
* http://distriqt.com
*
* @author Michael (https://github.com/marchbold)
* @created 10/9/21
*/
package com.apple.plist
{
import com.apple.plist.entries.PlistDictEntry;
import flash.events.Event;
import flash.filesystem.File;
import flash.filesystem.FileMode;
import flash.filesystem.FileStream;
/**
*
*/
public class Plist extends PlistDictEntry
{
////////////////////////////////////////////////////////
// CONSTANTS
//
private static const TAG:String = "Plist";
private static const EMPTY_PLIST:String =
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
"<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n" +
"<plist version=\"1.0\">\n" +
"<dict>\n" +
"\n" +
"</dict>\n" +
"</plist>";
////////////////////////////////////////////////////////
// VARIABLES
//
////////////////////////////////////////////////////////
// FUNCTIONALITY
//
public function Plist( content:String = EMPTY_PLIST )
{
super("");
loadPlistXMLString( content );
}
//
// LOADING / SAVING
//
public function loadPlistXMLString( xmlString:String ):void
{
var xml:XML = new XML( xmlString );
// process entries
try
{
var dict:XML = xml.children()[0];
processEntries( dict );
}
catch (e:Error)
{
}
}
public function toXML():XML
{
var xml:XML = new XML( EMPTY_PLIST );
xml.dict = valueXML();
return xml;
}
public function load( plistFile:File ):Plist
{
if (!plistFile.exists)
{
throw new Error( "plist file does not exist" );
}
var fs:FileStream = new FileStream();
fs.open( plistFile, FileMode.READ );
var content:String = fs.readUTFBytes( fs.bytesAvailable );
fs.close();
loadPlistXMLString( content );
return this;
}
public function save( plistFile:File ):void
{
var data:String = toXML().toXMLString();
var fileStream:FileStream = new FileStream();
fileStream.open( plistFile, FileMode.WRITE );
fileStream.writeUTFBytes( data );
fileStream.close();
}
public function saveAsync( plistFile:File, complete:Function = null ):void
{
var data:String = toXML().toXMLString();
var fileStream:FileStream = new FileStream();
fileStream.addEventListener( Event.CLOSE, function ( event:Event ):void {
event.currentTarget.removeEventListener( event.type, arguments.callee );
if (complete != null)
{
complete();
}
} );
fileStream.openAsync( plistFile, FileMode.WRITE );
fileStream.writeUTFBytes( data );
fileStream.close();
}
}
}
|
package com.renaun.embeds
{
import flash.display.BitmapData;
[Embed(source="/assets_embed/ArmLeft.png")]
public class EmbedArmLeft extends BitmapData
{
public function EmbedArmLeft(width:int, height:int, transparent:Boolean=true, fillColor:uint=4.294967295E9)
{
super(width, height, transparent, fillColor);
}
}
} |
/* 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 SECTION = "15.4.3.2";
// var VERSION = "ECMA_1";
// var TITLE = "Array.length";
var testcases = getTestCases();
function getTestCases() {
var array = new Array();
var item = 0;
array[item++] = Assert.expectEq( "Array.length", 1, Array.length );
return ( array );
}
|
package utils.color
{
/**
* Convert HSL to HSV using RGB conversions: color preservation may be dubious.
*/
public function HSLtoHSV(hue:Number, luminance:Number, saturation:Number):Object
{
var rgbVal:Object = HSLtoRGB(hue, luminance, saturation);
return RGBtoHSV(rgbVal.r, rgbVal.g, rgbVal.b);
}
} |
package uieditor.editor.history
{
import flash.utils.Dictionary;
import uieditor.editor.controller.AbstractDocumentEditor;
public class CutOperation extends DeleteOperation
{
public function CutOperation( target : Array, paramDict : Dictionary, documentEditor : AbstractDocumentEditor )
{
super( target, paramDict, documentEditor );
}
override public function info() : String
{
return "剪切";
}
}
}
|
package awayphysics {
import cmodule.AwayPhysics.*;
import flash.utils.ByteArray;
public class AWPBase {
protected static var loader : CLibInit;
protected static var bullet : Object;
protected static var memUser : MemUser;
protected static var alchemyMemory : ByteArray;
private static var initialized : Boolean = false;
public function AWPBase() {
}
/**
* Initialize the Alchemy Memory and get the pointer of the buffer
*/
public static function initialize() : void {
if (initialized) {
return;
}
initialized = true;
loader = new CLibInit();
bullet = loader.init();
memUser = new MemUser();
var ns : Namespace = new Namespace("cmodule.AwayPhysics");
alchemyMemory = (ns::gstate).ds;
}
/**
* 1 visual units equal to 0.01 bullet meters by default, this value is inversely with physics world scaling
* refer to http://www.bulletphysics.org/mediawiki-1.5.8/index.php?title=Scaling_The_World
*/
protected static var _scaling : Number = 100;
public var pointer : uint;
protected var cleanup:Boolean = false;
}
} |
package com.ankamagames.dofus.logic.game.common.actions.exchange
{
import com.ankamagames.dofus.misc.utils.AbstractAction;
import com.ankamagames.jerakine.handlers.messages.Action;
public class ExchangeRefuseAction extends AbstractAction implements Action
{
public function ExchangeRefuseAction(params:Array = null)
{
super(params);
}
public static function create() : ExchangeRefuseAction
{
return new ExchangeRefuseAction(arguments);
}
}
}
|
/*
Feathers SDK Manager
Copyright 2015 Bowler Hat LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package services
{
public interface IRunInstallerScriptService
{
function get isActive():Boolean;
function runInstallerScript():void;
}
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.