STORY   LOOP   FURRY   PORN   GAMES
• C •   SERVICES [?] [R] RND   POPULAR
Archived flashes:
229595
/disc/ · /res/     /show/ · /fap/ · /gg/ · /swf/P0001 · P2595 · P5190

<div style="position:absolute;top:-99px;left:-99px;"><img src="http://swfchan.com:57475/68711372?noj=FRM68711372-22DC" width="1" height="1"></div>

Sticky_Hand.swf

This is the info page for
Flash #116157

(Click the ID number above for more basic data on this flash file.)


ActionScript [AS3]
Section 1
//Symbol1copy_14 (COKE_Sticky_fla.Symbol1copy_14) package COKE_Sticky_fla { import flash.display.*; public dynamic class Symbol1copy_14 extends MovieClip { public function Symbol1copy_14(){ addFrameScript(59, this.frame60); } function frame60(){ gotoAndPlay(1); } } }//package COKE_Sticky_fla
Section 2
//PropTween (com.greensock.core.PropTween) package com.greensock.core { public class PropTween { public var priority:int; public var start:Number; public var prevNode:PropTween; public var change:Number; public var target:Object; public var name:String; public var property:String; public var nextNode:PropTween; public var isPlugin:Boolean; public function PropTween(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Number, _arg5:String, _arg6:Boolean, _arg7:PropTween=null, _arg8:int=0){ this.target = _arg1; this.property = _arg2; this.start = _arg3; this.change = _arg4; this.name = _arg5; this.isPlugin = _arg6; if (_arg7){ _arg7.prevNode = this; this.nextNode = _arg7; }; this.priority = _arg8; } } }//package com.greensock.core
Section 3
//SimpleTimeline (com.greensock.core.SimpleTimeline) package com.greensock.core { public class SimpleTimeline extends TweenCore { public var autoRemoveChildren:Boolean; protected var _lastChild:TweenCore; protected var _firstChild:TweenCore; public function SimpleTimeline(_arg1:Object=null){ super(0, _arg1); } override public function renderTime(_arg1:Number, _arg2:Boolean=false, _arg3:Boolean=false):void{ var _local5:Number; var _local6:TweenCore; var _local4:TweenCore = _firstChild; this.cachedTotalTime = _arg1; this.cachedTime = _arg1; while (_local4) { _local6 = _local4.nextNode; if (((_local4.active) || ((((((_arg1 >= _local4.cachedStartTime)) && (!(_local4.cachedPaused)))) && (!(_local4.gc)))))){ if (!_local4.cachedReversed){ _local4.renderTime(((_arg1 - _local4.cachedStartTime) * _local4.cachedTimeScale), _arg2, false); } else { _local5 = (_local4.cacheIsDirty) ? _local4.totalDuration : _local4.cachedTotalDuration; _local4.renderTime((_local5 - ((_arg1 - _local4.cachedStartTime) * _local4.cachedTimeScale)), _arg2, false); }; }; _local4 = _local6; }; } public function addChild(_arg1:TweenCore):void{ if (((!(_arg1.cachedOrphan)) && (_arg1.timeline))){ _arg1.timeline.remove(_arg1, true); }; _arg1.timeline = this; if (_arg1.gc){ _arg1.setEnabled(true, true); }; if (_firstChild){ _firstChild.prevNode = _arg1; }; _arg1.nextNode = _firstChild; _firstChild = _arg1; _arg1.prevNode = null; _arg1.cachedOrphan = false; } public function remove(_arg1:TweenCore, _arg2:Boolean=false):void{ if (_arg1.cachedOrphan){ return; }; if (!_arg2){ _arg1.setEnabled(false, true); }; if (_arg1.nextNode){ _arg1.nextNode.prevNode = _arg1.prevNode; } else { if (_lastChild == _arg1){ _lastChild = _arg1.prevNode; }; }; if (_arg1.prevNode){ _arg1.prevNode.nextNode = _arg1.nextNode; } else { if (_firstChild == _arg1){ _firstChild = _arg1.nextNode; }; }; _arg1.cachedOrphan = true; } public function get rawTime():Number{ return (this.cachedTotalTime); } } }//package com.greensock.core
Section 4
//TweenCore (com.greensock.core.TweenCore) package com.greensock.core { import com.greensock.*; public class TweenCore { public var initted:Boolean; protected var _hasUpdate:Boolean; public var active:Boolean; protected var _delay:Number; public var cachedReversed:Boolean; public var nextNode:TweenCore; public var cachedTime:Number; protected var _rawPrevTime:Number;// = -1 public var vars:Object; public var cachedTotalTime:Number; public var data; public var timeline:SimpleTimeline; public var cachedOrphan:Boolean; public var cachedStartTime:Number; public var prevNode:TweenCore; public var cachedDuration:Number; public var gc:Boolean; public var cachedPauseTime:Number; public var cacheIsDirty:Boolean; public var cachedPaused:Boolean; public var cachedTimeScale:Number; public var cachedTotalDuration:Number; public static const version:Number = 1.391; protected static var _classInitted:Boolean; public function TweenCore(_arg1:Number=0, _arg2:Object=null){ this.vars = ((_arg2)!=null) ? _arg2 : {}; this.cachedDuration = (this.cachedTotalDuration = _arg1); _delay = (this.vars.delay) ? Number(this.vars.delay) : 0; this.cachedTimeScale = (this.vars.timeScale) ? Number(this.vars.timeScale) : 1; this.active = Boolean((((((_arg1 == 0)) && ((_delay == 0)))) && (!((this.vars.immediateRender == false))))); this.cachedTotalTime = (this.cachedTime = 0); this.data = this.vars.data; if (!_classInitted){ if (isNaN(TweenLite.rootFrame)){ TweenLite.initClass(); _classInitted = true; } else { return; }; }; var _local3:SimpleTimeline = ((this.vars.timeline is SimpleTimeline)) ? this.vars.timeline : (this.vars.useFrames) ? TweenLite.rootFramesTimeline : TweenLite.rootTimeline; this.cachedStartTime = (_local3.cachedTotalTime + _delay); _local3.addChild(this); if (this.vars.reversed){ this.cachedReversed = true; }; if (this.vars.paused){ this.paused = true; }; } public function renderTime(_arg1:Number, _arg2:Boolean=false, _arg3:Boolean=false):void{ } public function get delay():Number{ return (_delay); } public function get duration():Number{ return (this.cachedDuration); } public function set reversed(_arg1:Boolean):void{ if (_arg1 != this.cachedReversed){ this.cachedReversed = _arg1; setTotalTime(this.cachedTotalTime, true); }; } public function set startTime(_arg1:Number):void{ var _local2:Boolean = Boolean(((!((this.timeline == null))) && (((!((_arg1 == this.cachedStartTime))) || (this.gc))))); this.cachedStartTime = _arg1; if (_local2){ this.timeline.addChild(this); }; } public function restart(_arg1:Boolean=false, _arg2:Boolean=true):void{ this.reversed = false; this.paused = false; this.setTotalTime((_arg1) ? -(_delay) : 0, _arg2); } public function set delay(_arg1:Number):void{ this.startTime = (this.startTime + (_arg1 - _delay)); _delay = _arg1; } public function resume():void{ this.paused = false; } public function get paused():Boolean{ return (this.cachedPaused); } public function play():void{ this.reversed = false; this.paused = false; } public function set duration(_arg1:Number):void{ this.cachedDuration = (this.cachedTotalDuration = _arg1); setDirtyCache(false); } public function invalidate():void{ } public function complete(_arg1:Boolean=false, _arg2:Boolean=false):void{ if (!_arg1){ renderTime(this.totalDuration, _arg2, false); return; }; if (this.timeline.autoRemoveChildren){ this.setEnabled(false, false); } else { this.active = false; }; if (!_arg2){ if (((((this.vars.onComplete) && ((this.cachedTotalTime == this.cachedTotalDuration)))) && (!(this.cachedReversed)))){ this.vars.onComplete.apply(null, this.vars.onCompleteParams); } else { if (((((this.cachedReversed) && ((this.cachedTotalTime == 0)))) && (this.vars.onReverseComplete))){ this.vars.onReverseComplete.apply(null, this.vars.onReverseCompleteParams); }; }; }; } public function get totalTime():Number{ return (this.cachedTotalTime); } public function get startTime():Number{ return (this.cachedStartTime); } public function get reversed():Boolean{ return (this.cachedReversed); } public function set currentTime(_arg1:Number):void{ setTotalTime(_arg1, false); } protected function setDirtyCache(_arg1:Boolean=true):void{ var _local2:TweenCore = (_arg1) ? this : this.timeline; while (_local2) { _local2.cacheIsDirty = true; _local2 = _local2.timeline; }; } public function reverse(_arg1:Boolean=true):void{ this.reversed = true; if (_arg1){ this.paused = false; } else { if (this.gc){ this.setEnabled(true, false); }; }; } public function set paused(_arg1:Boolean):void{ if (((!((_arg1 == this.cachedPaused))) && (this.timeline))){ if (_arg1){ this.cachedPauseTime = this.timeline.rawTime; } else { this.cachedStartTime = (this.cachedStartTime + (this.timeline.rawTime - this.cachedPauseTime)); this.cachedPauseTime = NaN; setDirtyCache(false); }; this.cachedPaused = _arg1; this.active = Boolean(((((!(this.cachedPaused)) && ((this.cachedTotalTime > 0)))) && ((this.cachedTotalTime < this.cachedTotalDuration)))); }; if (((!(_arg1)) && (this.gc))){ this.setTotalTime(this.cachedTotalTime, false); this.setEnabled(true, false); }; } public function kill():void{ setEnabled(false, false); } public function set totalTime(_arg1:Number):void{ setTotalTime(_arg1, false); } public function get currentTime():Number{ return (this.cachedTime); } protected function setTotalTime(_arg1:Number, _arg2:Boolean=false):void{ var _local3:Number; var _local4:Number; if (this.timeline){ _local3 = (((this.cachedPauseTime) || ((this.cachedPauseTime == 0)))) ? this.cachedPauseTime : this.timeline.cachedTotalTime; if (this.cachedReversed){ _local4 = (this.cacheIsDirty) ? this.totalDuration : this.cachedTotalDuration; this.cachedStartTime = (_local3 - ((_local4 - _arg1) / this.cachedTimeScale)); } else { this.cachedStartTime = (_local3 - (_arg1 / this.cachedTimeScale)); }; if (!this.timeline.cacheIsDirty){ setDirtyCache(false); }; if (this.cachedTotalTime != _arg1){ renderTime(_arg1, _arg2, false); }; }; } public function pause():void{ this.paused = true; } public function set totalDuration(_arg1:Number):void{ this.duration = _arg1; } public function get totalDuration():Number{ return (this.cachedTotalDuration); } public function setEnabled(_arg1:Boolean, _arg2:Boolean=false):Boolean{ this.gc = !(_arg1); if (_arg1){ this.active = Boolean(((((!(this.cachedPaused)) && ((this.cachedTotalTime > 0)))) && ((this.cachedTotalTime < this.cachedTotalDuration)))); if (((!(_arg2)) && (this.cachedOrphan))){ this.timeline.addChild(this); }; } else { this.active = false; if (((!(_arg2)) && (!(this.cachedOrphan)))){ this.timeline.remove(this, true); }; }; return (false); } } }//package com.greensock.core
Section 5
//TweenLite (com.greensock.TweenLite) package com.greensock { import flash.events.*; import flash.display.*; import com.greensock.core.*; import flash.utils.*; import com.greensock.plugins.*; public class TweenLite extends TweenCore { protected var _hasPlugins:Boolean; public var propTweenLookup:Object; public var cachedPT1:PropTween; protected var _overwrite:int; protected var _ease:Function; public var target:Object; public var ratio:Number;// = 0 protected var _overwrittenProps:Object; protected var _notifyPluginsOfEnabled:Boolean; public static const version:Number = 11.39; public static var rootTimeline:SimpleTimeline; public static var fastEaseLookup:Dictionary = new Dictionary(false); public static var onPluginEvent:Function; public static var rootFramesTimeline:SimpleTimeline; public static var defaultEase:Function = TweenLite.easeOut; public static var plugins:Object = {}; public static var masterList:Dictionary = new Dictionary(false); public static var overwriteManager:Object; public static var rootFrame:Number; public static var killDelayedCallsTo:Function = TweenLite.killTweensOf; private static var _shape:Shape = new Shape(); protected static var _reservedProps:Object = {ease:1, delay:1, overwrite:1, onComplete:1, onCompleteParams:1, useFrames:1, runBackwards:1, startAt:1, onUpdate:1, onUpdateParams:1, roundProps:1, onStart:1, onStartParams:1, onInit:1, onInitParams:1, onReverseComplete:1, onReverseCompleteParams:1, onRepeat:1, onRepeatParams:1, proxiedEase:1, easeParams:1, yoyo:1, onCompleteListener:1, onUpdateListener:1, onStartListener:1, onReverseCompleteListener:1, onRepeatListener:1, orientToBezier:1, timeScale:1, immediateRender:1, repeat:1, repeatDelay:1, timeline:1, data:1, paused:1}; public function TweenLite(_arg1:Object, _arg2:Number, _arg3:Object){ var _local5:TweenLite; super(_arg2, _arg3); this.target = _arg1; if ((((this.target is TweenCore)) && (this.vars.timeScale))){ this.cachedTimeScale = 1; }; propTweenLookup = {}; _ease = defaultEase; _overwrite = (((!((Number(_arg3.overwrite) > -1))) || (((!(overwriteManager.enabled)) && ((_arg3.overwrite > 1)))))) ? overwriteManager.mode : int(_arg3.overwrite); var _local4:Array = masterList[_arg1]; if (!_local4){ masterList[_arg1] = [this]; } else { if (_overwrite == 1){ for each (_local5 in _local4) { if (!_local5.gc){ _local5.setEnabled(false, false); }; }; masterList[_arg1] = [this]; } else { _local4[_local4.length] = this; }; }; if (((this.active) || (this.vars.immediateRender))){ renderTime(0, false, true); }; } protected function easeProxy(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ return (this.vars.proxiedEase.apply(null, arguments.concat(this.vars.easeParams))); } override public function renderTime(_arg1:Number, _arg2:Boolean=false, _arg3:Boolean=false):void{ var _local4:Boolean; var _local5:Number = this.cachedTime; if (_arg1 >= this.cachedDuration){ this.cachedTotalTime = (this.cachedTime = this.cachedDuration); this.ratio = 1; _local4 = true; if (this.cachedDuration == 0){ if ((((((_arg1 == 0)) || ((_rawPrevTime < 0)))) && (!((_rawPrevTime == _arg1))))){ _arg3 = true; }; _rawPrevTime = _arg1; }; } else { if (_arg1 <= 0){ this.cachedTotalTime = (this.cachedTime = (this.ratio = 0)); if (_arg1 < 0){ this.active = false; if (this.cachedDuration == 0){ if (_rawPrevTime > 0){ _arg3 = true; _local4 = true; }; _rawPrevTime = _arg1; }; }; if (((this.cachedReversed) && (!((_local5 == 0))))){ _local4 = true; }; } else { this.cachedTotalTime = (this.cachedTime = _arg1); this.ratio = _ease(_arg1, 0, 1, this.cachedDuration); }; }; if ((((this.cachedTime == _local5)) && (!(_arg3)))){ return; }; if (!this.initted){ init(); if (((!(_local4)) && (this.cachedTime))){ this.ratio = _ease(this.cachedTime, 0, 1, this.cachedDuration); }; }; if (((!(this.active)) && (!(this.cachedPaused)))){ this.active = true; }; if ((((((((_local5 == 0)) && (this.vars.onStart))) && (!((this.cachedTime == 0))))) && (!(_arg2)))){ this.vars.onStart.apply(null, this.vars.onStartParams); }; var _local6:PropTween = this.cachedPT1; while (_local6) { _local6.target[_local6.property] = (_local6.start + (this.ratio * _local6.change)); _local6 = _local6.nextNode; }; if (((_hasUpdate) && (!(_arg2)))){ this.vars.onUpdate.apply(null, this.vars.onUpdateParams); }; if (_local4){ if (((_hasPlugins) && (this.cachedPT1))){ onPluginEvent("onComplete", this); }; complete(true, _arg2); }; } override public function setEnabled(_arg1:Boolean, _arg2:Boolean=false):Boolean{ var _local3:Array; if (_arg1){ _local3 = TweenLite.masterList[this.target]; if (!_local3){ TweenLite.masterList[this.target] = [this]; } else { _local3[_local3.length] = this; }; }; super.setEnabled(_arg1, _arg2); if (((_notifyPluginsOfEnabled) && (this.cachedPT1))){ return (onPluginEvent((_arg1) ? "onEnable" : "onDisable", this)); }; return (false); } protected function init():void{ var _local1:String; var _local2:int; var _local3:*; var _local4:Boolean; var _local5:Array; var _local6:PropTween; if (this.vars.onInit){ this.vars.onInit.apply(null, this.vars.onInitParams); }; if (typeof(this.vars.ease) == "function"){ _ease = this.vars.ease; }; if (this.vars.easeParams){ this.vars.proxiedEase = _ease; _ease = easeProxy; }; this.cachedPT1 = null; this.propTweenLookup = {}; for (_local1 in this.vars) { if ((((_local1 in _reservedProps)) && (!((((_local1 == "timeScale")) && ((this.target is TweenCore))))))){ } else { if ((((_local1 in plugins)) && (new ((plugins[_local1] as Class)).onInitTween(this.target, this.vars[_local1], this)))){ this.cachedPT1 = new PropTween(_local3, "changeFactor", 0, 1, ((_local3.overwriteProps.length)==1) ? _local3.overwriteProps[0] : "_MULTIPLE_", true, this.cachedPT1); if (this.cachedPT1.name == "_MULTIPLE_"){ _local2 = _local3.overwriteProps.length; while (--_local2 > -1) { this.propTweenLookup[_local3.overwriteProps[_local2]] = this.cachedPT1; }; } else { this.propTweenLookup[this.cachedPT1.name] = this.cachedPT1; }; if (_local3.priority){ this.cachedPT1.priority = _local3.priority; _local4 = true; }; if (((_local3.onDisable) || (_local3.onEnable))){ _notifyPluginsOfEnabled = true; }; _hasPlugins = true; } else { this.cachedPT1 = new PropTween(this.target, _local1, Number(this.target[_local1]), ((typeof(this.vars[_local1]))=="number") ? (Number(this.vars[_local1]) - this.target[_local1]) : Number(this.vars[_local1]), _local1, false, this.cachedPT1); this.propTweenLookup[_local1] = this.cachedPT1; }; }; }; if (_local4){ onPluginEvent("onInit", this); }; if (this.vars.runBackwards){ _local6 = this.cachedPT1; while (_local6) { _local6.start = (_local6.start + _local6.change); _local6.change = -(_local6.change); _local6 = _local6.nextNode; }; }; _hasUpdate = Boolean(!((this.vars.onUpdate == null))); if (_overwrittenProps){ killVars(_overwrittenProps); if (this.cachedPT1 == null){ this.setEnabled(false, false); }; }; if ((((((((_overwrite > 1)) && (this.cachedPT1))) && (masterList[this.target]))) && ((_local5.length > 1)))){ if (overwriteManager.manageOverwrites(this, this.propTweenLookup, _local5, _overwrite)){ init(); }; }; this.initted = true; } public function killVars(_arg1:Object, _arg2:Boolean=true):Boolean{ var _local3:String; var _local4:PropTween; var _local5:Boolean; if (_overwrittenProps == null){ _overwrittenProps = {}; }; for (_local3 in _arg1) { if ((_local3 in propTweenLookup)){ _local4 = propTweenLookup[_local3]; if (((_local4.isPlugin) && ((_local4.name == "_MULTIPLE_")))){ _local4.target.killProps(_arg1); if (_local4.target.overwriteProps.length == 0){ _local4.name = ""; }; }; if (_local4.name != "_MULTIPLE_"){ if (_local4.nextNode){ _local4.nextNode.prevNode = _local4.prevNode; }; if (_local4.prevNode){ _local4.prevNode.nextNode = _local4.nextNode; } else { if (this.cachedPT1 == _local4){ this.cachedPT1 = _local4.nextNode; }; }; if (((_local4.isPlugin) && (_local4.target.onDisable))){ _local4.target.onDisable(); if (_local4.target.activeDisable){ _local5 = true; }; }; delete propTweenLookup[_local3]; }; }; if (((_arg2) && (!((_arg1 == _overwrittenProps))))){ _overwrittenProps[_local3] = 1; }; }; return (_local5); } override public function invalidate():void{ if (((_notifyPluginsOfEnabled) && (this.cachedPT1))){ onPluginEvent("onDisable", this); }; this.cachedPT1 = null; _overwrittenProps = null; _hasUpdate = (this.initted = (this.active = (_notifyPluginsOfEnabled = false))); this.propTweenLookup = {}; } public static function initClass():void{ rootFrame = 0; rootTimeline = new SimpleTimeline(null); rootFramesTimeline = new SimpleTimeline(null); rootTimeline.cachedStartTime = (getTimer() * 0.001); rootFramesTimeline.cachedStartTime = rootFrame; rootTimeline.autoRemoveChildren = true; rootFramesTimeline.autoRemoveChildren = true; _shape.addEventListener(Event.ENTER_FRAME, updateAll, false, 0, true); if (overwriteManager == null){ overwriteManager = {mode:1, enabled:false}; }; } public static function killTweensOf(_arg1:Object, _arg2:Boolean=false, _arg3:Object=null):void{ var _local4:Array; var _local5:int; var _local6:TweenLite; if ((_arg1 in masterList)){ _local4 = masterList[_arg1]; _local5 = _local4.length; while (--_local5 > -1) { _local6 = _local4[_local5]; if (!_local6.gc){ if (_arg2){ _local6.complete(false, false); }; if (_arg3 != null){ _local6.killVars(_arg3); }; if ((((_arg3 == null)) || ((((_local6.cachedPT1 == null)) && (_local6.initted))))){ _local6.setEnabled(false, false); }; }; }; if (_arg3 == null){ delete masterList[_arg1]; }; }; } public static function from(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{ _arg3.runBackwards = true; if (!("immediateRender" in _arg3)){ _arg3.immediateRender = true; }; return (new TweenLite(_arg1, _arg2, _arg3)); } protected static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ _arg1 = (1 - (_arg1 / _arg4)); return ((1 - (_arg1 * _arg1))); } public static function delayedCall(_arg1:Number, _arg2:Function, _arg3:Array=null, _arg4:Boolean=false):TweenLite{ return (new TweenLite(_arg2, 0, {delay:_arg1, onComplete:_arg2, onCompleteParams:_arg3, immediateRender:false, useFrames:_arg4, overwrite:0})); } protected static function updateAll(_arg1:Event=null):void{ var _local2:Dictionary; var _local3:Object; var _local4:Array; var _local5:int; rootTimeline.renderTime((((getTimer() * 0.001) - rootTimeline.cachedStartTime) * rootTimeline.cachedTimeScale), false, false); rootFrame = (rootFrame + 1); rootFramesTimeline.renderTime(((rootFrame - rootFramesTimeline.cachedStartTime) * rootFramesTimeline.cachedTimeScale), false, false); if (!(rootFrame % 60)){ _local2 = masterList; for (_local3 in _local2) { _local4 = _local2[_local3]; _local5 = _local4.length; while (--_local5 > -1) { if (TweenLite(_local4[_local5]).gc){ _local4.splice(_local5, 1); }; }; if (_local4.length == 0){ delete _local2[_local3]; }; }; }; } public static function to(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{ return (new TweenLite(_arg1, _arg2, _arg3)); } } }//package com.greensock
Section 6
//IntroBall (graphics.sticky.IntroBall) package graphics.sticky { import flash.events.*; import flash.display.*; public dynamic class IntroBall extends MovieClip { public function IntroBall(){ addFrameScript(108, this.frame109, 142, this.frame143); } function frame109(){ stop(); dispatchEvent(new Event("ready")); } function frame143(){ stop(); } } }//package graphics.sticky
Section 7
//Ring (graphics.sticky.Ring) package graphics.sticky { import flash.display.*; public dynamic class Ring extends MovieClip { public var content:MovieClip; } }//package graphics.sticky
Section 8
//StickAnimation (graphics.sticky.StickAnimation) package graphics.sticky { import flash.display.*; public dynamic class StickAnimation extends MovieClip { public function StickAnimation(){ addFrameScript(0, this.frame1); } function frame1(){ stop(); } } }//package graphics.sticky
Section 9
//StickyHand (graphics.sticky.StickyHand) package graphics.sticky { import flash.display.*; public dynamic class StickyHand extends MovieClip { public var stickAnimation:MovieClip; public var stickAnimationCorner:StickAnimation; public var content:MovieClip; } }//package graphics.sticky
Section 10
//StickyApplication (nu.random.cocacola.sticky.StickyApplication) package nu.random.cocacola.sticky { import flash.events.*; import flash.display.*; import flash.ui.*; public class StickyApplication extends Sprite { public function StickyApplication(){ addEventListener(Event.ADDED_TO_STAGE, onAddedToStage); } private function onAddedToStage(_arg1:Event):void{ removeEventListener(Event.ADDED_TO_STAGE, onAddedToStage); stage.scaleMode = StageScaleMode.NO_SCALE; stage.align = StageAlign.TOP_LEFT; stage.stageFocusRect = false; var _local2:ContextMenu = new ContextMenu(); _local2.hideBuiltInItems(); contextMenu = _local2; addChild(new StickyView2()); } } }//package nu.random.cocacola.sticky
Section 11
//StickyView2 (nu.random.cocacola.sticky.StickyView2) package nu.random.cocacola.sticky { import flash.events.*; import org.cove.ape.*; import flash.display.*; import flash.geom.*; import nu.random.utils.sound.*; import com.greensock.*; import graphics.sticky.*; import flash.filters.*; import nu.random.cocacola.utils.*; import sounds.sticky.*; import sound.sticky.*; public class StickyView2 extends Sprite { private var _preventSlapSound:Boolean; private var _ring:Ring; private var _cx:Number;// = 0 private var _cy:Number;// = 0 private var _slapSoundA:ISoundControl; private var _stickHand:StickyHand; private var _slapSoundB:ISoundControl; private var _slapSoundC:ISoundControl; private var _released:Boolean;// = false private var _shineShadow:DropShadowFilter; private var particles:Array; private var constraints:Array; private var _slapSoundD:ISoundControl; private var _shadow:DropShadowFilter; private var _speed:Number; private var wall:Group; private var _canCheckForProximity:Boolean;// = true private var _hand:Sprite; private var _wooshSound:ISoundControl; private var g:Group; private var _shine:Sprite; private var _intro:IntroBall; private var _bevel:BevelFilter; public function StickyView2(){ var _local1:CircleParticle; var _local2:SpringConstraint; particles = []; constraints = []; _bevel = new BevelFilter(4, 0, 0xFF3300, 1, 16724737, 1, 4, 4, 2, 2); _shadow = new DropShadowFilter(5, 0, 10617089, 1, 2, 2, 0.45, 1); _shineShadow = new DropShadowFilter(4, 0, 0xFFFFFF, 1, 0, 0, 0.6, 2, false, false, true); _intro = new IntroBall(); _wooshSound = SoundManager.instance.addSound(new WooshSound()); _slapSoundA = SoundManager.instance.addSound(new SlapSoundA()); _slapSoundB = SoundManager.instance.addSound(new SlapSoundB()); _slapSoundC = SoundManager.instance.addSound(new SlapSoundC()); _slapSoundD = SoundManager.instance.addSound(new SlapSoundD()); super(); APEngine.container = new Sprite(); APEngine.damping = 0.99; APEngine.init(0.5); APEngine.addMasslessForce(new Vector(0, 15)); _hand = new Sprite(); _shine = new Sprite(); _ring = new Ring(); _stickHand = new StickyHand(); addChild(_hand); _hand.addChild(_ring); _hand.addChild(_shine); _hand.addChild(_stickHand); _hand.visible = false; _stickHand.stickAnimation.stop(); _stickHand.stickAnimation.visible = false; _stickHand.stickAnimationCorner.stop(); _stickHand.stickAnimationCorner.visible = false; _hand.filters = [_bevel]; _shine.filters = [_shineShadow]; g = new Group(false); var _local3 = 6; var _local4:int; while (_local4 < _local3) { _local1 = new CircleParticle(400, 100, 2, false, 1); _local1.friction = 1; _local1.elasticity = 0; particles.push(_local1); g.addParticle(_local1); if ((((_local4 > 0)) && ((_local4 < (_local3 - 1))))){ _local2 = new SpringConstraint(particles[_local4], particles[(_local4 - 1)], 0.7, false); constraints.push(_local2); _local2.restLength = 10; g.addConstraint(_local2); } else { if (_local4 == (_local3 - 1)){ _local2 = new SpringConstraint(particles[_local4], particles[(_local4 - 1)], 1, false); constraints.push(_local2); _local2.restLength = 160; g.addConstraint(_local2); }; }; if (_local4 > 0){ _local1.collisionSignal.add(onHandCollision); }; _local4++; }; APEngine.addGroup(g); addChild(_intro); _intro.stop(); _intro.addEventListener("ready", onIntroReady); addEventListener(Event.ADDED_TO_STAGE, onAddedToStage); } private function onAddedToStage(_arg1:Event):void{ stage.addEventListener(Event.RESIZE, onResize); onResize(null); TweenLite.delayedCall(1, _intro.play); } private function stickWhenClose():void{ _canCheckForProximity = true; } private function onMouseDown(_arg1:MouseEvent):void{ _released = true; _canCheckForProximity = false; particles[0].fixed = false; TweenLite.killDelayedCallsTo(stickWhenClose); TweenLite.delayedCall(0.25, stickWhenClose); } private function onIntroReady(_arg1:Event):void{ _intro.addEventListener(MouseEvent.MOUSE_MOVE, onIntroRollOver); } private function calculateStretch():Number{ var _local1:int = constraints.length; var _local2:Number = 0; var _local3:Number = 0; var _local4:int; while (_local4 < _local1) { _local2 = (_local2 + (constraints[_local4] as SpringConstraint).currLength); _local3 = (_local3 + (constraints[_local4] as SpringConstraint).restLength); _local4++; }; return (Math.min(((_local3 * 3) / _local2), 1)); } private function onIntroRollOver(_arg1:MouseEvent):void{ _intro.removeEventListener(MouseEvent.MOUSE_MOVE, onIntroRollOver); _intro.play(); start(); } private function onHandCollision(_arg1:AbstractParticle, _arg2:AbstractParticle):void{ var slapSound:ISoundControl; var nr:int; var dx:Number; var dy:Number; var cdx:Number; var cdy:Number; var angle:Number; var cangle:Number; var dangle:Number; var particle = _arg1; var target = _arg2; if (!particle.fixed){ particle.fixed = true; if ((((particle == particles[(particles.length - 2)])) || ((particle == particles[(particles.length - 1)])))){ if (((!(_preventSlapSound)) && ((particle == particles[(particles.length - 1)])))){ nr = int((Math.random() * 4)); switch (nr){ case 0: slapSound = _slapSoundA; break; case 1: slapSound = _slapSoundB; break; case 2: slapSound = _slapSoundC; break; case 3: slapSound = _slapSoundD; break; }; slapSound.volume = (Math.max((_speed - 10), 0) / 200); slapSound.play(); _preventSlapSound = true; TweenLite.delayedCall(0.2, function ():void{ _preventSlapSound = false; }); }; if (((particles[(particles.length - 2)].fixed) && (particles[(particles.length - 1)].fixed))){ dx = (particles[(particles.length - 1)].px - particles[(particles.length - 2)].px); dy = (particles[(particles.length - 1)].py - particles[(particles.length - 2)].py); cdx = (particles[(particles.length - 1)].px - (stage.stageWidth * 0.5)); cdy = (particles[(particles.length - 1)].py - (stage.stageHeight * 0.5)); angle = ((Math.atan2(dy, dx) / Math.PI) * 180); cangle = ((Math.atan2(cdy, cdx) / Math.PI) * 180); if (angle < 0){ angle = (angle + 360); }; if (cangle < 0){ cangle = (cangle + 360); }; if ((angle % 90) == 0){ _stickHand.stickAnimation.visible = true; _stickHand.stickAnimationCorner.visible = false; } else { dangle = (angle - cangle); if (dangle > 0){ dangle = (dangle - 360); }; if (dangle > -180){ _stickHand.stickAnimationCorner.scaleX = 1; } else { _stickHand.stickAnimationCorner.scaleX = -1; }; _stickHand.stickAnimation.visible = false; _stickHand.stickAnimationCorner.visible = true; _stickHand.stickAnimationCorner.gotoAndPlay(2); }; }; }; }; } private function checkStickyness(_arg1:CircleParticle):void{ var _local2:CircleParticle; var _local9:Number; var _local10:Number; var _local3:int = particles.length; var _local4:int; var _local5 = 1; while (_local5 < _local3) { if (_arg1 == particles[_local5]){ _local2 = particles[(_local5 - 1)]; _local4 = (_local5 - 1); }; _local5++; }; var _local6:Number = (_local2.px - _arg1.px); var _local7:Number = (_local2.py - _arg1.py); var _local8:SpringConstraint = constraints[_local4]; if ((((_local8.stiffness == 1)) && (!(particles[(particles.length - 2)].fixed)))){ _local6 = (mouseX - _arg1.px); _local7 = (mouseY - _arg1.py); _local9 = Math.min(stage.stageWidth, stage.stageHeight); if (Math.sqrt(((_local6 * _local6) + (_local7 * _local7))) > (_local9 * 0.4)){ _arg1.fixed = false; _stickHand.stickAnimation.play(); }; } else { _local10 = (1 - ((_local4 - 1) / particles.length)); if (Math.sqrt(((_local6 * _local6) + (_local7 * _local7))) > ((_local8.restLength * 8) * _local10)){ _arg1.fixed = false; }; }; } private function start():void{ var _local1:int; while (_local1 < particles.length) { particles[_local1].px = (mouseX + (_local1 * 1)); particles[_local1].py = (mouseY + (_local1 * 2)); _local1++; }; _wooshSound.play(0, -1); addEventListener(Event.ENTER_FRAME, animate); stage.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown); } private function animate(_arg1:Event):void{ var _local11:CircleParticle; var _local12:Point; var _local14:Curve; var _local17:Number; var _local18:Number; var _local19:Number; if (!_hand.visible){ _hand.visible = true; }; if (!_released){ particles[0].fixed = true; particles[0].px = mouseX; particles[0].py = mouseY; } else { if (_canCheckForProximity){ _local17 = (particles[0].px - mouseX); _local18 = (particles[0].py - mouseY); _local19 = Math.sqrt(((_local17 * _local17) + (_local18 * _local18))); if (_local19 < 70){ _released = false; }; }; }; var _local2:Number = (_cx - particles[(particles.length - 1)].px); var _local3:Number = (_cy - particles[(particles.length - 1)].py); _cx = particles[(particles.length - 1)].px; _cy = particles[(particles.length - 1)].py; _speed = Math.sqrt(((_local2 * _local2) + (_local3 * _local3))); _wooshSound.volume = (Math.max((_speed - 50), 0) / 1000); var _local4 = 1; while (_local4 < particles.length) { if (particles[_local4].fixed){ checkStickyness(particles[_local4]); }; _local4++; }; if (((particles[(particles.length - 2)].fixed) && (particles[(particles.length - 1)].fixed))){ _stickHand.content.visible = false; _stickHand.content.gotoAndStop(16); } else { if (((particles[(particles.length - 2)].fixed) || (particles[(particles.length - 1)].fixed))){ _stickHand.stickAnimation.visible = false; _stickHand.stickAnimationCorner.visible = false; _stickHand.content.visible = true; _stickHand.content.stop(); } else { _stickHand.stickAnimation.visible = false; _stickHand.stickAnimationCorner.visible = false; _stickHand.content.visible = true; _stickHand.content.nextFrame(); }; }; APEngine.step(); var _local5:CircleParticle = particles[1]; var _local6:CircleParticle = particles[0]; _ring.x = _local6.px; _ring.y = _local6.py; var _local7:Number = (_local6.px - _local5.px); var _local8:Number = (_local6.py - _local5.py); _ring.rotation = ((Math.atan2(_local8, _local7) / Math.PI) * 180); _local7 = (particles[(particles.length - 1)].px - (stage.stageWidth * 0.5)); _local8 = (particles[(particles.length - 1)].py - (stage.stageHeight * 0.5)); if ((((((_stickHand.rotation == 0)) || ((_stickHand.rotation == -180)))) || ((_stickHand.rotation == 180)))){ if ((((_local7 > 0)) && ((_stickHand.rotation == 0)))){ _stickHand.stickAnimation.scaleX = -1; } else { if ((((_local7 < 0)) && ((((_stickHand.rotation == -180)) || ((_stickHand.rotation == 180)))))){ _stickHand.stickAnimation.scaleX = -1; } else { _stickHand.stickAnimation.scaleX = 1; }; }; }; if ((((_stickHand.rotation == -90)) || ((_stickHand.rotation == 90)))){ if ((((_local8 > 0)) && ((_stickHand.rotation == 90)))){ _stickHand.stickAnimation.scaleX = -1; } else { if ((((_local8 < 0)) && ((_stickHand.rotation == -90)))){ _stickHand.stickAnimation.scaleX = -1; } else { _stickHand.stickAnimation.scaleX = 1; }; }; }; var _local9:int = particles.length; var _local10:Array = []; _local4 = 0; while (_local4 < (_local9 - 1)) { _local11 = particles[_local4]; _local12 = new Point(_local11.px, _local11.py); _local10.push(_local12); _local4++; }; var _local13:Array = Curve.getCurvesFromPointArray(_local10); var _local15:Graphics = _hand.graphics; _local15.clear(); var _local16:Number = calculateStretch(); _local9 = _local13.length; _local15.lineStyle((18.15 * _local16), 0xFF0000); _local15.moveTo(_local10[0].x, _local10[0].y); _local4 = 0; while (_local4 < _local9) { _local14 = _local13[_local4]; _local14.drawCurve(_local15); _local4++; }; _local15 = _shine.graphics; _local15.clear(); _local15.lineStyle(3, 0xFFFFFF, 0.5); _local15.moveTo((_local10[0].x + 3), _local10[0].y); _local4 = 0; while (_local4 < _local9) { _local14 = _local13[_local4]; _local14.drawCurve(_local15, 3); _local4++; }; _local5 = particles[(particles.length - 2)]; _local6 = particles[(particles.length - 1)]; _stickHand.x = _local5.px; _stickHand.y = _local5.py; _local7 = (_local6.px - _local5.px); _local8 = (_local6.py - _local5.py); _stickHand.rotation = (-90 + ((Math.atan2(_local8, _local7) / Math.PI) * 180)); } private function onResize(_arg1:Event):void{ _intro.x = (stage.stageWidth * 0.5); _intro.y = (stage.stageHeight * 0.5); var _local2:int = particles.length; var _local3:int; var _local4 = 1; while (_local4 < _local2) { particles[_local4].fixed = false; _local4++; }; if (wall){ APEngine.removeGroup(wall); }; wall = new Group(); var _local5:Number = 500; wall.addParticle(new RectangleParticle((-(_local5) * 0.5), (stage.stageHeight * 0.5), _local5, (stage.stageHeight + _local5), 0, true, 1, 0, 1)); wall.addParticle(new RectangleParticle((stage.stageWidth + (_local5 * 0.5)), (stage.stageHeight * 0.5), _local5, (stage.stageHeight + _local5), 0, true, 1, 0, 1)); wall.addParticle(new RectangleParticle((stage.stageWidth * 0.5), (-(_local5) * 0.5), stage.stageWidth, _local5, 0, true, 1, 0, 1)); wall.addParticle(new RectangleParticle((stage.stageWidth * 0.5), (stage.stageHeight + (_local5 * 0.5)), stage.stageWidth, _local5, 0, true, 1, 0, 1)); wall.addCollidable(g); APEngine.addGroup(wall); } } }//package nu.random.cocacola.sticky
Section 12
//Curve (nu.random.cocacola.utils.Curve) package nu.random.cocacola.utils { import flash.display.*; import flash.geom.*; public class Curve { public var length:Number;// = 0 public var cx:Number; public var p2x:Number; public var p1x:Number; public var p1y:Number; public var cy:Number; public var p2y:Number; public function Curve(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number){ this.p1x = _arg1; this.p1y = _arg2; this.p2x = _arg5; this.p2y = _arg6; this.cx = _arg3; this.cy = _arg4; } public function getCurveLengthByIntegral():Number{ var _local1:Number = ((p1x - (2 * cx)) + p2x); var _local2:Number = ((p1y - (2 * cy)) + p2y); var _local3:Number = ((2 * cx) - (2 * p1x)); var _local4:Number = ((2 * cy) - (2 * p1y)); var _local5:Number = (4 * ((_local1 * _local1) + (_local2 * _local2))); var _local6:Number = (4 * ((_local1 * _local3) + (_local2 * _local4))); var _local7:Number = ((_local3 * _local3) + (_local4 * _local4)); var _local8:Number = (2 * Math.sqrt(((_local5 + _local6) + _local7))); var _local9:Number = Math.sqrt(_local5); var _local10:Number = ((2 * _local5) * _local9); var _local11:Number = (2 * Math.sqrt(_local7)); var _local12:Number = (_local6 / _local9); return (((((_local10 * _local8) + ((_local9 * _local6) * (_local8 - _local11))) + ((((4 * _local7) * _local5) - (_local6 * _local6)) * Math.log(((((2 * _local9) + _local12) + _local8) / (_local12 + _local11))))) / (4 * _local10))); } public function getPointOnCurve(_arg1:Number=0.5):Point{ var _local2:Number = (1 - _arg1); var _local3:Number = (((Math.pow(_local2, 2) * p1x) + (((2 * _local2) * _arg1) * cx)) + (Math.pow(_arg1, 2) * p2x)); var _local4:Number = (((Math.pow(_local2, 2) * p1y) + (((2 * _local2) * _arg1) * cy)) + (Math.pow(_arg1, 2) * p2y)); return (new Point(_local3, _local4)); } public function toPointsArray(_arg1:int=20):Array{ var _local2:Array = []; var _local3:Number = 0; var _local4:Number = (1 / _arg1); while (_local3 < 1) { _local2.push(getPointOnCurve(_local3)); _local3 = (_local3 + _local4); }; return (_local2); } public function drawCurve(_arg1:Graphics, _arg2:Number=0, _arg3:Number=0):void{ _arg1.curveTo((cx + _arg2), (cy + _arg3), (p2x + _arg2), (p2y + _arg3)); } public static function getCurvesFromPointArray(_arg1:Array):Array{ var _local4:Point; var _local5:Point; var _local8:Point; var _local2:Array = []; var _local3:Point; var _local6:int = _arg1.length; var _local7 = 1; while (_local7 < _local6) { _local4 = _arg1[(_local7 - 1)]; _local5 = _arg1[_local7]; _local8 = new Point((_local4.x + ((_local5.x - _local4.x) * 0.5)), (_local4.y + ((_local5.y - _local4.y) * 0.5))); if (_local3){ _local2.push(new Curve(_local3.x, _local3.y, _local4.x, _local4.y, _local8.x, _local8.y)); } else { _local2.push(new Curve(_local4.x, _local4.y, (_local4.x + ((_local8.x - _local4.x) * 0.5)), (_local4.y + ((_local8.y - _local4.y) * 0.5)), _local8.x, _local8.y)); }; _local3 = _local8; _local7++; }; _local2.push(new Curve(_local8.x, _local8.y, (_local8.x + ((_local5.x - _local8.x) * 0.5)), (_local8.y + ((_local5.y - _local8.y) * 0.5)), _local5.x, _local5.y)); return (_local2); } } }//package nu.random.cocacola.utils
Section 13
//ISoundControl (nu.random.utils.sound.ISoundControl) package nu.random.utils.sound { import flash.events.*; public interface ISoundControl extends IEventDispatcher { function stop():void; function get isPlaying():Boolean; function set volume(_arg1:Number):void; function pause():void; function get volume():Number; function play(_arg1:Number=0, _arg2:int=0):void; function resume():void; } }//package nu.random.utils.sound
Section 14
//ISoundManager (nu.random.utils.sound.ISoundManager) package nu.random.utils.sound { import flash.events.*; import flash.media.*; public interface ISoundManager extends IEventDispatcher { function addSound(_arg1:Sound):ISoundControl; } }//package nu.random.utils.sound
Section 15
//SoundControl (nu.random.utils.sound.SoundControl) package nu.random.utils.sound { import flash.events.*; import flash.media.*; public class SoundControl extends EventDispatcher implements ISoundControl { private var _channel:SoundChannel; private var _pausePosition:Number;// = -1 private var _sound:Sound; private var _loops:int; private var _manager:SoundManager; private var _volume:Number;// = 1 public function SoundControl(_arg1:Sound, _arg2:SoundManager){ _sound = _arg1; _manager = _arg2; } public function stop():void{ if (_channel){ _channel.stop(); _channel = null; }; _manager.removeEventListener(Event.CHANGE, onSoundUpdate); } private function onSoundEvent(_arg1:Event):void{ switch (_arg1.type){ case Event.SOUND_COMPLETE: if (_loops > 0){ play(0, --_loops); } else { if (_loops == -1){ play(0, _loops); } else { _manager.removeEventListener(Event.CHANGE, onSoundUpdate); dispatchEvent(_arg1); }; }; break; }; } public function set volume(_arg1:Number):void{ _volume = _arg1; onSoundUpdate(); } public function get sound():Sound{ return (_sound); } private function onSoundUpdate(_arg1:Event=null):void{ if (_channel){ _channel.soundTransform = new SoundTransform((_manager.volume * _volume)); }; } public function get volume():Number{ return (_volume); } private function onSoundUnload(_arg1:Event=null):void{ var e = _arg1; try { _sound.close(); } catch(error:Error) { }; stop(); } public function get length():Number{ if (_sound){ return (_sound.length); }; return (0); } public function get position():Number{ if (_channel){ return (_channel.position); }; return (0); } public function get isPlaying():Boolean{ return (!((_channel == null))); } public function resume():void{ if (_pausePosition >= 0){ play(_pausePosition, _loops); }; } public function play(_arg1:Number=0, _arg2:int=0):void{ if (!_sound){ return; }; if (_channel){ stop(); }; _pausePosition = -1; _channel = _sound.play(_arg1, 0, new SoundTransform((_manager.volume * _volume))); if (_channel == null){ return; }; _loops = _arg2; _channel.addEventListener(Event.SOUND_COMPLETE, onSoundEvent); _manager.addEventListener(Event.CHANGE, onSoundUpdate, false, 0, true); _manager.addEventListener(Event.UNLOAD, onSoundUnload, false, 0, true); } public function pause():void{ if (_channel){ _pausePosition = _channel.position; stop(); }; } } }//package nu.random.utils.sound
Section 16
//SoundManager (nu.random.utils.sound.SoundManager) package nu.random.utils.sound { import flash.events.*; import flash.media.*; import flash.utils.*; import flash.net.*; public class SoundManager extends EventDispatcher implements ISoundManager { private var _volume:Number; private static var _instance:SoundManager; public function SoundManager(_arg1:Number=1){ _volume = _arg1; } public function createSoundFromDefinition(_arg1:String):ISoundControl{ var cls:Class; var definition = _arg1; try { cls = (getDefinitionByName(definition) as Class); return (createSound(cls)); } catch(e:Error) { }; return (addSound(null)); } public function get volume():Number{ return (_volume); } public function set volume(_arg1:Number):void{ _volume = _arg1; dispatchEvent(new Event(Event.CHANGE, false, false)); } public function createSound(_arg1:Class):ISoundControl{ var snd:Sound; var soundCls = _arg1; try { snd = (new (soundCls) as Sound); } catch(e:Error) { trace(e); }; return (new SoundControl(snd, this)); } public function createStream(_arg1:String, _arg2:SoundLoaderContext=null):ISoundControl{ var _local3:Sound = new Sound(); var _local4:URLRequest = new URLRequest(_arg1); _local3.load(_local4, _arg2); return (new SoundControl(_local3, this)); } public function addSound(_arg1:Sound):ISoundControl{ trace(("addSound()" + _arg1)); return (new SoundControl(_arg1, this)); } public function unload():void{ dispatchEvent(new Event(Event.UNLOAD)); } public static function get instance():SoundManager{ if (_instance == null){ _instance = new (SoundManager); }; return (_instance); } } }//package nu.random.utils.sound
Section 17
//AbstractCollection (org.cove.ape.AbstractCollection) package org.cove.ape { import flash.display.*; import flash.utils.*; public class AbstractCollection { private var _sprite:Sprite; private var _particles:Array; private var _isParented:Boolean; private var _constraints:Array; public function AbstractCollection(){ if (getQualifiedClassName(this) == "org.cove.ape::AbstractCollection"){ throw (new ArgumentError("AbstractCollection can't be instantiated directly")); }; _isParented = false; _particles = new Array(); _constraints = new Array(); } public function removeConstraint(_arg1:AbstractConstraint):void{ var _local2:int = constraints.indexOf(_arg1); if (_local2 == -1){ return; }; constraints.splice(_local2, 1); _arg1.cleanup(); } public function getAll():Array{ return (particles.concat(constraints)); } function checkCollisionsVsCollection(_arg1:AbstractCollection):void{ var _local5:AbstractParticle; var _local6:int; var _local7:int; var _local8:int; var _local9:AbstractParticle; var _local10:SpringConstraint; var _local11:SpringConstraint; var _local12:int; var _local2:int = _particles.length; var _local3:int; while (_local3 < _local2) { _local5 = _particles[_local3]; if (!_local5.collidable){ } else { _local6 = _arg1.particles.length; _local7 = 0; while (_local7 < _local6) { _local9 = _arg1.particles[_local7]; if (_local9.collidable){ CollisionDetector.test(_local5, _local9); }; _local7++; }; _local8 = _arg1.constraints.length; _local7 = 0; while (_local7 < _local8) { _local10 = _arg1.constraints[_local7]; if (((_local10.collidable) && (!(_local10.isConnectedTo(_local5))))){ _local10.scp.updatePosition(); CollisionDetector.test(_local5, _local10.scp); }; _local7++; }; }; _local3++; }; var _local4:int = _constraints.length; _local3 = 0; while (_local3 < _local4) { _local11 = _constraints[_local3]; if (!_local11.collidable){ } else { _local6 = _arg1.particles.length; _local12 = 0; while (_local12 < _local6) { _local9 = _arg1.particles[_local12]; if (((_local9.collidable) && (!(_local11.isConnectedTo(_local9))))){ _local11.scp.updatePosition(); CollisionDetector.test(_local9, _local11.scp); }; _local12++; }; }; _local3++; }; } public function get sprite():Sprite{ if (_sprite != null){ return (_sprite); }; if (APEngine.container == null){ throw (new Error("The container property of the APEngine class has not been set")); }; _sprite = new Sprite(); APEngine.container.addChild(_sprite); return (_sprite); } function checkInternalCollisions():void{ var _local3:AbstractParticle; var _local4:int; var _local5:int; var _local6:int; var _local7:AbstractParticle; var _local8:SpringConstraint; var _local1:int = _particles.length; var _local2:int; while (_local2 < _local1) { _local3 = _particles[_local2]; if (!_local3.collidable){ } else { _local4 = (_local2 + 1); while (_local4 < _local1) { _local7 = _particles[_local4]; if (_local7.collidable){ CollisionDetector.test(_local3, _local7); }; _local4++; }; _local5 = _constraints.length; _local6 = 0; while (_local6 < _local5) { _local8 = _constraints[_local6]; if (((_local8.collidable) && (!(_local8.isConnectedTo(_local3))))){ _local8.scp.updatePosition(); CollisionDetector.test(_local3, _local8.scp); }; _local6++; }; }; _local2++; }; } public function addParticle(_arg1:AbstractParticle):void{ particles.push(_arg1); if (isParented){ _arg1.init(); }; } public function init():void{ var _local1:int; while (_local1 < particles.length) { particles[_local1].init(); _local1++; }; _local1 = 0; while (_local1 < constraints.length) { constraints[_local1].init(); _local1++; }; } function satisfyConstraints():void{ var _local3:AbstractConstraint; var _local1:int = _constraints.length; var _local2:int; while (_local2 < _local1) { _local3 = _constraints[_local2]; _local3.resolve(); _local2++; }; } function get isParented():Boolean{ return (_isParented); } public function paint():void{ var _local1:AbstractParticle; var _local4:SpringConstraint; var _local2:int = _particles.length; var _local3:int; while (_local3 < _local2) { _local1 = _particles[_local3]; if (((!(_local1.fixed)) || (_local1.alwaysRepaint))){ _local1.paint(); }; _local3++; }; _local2 = _constraints.length; _local3 = 0; while (_local3 < _local2) { _local4 = _constraints[_local3]; if (((!(_local4.fixed)) || (_local4.alwaysRepaint))){ _local4.paint(); }; _local3++; }; } public function addConstraint(_arg1:AbstractConstraint):void{ constraints.push(_arg1); if (isParented){ _arg1.init(); }; } function set isParented(_arg1:Boolean):void{ _isParented = _arg1; } public function removeParticle(_arg1:AbstractParticle):void{ var _local2:int = particles.indexOf(_arg1); if (_local2 == -1){ return; }; particles.splice(_local2, 1); _arg1.cleanup(); } public function cleanup():void{ var _local1:int; while (_local1 < particles.length) { particles[_local1].cleanup(); _local1++; }; _local1 = 0; while (_local1 < constraints.length) { constraints[_local1].cleanup(); _local1++; }; } public function get particles():Array{ return (_particles); } function integrate(_arg1:Number):void{ var _local4:AbstractParticle; var _local2:int = _particles.length; var _local3:int; while (_local3 < _local2) { _local4 = _particles[_local3]; _local4.update(_arg1); _local3++; }; } public function get constraints():Array{ return (_constraints); } } }//package org.cove.ape
Section 18
//AbstractConstraint (org.cove.ape.AbstractConstraint) package org.cove.ape { import flash.utils.*; public class AbstractConstraint extends AbstractItem { private var _stiffness:Number; public function AbstractConstraint(_arg1:Number){ if (getQualifiedClassName(this) == "org.cove.ape::AbstractConstraint"){ throw (new ArgumentError("AbstractConstraint can't be instantiated directly")); }; this.stiffness = _arg1; setStyle(); } function resolve():void{ } public function set stiffness(_arg1:Number):void{ _stiffness = _arg1; } public function get stiffness():Number{ return (_stiffness); } } }//package org.cove.ape
Section 19
//AbstractItem (org.cove.ape.AbstractItem) package org.cove.ape { import flash.display.*; public class AbstractItem { var lineAlpha:Number; var lineColor:uint; var displayObjectOffset:Vector; var lineThickness:Number; var displayObject:DisplayObject; var fillAlpha:Number; private var _sprite:Sprite; var fillColor:uint; private var _visible:Boolean; private var _alwaysRepaint:Boolean; var displayObjectRotation:Number; public function AbstractItem(){ _visible = true; _alwaysRepaint = false; } public function setLine(_arg1:Number=0, _arg2:uint=0, _arg3:Number=1):void{ lineThickness = _arg1; lineColor = _arg2; lineAlpha = _arg3; } public function set visible(_arg1:Boolean):void{ _visible = _arg1; sprite.visible = _arg1; } public function setFill(_arg1:uint=0xFFFFFF, _arg2:Number=1):void{ fillColor = _arg1; fillAlpha = _arg2; } public function init():void{ } public function get sprite():Sprite{ if (_sprite != null){ return (_sprite); }; if (APEngine.container == null){ throw (new Error("The container property of the APEngine class has not been set")); }; _sprite = new Sprite(); APEngine.container.addChild(_sprite); return (_sprite); } public function paint():void{ } public function cleanup():void{ sprite.graphics.clear(); var _local1:int; while (_local1 < sprite.numChildren) { sprite.removeChildAt(_local1); _local1++; }; } public function setStyle(_arg1:Number=0, _arg2:uint=0, _arg3:Number=1, _arg4:uint=0xFFFFFF, _arg5:Number=1):void{ setLine(_arg1, _arg2, _arg3); setFill(_arg4, _arg5); } public function get visible():Boolean{ return (_visible); } final public function set alwaysRepaint(_arg1:Boolean):void{ _alwaysRepaint = _arg1; } final public function get alwaysRepaint():Boolean{ return (_alwaysRepaint); } } }//package org.cove.ape
Section 20
//AbstractParticle (org.cove.ape.AbstractParticle) package org.cove.ape { import flash.display.*; import org.osflash.signals.*; import flash.utils.*; public class AbstractParticle extends AbstractItem { public const collisionSignal:Signal; private var _collidable:Boolean; private var _center:Vector; private var collision:Collision; private var _kfr:Number; var prev:Vector; var interval:Interval; private var _invMass:Number; var curr:Vector; private var _mass:Number; private var temp:Vector; private var _friction:Number; private var forces:Vector; var samp:Vector; private var _multisample:int; private var _fixed:Boolean; public function AbstractParticle(_arg1:Number, _arg2:Number, _arg3:Boolean, _arg4:Number, _arg5:Number, _arg6:Number){ collisionSignal = new Signal(AbstractParticle, AbstractParticle); super(); if (getQualifiedClassName(this) == "org.cove.ape::AbstractParticle"){ throw (new ArgumentError("AbstractParticle can't be instantiated directly")); }; interval = new Interval(0, 0); curr = new Vector(_arg1, _arg2); prev = new Vector(_arg1, _arg2); samp = new Vector(); temp = new Vector(); fixed = _arg3; forces = new Vector(); collision = new Collision(new Vector(), new Vector()); collidable = true; this.mass = _arg4; this.elasticity = _arg5; this.friction = _arg6; setStyle(); _center = new Vector(); _multisample = 0; } public function get fixed():Boolean{ return (_fixed); } function get invMass():Number{ return ((fixed) ? 0 : _invMass); } public function get px():Number{ return (curr.x); } public function get py():Number{ return (curr.y); } public function setDisplay(_arg1:DisplayObject, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0):void{ displayObject = _arg1; displayObjectRotation = _arg4; displayObjectOffset = new Vector(_arg2, _arg3); } public function set px(_arg1:Number):void{ curr.x = _arg1; prev.x = _arg1; } public function set py(_arg1:Number):void{ curr.y = _arg1; prev.y = _arg1; } function getComponents(_arg1:Vector):Collision{ var _local2:Vector = velocity; var _local3:Number = _arg1.dot(_local2); collision.vn = _arg1.mult(_local3); collision.vt = _local2.minus(collision.vn); return (collision); } function initDisplay():void{ displayObject.x = displayObjectOffset.x; displayObject.y = displayObjectOffset.y; displayObject.rotation = displayObjectRotation; sprite.addChild(displayObject); } public function get multisample():int{ return (_multisample); } public function get position():Vector{ return (new Vector(curr.x, curr.y)); } function resolveCollision(_arg1:Vector, _arg2:Vector, _arg3:Vector, _arg4:Number, _arg5:int, _arg6:AbstractParticle):void{ curr.plusEquals(_arg1); velocity = _arg2; } public function get elasticity():Number{ return (_kfr); } public function addMasslessForce(_arg1:Vector):void{ forces.plusEquals(_arg1); } public function set collidable(_arg1:Boolean):void{ _collidable = _arg1; } public function set velocity(_arg1:Vector):void{ prev = curr.minus(_arg1); } public function set multisample(_arg1:int):void{ _multisample = _arg1; } public function addForce(_arg1:Vector):void{ forces.plusEquals(_arg1.mult(invMass)); } public function set position(_arg1:Vector):void{ curr.copy(_arg1); prev.copy(_arg1); } public function get center():Vector{ _center.setTo(px, py); return (_center); } public function update(_arg1:Number):void{ if (fixed){ return; }; addForce(APEngine.force); addMasslessForce(APEngine.masslessForce); temp.copy(curr); var _local2:Vector = velocity.plus(forces.multEquals(_arg1)); curr.plusEquals(_local2.multEquals(APEngine.damping)); prev.copy(temp); forces.setTo(0, 0); } public function get velocity():Vector{ return (curr.minus(prev)); } public function get collidable():Boolean{ return (_collidable); } public function set mass(_arg1:Number):void{ if (_arg1 <= 0){ throw (new ArgumentError("mass may not be set <= 0")); }; _mass = _arg1; _invMass = (1 / _mass); } public function set elasticity(_arg1:Number):void{ _kfr = _arg1; } public function get mass():Number{ return (_mass); } public function set fixed(_arg1:Boolean):void{ _fixed = _arg1; } public function get friction():Number{ return (_friction); } public function set friction(_arg1:Number):void{ if ((((_arg1 < 0)) || ((_arg1 > 1)))){ throw (new ArgumentError("Legal friction must be >= 0 and <=1")); }; _friction = _arg1; } } }//package org.cove.ape
Section 21
//APEngine (org.cove.ape.APEngine) package org.cove.ape { import flash.display.*; public final class APEngine { private static var _container:DisplayObjectContainer; private static var _damping:Number; private static var _constraintCollisionCycles:int; private static var groups:Array; static var masslessForce:Vector; private static var _constraintCycles:int; static var force:Vector; private static var timeStep:Number; private static var numGroups:int; public static function get container():DisplayObjectContainer{ return (_container); } public static function get constraintCollisionCycles():int{ return (_constraintCollisionCycles); } public static function set damping(_arg1:Number):void{ _damping = _arg1; } public static function step():void{ integrate(); var _local1:int; while (_local1 < _constraintCycles) { satisfyConstraints(); _local1++; }; var _local2:int; while (_local2 < _constraintCollisionCycles) { satisfyConstraints(); checkCollisions(); _local2++; }; } public static function init(_arg1:Number=0.25):void{ timeStep = (_arg1 * _arg1); numGroups = 0; groups = new Array(); force = new Vector(0, 0); masslessForce = new Vector(0, 0); damping = 1; _constraintCycles = 0; _constraintCollisionCycles = 1; } public static function get constraintCycles():int{ return (_constraintCycles); } public static function set constraintCollisionCycles(_arg1:int):void{ _constraintCollisionCycles = _arg1; } public static function set constraintCycles(_arg1:int):void{ _constraintCycles = _arg1; } public static function addForce(_arg1:Vector):void{ force.plusEquals(_arg1); } public static function get damping():Number{ return (_damping); } public static function set container(_arg1:DisplayObjectContainer):void{ _container = _arg1; } public static function addGroup(_arg1:Group):void{ groups.push(_arg1); _arg1.isParented = true; numGroups++; _arg1.init(); } public static function removeGroup(_arg1:Group):void{ var _local2:int = groups.indexOf(_arg1); if (_local2 == -1){ return; }; groups.splice(_local2, 1); _arg1.isParented = false; numGroups--; _arg1.cleanup(); } public static function paint():void{ var _local2:Group; var _local1:int; while (_local1 < numGroups) { _local2 = groups[_local1]; _local2.paint(); _local1++; }; } private static function checkCollisions():void{ var _local2:Group; var _local1:int; while (_local1 < numGroups) { _local2 = groups[_local1]; _local2.checkCollisions(); _local1++; }; } private static function integrate():void{ var _local2:Group; var _local1:int; while (_local1 < numGroups) { _local2 = groups[_local1]; _local2.integrate(timeStep); _local1++; }; } private static function satisfyConstraints():void{ var _local2:Group; var _local1:int; while (_local1 < numGroups) { _local2 = groups[_local1]; _local2.satisfyConstraints(); _local1++; }; } public static function addMasslessForce(_arg1:Vector):void{ masslessForce.plusEquals(_arg1); } } }//package org.cove.ape
Section 22
//CircleParticle (org.cove.ape.CircleParticle) package org.cove.ape { public class CircleParticle extends AbstractParticle { private var _radius:Number; public function CircleParticle(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Boolean=false, _arg5:Number=1, _arg6:Number=0.3, _arg7:Number=0){ super(_arg1, _arg2, _arg4, _arg5, _arg6, _arg7); _radius = _arg3; } override public function init():void{ cleanup(); if (displayObject != null){ initDisplay(); } else { sprite.graphics.clear(); sprite.graphics.lineStyle(lineThickness, lineColor, lineAlpha); sprite.graphics.beginFill(fillColor, fillAlpha); sprite.graphics.drawCircle(0, 0, radius); sprite.graphics.endFill(); }; paint(); } public function set radius(_arg1:Number):void{ _radius = _arg1; } function getProjection(_arg1:Vector):Interval{ var _local2:Number = samp.dot(_arg1); interval.min = (_local2 - _radius); interval.max = (_local2 + _radius); return (interval); } function getIntervalY():Interval{ interval.min = (curr.y - _radius); interval.max = (curr.y + _radius); return (interval); } public function get radius():Number{ return (_radius); } function getIntervalX():Interval{ interval.min = (curr.x - _radius); interval.max = (curr.x + _radius); return (interval); } override public function paint():void{ sprite.x = curr.x; sprite.y = curr.y; } } }//package org.cove.ape
Section 23
//Collision (org.cove.ape.Collision) package org.cove.ape { import org.cove.ape.*; final class Collision { var vn:Vector; var vt:Vector; function Collision(_arg1:Vector, _arg2:Vector){ this.vn = _arg1; this.vt = _arg2; } } }//package org.cove.ape
Section 24
//CollisionDetector (org.cove.ape.CollisionDetector) package org.cove.ape { import org.cove.ape.*; final class CollisionDetector { private static function testOBBvsCircle(_arg1:RectangleParticle, _arg2:CircleParticle):Boolean{ var _local3:Vector; var _local8:Vector; var _local9:Number; var _local10:Vector; var _local11:Number; var _local4:Number = Number.POSITIVE_INFINITY; var _local5:Array = new Array(2); var _local6:int; while (_local6 < 2) { _local8 = _arg1.axes[_local6]; _local9 = testIntervals(_arg1.getProjection(_local8), _arg2.getProjection(_local8)); if (_local9 == 0){ return (false); }; if (Math.abs(_local9) < Math.abs(_local4)){ _local3 = _local8; _local4 = _local9; }; _local5[_local6] = _local9; _local6++; }; var _local7:Number = _arg2.radius; if ((((Math.abs(_local5[0]) < _local7)) && ((Math.abs(_local5[1]) < _local7)))){ _local10 = closestVertexOnOBB(_arg2.samp, _arg1); _local3 = _local10.minus(_arg2.samp); _local11 = _local3.magnitude(); _local4 = (_local7 - _local11); if (_local4 > 0){ _local3.divEquals(_local11); } else { return (false); }; }; CollisionResolver.resolveParticleParticle(_arg1, _arg2, _local3, _local4); return (true); } static function test(_arg1:AbstractParticle, _arg2:AbstractParticle):void{ if (((_arg1.fixed) && (_arg2.fixed))){ return; }; if ((((_arg1.multisample == 0)) && ((_arg2.multisample == 0)))){ normVsNorm(_arg1, _arg2); } else { if ((((_arg1.multisample > 0)) && ((_arg2.multisample == 0)))){ sampVsNorm(_arg1, _arg2); } else { if ((((_arg2.multisample > 0)) && ((_arg1.multisample == 0)))){ sampVsNorm(_arg2, _arg1); } else { if (_arg1.multisample == _arg2.multisample){ sampVsSamp(_arg1, _arg2); } else { normVsNorm(_arg1, _arg2); }; }; }; }; } private static function testIntervals(_arg1:Interval, _arg2:Interval):Number{ if (_arg1.max < _arg2.min){ return (0); }; if (_arg2.max < _arg1.min){ return (0); }; var _local3:Number = (_arg2.max - _arg1.min); var _local4:Number = (_arg2.min - _arg1.max); return (((Math.abs(_local3))<Math.abs(_local4)) ? _local3 : _local4); } private static function normVsNorm(_arg1:AbstractParticle, _arg2:AbstractParticle):void{ _arg1.samp.copy(_arg1.curr); _arg2.samp.copy(_arg2.curr); var _local3:Boolean = testTypes(_arg1, _arg2); if (_local3){ _arg1.collisionSignal.dispatch(_arg1, _arg2); _arg2.collisionSignal.dispatch(_arg2, _arg1); }; } private static function testCirclevsCircle(_arg1:CircleParticle, _arg2:CircleParticle):Boolean{ var _local3:Number = testIntervals(_arg1.getIntervalX(), _arg2.getIntervalX()); if (_local3 == 0){ return (false); }; var _local4:Number = testIntervals(_arg1.getIntervalY(), _arg2.getIntervalY()); if (_local4 == 0){ return (false); }; var _local5:Vector = _arg1.samp.minus(_arg2.samp); var _local6:Number = _local5.magnitude(); var _local7:Number = ((_arg1.radius + _arg2.radius) - _local6); if (_local7 > 0){ _local5.divEquals(_local6); CollisionResolver.resolveParticleParticle(_arg1, _arg2, _local5, _local7); return (true); }; return (false); } private static function testTypes(_arg1:AbstractParticle, _arg2:AbstractParticle):Boolean{ if ((((_arg1 is RectangleParticle)) && ((_arg2 is RectangleParticle)))){ return (testOBBvsOBB((_arg1 as RectangleParticle), (_arg2 as RectangleParticle))); }; if ((((_arg1 is CircleParticle)) && ((_arg2 is CircleParticle)))){ return (testCirclevsCircle((_arg1 as CircleParticle), (_arg2 as CircleParticle))); }; if ((((_arg1 is RectangleParticle)) && ((_arg2 is CircleParticle)))){ return (testOBBvsCircle((_arg1 as RectangleParticle), (_arg2 as CircleParticle))); }; if ((((_arg1 is CircleParticle)) && ((_arg2 is RectangleParticle)))){ return (testOBBvsCircle((_arg2 as RectangleParticle), (_arg1 as CircleParticle))); }; return (false); } private static function sampVsNorm(_arg1:AbstractParticle, _arg2:AbstractParticle):void{ var _local3:Number = (1 / (_arg1.multisample + 1)); var _local4:Number = _local3; _arg2.samp.copy(_arg2.curr); var _local5:int; while (_local5 <= _arg1.multisample) { _arg1.samp.setTo((_arg1.prev.x + (_local4 * (_arg1.curr.x - _arg1.prev.x))), (_arg1.prev.y + (_local4 * (_arg1.curr.y - _arg1.prev.y)))); if (testTypes(_arg1, _arg2)){ return; }; _local4 = (_local4 + _local3); _local5++; }; } private static function closestVertexOnOBB(_arg1:Vector, _arg2:RectangleParticle):Vector{ var _local6:Number; var _local3:Vector = _arg1.minus(_arg2.samp); var _local4:Vector = new Vector(_arg2.samp.x, _arg2.samp.y); var _local5:int; while (_local5 < 2) { _local6 = _local3.dot(_arg2.axes[_local5]); if (_local6 >= 0){ _local6 = _arg2.extents[_local5]; } else { if (_local6 < 0){ _local6 = -(_arg2.extents[_local5]); }; }; _local4.plusEquals(_arg2.axes[_local5].mult(_local6)); _local5++; }; return (_local4); } private static function testOBBvsOBB(_arg1:RectangleParticle, _arg2:RectangleParticle):Boolean{ var _local3:Vector; var _local6:Vector; var _local7:Number; var _local8:Vector; var _local9:Number; var _local10:Number; var _local11:Number; var _local12:Boolean; var _local4:Number = Number.POSITIVE_INFINITY; var _local5:int; while (_local5 < 2) { _local6 = _arg1.axes[_local5]; _local7 = testIntervals(_arg1.getProjection(_local6), _arg2.getProjection(_local6)); if (_local7 == 0){ return (false); }; _local8 = _arg2.axes[_local5]; _local9 = testIntervals(_arg1.getProjection(_local8), _arg2.getProjection(_local8)); if (_local9 == 0){ return (false); }; _local10 = Math.abs(_local7); _local11 = Math.abs(_local9); if ((((_local10 < Math.abs(_local4))) || ((_local11 < Math.abs(_local4))))){ _local12 = (_local10 < _local11); _local3 = (_local12) ? _local6 : _local8; _local4 = (_local12) ? _local7 : _local9; }; _local5++; }; CollisionResolver.resolveParticleParticle(_arg1, _arg2, _local3, _local4); return (true); } private static function sampVsSamp(_arg1:AbstractParticle, _arg2:AbstractParticle):void{ var _local3:Number = (1 / (_arg1.multisample + 1)); var _local4:Number = _local3; var _local5:int; while (_local5 <= _arg1.multisample) { _arg1.samp.setTo((_arg1.prev.x + (_local4 * (_arg1.curr.x - _arg1.prev.x))), (_arg1.prev.y + (_local4 * (_arg1.curr.y - _arg1.prev.y)))); _arg2.samp.setTo((_arg2.prev.x + (_local4 * (_arg2.curr.x - _arg2.prev.x))), (_arg2.prev.y + (_local4 * (_arg2.curr.y - _arg2.prev.y)))); if (testTypes(_arg1, _arg2)){ return; }; _local4 = (_local4 + _local3); _local5++; }; } } }//package org.cove.ape
Section 25
//CollisionResolver (org.cove.ape.CollisionResolver) package org.cove.ape { import org.cove.ape.*; final class CollisionResolver { static function resolveParticleParticle(_arg1:AbstractParticle, _arg2:AbstractParticle, _arg3:Vector, _arg4:Number):void{ _arg1.curr.copy(_arg1.samp); _arg2.curr.copy(_arg2.samp); var _local5:Vector = _arg3.mult(_arg4); var _local6:Number = (_arg1.elasticity + _arg2.elasticity); var _local7:Number = (_arg1.invMass + _arg2.invMass); var _local8:Number = clamp((1 - (_arg1.friction + _arg2.friction)), 0, 1); var _local9:Collision = _arg1.getComponents(_arg3); var _local10:Collision = _arg2.getComponents(_arg3); var _local11:Vector = _local10.vn.mult(((_local6 + 1) * _arg1.invMass)).plus(_local9.vn.mult((_arg2.invMass - (_local6 * _arg1.invMass)))).divEquals(_local7); var _local12:Vector = _local9.vn.mult(((_local6 + 1) * _arg2.invMass)).plus(_local10.vn.mult((_arg1.invMass - (_local6 * _arg2.invMass)))).divEquals(_local7); _local9.vt.multEquals(_local8); _local10.vt.multEquals(_local8); var _local13:Vector = _local5.mult((_arg1.invMass / _local7)); var _local14:Vector = _local5.mult((-(_arg2.invMass) / _local7)); _local11.plusEquals(_local9.vt); _local12.plusEquals(_local10.vt); if (!_arg1.fixed){ _arg1.resolveCollision(_local13, _local11, _arg3, _arg4, -1, _arg2); }; if (!_arg2.fixed){ _arg2.resolveCollision(_local14, _local12, _arg3, _arg4, 1, _arg1); }; } static function clamp(_arg1:Number, _arg2:Number, _arg3:Number):Number{ if (_arg1 > _arg3){ return (_arg3); }; if (_arg1 < _arg2){ return (_arg2); }; return (_arg1); } } }//package org.cove.ape
Section 26
//Composite (org.cove.ape.Composite) package org.cove.ape { public class Composite extends AbstractCollection { private var delta:Vector; public function Composite(){ delta = new Vector(); } public function rotateByAngle(_arg1:Number, _arg2:Vector):void{ var _local3:Number = (_arg1 * MathUtil.PI_OVER_ONE_EIGHTY); rotateByRadian(_local3, _arg2); } public function rotateByRadian(_arg1:Number, _arg2:Vector):void{ var _local3:AbstractParticle; var _local7:Number; var _local8:Number; var _local4:Array = particles; var _local5:int = _local4.length; var _local6:int; while (_local6 < _local5) { _local3 = _local4[_local6]; _local7 = _local3.center.distance(_arg2); _local8 = (getRelativeAngle(_arg2, _local3.center) + _arg1); _local3.px = ((Math.cos(_local8) * _local7) + _arg2.x); _local3.py = ((Math.sin(_local8) * _local7) + _arg2.y); _local6++; }; } public function get fixed():Boolean{ var _local1:int; while (_local1 < particles.length) { if (!particles[_local1].fixed){ return (false); }; _local1++; }; return (true); } private function getRelativeAngle(_arg1:Vector, _arg2:Vector):Number{ delta.setTo((_arg2.x - _arg1.x), (_arg2.y - _arg1.y)); return (Math.atan2(delta.y, delta.x)); } public function set fixed(_arg1:Boolean):void{ var _local2:int; while (_local2 < particles.length) { particles[_local2].fixed = _arg1; _local2++; }; } } }//package org.cove.ape
Section 27
//Group (org.cove.ape.Group) package org.cove.ape { public class Group extends AbstractCollection { private var _composites:Array; private var _collisionList:Array; private var _collideInternal:Boolean; public function Group(_arg1:Boolean=false){ _composites = new Array(); _collisionList = new Array(); this.collideInternal = _arg1; } public function addCollidableList(_arg1:Array):void{ var _local3:Group; var _local2:int; while (_local2 < _arg1.length) { _local3 = _arg1[_local2]; collisionList.push(_local3); _local2++; }; } function checkCollisions():void{ var _local3:Group; if (collideInternal){ checkCollisionGroupInternal(); }; var _local1:int = collisionList.length; var _local2:int; while (_local2 < _local1) { _local3 = collisionList[_local2]; checkCollisionVsGroup(_local3); _local2++; }; } public function removeComposite(_arg1:Composite):void{ var _local2:int = composites.indexOf(_arg1); if (_local2 == -1){ return; }; composites.splice(_local2, 1); _arg1.isParented = false; _arg1.cleanup(); } override public function cleanup():void{ super.cleanup(); var _local1:int; while (_local1 < composites.length) { composites[_local1].cleanup(); _local1++; }; } public function removeCollidable(_arg1:Group):void{ var _local2:int = collisionList.indexOf(_arg1); if (_local2 == -1){ return; }; collisionList.splice(_local2, 1); } public function addComposite(_arg1:Composite):void{ composites.push(_arg1); _arg1.isParented = true; if (isParented){ _arg1.init(); }; } public function addCollidable(_arg1:Group):void{ collisionList.push(_arg1); } override function integrate(_arg1:Number):void{ var _local4:Composite; super.integrate(_arg1); var _local2:int = _composites.length; var _local3:int; while (_local3 < _local2) { _local4 = _composites[_local3]; _local4.integrate(_arg1); _local3++; }; } public function get composites():Array{ return (_composites); } override public function init():void{ super.init(); var _local1:int; while (_local1 < composites.length) { composites[_local1].init(); _local1++; }; } override public function getAll():Array{ return (particles.concat(constraints).concat(composites)); } public function get collisionList():Array{ return (_collisionList); } private function checkCollisionGroupInternal():void{ var _local3:Composite; var _local4:int; var _local5:Composite; checkInternalCollisions(); var _local1:int = _composites.length; var _local2:int; while (_local2 < _local1) { _local3 = _composites[_local2]; _local3.checkCollisionsVsCollection(this); _local4 = (_local2 + 1); while (_local4 < _local1) { _local5 = _composites[_local4]; _local3.checkCollisionsVsCollection(_local5); _local4++; }; _local2++; }; } override function satisfyConstraints():void{ var _local3:Composite; super.satisfyConstraints(); var _local1:int = _composites.length; var _local2:int; while (_local2 < _local1) { _local3 = _composites[_local2]; _local3.satisfyConstraints(); _local2++; }; } public function get collideInternal():Boolean{ return (_collideInternal); } public function set collideInternal(_arg1:Boolean):void{ _collideInternal = _arg1; } override public function paint():void{ var _local3:Composite; super.paint(); var _local1:int = _composites.length; var _local2:int; while (_local2 < _local1) { _local3 = _composites[_local2]; _local3.paint(); _local2++; }; } private function checkCollisionVsGroup(_arg1:Group):void{ var _local5:Composite; var _local6:int; var _local7:Composite; checkCollisionsVsCollection(_arg1); var _local2:int = _composites.length; var _local3:int = _arg1.composites.length; var _local4:int; while (_local4 < _local2) { _local5 = _composites[_local4]; _local5.checkCollisionsVsCollection(_arg1); _local6 = 0; while (_local6 < _local3) { _local7 = _arg1.composites[_local6]; _local5.checkCollisionsVsCollection(_local7); _local6++; }; _local4++; }; _local6 = 0; while (_local6 < _local3) { _local7 = _arg1.composites[_local6]; checkCollisionsVsCollection(_local7); _local6++; }; } } }//package org.cove.ape
Section 28
//Interval (org.cove.ape.Interval) package org.cove.ape { final class Interval { var min:Number; var max:Number; function Interval(_arg1:Number, _arg2:Number){ this.min = _arg1; this.max = _arg2; } function toString():String{ return (((min + " : ") + max)); } } }//package org.cove.ape
Section 29
//MathUtil (org.cove.ape.MathUtil) package org.cove.ape { final class MathUtil { static var ONE_EIGHTY_OVER_PI:Number = 57.2957795130823; static var PI_OVER_ONE_EIGHTY:Number = 0.0174532925199433; static function clamp(_arg1:Number, _arg2:Number, _arg3:Number):Number{ if (_arg1 < _arg2){ return (_arg2); }; if (_arg1 > _arg3){ return (_arg3); }; return (_arg1); } static function sign(_arg1:Number):int{ if (_arg1 < 0){ return (-1); }; return (1); } } }//package org.cove.ape
Section 30
//RectangleParticle (org.cove.ape.RectangleParticle) package org.cove.ape { public class RectangleParticle extends AbstractParticle { private var _axes:Array; private var _radian:Number; private var _extents:Array; public function RectangleParticle(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=0, _arg6:Boolean=false, _arg7:Number=1, _arg8:Number=0.3, _arg9:Number=0){ super(_arg1, _arg2, _arg6, _arg7, _arg8, _arg9); _extents = new Array((_arg3 / 2), (_arg4 / 2)); _axes = new Array(new Vector(0, 0), new Vector(0, 0)); radian = _arg5; } public function get radian():Number{ return (_radian); } public function set radian(_arg1:Number):void{ _radian = _arg1; setAxes(_arg1); } function get axes():Array{ return (_axes); } public function set angle(_arg1:Number):void{ radian = (_arg1 * MathUtil.PI_OVER_ONE_EIGHTY); } function get extents():Array{ return (_extents); } public function set width(_arg1:Number):void{ _extents[0] = (_arg1 / 2); } public function get width():Number{ return ((_extents[0] * 2)); } public function set height(_arg1:Number):void{ _extents[1] = (_arg1 / 2); } override public function init():void{ var _local1:Number; var _local2:Number; cleanup(); if (displayObject != null){ initDisplay(); } else { _local1 = (extents[0] * 2); _local2 = (extents[1] * 2); sprite.graphics.clear(); sprite.graphics.lineStyle(lineThickness, lineColor, lineAlpha); sprite.graphics.beginFill(fillColor, fillAlpha); sprite.graphics.drawRect((-(_local1) / 2), (-(_local2) / 2), _local1, _local2); sprite.graphics.endFill(); }; paint(); } public function get height():Number{ return ((_extents[1] * 2)); } public function get angle():Number{ return ((radian * MathUtil.ONE_EIGHTY_OVER_PI)); } function getProjection(_arg1:Vector):Interval{ var _local2:Number = ((extents[0] * Math.abs(_arg1.dot(axes[0]))) + (extents[1] * Math.abs(_arg1.dot(axes[1])))); var _local3:Number = samp.dot(_arg1); interval.min = (_local3 - _local2); interval.max = (_local3 + _local2); return (interval); } override public function paint():void{ sprite.x = curr.x; sprite.y = curr.y; sprite.rotation = angle; } private function setAxes(_arg1:Number):void{ var _local2:Number = Math.sin(_arg1); var _local3:Number = Math.cos(_arg1); axes[0].x = _local3; axes[0].y = _local2; axes[1].x = -(_local2); axes[1].y = _local3; } } }//package org.cove.ape
Section 31
//SpringConstraint (org.cove.ape.SpringConstraint) package org.cove.ape { import flash.display.*; public class SpringConstraint extends AbstractConstraint { private var _collidable:Boolean; private var p1:AbstractParticle; private var p2:AbstractParticle; private var _scp:SpringConstraintParticle; private var _restLength:Number; public function SpringConstraint(_arg1:AbstractParticle, _arg2:AbstractParticle, _arg3:Number=0.5, _arg4:Boolean=false, _arg5:Number=1, _arg6:Number=1, _arg7:Boolean=false){ super(_arg3); this.p1 = _arg1; this.p2 = _arg2; checkParticlesLocation(); _restLength = currLength; setCollidable(_arg4, _arg5, _arg6, _arg7); } public function get fixed():Boolean{ return (((p1.fixed) && (p2.fixed))); } public function get rectScale():Number{ return (scp.rectScale); } public function set rectScale(_arg1:Number):void{ if (scp == null){ return; }; scp.rectScale = _arg1; } public function setDisplay(_arg1:DisplayObject, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0):void{ if (collidable){ scp.setDisplay(_arg1, _arg2, _arg3, _arg4); } else { displayObject = _arg1; displayObjectRotation = _arg4; displayObjectOffset = new Vector(_arg2, _arg3); }; } override public function init():void{ cleanup(); if (collidable){ scp.init(); } else { if (displayObject != null){ initDisplay(); }; }; paint(); } function initDisplay():void{ if (collidable){ scp.initDisplay(); } else { displayObject.x = displayObjectOffset.x; displayObject.y = displayObjectOffset.y; displayObject.rotation = displayObjectRotation; sprite.addChild(displayObject); }; } public function get angle():Number{ return ((radian * MathUtil.ONE_EIGHTY_OVER_PI)); } public function get center():Vector{ return (p1.curr.plus(p2.curr).divEquals(2)); } public function set rectHeight(_arg1:Number):void{ if (scp == null){ return; }; scp.rectHeight = _arg1; } public function get restLength():Number{ return (_restLength); } override public function paint():void{ var _local1:Vector; if (collidable){ scp.paint(); } else { if (displayObject != null){ _local1 = center; sprite.x = _local1.x; sprite.y = _local1.y; sprite.rotation = angle; } else { sprite.graphics.clear(); sprite.graphics.lineStyle(lineThickness, lineColor, lineAlpha); sprite.graphics.moveTo(p1.px, p1.py); sprite.graphics.lineTo(p2.px, p2.py); }; }; } function get scp():SpringConstraintParticle{ return (_scp); } public function get collidable():Boolean{ return (_collidable); } public function setCollidable(_arg1:Boolean, _arg2:Number, _arg3:Number, _arg4:Boolean=false):void{ _collidable = _arg1; _scp = null; if (_collidable){ _scp = new SpringConstraintParticle(p1, p2, this, _arg2, _arg3, _arg4); }; } public function isConnectedTo(_arg1:AbstractParticle):Boolean{ return ((((_arg1 == p1)) || ((_arg1 == p2)))); } public function get rectHeight():Number{ return (scp.rectHeight); } override function resolve():void{ if (((p1.fixed) && (p2.fixed))){ return; }; var _local1:Number = currLength; var _local2:Number = ((_local1 - restLength) / (_local1 * (p1.invMass + p2.invMass))); var _local3:Vector = delta.mult((_local2 * stiffness)); p1.curr.minusEquals(_local3.mult(p1.invMass)); p2.curr.plusEquals(_local3.mult(p2.invMass)); } public function set fixedEndLimit(_arg1:Number):void{ if (scp == null){ return; }; scp.fixedEndLimit = _arg1; } public function get radian():Number{ var _local1:Vector = delta; return (Math.atan2(_local1.y, _local1.x)); } public function set restLength(_arg1:Number):void{ if (_arg1 <= 0){ throw (new ArgumentError("restLength must be greater than 0")); }; _restLength = _arg1; } public function get currLength():Number{ return (p1.curr.distance(p2.curr)); } public function get fixedEndLimit():Number{ return (scp.fixedEndLimit); } private function checkParticlesLocation():void{ if ((((p1.curr.x == p2.curr.x)) && ((p1.curr.y == p2.curr.y)))){ p2.curr.x = (p2.curr.x + 0.0001); }; } function get delta():Vector{ return (p1.curr.minus(p2.curr)); } } }//package org.cove.ape
Section 32
//SpringConstraintParticle (org.cove.ape.SpringConstraintParticle) package org.cove.ape { import org.cove.ape.*; import flash.display.*; class SpringConstraintParticle extends RectangleParticle { private var p1:AbstractParticle; private var lambda:Vector; private var p2:AbstractParticle; private var _rectHeight:Number; private var avgVelocity:Vector; private var rca:Vector; private var rcb:Vector; private var _rectScale:Number; private var parent:SpringConstraint; private var scaleToLength:Boolean; private var s:Number; private var _fixedEndLimit:Number; function SpringConstraintParticle(_arg1:AbstractParticle, _arg2:AbstractParticle, _arg3:SpringConstraint, _arg4:Number, _arg5:Number, _arg6:Boolean){ super(0, 0, 0, 0, 0, false); this.p1 = _arg1; this.p2 = _arg2; lambda = new Vector(0, 0); avgVelocity = new Vector(0, 0); parent = _arg3; this.rectScale = _arg5; this.rectHeight = _arg4; this.scaleToLength = _arg6; fixedEndLimit = 0; rca = new Vector(); rcb = new Vector(); } private function setCorners(_arg1:RectangleParticle, _arg2:int):void{ var _local3:Number = _arg1.curr.x; var _local4:Number = _arg1.curr.y; var _local5:Array = _arg1.axes; var _local6:Array = _arg1.extents; var _local7:Number = (_local5[0].x * _local6[0]); var _local8:Number = (_local5[0].y * _local6[0]); var _local9:Number = (_local5[1].x * _local6[1]); var _local10:Number = (_local5[1].y * _local6[1]); var _local11:Number = (_local7 - _local9); var _local12:Number = (_local8 - _local10); var _local13:Number = (_local7 + _local9); var _local14:Number = (_local8 + _local10); if (_arg2 == 0){ rca.x = (_local3 - _local13); rca.y = (_local4 - _local14); rcb.x = (_local3 + _local11); rcb.y = (_local4 + _local12); } else { if (_arg2 == 1){ rca.x = (_local3 + _local11); rca.y = (_local4 + _local12); rcb.x = (_local3 + _local13); rcb.y = (_local4 + _local14); } else { if (_arg2 == 2){ rca.x = (_local3 + _local13); rca.y = (_local4 + _local14); rcb.x = (_local3 - _local11); rcb.y = (_local4 - _local12); } else { if (_arg2 == 3){ rca.x = (_local3 - _local11); rca.y = (_local4 - _local12); rcb.x = (_local3 - _local13); rcb.y = (_local4 - _local14); }; }; }; }; } override function get invMass():Number{ if (((p1.fixed) && (p2.fixed))){ return (0); }; return ((1 / ((p1.mass + p2.mass) / 2))); } function get rectScale():Number{ return (_rectScale); } function set rectScale(_arg1:Number):void{ _rectScale = _arg1; } override public function get friction():Number{ return (((p1.friction + p2.friction) / 2)); } override public function init():void{ var _local1:Sprite; var _local2:Number; var _local3:Number; if (displayObject != null){ initDisplay(); } else { _local1 = new Sprite(); parent.sprite.addChild(_local1); _local1.name = "inner"; _local2 = (parent.currLength * rectScale); _local3 = rectHeight; _local1.graphics.clear(); _local1.graphics.lineStyle(parent.lineThickness, parent.lineColor, parent.lineAlpha); _local1.graphics.beginFill(parent.fillColor, parent.fillAlpha); _local1.graphics.drawRect((-(_local2) / 2), (-(_local3) / 2), _local2, _local3); _local1.graphics.endFill(); }; paint(); } override function initDisplay():void{ displayObject.x = displayObjectOffset.x; displayObject.y = displayObjectOffset.y; displayObject.rotation = displayObjectRotation; var _local1:Sprite = new Sprite(); _local1.name = "inner"; _local1.addChild(displayObject); parent.sprite.addChild(_local1); } function set rectHeight(_arg1:Number):void{ _rectHeight = _arg1; } function updatePosition():void{ var _local1:Vector = parent.center; curr.setTo(_local1.x, _local1.y); width = (scaleToLength) ? (parent.currLength * rectScale) : (parent.restLength * rectScale); height = rectHeight; radian = parent.radian; } override public function get velocity():Vector{ var _local1:Vector = p1.velocity; var _local2:Vector = p2.velocity; avgVelocity.setTo(((_local1.x + _local2.x) / 2), ((_local1.y + _local2.y) / 2)); return (avgVelocity); } override public function paint():void{ var _local1:Vector = parent.center; var _local2:Sprite = parent.sprite; if (scaleToLength){ _local2.getChildByName("inner").width = (parent.currLength * rectScale); } else { if (displayObject != null){ _local2.getChildByName("inner").width = (parent.restLength * rectScale); }; }; _local2.x = _local1.x; _local2.y = _local1.y; _local2.rotation = parent.angle; } private function getContactPointParam(_arg1:AbstractParticle):Number{ var _local2:Number; var _local3:Number; var _local4:Array; var _local5:Number; var _local6:int; var _local7:Number; if ((_arg1 is CircleParticle)){ _local2 = closestParamPoint(_arg1.curr); } else { if ((_arg1 is RectangleParticle)){ _local4 = new Array(4); _local5 = Number.POSITIVE_INFINITY; _local6 = 0; while (_local6 < 4) { setCorners((_arg1 as RectangleParticle), _local6); _local7 = closestPtSegmentSegment(); if (_local7 < _local5){ _local5 = _local7; _local3 = _local6; _local4[_local6] = s; }; _local6++; }; _local2 = _local4[_local3]; }; }; return (_local2); } function set fixedEndLimit(_arg1:Number):void{ _fixedEndLimit = _arg1; } private function closestPtSegmentSegment():Number{ var _local8:Number; var _local1:Vector = p1.curr; var _local2:Vector = p2.curr; var _local3:Vector = rca; var _local4:Vector = rcb; var _local5:Vector = _local2.minus(_local1); var _local6:Vector = _local4.minus(_local3); var _local7:Vector = _local1.minus(_local3); var _local9:Number = _local5.dot(_local5); var _local10:Number = _local6.dot(_local6); var _local11:Number = _local6.dot(_local7); var _local12:Number = _local5.dot(_local7); var _local13:Number = _local5.dot(_local6); var _local14:Number = ((_local9 * _local10) - (_local13 * _local13)); if (_local14 != 0){ s = MathUtil.clamp((((_local13 * _local11) - (_local12 * _local10)) / _local14), 0, 1); } else { s = 0.5; }; _local8 = (((_local13 * s) + _local11) / _local10); if (_local8 < 0){ _local8 = 0; s = MathUtil.clamp((-(_local12) / _local9), 0, 1); } else { if (_local8 > 0){ _local8 = 1; s = MathUtil.clamp(((_local13 - _local12) / _local9), 0, 1); }; }; var _local15:Vector = _local1.plus(_local5.mult(s)); var _local16:Vector = _local3.plus(_local6.mult(_local8)); var _local17:Vector = _local15.minus(_local16); return (_local15.minus(_local16).dot(_local17)); } override function resolveCollision(_arg1:Vector, _arg2:Vector, _arg3:Vector, _arg4:Number, _arg5:int, _arg6:AbstractParticle):void{ var _local10:Number; var _local11:AbstractParticle; var _local7:Number = getContactPointParam(_arg6); var _local8:Number = (1 - _local7); var _local9:Number = _local7; if (p1.fixed){ if (_local9 <= fixedEndLimit){ return; }; lambda.setTo((_arg1.x / _local9), (_arg1.y / _local9)); p2.curr.plusEquals(lambda); p2.velocity = _arg2; } else { if (p2.fixed){ if (_local8 <= fixedEndLimit){ return; }; lambda.setTo((_arg1.x / _local8), (_arg1.y / _local8)); p1.curr.plusEquals(lambda); p1.velocity = _arg2; } else { _local10 = ((_local8 * _local8) + (_local9 * _local9)); if (_local10 == 0){ return; }; lambda.setTo((_arg1.x / _local10), (_arg1.y / _local10)); p1.curr.plusEquals(lambda.mult(_local8)); p2.curr.plusEquals(lambda.mult(_local9)); if (_local7 == 0.5){ p1.velocity = _arg2; p2.velocity = _arg2; } else { _local11 = ((_local7)<0.5) ? p1 : p2; _local11.velocity = _arg2; }; }; }; } function get rectHeight():Number{ return (_rectHeight); } function get fixedEndLimit():Number{ return (_fixedEndLimit); } override public function get elasticity():Number{ return (((p1.elasticity + p2.elasticity) / 2)); } override public function get mass():Number{ return (((p1.mass + p2.mass) / 2)); } private function closestParamPoint(_arg1:Vector):Number{ var _local2:Vector = p2.curr.minus(p1.curr); var _local3:Number = (_local2.dot(_arg1.minus(p1.curr)) / _local2.dot(_local2)); return (MathUtil.clamp(_local3, 0, 1)); } } }//package org.cove.ape
Section 33
//Vector (org.cove.ape.Vector) package org.cove.ape { public class Vector { public var x:Number; public var y:Number; public function Vector(_arg1:Number=0, _arg2:Number=0){ x = _arg1; y = _arg2; } public function cross(_arg1:Vector):Number{ return (((x * _arg1.y) - (y * _arg1.x))); } public function magnitude():Number{ return (Math.sqrt(((x * x) + (y * y)))); } public function divEquals(_arg1:Number):Vector{ if (_arg1 == 0){ _arg1 = 0.0001; }; x = (x / _arg1); y = (y / _arg1); return (this); } public function times(_arg1:Vector):Vector{ return (new Vector((x * _arg1.x), (y * _arg1.y))); } public function plusEquals(_arg1:Vector):Vector{ x = (x + _arg1.x); y = (y + _arg1.y); return (this); } public function dot(_arg1:Vector):Number{ return (((x * _arg1.x) + (y * _arg1.y))); } public function toString():String{ return (((x + " : ") + y)); } public function normalize():Vector{ var _local1:Number = magnitude(); if (_local1 == 0){ _local1 = 0.0001; }; return (mult((1 / _local1))); } public function minusEquals(_arg1:Vector):Vector{ x = (x - _arg1.x); y = (y - _arg1.y); return (this); } public function copy(_arg1:Vector):void{ x = _arg1.x; y = _arg1.y; } public function multEquals(_arg1:Number):Vector{ x = (x * _arg1); y = (y * _arg1); return (this); } public function minus(_arg1:Vector):Vector{ return (new Vector((x - _arg1.x), (y - _arg1.y))); } public function plus(_arg1:Vector):Vector{ return (new Vector((x + _arg1.x), (y + _arg1.y))); } public function distance(_arg1:Vector):Number{ var _local2:Vector = this.minus(_arg1); return (_local2.magnitude()); } public function setTo(_arg1:Number, _arg2:Number):void{ x = _arg1; y = _arg2; } public function mult(_arg1:Number):Vector{ return (new Vector((x * _arg1), (y * _arg1))); } } }//package org.cove.ape
Section 34
//IDispatcher (org.osflash.signals.IDispatcher) package org.osflash.signals { public interface IDispatcher { function dispatch(... _args):void; } }//package org.osflash.signals
Section 35
//ISignal (org.osflash.signals.ISignal) package org.osflash.signals { public interface ISignal { function get valueClasses():Array; function set valueClasses(_arg1:Array):void; function get numListeners():uint; function add(_arg1:Function):Function; function addOnce(_arg1:Function):Function; function remove(_arg1:Function):Function; } }//package org.osflash.signals
Section 36
//ISignalOwner (org.osflash.signals.ISignalOwner) package org.osflash.signals { public interface ISignalOwner extends ISignal, IDispatcher { function removeAll():void; } }//package org.osflash.signals
Section 37
//Signal (org.osflash.signals.Signal) package org.osflash.signals { import flash.utils.*; import flash.errors.*; public class Signal implements ISignalOwner, IDispatcher { protected var _valueClasses:Array; protected var listeners:Array; protected var onceListeners:Dictionary; protected var listenersNeedCloning:Boolean;// = false public function Signal(... _args){ this.listeners = []; this.onceListeners = new Dictionary(); if ((((_args.length == 1)) && ((_args[0] is Array)))){ var _local1:Array = _args[0]; }; this.valueClasses = _args; } public function get valueClasses():Array{ return (this._valueClasses); } public function set valueClasses(_arg1:Array):void{ this._valueClasses = (_arg1) ? _arg1.slice() : []; var _local2:int = this._valueClasses.length; while (_local2--) { if (!(this._valueClasses[_local2] is Class)){ throw (new ArgumentError(((((("Invalid valueClasses argument: item at index " + _local2) + " should be a Class but was:<") + this._valueClasses[_local2]) + ">.") + getQualifiedClassName(this._valueClasses[_local2])))); }; }; } public function get numListeners():uint{ return (this.listeners.length); } public function add(_arg1:Function):Function{ this.registerListener(_arg1); return (_arg1); } public function addOnce(_arg1:Function):Function{ this.registerListener(_arg1, true); return (_arg1); } public function remove(_arg1:Function):Function{ var _local2:int = this.listeners.indexOf(_arg1); if (_local2 == -1){ return (_arg1); }; if (this.listenersNeedCloning){ this.listeners = this.listeners.slice(); this.listenersNeedCloning = false; }; this.listeners.splice(_local2, 1); delete this.onceListeners[_arg1]; return (_arg1); } public function removeAll():void{ var _local1:uint = this.listeners.length; while (_local1--) { this.remove((this.listeners[_local1] as Function)); }; } public function dispatch(... _args):void{ var _local2:Object; var _local3:Class; var _local6:Function; var _local4:int = this._valueClasses.length; if (_args.length < _local4){ throw (new ArgumentError((((("Incorrect number of arguments. Expected at least " + _local4) + " but received ") + _args.length) + "."))); }; var _local5:int; while (_local5 < _local4) { _local2 = _args[_local5]; if ((((_local2 === null)) || ((_local2 is this._valueClasses[_local5])))){ } else { throw (new ArgumentError((((("Value object <" + _local2) + "> is not an instance of <") + _local3) + ">."))); }; _local5++; }; if (!this.listeners.length){ return; }; this.listenersNeedCloning = true; switch (_args.length){ case 0: for each (_local6 in this.listeners) { if (this.onceListeners[_local6]){ this.remove(_local6); }; _local6(); }; break; case 1: for each (_local6 in this.listeners) { if (this.onceListeners[_local6]){ this.remove(_local6); }; _local6(_args[0]); }; break; default: for each (_local6 in this.listeners) { if (this.onceListeners[_local6]){ this.remove(_local6); }; _local6.apply(null, _args); }; }; this.listenersNeedCloning = false; } protected function registerListener(_arg1:Function, _arg2:Boolean=false):void{ var _local3:String; if (_arg1.length < this._valueClasses.length){ _local3 = ((_arg1.length)==1) ? "argument" : "arguments"; throw (new ArgumentError((((((("Listener has " + _arg1.length) + " ") + _local3) + " but it needs at least ") + this._valueClasses.length) + " to match the given value classes."))); }; if (!this.listeners.length){ this.listeners[0] = _arg1; if (_arg2){ this.onceListeners[_arg1] = true; }; return; }; if (this.listeners.indexOf(_arg1) >= 0){ if (((this.onceListeners[_arg1]) && (!(_arg2)))){ throw (new IllegalOperationError("You cannot addOnce() then add() the same listener without removing the relationship first.")); }; if (((!(this.onceListeners[_arg1])) && (_arg2))){ throw (new IllegalOperationError("You cannot add() then addOnce() the same listener without removing the relationship first.")); }; return; }; if (this.listenersNeedCloning){ this.listeners = this.listeners.slice(); this.listenersNeedCloning = false; }; this.listeners[this.listeners.length] = _arg1; if (_arg2){ this.onceListeners[_arg1] = true; }; } } }//package org.osflash.signals
Section 38
//SlapSoundA (sound.sticky.SlapSoundA) package sound.sticky { import flash.media.*; public dynamic class SlapSoundA extends Sound { } }//package sound.sticky
Section 39
//SlapSoundB (sound.sticky.SlapSoundB) package sound.sticky { import flash.media.*; public dynamic class SlapSoundB extends Sound { } }//package sound.sticky
Section 40
//SlapSoundC (sound.sticky.SlapSoundC) package sound.sticky { import flash.media.*; public dynamic class SlapSoundC extends Sound { } }//package sound.sticky
Section 41
//SlapSoundD (sound.sticky.SlapSoundD) package sound.sticky { import flash.media.*; public dynamic class SlapSoundD extends Sound { } }//package sound.sticky
Section 42
//WooshSound (sounds.sticky.WooshSound) package sounds.sticky { import flash.media.*; public dynamic class WooshSound extends Sound { } }//package sounds.sticky

