CombinedText
stringlengths
4
3.42M
/** * DrawTrianglesExample6.as by Lee Burrows * Oct 27, 2010 * Visit blog.leeburrows.com for more stuff * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without * restriction, including without limitation the rights to use, * copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following * conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. **/ package { import flash.display.Shape; import flash.display.Sprite; import flash.display.StageAlign; import flash.display.StageScaleMode; import flash.events.Event; import flash.geom.Point; import flash.geom.Vector3D; [SWF(backgroundColor="#F0F0F0", frameRate="30", width="300", height="200")] public class DrawTrianglesExample6 extends Sprite { private var shape:Shape; private var cube:Vector.<Vector3D> = new Vector.<Vector3D>(); private var vertices:Vector.<Number> = new Vector.<Number>(); private var indices:Vector.<int> = new Vector.<int>(); public function DrawTrianglesExample6() { //do some general housekeeping stage.align = StageAlign.TOP_LEFT; stage.scaleMode = StageScaleMode.NO_SCALE; //define x,y,z points of cube cube.push(new Vector3D(-50, -50, -50)); cube.push(new Vector3D(50, -50, -50)); cube.push(new Vector3D(50, 50, -50)); cube.push(new Vector3D(-50, 50, -50)); cube.push(new Vector3D(-50, -50, 50)); cube.push(new Vector3D(50, -50, 50)); cube.push(new Vector3D(50, 50, 50)); cube.push(new Vector3D(-50, 50, 50)); //define indices //front face indices.push(0, 1, 3); indices.push(1, 2, 3); //back face indices.push(5, 4, 7); indices.push(6, 5, 7); //left face indices.push(1, 5, 2); indices.push(5, 6, 2); //right face indices.push(4, 0, 3); indices.push(4, 3, 7); //top face indices.push(4, 5, 0); indices.push(5, 1, 0); //bottom face indices.push(3, 2, 7); indices.push(2, 6, 7); //create shape to draw into and center it on stage shape = new Shape(); shape.x = 150; shape.y = 100; addChild(shape); //loop addEventListener(Event.ENTER_FRAME, loop); } private function loop(event:Event):void { //get x and y rotation from mouse position var angle:Vector3D = new Vector3D(2*Math.PI*mouseX/300, 2*Math.PI*mouseY/200, 0); //calculate vertices vertices = new Vector.<Number>(); for each (var v:Vector3D in cube) { var p:Point = convertTo2D(rotate3D(v, angle)); vertices.push(p.x, p.y); } //clear existing graphics shape.graphics.clear(); //set draw colours (black edge, no fill) shape.graphics.lineStyle(1, 0x000000); //draw triangle shape.graphics.drawTriangles(vertices, indices); //finish shape.graphics.endFill(); } private function convertTo2D(v:Vector3D):Point { var focalLength:Number = 200; var perspective:Number = focalLength/(focalLength+v.z); return new Point(v.x*perspective, v.y*perspective); } private function rotate3D(v:Vector3D, angle:Vector3D):Vector3D { //rotate v around x axis by angle.x, around y axis by angle.y and around z axis by angle.z var sinx:Number = Math.sin(angle.x); var cosx:Number = Math.cos(angle.x); var siny:Number = Math.sin(angle.y); var cosy:Number = Math.cos(angle.y); var sinz:Number = Math.sin(angle.z); var cosz:Number = Math.cos(angle.z); var y1:Number = (v.y * cosx) - (v.z * sinx); var z1:Number = (v.z * cosx) + (v.y * sinx); var x2:Number = (v.x * cosy) - (z1 * siny); var z2:Number = (z1 * cosy) + (v.x * siny); var x3:Number = (x2 * cosz) - (y1 * sinz); var y3:Number = (y1 * cosz) + (x2 * sinz); return new Vector3D(x3, y3, z2); } } }
package com.playata.application.ui.elements.leaderboard { import com.playata.application.data.movie.LeaderboardMovie; import com.playata.application.ui.elements.generic.UiClosableTooltip; import com.playata.application.ui.elements.movie.UiMovieCover; import com.playata.framework.display.IInteractiveDisplayObject; import com.playata.framework.display.ui.TextFieldAutoAdjustWidthHeight; import com.playata.framework.input.InteractionEvent; import com.playata.framework.localization.LocText; import visuals.ui.base.SymbolUiTooltipLeaderboardMovieGeneric; public class UiLeaderboardMovieTooltip extends UiClosableTooltip { private static var _tooltipContent:SymbolUiTooltipLeaderboardMovieGeneric; private static var _cover:UiMovieCover; private static var _currentMovie:LeaderboardMovie; private var _coverRefreshed:Boolean; private var _movie:LeaderboardMovie; public function UiLeaderboardMovieTooltip(param1:IInteractiveDisplayObject) { if(!_tooltipContent) { _tooltipContent = new SymbolUiTooltipLeaderboardMovieGeneric(); _tooltipContent.txtMovieTitle.autoAdjustWidthHeight = TextFieldAutoAdjustWidthHeight.VERTICAL; _cover = new UiMovieCover(_tooltipContent.cover); } super(param1,_tooltipContent); } override public function get height() : Number { return _tooltipContent.background.height * _tooltipContent.scale; } override public function get width() : Number { return _tooltipContent.background.width * _tooltipContent.scale; } override public function onAssigned() : void { if(_currentMovie == _movie) { return; } _currentMovie = _movie; if(_movie == null) { _tooltipContent.visible = false; return; } _tooltipContent.txtStudioTitle.text = LocText.current.text("dialog/movie_history/studio_caption"); _coverRefreshed = false; _tooltipContent.txtMovieTitle.text = _movie.title; _tooltipContent.txtMovieTitle.y = 13 + (100 - _tooltipContent.txtMovieTitle.height) * 0.5; _tooltipContent.txtStudioName.text = !!_movie.hasGuild?_movie.guildName:LocText.current.text("dialog/movie_history/no_studio"); _tooltipContent.txtStudioName.textColor = !!_movie.isMyGuild?245728:14342874; } public function refresh(param1:LeaderboardMovie) : void { _movie = param1; } override public function dispose() : void { _movie = null; super.dispose(); } override protected function handleInteractionOver(param1:InteractionEvent) : void { super.handleInteractionOver(param1); if(!_coverRefreshed && _movie) { _cover.showWithSettings(_movie.coverSettings); _coverRefreshed = true; } } } }
package Ankama_Grimoire.ui.optionalFeatures { import com.ankamagames.berilia.api.UiApi; import com.ankamagames.berilia.types.graphic.ButtonContainer; import com.ankamagames.berilia.types.graphic.GraphicContainer; import com.ankamagames.berilia.utils.ComponentHookList; import com.ankamagames.dofus.kernel.sound.enum.SoundEnum; import com.ankamagames.dofus.kernel.sound.enum.SoundTypeEnum; import com.ankamagames.dofus.misc.lists.ShortcutHookListEnum; import com.ankamagames.dofus.uiApi.SoundApi; public class ForgettableSpellsIntroPopUp { [Api(name="SoundApi")] public var soundApi:SoundApi; [Api(name="UiApi")] public var uiApi:UiApi; private var _validationCallback:Function; public var mainCtr:GraphicContainer; public var btn_close:ButtonContainer; public var btn_ok:ButtonContainer; public function ForgettableSpellsIntroPopUp() { super(); } public function main(params:Array) : void { if(params.length <= 0) { throw new Error("You should provide at least the validation callback"); } this._validationCallback = params[0]; this.btn_ok.soundId = SoundEnum.OK_BUTTON; this.uiApi.addComponentHook(this.btn_ok,ComponentHookList.ON_RELEASE); this.uiApi.addComponentHook(this.mainCtr,ComponentHookList.ON_RELEASE); this.uiApi.addShortcutHook(ShortcutHookListEnum.CLOSE_UI,this.onShortcut); this.uiApi.me().setOnTop(); } public function unload() : void { this.soundApi.playSound(SoundTypeEnum.CLOSE_WINDOW); } private function closeMe() : void { if(this.uiApi !== null) { this.uiApi.unloadUi(this.uiApi.me().name); } } private function validate() : void { this._validationCallback(); this.closeMe(); } public function onShortcut(shortcutLabel:String) : Boolean { switch(shortcutLabel) { case ShortcutHookListEnum.VALID_UI: this.validate(); return true; case ShortcutHookListEnum.CLOSE_UI: this.closeMe(); return true; default: return false; } } public function onRelease(target:GraphicContainer) : void { switch(target) { case this.mainCtr: this.uiApi.me().setOnTop(); break; case this.btn_close: case this.btn_ok: this.validate(); } } } }
/****************************************************************************** * Spine Runtimes License Agreement * Last updated May 1, 2019. Replaces all prior versions. * * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and * conditions of Section 2 of the Spine Editor License Agreement: * http://esotericsoftware.com/spine-editor-license * * Otherwise, it is permitted to integrate the Spine Runtimes into software * or otherwise create derivative works of the Spine Runtimes (collectively, * "Products"), provided that each user of the Products must obtain their own * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "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 ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) 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 spine.attachments { import spine.Color; import spine.MathUtils; import spine.Bone; public dynamic class PointAttachment extends VertexAttachment { public var x : Number, y : Number, rotation : Number; public var color : Color = new Color(0.38, 0.94, 0, 1); public function PointAttachment(name : String) { super(name); } public function computeWorldPosition(bone : Bone, point : Vector.<Number>) : Vector.<Number> { point[0] = this.x * bone.a + this.y * bone.b + bone.worldX; point[1] = this.x * bone.c + this.y * bone.d + bone.worldY; return point; } public function computeWorldRotation(bone : Bone) : Number { var cos : Number = MathUtils.cosDeg(this.rotation), sin : Number = MathUtils.sinDeg(this.rotation); var x : Number = cos * bone.a + sin * bone.b; var y : Number = cos * bone.c + sin * bone.d; return Math.atan2(y, x) * MathUtils.radDeg; } } }
/* * Copyright (c) 2014-2019 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.sprites { import flash.display.BitmapData; import flash.geom.Rectangle; import flash.utils.ByteArray; import flash.utils.Endian; import by.blooddy.crypto.MD5; import nail.errors.NullArgumentError; /** * The Sprite class represents an image with 32x32 pixels. */ public class Sprite { //-------------------------------------------------------------------------- // PROPERTIES //-------------------------------------------------------------------------- private var _id:uint; private var _transparent:Boolean; private var _compressedPixels:ByteArray; private var _bitmap:BitmapData; private var _hash:String; //-------------------------------------- // Getters / Setters //-------------------------------------- /** The id of the sprite. This value specifies the index in the spr file. **/ public function get id():uint { return _id; } public function set id(value:uint):void { _id = value; } /** Specifies whether the sprite supports per-pixel transparency. **/ public function get transparent():Boolean { return _transparent; } public function set transparent(value:Boolean):void { if (_transparent != value) { var pixels:ByteArray = getPixels(); _transparent = value; setPixels( pixels ); } } /** Indicates if the sprite does not have colored pixels. **/ public function get isEmpty():Boolean { return (_compressedPixels.length == 0); } internal function get length():uint { return _compressedPixels.length;} internal function get compressedPixels():ByteArray { return _compressedPixels; } //-------------------------------------------------------------------------- // CONSTRUCTOR //-------------------------------------------------------------------------- public function Sprite(id:uint, transparent:Boolean) { _id = id; _transparent = transparent; _compressedPixels = new ByteArray(); _compressedPixels.endian = Endian.LITTLE_ENDIAN; } //-------------------------------------------------------------------------- // METHODS //-------------------------------------------------------------------------- //-------------------------------------- // Public //-------------------------------------- /** * Returns the <code>id</code> string representation of the <code>Sprite</code>. */ public function toString():String { return _id.toString(); } public function getPixels():ByteArray { return uncompressPixels(); } public function setPixels(pixels:ByteArray):Boolean { if (!pixels) throw new NullArgumentError("pixels"); if (pixels.length != SPRITE_DATA_SIZE) throw new Error("Invalid sprite pixels length"); _hash = null; return compressPixels(pixels); } public function getBitmap():BitmapData { if (_bitmap) return _bitmap; var pixels:ByteArray = getPixels(); if (!pixels) return null; _bitmap = new BitmapData(DEFAULT_SIZE, DEFAULT_SIZE, true); _bitmap.setPixels(RECTANGLE, pixels); return _bitmap; } public function setBitmap(bitmap:BitmapData):Boolean { if (!bitmap) throw new NullArgumentError("bitmap"); if (bitmap.width != DEFAULT_SIZE || bitmap.height != DEFAULT_SIZE) throw new Error("Invalid sprite bitmap size"); if (!compressPixels( bitmap.getPixels(RECTANGLE) )) return false; _hash = null; _bitmap = bitmap.clone(); return true; } public function getHash():String { if (_hash != null) return _hash; if (_compressedPixels.length != 0) _hash = MD5.hashBytes(_compressedPixels); return _hash; } public function clone():Sprite { var sprite:Sprite = new Sprite(_id, _transparent); _compressedPixels.position = 0; _compressedPixels.readBytes(sprite._compressedPixels); sprite._bitmap = _bitmap; return sprite; } public function clear():void { if (_compressedPixels) _compressedPixels.clear(); if (_bitmap) _bitmap.fillRect(RECTANGLE, 0x00FF00FF); } public function dispose():void { if (_compressedPixels) _compressedPixels.clear(); if (_bitmap) { _bitmap.dispose(); _bitmap = null; } _id = 0; } //-------------------------------------- // Private //-------------------------------------- private function compressPixels(pixels:ByteArray):Boolean { _compressedPixels.clear(); pixels.position = 0; var index:uint; var color:uint; var transparentPixel:Boolean = true; var alphaCount:uint; var chunkSize:uint; var coloredPos:uint; var finishOffset:uint; var length:uint = pixels.length / 4; while (index < length) { chunkSize = 0; while (index < length) { pixels.position = index * 4; color = pixels.readUnsignedInt(); transparentPixel = (color == 0); if (!transparentPixel) break; alphaCount++; chunkSize++; index++; } // Entire image is transparent if (alphaCount < length) { // Already at the end if(index < length) { _compressedPixels.writeShort(chunkSize); // Write transparent pixels coloredPos = _compressedPixels.position; // Save colored position _compressedPixels.position += 2; // Skip colored short chunkSize = 0; while(index < length) { pixels.position = index * 4; color = pixels.readUnsignedInt(); transparentPixel = (color == 0); if (transparentPixel) break; _compressedPixels.writeByte(color >> 16 & 0xFF); // Write red _compressedPixels.writeByte(color >> 8 & 0xFF); // Write green _compressedPixels.writeByte(color & 0xFF); // Write blue if (_transparent) _compressedPixels.writeByte(color >> 24 & 0xFF); // Write Alpha chunkSize++; index++; } finishOffset = _compressedPixels.position; _compressedPixels.position = coloredPos; // Go back to chunksize indicator _compressedPixels.writeShort(chunkSize); // Write colored pixels _compressedPixels.position = finishOffset; } } } return true; } private function uncompressPixels():ByteArray { var read:uint; var write:uint; var transparentPixels:uint; var coloredPixels:uint; var alpha:uint; var red:uint; var green:uint; var blue:uint; var channels:uint = _transparent ? 4 : 3; var length:uint = _compressedPixels.length; var i:int; _compressedPixels.position = 0; var pixels:ByteArray = new ByteArray(); for (read = 0; read < length; read += 4 + (channels * coloredPixels)) { transparentPixels = _compressedPixels.readUnsignedShort(); coloredPixels = _compressedPixels.readUnsignedShort(); for (i = 0; i < transparentPixels; i++) { pixels[write++] = 0x00; // Alpha pixels[write++] = 0x00; // Red pixels[write++] = 0x00; // Green pixels[write++] = 0x00; // Blue } for (i = 0; i < coloredPixels; i++) { red = _compressedPixels.readUnsignedByte(); // Red green = _compressedPixels.readUnsignedByte(); // Green blue = _compressedPixels.readUnsignedByte(); // Blue alpha = _transparent ? _compressedPixels.readUnsignedByte() : 0xFF; // Alpha pixels[write++] = alpha; // Alpha pixels[write++] = red; // Red pixels[write++] = green; // Green pixels[write++] = blue; // Blue } } while(write < SPRITE_DATA_SIZE) { pixels[write++] = 0x00; // Alpha pixels[write++] = 0x00; // Red pixels[write++] = 0x00; // Green pixels[write++] = 0x00; // Blue } return pixels; } //-------------------------------------------------------------------------- // STATIC //-------------------------------------------------------------------------- public static const DEFAULT_SIZE:uint = 32; public static const SPRITE_DATA_SIZE:uint = 4096; // DEFAULT_WIDTH * DEFAULT_HEIGHT * 4 channels; private static const RECTANGLE:Rectangle = new Rectangle(0, 0, DEFAULT_SIZE, DEFAULT_SIZE); } }
package com.utils { import flash.display.DisplayObject; public class ImageUtil { public static function resizeTo( image : DisplayObject, size : Number ) : void { var decCount : Number = 0.0; if ( image.width >= image.height ) { decCount = image.width - size; image.width = size; image.height -= decCount; } else { decCount = image.height - size; image.height = size; image.width -= decCount; } } } }
package cc.gullinbursti.audio.fx { //] includes [!]> //]=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~. //]~=~=~=~=~=~=~=~=~=~=~=~=~=~[]~=~=~=~=~=~=~=~=~=~=~=~=~=~[ /** * * @author Gullinbursti */ // <[!] class delaration [!]> public class Reverb { //~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~~*~._ //] class properties ]> //]=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~. //]~=~=~=~=~=~=~=~=~=~=~=~=~=~[]~=~=~=~=~=~=~=~=~=~=~=~=~=~[ /** * */ // <*] class constructor [*> //~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~~*~._ public function Reverb() { }//]~*~~*~~*~~*~~*~~*~~*~~*~~·¯ //]~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=[> //]~=~=~=~=~=~=~=~=~=[> public static function apply(wave:Array, amt:Number, dur:Number):Array { //]~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~._ var fx_arr:Array = new Array(); for (var i:int=0; i<wave.length; i++) fx_arr.push(wave[i]); return (fx_arr); }//]~*~~*~~*~~*~~*~~*~~*~~*~~·¯ } }
/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is [Open Source Virtual Machine.]. * * The Initial Developer of the Original Code is * Adobe System Incorporated. * Portions created by the Initial Developer are Copyright (C) 2005-2006 * the Initial Developer. All Rights Reserved. * * Contributor(s): * Adobe AS3 Team * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) var VERSION = "AS3"; // Version of JavaScript or ECMA var TITLE = "Testing try block with multiple catch blocks, the catch block with parameter of type Error catching the Argument error when there is no catch block with parameter of type Argument Error"; // Provide ECMA section title or a description var BUGNUMBER = ""; startTest(); // leave this alone thisError = "no error"; try { throw new ArgumentError(); } catch(e:ReferenceError){ thisError="This is Reference Error"; }catch(e2:URIError){ thisError="This is URI Error"; }catch(e3:EvalError){ thisError="This is Eval Error"; }catch(e4:RangeError){ thisError="This is Range Error"; }catch(e4:TypeError){ thisError="This is Type Error"; }catch(e5:SecurityError){ thisError="This is security Error"; }catch(e6:DefinitionError){ thisError="This is Definition Error"; }catch(e7:UninitializedError){ thisError="This is Uninitialized Error"; }catch(e8:SyntaxError){ thisError="This is Syntax Error"; }catch(e9:VerifyError){ thisError="This is Verify Error"; }catch(e10:Error){ thisError = e10.toString(); }finally{ AddTestCase( "Testing try block with throw statement", "Error: ArgumentError" ,Error(thisError)+"" ); } test(); // leave this alone. this executes the test cases and // displays results.
//////////////////////////////////////////////////////////////////////////////// // // ADOBE SYSTEMS INCORPORATED // Copyright 2010 Adobe Systems Incorporated // All Rights Reserved. // // NOTICE: Adobe permits you to use, modify, and distribute this file // in accordance with the terms of the license agreement accompanying it. // //////////////////////////////////////////////////////////////////////////////// package spark.skins.mobile { import flash.display.DisplayObject; import mx.core.DPIClassification; import spark.components.Button; import spark.skins.mobile.supportClasses.MobileSkin; import spark.skins.mobile160.assets.HSliderThumb_normal; import spark.skins.mobile160.assets.HSliderThumb_pressed; import spark.skins.mobile240.assets.HSliderThumb_normal; import spark.skins.mobile240.assets.HSliderThumb_pressed; import spark.skins.mobile320.assets.HSliderThumb_normal; import spark.skins.mobile320.assets.HSliderThumb_pressed; /** * ActionScript-based skin for the HSlider thumb skin part in mobile applications. * * <p>Note that this particular implementation defines a hit zone which is larger than * the visible thumb for better usability on mobile screens.</p> * * @langversion 3.0 * @playerversion Flash 10 * @playerversion AIR 2.5 * @productversion Flex 4.5 */ public class HSliderThumbSkin extends MobileSkin { //-------------------------------------------------------------------------- // // Constructor // //-------------------------------------------------------------------------- /** * Constructor. * * @langversion 3.0 * @playerversion Flash 10 * @playerversion AIR 2.5 * @productversion Flex 4.5 * */ public function HSliderThumbSkin() { super(); // set the right assets and dimensions to use based on the screen density switch (applicationDPI) { case DPIClassification.DPI_320: { thumbImageWidth = 58; thumbImageHeight = 58; thumbNormalClass = spark.skins.mobile320.assets.HSliderThumb_normal; thumbPressedClass = spark.skins.mobile320.assets.HSliderThumb_pressed; hitZoneOffset = 10; hitZoneSideLength = 80; // chromeColor ellipse goes up to the thumb border chromeColorEllipseWidth = chromeColorEllipseHeight = 56; chromeColorEllipseX = 1; chromeColorEllipseY = 1; break; } case DPIClassification.DPI_240: { thumbImageWidth = 44; thumbImageHeight = 44; thumbNormalClass = spark.skins.mobile240.assets.HSliderThumb_normal; thumbPressedClass = spark.skins.mobile240.assets.HSliderThumb_pressed; hitZoneOffset = 10; hitZoneSideLength = 65; // chromeColor ellipse goes up to the thumb border chromeColorEllipseWidth = chromeColorEllipseHeight = 42; chromeColorEllipseX = chromeColorEllipseY = 1; break; } default: { // default DPI_160 thumbImageWidth = 29; thumbImageHeight = 29; thumbNormalClass = spark.skins.mobile160.assets.HSliderThumb_normal; thumbPressedClass = spark.skins.mobile160.assets.HSliderThumb_pressed; hitZoneOffset = 5; hitZoneSideLength = 40; // chromeColor ellipse goes up to the thumb border chromeColorEllipseWidth = chromeColorEllipseHeight = 29; chromeColorEllipseX = chromeColorEllipseY = 0; break; } } } //-------------------------------------------------------------------------- // // Properties // //-------------------------------------------------------------------------- /** * @copy spark.skins.spark.ApplicationSkin#hostComponent */ public var hostComponent:Button; //-------------------------------------------------------------------------- // // Variables // //-------------------------------------------------------------------------- // FXG thumb classes /** * Specifies the FXG class to use when the thumb is in the normal state * * @langversion 3.0 * @playerversion Flash 10 * @playerversion AIR 2.5 * @productversion Flex 4.5 */ protected var thumbNormalClass:Class; /** * Specifies the FXG class to use when the thumb is in the pressed state * * @langversion 3.0 * @playerversion Flash 10 * @playerversion AIR 2.5 * @productversion Flex 4.5 */ protected var thumbPressedClass:Class; /** * Specifies the DisplayObject to use when the thumb is in the normal state * * @langversion 3.0 * @playerversion Flash 10 * @playerversion AIR 2.5 * @productversion Flex 4.5 */ protected var thumbSkin_normal:DisplayObject; /** * Specifies the DisplayObject to use when the thumb is in the pressed state * * @langversion 3.0 * @playerversion Flash 10 * @playerversion AIR 2.5 * @productversion Flex 4.5 */ protected var thumbSkin_pressed:DisplayObject; /** * Specifies the current DisplayObject that should be shown * * @langversion 3.0 * @playerversion Flash 10 * @playerversion AIR 2.5 * @productversion Flex 4.5 */ protected var currentThumbSkin:DisplayObject; /** * Width of the overall thumb image * * @langversion 3.0 * @playerversion Flash 10 * @playerversion AIR 2.5 * @productversion Flex 4.5 */ protected var thumbImageWidth:int; /** * Height of the overall thumb image * * @langversion 3.0 * @playerversion Flash 10 * @playerversion AIR 2.5 * @productversion Flex 4.5 */ protected var thumbImageHeight:int; /** * Width of the chromeColor ellipse * * @langversion 3.0 * @playerversion Flash 10 * @playerversion AIR 2.5 * @productversion Flex 4.5 */ protected var chromeColorEllipseWidth:int; /** * Height of the chromeColor ellipse * * @langversion 3.0 * @playerversion Flash 10 * @playerversion AIR 2.5 * @productversion Flex 4.5 */ protected var chromeColorEllipseHeight:int; /** * X position of the chromeColor ellipse * * @langversion 3.0 * @playerversion Flash 10 * @playerversion AIR 2.5 * @productversion Flex 4.5 */ protected var chromeColorEllipseX:int; /** * Y position of the chromeColor ellipse * * @langversion 3.0 * @playerversion Flash 10 * @playerversion AIR 2.5 * @productversion Flex 4.5 */ protected var chromeColorEllipseY:int; /** * Length of the sizes of the hitzone (assumed to be square) * * @langversion 3.0 * @playerversion Flash 10 * @playerversion AIR 2.5 * @productversion Flex 4.5 */ protected var hitZoneSideLength:int; /** * Distance between the left edge of the hitzone and the left edge * of the thumb * * @langversion 3.0 * @playerversion Flash 10 * @playerversion AIR 2.5 * @productversion Flex 4.5 */ protected var hitZoneOffset:int; /** * @private * Remember which state is currently being displayed */ private var displayedState:String; //-------------------------------------------------------------------------- // // Overridden methods // //-------------------------------------------------------------------------- /** * @private */ override protected function commitCurrentState():void { if (currentState == "up") { // show the normal button if (!thumbSkin_normal) { thumbSkin_normal = new thumbNormalClass(); addChild(thumbSkin_normal); } else { thumbSkin_normal.visible = true; } currentThumbSkin = thumbSkin_normal; // hide the pressed button if (thumbSkin_pressed) thumbSkin_pressed.visible = false; } else if (currentState == "down") { // show the pressed button if (!thumbSkin_pressed) { thumbSkin_pressed = new thumbPressedClass(); addChild(thumbSkin_pressed); } else { thumbSkin_pressed.visible = true; } currentThumbSkin = thumbSkin_pressed; // hide the normal button if (thumbSkin_normal) thumbSkin_normal.visible = false; } displayedState = currentState; invalidateDisplayList(); } /** * @private */ override protected function measure():void { measuredWidth = thumbImageWidth; measuredHeight = thumbImageHeight; } /** * @private */ override protected function layoutContents(unscaledWidth:Number, unscaledHeight:Number):void { super.layoutContents(unscaledWidth, unscaledHeight); setElementSize(currentThumbSkin, unscaledWidth, unscaledHeight); setElementPosition(currentThumbSkin, 0, 0) } /** * @private */ override protected function drawBackground(unscaledWidth:Number, unscaledHeight:Number):void { super.drawBackground(unscaledWidth, unscaledHeight); graphics.beginFill(getStyle("chromeColor")); graphics.drawEllipse(chromeColorEllipseX, chromeColorEllipseY, chromeColorEllipseWidth, chromeColorEllipseHeight); graphics.endFill(); // put in a larger hit zone than the thumb graphics.beginFill(0xffffff, 0); graphics.drawRect(-hitZoneOffset, -hitZoneOffset, hitZoneSideLength, hitZoneSideLength); graphics.endFill(); } } }
/* * Copyright 2017 Tua Rua Ltd. * * 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 Terms * No part, or derivative of this Air Native Extensions's code is permitted * to be sold as the basis of a commercially packaged Air Native Extension which * undertakes the same purpose as this software. That is, a WebView for Windows, * OSX and/or iOS and/or Android. * All Rights Reserved. Tua Rua Ltd. */ package com.tuarua { import com.tuarua.fre.ANEError; import com.tuarua.utils.GUID; import com.tuarua.utils.os; import com.tuarua.webview.BackForwardList; import com.tuarua.webview.Settings; import com.tuarua.webview.TabDetails; import flash.desktop.NativeApplication; import flash.display.NativeWindowDisplayState; import flash.display.Stage; import flash.events.EventDispatcher; import flash.events.FullScreenEvent; import flash.events.KeyboardEvent; import flash.events.NativeWindowDisplayStateEvent; import flash.external.ExtensionContext; import flash.filesystem.File; import flash.geom.Rectangle; import flash.net.URLRequest; public class WebView extends EventDispatcher { private static const NAME:String = "WebViewANE"; private static var _isInited:Boolean = false; private var _viewPort:Rectangle; private static const AS_CALLBACK_PREFIX:String = "TRWV.as."; private var _visible:Boolean; private var _settings:Settings; private static var _shared:WebView; /** @private */ public function WebView() { if (_shared) { throw new Error(WebViewANEContext.NAME + " is a singleton, use .shared()"); } //noinspection JSUnusedLocalSymbols var tmp:ExtensionContext = WebViewANEContext.context; _shared = this; } public static function shared():WebView { if (!_shared) new WebView(); return _shared; } /** * * @param stage * @param viewPort * @param initialUrl Url to load when the view loads * @param settings * @param scaleFactor iOS, Android only * @param backgroundColor value of the view's background color in ARGB format.* * <p>Initialises the webView. N.B. The webView is set to visible = false initially.</p> */ public function init(stage:Stage, viewPort:Rectangle, initialUrl:URLRequest = null, settings:Settings = null, scaleFactor:Number = 1.0, backgroundColor:uint = 0xFFFFFFFF):void { if (viewPort == null) { throw new ArgumentError("viewPort cannot be null"); } WebViewANEContext.stage = stage; _viewPort = viewPort; if (os.isOSX) { NativeApplication.nativeApplication.activeWindow.addEventListener(NativeWindowDisplayStateEvent.DISPLAY_STATE_CHANGE, onWindowMiniMaxi, false, 1000); } stage.addEventListener(FullScreenEvent.FULL_SCREEN, onFullScreenEvent, false, 1000); _settings = settings; if (_settings == null) { _settings = new Settings(); } var ret:* = WebViewANEContext.context.call("init", initialUrl, _viewPort, _settings, scaleFactor, backgroundColor); if (ret is ANEError) throw ret as ANEError; if ((os.isWindows || os.isOSX)) { if (this.hasEventListener(KeyboardEvent.KEY_UP)) { WebViewANEContext.context.call("addEventListener", KeyboardEvent.KEY_UP); } if (this.hasEventListener(KeyboardEvent.KEY_DOWN)) { WebViewANEContext.context.call("addEventListener", KeyboardEvent.KEY_DOWN); } } _isInited = true; } override public function addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void { super.addEventListener(type, listener, useCapture, priority, useWeakReference); if (_isInited && (KeyboardEvent.KEY_UP == type || KeyboardEvent.KEY_DOWN == type) && (os.isWindows || os.isOSX)) { if (this.hasEventListener(type)) { WebViewANEContext.context.call("addEventListener", type); } } } override public function removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void { if (_isInited && (KeyboardEvent.KEY_UP == type || KeyboardEvent.KEY_DOWN == type) && (os.isWindows || os.isOSX)) { if (this.hasEventListener(type)) { WebViewANEContext.context.call("removeEventListener", type); } } super.removeEventListener(type, listener, useCapture); } /** * * @param functionName name of the function as called from Javascript * @param closure Actionscript function to call when functionName is called from Javascript * * Adds a callback in the webView. These should be added before .init() is called. * */ public function addCallback(functionName:String, closure:Function):void { if (functionName && closure != null) { WebViewANEContext.jsCallBacks[functionName] = closure; } else { throw new ArgumentError("functionName and/or closure cannot be null"); } } /** * * @param functionName name of the function to remove. This function should have been added via .addCallback() method * */ public function removeCallback(functionName:String):void { if (functionName) { WebViewANEContext.jsCallBacks[functionName] = null; } else { throw new ArgumentError("functionName cannot be null"); } } /** * * @param functionName name of the Javascript function to call * @param closure Actionscript function to call when Javascript functionName is called. If null then no * actionscript function is called, aka a 'fire and forget' call. * @param args arguments to send to the Javascript function * * <p>Call a javascript function.</p> * * @example * <listing version="3.0"> * // Logs to the console. No result expected. * webView.callJavascriptFunction("as_to_js",asToJsCallback,1,"a",77); * * public function asToJsCallback(jsResult:JavascriptResult):void { * trace("asToJsCallback"); * trace("jsResult.error", jsResult.error); * trace("jsResult.result", jsResult.result); * trace("jsResult.message", jsResult.message); * trace("jsResult.success", jsResult.success); * var testObject:* = jsResult.result; * trace(testObject); * } * </listing> * @example * <listing version="3.0"> * // Calls Javascript function passing 3 args. Javascript function returns an * // object which is automatically mapped to an * // Actionscript Object * webView.callJavascriptFunction("console.log",null,"hello console. The is AIR"); * * // function in HTML page * function as_to_js(numberA, stringA, numberB, obj) { * var person = { * name: "Jim Cowart", * response: { * name: "Chattanooga", * population: 167674 * } * }; * return person; * } * </listing> */ public function callJavascriptFunction(functionName:String, closure:Function = null, ...args):void { if (functionName == null) { throw new ArgumentError("functionName cannot be null"); } if (!safetyCheck()) return; var ret:*; var finalArray:Array = []; for each (var arg:* in args) { finalArray.push(JSON.stringify(arg)); } var js:String = functionName + "(" + finalArray.toString() + ");"; if (closure != null) { WebViewANEContext.asCallBacks[AS_CALLBACK_PREFIX + functionName] = closure; ret = WebViewANEContext.context.call("callJavascriptFunction", js, AS_CALLBACK_PREFIX + functionName); } else { ret = WebViewANEContext.context.call("callJavascriptFunction", js, null); } if (ret is ANEError) throw ret as ANEError; } //to insert script or run some js, no closure fire and forget /** * * @param code Javascript string to evaluate. * @param closure Actionscript function to call when the Javascript string is evaluated. If null then no * actionscript function is called, aka a 'fire and forget' call. * * @example * <listing version="3.0"> * // Set the body background to yellow. No result expected * webView.evaluateJavascript('document.getElementsByTagName("body")[0].style.backgroundColor = "yellow";'); * </listing> * @example * <listing version="3.0"> * // Retrieve contents of div. Result is returned to Actionscript function 'onJsEvaluated' * webView.evaluateJavascript("document.getElementById('output').innerHTML;", onJsEvaluated) * private function onJsEvaluated(jsResult:JavascriptResult):void { * trace("innerHTML of div is:", jsResult.result); * } * </listing> * */ public function evaluateJavascript(code:String, closure:Function = null):void { if (code == null) { throw new ArgumentError("code cannot be null"); } if (!safetyCheck()) return; var ret:*; if (closure != null) { var guid:String = GUID.create(); WebViewANEContext.asCallBacks[AS_CALLBACK_PREFIX + guid] = closure; ret = WebViewANEContext.context.call("evaluateJavaScript", code, AS_CALLBACK_PREFIX + guid); } else { ret = WebViewANEContext.context.call("evaluateJavaScript", code, null); } if (ret is ANEError) { throw ret as ANEError; } } /** @private */ private function onWindowMiniMaxi(event:NativeWindowDisplayStateEvent):void { /* !! Needed for OSX, restores webView when we restore from minimized state */ if (event.beforeDisplayState == NativeWindowDisplayState.MINIMIZED) { visible = false; visible = true; } } private function onFullScreenEvent(event:FullScreenEvent):void { if (!safetyCheck()) return; WebViewANEContext.context.call("onFullScreen", event.fullScreen); } /** * @param url */ public function load(url:URLRequest):void { if (!safetyCheck()) return; var ret:* = WebViewANEContext.context.call("load", url); if (ret is ANEError) throw ret as ANEError; } /** * * @param html HTML provided as a string * @param baseUrl url which will display as the address * * Loads a HTML string into the webView. * */ public function loadHTMLString(html:String, baseUrl:URLRequest = null):void { if (!safetyCheck()) return; var ret:* = WebViewANEContext.context.call("loadHTMLString", html, baseUrl); if (ret is ANEError) throw ret as ANEError; } /** * * @param url full path to the file on the local file system * @param allowingReadAccessTo path to the root of the document * * Loads a file from the local file system into the webView. * */ public function loadFileURL(url:String, allowingReadAccessTo:String):void { if (!safetyCheck()) return; var ret:* = WebViewANEContext.context.call("loadFileURL", url, allowingReadAccessTo); if (ret is ANEError) throw ret as ANEError; } /** * Reloads the current page. */ public function reload():void { if (!safetyCheck()) return; WebViewANEContext.context.call("reload"); } /** * Stops loading the current page. */ public function stopLoading():void { if (!safetyCheck()) return; WebViewANEContext.context.call("stopLoading"); } /** * Navigates back. */ public function goBack():void { if (!safetyCheck()) return; WebViewANEContext.context.call("goBack"); } /** * Navigates forward. */ public function goForward():void { if (!safetyCheck()) return; WebViewANEContext.context.call("goForward"); } /** * * @param offset Navigate forward (eg +1) or back (eg -1) * */ public function go(offset:int = 1):void { if (!safetyCheck()) return; WebViewANEContext.context.call("go", offset); } /** * * @return * <p><b>Ignored on Windows and Android.</b></p> */ public function backForwardList():BackForwardList { if (!safetyCheck()) return new BackForwardList(); return WebViewANEContext.context.call("backForwardList") as BackForwardList; } /** * Clears any persistent requestHeaders added to URLRequest */ public function clearRequestHeaders():void { if (!safetyCheck()) return; WebViewANEContext.context.call("clearRequestHeaders"); } /** * Forces a reload of the page (i.e. ctrl F5) */ public function reloadFromOrigin():void { if (!safetyCheck()) return; WebViewANEContext.context.call("reloadFromOrigin"); } /** * Clears the browser cache. Available on iOS, OSX, Android only. * <p><b>Ignored on Windows.</b></p> * <p>You cannot clear the cache on Windows while CEF is running. This is a known limitation. * You can delete the contents of the value of your settings.cef.cachePath using Actionscript * only before you call .init(). Calling after .dispose() may cause file locks as the files may * still be 'owned' by the CEF process</p> * */ public function clearCache():void { //Windows is special case. if (os.isWindows) { if (_isInited) { trace("[" + NAME + "] You cannot clear the cache on Windows while CEF is running. This is a known " + "limitation. You can only call this method after .dispose() is called"); return; } try { var cacheFolder:File = File.applicationDirectory.resolvePath(_settings.cef.cachePath); if (cacheFolder.exists) { var files:Array = cacheFolder.getDirectoryListing(); for (var i:uint = 0; i < files.length; i++) { var file:File = files[i]; if (file.isDirectory) { file.deleteDirectory(true); } else { file.deleteFile(); } } } } catch (e:Error) { trace("[" + NAME + "] unable to delete cache files"); } return; } if (!safetyCheck()) return; WebViewANEContext.context.call("clearCache"); } /** * * @return Whether the page allows magnification functionality * <b>Ignored on iOS.</b> */ public function allowsMagnification():Boolean { if (!safetyCheck()) return false; return WebViewANEContext.context.call("allowsMagnification") as Boolean; } /** * Zooms in * */ public function zoomIn():void { if (!safetyCheck()) return; WebViewANEContext.context.call("zoomIn"); } /** Zooms out*/ public function zoomOut():void { if (!safetyCheck()) return; WebViewANEContext.context.call("zoomOut"); } /** Windows + OSX only */ public function addTab(initialUrl:URLRequest = null):void { if (!safetyCheck()) return; var ret:* = WebViewANEContext.context.call("addTab", initialUrl); if (ret is ANEError) throw ret as ANEError; } /** Windows + OSX only*/ public function closeTab(index:int):void { if (!safetyCheck()) return; var ret:* = WebViewANEContext.context.call("closeTab", index); if (ret is ANEError) throw ret as ANEError; } /**Windows + OSX only*/ public function set currentTab(value:int):void { if (!safetyCheck()) return; var ret:* = WebViewANEContext.context.call("setCurrentTab", value); if (ret is ANEError) throw ret as ANEError; } /**Windows + OSX only*/ public function get currentTab():int { if (!safetyCheck()) return 0; return int(WebViewANEContext.context.call("getCurrentTab")); } public function get tabDetails():Vector.<TabDetails> { if (!safetyCheck()) return new Vector.<TabDetails>(); var ret:* = WebViewANEContext.context.call("getTabDetails"); if (ret is ANEError) throw ret as ANEError; return Vector.<TabDetails>(ret); } /** * Shows the Chromium dev tools on Windows * <p>Enables Inspect Element on right click on OSX</p> * <p>On Android use Chrome on connected computer and navigate to chrome://inspect</p> */ public function showDevTools():void { if (!safetyCheck()) return; WebViewANEContext.context.call("showDevTools"); } /** * Close the Chromium dev tools * <p>Disables Inspect Element on right click on OSX</p> * <p>On Android disconnects from chrome://inspect</p> */ public function closeDevTools():void { if (!safetyCheck()) return; WebViewANEContext.context.call("closeDevTools"); } public function focus():void { if (!safetyCheck()) return; WebViewANEContext.context.call("focus"); } /** * * @param code Javascript to inject, if any. * @param scriptUrl is the URL where the script in question can be found, if any. Windows only * @param startLine is the base line number to use for error reporting. Windows only * * <p>Specify either code or scriptUrl. These are injected into the main Frame when it is loaded. Call before * load() method</p> * <p><b>Ignored on Android.</b></p> */ public function injectScript(code:String = null, scriptUrl:String = null, startLine:uint = 0):void { if (code == null && scriptUrl == null) { throw new ArgumentError("code and scriptUrl cannot be null"); } var ret:* = WebViewANEContext.context.call("injectScript", code, scriptUrl, startLine); if (ret is ANEError) throw ret as ANEError; } /** * Prints the webView. * <p><b>Windows and macOS 11.0+ only.</b></p> */ public function print():void { WebViewANEContext.context.call("print"); } /** * @param savePath path to save the pdf to. * * Prints the webView to a pdf. * <p><b>Windows and macOS 11.0+ only.</b></p> */ public function printToPdf(savePath:String):void { if (!safetyCheck()) return; var ret:* = WebViewANEContext.context.call("printToPdf", savePath); if (ret is ANEError) throw ret as ANEError; } /** * Deletes all cookies */ public function deleteCookies():void { if (!safetyCheck()) return; var ret:* = WebViewANEContext.context.call("deleteCookies"); if (ret is ANEError) throw ret as ANEError; } /** * Captures the webView to BitmapData. * * @param onComplete function(result:BitmapData) * @param cropTo optionally crops to the supplied Rectangle */ public function capture(onComplete:Function, cropTo:Rectangle = null):void { if (!safetyCheck()) return; WebViewANEContext.onCaptureComplete = onComplete; var ret:* = WebViewANEContext.context.call("capture", cropTo); if (ret is ANEError) throw ret as ANEError; } /** * @param value */ public function set visible(value:Boolean):void { if (_visible == value) return; _visible = value; if (!safetyCheck()) return; var ret:* = WebViewANEContext.context.call("setVisible", value); if (ret is ANEError) throw ret as ANEError; } /** * @return whether the webView is visible */ public function get visible():Boolean { return _visible; } public function get viewPort():Rectangle { return _viewPort; } /** * @param value * Sets the viewPort of the webView. */ public function set viewPort(value:Rectangle):void { if (viewPort == null) { throw new ArgumentError("viewPort cannot be null"); } _viewPort = value; if (!safetyCheck()) return; var ret:* = WebViewANEContext.context.call("setViewPort", _viewPort); if (ret is ANEError) throw ret as ANEError; } /** * This cleans up the webview and all related processes. * <p><b>It is important to call this when the app is exiting.</b></p> * @example * <listing version="3.0"> * NativeApplication.nativeApplication.addEventListener(flash.events.Event.EXITING, onExiting); * private function onExiting(event:Event):void { * WebView.dispose(); * }</listing> * */ /** Disposes the ANE */ public static function dispose():void { if (WebViewANEContext.context) { WebViewANEContext.dispose(); } _isInited = false; } /** @private */ private function safetyCheck():Boolean { if (!_isInited) { trace("You need to init first"); return false; } return true; } } }
package { import flash.display.MovieClip; import flash.display.Stage; import flash.events.Event; public class McBiDeFour extends MCBase { } }
package gs.display.tabbar { /** * The ITabView interface defines a contract * for views that work with the TabBar class. */ public interface ITabView { /** * A query method that the TabBar uses to * decide if switching to another view - other * than the current view, is allowed. * * <p>You need to return true, to allow a switch * to another view, or false to deny the switch.</p> * * <p>This can be useful in situation where forms * are being used, and you need to make sure a * form is filled out before switching to the next * view.</p> */ function shouldActivateOther():Boolean; /** * Called if the "shouldActivateOther" method * returns false, indicating that a view switch * was not allowed. */ function couldNotActivateOther():void; /** * Tells the tab bar to wait for an event * to fire, before switching to the next view. * * <p>Return null to not wait, or any string, * as the event to wait for.</p> */ function waitForEvent():String; /** * Tell's the view that the tab manager is waiting * for the event specified from waitForEvent(). */ function tabBarIsWaiting():void; /** * Show the view. */ function show():void; /** * Hide the view. */ function hide():void; /** * A hook into after the view is shown, * which can be used to select default * form elements or any display object. */ function select():void; /** * A hook into after the view is hidden, * which can be used to deselect form fields * or any display objects. */ function deselect():void; } }
package { public class Player { public var hand; public var clickedCard = null; public var cardIsPlayable; var parent; var game; var table; var deck; public var whoAmI; var emptyHand; var timerLength; var endOfTrickTimer; public var endOfTrickTimerLength; public function Player() { super(); this.timerLength = 1500; this.endOfTrickTimerLength = 1000; } public function setPriority() : * { var _loc1_:* = 0; while(_loc1_ < 5) { if(this.cardIsPlayable[_loc1_] && this.hand[_loc1_] != null) { this.hand[_loc1_].priority = this.hand[_loc1_].value; if(this.game.GiveTrumpSuit() == this.hand[_loc1_].suit) { this.hand[_loc1_].priority = this.hand[_loc1_].priority + 10; if(this.hand[_loc1_].value == 11) { this.hand[_loc1_].priority = 26; } } if((this.game.GiveTrumpSuit() == 3 - this.hand[_loc1_].suit || 3 - this.game.GiveTrumpSuit() == this.hand[_loc1_].suit) && this.hand[_loc1_].value == 11) { this.hand[_loc1_].suit = this.game.GiveTrumpSuit(); this.hand[_loc1_].priority = 25; } } _loc1_++; } } public function GetCard(param1:Card) : * { var _loc2_:* = new Array(300,this.parent.stage.stageWidth / 2 - 105,this.parent.stage.stageWidth - 190); var _loc3_:* = new Array(this.parent.stage.stageHeight / 2 - 225,5,this.parent.stage.stageHeight / 2 - 225); var _loc4_:* = this.parent.stage.stageWidth / 2 - 105; var _loc5_:* = this.parent.stage.stageHeight - 130; var _loc6_:* = -1; var _loc7_:* = 4; while(_loc7_ >= 0) { if(this.hand[_loc7_] == null) { _loc6_ = _loc7_; break; } _loc7_--; } if(_loc6_ != -1) { this.hand[_loc6_] = param1; if(this.whoAmI == 0) { if(this.game.debug) { this.hand[_loc6_].sprite.x = _loc2_[0]; this.hand[_loc6_].sprite.y = _loc3_[0] + _loc7_ * 126; } else { this.emptyHand[_loc6_].x = _loc2_[0]; this.emptyHand[_loc6_].y = _loc3_[0] + _loc7_ * 90; } } if(this.whoAmI == 1) { if(this.game.debug) { this.hand[_loc6_].sprite.x = _loc2_[1] + _loc7_ * 90; this.hand[_loc6_].sprite.y = _loc3_[1]; } else { this.emptyHand[_loc6_].x = _loc2_[1] + _loc7_ * 90; this.emptyHand[_loc6_].y = _loc3_[1]; } } if(this.whoAmI == 2) { if(this.game.debug) { this.hand[_loc6_].sprite.x = _loc2_[2]; this.hand[_loc6_].sprite.y = _loc3_[2] + _loc7_ * 126; } else { this.emptyHand[_loc6_].x = _loc2_[2]; this.emptyHand[_loc6_].y = _loc3_[2] + _loc7_ * 90; } } if(this.whoAmI == 3) { this.hand[_loc6_].sprite.x = _loc4_ + _loc7_ * 90; this.hand[_loc6_].sprite.y = _loc5_; } if(this.game.debug || this.whoAmI == 3) { this.hand[_loc6_].sprite.visible = true; } else { this.emptyHand[_loc6_].visible = true; } } } } }
package feathers.extension.ahhenderson.data.service.mvc.actor { import ahhenderson.core.mvc.interfaces.IMediatorActor; import feathers.extension.ahhenderson.data.service.helpers.DS_FacadeHelper; import feathers.extension.ahhenderson.mvc.actor.FeathersMediator; public class DataServiceMediator extends FeathersMediator implements IMediatorActor { include "_BaseDataServiceActor.inc" public function DataServiceMediator( name:String = null, component:Object = null ) { super( name, component ); } override protected function setMessageFilter():void { DS_FacadeHelper.registerMediator( this, _messageFilter ); } } }
package _-3J { public class _-Km extends Object { public function _-Km(param1:Object = null) { var _loc3_:* = true; if(_loc3_) { super(); if(!_loc2_) { if(param1 != null) { if(_loc3_) { } } } this.update(param1); } } public var cash:int = 0; public var score:int = 0; public var level:int = 0; public var _-CC:String = ""; public var _-6A:int = 0; public var _-79:int = 0; public var _-4q:int = 0; public var _-I3:int = 0; public var engine:int = 0; public var _-E0:int = 0; public var _-4g:int = 0; public var _-Dp:int = 0; public var _-71:int = 0; public function _-1Z(param1:Number) : Boolean { /* * Decompilation error * Code may be obfuscated * Error type: EmptyStackException */ throw new flash.errors.IllegalOperationError("Not decompiled due to error"); } public function update(param1:Object) : void { var _loc4_:* = false; var _loc5_:* = true; var _loc2_:Array = ["cash","score","level"]; while(_loc3_ < _loc2_.length) { if(param1[_loc2_[_loc3_]] != undefined) { if(!_loc4_) { this[_loc2_[_loc3_]] = param1[_loc2_[_loc3_]]; if(!(_loc5_ || (_loc3_))) { continue; } } else { continue; } } _loc3_++; if(!_loc4_) { continue; } break; } } } }
// Action script... // [Initial MovieClip Action of sprite 20510] #initclip 31 if (!dofus.managers.TutorialServersManager) { if (!dofus) { _global.dofus = new Object(); } // end if if (!dofus.managers) { _global.dofus.managers = new Object(); } // end if var _loc1 = (_global.dofus.managers.TutorialServersManager = function () { super(); dofus.managers.TutorialServersManager._sSelf = this; }).prototype; (_global.dofus.managers.TutorialServersManager = function () { super(); dofus.managers.TutorialServersManager._sSelf = this; }).getInstance = function () { return (dofus.managers.TutorialServersManager._sSelf); }; _loc1.initialize = function (oAPI) { super.initialize(oAPI, "tutorials", "tutorials/"); }; _loc1.loadTutorial = function (sID) { this.loadData(sID + ".swf"); }; _loc1.onComplete = function (mc) { var _loc3 = new dofus.datacenter.Tutorial(mc); this.addToQueue({object: this.api.kernel.TutorialManager, method: this.api.kernel.TutorialManager.start, params: [_loc3]}); }; _loc1.onFailed = function () { this.addToQueue({object: this.api.kernel, method: this.api.kernel.showMessage, params: [undefined, this.api.lang.getText("NO_TUTORIALDATA_FILE"), "ERROR_CHAT"]}); this.api.kernel.TutorialManager.terminate(0); }; ASSetPropFlags(_loc1, null, 1); (_global.dofus.managers.TutorialServersManager = function () { super(); dofus.managers.TutorialServersManager._sSelf = this; })._sSelf = null; } // end if #endinitclip
package SJ.Game.kfcontend { import SJ.Game.CJModulePopupBase; import SJ.Game.layer.CJLayerManager; import SJ.Game.layer.CJLoadingLayer; import engine_starling.utils.AssetManagerUtil; /** * 开服争霸 * @author bianbo * */ public class CJKFContendModule extends CJModulePopupBase { // private var _kfLayer:CJKFContendLayer; public function CJKFContendModule() { super("CJKFContendModule"); } override public function getPreloadResource():Array { return [ // "resourceui_kfcontend.xml" ]; } override protected function _onEnter(params:Object=null):void { super._onEnter(params); //添加加载动画 CJLoadingLayer.show(); AssetManagerUtil.o.loadPrepareInQueueWithArray("CJKFContendResource", getPreloadResource()); AssetManagerUtil.o.loadQueue(function (r:Number):void { //设置加载动画的进度 CJLoadingLayer.loadingprogress = r; if(r == 1) { //移除加载动画 CJLoadingLayer.close(); _kfLayer = new CJKFContendLayer(); CJLayerManager.o.addToModuleLayerFadein(_kfLayer); } }); } override protected function _onExit(params:Object=null):void { super._onExit(params); CJLayerManager.o.removeFromLayerFadeout(_kfLayer); AssetManagerUtil.o.disposeAssetsByGroup("CJKFContendResource"); _kfLayer = null; } override protected function _onInit(params:Object=null):void { // TODO Auto Generated method stub super._onInit(params); } } }
package com.does.lotte.pacman.steps { import com.does.lotte.global.Tracking; import com.does.lotte.controller.BtnController; import com.does.lotte.events.GameEvent; import flash.display.FrameLabel; import flash.display.MovieClip; import flash.display.Sprite; import flash.events.Event; import flash.events.MouseEvent; import flash.external.ExternalInterface; /** * @author chaesumin */ public class Main extends MovieClip { public var startBtn : Sprite; public var skip : Sprite; public function Main() { addEventListener(Event.ADDED_TO_STAGE, initAddStage); addEventListener(Event.REMOVED_FROM_STAGE, initRemoveStage); init(); } private function initAddStage(event : Event) : void { removeEventListener(Event.ADDED_TO_STAGE, initAddStage); start(); } private function initRemoveStage(event : Event) : void { removeEventListener(Event.REMOVED_FROM_STAGE, initRemoveStage); } private function init() : void { } private function start() : void { skip.buttonMode = true; skip.addEventListener(MouseEvent.CLICK, skipClick); if (FrameLabel(currentLabels[0]).name == "loop") { addFrameScript(FrameLabel(currentLabels[0]).frame - 1, inMotionScript); } } private function inMotionScript() : void { startBtn.buttonMode = true; startBtn.addEventListener(MouseEvent.CLICK, startBtnClick); BtnController.down(MovieClip(startBtn)); } private function skipClick(event : MouseEvent) : void { gotoAndPlay("loop"); } private function startBtnClick(event : MouseEvent) : void { Tracking.track("click", "Game_Start"); var isLogin : String = ExternalInterface.call("GAME.login"); if(isLogin == "true"){ dispatchEvent(new GameEvent(GameEvent.INIT_GAME, true)); }else{ } } } }
/******************************************************************************************************************************************* * This is an automatically generated class. Please do not modify it since your changes may be lost in the following circumstances: * - Members will be added to this class whenever an embedded worker is added. * - Members in this class will be renamed when a worker is renamed or moved to a different package. * - Members in this class will be removed when a worker is deleted. *******************************************************************************************************************************************/ package { import flash.utils.ByteArray; public class Workers { [Embed(source="../workerswfs/com/worker/CryptWorker.swf", mimeType="application/octet-stream")] private static var com_worker_CryptWorker_ByteClass:Class; [Embed(source="../workerswfs/com/worker/DispatchWorker.swf", mimeType="application/octet-stream")] private static var com_worker_DispatchWorker_ByteClass:Class; public static function get com_worker_CryptWorker():ByteArray { return new com_worker_CryptWorker_ByteClass(); } public static function get com_worker_DispatchWorker():ByteArray { return new com_worker_DispatchWorker_ByteClass(); } } }
//////////////////////////////////////////////////////////////////////////////// // // 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.supportClasses { import flash.display.DisplayObject; import flash.events.Event; import flash.events.FocusEvent; import flash.geom.Point; import mx.core.DPIClassification; import mx.core.mx_internal; import spark.components.supportClasses.IStyleableEditableText; import spark.components.supportClasses.SkinnableTextBase; import spark.components.supportClasses.StyleableStageText; import spark.components.supportClasses.StyleableTextField; import spark.core.IDisplayText; import spark.skins.mobile120.assets.TextInput_border; import spark.skins.mobile160.assets.TextInput_border; import spark.skins.mobile240.assets.TextInput_border; import spark.skins.mobile320.assets.TextInput_border; import spark.skins.mobile480.assets.TextInput_border; import spark.skins.mobile640.assets.TextInput_border; use namespace mx_internal; /** * ActionScript-based skin for text input controls in mobile applications. * * @langversion 3.0 * @playerversion AIR 3.0 * @productversion Flex 4.6 */ public class StageTextSkinBase extends MobileSkin { //-------------------------------------------------------------------------- // // Constructor // //-------------------------------------------------------------------------- /** * Constructor. * * @langversion 3.0 * @playerversion AIR 3.0 * @productversion Flex 4.6 * */ public function StageTextSkinBase() { super(); switch (applicationDPI) { case DPIClassification.DPI_640: { // Note provisional may need changes borderClass = spark.skins.mobile640.assets.TextInput_border; layoutCornerEllipseSize = 48; measuredDefaultWidth = 1200; measuredDefaultHeight = 132; layoutBorderSize = 3; break; } case DPIClassification.DPI_480: { // Note provisional may need changes borderClass = spark.skins.mobile480.assets.TextInput_border; layoutCornerEllipseSize = 32; measuredDefaultWidth = 880; measuredDefaultHeight = 100; layoutBorderSize = 2; break; } case DPIClassification.DPI_320: { borderClass = spark.skins.mobile320.assets.TextInput_border; layoutCornerEllipseSize = 24; measuredDefaultWidth = 600; measuredDefaultHeight = 66; layoutBorderSize = 2; break; } case DPIClassification.DPI_240: { borderClass = spark.skins.mobile240.assets.TextInput_border; layoutCornerEllipseSize = 12; measuredDefaultWidth = 440; measuredDefaultHeight = 50; layoutBorderSize = 1; break; } case DPIClassification.DPI_120: { // Note provisional may need changes borderClass = spark.skins.mobile120.assets.TextInput_border; layoutCornerEllipseSize = 6; measuredDefaultWidth = 220; measuredDefaultHeight = 25; layoutBorderSize = 1; break; } default: { borderClass = spark.skins.mobile160.assets.TextInput_border; layoutCornerEllipseSize = 12; measuredDefaultWidth = 300; measuredDefaultHeight = 33; layoutBorderSize = 1; break; } } } //-------------------------------------------------------------------------- // // Graphics variables // //-------------------------------------------------------------------------- /** * Defines the border. * * @langversion 3.0 * @playerversion AIR 3.0 * @productversion Flex 4.6 */ protected var borderClass:Class; //-------------------------------------------------------------------------- // // Layout variables // //-------------------------------------------------------------------------- /** * Defines the corner radius. * * @langversion 3.0 * @playerversion AIR 3.0 * @productversion Flex 4.6 */ protected var layoutCornerEllipseSize:uint; /** * Defines the border's thickness. * * @langversion 3.0 * @playerversion AIR 3.0 * @productversion Flex 4.6 */ protected var layoutBorderSize:uint; //-------------------------------------------------------------------------- // // Variables // //-------------------------------------------------------------------------- /** * @private * * Instance of the border graphics. */ protected var border:DisplayObject; private var borderVisibleChanged:Boolean = false; /** * @private * * Multiline flag. */ protected var multiline:Boolean = false; //-------------------------------------------------------------------------- // // Skin parts // //-------------------------------------------------------------------------- /** * textDisplay skin part. * * @langversion 3.0 * @playerversion AIR 3.0 * @productversion Flex 4.6 */ public var textDisplay:IStyleableEditableText; [Bindable] /** * Bindable promptDisplay skin part. Bindings fire when promptDisplay is * removed and added for proper updating by the SkinnableTextBase. * * @langversion 3.0 * @playerversion AIR 3.0 * @productversion Flex 4.6 */ public var promptDisplay:IDisplayText; //-------------------------------------------------------------------------- // // Overridden methods // //-------------------------------------------------------------------------- /** * @private */ override protected function createChildren():void { super.createChildren(); if (!textDisplay) { textDisplay = createTextDisplay(); textDisplay.editable = true; textDisplay.styleName = this; this.addChild(DisplayObject(textDisplay)); } if (!border) { border = new borderClass(); addChild(border); } } /** Could be overridden by subclasses * * @return instance of IStyleableEditableText */ protected function createTextDisplay():IStyleableEditableText { return new StyleableStageText(multiline); } /** * @private */ override protected function commitProperties():void { super.commitProperties(); if (borderVisibleChanged) { borderVisibleChanged = false; var borderVisible:Boolean = getStyle("borderVisible"); if (borderVisible && !border) { border = new borderClass(); addChild(border); } else if (!borderVisible && border) { removeChild(border); border = null; } } } /** * @private */ override protected function drawBackground(unscaledWidth:Number, unscaledHeight:Number):void { super.drawBackground(unscaledWidth, unscaledHeight); var borderSize:uint = (border) ? layoutBorderSize : 0; var borderWidth:uint = borderSize * 2; var contentBackgroundColor:uint = getStyle("contentBackgroundColor"); var contentBackgroundAlpha:Number = getStyle("contentBackgroundAlpha"); if (isNaN(contentBackgroundAlpha)) contentBackgroundAlpha = 1; // Draw the contentBackgroundColor graphics.beginFill(contentBackgroundColor, contentBackgroundAlpha); graphics.drawRoundRect(borderSize, borderSize, unscaledWidth - borderWidth, unscaledHeight - borderWidth, layoutCornerEllipseSize, layoutCornerEllipseSize); graphics.endFill(); } /** * @private */ override public function styleChanged(styleProp:String):void { var allStyles:Boolean = !styleProp || styleProp == "styleName"; if (allStyles || styleProp == "borderVisible") { borderVisibleChanged = true; invalidateProperties(); } if (allStyles || styleProp.indexOf("padding") == 0) { invalidateDisplayList(); } super.styleChanged(styleProp); } /** * @private */ override protected function commitCurrentState():void { super.commitCurrentState(); alpha = currentState.indexOf("disabled") == -1 ? 1 : 0.5; var showPrompt:Boolean = currentState.indexOf("WithPrompt") != -1; if (showPrompt && !promptDisplay) { promptDisplay = createPromptDisplay(); promptDisplay.addEventListener(FocusEvent.FOCUS_IN, promptDisplay_focusInHandler); } else if (!showPrompt && promptDisplay) { promptDisplay.removeEventListener(FocusEvent.FOCUS_IN, promptDisplay_focusInHandler); removeChild(promptDisplay as DisplayObject); promptDisplay = null; } invalidateDisplayList(); } /** * @private */ override protected function layoutContents(unscaledWidth:Number, unscaledHeight:Number):void { super.layoutContents(unscaledWidth, unscaledHeight); // position & size border if (border) { setElementSize(border, unscaledWidth, unscaledHeight); setElementPosition(border, 0, 0); } } //-------------------------------------------------------------------------- // // Methods // //-------------------------------------------------------------------------- /** * @private * Create a control appropriate for displaying the prompt text in a mobile * input field. */ protected function createPromptDisplay():IDisplayText { var prompt:StyleableTextField = StyleableTextField(createInFontContext(StyleableTextField)); prompt.styleName = this; prompt.editable = false; prompt.mouseEnabled = false; prompt.useTightTextBounds = false; // StageText objects appear in their own layer on top of the display // list. So, even though this prompt may be created after the StageText // for textDisplay, textDisplay will still be on top. addChild(prompt); return prompt; } /** * @private * Utility function used by subclasses' measure functions to measure their * text host components. */ protected function measureTextComponent(hostComponent:SkinnableTextBase):void { var paddingLeft:Number = getStyle("paddingLeft"); var paddingRight:Number = getStyle("paddingRight"); var paddingTop:Number = getStyle("paddingTop"); var paddingBottom:Number = getStyle("paddingBottom"); var textHeight:Number = getStyle("fontSize"); if (textDisplay) textHeight = getElementPreferredHeight(textDisplay); // width is based on maxChars (if set) if (hostComponent && hostComponent.maxChars) { // Grab the fontSize and subtract 2 as the pixel value for each character. // This is just an approximation, but it appears to be a reasonable one // for most input and most font. var characterWidth:int = Math.max(1, (textHeight - 2)); measuredWidth = (characterWidth * hostComponent.maxChars) + paddingLeft + paddingRight; } measuredHeight = paddingTop + textHeight + paddingBottom; } //-------------------------------------------------------------------------- // // Event handlers // //-------------------------------------------------------------------------- /** * If the prompt is focused, we need to move focus to the textDisplay * StageText. This needs to happen outside of the process of setting focus * to the prompt, so we use callLater to do that. */ private function focusTextDisplay():void { textDisplay.setFocus(); } private function promptDisplay_focusInHandler(event:FocusEvent):void { callLater(focusTextDisplay); } } }
package ui { public class BuffItem extends Box implements IAnimatable { private var buffInfo:BuffInfo; public function BuffItem() { super(); } public function setBuffInfo(buffInfo:BuffInfo):void{ this.buffInfo = buffInfo; JugglerManager.fourJuggler.add(this); } public function advanceTime(time:Number):void{ onFrame(); } private function onFrame():void{ } override public function get width():Number{ return getAllChildrenSize().x; } override public function get height():Number{ return getAllChildrenSize().y; } } }
/* Copyright (c) 2012 Josh Tynjala Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package feathers.controls { import flash.errors.IllegalOperationError; import starling.display.DisplayObject; /** * Data for an individual screen that will be used by a <code>ScreenNavigator</code> * object. * * @see feathers.controls.ScreenNavigator * * @author Josh Tynjala (joshblog.net) */ public class ScreenNavigatorItem { /** * Creates a new ScreenNavigatorItem instance. * * @param screen Sets the screen property. * @param events Sets the events property. * * @see #screen * @see #events */ public function ScreenNavigatorItem(screen:Object, events:Object = null, initializer:Object = null) { this.screen = screen; this.events = events ? events : {}; this.initializer = initializer ? initializer : {}; } /** * A DisplayObject instance or a Class that creates a display object. */ public var screen:Object; /** * A hash of events to which the ScreenNavigator will listen. Keys in * the hash are event types, and values are one of two possible types. * If the value is a String, it must refer to a screen ID for the * ScreenNavigator to display. If the value is a Function, it must * be a listener for the screen's event. */ public var events:Object; /** * A hash of properties to set on the screen. */ public var initializer:Object; /** * Creates and instance of the screen type (or uses the screen directly * if it isn't a class). */ internal function getScreen():DisplayObject { var screenInstance:DisplayObject; if(this.screen is Class) { var ScreenType:Class = Class(this.screen); screenInstance = new ScreenType(); } else if(this.screen is DisplayObject) { screenInstance = DisplayObject(this.screen); } else { throw new IllegalOperationError("ScreenNavigatorItem \"screen\" must be a Class or a display object."); } if(this.initializer) { for(var property:String in this.initializer) { screenInstance[property] = this.initializer[property]; } } return screenInstance; } } }
package cmodule.lua_wrapper { const __2E_str30379:int = gstaticInitter.alloc(7,1); }
/* Adobe Systems Incorporated(r) Source Code License Agreement Copyright(c) 2005 Adobe Systems Incorporated. All rights reserved. Please read this Source Code License Agreement carefully before using the source code. Adobe Systems Incorporated grants to you a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license, to reproduce, prepare derivative works of, publicly display, publicly perform, and distribute this source code and such derivative works in source or object code form without any attribution requirements. The name "Adobe Systems Incorporated" must not be used to endorse or promote products derived from the source code without prior written permission. You agree to indemnify, hold harmless and defend Adobe Systems Incorporated from and against any loss, damage, claims or lawsuits, including attorney's fees that arise or result from your use or distribution of the source code. THIS SOURCE CODE IS PROVIDED "AS IS" AND "WITH ALL FAULTS", WITHOUT ANY TECHNICAL SUPPORT OR ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ALSO, THERE IS NO WARRANTY OF NON-INFRINGEMENT, TITLE OR QUIET ENJOYMENT. IN NO EVENT SHALL MACROMEDIA OR ITS SUPPLIERS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOURCE CODE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package com.adobe.xml.syndication.atom { import com.adobe.xml.syndication.Namespaces; import com.adobe.utils.DateUtil; import com.adobe.xml.syndication.ParsingTools; import com.adobe.xml.syndication.NewsFeedElement; /** * Class that represents a feed element within an Atom feed * * @langversion ActionScript 3.0 * @playerversion Flash 8.5 * @tiptext * * @see http://www.atomenabled.org/developers/syndication/atom-format-spec.php#rfc.section.4.1.1 */ public class FeedData extends NewsFeedElement { private var atom:Namespace = Namespaces.ATOM_NS; /** * Constructor for class. * * @param x An XML document that contains a feed element from within * an Aton XML feed. * * @langversion ActionScript 3.0 * @playerversion Flash 8.5 * @tiptext */ public function FeedData(x:XMLList) { super(x); } /** * The title element for the Feed. * * * @langversion ActionScript 3.0 * @playerversion Flash 8.5 * @tiptext */ public function get title():Title { var title:Title = new Title(); title.type = ParsingTools.nullCheck(this.x.atom::title.@type); title.value = ParsingTools.nullCheck(this.x.atom::title); return title; } /** * The subtitle element for the Feed. * * * @langversion ActionScript 3.0 * @playerversion Flash 8.5 * @tiptext */ public function get subtitle():SubTitle { var subtitle:SubTitle = new SubTitle(); subtitle.type = ParsingTools.nullCheck(this.x.atom::subtitle.@type); subtitle.value = ParsingTools.nullCheck(this.x.atom::subtitle); return subtitle; } /** * A date specifying when the Feed was last updated. * * * @langversion ActionScript 3.0 * @playerversion Flash 8.5 * @tiptext */ public function get updated():Date { return ParsingTools.dateCheck(this.x.atom::updated, DateUtil.parseW3CDTF); } /** * The subtitle element for the Feed. * * * @langversion ActionScript 3.0 * @playerversion Flash 8.5 * @tiptext */ public function get id():String { return ParsingTools.nullCheck(this.x.atom::id); } /** * An Array of Author classes representing all of all of the authors for * the feed * * * @langversion ActionScript 3.0 * @playerversion Flash 8.5 * @tiptext */ public function get authors():Array { var authors:Array = new Array(); var i:XML; for each (i in this.x.atom::author) { var author:Author = new Author(); author.name = ParsingTools.nullCheck(i.atom::["name"]); author.email = ParsingTools.nullCheck(i.atom::email); author.uri = ParsingTools.nullCheck(i.atom::uri); authors.push(author); } return authors; } /** * An Array of Contributor classes representing all of all of the * contributors for the feed * * * @langversion ActionScript 3.0 * @playerversion Flash 8.5 * @tiptext */ public function get contributors():Array { var contributors:Array = new Array(); var i:XML; for each (i in this.x.atom::contributor) { var contributor:Contributor = new Contributor(); contributor.name = ParsingTools.nullCheck(i.atom::["name"]); contributor.email = ParsingTools.nullCheck(i.atom::email); contributor.uri = ParsingTools.nullCheck(i.atom::uri); contributors.push(contributor); } return contributors; } /** * An Array of Categories classes containing all of the categories * associated with the feed * * * @langversion ActionScript 3.0 * @playerversion Flash 8.5 * @tiptext */ public function get categories():Array { var categories:Array = new Array(); var i:XML; for each (i in this.x.atom::category) { var category:Category = new Category(); category.term = ParsingTools.nullCheck(i.@term); category.scheme = ParsingTools.nullCheck(i.@scheme); category.label = ParsingTools.nullCheck(i.@label); categories.push(category); } return categories; } /** * A Link associated with the feed. * * This is the preferred URI for retrieving Atom Feed Documents * representing this Atom feed. * * * @langversion ActionScript 3.0 * @playerversion Flash 8.5 * @tiptext */ public function get link():Link { var link:Link = new Link(); link.rel = ParsingTools.nullCheck(this.x.atom::link.@rel); link.type = ParsingTools.nullCheck(this.x.atom::link.@type); link.hreflang = ParsingTools.nullCheck(this.x.atom::link.@hreflang); link.href = ParsingTools.nullCheck(this.x.atom::link.@href); link.title = ParsingTools.nullCheck(this.x.atom::link.@title); link.length = ParsingTools.nanCheck(this.x.atom::link.@length); return link; } /** * A rights class that conveys information about the rights held in * and over the feed. * * * @langversion ActionScript 3.0 * @playerversion Flash 8.5 * @tiptext */ public function get rights():Rights { var rights:Rights = new Rights(); rights.type = ParsingTools.nullCheck(this.x.atom::rights.@type); rights.value = ParsingTools.nullCheck(this.x.atom::rights); return rights; } /** * A Generator class that contains information about the agent used to * generate the feed. * * * @langversion ActionScript 3.0 * @playerversion Flash 8.5 * @tiptext */ public function get generator():Generator { var generator:Generator = new Generator(); generator.uri = ParsingTools.nullCheck(this.x.atom::generator.@uri); generator.version = ParsingTools.nullCheck(this.x.atom::generator.@version); generator.value = ParsingTools.nullCheck(this.x.atom::generator); return generator; } /** * An IRI reference [RFC3987] which identifies an image which provides * iconic visual identification for a feed. * * * @langversion ActionScript 3.0 * @playerversion Flash 8.5 * @tiptext */ public function get icon():String { return ParsingTools.nullCheck(this.x.atom::icon); } /** * An IRI reference [RFC3987] which identifies an image which provides * visual identification for a feed. * * * @langversion ActionScript 3.0 * @playerversion Flash 8.5 * @tiptext */ public function get logo():String { return ParsingTools.nullCheck(this.x.atom::logo); } } }
import org.aswing.awml.AwmlNamespace; import org.aswing.thumbstrip.awml.ThumbStripParser; import org.aswing.thumbstrip.LoadThumbStrip; /** * @author Igor Sadovskiy */ class org.aswing.thumbstrip.awml.LoadThumbStripParser extends ThumbStripParser { private static var ATTR_BASE_URL:String = "base-url"; private static var ATTR_USE_BASE_URL:String = "use-base-url"; private static var ATTR_USE_URL_AS_TITLE:String = "use-url-as-title"; private static var ATTR_LOAD_MODE:String = "load-mode"; private static var ATTR_PARTIAL_LOAD_AMOUNT:String = "partial-load-amount"; private static var LOAD_MODE_ALL:String = "all"; private static var LOAD_MODE_PARTIAL:String = "partial"; private static var LOAD_MODE_VISIBLE:String = "visible"; public function LoadThumbStripParser(Void) { super(); } public function parse(awml:XMLNode, its:LoadThumbStrip, namespace:AwmlNamespace) { if (its == null) { its = new LoadThumbStrip(); } super.parse(awml, its, namespace); its.setBaseUrl(getAttributeAsString(awml, ATTR_BASE_URL, its.getBaseUrl())); its.setUseBaseUrl(getAttributeAsBoolean(awml, ATTR_USE_BASE_URL, its.isUseBaseUrl())); its.setUseUrlAsTitle(getAttributeAsBoolean(awml, ATTR_USE_URL_AS_TITLE, its.isUseUrlAsTitle())); its.setPartialLoadAmount(getAttributeAsNumber(awml, ATTR_PARTIAL_LOAD_AMOUNT, its.getPartialLoadAmount())); var loadMode:String = getAttributeAsString(awml, ATTR_LOAD_MODE, null); switch (loadMode) { case LOAD_MODE_ALL: its.setImageLoadMode(LoadThumbStrip.LOAD_ALL); break; case LOAD_MODE_PARTIAL: its.setImageLoadMode(LoadThumbStrip.LOAD_PARTIAL); break; case LOAD_MODE_VISIBLE: its.setImageLoadMode(LoadThumbStrip.LOAD_VISIBLE); break; } // TODO image list // TODO selection return its; } }
//////////////////////////////////////////////////////////////////////////////// // // 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.beads { import mx.core.IFlexDisplayObject; import mx.core.IUIComponent; import mx.managers.PopUpManager; import spark.components.Button; import spark.components.supportClasses.DropDownListButton; import spark.components.DropDownList; import org.apache.royale.core.IBead; import org.apache.royale.core.IChild; import org.apache.royale.core.IContainer; import org.apache.royale.core.ILayoutChild; import org.apache.royale.core.IPopUpHost; import org.apache.royale.core.ISelectionModel; import org.apache.royale.core.IStrand; import org.apache.royale.core.IStrandWithModel; import org.apache.royale.core.IStyleableObject; import org.apache.royale.core.IUIBase; import org.apache.royale.events.Event; import org.apache.royale.events.IEventDispatcher; import org.apache.royale.html.beads.IDropDownListView; import org.apache.royale.html.util.getLabelFromData; /** * @private * The DropDownListView for emulation. */ public class DropDownListView extends SkinnableContainerView implements IDropDownListView { //-------------------------------------------------------------------------- // // Constructor // //-------------------------------------------------------------------------- /** * Constructor. * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ public function DropDownListView() { super(); } /** * @royalesuppresspublicvarwarning */ public var label:Button; private var selectionModel:ISelectionModel; /** */ override public function set strand(value:IStrand):void { super.strand = value; selectionModel = (value as IStrandWithModel).model as ISelectionModel; selectionModel.addEventListener("selectedIndexChanged", selectionChangeHandler); selectionModel.addEventListener("dataProviderChanged", selectionChangeHandler); (value as IEventDispatcher).addEventListener("initComplete", selectionChangeHandler); // remove the DataGroup. It will be the dropdown var chost:IContainer = host as IContainer; chost.strandChildren.removeElement(viewport.contentView); label = new DropDownListButton(); if (selectionModel.selectedIndex == -1) label.label = (host as DropDownList).prompt; chost.strandChildren.addElement(label); value.addBead(new DropDownListLayout()); } private function selectionChangeHandler(event:Event):void { if (selectionModel.selectedItem == null) { label.label = (host as DropDownList).prompt; } else { } label.label = getLabelFromData(selectionModel,selectionModel.selectedItem); } /** * The dropdown/popup that displays the set of choices. * * @langversion 3.0 * @playerversion Flash 10.2 * @playerversion AIR 2.6 * @productversion Royale 0.0 */ public function get popUp():IStrand { return viewport.contentView as IStrand; } private var _popUpVisible:Boolean; /** * A flag that indicates whether the dropdown/popup is * visible. * * @langversion 3.0 * @playerversion Flash 10.2 * @playerversion AIR 2.6 * @productversion Royale 0.0 */ public function get popUpVisible():Boolean { return _popUpVisible; } /** * @private */ public function set popUpVisible(value:Boolean):void { if (value != _popUpVisible) { _popUpVisible = value; var popUpDisplayObject:IFlexDisplayObject = popUp as IFlexDisplayObject; if (value) { PopUpManager.addPopUp(popUpDisplayObject, _strand); (popUpDisplayObject as IStyleableObject).className = "DropDownDataGroup"; (popUp as IUIComponent).setActualSize((popUp as IUIComponent).width, 100); } else { PopUpManager.removePopUp(popUpDisplayObject); } } } } } import spark.components.Button; import spark.components.DropDownList; import spark.components.beads.DropDownListView; import org.apache.royale.core.LayoutBase; // this layouts out the one Label/Button. class DropDownListLayout extends LayoutBase { override public function layout():Boolean { var list:DropDownList = host as DropDownList; var view:DropDownListView = list.view as DropDownListView; view.label.setActualSize(list.width, list.height); return false; } }
package com.codeazur.as3swf.tags { import com.codeazur.as3swf.SWFData; import flash.utils.ByteArray; public class TagDefineFontInfo implements ITag { public static const TYPE:uint = 13; public var fontId:uint; public var fontName:String; public var smallText:Boolean; public var shiftJIS:Boolean; public var ansi:Boolean; public var italic:Boolean; public var bold:Boolean; public var wideCodes:Boolean; public var langCode:uint = 0; protected var _codeTable:Vector.<uint>; protected var langCodeLength:uint = 0; public function TagDefineFontInfo() { _codeTable = new Vector.<uint>(); } public function get codeTable():Vector.<uint> { return _codeTable; } public function parse(data:SWFData, length:uint, version:uint, async:Boolean = false):void { fontId = data.readUI16(); var fontNameLen:uint = data.readUI8(); var fontNameRaw:ByteArray = new ByteArray(); data.readBytes(fontNameRaw, 0, fontNameLen); fontName = fontNameRaw.readUTFBytes(fontNameLen); var flags:uint = data.readUI8(); smallText = ((flags & 0x20) != 0); shiftJIS = ((flags & 0x10) != 0); ansi = ((flags & 0x08) != 0); italic = ((flags & 0x04) != 0); bold = ((flags & 0x02) != 0); wideCodes = ((flags & 0x01) != 0); parseLangCode(data); var numGlyphs:uint = length - fontNameLen - langCodeLength - 4; for (var i:uint = 0; i < numGlyphs; i++) { _codeTable.push(wideCodes ? data.readUI16() : data.readUI8()); } } public function publish(data:SWFData, version:uint):void { var body:SWFData = new SWFData(); body.writeUI16(fontId); var fontNameRaw:ByteArray = new ByteArray(); fontNameRaw.writeUTFBytes(fontName); body.writeUI8(fontNameRaw.length); body.writeBytes(fontNameRaw); var flags:uint = 0; if(smallText) { flags |= 0x20; } if(shiftJIS) { flags |= 0x10; } if(ansi) { flags |= 0x08; } if(italic) { flags |= 0x04; } if(bold) { flags |= 0x02; } if(wideCodes) { flags |= 0x01; } body.writeUI8(flags); publishLangCode(body); var numGlyphs:uint = _codeTable.length; for (var i:uint = 0; i < numGlyphs; i++) { if(wideCodes) { body.writeUI16(_codeTable[i]); } else { body.writeUI8(_codeTable[i]); } } data.writeTagHeader(type, body.length); data.writeBytes(body); } protected function parseLangCode(data:SWFData):void { // Does nothing here. // Overridden in TagDefineFontInfo2, where it: // - reads langCode // - sets langCodeLength to 1 } protected function publishLangCode(data:SWFData):void { // Does nothing here. // Overridden in TagDefineFontInfo2 } public function get type():uint { return TYPE; } public function get name():String { return "DefineFontInfo"; } public function get version():uint { return 1; } public function get level():uint { return 1; } public function toString(indent:uint = 0, flags:uint = 0):String { return Tag.toStringCommon(type, name, indent) + "FontID: " + fontId + ", " + "FontName: " + fontName + ", " + "Italic: " + italic + ", " + "Bold: " + bold + ", " + "Codes: " + _codeTable.length; } } }
package baseflex.utils.math { public class MathUtils { public static function randomRange(iMin:uint,iMax:uint):uint { return ((Math.random()*iMax)-(Math.random()*iMin)+1)+(Math.random()*iMin); } public static function randomNumberRange(aMin:Number,aMax:Number):Number { return ((Math.random()*aMax)-(Math.random()*aMin))+(Math.random()*aMin); } } }
package feathers.examples.componentsExplorer.data { public class GroupedListSettings { public static const STYLE_NORMAL:String = "normal"; public static const STYLE_INSET:String = "inset"; public function GroupedListSettings() { } public var isSelectable:Boolean = true; public var hasElasticEdges:Boolean = true; public var style:String = STYLE_NORMAL; } }
/* Copyright 2016-2021 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 com.as3mxml.asconfigc { public class CompilerOptions { public static const ACCESSIBLE:String = "accessible"; public static const ADVANCED_TELEMETRY:String = "advanced-telemetry"; public static const BENCHMARK:String = "benchmark"; public static const DEBUG:String = "debug"; public static const DEBUG_PASSWORD:String = "debug-password"; public static const DEFAULT_BACKGROUND_COLOR:String = "default-background-color"; public static const DEFAULT_FRAME_RATE:String = "default-frame-rate"; public static const DEFAULT_SIZE:String = "default-size"; public static const DEFAULT_SIZE__WIDTH:String = "width"; public static const DEFAULT_SIZE__HEIGHT:String = "height"; public static const DEFAULTS_CSS_FILES:String = "defaults-css-files"; public static const DEFINE:String = "define"; public static const DEFINE__NAME:String = "name"; public static const DEFINE__VALUE:String = "value"; public static const DIRECTORY:String = "directory"; public static const DUMP_CONFIG:String = "dump-config"; public static const EXTERNAL_LIBRARY_PATH:String = "external-library-path"; public static const INCLUDE_LIBRARIES:String = "include-libraries"; public static const KEEP_ALL_TYPE_SELECTORS:String = "keep-all-type-selectors"; public static const KEEP_AS3_METADATA:String = "keep-as3-metadata"; public static const KEEP_GENERATED_ACTIONSCRIPT:String = "keep-generated-actionscript"; public static const LIBRARY_PATH:String = "library-path"; public static const LINK_REPORT:String = "link-report"; public static const LOAD_CONFIG:String = "load-config"; public static const LOAD_EXTERNS:String = "load-externs"; public static const LOCALE:String = "locale"; public static const NAMESPACE:String = "namespace"; public static const NAMESPACE__URI:String = "uri"; public static const NAMESPACE__MANIFEST:String = "manifest"; public static const OPTIMIZE:String = "optimize"; public static const OMIT_TRACE_STATEMENTS:String = "omit-trace-statements"; public static const OUTPUT:String = "output"; public static const PRELOADER:String = "preloader"; public static const SHOW_UNUSED_TYPE_SELECTOR_WARNINGS:String = "show-unused-type-selector-warnings"; public static const SIZE_REPORT:String = "size-report"; public static const SOURCE_PATH:String = "source-path"; public static const STATIC_LINK_RUNTIME_SHARED_LIBRARIES:String = "static-link-runtime-shared-libraries"; public static const STRICT:String = "strict"; public static const SWF_VERSION:String = "swf-version"; public static const TARGET_PLAYER:String = "target-player"; public static const THEME:String = "theme"; public static const TOOLS_LOCALE:String = "tools-locale"; public static const USE_DIRECT_BLIT:String = "use-direct-blit"; public static const USE_GPU:String = "use-gpu"; public static const USE_NETWORK:String = "use-network"; public static const USE_RESOURCE_BUNDLE_METADATA:String = "use-resource-bundle-metadata"; public static const VERBOSE_STACKTRACES:String = "verbose-stacktraces"; public static const WARNINGS:String = "warnings"; //royale options public static const HTML_OUTPUT_FILENAME:String = "html-output-filename"; public static const HTML_TEMPLATE:String = "html-template"; public static const JS_COMPILER_OPTION:String = "js-compiler-option"; public static const JS_DEFAULT_INITIALIZERS:String = "js-default-initializers"; public static const JS_DEFINE:String = "js-define"; public static const JS_EXTERNAL_LIBRARY_PATH:String = "js-external-library-path"; public static const JS_LIBRARY_PATH:String = "js-library-path"; public static const JS_LOAD_CONFIG:String = "js-load-config"; public static const JS_OUTPUT:String = "js-output"; public static const JS_OUTPUT_TYPE:String = "js-output-type"; public static const REMOVE_CIRCULARS:String = "remove-circulars"; public static const SOURCE_MAP:String = "source-map"; public static const SWF_EXTERNAL_LIBRARY_PATH:String = "swf-external-library-path"; public static const SWF_LIBRARY_PATH:String = "swf-library-path"; public static const TARGETS:String = "targets"; public static const WARN_PUBLIC_VARS:String = "warn-public-vars"; //library options public static const INCLUDE_CLASSES:String = "include-classes"; public static const INCLUDE_FILE:String = "include-file"; public static const INCLUDE_FILE__FILE:String = "file"; public static const INCLUDE_FILE__PATH:String = "path"; public static const INCLUDE_NAMESPACES:String = "include-namespaces"; public static const INCLUDE_SOURCES:String = "include-sources"; } }
/** * Cyclops Framework * * Copyright 2010 Mark Davis Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.cyclopsframework.actions.flow { import org.cyclopsframework.core.CFAction; public class CFDoOnExit extends CFAction { public static const TAG:String = "@CFDoOnExit"; private var _f:Function; public function CFDoOnExit(f:Function) { super(0, Number.MAX_VALUE, null, [TAG]); _f = f; } protected override function onExit():void { _f(); } } }
package cmodule.lua_wrapper { const ___sF:int = gstaticInitter.alloc(264,8); }
package visuals.ui.elements.backgrounds { 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 SymbolSlice9BackgroundTooltipGeneric extends Sprite { private var _nativeObject:SymbolSlice9BackgroundTooltip = null; public function SymbolSlice9BackgroundTooltipGeneric(param1:MovieClip = null) { if(param1) { _nativeObject = param1 as SymbolSlice9BackgroundTooltip; } else { _nativeObject = new SymbolSlice9BackgroundTooltip(); } super(null,FlashSprite.fromNative(_nativeObject)); var _loc2_:FlashDisplayObjectContainer = _sprite as FlashDisplayObjectContainer; } public function setNativeInstance(param1:SymbolSlice9BackgroundTooltip) : void { FlashSprite.setNativeInstance(_sprite,param1); _nativeObject = param1; syncInstances(); } public function syncInstances() : void { } } }
//////////////////////////////////////////////////////////////////////////////// // // NOTEFLIGHT LLC // Copyright 2009 Noteflight LLC // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // //////////////////////////////////////////////////////////////////////////////// package com.noteflight.standingwave3.sources { import __AS3__.vec.Vector; import com.noteflight.standingwave3.elements.*; /** * AbstractSource is an implementation superclass for IAudioSource implementations * that wish to generate their output on a per-channel basis. An AbstractSource * has standard amplitude and duration properties. */ public class AbstractSource implements IAudioSource { /** Audio descriptor for this source. */ protected var _descriptor:AudioDescriptor; protected var _position:Number; protected var _duration:Number; public var amplitude:Number; public static const MAX_DURATION:Number = int.MAX_VALUE; /** * Create an AbstractSource of a particular duration and amplitude. * @param descriptor an AudioDescriptor for the source's audio * @param duration the duration of the source's output * @param amplitude the amplitude of the source's output */ public function AbstractSource(descriptor:AudioDescriptor, duration:Number = MAX_DURATION, amplitude:Number = 1.0) { _descriptor = descriptor; this.amplitude = amplitude; _duration = duration; _position = 0; } public function get duration():Number { return _duration; } protected function generateChannel(data:Vector.<Number>, channel:Number, numFrames:Number):void { throw new Error("generateChannel() not overridden"); } //////////////////////////////////////////// // IAudioSource interface implementation //////////////////////////////////////////// /** * Get the AudioDescriptor for this Sample. */ public function get descriptor():AudioDescriptor { return _descriptor; } public function get frameCount():Number { return Math.floor(duration * descriptor.rate); } public function get position():Number { return _position; } public function resetPosition():void { _position = 0; } public function getSample(numFrames:Number):Sample { var sample:Sample = new Sample(descriptor, numFrames); for (var c:Number = 0; c < descriptor.channels; c++) { var data:Vector.<Number> = new Vector.<Number>(numFrames, true); generateChannel(data, c, numFrames); sample.commitSlice(data, c, 0); // commit the new data to the sample memory } _position += numFrames; return sample; } public function clone():IAudioSource { throw new Error("clone() not overridden"); } } }
package serverProto.rolePromote { import com.netease.protobuf.Message; import com.netease.protobuf.fieldDescriptors.FieldDescriptor$TYPE_SINT32; import com.netease.protobuf.fieldDescriptors.FieldDescriptor$TYPE_MESSAGE; import com.netease.protobuf.WireType; import com.netease.protobuf.WritingBuffer; import com.netease.protobuf.WriteUtils; import flash.utils.IDataInput; import com.netease.protobuf.ReadUtils; import flash.errors.IOError; public final class ProtoPromoteBattleNotify extends Message { public static const RESULT:FieldDescriptor$TYPE_SINT32 = new FieldDescriptor$TYPE_SINT32("serverProto.rolePromote.ProtoPromoteBattleNotify.result","result",1 << 3 | WireType.VARINT); public static const REMAIN_STAR:FieldDescriptor$TYPE_SINT32 = new FieldDescriptor$TYPE_SINT32("serverProto.rolePromote.ProtoPromoteBattleNotify.remain_star","remainStar",2 << 3 | WireType.VARINT); public static const PREV_START:FieldDescriptor$TYPE_SINT32 = new FieldDescriptor$TYPE_SINT32("serverProto.rolePromote.ProtoPromoteBattleNotify.prev_start","prevStart",3 << 3 | WireType.VARINT); public static const ATTR_INFO:FieldDescriptor$TYPE_MESSAGE = new FieldDescriptor$TYPE_MESSAGE("serverProto.rolePromote.ProtoPromoteBattleNotify.attr_info","attrInfo",4 << 3 | WireType.LENGTH_DELIMITED,ProtoPromoteAttrInfo); private var result$field:int; private var hasField$0:uint = 0; private var remain_star$field:int; private var prev_start$field:int; private var attr_info$field:serverProto.rolePromote.ProtoPromoteAttrInfo; public function ProtoPromoteBattleNotify() { super(); } public function clearResult() : void { this.hasField$0 = this.hasField$0 & 4.294967294E9; this.result$field = new int(); } public function get hasResult() : Boolean { return (this.hasField$0 & 1) != 0; } public function set result(param1:int) : void { this.hasField$0 = this.hasField$0 | 1; this.result$field = param1; } public function get result() : int { return this.result$field; } public function clearRemainStar() : void { this.hasField$0 = this.hasField$0 & 4.294967293E9; this.remain_star$field = new int(); } public function get hasRemainStar() : Boolean { return (this.hasField$0 & 2) != 0; } public function set remainStar(param1:int) : void { this.hasField$0 = this.hasField$0 | 2; this.remain_star$field = param1; } public function get remainStar() : int { return this.remain_star$field; } public function clearPrevStart() : void { this.hasField$0 = this.hasField$0 & 4.294967291E9; this.prev_start$field = new int(); } public function get hasPrevStart() : Boolean { return (this.hasField$0 & 4) != 0; } public function set prevStart(param1:int) : void { this.hasField$0 = this.hasField$0 | 4; this.prev_start$field = param1; } public function get prevStart() : int { return this.prev_start$field; } public function clearAttrInfo() : void { this.attr_info$field = null; } public function get hasAttrInfo() : Boolean { return this.attr_info$field != null; } public function set attrInfo(param1:serverProto.rolePromote.ProtoPromoteAttrInfo) : void { this.attr_info$field = param1; } public function get attrInfo() : serverProto.rolePromote.ProtoPromoteAttrInfo { return this.attr_info$field; } override final function writeToBuffer(param1:WritingBuffer) : void { var _loc2_:* = undefined; if(this.hasResult) { WriteUtils.writeTag(param1,WireType.VARINT,1); WriteUtils.write$TYPE_SINT32(param1,this.result$field); } if(this.hasRemainStar) { WriteUtils.writeTag(param1,WireType.VARINT,2); WriteUtils.write$TYPE_SINT32(param1,this.remain_star$field); } if(this.hasPrevStart) { WriteUtils.writeTag(param1,WireType.VARINT,3); WriteUtils.write$TYPE_SINT32(param1,this.prev_start$field); } if(this.hasAttrInfo) { WriteUtils.writeTag(param1,WireType.LENGTH_DELIMITED,4); WriteUtils.write$TYPE_MESSAGE(param1,this.attr_info$field); } for(_loc2_ in this) { super.writeUnknown(param1,_loc2_); } } override final function readFromSlice(param1:IDataInput, param2:uint) : void { /* * Decompilation error * Code may be obfuscated * Tip: You can try enabling "Automatic deobfuscation" in Settings * Error type: IndexOutOfBoundsException (Index: 4, Size: 4) */ throw new flash.errors.IllegalOperationError("Not decompiled due to error"); } } }
package examples.fiducial.caurina.transitions { /** * PropertyInfoObj * An object containing the updating info for a given property (its starting value, and its final value) * * @author Zeh Fernando * @version 1.0.0 * @private */ public class PropertyInfoObj { public var valueStart :Number; // Starting value of the tweening (null if not started yet) public var valueComplete :Number; // Final desired value public var originalValueComplete :Object; // Final desired value as declared initially public var arrayIndex :Number; // Index (if this is an array item) public var extra :Object; // Additional parameters, used by some special properties public var isSpecialProperty :Boolean; // Whether or not this is a special property instead of a direct one public var hasModifier :Boolean; // Whether or not it has a modifier function public var modifierFunction :Function; // Modifier function, if any public var modifierParameters :Array; // Additional array of modifier parameters // ================================================================================================================================== // CONSTRUCTOR function ------------------------------------------------------------------------------------------------------------- /** * Initializes the basic PropertyInfoObj. * * @param p_valueStart Number Starting value of the tweening (null if not started yet) * @param p_valueComplete Number Final (desired) property value */ function PropertyInfoObj(p_valueStart:Number, p_valueComplete:Number, p_originalValueComplete:Object, p_arrayIndex:Number, p_extra:Object, p_isSpecialProperty:Boolean, p_modifierFunction:Function, p_modifierParameters:Array) { valueStart = p_valueStart; valueComplete = p_valueComplete; originalValueComplete = p_originalValueComplete; arrayIndex = p_arrayIndex; extra = p_extra; isSpecialProperty = p_isSpecialProperty; hasModifier = Boolean(p_modifierFunction); modifierFunction = p_modifierFunction; modifierParameters = p_modifierParameters; } // ================================================================================================================================== // OTHER functions ------------------------------------------------------------------------------------------------------------------ /** * Clones this property info and returns the new PropertyInfoObj * * @param omitEvents Boolean Whether or not events such as onStart (and its parameters) should be omitted * @return TweenListObj A copy of this object */ public function clone():PropertyInfoObj { var nProperty:PropertyInfoObj = new PropertyInfoObj(valueStart, valueComplete, originalValueComplete, arrayIndex, extra, isSpecialProperty, modifierFunction, modifierParameters); return nProperty; } /** * Returns this object described as a String. * * @return String The description of this object. */ public function toString():String { var returnStr:String = "\n[PropertyInfoObj "; returnStr += "valueStart:" + String(valueStart); returnStr += ", "; returnStr += "valueComplete:" + String(valueComplete); returnStr += ", "; returnStr += "originalValueComplete:" + String(originalValueComplete); returnStr += ", "; returnStr += "arrayIndex:" + String(arrayIndex); returnStr += ", "; returnStr += "extra:" + String(extra); returnStr += ", "; returnStr += "isSpecialProperty:" + String(isSpecialProperty); returnStr += ", "; returnStr += "hasModifier:" + String(hasModifier); returnStr += ", "; returnStr += "modifierFunction:" + String(modifierFunction); returnStr += ", "; returnStr += "modifierParameters:" + String(modifierParameters); returnStr += "]\n"; return returnStr; } } }
var foo; // untyped var bar:*; // explicitly untyped trace(foo + ", " + bar); // outputs "undefined, undefined" if (foo == undefined) trace("foo is undefined"); // outputs "foo is undefined"
/* * Copyright 2014 Mozilla Foundation * * 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 flash.net { import flash.events.EventDispatcher; [native(cls="SharedObjectClass")] public class SharedObject extends EventDispatcher { public native function SharedObject(); public static native function deleteAll(url:String):int; public static native function getDiskUsage(url:String):int; public static native function getLocal(name:String, localPath:String = null, secure:Boolean = false):SharedObject; public static native function getRemote(name:String, remotePath:String = null, persistence:Object = false, secure:Boolean = false):SharedObject; public static native function get defaultObjectEncoding():uint; public static native function set defaultObjectEncoding(version:uint):void; public native function get data():Object; public native function connect(myConnection:NetConnection, params:String = null):void; public native function close():void; public native function flush(minDiskSpace:int = 0):String; public native function get size():uint; public native function set fps(updatesPerSecond:Number):void; public native function send():void; public native function clear():void; public native function get objectEncoding():uint; public native function set objectEncoding(version:uint):void; public native function get client():Object; public native function set client(object:Object):void; public native function setDirty(propertyName:String):void; public native function setProperty(propertyName:String, value:Object = null):void; } }
// Decompiled by AS3 Sorcerer 6.08 // www.as3sorcerer.com //kabam.rotmg.assets.EmbeddedAssets_chars8x8rHero2Embed_ package kabam.rotmg.assets { import mx.core.BitmapAsset; [Embed(source="EmbeddedAssets_chars8x8rHero2.png")] public class EmbeddedAssets_chars8x8rHero2Embed_ extends BitmapAsset { } }//package kabam.rotmg.assets
/*********************************************************************************************************************** * 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.widgets.interfaces { public interface ISkinnable { function get id():String; function get type():String; function get assetWidth():Number; function get assetHeight():Number; function get data():Object; function set data(value:Object):void; } }
/* * Scratch Project Editor and Player * Copyright (C) 2014 Massachusetts Institute of Technology * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ // EditableLabel.as // John Maloney, July 2011 // // An EditableLabel is an editable text field with an optional bezel (box) around it. // By default, the bezel is always visible, but useDynamicBezel() can be used to make // it appear only while the user is editing the text (i.e. it has keyboard focus). package uiwidgets { import flash.display.*; import flash.events.*; import flash.filters.*; import flash.text.*; public class EditableLabel extends Sprite { private const defaultFormat:TextFormat = new TextFormat(CSS.font, 13, 0x929497); private const bgColor:int = 0xFFFFFF; private const frameColor:int = 0xA6A8AB; public var tf:TextField; private var bezel:Shape; private var dynamicBezel:Boolean; private var textChanged:Function; public function EditableLabel(textChanged:Function, format:TextFormat = null) { this.textChanged = textChanged; bezel = new Shape(); addChild(bezel); addFilter(); if (format == null) format = defaultFormat; addTextField(format); setWidth(100); } public function setWidth(w:int):void { if (tf.text.length == 0) tf.text = ' '; // needs at least one character to compute textHeight var h:int = tf.textHeight + 5; // the height is determined by the font var g:Graphics = bezel.graphics; g.clear(); g.lineStyle(0.5, frameColor, 1, true); g.beginFill(bgColor); g.drawRoundRect(0, 0, w, h, 7, 7); g.endFill(); tf.width = w - 3; tf.height = h - 1; } public function contents():String { return tf.text } public function setContents(s:String):void { tf.text = s } public function setEditable(flag:Boolean):void { tf.type = flag ? TextFieldType.INPUT : TextFieldType.DYNAMIC; tf.selectable = flag; bezel.visible = flag; } public function useDynamicBezel(flag:Boolean):void { dynamicBezel = flag; bezel.visible = !dynamicBezel; } private function focusChange(evt:FocusEvent):void { if (dynamicBezel) bezel.visible = ((root.stage.focus == tf) && (tf.type == TextFieldType.INPUT)); if ((evt.type == FocusEvent.FOCUS_OUT) && (textChanged != null)) textChanged(); } private function keystroke(evt:KeyboardEvent):void { // Called after each keystroke. var k:int = evt.charCode; if ((k == 10) || (k == 13)) { stage.focus = null; // relinquish keyboard focus evt.stopPropagation(); } } private function addTextField(format:TextFormat):void { tf = new TextField(); tf.defaultTextFormat = format; tf.type = TextFieldType.INPUT; var debugAlignment:Boolean = false; if (debugAlignment) { tf.background = true; tf.backgroundColor = 0xA0A0FF; } tf.x = 2; tf.y = 1; tf.addEventListener(FocusEvent.FOCUS_IN, focusChange); tf.addEventListener(FocusEvent.FOCUS_OUT, focusChange); tf.addEventListener(KeyboardEvent.KEY_DOWN, keystroke); addChild(tf); } private function addFilter():void { var f:BevelFilter = new BevelFilter(); f.angle = 225; f.shadowAlpha = 0.5; f.distance = 2; f.strength = 0.5; f.blurX = f.blurY = 2; bezel.filters = [f]; } }}
/** * Created with IntelliJ IDEA. * User: mobitile * Date: 7/19/13 * Time: 10:10 AM * To change this template use File | Settings | File Templates. */ package skein.validators.validators { import skein.validators.data.ValidationResult; public class PhoneValidator extends BasicValidator { private static const PHONE_REGEXP:RegExp = /^[\+0-9]+$/; public function PhoneValidator() { super(); } private var _phoneWrongFormatError:String = 'Valid format is "+123456789"'; public function get phoneWrongFormatError():String { return _phoneWrongFormatError; } public function set phoneWrongFormatError(value:String):void { _phoneWrongFormatError = value; } override protected function doValidation(value:Object):Array { var result:Array = super.doValidation(value); if (result.length > 0) return result; else return validatePhone(value); } private function validatePhone(value:Object):Array { var results:Array = []; if (required) { if (!PHONE_REGEXP.test(String(value))) { results.push(new ValidationResult(true, _phoneWrongFormatError)); } } return results; } } }
package sh.saqoo.util { public class DateUtil { public static const MILLISECOND:Number = 1; public static const SECOND:Number = MILLISECOND * 1000; public static const MINUTE:Number = SECOND * 60; public static const HOUR:Number = MINUTE * 60; public static const DAY:Number = HOUR * 24; public static const DAY_NAME_SHORT:Array = [ 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat' ]; public static const MONTH_NAME_SHORT:Array = [ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' ]; public static const MONTH_NAME_LONG:Array = [ 'January', 'Febrary', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ]; public static const TIMEZONE:Object = { 'ADT': -3 * HOUR, 'AST': -4 * HOUR, 'CDT': -5 * HOUR, 'CST': -6 * HOUR, 'EDT': -4 * HOUR, 'EST': -5 * HOUR, 'GMT': 0, 'MDT': -6 * HOUR, 'MST': -7 * HOUR, 'PDT': -7 * HOUR, 'PST': -8 * HOUR, 'UT': 0, 'UTC': 0, 'Z': 0, 'A': -1 * HOUR, 'M': -12 * HOUR, 'N': 1 * HOUR, 'Y': 12 * HOUR }; public static function fromRFC822(dateString:String):Date { var parts:Array = dateString.split(/\s+/); var dayNames:Array = DAY_NAME_SHORT.map(function (...a):* { return a[0].toLowerCase(); }); var dn:String = parts[0].toLowerCase(); var dl:int = dn.length - 1; if ([',', '.'].indexOf(dn.charAt(dl)) !== -1 || dayNames.indexOf(dn) !== -1) { parts.shift(); } var Y:int, m:int, d:int; d = int(parts.shift()); m = MONTH_NAME_SHORT.indexOf(parts.shift()); Y = int(parts.shift()); var H:int, M:int, S:int, times:Array, tzInfo:String; // check format. if (parts.length) { times = parts.shift().split(':'); H = int(times.shift()); M = int(times.shift()); S = int(times.shift()); } else { H = 0; M = 0; S = 0; } tzInfo = parts.shift() || 'GMT'; var op:int = 1, offset:Number = 0, utc:Number = Date.UTC(Y, m, d, H, M, S); if (tzInfo.search(/\d/) === -1) { offset = TIMEZONE[tzInfo]; } else { if (tzInfo.length > 4) { if (tzInfo.charAt(0) == '-') { op = -1; } tzInfo = tzInfo.substr(1, 4); } offset = (int(tzInfo.substr(0, 2)) * HOUR + int(tzInfo.substr(2, 2)) * MINUTE) * op; } return new Date(utc - offset); } public static function toRFC822(d:Date):String { var date:Number = d.getDate(); var hours:Number = d.getHours(); var minutes:Number = d.getMinutes(); var seconds:Number = d.getSeconds(); var sb:String = new String(); sb += DAY_NAME_SHORT[d.getDay()]; sb += ', '; sb += ('0' + date).substr(-2); sb += ' '; sb += MONTH_NAME_SHORT[d.getMonth()]; sb += ' '; sb += d.getFullYear(); sb += ' '; if (hours < 10) { sb += '0'; } sb += hours; sb += ':'; if (minutes < 10) { sb += '0'; } sb += minutes; sb += ':'; if (seconds < 10) { sb += '0'; } sb += seconds; sb += ' '; var offset:Number = d.timezoneOffset; if (offset < 0) { sb += '+'; offset *= -1; } else { sb += '-'; } var ofh:int = offset / 60; if (ofh < 10) { sb += '0'; } sb += ofh; var ofm:int = offset % 60; if (ofm < 10) { sb += '0'; } sb += ofm; return sb; } public static function fromW3C(dateString:String):Date { var parts:Array = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(\.\d+)?([-+](\d{2})(?::?(\d{2}))|Z)$/.exec(dateString); var utc:Number = Date.UTC(parts[1], int(parts[2])-1, parts[3], parts[4], parts[5], parts[6]); var offset:Number = 0; var tzInfo:String = parts[8]; var hour:int = int(parts[9]); var minutes:int = int(parts[10]); if (tzInfo && tzInfo != 'Z') { offset = hour * HOUR + minutes * MINUTE; if (tzInfo.charAt(0) == '-') { offset *= -1; } } return new Date(utc - offset); } public static function toW3C(d:Date):String { var year:String = d.fullYearUTC.toString(); var month:String = '0' + (d.monthUTC + 1).toString(); var date:String = '0' + d.dateUTC.toString(); var hour:String = '0' + d.hoursUTC.toString(); var minute:String = '0' + d.minutesUTC.toString(); var second:String = '0' + d.secondsUTC.toString(); return year + '-' + month.substr(-2) + '-' + date.substr(-2) + 'T' + hour.substr(-2) + ':' + minute.substr(-2) + ':' + second.substr(-2) + 'Z'; } /** * @param year Same as Data class constructor parameter. * @param month Same as Data class constructor parameter. * @return Number of days in specified month. */ public static function numberOfDaysIn(year:int, month:int):int { var d:Date = new Date(year, month); return new Date(d.getTime() - 1).getDate(); } public static function getFirstDayOf(year:int, month:int):int { return new Date(year, month).getDay(); } public static function getTwitterStyle(date:Date, current:Date = null):String { current ||= new Date(); var time:Number = (current.getTime() - date.getTime()) / 1000; var tweetTime:String; if (time <= 0) { tweetTime = ' '; } else if (time < 10) { tweetTime = 'now'; } else if (time < 60) { tweetTime = int(time) + ' seconds ago'; } else if (time < 3600) { var m:int = time / 60; tweetTime = m == 1 ? '1 minute age' : m + ' minutes ago'; } else if (time < 3600 * 24) { var h:int = time / (3600); tweetTime = h == 1 ? '1 hour ago' : h + ' hours ago'; } else { tweetTime = current.getDate() + ' ' + MONTH_NAME_SHORT[current.getMonth()]; } // } else if (current.getDate() - date.getDate() < 31) { // tweetTime = int(time / (3600 * 24)) + ' days ago'; // } else if (date.getMonth() < current.getMonth()) { // tweetTime = current.getMonth() - date.getMonth() + ' months ago'; // } return tweetTime; } } }
/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ package DynamicClass { interface DefaultInt { function iGetNumber():Number function iGetNumber1(): Number } }
/* * =BEGIN CLOSED LICENSE * * Copyright(c) 2014 Andras Csizmadia. * http://www.vpmedia.eu * * For information about the licensing and copyright please * contact Andras Csizmadia at andras@vpmedia.eu. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * * =END CLOSED LICENSE */ package app.core { import app.flash.*; import app.ui.ApplicationContextMenuItem; import hu.vpmedia.ui.BaseContextMenuItem; import app.ui.DeveloperContextMenuItem; import app.ui.ShareContextMenuItem; import hu.vpmedia.utils.ContextMenuUtil; import hu.vpmedia.mvc.BaseModel; import hu.vpmedia.mvc.IBaseView; import hu.vpmedia.mvc.Router; import hu.vpmedia.mvc.RouterItem; import hu.vpmedia.net.BaseTransmission; import hu.vpmedia.net.HTTPConnection; import hu.vpmedia.net.HTTPConnectionVars; import hu.vpmedia.net.ServiceManager; import hu.vpmedia.starlingmvc.StarlingRouter; import hu.vpmedia.utils.SystemUtil; import org.as3commons.logging.api.ILogger; import org.as3commons.logging.api.LOGGER_FACTORY; import org.as3commons.logging.api.getLogger; import org.as3commons.logging.setup.SimpleSetup; import org.as3commons.logging.setup.target.TraceTarget; import org.osflash.signals.ISignal; import org.osflash.signals.Signal; /** * Class * @author Andras Csizmadia */ public class ApplicationModel extends BaseModel { private static const LOG:ILogger = getLogger("ApplicationModel"); //---------------------------------- // Helpers //---------------------------------- /** * TBD */ public var flashVars:Object; /** * TBD */ public var signal:ISignal; //---------------------------------- // Managers //---------------------------------- /** * TBD */ public var serviceManager:ServiceManager; /** * TBD */ public var serviceProxy:ApplicationServices; /** * TBD */ public var router:Router; /** * TBD */ public var starlingRouter:StarlingRouter; //---------------------------------- // Constructor //---------------------------------- /** * Constructor */ public function ApplicationModel(flashVars:Object) { this.flashVars = flashVars; super(); initialize(); } //---------------------------------- // Bootstrap //---------------------------------- /** * setupCore */ private final function initialize():void { // logger LOGGER_FACTORY.setup = new SimpleSetup(new TraceTarget()); LOG.debug(this, "initialize"); // flash vars if (flashVars) { for (var p:String in flashVars) { LOG.debug(this, "flashVars::" + p + "=>" + flashVars[p]); } } // signal signal = new Signal(BaseTransmission); //initServiceManager serviceManager = new ServiceManager(); serviceManager.signal.add(signalHandler); serviceManager.registerServiceProvider(HTTPConnection, HTTPConnectionVars); if (SystemUtil.isLocalSandbox()) { serviceManager.setUrlPrefix(ApplicationConfig.LOCAL_SERVER); // serviceManager.setAssetPrefix(ApplicationConfig.LOCAL_ASSETS); } serviceManager.loadXML(XML(new ApplicationAsset.SERVICE_CONFIG_XML())); serviceProxy = new ApplicationServices(this); } //---------------------------------- // API //---------------------------------- /** * setupView * @param context */ public final function initViewManager(view:IBaseView):void { LOG.debug(this, "initViewManager"); const contextMenuItems:Vector.<BaseContextMenuItem> = new Vector.<BaseContextMenuItem>() contextMenuItems.push(new ApplicationContextMenuItem()); contextMenuItems.push(new DeveloperContextMenuItem()); contextMenuItems.push(new ShareContextMenuItem()); ContextMenuUtil.addItems(view.content.parent, contextMenuItems); const routerItems:Array = []; routerItems.push(new RouterItem({view: StartView, controller: StartController, mediator: StartMediator, url: ApplicationConfig.VIEW_START_URL})); routerItems.push(new RouterItem({view: MainView, controller: MainController, mediator: MainMediator, url: ApplicationConfig.VIEW_MAIN_URL})); routerItems.push(new RouterItem({view: MultiStateView, url: ApplicationConfig.VIEW_MULTISTATE_URL})); routerItems.push(new RouterItem({view: MultiStateView, url: ApplicationConfig.VIEW_MULTISTATE_START_URL})); routerItems.push(new RouterItem({view: MultiStateView, url: ApplicationConfig.VIEW_MULTISTATE_MAIN_URL})); router = new Router(this, view, routerItems); } /** * Set view by address * @param value String */ public final function setViewState(value:String):void { LOG.debug(this, "setViewState: " + value); router.setState(value); } /** * Set view by address * @param value String */ public final function setStarlingViewState(value:String):void { LOG.debug("setStarlingViewState: " + value); starlingRouter.setState(value); } //---------------------------------- // Private //---------------------------------- /** * Signal event bus */ private final function signalHandler(medium:BaseTransmission):void { LOG.debug("signalHandler: " + medium); signal.dispatch(medium); } /** * Will return the description of the object including property information. */ /*public function toString():String { return BaseConfig.toStr(this); }*/ } }
package com.ankamagames.dofus.network.types.game.presets { import com.ankamagames.jerakine.network.ICustomDataInput; import com.ankamagames.jerakine.network.ICustomDataOutput; import com.ankamagames.jerakine.network.INetworkType; import com.ankamagames.jerakine.network.utils.FuncTree; public class ItemForPreset implements INetworkType { public static const protocolId:uint = 4107; public var position:uint = 63; public var objGid:uint = 0; public var objUid:uint = 0; public function ItemForPreset() { super(); } public function getTypeId() : uint { return 4107; } public function initItemForPreset(position:uint = 63, objGid:uint = 0, objUid:uint = 0) : ItemForPreset { this.position = position; this.objGid = objGid; this.objUid = objUid; return this; } public function reset() : void { this.position = 63; this.objGid = 0; this.objUid = 0; } public function serialize(output:ICustomDataOutput) : void { this.serializeAs_ItemForPreset(output); } public function serializeAs_ItemForPreset(output:ICustomDataOutput) : void { output.writeShort(this.position); if(this.objGid < 0) { throw new Error("Forbidden value (" + this.objGid + ") on element objGid."); } output.writeVarShort(this.objGid); if(this.objUid < 0) { throw new Error("Forbidden value (" + this.objUid + ") on element objUid."); } output.writeVarInt(this.objUid); } public function deserialize(input:ICustomDataInput) : void { this.deserializeAs_ItemForPreset(input); } public function deserializeAs_ItemForPreset(input:ICustomDataInput) : void { this._positionFunc(input); this._objGidFunc(input); this._objUidFunc(input); } public function deserializeAsync(tree:FuncTree) : void { this.deserializeAsyncAs_ItemForPreset(tree); } public function deserializeAsyncAs_ItemForPreset(tree:FuncTree) : void { tree.addChild(this._positionFunc); tree.addChild(this._objGidFunc); tree.addChild(this._objUidFunc); } private function _positionFunc(input:ICustomDataInput) : void { this.position = input.readShort(); if(this.position < 0) { throw new Error("Forbidden value (" + this.position + ") on element of ItemForPreset.position."); } } private function _objGidFunc(input:ICustomDataInput) : void { this.objGid = input.readVarUhShort(); if(this.objGid < 0) { throw new Error("Forbidden value (" + this.objGid + ") on element of ItemForPreset.objGid."); } } private function _objUidFunc(input:ICustomDataInput) : void { this.objUid = input.readVarUhInt(); if(this.objUid < 0) { throw new Error("Forbidden value (" + this.objUid + ") on element of ItemForPreset.objUid."); } } } }
package com.codeazur.as3swf.data.abc.reflect { import com.codeazur.as3swf.data.abc.ABC; import com.codeazur.as3swf.data.abc.bytecode.IABCMultiname; import com.codeazur.as3swf.data.abc.bytecode.traits.ABCTraitSlotInfo; import com.codeazur.utils.StringUtils; /** * @author Simon Richardson - simon@ustwo.co.uk */ public class ABCReflectVariable implements IABCReflectObject { private var _slotInfo:ABCTraitSlotInfo; public function ABCReflectVariable(slotInfo:ABCTraitSlotInfo) { _slotInfo = slotInfo; } public static function create(slotInfo:ABCTraitSlotInfo):ABCReflectVariable { return new ABCReflectVariable(slotInfo); } public function get multiname():IABCMultiname { return _slotInfo.multiname; } public function get isFinal():Boolean { return _slotInfo.isFinal; } public function get isStatic():Boolean { return _slotInfo.isStatic; } public function get typeMultiname():IABCMultiname { return _slotInfo.typeMultiname; } public function get hasDefaultValue():Boolean { return _slotInfo.hasDefaultValue; } public function get defaultValue():* { return _slotInfo.defaultValue; } public function get name():String { return "ABCReflectVariable"; } public function toString(indent:uint=0):String { var str:String = ABC.toStringCommon(name, indent); str += "\n" + StringUtils.repeat(indent + 2) + "Multiname:"; str += "\n" + StringUtils.repeat(indent + 4) + multiname.fullPath; return str; } } }
package serverProto.activity { import com.netease.protobuf.Message; import com.netease.protobuf.fieldDescriptors.FieldDescriptor$TYPE_MESSAGE; import com.netease.protobuf.fieldDescriptors.FieldDescriptor$TYPE_UINT32; import com.netease.protobuf.fieldDescriptors.FieldDescriptor$TYPE_INT32; import com.netease.protobuf.WireType; import serverProto.inc.ProtoRetInfo; import com.netease.protobuf.WritingBuffer; import com.netease.protobuf.WriteUtils; import flash.utils.IDataInput; import com.netease.protobuf.ReadUtils; import flash.errors.IOError; public final class ProtoNinjaComeActivityQueryRsp extends Message { public static const RET:FieldDescriptor$TYPE_MESSAGE = new FieldDescriptor$TYPE_MESSAGE("serverProto.activity.ProtoNinjaComeActivityQueryRsp.ret","ret",1 << 3 | WireType.LENGTH_DELIMITED,ProtoRetInfo); public static const ACTIVITY_BEGIN_TIME:FieldDescriptor$TYPE_UINT32 = new FieldDescriptor$TYPE_UINT32("serverProto.activity.ProtoNinjaComeActivityQueryRsp.activity_begin_time","activityBeginTime",2 << 3 | WireType.VARINT); public static const ACTIVITY_END_TIME:FieldDescriptor$TYPE_UINT32 = new FieldDescriptor$TYPE_UINT32("serverProto.activity.ProtoNinjaComeActivityQueryRsp.activity_end_time","activityEndTime",3 << 3 | WireType.VARINT); public static const SCORE:FieldDescriptor$TYPE_INT32 = new FieldDescriptor$TYPE_INT32("serverProto.activity.ProtoNinjaComeActivityQueryRsp.score","score",4 << 3 | WireType.VARINT); public static const FREE_BOX_KEY_COUNT:FieldDescriptor$TYPE_INT32 = new FieldDescriptor$TYPE_INT32("serverProto.activity.ProtoNinjaComeActivityQueryRsp.free_box_key_count","freeBoxKeyCount",5 << 3 | WireType.VARINT); public var ret:ProtoRetInfo; public var activityBeginTime:uint; public var activityEndTime:uint; public var score:int; public var freeBoxKeyCount:int; public function ProtoNinjaComeActivityQueryRsp() { super(); } override final function writeToBuffer(param1:WritingBuffer) : void { var _loc2_:* = undefined; WriteUtils.writeTag(param1,WireType.LENGTH_DELIMITED,1); WriteUtils.write$TYPE_MESSAGE(param1,this.ret); WriteUtils.writeTag(param1,WireType.VARINT,2); WriteUtils.write$TYPE_UINT32(param1,this.activityBeginTime); WriteUtils.writeTag(param1,WireType.VARINT,3); WriteUtils.write$TYPE_UINT32(param1,this.activityEndTime); WriteUtils.writeTag(param1,WireType.VARINT,4); WriteUtils.write$TYPE_INT32(param1,this.score); WriteUtils.writeTag(param1,WireType.VARINT,5); WriteUtils.write$TYPE_INT32(param1,this.freeBoxKeyCount); for(_loc2_ in this) { super.writeUnknown(param1,_loc2_); } } override final function readFromSlice(param1:IDataInput, param2:uint) : void { /* * Decompilation error * Code may be obfuscated * Tip: You can try enabling "Automatic deobfuscation" in Settings * Error type: IndexOutOfBoundsException (Index: 5, Size: 5) */ throw new flash.errors.IllegalOperationError("Not decompiled due to error"); } } }
package nid.xfl.compiler.swf { import flash.events.EventDispatcher; import flash.utils.ByteArray; import nid.xfl.compiler.swf.data.SWFRawTag; import nid.xfl.compiler.swf.data.SWFRectangle; import nid.xfl.compiler.swf.data.SWFScene; import nid.xfl.compiler.swf.data.SWFSymbol; import nid.xfl.compiler.swf.tags.ITag; import nid.xfl.compiler.swf.tags.TagDefineSceneAndFrameLabelData; import nid.xfl.compiler.swf.tags.TagDoABC; import nid.xfl.compiler.swf.tags.TagFileAttributes; import nid.xfl.compiler.swf.tags.TagSetBackgroundColor; import nid.xfl.compiler.swf.tags.TagSymbolClass; import nid.xfl.core.XFLObject; import nid.xfl.XFLCompiler; import nid.xfl.XFLDocument; /** * ... * @author Nidin Vinayak */ public class SWFCompiler extends EventDispatcher { public var bytes:ByteArray; public var xflobj:XFLObject; /** * SWF PROPERTIES */ public var version:int; public var fileLength:uint; public var fileLengthCompressed:uint; public var frameSize:SWFRectangle; public var frameRate:Number; public var frameCount:uint; public var compressed:Boolean; public var backgroundColor:uint; protected static const FILE_LENGTH_POS:uint = 4; protected static const COMPRESSION_START_POS:uint = 8; protected var tags:Vector.<ITag>; protected var tagsRaw:Vector.<SWFRawTag>; public function SWFCompiler() { version = 10; frameRate = 24; compressed = true; frameCount = 1; frameSize = new SWFRectangle(); tags = new Vector.<ITag>(); tagsRaw = new Vector.<SWFRawTag>(); } protected function publishTags(data:SWFData, version:uint):void { for (var i:uint = 0; i < tags.length; i++) { try { if (tags[i] is TagDoABC) { trace('caught'); } tags[i].publish(data, version); } catch (e:Error) { trace("WARNING: publish error: " + e.message + " (tag: " + tags[i].name + ", index: " + i + ")"); //tagsRaw[i].publish(data); } } } protected function initTags():void { var fileAttributes:TagFileAttributes = new TagFileAttributes(); fileAttributes.actionscript3 = true; fileAttributes.hasMetadata = false; fileAttributes.useDirectBlit = true; fileAttributes.useGPU = true; fileAttributes.useNetwork = false; tags.push(fileAttributes); var backGround:TagSetBackgroundColor = new TagSetBackgroundColor(); backGround.color = backgroundColor; tags.push(backGround); var defineSceneAndFrameLabelData:TagDefineSceneAndFrameLabelData = new TagDefineSceneAndFrameLabelData(); defineSceneAndFrameLabelData.scenes.push(new SWFScene(0, "Scene 1")); tags.push(defineSceneAndFrameLabelData); } protected function buildHeader(data:SWFData):void { data.writeUI8(compressed ? 0x43 : 0x46); data.writeUI8(0x57); data.writeUI8(0x53); data.writeUI8(version); data.writeUI32(0); data.writeRECT(frameSize); data.writeFIXED8(frameRate); data.writeUI16(frameCount); // TODO: get the real number of frames from the tags } protected function publishFinalize(data:SWFData):void { fileLength = fileLengthCompressed = data.length; if (compressed) { data.position = COMPRESSION_START_POS; data.swfCompress(); fileLengthCompressed = data.length; } var endPos:uint = data.position; data.position = FILE_LENGTH_POS; data.writeUI32(fileLength); data.position = 0; } } }
package Ankama_Social { import Ankama_Common.Common; import Ankama_Social.ui.AddFriendWindow; import Ankama_Social.ui.Alliance; import Ankama_Social.ui.AllianceAreas; import Ankama_Social.ui.AllianceCard; import Ankama_Social.ui.AllianceCreator; import Ankama_Social.ui.AllianceDirectory; import Ankama_Social.ui.AllianceFights; import Ankama_Social.ui.AllianceMembers; import Ankama_Social.ui.CollectedTaxCollector; import Ankama_Social.ui.Friends; import Ankama_Social.ui.Guild; import Ankama_Social.ui.GuildApplications; import Ankama_Social.ui.GuildApplyPopup; import Ankama_Social.ui.GuildCard; import Ankama_Social.ui.GuildCreator; import Ankama_Social.ui.GuildDirectory; import Ankama_Social.ui.GuildHouses; import Ankama_Social.ui.GuildJoinPopup; import Ankama_Social.ui.GuildMemberRights; import Ankama_Social.ui.GuildMembers; import Ankama_Social.ui.GuildPaddock; import Ankama_Social.ui.GuildPersonalization; import Ankama_Social.ui.GuildPrezAndRecruit; import Ankama_Social.ui.GuildTaxCollector; import Ankama_Social.ui.HousesList; import Ankama_Social.ui.SocialBase; import Ankama_Social.ui.SocialBulletin; import Ankama_Social.ui.Spouse; import Ankama_Social.ui.TopTaxCollectors; import Ankama_Social.ui.items.IconWithLabelItem; import Ankama_Social.ui.items.MultiIconWithLabelItem; import com.ankamagames.berilia.api.UiApi; import com.ankamagames.berilia.enums.StrataEnum; import com.ankamagames.berilia.enums.UIEnum; import com.ankamagames.dofus.internalDatacenter.DataEnum; import com.ankamagames.dofus.internalDatacenter.guild.GuildWrapper; import com.ankamagames.dofus.internalDatacenter.guild.TaxCollectorWrapper; import com.ankamagames.dofus.logic.game.common.actions.alliance.AllianceInvitationAnswerAction; import com.ankamagames.dofus.logic.game.common.actions.guild.GuildInvitationAnswerAction; import com.ankamagames.dofus.logic.game.common.actions.social.SpouseRequestAction; import com.ankamagames.dofus.logic.game.roleplay.actions.PlayerFightRequestAction; import com.ankamagames.dofus.misc.lists.CustomUiHookList; import com.ankamagames.dofus.misc.lists.HookList; import com.ankamagames.dofus.misc.lists.SocialHookList; import com.ankamagames.dofus.network.enums.GameContextEnum; import com.ankamagames.dofus.uiApi.ChatApi; import com.ankamagames.dofus.uiApi.ConfigApi; import com.ankamagames.dofus.uiApi.DataApi; import com.ankamagames.dofus.uiApi.PlayedCharacterApi; import com.ankamagames.dofus.uiApi.SocialApi; import com.ankamagames.dofus.uiApi.SystemApi; import com.ankamagames.dofus.uiApi.TimeApi; import com.ankamagames.dofus.uiApi.UtilApi; import flash.display.Sprite; public class Social extends Sprite { private static var _self:Social; protected var socialBase:SocialBase; protected var friends:Friends; protected var addFriendWindow:AddFriendWindow; protected var spouse:Spouse; protected var guild:Guild; protected var guildDirectory:GuildDirectory; protected var alliance:Alliance; protected var directory:AllianceDirectory; protected var housesList:HousesList; protected var guildJoinPopup:GuildJoinPopup; protected var guilApplyPopup:GuildApplyPopup; protected var guildCard:GuildCard; protected var allianceCard:AllianceCard; protected var guildHouses:GuildHouses; protected var guildMembers:GuildMembers; protected var guildMemberRights:GuildMemberRights; protected var guildPaddock:GuildPaddock; protected var guildPersonalization:GuildPersonalization; protected var guildTaxCollector:GuildTaxCollector; protected var guildPrezAndRecruit:GuildPrezAndRecruit; protected var guildCreator:GuildCreator; protected var guildApplications:GuildApplications; protected var allianceMembers:AllianceMembers; protected var allianceAreas:AllianceAreas; protected var allianceFights:AllianceFights; protected var allianceCreator:AllianceCreator; protected var collectedTaxCollector:CollectedTaxCollector; protected var topTaxCollectors:TopTaxCollectors; protected var socialBulletin:SocialBulletin; protected var iconWithLabelItem:IconWithLabelItem = null; protected var multiIconWithLabelItem:MultiIconWithLabelItem = null; [Api(name="SystemApi")] public var sysApi:SystemApi; [Api(name="UiApi")] public var uiApi:UiApi; [Api(name="ChatApi")] public var chatApi:ChatApi; [Api(name="SocialApi")] public var socialApi:SocialApi; [Api(name="PlayedCharacterApi")] public var playerApi:PlayedCharacterApi; [Api(name="DataApi")] public var dataApi:DataApi; [Api(name="UtilApi")] public var utilApi:UtilApi; [Api(name="TimeApi")] public var timeApi:TimeApi; [Api(name="ConfigApi")] public var configApi:ConfigApi; [Module(name="Ankama_Common")] public var modCommon:Common; private var _firstTime:Boolean = true; private var _ava:Boolean; private var _targetId:Number; private var _cellId:int; private var _popupName:String = null; private var _popupAllianceName:String = null; private const MAX_GUILD_DETAILS:uint = 6; private var _guildDetailsList:Array; public function Social() { this._guildDetailsList = []; super(); } public static function getInstance() : Social { return _self; } public function main() : void { Api.system = this.sysApi; Api.social = this.socialApi; Api.ui = this.uiApi; Api.player = this.playerApi; Api.modCommon = this.modCommon; Api.data = this.dataApi; Api.util = this.utilApi; Api.time = this.timeApi; Api.config = this.configApi; _self = this; this.sysApi.addHook(SocialHookList.OpenSocial,this.onOpenSocial); this.sysApi.addHook(HookList.OpenHouses,this.onOpenHouses); this.sysApi.addHook(CustomUiHookList.ClientUIOpened,this.onClientUIOpened); this.sysApi.addHook(HookList.ContextChanged,this.onContextChanged); this.sysApi.addHook(SocialHookList.GuildCreationStarted,this.onCreateGuild); this.sysApi.addHook(SocialHookList.GuildInvited,this.onGuildInvited); this.sysApi.addHook(SocialHookList.GuildInvitationStateRecruter,this.onGuildInvitationStateRecruter); this.sysApi.addHook(SocialHookList.GuildInvitationStateRecruted,this.onGuildInvitationStateRecruted); this.sysApi.addHook(SocialHookList.AllianceCreationStarted,this.onCreateAlliance); this.sysApi.addHook(SocialHookList.AllianceInvited,this.onAllianceInvited); this.sysApi.addHook(SocialHookList.AllianceInvitationStateRecruter,this.onAllianceInvitationStateRecruter); this.sysApi.addHook(SocialHookList.AllianceInvitationStateRecruted,this.onAllianceInvitationStateRecruted); this.sysApi.addHook(SocialHookList.GuildApplicationsUiRequested,this.onOpenGuildApplications); this.sysApi.addHook(SocialHookList.GuildPrezAndRecruitUiRequested,this.onOpenGuildPrezAndRecruit); this.sysApi.addHook(SocialHookList.AttackPlayer,this.onAttackPlayer); this.sysApi.addHook(SocialHookList.DishonourChanged,this.onDishonourChanged); this.sysApi.addHook(SocialHookList.OpenOneAlliance,this.onOpenOneAlliance); this.sysApi.addHook(SocialHookList.OpenOneGuild,this.onOpenOneGuild); this.sysApi.addHook(SocialHookList.GuildJoined,this.onGuildJoined); this.sysApi.addHook(SocialHookList.GuildLeft,this.onGuildLeft); this.sysApi.addHook(HookList.ShowCollectedTaxCollector,this.onShowCollectedTaxCollector); this.sysApi.addHook(SocialHookList.ShowTopTaxCollectors,this.onShowTopTaxCollectors); this.sysApi.addHook(HookList.LeaveDialog,this.onLeaveDialog); if(!this.sysApi.getData("guildBulletinLastVisitTimestamp")) { this.sysApi.setData("guildBulletinLastVisitTimestamp",0); } if(!this.sysApi.getData("allianceBulletinLastVisitTimestamp")) { this.sysApi.setData("allianceBulletinLastVisitTimestamp",0); } } private function onCreateGuild(modifyName:Boolean, modifyEmblem:Boolean) : void { this.uiApi.loadUi("guildCreator","guildCreator",[modifyName,modifyEmblem]); } private function onCreateAlliance(modifyName:Boolean, modifyEmblem:Boolean) : void { this.uiApi.loadUi("allianceCreator","allianceCreator",[modifyName,modifyEmblem]); } private function onOpenOneGuild(guild:Object) : void { var instanceName:String = null; var guildCardName:String = "guildCard" + guild.guildId; this.uiApi.unloadUi("allianceCard"); if(this._guildDetailsList.length >= 6 && this._guildDetailsList.indexOf(guildCardName) == -1) { instanceName = this._guildDetailsList.shift(); if(this.uiApi.getUi(instanceName)) { this.uiApi.unloadUi(instanceName); } } if(!this.uiApi.getUi(guildCardName)) { this.uiApi.loadUi("guildCard",guildCardName,{"guild":guild},StrataEnum.STRATA_MEDIUM); this._guildDetailsList.push(guildCardName); } else { this.uiApi.getUi(guildCardName).setOnTop(); } } public function onGuildJoined() : void { var socialBase:SocialBase = null; if(this.uiApi.getUi(UIEnum.SOCIAL_BASE)) { socialBase = this.uiApi.getUi(UIEnum.SOCIAL_BASE).uiClass as SocialBase; if(socialBase && socialBase.getTab() == DataEnum.SOCIAL_TAB_GUILD_DIRECTORY_ID) { socialBase.openTab(DataEnum.SOCIAL_TAB_GUILD_ID); } } } public function onGuildLeft() : void { var socialBase:SocialBase = null; if(this.uiApi.getUi(UIEnum.SOCIAL_BASE)) { socialBase = this.uiApi.getUi(UIEnum.SOCIAL_BASE).uiClass as SocialBase; if(socialBase && socialBase.getTab() == DataEnum.SOCIAL_TAB_GUILD_ID) { socialBase.openTab(DataEnum.SOCIAL_TAB_GUILD_DIRECTORY_ID); } } } private function onOpenOneAlliance(alliance:Object) : void { this.uiApi.unloadUi("guildCard"); if(!this.uiApi.getUi("allianceCard")) { this.uiApi.loadUi("allianceCard","allianceCard",{"alliance":alliance}); } } private function onOpenSocial(tab:int = -1, subTab:int = -1, params:Object = null) : void { var args:Object = null; this.sysApi.log(8,"onOpenSocial " + tab + ", " + subTab + ", " + params); if(tab == 2 && !this.playerApi.characteristics()) { return; } if(tab == 3) { if(!this.uiApi.getUi("spouse")) { this.sysApi.sendAction(new SpouseRequestAction([])); this.uiApi.loadUi("spouse"); } else { this.uiApi.unloadUi("spouse"); } return; } if(!this.uiApi.getUi("socialBase")) { if(tab == 3 && this.socialApi.getSpouse() == null) { return; } args = {}; if(tab != -1) { args.tab = tab; } if(subTab != -1) { args.subTab = subTab; } if(params != null && params.length > 0) { args.params = params; } if(subTab == -1) { this.uiApi.loadUi("socialBase","socialBase",args); } else { this.uiApi.loadUi("socialBase","socialBase",args,1,null,false,false,false); } } else if(tab != -1) { if(this.uiApi.getUi("socialBase").uiClass.getTab() != tab || subTab != -1 && this.uiApi.getUi("socialBase").uiClass.getSubTab() != subTab) { if(subTab == -1) { this.uiApi.getUi("socialBase").uiClass.openTab(tab); } else if(params == null) { this.uiApi.getUi("socialBase").uiClass.openTab(tab,subTab,null,false); } else { this.uiApi.getUi("socialBase").uiClass.openTab(tab,subTab,params,false); } } else { this.uiApi.unloadUi("socialBase"); } } else { this.uiApi.unloadUi("socialBase"); } } private function onOpenGuildApplications() : void { var guildInfo:GuildWrapper = this.socialApi.getGuild(); if(guildInfo !== null && !this.uiApi.getUi(UIEnum.GUILD_APPLICATIONS)) { this.uiApi.loadUi(UIEnum.GUILD_APPLICATIONS,null,{"hasRights":guildInfo.manageGuildApply}); } } private function onOpenGuildPrezAndRecruit() : void { this.uiApi.loadUi(UIEnum.GUILD_PREZ_AND_RECRUIT,null,{"recruitmentData":this.socialApi.getGuild().guildRecruitmentInfo}); } private function onOpenHouses() : void { if(!this.uiApi.getUi("housesList")) { this.uiApi.loadUi("housesList"); } } private function onContextChanged(context:uint) : void { if(context == GameContextEnum.FIGHT || context == GameContextEnum.ROLE_PLAY) { this.uiApi.unloadUi(UIEnum.SOCIAL_BASE); this.uiApi.unloadUi(UIEnum.GUILD_PREZ_AND_RECRUIT); this.uiApi.unloadUi(UIEnum.GUILD_APPLICATIONS); } } private function onClientUIOpened(type:uint, uid:uint) : void { if(this.socialApi.hasGuild()) { if(!this.uiApi.getUi("socialBase")) { switch(type) { case 0: this.sysApi.log(16,"Error : wrong UI type to open."); break; case 1: this.uiApi.loadUi("socialBase","socialBase",{ "tab":1, "subTab":4 },1,null,false,false,false); break; case 2: this.uiApi.loadUi("socialBase","socialBase",{ "tab":1, "subTab":3 },1,null,false,false,false); break; case 4: this.uiApi.loadUi("socialBase","socialBase",{ "tab":1, "subTab":2 },1,null,false,false,false); } } else if(this.uiApi.getUi("socialBase").uiClass.getTab() != 1) { switch(type) { case 1: this.uiApi.getUi("socialBase").uiClass.openTab(1,4,null,false); break; case 2: this.uiApi.getUi("socialBase").uiClass.openTab(1,3,null,false); break; case 4: this.uiApi.getUi("socialBase").uiClass.openTab(1,2,null,false); } } else { this.sysApi.log(16,"Error : Social UI is already open."); } } if(type == 5) { if(!this.uiApi.getUi("housesList")) { this.uiApi.loadUi("housesList"); } } } private function onDishonourChanged(dishonour:int) : void { var text:String = this.uiApi.processText(this.uiApi.getText("ui.social.disgraceSanction",dishonour),"n",dishonour < 2,dishonour == 0); text += "\n\n" + this.uiApi.getText("ui.disgrace.sanction.1"); this.modCommon.openPopup(this.uiApi.getText("ui.common.informations"),text,[this.uiApi.getText("ui.common.ok")]); } private function onAttackPlayer(targetId:Number, ava:Boolean, targetName:String, type:int, cellId:int) : void { var text:String = null; this._targetId = targetId; this._cellId = cellId; this._ava = ava; if(ava || type == 0) { text = this.uiApi.getText("ui.pvp.doUAttack",targetName); } else if(type == 2) { text = this.uiApi.getText("ui.pvp.doUAttackNeutral"); } else if(type == -1) { text = this.uiApi.getText("ui.pvp.doUAttackNoGain",targetName); } else if(type == 1) { text = this.uiApi.getText("ui.pvp.doUAttackBonusGain",targetName); } this.modCommon.openPopup(this.uiApi.getText("ui.popup.warning"),text,[this.uiApi.getText("ui.common.attack"),this.uiApi.getText("ui.common.cancel")],[this.onConfirmAttack,null],this.onConfirmAttack); } private function onConfirmAttack() : void { this.sysApi.sendAction(new PlayerFightRequestAction([this._targetId,this._ava,false,true])); } private function onGuildInvited(guildId:uint, guildName:String, recruterId:Number, recruterName:String) : void { var guildDescr:Object = { "guildId":guildId, "guildName":guildName }; this._popupName = this.modCommon.openTextButtonPopup(this.uiApi.getText("ui.common.invitation"),this.uiApi.getText("ui.guild.invitationRequest",recruterName,this.chatApi.getGuildLink(guildDescr,guildName)),[this.uiApi.getText("ui.guild.joinGuild"),this.uiApi.getText("ui.guild.dontJoinGuild")],[this.onConfirmJoinGuild,this.onCancelJoinGuild],this.onConfirmJoinGuild,this.onCancelJoinGuild); } private function onConfirmJoinGuild() : void { this.sysApi.sendAction(new GuildInvitationAnswerAction([true])); } private function onCancelJoinGuild() : void { this.sysApi.sendAction(new GuildInvitationAnswerAction([false])); } private function onGuildInvitationStateRecruter(state:uint, recrutedName:String) : void { switch(state) { case 1: this._popupName = this.modCommon.openPopup(this.uiApi.getText("ui.common.invitation"),this.uiApi.getText("ui.craft.waitForCraftClient",recrutedName),[this.uiApi.getText("ui.common.cancel")],[this.onCancelJoinGuild],null,this.onCancelJoinGuild); break; case 2: case 3: this.unloadPopup(); } } private function unloadPopup() : void { if(this._popupName && this.uiApi.getUi(this._popupName)) { this.uiApi.unloadUi(this._popupName); this._popupName = null; } } private function onGuildInvitationStateRecruted(state:uint) : void { switch(state) { case 1: break; case 2: case 3: if(this._popupName && this.uiApi.getUi(this._popupName)) { this.uiApi.unloadUi(this._popupName); this._popupName = null; } } } private function onAllianceInvited(allianceName:String, recruterId:Number, recruterName:String) : void { this._popupAllianceName = this.modCommon.openPopup(this.uiApi.getText("ui.common.invitation"),this.uiApi.getText("ui.alliance.youAreInvited",recruterName,allianceName),[this.uiApi.getText("ui.common.yes"),this.uiApi.getText("ui.common.no")],[this.onConfirmJoinAlliance,this.onCancelJoinAlliance],this.onConfirmJoinAlliance,this.onCancelJoinAlliance); } private function onConfirmJoinAlliance() : void { this.sysApi.sendAction(new AllianceInvitationAnswerAction([true])); } private function onCancelJoinAlliance() : void { this.sysApi.sendAction(new AllianceInvitationAnswerAction([false])); } private function onAllianceInvitationStateRecruter(state:uint, recrutedName:String) : void { switch(state) { case 1: this._popupAllianceName = this.modCommon.openPopup(this.uiApi.getText("ui.common.invitation"),this.uiApi.getText("ui.craft.waitForCraftClient",recrutedName),[this.uiApi.getText("ui.common.cancel")],[this.onCancelJoinAlliance],null,this.onCancelJoinAlliance); break; case 2: case 3: if(this._popupAllianceName && this.uiApi.getUi(this._popupAllianceName)) { this.uiApi.unloadUi(this._popupAllianceName); this._popupAllianceName = null; } } } private function onAllianceInvitationStateRecruted(state:uint) : void { switch(state) { case 1: break; case 2: case 3: if(this._popupAllianceName && this.uiApi.getUi(this._popupAllianceName)) { this.uiApi.unloadUi(this._popupAllianceName); this._popupAllianceName = null; } } } private function onShowCollectedTaxCollector(pTaxCollector:TaxCollectorWrapper) : void { this.uiApi.loadUi("collectedTaxCollector",null,pTaxCollector,1,null,true); } private function onShowTopTaxCollectors(pDungeonTopTaxCollectors:Object, pTopTaxCollectors:Object) : void { this.uiApi.loadUi("topTaxCollectors",null,{ "dungeonTopTaxCollectors":pDungeonTopTaxCollectors, "topTaxCollectors":pTopTaxCollectors },1,null,true); } private function onLeaveDialog() : void { this.unloadPopup(); } } }
package kabam.rotmg.assets { import mx.core.BitmapAsset; [Embed(source="EmbeddedAssets_chars16x16dEncounters2Embed.png")] public class EmbeddedAssets_chars16x16dEncounters2Embed extends BitmapAsset { public function EmbeddedAssets_chars16x16dEncounters2Embed() { super(); } } }
package framework.view.components.controls { import flash.events.Event; import framework.model.AppModelLocator; import mx.controls.ComboBox; import mx.events.ListEvent; import services.vo.backend.RoomWithStatusVO; import services.vo.hotels.HotelRoomStatusVO; public class RoomStatusComboBoxItemEditor extends ComboBox { [Bindable] public var model:AppModelLocator = AppModelLocator.getInstance(); public var oHousekeepStatus:HotelRoomStatusVO; // necessesary for houseKeeperView [Bindable] public var oldStatus:HotelRoomStatusVO; public function RoomStatusComboBoxItemEditor() { addEventListener(Event.CHANGE, onSelectionChange); } private var _data:RoomWithStatusVO; override public function set data(value:Object):void { if(value is RoomWithStatusVO) { _data = value as RoomWithStatusVO; super.data = _data; if(_data){ for each(var roomStatus:HotelRoomStatusVO in dataProvider) { if(roomStatus.lId == _data.oHousekeepStatus.lId) { super.selectedItem = roomStatus; oHousekeepStatus = roomStatus; oldStatus = roomStatus; } } } dispatchEvent(new Event("RoomStatusComboboxChange")); } } [Bindable (event = "RoomStatusComboboxChange")] override public function get data():Object { return _data ; } override public function setFocus():void { super.setFocus(); //TODO //open(); } private function onSelectionChange(e:ListEvent):void { _data.oHousekeepStatus = selectedItem as HotelRoomStatusVO; oHousekeepStatus = _data.oHousekeepStatus; } } }
/** * Copyright (c) 2015 egg82 (Alexander Mason) * * 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 egg82.math.collision.quadtree { import egg82.events.math.collision.quadtree.QuadtreeNodeEvent; import egg82.patterns.Observer; import flash.geom.Rectangle; /** * ... * @author egg82 */ public class QuadtreeNode { //vars public static const OBSERVERS:Vector.<Observer> = new Vector.<Observer>(); private var maxObjects:uint; private var level:uint; private var bounds:Rectangle; private var objects:Vector.<QuadtreeObject> = new Vector.<QuadtreeObject>(); private var nodes:Vector.<QuadtreeNode> = new Vector.<QuadtreeNode>(); //constructor public function QuadtreeNode(level:uint, bounds:Rectangle, maxObjects:uint) { this.level = level; this.bounds = bounds; this.maxObjects = maxObjects; } //public public function clear():void { objects = new Vector.<QuadtreeObject>(); for (var i:uint = 0; i < nodes.length; i++) { nodes[i].clear(); } nodes = new Vector.<QuadtreeNode>(); } public function insert(obj:QuadtreeObject):void { var index:int; if (nodes.length > 0) { index = getIndex(obj); if (index != -1) { nodes[index].insert(obj); return; } } objects.push(obj); if (objects.length > maxObjects) { if (nodes.length == 0) { split(); } var i:uint = 0; while (i < objects.length) { index = getIndex(objects[i]); if (index != -1) { nodes[index].insert(objects.splice(i, 1)[0]); } else { i++; } } } } public function getProbableCollisions(obj:QuadtreeObject):Vector.<QuadtreeObject> { var returnVec:Vector.<QuadtreeObject> = new Vector.<QuadtreeObject>(); var tempVec:Vector.<QuadtreeObject>; var index:int = getIndex(obj); var i:uint; if (index != -1 && nodes.length > 0) { tempVec = nodes[index].getProbableCollisions(obj); for (i = 0; i < tempVec.length; i++) { returnVec.push(tempVec[i]); } } for (i = 0; i < objects.length; i++) { returnVec.push(objects[i]); } return returnVec; } //private private function split():void { var subWidth:Number = bounds.width / 2; var subHeight:Number = bounds.height / 2; var x:Number = bounds.x; var y:Number = bounds.y; nodes[0] = new QuadtreeNode(level + 1, new Rectangle(x + subWidth, y, subWidth, subHeight), maxObjects); nodes[1] = new QuadtreeNode(level + 1, new Rectangle(x, y, subWidth, subHeight), maxObjects); nodes[2] = new QuadtreeNode(level + 1, new Rectangle(x, y + subHeight, subWidth, subHeight), maxObjects); nodes[3] = new QuadtreeNode(level + 1, new Rectangle(x + subWidth, y + subHeight, subWidth, subHeight), maxObjects); dispatch(QuadtreeNodeEvent.SPLIT); } private function getIndex(obj:QuadtreeObject):int { var index:int = -1; var horiz:Number = bounds.x + bounds.width / 2; var vert:Number = bounds.y + bounds.height / 2; var topQuad:Boolean = obj.y + obj.height < horiz; var bottomQuad:Boolean = obj.y > horiz; if (obj.x + obj.width < vert) { if (topQuad) { index = 1 } else if (bottomQuad) { index = 2; } } else if (obj.x > vert) { if (topQuad) { index = 0; } else if (bottomQuad) { index = 3; } } return index; } protected function dispatch(event:String, data:Object = null):void { Observer.dispatch(OBSERVERS, null, event, data); } } }
package tests.velocity { import org.flixel.*; import org.flixel.plugin.photonstorm.*; import tests.TestsHeader; public class VelocityTest3 extends FlxState { // Common variables public static var title:String = "Velocity 3"; public static var description:String = "Get the distance between 2 FlxObjects"; private var instructions:String = ""; private var header:TestsHeader; // Test specific variables private var red:FlxSprite; private var green:FlxSprite; public function VelocityTest3() { } override public function create():void { header = new TestsHeader(instructions); add(header); // Test specific red = new FlxSprite(160, 120, AssetsRegistry.redPNG); green = new FlxSprite(-32, 0, AssetsRegistry.greenPNG); add(red); add(green); // Header overlay add(header.overlay); } override public function update():void { super.update(); green.x = FlxG.mouse.screenX; green.y = FlxG.mouse.screenY; header.instructions.text = "Distance between red and green: " + FlxVelocity.distanceBetween(red, green) + " px"; } } }
package suites.testObjects.moduleMain { import mvcexpress.mvc.Proxy; import suites.SuiteModuleNames; import suites.testObjects.controller.GetProxyTestCommand; /** * COMMENT * @author Raimundas Banevicius (http://mvcexpress.org/) */ public class MainModuleFull extends ModuleSprite { private var dataProxy:MainDataProxy; private var testView:MainView; static public const NAME:String = SuiteModuleNames.MAIN_MODULE; public function MainModuleFull() { super(MainModule.NAME, true, false); } override protected function onInit():void { dataProxy = new MainDataProxy(); proxyMap.map(dataProxy); mediatorMap.map(MainView, MainViewMediator); } override protected function onDispose():void { proxyMap.unmap(MainDataProxy); dataProxy = null; } //---------------------------------- // //---------------------------------- public function createLocalCommand(message:String):void { commandMap.map(message, MainLocalCommand) } public function createLocalHandler(message:String):void { if (!testView) { testView = new MainView(); mediatorMap.mediate(testView); } testView.addLocalhandler(message); } public function createRemoteCommand(message:String):void { commandMap.mapRemote(message, MainRemoteCommand, SuiteModuleNames.EXTERNAL_MODULE); } public function createRemoteHandler(message:String):void { if (!testView) { testView = new MainView(); mediatorMap.mediate(testView); } testView.addRemoteHandler(message); } public function sendTestMessage(message:String):void { sendMessage(message); } public function removeLocalCommand(message:String):void { commandMap.unmap(message, MainLocalCommand) } public function removeLocalHandler(message:String):void { if (!testView) { testView = new MainView(); mediatorMap.mediate(testView); } testView.removeLocalhandler(message); } public function removeRemoteCommand(message:String):void { commandMap.unmapRemote(message, MainRemoteCommand, SuiteModuleNames.EXTERNAL_MODULE); } public function removeRemoteHandler(message:String):void { if (!testView) { testView = new MainView(); mediatorMap.mediate(testView); } testView.removeRemoteHandler(message); } //---------------------------------- // //---------------------------------- public function mapTestProxy(testProxy:Proxy, injectClass:Class = null, name:String = ""):void { proxyMap.map(testProxy, injectClass, name); } public function getTestProxy(proxyClass:Class, name:String = ""):Proxy { return proxyMap.getProxy(proxyClass, name); } public function getProxyFromProxy(proxyClass:Class, name:String = ""):Proxy { return dataProxy.getTestProxy(proxyClass, name); } public function getProxyFromMediator(proxyClass:Class, name:String = ""):Proxy { if (!testView) { testView = new MainView(); mediatorMap.mediate(testView); } testView.testGetProxyClass(proxyClass, name); return dataProxy.testProxy; } public function getProxyInCommand(proxyClass:Class, name:String = ""):Proxy { commandMap.execute(GetProxyTestCommand, {moduleClass:proxyClass, moduleName:name}); return dataProxy.testProxy; } //---------------------------------- // //---------------------------------- public function get localCommandCount():int { return dataProxy.localCommandCount; } public function get localHandlerCount():int { return dataProxy.localHandlerCount; } public function get remoteCommandCount():int { return dataProxy.remoteCommandCount; } public function get remoteHandlerCount():int { return dataProxy.remoteHandlerCount; } // add tests with hosting. // add tests with multiply proxiest.?? (maybe dont belong here..) } }
/* 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; import com.adobe.test.Utils; var CODE = 1095; // XML parser failure: Unterminated attribute. //----------------------------------------------------------- //----------------------------------------------------------- try { var result = "no error"; var y = "<a b='/>"; var z = new XML(y); } catch (err) { result = err.toString(); } finally { Assert.expectEq("Runtime Error", Utils.TYPEERROR + CODE, Utils.typeError(result)); } //----------------------------------------------------------- //-----------------------------------------------------------
package com.playata.framework.display.lib.flash { import com.playata.framework.assets.AssetLoaderBase; import com.playata.framework.assets.IAsset; import com.playata.framework.assets.definition.AssetDefinition; import com.playata.framework.assets.location.ClassAssetLocationData; import com.playata.framework.core.data.IByteArray; import com.playata.framework.core.error.Exception; import com.playata.framework.display.assets.SpineAssetDefinitionData; import com.playata.framework.display.assets.SpineDefinitionAsset; import spine.SkeletonJson; import spine.atlas.Atlas; import spine.attachments.AtlasAttachmentLoader; import spine.flash.FlashTextureLoader; public class FlashSpineDefinitionsLoader extends AssetLoaderBase { public function FlashSpineDefinitionsLoader() { super(); } override protected function processAsset(param1:AssetDefinition, param2:IByteArray) : IAsset { var _loc8_:* = null; var _loc4_:* = null; var _loc10_:* = null; var _loc7_:* = null; var _loc5_:* = null; var _loc3_:* = null; var _loc9_:* = null; var _loc6_:* = null; try { _loc8_ = AssetLoaderBase.getStringFromData(param2); _loc4_ = param1.data as SpineAssetDefinitionData; _loc10_ = (assetLocations[0].getLocationData(new AssetDefinition(_loc4_.identifier + "Atlas")) as ClassAssetLocationData).data; _loc7_ = (assetLocations[0].getLocationData(new AssetDefinition(_loc4_.identifier + "Texture")) as ClassAssetLocationData).data; _loc5_ = new Atlas(new _loc10_(),new FlashTextureLoader(new _loc7_())); _loc3_ = new AtlasAttachmentLoader(_loc5_); _loc9_ = new SkeletonJson(_loc3_); _loc9_.scale = _loc4_.scale; _loc6_ = new SpineDefinitionAsset(_loc9_.readSkeletonData(_loc8_)); var _loc12_:* = _loc6_; return _loc12_; } catch(e:Error) { throw new Exception("Failed to load Spine Definition (invalid json): " + param1.identifier + " " + e.message); } return null; } } }
/* Copyright (c) 2012 Ivano Ras, ivano.ras@gmail.com See the file license.txt for copying permission. */ package subModels.globalTransitions { import subModels.*; // Global Transition 12 - Avalanche spreading linearly across the sphere. Such effect is achieved by means of a plane moving thru the sphere. // The plane parameters (centre + normal versor) are acquired from the PolyVisual instance that has been clicked on. // V2Transition12's function is to trigger off a LOCAL TRANSITION in each Poly instances after the plane has gone beyond // them in its movemenet across the sphere. See whiteboard for more details. public class V2Transition12 { private var _model:IV2Model, _pArrayModel:Array; // Sweeping plane data private var _n:Vector.<Number>=new Vector.<Number>(); private var _r:Vector.<Number>=new Vector.<Number>(); private var _sp:Number=0.33; // velocity of sweep_plane moving along the versor normal. // misc vars private var i:int, wo:int; private var test:Boolean, OnTickTest:Boolean; private var pCentre:Vector.<Number>; private var dpp0:Number, dpp1:Number, dpp2:Number; public function V2Transition12 (aModel:IV2Model, a:Vector.<Number>) { _model=aModel; _pArrayModel=_model.pArray; // init sweeping-plane data _r.push(a[0]); _r.push(a[1]); _r.push(a[2]); _n.push(-a[3]);_n.push(-a[4]);_n.push(-a[5]); // normal is reversed - plane will progress inwards, towards centre of sphere and beyond to carry out the sweep wo=_pArrayModel.length; for(i=0;i<wo;i++) _pArrayModel[i].locTransOVER=false; // reset flag "local transition over flag". } public function onTick ():void { OnTickTest=false; // set to false to catch whether there're still polygons not yet triggered off at the end of the for-loop. wo=_pArrayModel.length; for(i=0;i<wo;i++) { if (!_pArrayModel[i].locTrans12Flag) { if (SPlane_Test (_pArrayModel[i])) _pArrayModel[i].locTrans12Flag=true; // if the Poly passes the test, its local transition will get started. OnTickTest=true; // this assignment tells (outside the loop) that there've been being still polygons that needed to fire off their local transitions during this loop. } } shiftSPlane(); // check whether this V2Transition12 instance has done transitioning. If yes, let the model know about it and clean it all up. if (!OnTickTest) {_model.trans12Flag=false; _model=null; _pArrayModel=[]} // clean up } private function SPlane_Test (a:Poly):Boolean { test=false; pCentre=a.pMath.centre; // vector distance (centre_poli,_orig) See whiteboards for more details dpp0=pCentre[0]-_r[0]; dpp1=pCentre[1]-_r[1]; dpp2=pCentre[2]-_r[2]; if ((dpp0*_n[0]+dpp1*_n[1]+dpp2*_n[2])<0) test=true; return test; } private function shiftSPlane ():void{_r[0]+=_n[0]*_sp; _r[1]+=_n[1]*_sp; _r[2]+=_n[2]*_sp} } }
/* 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/. */ include "unicodeUtil.as"; include "unicodeNegativeUtil.as"; // var SECTION = "Hangul Jamo"; // var VERSION = "ECMA_3"; // var TITLE = "Test String functions (search, match, split, replace) on all unicode characters"; var array = new Array(); var item = 0; getTestCases(); var testcases = array; function getTestCases():void { // Hangul Jamo testUnicodeRange(0x1100, 0x11FF); negativeTestUnicodeRange(0x1100, 0x11FF); }
package de.karfau.signals { import flash.events.Event; import flash.events.EventDispatcher; import flash.events.MouseEvent; import org.hamcrest.assertThat; import org.hamcrest.collection.array; import org.hamcrest.collection.emptyArray; import org.hamcrest.object.equalTo; public class PropertyRelaySignalConstructorTest { private var signal:PropertyRelaySignal; private var dispatcher:EventDispatcher; private const eventClass:Class = MouseEvent; private const TEST:String = "test"; [Before] public function setUp ():void { dispatcher = new EventDispatcher(); } [After] public function tearDown ():void { signal = null; dispatcher = null; } [Test] public function twoArgsConstructor ():void { signal = new PropertyRelaySignal(dispatcher, TEST); assertThat(signal.target, equalTo(dispatcher)); assertThat(signal.eventClass, equalTo(Event)); assertThat(signal.valueClasses, emptyArray()); } [Test] public function threeArgsConstructor ():void { signal = new PropertyRelaySignal(dispatcher, TEST, eventClass); assertThat(signal.target, equalTo(dispatcher)); assertThat(signal.eventClass, equalTo(eventClass)); assertThat("signal.valueclasses has length of 0", signal.valueClasses, emptyArray()); } [Test] public function fourOrMoreArgsConstructor ():void { signal = new PropertyRelaySignal(dispatcher, TEST, eventClass, String, uint, Class); assertThat(signal.target, equalTo(dispatcher)); assertThat(signal.eventClass, equalTo(eventClass)); assertThat(signal.valueClasses, array(String, uint, Class)); } [Test(expects="ArgumentError")] public function fourArgsConstructorNull ():void { signal = new PropertyRelaySignal(dispatcher, TEST, eventClass, null); //assertThat(signal.eventClass, equalTo(clazz)); //assertThat(signal.valueClasses, array(null)); } } }
/* * BlobAnimation stores information about the animation, not the animation itself */ package toolbox { import flash.geom.Rectangle; public class BlobAnimation { public var name:String; public function BlobAnimation( name:String, numFrames:int, fps:Number, firstFrame:Rectangle, stripMaxX:int = 2880, stripMinX:int = 0 ) { __numFrames = numFrames; __fps = fps; __msToAdvance = 1000 / __fps; __firstFrame = firstFrame; __stripMinX = stripMinX; __stripMaxX = stripMaxX; resetFramePosition(); } public function play( currentTimeBias:int = 0 ):void { __msLeft = __msToAdvance + currentTimeBias; } public function update( deltaTime:int ):void { __msLeft -= deltaTime; while( __msLeft < 0 ) { __currentFrameNum++; if( __currentFrameNum > __numFrames ) { __currentFrameNum = 1; resetFramePosition(); } else { advanceFramePosition(); } __msLeft += __msToAdvance; } } public function get currentFrame():int { return __currentFrameNum; } public function get rect():Rectangle { return __currentFrame; } public function set currentFrame( frame:int ):void { __currentFrameNum = frame; __msLeft = __msToAdvance; resetFramePosition(); for( var i:int = 1 ; i < frame ; i++ ) { advanceFramePosition(); } } public function destroy():void { } private var __currentFrameNum:int; private var __fps:Number; private var __msToAdvance:int; private var __msLeft:int; private var __numFrames:int; private var __firstFrame:Rectangle; private var __currentFrame:Rectangle; private var __stripMinX:int; private var __stripMaxX:int; private function advanceFramePosition():void { __currentFrame.x += __currentFrame.width; if( __currentFrame.x + __currentFrame.width > __stripMaxX ) { __currentFrame.x = __stripMinX; __currentFrame.y += __currentFrame.height; } } private function resetFramePosition():void { __currentFrame = new Rectangle( __firstFrame.x, __firstFrame.y, __firstFrame.width, __firstFrame.height ); } } }
package com.adobe.cep { /** * @author harbs */ public class FS { /** * @constant No error. */ static public const NO_ERROR : int = 0; /** * @constant Unknown error occurred. */ static public const ERR_UNKNOWN : int = 1; /** * @constant Invalid parameters passed to function. */ static public const ERR_INVALID_PARAMS : int = 2; /** * @constant File or directory was not found. */ static public const ERR_NOT_FOUND : int = 3; /** * @constant File or directory could not be read. */ static public const ERR_CANT_READ : int = 4; /** * @constant An unsupported encoding value was specified. */ static public const ERR_UNSUPPORTED_ENCODING : int = 5; /** * @constant File could not be written. */ static public const ERR_CANT_WRITE : int = 6; /** * @constant Target directory is out of space. File could not be written. */ static public const ERR_OUT_OF_SPACE : int = 7; /** * @constant Specified path does not point to a file. */ static public const ERR_NOT_FILE : int = 8; /** * @constant Specified path does not point to a directory. */ static public const ERR_NOT_DIRECTORY : int = 9; /** * @constant Specified file already exists. */ static public const ERR_FILE_EXISTS : int = 10; /** * @constant The maximum number of processes has been exceeded. */ /** * Displays the OS File Open dialog, allowing the user to select files or directories. * * @param allowMultipleSelection {boolean} When true, multiple files/folders can be selected. * @param chooseDirectory {boolean} When true, only folders can be selected. When false, only * files can be selected. * @param title {string} Title of the open dialog. * @param initialPath {string} Initial path to display in the dialog. Pass NULL or "" to * display the last path chosen. * @param fileTypes {Array.<string>} The file extensions (without the dot) for the types * of files that can be selected. Ignored when chooseDirectory=true. * * @return An object with these properties: * <ul><li>"data": An array of the full names of the selected files.</li> * <li>"err": The status of the operation, one of * <br>NO_ERROR * <br>ERR_INVALID_PARAMS </li> * </ul> **/ public function showOpenDialog(allowMultipleSelection : Boolean, chooseDirectory : Boolean, title : String, initialPath : String = null, fileTypes : Array = null) : Object { allowMultipleSelection;chooseDirectory;title;initialPath;fileTypes; return null; } /** * Displays the OS File Open dialog, allowing the user to select files or directories. * * @param allowMultipleSelection {boolean} When true, multiple files/folders can be selected. * @param chooseDirectory {boolean} When true, only folders can be selected. When false, only * files can be selected. * @param title {string} Title of the open dialog. * @param initialPath {string} Initial path to display in the dialog. Pass NULL or "" to * display the last path chosen. * @param fileTypes {Array.<string>} The file extensions (without the dot) for the types * of files that can be selected. Ignored when chooseDirectory=true. * @param friendlyFilePrefix {string} String to put in front of the extensions * of files that can be selected. Ignored when chooseDirectory=true. (win only) * For example: * fileTypes = ["gif", "jpg", "jpeg", "png", "bmp", "webp", "svg"]; * friendlyFilePrefix = "Images (*.gif;*.jpg;*.jpeg;*.png;*.bmp;*.webp;*.svg)"; * @param prompt {string} String for OK button (mac only, default is "Open" on mac, "Open" or "Select Folder" on win). * * @return An object with these properties: * <ul><li>"data": An array of the full names of the selected files.</li> * <li>"err": The status of the operation, one of * <br>NO_ERROR * <br>ERR_INVALID_PARAMS </li> * </ul> **/ public function showOpenDialogEx(allowMultipleSelection : Boolean, chooseDirectory : Boolean, title : String, initialPath : String = null, fileTypes : Array = null, friendlyFilePrefix : String = null, prompt : String = null) : Object { allowMultipleSelection;chooseDirectory;title;initialPath;fileTypes;friendlyFilePrefix;prompt; return null; } /** * Displays the OS File Save dialog, allowing the user to type in a file name. * * @param title {string} Title of the save dialog. * @param initialPath {string} Initial path to display in the dialog. Pass NULL or "" to * display the last path chosen. * @param fileTypes {Array.<string>} The file extensions (without the dot) for the types * of files that can be selected. * @param defaultName {string} String to start with for the file name. * @param friendlyFilePrefix {string} String to put in front of the extensions of files that can be selected. (win only) * For example: * fileTypes = ["gif", "jpg", "jpeg", "png", "bmp", "webp", "svg"]; * friendlyFilePrefix = "Images (*.gif;*.jpg;*.jpeg;*.png;*.bmp;*.webp;*.svg)"; * @param prompt {string} String for Save button (mac only, default is "Save" on mac and win). * @param nameFieldLabel {string} String displayed in front of the file name text field (mac only, "File name:" on win). * * @return An object with these properties: * <ul><li>"data": The file path selected to save at or "" if canceled</li> * <li>"err": The status of the operation, one of * <br>NO_ERROR * <br>ERR_INVALID_PARAMS </li> * </ul> **/ public function showSaveDialogEx(title : String, initialPath : String = null, fileTypes : Array = null, defaultName : String = null, friendlyFilePrefix : String = null, prompt : String = null, nameFieldLabel : String = null) : Object { title;initialPath;fileTypes;defaultName;friendlyFilePrefix;prompt;nameFieldLabel; return null; } /** * Reads the contents of a folder. * * @param path {string} The path of the folder to read. * * @return An object with these properties: * <ul><li>"data": An array of the names of the contained files (excluding '.' and '..'.</li> * <li>"err": The status of the operation, one of: * <br>NO_ERROR * <br>ERR_UNKNOWN * <br>ERR_INVALID_PARAMS * <br>ERR_NOT_FOUND * <br>ERR_CANT_READ </li></ul> **/ public function readdir(path : String) : Object { path; return null; }; /** * Creates a new folder. * * @param path {string} The path of the folder to create. * * @return An object with this property: * <ul><li>"err": The status of the operation, one of: * <br>NO_ERROR * <br>ERR_UNKNOWN * <br>ERR_INVALID_PARAMS</li></ul> **/ public function makedir(path : String) : Object { path; return null; }; /** * Renames a file or folder. * * @param oldPath {string} The old name of the file or folder. * @param newPath {string} The new name of the file or folder. * * @return An object with this property: * <ul><li>"err": The status of the operation, one of: * <br>NO_ERROR * <br>ERR_UNKNOWN * <br>ERR_INVALID_PARAMS * <br>ERR_NOT_FOUND * <br>ERR_FILE_EXISTS </li></ul> **/ public function rename(oldPath : String, newPath : String) : Object { oldPath;newPath; return null; }; /** * Reports whether an item is a file or folder. * * @param path {string} The path of the file or folder. * * @return An object with these properties: * <ul><li>"data": An object with properties * <br>isFile (boolean) * <br>isDirectory (boolean) * <br>mtime (modification DateTime) </li> * <li>"err": The status of the operation, one of * <br>NO_ERROR * <br>ERR_UNKNOWN * <br>ERR_INVALID_PARAMS * <br>ERR_NOT_FOUND </li> * </ul> **/ public function stat(path : String) : Object { path; return null; }; /** * Reads the entire contents of a file. * * @param path {string} The path of the file to read. * @param encoding {string} The encoding of the contents of file, one of * UTF8 (the default) or Base64. * * @return An object with these properties: * <ul><li>"data": The file contents. </li> * <li>"err": The status of the operation, one of * <br>NO_ERROR * <br>ERR_UNKNOWN * <br>ERR_INVALID_PARAMS * <br>ERR_NOT_FOUND * <br>ERR_CANT_READ * <br>ERR_UNSUPPORTED_ENCODING </li> * </ul> **/ public function readFile(path : String, encoding : String) : Object { path;encoding; return null; }; /** * Writes data to a file, replacing the file if it already exists. * * @param path {string} The path of the file to write. * @param data {string} The data to write to the file. * @param encoding {string} The encoding of the contents of file, one of * UTF8 (the default) or Base64. * * @return An object with this property: * <ul><li>"err": The status of the operation, one of: * <br>NO_ERROR * <br>ERR_UNKNOWN * <br>ERR_INVALID_PARAMS * <br>ERR_UNSUPPORTED_ENCODING * <br>ERR_CANT_WRITE * <br>ERR_OUT_OF_SPACE </li></ul> **/ public function writeFile(path : String, data : String, encoding : String):Object { path;data;encoding; return null; }; /** * Sets permissions for a file or folder. * * @param path {string} The path of the file or folder. * @param mode {number} The permissions in numeric format (for example, 0777). * * @return An object with this property: * <ul><li>"err": The status of the operation, one of: * <br>NO_ERROR * <br>ERR_UNKNOWN * <br>ERR_INVALID_PARAMS * <br>ERR_CANT_WRITE </li></ul> **/ public function chmod(path : String, mode : Number):Object { path;mode; return null; }; /** * Deletes a file. * * @param path {string} The path of the file to delete. * * @return An object with this property: * <ul><li>"err": The status of the operation, one of: * <br>NO_ERROR * <br>ERR_UNKNOWN * <br>ERR_INVALID_PARAMS * <br>ERR_NOT_FOUND * <br>ERR_NOT_FILE </li></ul> **/ public function deleteFile(path : String) : Object { path; return null; }; } }
/** * Copyright (C) 2008 Darshan Sawardekar. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.puremvc.as3.multicore.utilities.fabrication.patterns.observer { import org.puremvc.as3.multicore.utilities.fabrication.interfaces.IDisposable; import org.puremvc.as3.multicore.patterns.observer.Notification; /** * Notification object used to send fabrication system notifications. * * @author Darshan Sawardekar */ public class FabricationNotification extends Notification implements IDisposable { /** * Application startup notification */ static public const STARTUP:String = "startup"; /** * Application shutdown notification */ static public const SHUTDOWN:String = "shutdown"; /** * Application bootstrap notification. Notified immediately after * the startup notification. It can be used to break the startup * commands into Proxy, Mediator etc creation and an optional * configuration load(from xml) etc stage. */ static public const BOOTSTRAP:String = "bootstrap"; /** * Undo's the last command executed. */ static public const UNDO:String = "undo"; /** * Redo's the last command undone. */ static public const REDO:String = "redo"; /** * Changes the current undo group. The notification body is the name of the undo group. */ static public const CHANGE_UNDO_GROUP:String = "changeUndoGroup"; /** * Creates a new FabricationNotification object. */ public function FabricationNotification(name:String, body:Object = null, type:String = null) { super(name, body, type); } /** * Returns the number of steps to undo. Default is 1. */ public function steps():int { return getBody() as int; } /** * @see org.puremvc.as3.multicore.utilities.fabrication.patterns.observer.FabricationNotification */ public function dispose():void { setBody(null); setType(null); } } }
import mx.core.IFlexModuleFactory; import mx.core.UIComponent; import mx.styles.AdvancedStyleClient; import mx.styles.CSSStyleDeclaration; import mx.styles.IAdvancedStyleClient; import mx.styles.IStyleManager2; import mx.styles.StyleProtoChain; import mx.utils.NameUtil; //////////////////////////////////////////////////////////////////////////////// // // 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. // //////////////////////////////////////////////////////////////////////////////// private var _advancedStyleClient:AdvancedStyleClient_; private function initAdvancedStyleClient():void { _advancedStyleClient = new AdvancedStyleClient_(this); _advancedStyleClient.addEventListener("allStylesChanged", dispatchIfListenersExist); } private function dispatchIfListenersExist(event:Event):void { if(hasEventListener(event.type)) dispatchEvent(event); } public function get id():String { return _advancedStyleClient.id; } public function set id(value:String):void { _advancedStyleClient.id = value; } public function get styleParent():IAdvancedStyleClient { return _advancedStyleClient.styleParent; } public function set styleParent(parent:IAdvancedStyleClient):void { _advancedStyleClient.styleParent = parent; } public function stylesInitialized():void { _advancedStyleClient.stylesInitialized(); } public function matchesCSSState(cssState:String):Boolean { return _advancedStyleClient.matchesCSSState(cssState); } public function matchesCSSType(cssType:String):Boolean { return _advancedStyleClient.matchesCSSType(cssType); } public function hasCSSState():Boolean { return _advancedStyleClient.hasCSSState(); } public function get className():String { return _advancedStyleClient.className; } public function get inheritingStyles():Object { return _advancedStyleClient.inheritingStyles; } public function set inheritingStyles(value:Object):void { _advancedStyleClient.inheritingStyles = value; } public function get nonInheritingStyles():Object { return _advancedStyleClient.nonInheritingStyles; } public function set nonInheritingStyles(value:Object):void { _advancedStyleClient.nonInheritingStyles = value; } public function get styleDeclaration():CSSStyleDeclaration { return _advancedStyleClient.styleDeclaration; } public function set styleDeclaration(value:CSSStyleDeclaration):void { _advancedStyleClient.styleDeclaration = value; } public function getStyle(styleProp:String):* { return _getStyle(styleProp); } public function setStyle(styleProp:String, newValue:*):void { _setStyle(styleProp, newValue); } public function clearStyle(styleProp:String):void { _advancedStyleClient.clearStyle(styleProp); } public function getClassStyleDeclarations():Array { return _advancedStyleClient.getClassStyleDeclarations(); } public function notifyStyleChangeInChildren(styleProp:String, recursive:Boolean):void { _advancedStyleClient.notifyStyleChangeInChildren(styleProp, recursive) } public function regenerateStyleCache(recursive:Boolean):void { _advancedStyleClient.regenerateStyleCache(recursive); } public function registerEffects(effects:Array):void { _advancedStyleClient.registerEffects(effects); } public function get styleName():Object { return _advancedStyleClient.styleName; } public function set styleName(value:Object):void { _advancedStyleClient.styleName = value; } public function styleChanged(styleProp:String):void { _advancedStyleClient.addEventListener(styleProp + "Changed", dispatchIfListenersExist); _styleChanged(styleProp); _advancedStyleClient.removeEventListener(styleProp + "Changed", dispatchIfListenersExist); } public function get styleManager():IStyleManager2 { return _advancedStyleClient.styleManager; } public function get moduleFactory():IFlexModuleFactory { return _advancedStyleClient.moduleFactory; } public function set moduleFactory(factory:IFlexModuleFactory):void { _advancedStyleClient.moduleFactory = factory; } public function initialized(document:Object, id:String):void { _advancedStyleClient.initialized(document, id); }
package egg82.base { import egg82.enums.OptionsRegistryType; import egg82.enums.ServiceType; import egg82.events.base.BaseLoadingStateEvent; import egg82.events.ImageDecoderEvent; import egg82.events.net.SimpleURLLoaderEvent; import egg82.net.SimpleURLLoader; import egg82.patterns.Observer; import egg82.patterns.ServiceLocator; import egg82.registry.interfaces.IRegistry; import egg82.utils.ImageDecoder; import flash.display.BitmapData; import flash.utils.ByteArray; import starling.text.TextField; import starling.utils.HAlign; import starling.utils.VAlign; /** * ... * @author Alex */ public class BaseLoadingState extends BaseState { //vars public static const OBSERVERS:Vector.<Observer> = new Vector.<Observer>(); private var font:String = "visitor"; private var loadingString:String = "Loading.."; private var fileArr:Array; private var centerText:TextField; private var imageDecoders:Vector.<ImageDecoder> = new Vector.<ImageDecoder>(); private var urlLoaders:Vector.<SimpleURLLoader>; private var retries:Vector.<uint>; private var currentFile:uint; private var _loadedFiles:Number; private var _totalFiles:Number; private var maxRetry:uint; private var _decodedFiles:Number; private var _totalDecodeFiles:Number; private var urlLoaderObserver:Observer = new Observer(); private var imageDecoderObserver:Observer = new Observer(); private var optionsRegistry:IRegistry = ServiceLocator.getService(ServiceType.OPTIONS_REGISTRY) as IRegistry; //constructor public function BaseLoadingState() { } //public override public function create(args:Array = null):void { super.create(args); throwErrorOnArgsNull(args); fileArr = getArg(args, "fileArr") as Array; if (getArg(args, "font")) { font = getArg(args, "font") as String; if (!font) { throw new Error("font cannot be null."); } } if (getArg(args, "loadingString")) { loadingString = getArg(args, "loadingString") as String; if (!loadingString) { throw new Error("loadingString cannot be null"); } } if (!fileArr || fileArr.length == 0) { dispatch(BaseLoadingStateEvent.COMPLETE); nextState(); return; } urlLoaderObserver.add(onUrlLoaderObserverNotify); Observer.add(SimpleURLLoader.OBSERVERS, urlLoaderObserver); imageDecoderObserver.add(onImageDecoderObserverNotify); Observer.add(ImageDecoder.OBSERVERS, imageDecoderObserver); centerText = new TextField(0, 0, loadingString + "\n0/0\n0.00%", font, 22, 0x000000, false); centerText.hAlign = HAlign.CENTER; centerText.vAlign = VAlign.CENTER; addChild(centerText); _loadedFiles = 0; _totalFiles = fileArr.length; _decodedFiles = 0; _totalDecodeFiles = 0; maxRetry = REGISTRY_UTIL.getOption(OptionsRegistryType.NETWORK, "maxRetry") as uint; setLoaded(0, _totalFiles); urlLoaders = new Vector.<SimpleURLLoader>(); retries = new Vector.<uint>(); var toLoad:uint = currentFile = Math.min(optionsRegistry.getRegister(OptionsRegistryType.NETWORK).threads, _totalFiles); var loaded:uint = 0; currentFile--; while (loaded < toLoad) { urlLoaders.push(new SimpleURLLoader()); retries.push(0); urlLoaders[urlLoaders.length - 1].load(fileArr[loaded]); loaded++; } } override public function resize():void { super.resize(); if (centerText) { centerText.width = stage.stageWidth; centerText.height = stage.stageHeight; } } override public function destroy():void { Observer.remove(SimpleURLLoader.OBSERVERS, urlLoaderObserver); Observer.remove(ImageDecoder.OBSERVERS, imageDecoderObserver); cancelAll(); super.destroy(); } //private protected function setLoaded(loadedFiles:uint, totalFiles:uint):void { centerText.text = loadingString + "\n" + loadedFiles + "/" + totalFiles + "\n" + ((loadedFiles / totalFiles) * 100).toFixed(2) + "%"; } protected function decodeImage(name:String, data:ByteArray):void { _totalDecodeFiles++; setLoaded(_loadedFiles + _decodedFiles, _totalFiles + _totalDecodeFiles); imageDecoders.push(new ImageDecoder()); imageDecoders[imageDecoders.length - 1].decode(data, name); } protected function cancelAll():void { var i:uint; if (urlLoaders) { for (i = 0; i < urlLoaders.length; i++) { urlLoaders[i].cancel(); } } if (imageDecoders) { for (i = 0; i < imageDecoders.length; i++) { imageDecoders[i].cancel(); } } } private function getTotal(inV:Vector.<Number>):Number { var retNum:Number = 0; for (var i:uint = 0; i < inV.length; i++) { if (!isNaN(inV[i])) { retNum += inV[i]; } } return retNum; } private function onUrlLoaderObserverNotify(sender:Object, event:String, data:Object):void { var isInVec:Boolean = false; for (var i:uint = 0; i < urlLoaders.length; i++) { if (sender === urlLoaders[i]) { isInVec = true; break; } } if (!isInVec) { return; } if (event == SimpleURLLoaderEvent.COMPLETE) { setLoaded(_loadedFiles + _decodedFiles, _totalFiles + _totalDecodeFiles); onUrlLoaderComplete(sender as SimpleURLLoader, data as ByteArray); } else if (event == SimpleURLLoaderEvent.ERROR) { dispatch(BaseLoadingStateEvent.ERROR, data); if (retries[i] < maxRetry) { (sender as SimpleURLLoader).load((sender as SimpleURLLoader).file); retries[i]++; } else { centerText.text = "Error loading file\n" + (data as String); cancelAll(); } } } private function onUrlLoaderComplete(loader:SimpleURLLoader, data:ByteArray):void { var name:String = REGISTRY_UTIL.stripURL(loader.file); dispatch(BaseLoadingStateEvent.DOWNLOAD_COMPLETE, { "name": name, "data": data }); _loadedFiles++; setLoaded(_loadedFiles + _decodedFiles, _totalFiles + _totalDecodeFiles); if (currentFile < _totalFiles - 1) { currentFile++; if (currentFile > _totalFiles - 1) { trace("Skipping loading file " + currentFile); if (_loadedFiles == _totalFiles && _decodedFiles == _totalDecodeFiles) { dispatch(BaseLoadingStateEvent.COMPLETE); nextState(); return; } } loader.load(fileArr[currentFile]); } else { if (_loadedFiles == _totalFiles && _decodedFiles == _totalDecodeFiles) { dispatch(BaseLoadingStateEvent.COMPLETE); nextState(); } } } private function onImageDecoderObserverNotify(sender:Object, event:String, data:Object):void { var isInVec:Boolean = false; for (var i:uint = 0; i < imageDecoders.length; i++) { if (sender === imageDecoders[i]) { isInVec = true; break; } } if (!isInVec) { return; } if (event == ImageDecoderEvent.COMPLETE) { onImageDecoderComplete(sender as ImageDecoder, data as BitmapData); } else if (event == ImageDecoderEvent.ERROR) { dispatch(BaseLoadingStateEvent.ERROR, data); centerText.text = "Error loading file\n" + (data as String); } } private function onImageDecoderComplete(decoder:ImageDecoder, data:BitmapData):void { var name:String = REGISTRY_UTIL.stripURL(decoder.file); dispatch(BaseLoadingStateEvent.DECODE_COMPLETE, { "name": name, "data": data }); _decodedFiles++; setLoaded(_loadedFiles + _decodedFiles, _totalFiles + _totalDecodeFiles); if (_loadedFiles == _totalFiles && _decodedFiles == _totalDecodeFiles) { dispatch(BaseLoadingStateEvent.COMPLETE); nextState(); } } override protected function dispatch(event:String, data:Object = null):void { Observer.dispatch(OBSERVERS, this, event, data); } } }
/* Copyright 2016-2021 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 com.as3mxml.royale.utils { /** * Utilities for finding and running executables from an Apache Royale SDK. */ public class ApacheRoyaleUtils { /** * @private */ private static const ASJSC:String = "asjsc"; /** * @private */ private static const ENV_ROYALE_HOME:String = "ROYALE_HOME"; /** * @private */ private static const ENV_PATH:String = "PATH"; /** * @private */ private static const ROYALE_ASJS:String = "royale-asjs"; /** * @private */ private static const NODE_MODULES:String = "node_modules"; /** * @private */ private static const NPM_ORG_ROYALE:String = "@apache-royale"; /** * @private */ private static const NPM_PACKAGE_ROYALE_JS:String = "royale-js"; /** * @private */ private static const NPM_PACKAGE_ROYALE_SWF:String = "royale-js-swf"; /** * @private */ private static const ROYALE_SDK_DESCRIPTION:String = "royale-sdk-description.xml"; /** * Determines if a directory contains a valid Apache Royale SDK. */ public static function isValidSDK(absolutePath:String):String { if(!absolutePath) { return null; } if(isValidSDKInternal(absolutePath)) { return absolutePath; } var royalePath:String = path.join(absolutePath, ROYALE_ASJS); if(isValidSDKInternal(royalePath)) { return royalePath; } return null; } private static function isValidSDKInternal(absolutePath:String):Boolean { if(!absolutePath) { return false; } var sdkDescriptionPath:String = path.join(absolutePath, ROYALE_SDK_DESCRIPTION); if(!fs.existsSync(sdkDescriptionPath) || fs.statSync(sdkDescriptionPath).isDirectory()) { return false; } return true; } /** * Attempts to find a valid Apache Royale SDK by searching for * installed npm modules, testing the ROYALE_HOME environment variable, * and finally, testing the PATH environment variable. */ public static function findSDK():String { var sdkPath:String = null; //look for an npm module try { sdkPath = path.join(process.cwd(), NODE_MODULES, NPM_ORG_ROYALE, NPM_PACKAGE_ROYALE_JS); sdkPath = isValidSDK(sdkPath) if(sdkPath != null) { return sdkPath; } } catch(error) {}; try { sdkPath = path.join(process.cwd(), NODE_MODULES, NPM_ORG_ROYALE, NPM_PACKAGE_ROYALE_SWF); sdkPath = isValidSDK(sdkPath) if(sdkPath != null) { return sdkPath; } } catch(error) {}; if(ENV_ROYALE_HOME in process.env) { sdkPath = process.env[ENV_ROYALE_HOME]; sdkPath = isValidSDK(sdkPath) if(sdkPath != null) { return sdkPath; } } if(ENV_PATH in process.env) { var paths:Array = process.env[ENV_PATH].split(path.delimiter); var pathCount:int = paths.length; for(var i:int = 0; i < pathCount; i++) { var currentPath:String = paths[i]; //first check if this directory contains the NPM version for //Windows var asjscPath:String = path.join(currentPath, ASJSC + ".cmd"); if(fs.existsSync(asjscPath)) { sdkPath = path.join(path.dirname(asjscPath), NODE_MODULES, NPM_ORG_ROYALE, NPM_PACKAGE_ROYALE_JS); sdkPath = isValidSDK(sdkPath) if(sdkPath != null) { return sdkPath; } sdkPath = path.join(path.dirname(asjscPath), NODE_MODULES, NPM_ORG_ROYALE, NPM_PACKAGE_ROYALE_SWF); sdkPath = isValidSDK(sdkPath) if(sdkPath != null) { return sdkPath; } } asjscPath = path.join(currentPath, ASJSC); if(fs.existsSync(asjscPath)) { //this may a symbolic link rather than the actual file, //such as when Apache Royale is installed with NPM on //Mac, so get the real path. asjscPath = fs.realpathSync(asjscPath); sdkPath = path.join(path.dirname(asjscPath), "..", ".."); sdkPath = isValidSDK(sdkPath) if(sdkPath != null) { return sdkPath; } } } } return null; } } }
package com.gamesparks.api.requests { import com.gamesparks.api.responses.*; import com.gamesparks.*; /** * Allows a PSN account to be used as an authentication mechanism. * Once authenticated the platform can determine the current players details from the PSN platform and store them within GameSparks. * GameSparks will determine the player's friends and whether any of them are currently registered with the game. * If the PSN user is already linked to a player, the current session will switch to the linked player. * If the current player has previously created an account using either DeviceAuthentictionRequest or RegistrationRequest AND the PSN user is not already registered with the game, the PSN user will be linked to the current player. * If the current player has not authenticated and the PSN user is not known, a new player will be created using the PSN details and the session will be authenticated against the new player. * If the PSN user is already known, the session will switch to being the previously created user. */ public class PSNConnectRequest extends GSRequest { function PSNConnectRequest(gs:GS) { super(gs); data["@class"] = ".PSNConnectRequest"; } /** * set the timeout for this request */ public function setTimeoutSeconds(timeoutSeconds:int=10):PSNConnectRequest { this.timeoutSeconds = timeoutSeconds; return this; } /** * Send the request to the server. The callback function will be invoked with the response */ public override function send (callback : Function) : String{ return super.send( function(message:Object) : void{ if(callback != null) { callback(new AuthenticationResponse(message)); } } ); } public function setScriptData(scriptData:Object):PSNConnectRequest{ data["scriptData"] = scriptData; return this; } /** * The authorization code obtained from PSN, as described here https://ps4.scedev.net/resources/documents/SDK/latest/NpAuth-Reference/0008.html */ public function setAuthorizationCode( authorizationCode : String ) : PSNConnectRequest { this.data["authorizationCode"] = authorizationCode; return this; } /** * Indicates that the server should not try to link the external profile with the current player. If false, links the external profile to the currently signed in player. If true, creates a new player and links the external profile to them. Defaults to false. */ public function setDoNotLinkToCurrentPlayer( doNotLinkToCurrentPlayer : Boolean ) : PSNConnectRequest { this.data["doNotLinkToCurrentPlayer"] = doNotLinkToCurrentPlayer; return this; } /** * Indicates whether the server should return an error if an account switch would have occurred, rather than switching automatically. Defaults to false. */ public function setErrorOnSwitch( errorOnSwitch : Boolean ) : PSNConnectRequest { this.data["errorOnSwitch"] = errorOnSwitch; return this; } /** * When using the authorization code obtained from PlayStation®4/PlayStation®Vita/PlayStation®3, this is not required. * When using the authorization code obtained with the PC authentication gateway, set the URI issued from the Developer Network website. */ public function setRedirectUri( redirectUri : String ) : PSNConnectRequest { this.data["redirectUri"] = redirectUri; return this; } /** * An optional segment configuration for this request. * If this request creates a new player on the gamesparks platform, the segments of the new player will match the values provided */ public function setSegments( segments : Object ) : PSNConnectRequest { this.data["segments"] = segments; return this; } /** * Indicates that the server should switch to the supplied profile if it isalready associated to a player. Defaults to false. */ public function setSwitchIfPossible( switchIfPossible : Boolean ) : PSNConnectRequest { this.data["switchIfPossible"] = switchIfPossible; return this; } /** * Indicates that the associated players displayName should be kept in syn with this profile when it's updated by the external provider. */ public function setSyncDisplayName( syncDisplayName : Boolean ) : PSNConnectRequest { this.data["syncDisplayName"] = syncDisplayName; return this; } } }
import templateSlider.util.*; import templateSlider.mvc.*; import templateSlider.I.* interface templateSlider.I.Controller { public function setModel (m:Observable):Void; public function getModel ():Observable; public function setView (v:View):Void; public function getView ():View; }
// Copyright 2020 Cadic AB. All Rights Reserved. // @URL https://github.com/Temaran/Feather // @Author Fredrik Lindh [Temaran] (temaran@gmail.com) //////////////////////////////////////////////////////////// UCLASS(Abstract) class UFeatherStyleBase : UUserWidget { }; UCLASS(Abstract) class UFeatherWindowStyle : UFeatherStyleBase { // Set this to your UFeatherWindow UPROPERTY(Category = "Feather|Style") UWidget ActualWindow; UFUNCTION(Category = "Feather|Style", BlueprintEvent, BlueprintPure) UNamedSlot GetWindowContentSlot() const { return nullptr; } UFUNCTION(Category = "Feather|Style", BlueprintEvent) void SetNewActualWindow(UWidget InActualWindow) { ActualWindow = InActualWindow; } }; event void FButtonClickedWithContextSignature(UFeatherButtonStyle ThisButton); UCLASS(Abstract) class UFeatherButtonStyle : UFeatherStyleBase { UPROPERTY(Category = "Feather|Style") bool bUseStyleOverride; UPROPERTY(Category = "Feather|Style", meta = (EditCondition = bUseStyleOverride)) FButtonStyle OverrideButtonStyle; UPROPERTY(Category = "Feather|Style", meta = (EditCondition = bUseStyleOverride)) FLinearColor OverrideButtonTint; UPROPERTY(Category = "Feather|Style") FButtonClickedWithContextSignature OnClickedWithContext; UFUNCTION(Category = "Feather|Style", BlueprintEvent, BlueprintPure) UButton GetButtonWidget() const { return nullptr; } UFUNCTION(BlueprintOverride) void PreConstruct(bool bIsDesignTime) { SetStyleOverride(); } UFUNCTION(BlueprintOverride) void Construct() { SetStyleOverride(); } void SetStyleOverride() { if(bUseStyleOverride) { GetButtonWidget().SetStyle(OverrideButtonStyle); GetButtonWidget().SetBackgroundColor(OverrideButtonTint); } } // Call this from your style if you want to support this! UFUNCTION(Category = "Feather|Style", BlueprintEvent, BlueprintCallable) void ClickedWithContext() { OnClickedWithContext.Broadcast(this); } }; event void FCheckBoxCheckedWithContextSignature(UFeatherCheckBoxStyle CheckBox, bool bIsChecked); UCLASS(Abstract) class UFeatherCheckBoxStyle : UFeatherStyleBase { UPROPERTY(Category = "Feather|Style") FCheckBoxCheckedWithContextSignature OnCheckedStateChangedWithContext; UFUNCTION(Category = "Feather|Style", BlueprintEvent, BlueprintPure) UCheckBox GetCheckBoxWidget() const { return nullptr; } UFUNCTION(Category = "Feather|Style", BlueprintPure) bool IsChecked() const { return GetCheckBoxWidget().IsChecked(); } UFUNCTION(Category = "Feather|Style") void SetIsChecked(bool bNewCheckedState) { GetCheckBoxWidget().SetIsChecked(bNewCheckedState); // CheckStateChanged is not called for checkboxes when set from code GetCheckBoxWidget().OnCheckStateChanged.Broadcast(bNewCheckedState); } // Call this from your style if you want to support this! UFUNCTION(Category = "Feather|Style", BlueprintEvent, BlueprintCallable) void CheckedStateChangedWithContext(bool bNewCheckedState) { OnCheckedStateChangedWithContext.Broadcast(this, bNewCheckedState); } }; event void FComboBoxSelectionChangedWithContextSignature(UFeatherComboBoxStyle ComboBox, FString SelectedItem, ESelectInfo SelectionType); UCLASS(Abstract) class UFeatherComboBoxStyle : UFeatherStyleBase { UPROPERTY(Category = "Feather|Style") bool bUseStyleOverride; UPROPERTY(Category = "Feather|Style", meta = (EditCondition = bUseStyleOverride)) TArray<FString> DefaultOptions; UPROPERTY(Category = "Feather|Style", meta = (EditCondition = bUseStyleOverride)) FString SelectedOption; UPROPERTY(Category = "Feather|Style") FComboBoxSelectionChangedWithContextSignature OnSelectionChangedWithContext; UFUNCTION(Category = "Feather|Style", BlueprintEvent, BlueprintPure) UComboBoxString GetComboBoxWidget() const { return nullptr; } UFUNCTION(Category = "Feather|Style", BlueprintPure) FString GetSelectedOption() const { return GetComboBoxWidget().GetSelectedOption(); } UFUNCTION(Category = "Feather|Style", BlueprintPure) int GetSelectedIndex() const { return GetComboBoxWidget().GetSelectedIndex(); } UFUNCTION(Category = "Feather|Style") void SetSelectedOption(FString NewSelectedOption) { GetComboBoxWidget().SetSelectedOption(NewSelectedOption); } UFUNCTION(Category = "Feather|Style") void SetSelectedIndex(int NewSelectedIndex) { GetComboBoxWidget().SetSelectedIndex(NewSelectedIndex); } UFUNCTION(BlueprintOverride) void PreConstruct(bool bIsDesignTime) { SetStyleOverride(); } UFUNCTION(BlueprintOverride) void Construct() { SetStyleOverride(); } void SetStyleOverride() { if(bUseStyleOverride) { GetComboBoxWidget().ClearOptions(); for(FString DefaultOption : DefaultOptions) { GetComboBoxWidget().AddOption(DefaultOption); } GetComboBoxWidget().SetSelectedOption(SelectedOption); } } // Call this from your style if you want to support this! UFUNCTION(Category = "Feather|Style", BlueprintEvent, BlueprintCallable) void SelectionChangedWithContext(FString SelectedItem, ESelectInfo SelectionType) { OnSelectionChangedWithContext.Broadcast(this, SelectedItem, SelectionType); } }; event void FSliderValueChangedWithContextSignature(UFeatherSliderStyle Slider, float NewValue); UCLASS(Abstract) class UFeatherSliderStyle : UFeatherStyleBase { UPROPERTY(Category = "Feather|Style") bool bUseStyleOverride; UPROPERTY(Category = "Feather|Style", meta = (EditCondition = bUseStyleOverride)) float InitialValue; UPROPERTY(Category = "Feather|Style") FSliderValueChangedWithContextSignature OnValueChangedWithContext; UFUNCTION(Category = "Feather|Style", BlueprintEvent, BlueprintPure) USlider GetSliderWidget() const { return nullptr; } UFUNCTION(Category = "Feather|Style", BlueprintPure) float GetValue() const { return GetSliderWidget().GetValue(); } UFUNCTION(Category = "Feather|Style") void SetValue(float NewValue) { GetSliderWidget().SetValue(NewValue); GetSliderWidget().OnValueChanged.Broadcast(NewValue); } UFUNCTION(BlueprintOverride) void PreConstruct(bool bIsDesignTime) { SetStyleOverride(); } UFUNCTION(BlueprintOverride) void Construct() { SetStyleOverride(); } void SetStyleOverride() { if(bUseStyleOverride) { GetSliderWidget().Value = InitialValue; } } // Call this from your style if you want to support this! UFUNCTION(Category = "Feather|Style", BlueprintEvent, BlueprintCallable) void ValueChangedWithContext(float NewValue) { OnValueChangedWithContext.Broadcast(this, NewValue); } }; UCLASS(Abstract) class UFeatherTextBlockStyle : UFeatherStyleBase { UPROPERTY(Category = "Feather|Style") bool bUseStyleOverride; UPROPERTY(Category = "Feather|Style", meta = (EditCondition = bUseStyleOverride)) FText Text; UFUNCTION(Category = "Feather|Style", BlueprintEvent, BlueprintPure) UTextBlock GetTextWidget() const { return nullptr; } UFUNCTION(Category = "Feather|Style", BlueprintPure) FText GetText() const { return GetTextWidget().GetText(); } UFUNCTION(Category = "Feather|Style") void SetText(FText NewText) { GetTextWidget().SetText(NewText); } UFUNCTION(BlueprintOverride) void PreConstruct(bool bIsDesignTime) { SetStyleOverride(); } UFUNCTION(BlueprintOverride) void Construct() { SetStyleOverride(); } void SetStyleOverride() { if(bUseStyleOverride) { GetTextWidget().Text = Text; } } }; event void FTextChangedWithContextSignature(UFeatherEditableTextStyle EditableText, FText NewText); UCLASS(Abstract) class UFeatherEditableTextStyle : UFeatherStyleBase { UPROPERTY(Category = "Feather|Style") bool bUseStyleOverride; UPROPERTY(Category = "Feather|Style", meta = (EditCondition = bUseStyleOverride)) FText Text; UPROPERTY(Category = "Feather|Style", meta = (EditCondition = bUseStyleOverride)) FText HintText; UPROPERTY(Category = "Feather|Style") FTextChangedWithContextSignature OnTextChangedWithContext; UFUNCTION(Category = "Feather|Style", BlueprintEvent, BlueprintPure) UEditableText GetEditableText() const { return nullptr; } UFUNCTION(Category = "Feather|Style", BlueprintPure) FText GetText() const { return GetEditableText().GetText(); } UFUNCTION(Category = "Feather|Style") void SetText(FText NewText) { GetEditableText().SetText(NewText); // Not called when set from code GetEditableText().OnTextChanged.Broadcast(NewText); GetEditableText().OnTextCommitted.Broadcast(NewText, ETextCommit::Default); } UFUNCTION(BlueprintOverride) void PreConstruct(bool bIsDesignTime) { SetStyleOverride(); } UFUNCTION(BlueprintOverride) void Construct() { SetStyleOverride(); } void SetStyleOverride() { if(bUseStyleOverride) { GetEditableText().Text = Text; GetEditableText().HintText = HintText; } } // Call this from your style if you want to support this! UFUNCTION(Category = "Feather|Style", BlueprintEvent, BlueprintCallable) void TextChangedWithContext(FText NewText) { OnTextChangedWithContext.Broadcast(this, NewText); } }; event void FMultiLineTextChangedWithContextSignature(UFeatherMultiLineEditableTextStyle MultiLineEditableText, FText NewText); UCLASS(Abstract) class UFeatherMultiLineEditableTextStyle : UFeatherStyleBase { UPROPERTY(Category = "Feather|Style") bool bUseStyleOverride; UPROPERTY(Category = "Feather|Style", meta = (EditCondition = bUseStyleOverride)) FText Text; UPROPERTY(Category = "Feather|Style", meta = (EditCondition = bUseStyleOverride)) FText HintText; UPROPERTY(Category = "Feather|Style") FMultiLineTextChangedWithContextSignature OnTextChangedWithContext; UFUNCTION(Category = "Feather|Style", BlueprintEvent, BlueprintPure) UMultiLineEditableText GetEditableText() const { return nullptr; } UFUNCTION(Category = "Feather|Style", BlueprintPure) FText GetText() const { return GetEditableText().GetText(); } UFUNCTION(Category = "Feather|Style") void SetText(FText NewText) { GetEditableText().SetText(NewText); // Not called when set from code GetEditableText().OnTextChanged.Broadcast(NewText); GetEditableText().OnTextCommitted.Broadcast(NewText, ETextCommit::Default); } UFUNCTION(BlueprintOverride) void PreConstruct(bool bIsDesignTime) { SetStyleOverride(); } UFUNCTION(BlueprintOverride) void Construct() { SetStyleOverride(); } void SetStyleOverride() { if(bUseStyleOverride) { GetEditableText().Text = Text; GetEditableText().HintText = HintText; } } // Call this from your style if you want to support this! UFUNCTION(Category = "Feather|Style", BlueprintEvent, BlueprintCallable) void TextChangedWithContext(FText NewText) { OnTextChangedWithContext.Broadcast(this, NewText); } }; UCLASS(Abstract) class UFeatherExpanderStyle : UFeatherStyleBase { UFUNCTION(BlueprintEvent) UNamedSlot GetHeaderSlot() const { return nullptr; } UFUNCTION(BlueprintEvent) UNamedSlot GetBodySlot() const { return nullptr; } }; // This is the main style container. You can add multiple styles and identify them by name. Default styles have an empty identifier struct FFeatherStyle { // These are the styles you want to use as their respective defaults UPROPERTY(Category = "Feather|Style") TSet<TSubclassOf<UFeatherStyleBase>> DefaultStyles; // You can add any number of named styles here to allow for greater customization. UPROPERTY(Category = "Feather|Style") TMap<FName, TSubclassOf<UFeatherStyleBase>> NamedStyles; };
package com.saia.starlingPunkExample.entities { import com.saia.starlingPunk.SP; import com.saia.starlingPunk.SPEntity; import com.saia.starlingPunkExample.controller.ScoreController; import com.saia.starlingPunkExample.particles.ExplosionParticles; import flash.display.BitmapData; import starling.display.Image; import starling.textures.Texture; /** * ... * @author Andy Saia */ public class BulletEntity extends SPEntity { private var _speed:Number; public function BulletEntity(x:Number, y:Number) { super(x, y, "bullet"); } override public function added():void { super.added(); var bmpData:BitmapData = new BitmapData(16, 4, false, 0x597137); var img:Image = new Image(Texture.fromBitmapData(bmpData)); addChild(img); _speed = 20; } override public function update():void { super.update(); this.x += _speed; checkBounds(); checkCollision(); } override public function removed():void { super.removed(); removeChildren(0, -1, true); } //---------- // private methods //---------- private function checkBounds():void { if (this.x > SP.width) { world.remove(this); } } private function checkCollision():void { var alien:SPEntity = collide("alien", x, y) if (alien) { ScoreController.increaseScore(); var explosion:ExplosionParticles = new ExplosionParticles(); explosion.start(x, y); world.remove(alien); world.remove(this); } } } }
package com.guepard.parser.serialization { import com.guepard.parser.info.ClassInfo; import com.guepard.parser.info.ExpressionInfo; import com.guepard.parser.info.ExpressionType; import com.guepard.parser.info.MemberInfo; import com.guepard.parser.info.MethodInfo; import com.guepard.parser.info.MethodType; import com.guepard.parser.info.NamespaceInfo; import com.guepard.parser.info.TagInfo; import com.guepard.parser.info.VariableInfo; import com.guepard.parser.token.Token; import com.guepard.parser.token.TokenType; /** * ... * @author Antonov Sergey */ public class AS3Writer extends CodeWriter { public static const DESCRIPTION:String = "description"; public static const STATICAL:String = "statical"; private var _convertComma:Boolean = true; public function AS3Writer(info:ClassInfo) { super(info); } override public function write():void { super.write(); var stream:Token = new Token(); writePackage(stream, info); for each(var internalInfo:ClassInfo in _info.classesInfo) { stream.writeSymbol(ENTER, ENTER, "/*internal class*/", ENTER, ENTER); writeClass(stream, internalInfo); } var strings:Vector.<String> = stream.toStrings(true); _output = writeStrings(strings, ""); } private function writeClass(stream:Token, info:ClassInfo):void { writeImports(stream, info); stream.writeSymbol("public"); if (info.isClass) { stream.writeSymbol("class"); } else { stream.writeSymbol("interface"); } stream.writeSymbol(info.name); if (info.extendsInfo && info.extendsInfo.data) { stream.writeSymbol("extends", info.extendsInfo.data); } stream.writeSymbol("{"); writeProperties(stream, info); writeMethods(stream, info); stream.writeSymbol("}"); } private function writePackage(stream:Token, info:ClassInfo):void { stream.writeSymbol("package"); if (info.packageInfo && info.packageInfo.data) { stream.writeSymbol(info.packageInfo.data); } stream.writeSymbol("{"); writeClass(stream, info); stream.writeSymbol("}"); } private function writeImports(stream:Token, info:ClassInfo):void { if (info.importsInfo.length) { for each(var importInfo:NamespaceInfo in info.importsInfo) { stream.writeSymbol("import ", importInfo.data, ";"); } stream.writeSymbol(ENTER); } } private function writeInstance(stream:Token, info:ClassInfo):void { if (_info.hasInstanceMembers) { stream.writeSymbol("var", DESCRIPTION, "=", "{}", ";"); stream.writeSymbol(ENTER); } } private function writeProperties(stream:Token, info:ClassInfo):void { if (info.variablesInfo && info.variablesInfo.length) { for each (var variable:VariableInfo in info.variablesInfo) { writeMember(stream, variable, info); if (variable.constant) { stream.writeSymbol("const"); } else { stream.writeSymbol("var"); } writeProperty(stream, variable, info); } stream.writeSymbol(ENTER); } } private function writeMember(stream:Token, member:MemberInfo, info:ClassInfo):void { if (member.tag) { writeTag(stream, member.tag, info); } stream.writeSymbol(member.access); if (member.statique) { stream.writeSymbol("static"); } } private function writeType(stream:Token, member:MemberInfo):void { stream.writeSymbol(":"); if (member.type) { stream.writeSymbol(member.type.data); } else { stream.writeSymbol("Object"); } } private function writeTag(stream:Token, tag:TagInfo, info:ClassInfo):void { stream.writeSymbol(ENTER, "[", tag.type); if (tag.parameters) { stream.writeSymbol("("); var enabled:Boolean = false; for (var i:String in tag.parameters) { stream.writeSymbol(i, "=", '"', tag.parameters[i], '"', ","); enabled = true; } if (enabled) { stream.pop(); } stream.writeSymbol(")"); } stream.writeSymbol("]", ENTER); } private function writeProperty(stream:Token, variable:VariableInfo, info:ClassInfo):void { stream.writeSymbol(variable.name); writeType(stream, variable); if (variable.body) { stream.writeSymbol("="); writeBody(stream, variable.body, null, info); } writeSplitter(stream); } private function writeBody(stream:Token, body:Vector.<ExpressionInfo>, method:MethodInfo, info:ClassInfo, splitter:String = SEMICOLON, ignoreSplitterToken:Token = null):void { if (!body) return; for (var i:int = 0; i < body.length; i++) { var expression:ExpressionInfo = body[i]; writeExpression(stream, expression, method, info); if (splitter && stream.length && stream.lastToken.data != ENTER) { var splitterEnabled:Boolean = true; if (ignoreSplitterToken) { if (expression.token.equals(ignoreSplitterToken)) { splitterEnabled = false; } else { var next:ExpressionInfo = i + 1 < body.length ? body[i + 1] : null; if (next && next.token.equals(ignoreSplitterToken)) { splitterEnabled = false; } } } if (splitterEnabled) { writeSplitter(stream, splitter); } } } } private function writeMethods(stream:Token, info:ClassInfo):void { if (info.methodsInfo && info.methodsInfo.length) { for each(var method:MethodInfo in info.methodsInfo) { if (method.overrided) { stream.writeSymbol("override"); } if (method.finalMethod) { stream.writeSymbol("final"); } writeMember(stream, method, info); writeMethod(stream, method, info); } stream.writeSymbol(ENTER); } } private function writeMethod(stream:Token, method:MethodInfo, info:ClassInfo):void { if (method.methodType == MethodType.GETTER) { stream.writeSymbol("get"); } else if (method.methodType == MethodType.SETTER) { stream.writeSymbol("set"); } stream.writeSymbol("function", method.name); writeFunction(stream, method, info); stream.writeSymbol(ENTER); } private function writeFunction(stream:Token, method:MethodInfo, info:ClassInfo):void { stream.writeSymbol("("); writeParameters(stream, method, info); stream.writeSymbol(")"); writeType(stream, method); stream.writeSymbol("{"); if (method.body) { writeLocals(stream, method, info); writeBody(stream, method.body, method, info); } stream.writeSymbol("}"); } private function writeParameters(stream:Token, method:MethodInfo, info:ClassInfo):void { if (method.parameters && method.parameters.length) { for (var i:int = 0; i < method.parameters.length; i++) { var parameter:VariableInfo = method.parameters[i]; if (i != 0) { stream.writeSymbol(","); } if (parameter.multiply) { stream.writeSymbol("..."); } stream.writeSymbol(parameter.name); writeType(stream, parameter); if (parameter.body) { stream.writeSymbol("="); writeBody(stream, parameter.body, null, info); } } } } private function writeLocals(stream:Token, method:MethodInfo, info:ClassInfo):void { var type:String; if (method.locals && method.locals.length) { for each (var local:VariableInfo in method.locals) { stream.writeSymbol("var", local.name); writeType(stream, local); writeSplitter(stream); } stream.writeSymbol(ENTER); } } private function writeExpression(stream:Token, expression:ExpressionInfo, method:MethodInfo, info:ClassInfo):void { if (expression) { var checkFunction:Boolean = false; switch (expression.type) { case ExpressionType.GET: if (expression.parent && expression.parent.isAccess) { stream.writeSymbol("."); //if (writeGetProperty(stream, expression, method, info)) return; writeGetProperty(stream, expression, method, info); } else if (expression.isLiteral) { switch (expression.tokenType) { case TokenType.NUMBER: case TokenType.BOOLEAN: case TokenType.STRING: case TokenType.LITERAL: case TokenType.REGULAR_EXPRESSION: case TokenType.NATIVE_XML: stream.writeSymbol(expression.tokenData); break; default: stream.writeSymbol("/*error: " + expression.tokenData + "*/"); break; } } else { if (expression.tokenData) { stream.writeSymbol(expression.tokenData); } } break; case ExpressionType.ELEMENT: stream.writeSymbol("["); writeBody(stream, expression.body, method, info); removeSplitter(stream); stream.writeSymbol("]"); break; case ExpressionType.RUN: stream.writeSymbol("("); writeBody(stream, expression.body, method, info, COMMA); removeSplitter(stream, COMMA); stream.writeSymbol(")"); break; case ExpressionType.SET: stream.writeSymbol(expression.tokenData); break; case ExpressionType.VECTOR: stream.writeSymbol(expression.about); break; case ExpressionType.CONSTRUCTION: switch (expression.tokenData) { case "break": case "continue": stream.writeSymbol(expression.tokenData); break; case "return": case "throw": case "new": stream.writeSymbol(expression.tokenData); break; case "if": case "else if": case "switch": case "while": stream.writeSymbol(expression.tokenData); writeBlock(stream, "(", ")", expression.body, COMMA, method, info, new Token(TokenType.OPERATOR, ",")); writeBlock(stream, "{", "}", expression.child.body, SEMICOLON, method, info, null); stream.writeSymbol(ENTER); return; case "try": case "finally": stream.writeSymbol(expression.tokenData); writeBlock(stream, "{", "}", expression.body, SEMICOLON, method, info, null); stream.writeSymbol(ENTER); return; case "with": stream.writeSymbol(expression.tag); writeBlock(stream, "{", "}", expression.child.body, SEMICOLON, method, info, null); stream.writeSymbol(ENTER); return; case "case": case "default": stream.writeSymbol(expression.tokenData); writeBody(stream, expression.body, method, info, null); stream.writeSymbol(":", ENTER); return; case "else": stream.writeSymbol(expression.tokenData); writeBlock(stream, "{", "}", expression.child.body, SEMICOLON, method, info, null); stream.writeSymbol(ENTER); return; case "for": case "for each": stream.writeSymbol(expression.tokenData); if (expression.body.length) { _convertComma = false; writeBlock(stream, "(", ")", expression.body, "; ", method, info, new Token(TokenType.OPERATOR, ",")); _convertComma = true; } else { stream.writeSymbol("(;;)"); } writeBlock(stream, "{", "}", expression.child.body, SEMICOLON, method, info, null); stream.writeSymbol(ENTER); return; case "do while": stream.writeSymbol("do"); writeBlock(stream, "{", "}", expression.body, SEMICOLON, method, info, null); stream.writeSymbol("while"); writeBlock(stream, "(", ")", expression.child.body, COMMA, method, info, new Token(TokenType.OPERATOR, ",")); stream.writeSymbol(ENTER); return; case "function": case "catch": stream.writeSymbol(expression.tokenData); writeFunction(stream, expression.method, info); stream.writeSymbol(ENTER); return; case "delete": stream.writeSymbol(expression.tokenData); break; default: stream.writeSymbol("/*error: " + expression.tokenData + "*/"); break; } break; case ExpressionType.OBJECT: writeObject(stream, expression.properties, method, info); break; case ExpressionType.ARRAY: writeBlock(stream, "[", "]", expression.body, COMMA, method, info, null); break; case ExpressionType.BLOCK: writeBlock( stream, expression.tokenData, TokenType.getPairedSymbol(expression.tokenData), expression.body, SEMICOLON, method, info, null ); break; case ExpressionType.OPERATION: switch (expression.tokenData) { case ",": if (_convertComma) { stream.writeSymbol(";"); } else { stream.writeSymbol(","); } break; default: stream.writeSymbol(expression.tokenData); break; } break; default: stream.writeSymbol(expression.tokenData); break; } if (expression.child && expression.child.enabled) { writeExpression(stream, expression.child, method, info); } } else { stream.writeSymbol(";"); } } private function writeGetProperty(stream:Token, expression:ExpressionInfo, method:MethodInfo, info:ClassInfo):void { stream.writeSymbol(expression.tokenData); } private function writeObject(stream:Token, properties:Vector.<Object>, method:MethodInfo, info:ClassInfo):void { stream.writeSymbol("{"); for each (var property:Object in properties) { stream.writeSymbol(property.name, ":"); writeExpression(stream, ExpressionInfo(property.value), method, info); writeSplitter(stream, COMMA); } removeSplitter(stream, COMMA); stream.writeSymbol("}"); } private function writeBlock(stream:Token, begin:String, end:String, body:Vector.<ExpressionInfo>, splitter:String, method:MethodInfo, info:ClassInfo, ignoreSplitterToken:Token):void { stream.writeSymbol(begin); writeBody(stream, body, method, info, splitter, ignoreSplitterToken); removeSplitter(stream, splitter); stream.writeSymbol(end); } } }
package uieditor.editor.ui.inspector { import feathers.controls.NumericStepper; import starling.events.Event; public class NumericStepperPropertyComponent extends BasePropertyComponent { private var _numericStepper : NumericStepper; public function NumericStepperPropertyComponent( propertyRetriever : IPropertyRetriever, param : Object ) { super( propertyRetriever, param ); var name : String = param.name; var min : Number = param[ "min" ]; var max : Number = param[ "max" ]; var default_value : Number = param[ "default" ]; var step : Number = param[ "step" ]; var component : String = param[ "component" ]; if ( !isNaN( min ) && !isNaN( max )) { _numericStepper = new NumericStepper(); _numericStepper.addEventListener( Event.CHANGE, onNumericChange ); _numericStepper.minimum = min; _numericStepper.maximum = max; _numericStepper.value = Number( _propertyRetriever.get( name )); addChild( _numericStepper ); if ( !isNaN( step )) _numericStepper.step = step; } else { throw new Error( "Min and Max have to be defined!" ) } } override public function dispose() : void { if ( _numericStepper != null ) { _numericStepper.removeEventListener( Event.CHANGE, onNumericChange ); _numericStepper = null; } super.dispose(); } private function onNumericChange( event : Event ) : void { _oldValue = _propertyRetriever.get( _param.name ); _propertyRetriever.set( _param.name, _numericStepper.value ); setChanged(); } override public function update() : void { //Setting to NaN on slider will always dispatch a change, we need to do this workaround var value : Number = Number( _propertyRetriever.get( _param.name )); if ( !isNaN( value )) { _numericStepper.value = value; } } } }
package com.winonetech.core { /** * * 视图的基类。 * */ import cn.vision.interfaces.IID; import cn.vision.interfaces.IName; import cn.vision.utils.ClassUtil; import cn.vision.utils.IDUtil; import cn.vision.utils.LogUtil; import com.winonetech.events.ControlEvent; import flash.geom.Rectangle; /** * * 开始播放时触发。 * */ [Event(name="play", type="com.winonetech.events.ControlEvent")] /** * * 结束播放时触发。 * */ [Event(name="stop", type="com.winonetech.events.ControlEvent")] /** * * 结束播放时触发。 * */ [Event(name="ready", type="com.winonetech.events.ControlEvent")] public class View extends Vessel implements IName, IID { /** * * 构造函数。 * */ public function View() { super(); initializeEnvironment(); } /** * * 开始播放。 * * @param $evt:Boolean (default = true) 是否发送事件。 * */ public function play($evt:Boolean = true, $force:Boolean = false):void { if(!wt::playing || $force) { wt::playing = true; $evt && dispatchEvent(new ControlEvent(ControlEvent.PLAY)); for each (var view:View in views) view.play($evt); try { processPlay(); } catch (e:Error) { LogUtil.log(e.getStackTrace()); } } } /** * * 结束播放。 * * @param $evt:Boolean (default = true) 是否发送事件。 * */ public function stop($evt:Boolean = true, $rect:Rectangle = null, $force:Boolean = false):void { if (wt::playing || $force) { wt::playing = false; stopRect = $rect; stopForce = $force; processStop(); for each (var item:View in views) { var rect:Rectangle = new Rectangle(item.x, item.y, item.width, item.height); var bool:Boolean = $rect ? $rect.intersects(rect) : false; if ((!$rect) || bool) { item.stop($evt); stops[item.vid] = item; } } $evt && dispatchEvent(new ControlEvent(ControlEvent.STOP)); } } /** * * 恢复原状。 * */ public function resume():void { processResume(); for each (var item:View in stops) item.resume(); stops = {}; } /** * @inheritDic */ public function reset():void { stop(false); processReset(); removeAllEventListeners(); for each (var view:View in views) view.reset(); removeAllView(); } /** * * 播放处理。 * */ protected function processPlay():void { } /** * * 结束处理。 * */ protected function processStop():void { } /** * * 恢复处理。 * */ protected function processResume():void { } /** * * 重置处理。 * */ protected function processReset():void { } /** * * 解析数据。 * */ protected function resolveData():void { } /** * * 注册子视图。 * * @param $view:View 子视图。 * */ protected function registView($view:View):void { views[$view.vid] = $view; } /** * * 删除子视图。 * * @param $view:View 子视图。 * */ protected function removeView($view:View):void { delete views[$view.vid]; } /** * * 清除所有子视图。 * */ protected function removeAllView():void { views = {}; stops = {}; } /** * * 发送rady。 * */ protected function dispatchReady():void { wt::ready = true; dispatchEvent(new ControlEvent(ControlEvent.READY)) } /** * @private */ private function initializeEnvironment():void { wt::className = ClassUtil.getClassName(this); wt::vid = IDUtil.generateID(); clipAndEnableScrolling = true; views = {}; stops = {}; } /** * inheritDoc */ override public function get className():String { return wt::className; } /** * * 数据模型。 * */ [Bindable] public function get data():VO { return wt::data; } /** * @private */ public function set data($value:VO):void { wt::ready = false; wt::data = $value; resolveData(); } /** * @inheritDoc */ public function get instanceName():String { return wt::instanceName; } /** * @private */ public function set instanceName($value:String):void { wt::instanceName = $value; } /** * * 是否处于播放状态。 * */ public function get playing():Boolean { return Boolean(wt::playing); } /** * * 是否在缓动过程中。 * */ public function get tweening():Boolean { return wt::tweening as Boolean; } /** * * 是否已经准备完毕。 * */ public function get ready():Boolean { return wt::ready as Boolean; } /** * @inheritDoc */ public function get vid():uint { return wt::vid; } /** * * 是否在缓动过程中。 * */ protected var stopRect:Rectangle; /** * * 是否在缓动过程中。 * */ protected var stopForce:Boolean; /** * @private */ private var views:Object; /** * @private */ private var stops:Object; /** * @private */ wt var tweening:Boolean; /** * @private */ wt var ready:Boolean; /** * @private */ wt var className:String; /** * @private */ wt var data:VO; /** * @private */ wt var instanceName:String; /** * @private */ wt var playing:Boolean; /** * @private */ wt var vid:uint; } }
package com.company.assembleegameclient.account.ui { import flash.events.MouseEvent; import org.osflash.signals.Signal; public class NewChooseNameFrame extends Frame { public const choose:Signal = new Signal(); public const cancel:Signal = new Signal(); public function NewChooseNameFrame() { super("Choose a unique player name","Cancel","NewChooseNameFrame.rightButton","/newChooseName"); this.name_ = new TextInputField("Player Name", false); this.name_.inputText_.restrict = "A-Za-z"; this.name_.inputText_.maxChars = 10; addTextInputField(this.name_); addPlainText("Frame.maxChar", {"maxChars": 10}); addPlainText("Frame.restrictChar"); addPlainText("NewChooseNameFrame.warning"); leftButton_.addEventListener("click", this.onCancel); rightButton_.addEventListener("click", this.onChoose); } private var name_:TextInputField; public function setError(_arg_1:String):void { this.name_.setError(_arg_1); } private function onChoose(_arg_1:MouseEvent):void { this.choose.dispatch(this.name_.text()); } private function onCancel(_arg_1:MouseEvent):void { this.cancel.dispatch(); } } }
/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is [Open Source Virtual Machine.]. * * The Initial Developer of the Original Code is * Adobe System Incorporated. * Portions created by the Initial Developer are Copyright (C) 2009 * the Initial Developer. All Rights Reserved. * * Contributor(s): * Adobe AS3 Team * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ var SECTION = "E4X"; var VERSION = ""; var TITLE = "Wildcard attribute assignment"; startTest(); var none:XML = <x><c/></x>; none.@* = 1; var noneres:XML = <x><c/></x>; AddTestCase( "wildcard attribute assignment no result", noneres.toString(), none.toString()); var one:XML = <x bar="0"><c/></x>; one.@* = 1; var oneres:XML = <x bar="1"><c/></x>; AddTestCase( "wildcard attribute assignment one result", oneres.toString(), one.toString()); var many:XML = <x bar="0" foo="bar"><c/></x>; many.@* = 1; var manyres:XML = <x bar="1"><c/></x>; AddTestCase( "wildcard attribute assignment many results", manyres.toString(), many.toString()); test();
package lib.engine.game.data.scene { import lib.engine.game.data.GameData; /** * 场景对象 * @author caihua * */ public class GameData_SceneObject extends GameData { public function GameData_SceneObject() { super(); } private var _name:String = new String(); private var _depth:int = 0; private var _x:Number = 0.0; private var _y:Number = 0.0; private var _resource:String = new String(); private var _collision:Boolean = false; private var _playspace:int = 1000; /** * 深度 */ public function get depth():int { return _depth; } /** * @private */ public function set depth(value:int):void { _depth = value; } /** * 坐标 x */ public function get x():Number { return _x; } /** * @private */ public function set x(value:Number):void { _x = value; } /** * 坐标 y */ public function get y():Number { return _y; } /** * @private */ public function set y(value:Number):void { _y = value; } /** * 名称 */ public function get name():String { return _name; } /** * @private */ public function set name(value:String):void { _name = value; } /** * 资源路径,文件标识::动画名称 */ public function get resource():String { return _resource; } /** * @private */ public function set resource(value:String):void { _resource = value; } /** * 是否碰撞 */ public function get collision():Boolean { return _collision; } /** * @private */ public function set collision(value:Boolean):void { _collision = value; } /** * 动画播放间隔 */ public function get playspace():int { return _playspace; } /** * @private */ public function set playspace(value:int):void { _playspace = value; } } }
package goplayer { import flash.display.DisplayObject import flash.display.Sprite public class AbstractSkin extends Component implements ISkin { private var _backend : ISkinBackend = null public function set backend(value : ISkinBackend) : void { _backend = value } public function get frontend() : DisplayObject { return this } override public function update() : void { super.update() dimensions = internalDimensions scaleX = backend.skinScale scaleY = backend.skinScale } private function get internalDimensions() : Dimensions { return externalDimensions.scaledBy(1 / backend.skinScale) } private function get externalDimensions() : Dimensions { return new Dimensions(backend.skinWidth, backend.skinHeight) } // ----------------------------------------------------- public function get backend() : ISkinBackend { return _backend } protected function get titleText() : String { return backend.title } protected function get shareLinkText() : String { return backend.shareURL } protected function get embedCodeText() : String { return backend.embedCode } protected function get enableChrome() : Boolean { return backend.enableChrome } // ----------------------------------------------------- protected function get showChrome() : Boolean { return backend.showChrome } protected function get showLargePlayButton() : Boolean { return backend.showLargePlayButton } protected function get showTitle() : Boolean { return backend.showTitle } protected function get showShareButton() : Boolean { return backend.showShareButton } protected function get showEmbedButton() : Boolean { return backend.showEmbedButton } protected function get showPlayPauseButton() : Boolean { return backend.showPlayPauseButton } protected function get showElapsedTime() : Boolean { return backend.showElapsedTime } protected function get showSeekBar() : Boolean { return backend.showSeekBar } protected function get showTotalTime() : Boolean { return backend.showTotalTime } protected function get showVolumeControl() : Boolean { return backend.showVolumeControl } protected function get showFullscreenButton() : Boolean { return backend.showFullscreenButton } // ----------------------------------------------------- protected function get playheadRatio() : Number { return backend.playheadRatio } protected function get bufferRatio() : Number { return backend.bufferRatio } protected function get bufferFillRatio() : Number { return backend.bufferFillRatio } protected function get playing() : Boolean { return backend.playing } protected function get bufferingUnexpectedly() : Boolean { return backend.bufferingUnexpectedly } protected function get volume() : Number { return backend.volume } protected function get muted() : Boolean { return volume == 0 } protected function get running() : Boolean { return backend.running } protected function get elapsedTimeText() : String { return getDurationByRatio(playheadRatio).mss } protected function get remainingTimeText() : String { return "−" + getDurationByRatio(1 - playheadRatio).mss } protected function get totalTimeText() : String { return getDurationByRatio(1).mss } protected function getDurationByRatio(ratio : Number) : Duration { return Duration.seconds(backend.duration * ratio) } protected function lookup(name : String) : * { try { return SkinPartFinder.lookup(this, name.split(".")) } catch (error : SkinPartMissingError) { backend.handleSkinPartMissing(error.names.join(".")) } return null } protected function undefinedPart(name : String) : * { lookup("[undefined:" + name + "]") ; return null } } }
package { import org.flixel.FlxG; public class Player extends Actor { public function Player( customCar:Car ) { super( customCar ); customCar.setPosition( 400, 300 ); } override public function preUpdate():void { this.zOrder = this.calculateZOrder(); } override public function update():void { if (FlxG.keys.pressed("LEFT") ) { this.car.setVelocityX( -ACTOR_MOVEMENT_DEFAULT_VELOCITY ); } else if (FlxG.keys.pressed("RIGHT")) { this.car.setVelocityX( ACTOR_MOVEMENT_DEFAULT_VELOCITY ); } else { this.car.setVelocityX( ACTOR_MOVEMENT_STOPPED ); } if (FlxG.keys.justPressed( "ONE" ) ) { Registry.enemy.changeLane( Enemy.ENEMY_ROAD_LANE_1 ); } if (FlxG.keys.justPressed( "TWO" ) ) { Registry.enemy.changeLane( Enemy.ENEMY_ROAD_LANE_2 ); } if (FlxG.keys.justPressed( "THREE" ) ) { Registry.enemy.changeLane( Enemy.ENEMY_ROAD_LANE_3 ); } if (FlxG.keys.justPressed( "FOUR" ) ) { Registry.enemy.changeLane( Enemy.ENEMY_ROAD_LANE_4 ); } if (FlxG.keys.justPressed( "K" ) ) { Registry.nightScene.backdrop.zOrder +=20; trace( Registry.nightScene.backdrop.zOrder ); } if (FlxG.keys.justPressed( "J" ) ) { Registry.nightScene.backdrop.zOrder -=20; trace( Registry.nightScene.backdrop.zOrder ); } if (FlxG.keys.pressed("UP") && this.car.carSprite.y > ACTOR_ROAD_BOUNDS_TOP ) { this.car.setVelocityY( -ACTOR_MOVEMENT_DEFAULT_VELOCITY ); } else if (FlxG.keys.pressed("DOWN") && this.car.carSprite.y < ACTOR_ROAD_BOUNDS_BOTTOM ) { this.car.setVelocityY( ACTOR_MOVEMENT_DEFAULT_VELOCITY ); } else { this.car.setVelocityY( ACTOR_MOVEMENT_STOPPED ); } super.update() } } }
// Copyright (c) 2012, Unwrong Ltd. http://www.unwrong.com // All rights reserved. package core.appEx.validators { import core.appEx.core.contexts.IContext; import core.appEx.core.contexts.ISelectionContext; import core.app.events.CollectionValidatorEvent; import core.appEx.events.ContextSelectionValidatorEvent; import core.appEx.events.ContextValidatorEvent; import core.app.events.ValidatorEvent; import core.appEx.managers.ContextManager; import core.app.validators.CollectionValidator; [Event(type="core.appEx.events.ContextSelectionValidatorEvent", name="validSelectionChanged")]; [Event(type="core.appEx.events.ContextValidatorEvent", name="contextChanged" )]; public class ContextSelectionValidator extends ContextValidator { protected var collectionValidator :CollectionValidator; public function ContextSelectionValidator( contextManager:ContextManager, contextType:Class = null, isCurrent:Boolean = false, selectionType:Class = null, minSelected:uint = 1, maxSelected:uint = uint.MAX_VALUE ) { super( contextManager, contextType, isCurrent ); if ( contextType == null ) _contextType = ISelectionContext; if ( selectionType == null ) selectionType = Object; collectionValidator = new CollectionValidator( null, selectionType, minSelected, maxSelected ); collectionValidator.addEventListener(ValidatorEvent.STATE_CHANGED, collectionValidatorStageChangeHandler); collectionValidator.addEventListener(CollectionValidatorEvent.VALID_ITEMS_CHANGED, validItemsChangedHandler); updateState(); } override public function dispose():void { super.dispose(); collectionValidator.dispose(); collectionValidator = null; } private function validItemsChangedHandler( event:CollectionValidatorEvent ):void { updateState(); dispatchEvent( new ContextSelectionValidatorEvent( ContextSelectionValidatorEvent.VALID_SELECTION_CHANGED, event.validItems ) ); } private var supressHandler:Boolean = false; private function collectionValidatorStageChangeHandler( event:ValidatorEvent ):void { if ( supressHandler ) return; updateState(); } public function getValidSelection():Array { return collectionValidator.getValidItems(); } override protected function updateState():void { var newContext:IContext = contextManager.getLatestContextOfType( _contextType ); if ( !collectionValidator ) { setState(state); } else if ( newContext is _contextType ) { supressHandler = true; collectionValidator.collection = ISelectionContext( newContext ).selection; supressHandler = false; setState(collectionValidator.state); } else { supressHandler = true; collectionValidator.collection = null; supressHandler = false; setState(false); } if ( newContext != _context ) { var oldContext:IContext = _context; _context = newContext; dispatchEvent( new ContextValidatorEvent( ContextValidatorEvent.CONTEXT_CHANGED, oldContext, newContext ) ); } } } }
/**Created by the LayaAirIDE,do not modify.*/ package ui.srddzGame.ddzPart.handlePart { import laya.ui.*; import laya.display.*; import ui.srddzGame.ddzPart.item.PockerItemUI; public class OtherHandlePartUI extends View { public var mingBox:Box; public var card0:PockerItemUI; public var card1:PockerItemUI; public var card2:PockerItemUI; public var card3:PockerItemUI; public var card4:PockerItemUI; public var card5:PockerItemUI; public var card6:PockerItemUI; public var card7:PockerItemUI; public var card8:PockerItemUI; public var card9:PockerItemUI; public var card10:PockerItemUI; public var card11:PockerItemUI; public var card12:PockerItemUI; public var card13:PockerItemUI; public var card14:PockerItemUI; public var card15:PockerItemUI; public var card16:PockerItemUI; public var card17:PockerItemUI; public var card18:PockerItemUI; public var card19:PockerItemUI; public var card20:PockerItemUI; public var card21:PockerItemUI; public var card22:PockerItemUI; public var card23:PockerItemUI; public var card24:PockerItemUI; public var card25:PockerItemUI; public var card26:PockerItemUI; public var card27:PockerItemUI; public var card28:PockerItemUI; public var card29:PockerItemUI; public var card30:PockerItemUI; public var card31:PockerItemUI; public var card32:PockerItemUI; public var backBox:Box; public var card:PockerItemUI; public var numTxt:Label; public static var uiView:Object =/*[STATIC SAFE]*/{"type":"View","props":{"width":0,"height":0},"child":[{"type":"Box","props":{"y":0,"x":0,"var":"mingBox"},"child":[{"type":"PockerItem","props":{"y":0,"x":0,"var":"card0","scaleY":0.5,"scaleX":0.5,"runtime":"ui.srddzGame.ddzPart.item.PockerItemUI"}},{"type":"PockerItem","props":{"y":0,"x":21,"var":"card1","scaleY":0.5,"scaleX":0.5,"runtime":"ui.srddzGame.ddzPart.item.PockerItemUI"}},{"type":"PockerItem","props":{"y":0,"x":43,"var":"card2","scaleY":0.5,"scaleX":0.5,"runtime":"ui.srddzGame.ddzPart.item.PockerItemUI"}},{"type":"PockerItem","props":{"y":0,"x":64,"var":"card3","scaleY":0.5,"scaleX":0.5,"runtime":"ui.srddzGame.ddzPart.item.PockerItemUI"}},{"type":"PockerItem","props":{"y":0,"x":86,"var":"card4","scaleY":0.5,"scaleX":0.5,"runtime":"ui.srddzGame.ddzPart.item.PockerItemUI"}},{"type":"PockerItem","props":{"y":26,"x":0,"var":"card5","scaleY":0.5,"scaleX":0.5,"runtime":"ui.srddzGame.ddzPart.item.PockerItemUI"}},{"type":"PockerItem","props":{"y":26,"x":21,"var":"card6","scaleY":0.5,"scaleX":0.5,"runtime":"ui.srddzGame.ddzPart.item.PockerItemUI"}},{"type":"PockerItem","props":{"y":26,"x":43,"var":"card7","scaleY":0.5,"scaleX":0.5,"runtime":"ui.srddzGame.ddzPart.item.PockerItemUI"}},{"type":"PockerItem","props":{"y":26,"x":64,"var":"card8","scaleY":0.5,"scaleX":0.5,"runtime":"ui.srddzGame.ddzPart.item.PockerItemUI"}},{"type":"PockerItem","props":{"y":26,"x":86,"var":"card9","scaleY":0.5,"scaleX":0.5,"runtime":"ui.srddzGame.ddzPart.item.PockerItemUI"}},{"type":"PockerItem","props":{"y":52,"x":0,"var":"card10","scaleY":0.5,"scaleX":0.5,"runtime":"ui.srddzGame.ddzPart.item.PockerItemUI"}},{"type":"PockerItem","props":{"y":52,"x":21,"var":"card11","scaleY":0.5,"scaleX":0.5,"runtime":"ui.srddzGame.ddzPart.item.PockerItemUI"}},{"type":"PockerItem","props":{"y":52,"x":43,"var":"card12","scaleY":0.5,"scaleX":0.5,"runtime":"ui.srddzGame.ddzPart.item.PockerItemUI"}},{"type":"PockerItem","props":{"y":52,"x":64,"var":"card13","scaleY":0.5,"scaleX":0.5,"runtime":"ui.srddzGame.ddzPart.item.PockerItemUI"}},{"type":"PockerItem","props":{"y":52,"x":86,"var":"card14","scaleY":0.5,"scaleX":0.5,"runtime":"ui.srddzGame.ddzPart.item.PockerItemUI"}},{"type":"PockerItem","props":{"y":78,"x":0,"var":"card15","scaleY":0.5,"scaleX":0.5,"runtime":"ui.srddzGame.ddzPart.item.PockerItemUI"}},{"type":"PockerItem","props":{"y":78,"x":21,"var":"card16","scaleY":0.5,"scaleX":0.5,"runtime":"ui.srddzGame.ddzPart.item.PockerItemUI"}},{"type":"PockerItem","props":{"y":78,"x":43,"var":"card17","scaleY":0.5,"scaleX":0.5,"runtime":"ui.srddzGame.ddzPart.item.PockerItemUI"}},{"type":"PockerItem","props":{"y":78,"x":64,"var":"card18","scaleY":0.5,"scaleX":0.5,"runtime":"ui.srddzGame.ddzPart.item.PockerItemUI"}},{"type":"PockerItem","props":{"y":78,"x":86,"var":"card19","scaleY":0.5,"scaleX":0.5,"runtime":"ui.srddzGame.ddzPart.item.PockerItemUI"}},{"type":"PockerItem","props":{"y":104,"x":0,"var":"card20","scaleY":0.5,"scaleX":0.5,"runtime":"ui.srddzGame.ddzPart.item.PockerItemUI"}},{"type":"PockerItem","props":{"y":104,"x":21,"var":"card21","scaleY":0.5,"scaleX":0.5,"runtime":"ui.srddzGame.ddzPart.item.PockerItemUI"}},{"type":"PockerItem","props":{"y":104,"x":43,"var":"card22","scaleY":0.5,"scaleX":0.5,"runtime":"ui.srddzGame.ddzPart.item.PockerItemUI"}},{"type":"PockerItem","props":{"y":104,"x":64,"var":"card23","scaleY":0.5,"scaleX":0.5,"runtime":"ui.srddzGame.ddzPart.item.PockerItemUI"}},{"type":"PockerItem","props":{"y":104,"x":86,"var":"card24","scaleY":0.5,"scaleX":0.5,"runtime":"ui.srddzGame.ddzPart.item.PockerItemUI"}},{"type":"PockerItem","props":{"y":130,"x":0,"var":"card25","scaleY":0.5,"scaleX":0.5,"runtime":"ui.srddzGame.ddzPart.item.PockerItemUI"}},{"type":"PockerItem","props":{"y":130,"x":21,"var":"card26","scaleY":0.5,"scaleX":0.5,"runtime":"ui.srddzGame.ddzPart.item.PockerItemUI"}},{"type":"PockerItem","props":{"y":130,"x":43,"var":"card27","scaleY":0.5,"scaleX":0.5,"runtime":"ui.srddzGame.ddzPart.item.PockerItemUI"}},{"type":"PockerItem","props":{"y":130,"x":64,"var":"card28","scaleY":0.5,"scaleX":0.5,"runtime":"ui.srddzGame.ddzPart.item.PockerItemUI"}},{"type":"PockerItem","props":{"y":130,"x":86,"var":"card29","scaleY":0.5,"scaleX":0.5,"runtime":"ui.srddzGame.ddzPart.item.PockerItemUI"}},{"type":"PockerItem","props":{"y":156,"x":0,"var":"card30","scaleY":0.5,"scaleX":0.5,"runtime":"ui.srddzGame.ddzPart.item.PockerItemUI"}},{"type":"PockerItem","props":{"y":156,"x":21,"var":"card31","scaleY":0.5,"scaleX":0.5,"runtime":"ui.srddzGame.ddzPart.item.PockerItemUI"}},{"type":"PockerItem","props":{"y":156,"x":43,"var":"card32","scaleY":0.5,"scaleX":0.5,"runtime":"ui.srddzGame.ddzPart.item.PockerItemUI"}}]},{"type":"Box","props":{"y":0,"x":28,"var":"backBox","scaleY":0.75,"scaleX":0.75},"child":[{"type":"PockerItem","props":{"var":"card","runtime":"ui.srddzGame.ddzPart.item.PockerItemUI"}},{"type":"Label","props":{"y":46,"x":32,"width":55.615234375,"var":"numTxt","valign":"middle","text":17,"strokeColor":"#000000","stroke":2,"height":50,"fontSize":50,"color":"#f3f1ca","align":"center"}}]}]}; override protected function createChildren():void { View.regComponent("ui.srddzGame.ddzPart.item.PockerItemUI",PockerItemUI); super.createChildren(); createView(uiView); } } }
package sound { import flash.events.*; import flash.media.*; import mx.controls.*; import org.libspark.thread.Thread; import model.Option; /** * コントロールの基底クラス * */ public class SoundCtrl extends EventDispatcher { private static var __bgmVolume:int; private static var __seVolume:int; private static var __cvVolume:int; protected static var __instance:SoundCtrl; // シングルトン保存用 private static var __currentBGMChannels:Vector.<SoundChannel> = new Vector.<SoundChannel>(); private static var __currentSEChannels:Vector.<SoundChannel> = new Vector.<SoundChannel>(); private static var __currentCVChannels:Vector.<SoundChannel> = new Vector.<SoundChannel>(); private var _option:Option = Option.instance; public function SoundCtrl(caller:Function=null) { __bgmVolume = _option.BGMVolume; __seVolume = _option.SEVolume; __cvVolume = _option.CVVolume; _option.addEventListener(Option.UPDATE_BGM, bgmHandler); _option.addEventListener(Option.UPDATE_SE, seHandler); _option.addEventListener(Option.UPDATE_CV, cvHandler); } private static function createInstance():SoundCtrl { return new SoundCtrl(arguments.callee); } public static function get instance():SoundCtrl { if( __instance == null ){ __instance = createInstance(); } return __instance; } public function get BGMVolume():int { return __bgmVolume; } public function get SEVolume():int { return __seVolume; } public function get CVVolume():int { return __cvVolume; } public function set BGMVolume(v:int):void { __bgmVolume = v; var trans:SoundTransform = new SoundTransform(); trans.volume = __bgmVolume/100; __currentBGMChannels.forEach(function(item:*, index:int, vector:Vector.<SoundChannel>):void{item.soundTransform = trans}); // log.writeLog(log.LV_FATAL, this, "volume change", __bgmVolume); } public function set SEVolume(v:int):void { __seVolume = v; var trans:SoundTransform = new SoundTransform(); trans.volume = __seVolume/100; __currentSEChannels.forEach(function(item:*, index:int, vector:Vector.<SoundChannel>):void{item.soundTransform = trans}); } public function set CVVolume(v:int):void { __cvVolume = v; var trans:SoundTransform = new SoundTransform(); trans.volume = __cvVolume/100; __currentCVChannels.forEach(function(item:*, index:int, vector:Vector.<SoundChannel>):void{item.soundTransform = trans}); } public function disposeBGM(sc:SoundChannel):void { __currentBGMChannels.splice(__currentBGMChannels.indexOf(sc),1); } public function disposeSE(sc:SoundChannel):void { __currentSEChannels.splice(__currentSEChannels.indexOf(sc),1); } public function disposeCV(sc:SoundChannel):void { __currentCVChannels.splice(__currentCVChannels.indexOf(sc),1); } public function addBGM(sc:SoundChannel):void { __currentBGMChannels.push(sc); } public function addSE(sc:SoundChannel):void { __currentSEChannels.push(sc); } public function addCV(sc:SoundChannel):void { __currentCVChannels.push(sc); } private function bgmHandler(e:Event):void { // log.writeLog(log.LV_FATAL, this, "bgm vol change"); BGMVolume = _option.BGMVolume; } private function seHandler(e:Event):void { SEVolume = _option.SEVolume; } private function cvHandler(e:Event):void { CVVolume = _option.CVVolume; } } }
//////////////////////////////////////////////////////////////////////////////// // // ADOBE SYSTEMS INCORPORATED // Copyright 2004-2007 Adobe Systems Incorporated // All Rights Reserved. // // NOTICE: Adobe permits you to use, modify, and distribute this file // in accordance with the terms of the license agreement accompanying it. // //////////////////////////////////////////////////////////////////////////////// package mx.effects.easing { /** * The Circular class defines three easing functions to implement * circular motion with Flex effect classes. * * For more information, see http://www.robertpenner.com/profmx. * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ public class Circular { include "../../core/Version.as"; //-------------------------------------------------------------------------- // // Class methods // //-------------------------------------------------------------------------- /** * The <code>easeIn()</code> method starts motion slowly, * and then accelerates motion as it executes. * * @param t Specifies time. * * @param b Specifies the initial position of a component. * * @param c Specifies the total change in position of the component. * * @param d Specifies the duration of the effect, in milliseconds. * * @return Number corresponding to the position of the component. * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ public static function easeIn(t:Number, b:Number, c:Number, d:Number):Number { return -c * (Math.sqrt(1 - (t /= d) * t) - 1) + b; } /** * The <code>easeOut()</code> method starts motion fast, * and then decelerates motion as it executes. * * @param t Specifies time. * * @param b Specifies the initial position of a component. * * @param c Specifies the total change in position of the component. * * @param d Specifies the duration of the effect, in milliseconds. * * @return Number corresponding to the position of the component. * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ public static function easeOut(t:Number, b:Number, c:Number, d:Number):Number { return c * Math.sqrt(1 - (t = t/d - 1) * t) + b; } /** * The <code>easeInOut()</code> method combines the motion * of the <code>easeIn()</code> and <code>easeOut()</code> methods * to start the motion slowly, accelerate motion, then decelerate. * * @param t Specifies time. * * @param b Specifies the initial position of a component. * * @param c Specifies the total change in position of the component. * * @param d Specifies the duration of the effect, in milliseconds. * * @return Number corresponding to the position of the component. * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ public static function easeInOut(t:Number, b:Number, c:Number, d:Number):Number { if ((t /= d / 2) < 1) return -c / 2 * (Math.sqrt(1 - t * t) - 1) + b; return c / 2 * (Math.sqrt(1 - (t -= 2) * t) + 1) + b; } } }
/* Copyright aswing.org, see the LICENCE.txt. */ package org.aswing.plaf.basic{ import org.aswing.plaf.BaseComponentUI; import org.aswing.*; import org.aswing.graphics.*; import org.aswing.geom.*; import org.aswing.error.ImpMissError; /** * The base class for text component UIs. * @author iiley * @private */ public class BasicTextComponentUI extends BaseComponentUI{ protected var textComponent:JTextComponent; public function BasicTextComponentUI(){ super(); } protected function getPropertyPrefix():String { throw new ImpMissError(); return ""; } override public function paint(c:Component, g:Graphics2D, r:IntRectangle):void{ super.paint(c, g, r); } override public function installUI(c:Component):void{ textComponent = JTextComponent(c); installDefaults(); installComponents(); installListeners(); } override public function uninstallUI(c:Component):void{ textComponent = JTextComponent(c); uninstallDefaults(); uninstallComponents(); uninstallListeners(); } protected function installDefaults():void{ var pp:String = getPropertyPrefix(); LookAndFeel.installColorsAndFont(textComponent, pp); LookAndFeel.installBorderAndBFDecorators(textComponent, pp); LookAndFeel.installBasicProperties(textComponent, pp); } protected function uninstallDefaults():void{ LookAndFeel.uninstallBorderAndBFDecorators(textComponent); } protected function installComponents():void{ } protected function uninstallComponents():void{ } protected function installListeners():void{ } protected function uninstallListeners():void{ } override public function getMaximumSize(c:Component):IntDimension { return IntDimension.createBigDimension(); } override public function getMinimumSize(c:Component):IntDimension { return c.getInsets().getOutsideSize(); } } }
package cmodule.decry { const i_AS3_Int:int = exportSym("_AS3_Int",new CProcTypemap(CTypemap.AS3ValType,[CTypemap.IntType]).createC(AS3_NOP)[0]); }
package devoron.aslc.events { import flash.events.Event; /** * ... * @author Devoron */ public class SWCBuilderEvent extends Event { public var data:*; public static const NEW_PROJECT:String = "new_project"; public function SWCBuilderEvent(type:String, data:*) { super(type); this.data = data; } } }
package feathers.tests { import feathers.controls.Button; import feathers.controls.ToggleButton; import feathers.utils.touch.TapToSelect; import flash.geom.Point; import org.flexunit.Assert; import starling.display.DisplayObject; import starling.display.Quad; import starling.events.Event; import starling.events.Touch; import starling.events.TouchEvent; import starling.events.TouchPhase; public class TapToSelectTests { private var _target:ToggleButton; private var _blocker:Quad; private var _tapToSelect:TapToSelect; [Before] public function prepare():void { this._target = new ToggleButton(); this._target.setSize(200, 200); this._target.isToggle = false; TestFeathers.starlingRoot.addChild(this._target); this._tapToSelect = new TapToSelect(this._target); } [After] public function cleanup():void { this._target.removeFromParent(true); this._target = null; if(this._blocker) { this._blocker.removeFromParent(true); this._blocker = null; } this._tapToSelect = null; Assert.assertStrictlyEquals("Child not removed from Starling root on cleanup.", 0, TestFeathers.starlingRoot.numChildren); } [Test] public function testChangeEvent():void { this._target.isSelected = false; var hasChanged:Boolean = false; this._target.addEventListener(Event.CHANGE, function(event:Event):void { hasChanged = true; }); var position:Point = new Point(10, 10); var target:DisplayObject = this._target.stage.hitTest(position, true); var touch:Touch = new Touch(0); touch.target = target; touch.phase = TouchPhase.BEGAN; touch.globalX = position.x; touch.globalY = position.y; var touches:Vector.<Touch> = new <Touch>[touch]; target.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches)); //this touch does not move at all, so it should result in triggering //the button. touch.phase = TouchPhase.ENDED; target.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches)); Assert.assertTrue("Event.CHANGE was not dispatched", hasChanged); Assert.assertTrue("isSelected was not changed to true after tap", this._target.isSelected); } [Test] public function testDisabled():void { this._target.isSelected = false; this._tapToSelect.isEnabled = false; var hasChanged:Boolean = false; this._target.addEventListener(Event.CHANGE, function(event:Event):void { hasChanged = true; }); var position:Point = new Point(10, 10); var target:DisplayObject = this._target.stage.hitTest(position, true); var touch:Touch = new Touch(0); touch.target = target; touch.phase = TouchPhase.BEGAN; touch.globalX = position.x; touch.globalY = position.y; var touches:Vector.<Touch> = new <Touch>[touch]; target.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches)); //this touch does not move at all, so it should result in triggering //the button. touch.phase = TouchPhase.ENDED; target.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches)); Assert.assertFalse("Event.CHANGE was incorrectly dispatched when disabled", hasChanged); Assert.assertFalse("isSelected was incorrectly changed to true after tap when disabled", this._target.isSelected); } [Test] public function testTouchMoveOutsideBeforeChangeEvent():void { this._target.isSelected = false; var hasChanged:Boolean = false; this._target.addEventListener(Event.CHANGE, function(event:Event):void { hasChanged = true; }); var position:Point = new Point(10, 10); var target:DisplayObject = this._target.stage.hitTest(position, true); var touch:Touch = new Touch(0); touch.target = target; touch.phase = TouchPhase.BEGAN; touch.globalX = position.x; touch.globalY = position.y; var touches:Vector.<Touch> = new <Touch>[touch]; target.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches)); touch.globalX = 1000; //move the touch way outside the bounds of the button touch.phase = TouchPhase.MOVED; target.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches)); touch.phase = TouchPhase.ENDED; target.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches)); Assert.assertFalse("Event.CHANGE was incorrectly dispatched after touch moved out of bounds", hasChanged); Assert.assertFalse("isSelected was incorrectly changed to true after touch moved out of bounds", this._target.isSelected); } [Test] public function testOtherDisplayObjectBlockingChangeEvent():void { this._target.isSelected = false; var hasChanged:Boolean = false; this._target.addEventListener(Event.CHANGE, function(event:Event):void { hasChanged = true; }); var position:Point = new Point(10, 10); var target:DisplayObject = this._target.stage.hitTest(position, true); var touch:Touch = new Touch(0); touch.target = target; touch.phase = TouchPhase.BEGAN; touch.globalX = position.x; touch.globalY = position.y; var touches:Vector.<Touch> = new <Touch>[touch]; target.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches)); this._blocker = new Quad(200, 200, 0xff0000); TestFeathers.starlingRoot.addChild(this._blocker); touch.phase = TouchPhase.ENDED; target.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches)); Assert.assertFalse("Event.CHANGE was incorrectly dispatched when another display object blocked the touch", hasChanged); Assert.assertFalse("isSelected was incorrectly changed to true when another display object blocked the touch", this._target.isSelected); } [Test] public function testDeselect():void { this._tapToSelect.tapToDeselect = true; this._target.isSelected = true; var position:Point = new Point(10, 10); var target:DisplayObject = this._target.stage.hitTest(position, true); var touch:Touch = new Touch(0); touch.target = target; touch.phase = TouchPhase.BEGAN; touch.globalX = position.x; touch.globalY = position.y; var touches:Vector.<Touch> = new <Touch>[touch]; target.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches)); //this touch does not move at all, so it should result in triggering //the button. touch.phase = TouchPhase.ENDED; target.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches)); Assert.assertFalse("isSelected was not changed to false when tapToDeselect set to true", this._target.isSelected); } [Test] public function testDisabledDeselect():void { this._tapToSelect.tapToDeselect = false; this._target.isSelected = true; var position:Point = new Point(10, 10); var target:DisplayObject = this._target.stage.hitTest(position, true); var touch:Touch = new Touch(0); touch.target = target; touch.phase = TouchPhase.BEGAN; touch.globalX = position.x; touch.globalY = position.y; var touches:Vector.<Touch> = new <Touch>[touch]; target.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches)); //this touch does not move at all, so it should result in triggering //the button. touch.phase = TouchPhase.ENDED; target.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches)); Assert.assertTrue("isSelected was incorrectly changed to false when tapToDeselect set to false", this._target.isSelected); } } }
package laya.particle { /** * <code>ParticleSettings</code> 类是粒子配置数据类 */ public class ParticleSetting { /**贴图*/ public var textureName:String = null; /**贴图个数,默认为1可不设置*/ public var textureCount:int = 1; /**最大同屏粒子个数,最大饱和粒子数为maxPartices-1。注意:WebGL模式下释放粒子时间为最大声明周期,可能会出现释放延迟,实际看到的同屏粒子数小于该数值,如连续喷发出现中断,请调大该数值。*/ public var maxPartices:int = 100; /**粒子持续时间(单位:秒)*/ public var duration:Number = 1; /**如果大于0,某些粒子的持续时间会小于其他粒子,并具有随机性(单位:无)*/ public var ageAddScale:Number = 0; /**粒子受发射器速度的敏感度(需在自定义发射器中编码设置)*/ public var emitterVelocitySensitivity:Number = 1; /**最小开始尺寸(单位:2D像素、3D坐标)*/ public var minStartSize:Number = 100; /**最大开始尺寸(单位:2D像素、3D坐标)*/ public var maxStartSize:Number = 100; /**最小结束尺寸(单位:2D像素、3D坐标)*/ public var minEndSize:Number = 100; /**最大结束尺寸(单位:2D像素、3D坐标)*/ public var maxEndSize:Number = 100; /**最小水平速度(单位:2D像素、3D坐标)*/ public var minHorizontalVelocity:Number = 0; /**最大水平速度(单位:2D像素、3D坐标)*/ public var maxHorizontalVelocity:Number = 0; /**最小垂直速度(单位:2D像素、3D坐标)*/ public var minVerticalVelocity:Number = 0; /**最大垂直速度(单位:2D像素、3D坐标)*/ public var maxVerticalVelocity:Number = 0; /**等于1时粒子从出生到消亡保持一致的速度,等于0时粒子消亡时速度为0,大于1时粒子会保持加速(单位:无)*/ public var endVelocity:Number = 1; /**(单位:2D像素、3D坐标)*/ public var gravity:Float32Array = new Float32Array([0, 0, 0]); /**最小旋转速度(单位:2D弧度/秒、3D弧度/秒)*/ public var minRotateSpeed:Number = 0; /**最大旋转速度(单位:2D弧度/秒、3D弧度/秒)*/ public var maxRotateSpeed:Number = 0; /**最小开始半径(单位:2D像素、3D坐标)*/ public var minStartRadius:Number = 0; /**最大开始半径(单位:2D像素、3D坐标)*/ public var maxStartRadius:Number = 0; /**最小结束半径(单位:2D像素、3D坐标)*/ public var minEndRadius:Number = 0; /**最大结束半径(单位:2D像素、3D坐标)*/ public var maxEndRadius:Number = 0; /**最小水平开始弧度(单位:2D弧度、3D弧度)*/ public var minHorizontalStartRadian:Number = 0; /**最大水平开始弧度(单位:2D弧度、3D弧度)*/ public var maxHorizontalStartRadian:Number = 0; /**最小垂直开始弧度(单位:2D弧度、3D弧度)*/ public var minVerticalStartRadian:Number = 0; /**最大垂直开始弧度(单位:2D弧度、3D弧度)*/ public var maxVerticalStartRadian:Number = 0; /**是否使用结束弧度,false为结束时与起始弧度保持一致,true为根据minHorizontalEndRadian、maxHorizontalEndRadian、minVerticalEndRadian、maxVerticalEndRadian计算结束弧度。*/ public var useEndRadian:Boolean = true; /**最小水平结束弧度(单位:2D弧度、3D弧度)*/ public var minHorizontalEndRadian:Number = 0; /**最大水平结束弧度(单位:2D弧度、3D弧度)*/ public var maxHorizontalEndRadian:Number = 0; /**最小垂直结束弧度(单位:2D弧度、3D弧度)*/ public var minVerticalEndRadian:Number = 0; /**最大垂直结束弧度(单位:2D弧度、3D弧度)*/ public var maxVerticalEndRadian:Number = 0; /**最小开始颜色*/ public var minStartColor:Float32Array = new Float32Array([1, 1, 1, 1]); /**最大开始颜色*/ public var maxStartColor:Float32Array = new Float32Array([1, 1, 1, 1]); /**最小结束颜色*/ public var minEndColor:Float32Array = new Float32Array([1, 1, 1, 1]); /**最大结束颜色*/ public var maxEndColor:Float32Array = new Float32Array([1, 1, 1, 1]); /**false代表RGBA整体插值,true代表RGBA逐分量插值*/ public var colorComponentInter:Boolean = false; /**false代表使用参数颜色数据,true代表使用原图颜色数据*/ public var disableColor:Boolean = false; /**混合模式,待调整,引擎中暂无BlendState抽象*/ public var blendState:int = 0; //.........................................................3D发射器参数......................................................... /**发射器类型,"point","box","sphere","ring"*/ public var emitterType:String = "null"; /**发射器发射速率*/ public var emissionRate:int = 0; /**点发射器位置*/ public var pointEmitterPosition:Float32Array = new Float32Array([0, 0, 0]); /**点发射器位置随机值*/ public var pointEmitterPositionVariance:Float32Array = new Float32Array([0, 0, 0]); /**点发射器速度*/ public var pointEmitterVelocity:Float32Array = new Float32Array([0, 0, 0]); /**点发射器速度随机值*/ public var pointEmitterVelocityAddVariance:Float32Array = new Float32Array([0, 0, 0]); /**盒发射器中心位置*/ public var boxEmitterCenterPosition:Float32Array = new Float32Array([0, 0, 0]); /**盒发射器尺寸*/ public var boxEmitterSize:Float32Array = new Float32Array([0, 0, 0]); /**盒发射器速度*/ public var boxEmitterVelocity:Float32Array = new Float32Array([0, 0, 0]); /**盒发射器速度随机值*/ public var boxEmitterVelocityAddVariance:Float32Array = new Float32Array([0, 0, 0]); /**球发射器中心位置*/ public var sphereEmitterCenterPosition:Float32Array = new Float32Array([0, 0, 0]); /**球发射器半径*/ public var sphereEmitterRadius:Number = 1; /**球发射器速度*/ public var sphereEmitterVelocity:Number = 0; /**球发射器速度随机值*/ public var sphereEmitterVelocityAddVariance:Number = 0; /**环发射器中心位置*/ public var ringEmitterCenterPosition:Float32Array = new Float32Array([0, 0, 0]); /**环发射器半径*/ public var ringEmitterRadius:Number = 30; /**环发射器速度*/ public var ringEmitterVelocity:Number = 0; /**环发射器速度随机值*/ public var ringEmitterVelocityAddVariance:Number = 0; /**环发射器up向量,0代表X轴,1代表Y轴,2代表Z轴*/ public var ringEmitterUp:int = 2; //.........................................................3D发射器参数......................................................... //.........................................................2D发射器参数......................................................... /**发射器位置随机值,2D使用*/ public var positionVariance:Float32Array = new Float32Array([0, 0, 0]); //.........................................................2D发射器参数......................................................... /** * 创建一个新的 <code>ParticleSettings</code> 类实例。 * */ public function ParticleSetting() { } private static var _defaultSetting:ParticleSetting = new ParticleSetting(); public static function checkSetting(setting:Object):void { var key:String; for (key in _defaultSetting) { if (!setting.hasOwnProperty(key)) { setting[key] = _defaultSetting[key]; } } } } }
/* * Copyright 2007-2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.as3commons.async.operation.impl { import org.as3commons.async.operation.IOperation; import org.as3commons.async.operation.IOperationHandler; import org.as3commons.async.operation.event.OperationEvent; import org.as3commons.lang.Assert; import flash.events.Event; import flash.events.EventDispatcher; import flash.utils.Dictionary; /** * Helper class that generically handles <code>IOperation</code> events and either routes their result or error * data to a specified method or assigns them to a specified property on an object instance. * <p><em>Assigning an operation result to an instance property</em></p> * <listing version="3.0"> * public class MyPresentationModel { * * private var _operationHandler:OperationHandler * * public var products:Array; * * public function MyPresentationModel(){ * _operationHandler = new OperationHandler(this.errorHandler); * } * * public function getProducts():void { * var operation:IOperation = serviceImplementation.getProducts(); * _operationHandler.handleOperation(operation,null,this,"products"); * } * * protected function errorHandler(error:*):void { * //implementation omitted * } * } * </listing> * <p><em>Assigning an operation result to an instance property using an extra method</em></p> * <p>If the data returned from the <code>IOperation</code> needs some extra processing, specify * an extra method for it like in this example:</p> * <listing version="3.0"> * public class MyPresentationModel { * * private var _operationHandler:OperationHandler * * public var products:ArrayCollection; * * public function MyPresentationModel(){ * _operationHandler = new OperationHandler(this.errorHandler); * } * * public function getProducts():void { * var operation:IOperation = serviceImplementation.getProducts(); * _operationHandler.handleOperation(operation,convertArray,this,"products"); * } * * protected function convertArray(input:Array):ArrayCollection { * return new ArrayCollection(input); * } * * protected function errorHandler(error:*):void { * //implementation omitted * } * } * </listing> * @author Roland Zwaga */ public class OperationHandler extends EventDispatcher implements IOperationHandler { private static const BUSY_CHANGE_EVENT:String = "busyChanged"; /** * Creates a new <code>OperationHandler</code> instance. * @param defaultErrorhandler a default method that is invoked when an operation returns an error. */ public function OperationHandler(defaultErrorHandler:Function=null) { super(); initOperationHandler(defaultErrorHandler); } private var _busy:Boolean; private var _defaultErrorHandler:Function; private var _operations:Dictionary; [Bindable(event="busyChanged")] /** * Returns <code>true</code> if the current <code>OperationHandler</code> is waiting for an <code>IOperation</code> * to complete. */ public function get busy():Boolean { return _busy; } /** * @private */ public function set busy(value:Boolean):void { if (_busy != value) { _busy = value; dispatchEvent(new Event(BUSY_CHANGE_EVENT)); } } /** * * @param operation The specified <code>IOperation</code> * @param resultMethod A <code>Function</code> that will be invoked using the <code>IOperation.result</code> as a parameter. * @param resultTargetObject The target instance that holds the property that will have the <code>IOperation.result</code> or <code>resultMethod</code> result assigned to it. * @param resultPropertyName The property name on the <code>resultTargetObject</code> that will have the <code>IOperation.result</code> or <code>resultMethod</code> result assigned to it. * @param errorMethod A <code>Function</code> that will be invoked using the <code>IOperation.error</code> as a parameter. */ public function handleOperation(operation:IOperation, resultMethod:Function=null, resultTargetObject:Object=null, resultPropertyName:String=null, errorMethod:Function=null):void { if (operation != null) { busy = true; _operations[operation] = new OperationHandlerData(resultPropertyName, resultTargetObject, resultMethod, errorMethod); operation.addCompleteListener(operationCompleteListener); operation.addErrorListener(operationErrorHandler); } } /** * Removes all event listeners from the specified <code>IOperation</code>. * @param operation */ protected function cleanupUpOperation(operation:IOperation):void { Assert.notNull(operation, "operation argument must not be null"); operation.removeCompleteListener(operationCompleteListener); operation.removeErrorListener(operationErrorHandler); delete _operations[operation]; } /** * Initializes the current <code>OperationHandler</code>. * @param defaultErrorHandler a default method that is invoked when an operation returns an error. */ protected function initOperationHandler(defaultErrorHandler:Function):void { _operations = new Dictionary(); _defaultErrorHandler = defaultErrorHandler; } /** * Invokes either the specified result method with * the <code>OperationEvent.result</code> property after an <code>IOperation</code> return a result. * @param event The specified <code>OperationEvent</code>. */ protected function operationCompleteListener(event:OperationEvent):void { Assert.notNull(event, "event argument must not be null"); busy = false; var data:OperationHandlerData = _operations[event.operation]; cleanupUpOperation(event.operation); if (data == null) { return; } if ((data.resultPropertyName == null) && (data.resultMethod == null)) { return; } if ((data.resultPropertyName != null) && (data.resultTargetObject != null) && (data.resultMethod == null)) { data.resultTargetObject[data.resultPropertyName] = event.operation.result; } else if ((data.resultPropertyName == null) && (data.resultMethod != null)) { data.resultMethod.apply(data, [event.operation.result]); } else if ((data.resultPropertyName != null) && (data.resultTargetObject != null) && (data.resultMethod != null)) { data.resultTargetObject[data.resultPropertyName] = data.resultMethod.apply(data, [event.operation.result]); } } /** * Invokes either the default error method or the specified error method with * the <code>OperationEvent.error</code> property after an <code>IOperation</code> encountered an error. * @param event The specified <code>OperationEvent</code>. */ protected function operationErrorHandler(event:OperationEvent):void { Assert.notNull(event, "event argument must not be null"); busy = false; var data:OperationHandlerData = _operations[event.operation]; cleanupUpOperation(event.operation); var errorMethod:Function = _defaultErrorHandler; if (data.errorMethod != null) { errorMethod = data.errorMethod; } if (errorMethod != null) { errorMethod(event.operation.error); } } } }
/** * 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.tc.services { public interface IUserDataService { function retrieve():void } }
/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is [Open Source Virtual Machine.]. * * The Initial Developer of the Original Code is * Adobe System Incorporated. * Portions created by the Initial Developer are Copyright (C) 2004-2006 * the Initial Developer. All Rights Reserved. * * Contributor(s): * Adobe AS3 Team * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ var SECTION = "Definitions"; // provide a document reference (ie, ECMA section) var VERSION = "AS 3.0"; // Version of JavaScript or ECMA var TITLE = "Access static method of base class from subclass"; // Provide ECMA section title or a description var BUGNUMBER = ""; startTest(); // leave this alone /** * Calls to AddTestCase here. AddTestCase is a function that is defined * in shell.js and takes three arguments: * - a string representation of what is being tested * - the expected result * - the actual result * * For example, a test might look like this: * * var helloWorld = "Hello World"; * * AddTestCase( * "var helloWorld = 'Hello World'", // description of the test * "Hello World", // expected result * helloWorld ); // actual result * */ import StaticPropertyPackage.*; var obj = new AccStatMethIntermediateSubClassMeth(); // ******************************************** // Access the static method via sub class, // using unadorned "foo()" // ******************************************** AddTestCase( "*** Access the static method via sub class using unadorned method call ***", 1, 1 ); AddTestCase( "obj.callEcho('world')", "world", obj.callEcho("world") ); // ******************************************** // Access the static method via sub class, // using "BaseClass.foo()" // ******************************************** AddTestCase( "*** Access the static method via sub class using base class method call ***", 1, 1 ); AddTestCase( "obj.callBaseEcho('here')", "here", obj.callBaseEcho("here") ); test(); // leave this alone. this executes the test cases and // displays results.
package org.osflash.net.rest { import asunit.asserts.assertNotNull; import asunit.asserts.assertTrue; import asunit.asserts.fail; import asunit.framework.IAsync; import org.osflash.net.http.queues.HTTPQueue; import org.osflash.net.http.queues.IHTTPQueue; import org.osflash.net.rest.events.RestErrorEvent; import org.osflash.net.rest.output.http.RestHTTPOutput; import org.osflash.net.rest.services.IRestService; import org.osflash.net.rest.support.services.GetAllUsersService; /** * @author Simon Richardson - simon@ustwo.co.uk */ public class RestGetAllUsersTest { [Inject] public var async : IAsync; private var _rest : RestManager; [Before] public function setUp() : void { const queue : IHTTPQueue = new HTTPQueue(); const host : RestHost = new RestHost('rest.com'); _rest = new RestManager(host); _rest.output = new RestHTTPOutput(queue); } [After] public function tearDown() : void { _rest = null; } [Test] public function create_service_and_execute() : void { const service : IRestService = new GetAllUsersService(); service.completedSignal.add(async.add(handleCompletedSignal, 2000)); service.errorSignal.add(handleErrorSignal); _rest.add(service); } private function handleCompletedSignal(service : IRestService) : void { const getAllUsersService : GetAllUsersService = service as GetAllUsersService; assertTrue('Service should be GetAllUsersService', service is GetAllUsersService); assertNotNull('GetAllUsersService should not be null', getAllUsersService); assertNotNull('GetAllUsersService users should not be null', getAllUsersService.users); assertTrue('Users should be greater than 0', getAllUsersService.users.length > 0); } private function handleErrorSignal(service : IRestService, event : RestErrorEvent) : void { fail("Failed if called"); service; event; } } }
import com.Utils.Text; import com.boobuildscommon.ModalBase; import mx.utils.Delegate; /** * There is no copyright on this code * * 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. * * 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. * * Author: Boorish */ class com.boobuilds.ImportOutfitDialog { private var m_modalBase:ModalBase; private var m_textFormat:TextFormat; private var m_callback:Function; private var m_nameInput:TextField; private var m_outfitInput:TextField; public function ImportOutfitDialog(name:String, parent:MovieClip, frameWidth:Number, frameHeight:Number) { m_modalBase = new ModalBase(name, parent, Delegate.create(this, DrawControls), frameWidth, frameHeight, frameWidth * 0.65, frameHeight * 0.75); var modalMC:MovieClip = m_modalBase.GetMovieClip(); var x:Number = modalMC._width / 4; var y:Number = modalMC._height - 10; m_modalBase.DrawButton("OK", modalMC._width / 4, y, Delegate.create(this, ButtonPressed)); m_modalBase.DrawButton("Cancel", modalMC._width - (modalMC._width / 4), y, Delegate.create(this, ButtonPressed)); } public function Show(callback:Function):Void { Selection.setFocus(m_nameInput); m_callback = callback; m_modalBase.Show(m_callback); } public function Hide():Void { Selection.setFocus(null); m_modalBase.Hide(); } public function Unload():Void { Selection.setFocus(null); m_modalBase.Unload(); } private function DrawControls(modalMC:MovieClip, textFormat:TextFormat):Void { m_textFormat = textFormat; var text1:String = "Outfit name"; var labelExtents:Object; labelExtents = Text.GetTextExtent(text1, m_textFormat, modalMC); var line1:TextField = modalMC.createTextField("Line1", modalMC.getNextHighestDepth(), modalMC._width / 2 - labelExtents.width / 2, labelExtents.height, labelExtents.width, labelExtents.height); line1.embedFonts = true; line1.selectable = false; line1.antiAliasType = "advanced"; line1.autoSize = true; line1.border = false; line1.background = false; line1.setNewTextFormat(m_textFormat); line1.text = text1; var input:TextField = modalMC.createTextField("NameInput", modalMC.getNextHighestDepth(), 30, line1._y + line1._height + 10, modalMC._width - 60, labelExtents.height + 6); input.type = "input"; input.embedFonts = true; input.selectable = true; input.antiAliasType = "advanced"; input.autoSize = false; input.border = true; input.background = false; input.setNewTextFormat(m_textFormat); input.text = ""; input.borderColor = 0x585858; input.background = true; input.backgroundColor = 0x2E2E2E; input.wordWrap = false; input.maxChars = 40; m_nameInput = input; var text2:String = "Outfit export string"; labelExtents = Text.GetTextExtent(text2, m_textFormat, modalMC); var line2:TextField = modalMC.createTextField("Label", modalMC.getNextHighestDepth(), 30, labelExtents.height * 4, labelExtents.width, labelExtents.height); line2.embedFonts = true; line2.selectable = false; line2.antiAliasType = "advanced"; line2.autoSize = true; line2.border = false; line2.background = false; line2.setNewTextFormat(m_textFormat); line2.text = text2; var input2:TextField = modalMC.createTextField("Input", modalMC.getNextHighestDepth(), 30, line2._y + line2._height + 10, modalMC._width - 60, (labelExtents.height * 10) + 6); input2.type = "input"; input2.embedFonts = true; input2.selectable = true; input2.antiAliasType = "advanced"; input2.autoSize = false; input2.border = true; input2.background = false; input2.setNewTextFormat(m_textFormat); input2.text = ""; input2.borderColor = 0x585858; input2.background = true; input2.backgroundColor = 0x2E2E2E; input2.wordWrap = true; input2.maxChars = 8192; input2.multiline = true; m_outfitInput = input2; } private function ButtonPressed(text:String):Void { var success:Boolean = false; if (text == "OK") { success = true; } m_modalBase.Hide(); if (m_callback != null) { if (success) { m_callback(m_nameInput.text, m_outfitInput.text); } else { m_callback(null, null); } } } }
//////////////////////////////////////////////////////////////////////////////// // // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. // The ASF licenses this file to You under the Apache License, Version 2.0 // (the "License"); you may not use this file except in compliance with // the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // //////////////////////////////////////////////////////////////////////////////// package mx.containers.gridClasses { import mx.core.UIComponent; [ExcludeClass] /** * @private * Internal helper class used to exchange information between * Grid and GridRow. */ public class GridRowInfo { include "../../core/Version.as"; //-------------------------------------------------------------------------- // // Constructor // //-------------------------------------------------------------------------- /** * Constructor. * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ public function GridRowInfo() { super(); min = 0; preferred = 0; max = UIComponent.DEFAULT_MAX_HEIGHT; flex = 0; } //-------------------------------------------------------------------------- // // Properties // //-------------------------------------------------------------------------- //---------------------------------- // flex //---------------------------------- /** * Input: Measurement for the GridRow. * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ public var flex:Number; //---------------------------------- // height //---------------------------------- /** * Output: The actual height of each row, * as determined by updateDisplayList(). * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ public var height:Number; //---------------------------------- // max //---------------------------------- /** * Input: Measurement for the GridRow. * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ public var max:Number; //---------------------------------- // min //---------------------------------- /** * Input: Measurement for the GridRow. * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ public var min:Number; //---------------------------------- // preferred //---------------------------------- /** * Input: Measurement for the GridRow. * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ public var preferred:Number; //---------------------------------- // y //---------------------------------- /** * Output: The actual position of each row, * as determined by updateDisplayList(). * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ public var y:Number; } }
/* * FLINT PARTICLE SYSTEM * ..................... * * Author: Richard Lord & Michael Ivanov * Copyright (c) Richard Lord 2008-2011 * http://flintparticles.org * * * Licence Agreement * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ package org.flintparticles.integration.away3d.v4.initializers { import away3d.core.base.Object3D; import org.flintparticles.common.emitters.Emitter; import org.flintparticles.common.initializers.InitializerBase; import org.flintparticles.common.particles.Particle; import org.flintparticles.common.utils.construct; /** * The ApplyMaterialClass initializer creates a material to apply to the Away3D 4 * object that is used when rendering the particle. To use this initializer, * the particle's image object must be an Away3D 4 Object3D. * * <p>This initializer has a priority of -10 to ensure that it is applied after * the ImageInit classes which define the image object.</p> */ public class A3D4ApplyMaterialClass extends InitializerBase { private var _materialClass:Class; private var _parameters:Array; /** * The constructor creates an ApplyMaterial initializer for use by * an emitter. To add an ApplyMaterial to all particles created by * an emitter, use the emitter's addInitializer method. * * @param materialClass The class to use when creating * the particles' material. * @param parameters The parameters to pass to the constructor * for the material class. * * @see org.flintparticles.common.emitters.Emitter#addInitializer() */ public function A3D4ApplyMaterialClass( materialClass:Class, ...parameters ) { priority = -10; _materialClass = materialClass; _parameters = parameters; } /** * The class to use when creating the particles' material. */ public function get materialClass():Class { return _materialClass; } public function set materialClass( value:Class ):void { _materialClass = value; } /** * The parameters to pass to the constructor * for the material class. */ public function get parameters():Array { return _parameters; } public function set parameters( value:Array ):void { _parameters = value; } /** * @inheritDoc */ override public function initialize( emitter:Emitter, particle:Particle ):void { if( particle.image && particle.image is Object3D ) { if( Object3D( particle.image ).hasOwnProperty( "material" ) ) { Object3D( particle.image )["material"] = construct( _materialClass, _parameters ); } } } } }
/*********************************************************************** Copyright (c) 2008, Memo Akten, www.memo.tv This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program 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 General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. ***********************************************************************/ package alternterrainxtras.msa { public class MathUtils { static public function clamp(n:Number):Number { return n < 0 ? 0 : n > 1 ? 1 : n; } static public function contrast(n:Number, c:Number = 1):Number { return ((n*2 - 1) * c * c + 1) * 0.5; } static public function brightness(n:Number, b:Number = 0):Number { return (b<0) ? n * (1 + b) : 1 - (1 - n) * (1 - b); } } }
/* 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/. */ /* * Internal Interface InternalInterface * Interface methods * * */ package PublicClassImpInternalInt{ internal interface InternalInt{ function deffunc():String; } }
package com.company.assembleegameclient.objects.particles { import com.company.assembleegameclient.objects.GameObject; import flash.events.TimerEvent; import flash.geom.Point; import flash.utils.Timer; public class ShockeeEffect extends ParticleEffect { public function ShockeeEffect(param1:GameObject) { super(); this.go = param1; this.go.hasShock = true; } public var start_:Point; public var go:GameObject; private var isShocked:Boolean; override public function update(param1:int, param2:int):Boolean { var _loc3_:Timer = new Timer(50, 12); _loc3_.addEventListener("timer", this.onTimer); _loc3_.addEventListener("timerComplete", this.onTimerComplete); _loc3_.start(); return false; } private function onTimerComplete(param1:TimerEvent):void { this.go = null; } private function onTimer(param1:TimerEvent):void { this.isShocked = !this.isShocked; if (this.go) { this.go.toggleShockEffect(this.isShocked); } } } }
package wsClasses { import flash.utils.Dictionary; import wsForm.WSProjectProperties; public class WSGenerator { public function WSGenerator() { } public var properties:WSProjectProperties = null; public function start():void { } protected var service:SoapService = null; protected var url:String = ""; public var libPath:String = ""; protected final function log(s:String):void { properties.log += s + "\n"; } private var s:Namespace = new Namespace("http://www.w3.org/2001/XMLSchema"); protected function escapeClassName(name:String):String { return name; } protected function getClassName(sc:WSType):String { var name:String = sc.wsType; if(sc.serviceName!=null){ name = sc.serviceName + "_" + name; } if(types.hasOwnProperty(name)){ var i:int = types[name]; i = i+1; types[name] = i; return name + i.toString(); }else{ types[name] = 0; } return name; } private var types:Dictionary = new Dictionary(); public final function clearTypes():void { types = new Dictionary(); } public final function generateService(ss:SoapService):void { if(License.demo){ log("WARNING! Only two web services and only two methods will be created in demo version !!"); } var sc:WSType; clearTypes(); service = ss; beforeGenerate(ss); // generate all native information first... // generate all classes first.. for each(sc in ss.types) { if(sc.isCustom && !sc.isArray) { sc.className = escapeClassName(getClassName(sc)); } } for each(sc in ss.types) { if(sc.isCustom && sc.isArray) { sc.className = sc.arrayType.className; } } var st:WSType; for each(st in ss.types){ _setType(st); } for each(sc in ss.types) { if(sc.isCustom && !sc.isArray) { generateClass(sc); } } log("Generating Web Service: " + ss.serviceName); generate(ss); afterGenerate(ss); } public function generateClass(sc:WSType):void { } private function _setType(st:WSType):void { if(st.isArray){ st.arrayType.qName = changeQName(st.arrayType.qName); }else{ st.qName = changeQName(st.qName); } // change types ... setType(st); } private function changeQName(qn:QName):QName { if(qn.uri == s.uri){ switch(qn.localName){ case "byte": case "unsignedByte": case "unsignedInt": case "unsignedShort": case "integer": case "short": case "negativeInteger": case "nonNegativeInteger": case "nonPositiveInteger": case "positiveInteger": //st.wsType = "int"; //st.wsNameSpace = "s"; qn = new QName(s.uri,"int"); break; case "unsignedLong": //st.wsFullType = "s:long"; //st.wsType = "long"; //st.wsNameSpace = "s"; qn = new QName(s.uri,"long"); break; case "token": case "hexBinary": case "base64Binary": case "duration": case "anyURI": case "QName": case "NOTATION": case "normalizedString": case "Name": case "guid": case "ID": case "NMTOKEN": case "IDREF": //st.wsFullType = "s:string"; //st.wsType = "string"; //st.wsNameSpace = "s"; qn = new QName(s.uri,"string"); break; case "date": case "time": //st.wsFullType = "s:dateTime"; //st.wsType = "dateTime"; //st.wsNameSpace = "s"; qn = new QName(s.uri,"dateTime"); break; case "decimal": //st.wsFullType = "s:double"; //st.wsType = "double"; //st.wsNameSpace = "s"; qn = new QName(s.uri,"double"); break; } } return qn; } protected function setType(st:WSType):void { } protected function generate(ss:SoapService):void { } protected function beforeGenerateClass(st:WSType):void { log("Generating Type:" + st.wsType); } protected function beforeGenerate(ss:SoapService):void { } protected function afterGenerate(ss:SoapService):void { } public function end():void { log("Services Generated..."); } } }
/** * User: Valeriy Bashtovoy * Date: 12/1/2014 */ package org.motivateclock.controller.command { import flash.filesystem.File; import org.motivateclock.Model; import org.motivateclock.enum.FileEnum; import org.motivateclock.events.StorageEvent; import org.motivateclock.interfaces.ICommand; import org.motivateclock.utils.Storage; public class LoadTempProcessCommand implements ICommand { private var _model:Model; private var _tempFile:File; public function LoadTempProcessCommand(model:Model) { _model = model; } public function execute():void { _tempFile = File.applicationStorageDirectory.resolvePath(FileEnum.TEMP); if (!_tempFile.exists) { return; } var storage:Storage = new Storage(_tempFile); storage.addEventListener(StorageEvent.COMPLETE, storage_completeHandler); storage.loadString(); } private function storage_completeHandler(event:StorageEvent):void { const data:String = event.data as String; const rawProcessList:Array = data.split("\n"); const length:int = rawProcessList.length; var processInfo:Array; var date:String; var projectId:String; var name:String; var path:String; var time:Number; for (var i:int = 0; i < length; i++) { processInfo = rawProcessList[i].split("\t"); if (processInfo.length == 0) { continue; } projectId = processInfo[0]; date = processInfo[1]; name = processInfo[2]; path = processInfo[3]; time = processInfo[4]; if (!projectId) { continue; } //trace(this, projectId, date, path, name, time); _model.dataBase.syncProcess(projectId, date, path, name, time); } //trace(this); _tempFile.deleteFile(); } } }
/* * Copyright(c) 2007 the Spark project. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, * either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ package org.libspark.swfassist.swf.tags { public class ExportAssets extends AbstractTag { public function ExportAssets(code:uint = 0) { super(code != 0 ? code : TagCodeConstants.TAG_EXPORT_ASSETS); } private var _assets:Array = []; public function get numAssets():uint { return assets.length; } public function get assets():Array { return _assets; } public function set assets(value:Array):void { _assets = value; } public override function visit(visitor:TagVisitor):void { visitor.visitExportAssets(this); } } }