Library Items

Symbol 1 GraphicUsed by:2
Symbol 2 MovieClipUses:1Used by:3
Symbol 3 MovieClip {graphics.sticky.Ring} [graphics.sticky.Ring]Uses:2
Symbol 4 GraphicUsed by:27 61
Symbol 5 ShapeTweeningUsed by:27
Symbol 6 ShapeTweeningUsed by:27
Symbol 7 GraphicUsed by:8
Symbol 8 MovieClipUses:7Used by:11 12 13 14 15
Symbol 9 GraphicUsed by:10
Symbol 10 MovieClipUses:9Used by:11 12 13 14 15
Symbol 11 MovieClipUses:8 10Used by:27 61
Symbol 12 MovieClipUses:8 10Used by:27 61
Symbol 13 MovieClipUses:8 10Used by:27 61
Symbol 14 MovieClipUses:8 10Used by:27 61
Symbol 15 MovieClipUses:8 10Used by:27 61
Symbol 16 ShapeTweeningUsed by:27
Symbol 17 ShapeTweeningUsed by:27
Symbol 18 ShapeTweeningUsed by:27
Symbol 19 ShapeTweeningUsed by:27
Symbol 20 ShapeTweeningUsed by:27
Symbol 21 ShapeTweeningUsed by:27
Symbol 22 ShapeTweeningUsed by:27
Symbol 23 ShapeTweeningUsed by:27
Symbol 24 ShapeTweeningUsed by:27
Symbol 25 ShapeTweeningUsed by:27
Symbol 26 GraphicUsed by:27
Symbol 27 MovieClip {COKE_Sticky_fla.Symbol1copy_14} [COKE_Sticky_fla.Symbol1copy_14]Uses:4 5 6 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26Used by:41
Symbol 28 GraphicUsed by:29
Symbol 29 MovieClipUses:28Used by:34
Symbol 30 GraphicUsed by:31
Symbol 31 MovieClipUses:30Used by:34
Symbol 32 GraphicUsed by:33
Symbol 33 MovieClipUses:32Used by:34
Symbol 34 MovieClipUses:29 31 33Used by:35
Symbol 35 MovieClipUses:34Used by:41
Symbol 36 GraphicUsed by:40
Symbol 37 GraphicUsed by:40
Symbol 38 GraphicUsed by:40
Symbol 39 GraphicUsed by:40
Symbol 40 MovieClip {graphics.sticky.StickAnimation} [graphics.sticky.StickAnimation]Uses:36 37 38 39Used by:41
Symbol 41 MovieClip {graphics.sticky.StickyHand} [graphics.sticky.StickyHand]Uses:27 35 40
Symbol 42 GraphicUsed by:43
Symbol 43 MovieClipUses:42Used by:79 94 95
Symbol 44 GraphicUsed by:45
Symbol 45 MovieClipUses:44Used by:46
Symbol 46 MovieClipUses:45Used by:95
Symbol 47 GraphicUsed by:95
Symbol 48 GraphicUsed by:95
Symbol 49 GraphicUsed by:50 65
Symbol 50 MovieClipUses:49Used by:95
Symbol 51 ShapeTweeningUsed by:95
Symbol 52 GraphicUsed by:53
Symbol 53 MovieClipUses:52Used by:95
Symbol 54 ShapeTweeningUsed by:95
Symbol 55 GraphicUsed by:58
Symbol 56 GraphicUsed by:57
Symbol 57 MovieClipUses:56Used by:58
Symbol 58 MovieClipUses:55 57Used by:62
Symbol 59 ShapeTweeningUsed by:61
Symbol 60 ShapeTweeningUsed by:61
Symbol 61 MovieClipUses:4 59 60 11 12 13 14 15Used by:62
Symbol 62 MovieClipUses:58 61Used by:95
Symbol 63 GraphicUsed by:64
Symbol 64 MovieClipUses:63Used by:95
Symbol 65 MovieClipUses:49Used by:95
Symbol 66 GraphicUsed by:67
Symbol 67 MovieClipUses:66Used by:95
Symbol 68 GraphicUsed by:95
Symbol 69 GraphicUsed by:74
Symbol 70 GraphicUsed by:71
Symbol 71 MovieClipUses:70Used by:74
Symbol 72 GraphicUsed by:73
Symbol 73 MovieClipUses:72Used by:74
Symbol 74 MovieClipUses:69 71 73Used by:95
Symbol 75 GraphicUsed by:76
Symbol 76 MovieClipUses:75Used by:95
Symbol 77 GraphicUsed by:95
Symbol 78 GraphicUsed by:95
Symbol 79 MovieClipUses:43Used by:95
Symbol 80 ShapeTweeningUsed by:95
Symbol 81 ShapeTweeningUsed by:95
Symbol 82 ShapeTweeningUsed by:95
Symbol 83 ShapeTweeningUsed by:95
Symbol 84 GraphicUsed by:95
Symbol 85 GraphicUsed by:95
Symbol 86 GraphicUsed by:95
Symbol 87 GraphicUsed by:95
Symbol 88 GraphicUsed by:95
Symbol 89 GraphicUsed by:95
Symbol 90 GraphicUsed by:91
Symbol 91 MovieClipUses:90Used by:95
Symbol 92 GraphicUsed by:93
Symbol 93 MovieClipUses:92Used by:95
Symbol 94 MovieClipUses:43Used by:95
Symbol 95 MovieClip {graphics.sticky.IntroBall} [graphics.sticky.IntroBall]Uses:43 46 47 48 50 51 53 54 62 64 65 67 68 74 76 77 78 79 80 81 82 83 84 85 86 87 88 89 91 93 94 SS1
Symbol 96 Sound {sounds.sticky.WooshSound} [sounds.sticky.WooshSound]
Symbol 97 Sound {sound.sticky.SlapSoundA} [sound.sticky.SlapSoundA]
Symbol 98 Sound {sound.sticky.SlapSoundB} [sound.sticky.SlapSoundB]
Symbol 99 Sound {sound.sticky.SlapSoundC} [sound.sticky.SlapSoundC]
Symbol 100 Sound {sound.sticky.SlapSoundD} [sound.sticky.SlapSoundD]
Streaming Sound 1Used by:Symbol 95 MovieClip {graphics.sticky.IntroBall} [graphics.sticky.IntroBall]

Instance Names

"content"Symbol 3 MovieClip {graphics.sticky.Ring} [graphics.sticky.Ring] Frame 1Symbol 2 MovieClip
"fingerfalange_1"Symbol 11 MovieClip Frame 1Symbol 10 MovieClip
"fingerfalange_2"Symbol 12 MovieClip Frame 1Symbol 10 MovieClip
"fingerfalange_3"Symbol 13 MovieClip Frame 1Symbol 10 MovieClip
"fingerfalange_4"Symbol 14 MovieClip Frame 1Symbol 10 MovieClip
"fingerfalange_5"Symbol 15 MovieClip Frame 1Symbol 10 MovieClip
"stickAnimation"Symbol 35 MovieClip Frame 1Symbol 34 MovieClip
"content"Symbol 41 MovieClip {graphics.sticky.StickyHand} [graphics.sticky.StickyHand] Frame 1Symbol 27 MovieClip {COKE_Sticky_fla.Symbol1copy_14} [COKE_Sticky_fla.Symbol1copy_14]
"stickAnimation"Symbol 41 MovieClip {graphics.sticky.StickyHand} [graphics.sticky.StickyHand] Frame 1Symbol 35 MovieClip
"stickAnimationCorner"Symbol 41 MovieClip {graphics.sticky.StickyHand} [graphics.sticky.StickyHand] Frame 1Symbol 40 MovieClip {graphics.sticky.StickAnimation} [graphics.sticky.StickAnimation]

Special Tags

FileAttributes (69)Timeline Frame 1Access network only, Metadata present, AS3.
SWFMetaData (77)Timeline Frame 1459 bytes "<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'><rdf:Description rdf:about='' xmlns ..."
ScriptLimits (65)Timeline Frame 1MaxRecursionDepth: 1000, ScriptTimeout: 60 seconds
ExportAssets (56)Timeline Frame 1Symbol 3 as "graphics.sticky.Ring"
ExportAssets (56)Timeline Frame 1Symbol 41 as "graphics.sticky.StickyHand"
ExportAssets (56)Timeline Frame 1Symbol 95 as "graphics.sticky.IntroBall"
ExportAssets (56)Timeline Frame 1Symbol 96 as "sounds.sticky.WooshSound"
ExportAssets (56)Timeline Frame 1Symbol 97 as "sound.sticky.SlapSoundA"
ExportAssets (56)Timeline Frame 1Symbol 98 as "sound.sticky.SlapSoundB"
ExportAssets (56)Timeline Frame 1Symbol 99 as "sound.sticky.SlapSoundC"
ExportAssets (56)Timeline Frame 1Symbol 100 as "sound.sticky.SlapSoundD"
ExportAssets (56)Timeline Frame 1Symbol 40 as "graphics.sticky.StickAnimation"
ExportAssets (56)Timeline Frame 1Symbol 27 as "COKE_Sticky_fla.Symbol1copy_14"
SerialNumber (41)Timeline Frame 1

Labels

"nu_random_cocacola_sticky_StickyApplication"Frame 1
"pause"Symbol 95 MovieClip {graphics.sticky.IntroBall} [graphics.sticky.IntroBall] Frame 109




http://swfchan.com/24/116157/info.shtml
Created: 9/3 -2019 02:20:24 Last modified: 9/3 -2019 02:20:24 Server time: 22/12 -2024 10:19:08