Section 1
//Action (org.flintparticles.common.actions.Action)
package org.flintparticles.common.actions {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
public interface Action {
function update(_arg1:Emitter, _arg2:Particle, _arg3:Number):void;
function addedToEmitter(_arg1:Emitter):void;
function removedFromEmitter(_arg1:Emitter):void;
function getDefaultPriority():Number;
}
}//package org.flintparticles.common.actions
Section 2
//ActionBase (org.flintparticles.common.actions.ActionBase)
package org.flintparticles.common.actions {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
public class ActionBase implements Action {
public function addedToEmitter(_arg1:Emitter):void{
}
public function removedFromEmitter(_arg1:Emitter):void{
}
public function getDefaultPriority():Number{
return (0);
}
public function update(_arg1:Emitter, _arg2:Particle, _arg3:Number):void{
}
}
}//package org.flintparticles.common.actions
Section 3
//Age (org.flintparticles.common.actions.Age)
package org.flintparticles.common.actions {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
import org.flintparticles.common.energyEasing.*;
public class Age extends ActionBase {
private var _easing:Function;
public function Age(_arg1:Function=null){
if (_arg1 == null){
_easing = Linear.easeNone;
} else {
_easing = _arg1;
};
}
public function set easing(_arg1:Function):void{
_easing = _arg1;
}
override public function update(_arg1:Emitter, _arg2:Particle, _arg3:Number):void{
_arg2.age = (_arg2.age + _arg3);
if (_arg2.age >= _arg2.lifetime){
_arg2.energy = 0;
_arg2.isDead = true;
} else {
_arg2.energy = _easing(_arg2.age, _arg2.lifetime);
};
}
public function get easing():Function{
return (_easing);
}
}
}//package org.flintparticles.common.actions
Section 4
//Fade (org.flintparticles.common.actions.Fade)
package org.flintparticles.common.actions {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
public class Fade extends ActionBase {
private var _endAlpha:Number;
private var _diffAlpha:Number;
public function Fade(_arg1:Number=1, _arg2:Number=0){
_diffAlpha = (_arg1 - _arg2);
_endAlpha = _arg2;
}
public function get endAlpha():Number{
return (_endAlpha);
}
public function set endAlpha(_arg1:Number):void{
_diffAlpha = ((_endAlpha + _diffAlpha) - _arg1);
_endAlpha = _arg1;
}
override public function update(_arg1:Emitter, _arg2:Particle, _arg3:Number):void{
var _local4:Number = (_endAlpha + (_diffAlpha * _arg2.energy));
_arg2.color = ((_arg2.color & 0xFFFFFF) | (Math.round((_local4 * 0xFF)) << 24));
}
override public function getDefaultPriority():Number{
return (-5);
}
public function set startAlpha(_arg1:Number):void{
_diffAlpha = (_arg1 - _endAlpha);
}
public function get startAlpha():Number{
return ((_endAlpha + _diffAlpha));
}
}
}//package org.flintparticles.common.actions
Section 5
//Activity (org.flintparticles.common.activities.Activity)
package org.flintparticles.common.activities {
import org.flintparticles.common.emitters.*;
public interface Activity {
function initialize(_arg1:Emitter):void;
function removedFromEmitter(_arg1:Emitter):void;
function update(_arg1:Emitter, _arg2:Number):void;
function addedToEmitter(_arg1:Emitter):void;
function getDefaultPriority():Number;
}
}//package org.flintparticles.common.activities
Section 6
//ActivityBase (org.flintparticles.common.activities.ActivityBase)
package org.flintparticles.common.activities {
import org.flintparticles.common.emitters.*;
public class ActivityBase implements Activity {
public function initialize(_arg1:Emitter):void{
}
public function addedToEmitter(_arg1:Emitter):void{
}
public function removedFromEmitter(_arg1:Emitter):void{
}
public function getDefaultPriority():Number{
return (0);
}
public function update(_arg1:Emitter, _arg2:Number):void{
}
}
}//package org.flintparticles.common.activities
Section 7
//Blast (org.flintparticles.common.counters.Blast)
package org.flintparticles.common.counters {
import org.flintparticles.common.emitters.*;
public class Blast implements Counter {
private var _startCount:uint;
public function Blast(_arg1:uint){
_startCount = _arg1;
}
public function stop():void{
}
public function updateEmitter(_arg1:Emitter, _arg2:Number):uint{
return (0);
}
public function startEmitter(_arg1:Emitter):uint{
return (_startCount);
}
public function resume():void{
}
public function set startCount(_arg1:Number):void{
_startCount = _arg1;
}
public function get startCount():Number{
return (_startCount);
}
}
}//package org.flintparticles.common.counters
Section 8
//Counter (org.flintparticles.common.counters.Counter)
package org.flintparticles.common.counters {
import org.flintparticles.common.emitters.*;
public interface Counter {
function stop():void;
function startEmitter(_arg1:Emitter):uint;
function updateEmitter(_arg1:Emitter, _arg2:Number):uint;
function resume():void;
}
}//package org.flintparticles.common.counters
Section 9
//Steady (org.flintparticles.common.counters.Steady)
package org.flintparticles.common.counters {
import org.flintparticles.common.emitters.*;
public class Steady implements Counter {
private var _stop:Boolean;
private var _rateInv:Number;
private var _timeToNext:Number;
private var _rate:Number;
public function Steady(_arg1:Number){
_stop = false;
_rate = _arg1;
_rateInv = (1 / _rate);
}
public function get rate():Number{
return (_rate);
}
public function updateEmitter(_arg1:Emitter, _arg2:Number):uint{
if (_stop){
return (0);
};
var _local3:uint;
_timeToNext = (_timeToNext - _arg2);
while (_timeToNext <= 0) {
_local3++;
_timeToNext = (_timeToNext + _rateInv);
};
return (_local3);
}
public function set rate(_arg1:Number):void{
_rate = _arg1;
_rateInv = (1 / _arg1);
}
public function stop():void{
_stop = true;
}
public function startEmitter(_arg1:Emitter):uint{
_timeToNext = _rateInv;
return (0);
}
public function resume():void{
_stop = false;
}
}
}//package org.flintparticles.common.counters
Section 10
//ZeroCounter (org.flintparticles.common.counters.ZeroCounter)
package org.flintparticles.common.counters {
import org.flintparticles.common.emitters.*;
public class ZeroCounter implements Counter {
public function stop():void{
}
public function updateEmitter(_arg1:Emitter, _arg2:Number):uint{
return (0);
}
public function startEmitter(_arg1:Emitter):uint{
return (0);
}
public function resume():void{
}
}
}//package org.flintparticles.common.counters
Section 11
//Dot (org.flintparticles.common.displayObjects.Dot)
package org.flintparticles.common.displayObjects {
import flash.display.*;
public class Dot extends Shape {
public function Dot(_arg1:Number, _arg2:uint=0xFFFFFF, _arg3:String="normal"){
graphics.beginFill(_arg2);
graphics.drawCircle(0, 0, _arg1);
graphics.endFill();
blendMode = _arg3;
}
}
}//package org.flintparticles.common.displayObjects
Section 12
//Line (org.flintparticles.common.displayObjects.Line)
package org.flintparticles.common.displayObjects {
import flash.display.*;
public class Line extends Shape {
public function Line(_arg1:Number, _arg2:uint=0xFFFFFF, _arg3:String="normal"){
graphics.lineStyle(1, _arg2);
graphics.moveTo((-(_arg1) * 0.5), 0);
graphics.lineTo((_arg1 * 0.5), 0);
blendMode = _arg3;
}
}
}//package org.flintparticles.common.displayObjects
Section 13
//Emitter (org.flintparticles.common.emitters.Emitter)
package org.flintparticles.common.emitters {
import org.flintparticles.common.particles.*;
import org.flintparticles.common.initializers.*;
import org.flintparticles.common.actions.*;
import org.flintparticles.common.activities.*;
import org.flintparticles.common.counters.*;
import org.flintparticles.common.events.*;
import org.flintparticles.common.utils.*;
import flash.events.*;
public class Emitter extends EventDispatcher {
protected var _running:Boolean;// = false
protected var _activities:PriorityArray;
protected var _particles:Array;
protected var _initializers:PriorityArray;
protected var _counter:Counter;
protected var _started:Boolean;// = false
protected var _actions:PriorityArray;
protected var _useInternalTick:Boolean;// = true
protected var _particleFactory:ParticleFactory;
protected var _fixedFrameTime:Number;// = 0
protected var _maximumFrameTime:Number;// = 0.1
public function Emitter(){
_particles = new Array();
_actions = new PriorityArray();
_initializers = new PriorityArray();
_activities = new PriorityArray();
_counter = new ZeroCounter();
}
public function addInitializer(_arg1:Initializer, _arg2:Number=NaN):void{
if (isNaN(_arg2)){
_arg2 = _arg1.getDefaultPriority();
};
_initializers.add(_arg1, _arg2);
_arg1.addedToEmitter(this);
}
public function stop():void{
if (_useInternalTick){
FrameUpdater.instance.removeEventListener(UpdateEvent.UPDATE, updateEventListener);
};
_started = false;
killAllParticles();
}
public function killAllParticles():void{
var _local1:int = _particles.length;
var _local2:int;
while (_local2 < _local1) {
dispatchEvent(new ParticleEvent(ParticleEvent.PARTICLE_DEAD, _particles[_local2]));
_particleFactory.disposeParticle(_particles[_local2]);
_local2++;
};
_particles.length = 0;
}
public function set fixedFrameTime(_arg1:Number):void{
_fixedFrameTime = _arg1;
}
public function get maximumFrameTime():Number{
return (_maximumFrameTime);
}
public function get useInternalTick():Boolean{
return (_useInternalTick);
}
protected function createParticle():Particle{
var _local1:Particle = _particleFactory.createParticle();
var _local2:int = _initializers.length;
initParticle(_local1);
var _local3:int;
while (_local3 < _local2) {
_initializers[_local3].initialize(this, _local1);
_local3++;
};
_particles.push(_local1);
dispatchEvent(new ParticleEvent(ParticleEvent.PARTICLE_CREATED, _local1));
return (_local1);
}
public function get particleFactory():ParticleFactory{
return (_particleFactory);
}
private function updateEventListener(_arg1:UpdateEvent):void{
if (_fixedFrameTime){
update(_fixedFrameTime);
} else {
update(_arg1.time);
};
}
public function get particles():Array{
return (_particles);
}
protected function sortParticles():void{
}
public function removeActivity(_arg1:Activity):void{
if (_activities.remove(_arg1)){
_arg1.removedFromEmitter(this);
};
}
public function set maximumFrameTime(_arg1:Number):void{
_maximumFrameTime = _arg1;
}
protected function initParticle(_arg1:Particle):void{
}
public function addAction(_arg1:Action, _arg2:Number=NaN):void{
if (isNaN(_arg2)){
_arg2 = _arg1.getDefaultPriority();
};
_actions.add(_arg1, _arg2);
_arg1.addedToEmitter(this);
}
public function hasInitializerOfType(_arg1:Class):Boolean{
var _local2:uint = _initializers.length;
var _local3:uint;
while (_local3 < _local2) {
if ((_initializers[_local3] is _arg1)){
return (true);
};
_local3++;
};
return (false);
}
public function resume():void{
_running = true;
}
public function removeInitializer(_arg1:Initializer):void{
if (_initializers.remove(_arg1)){
_arg1.removedFromEmitter(this);
};
}
public function get running():Boolean{
return (_running);
}
public function hasActionOfType(_arg1:Class):Boolean{
var _local2:uint = _actions.length;
var _local3:uint;
while (_local3 < _local2) {
if ((_actions[_local3] is _arg1)){
return (true);
};
_local3++;
};
return (false);
}
public function get fixedFrameTime():Number{
return (_fixedFrameTime);
}
public function set particleFactory(_arg1:ParticleFactory):void{
_particleFactory = _arg1;
}
public function hasActivity(_arg1:Activity):Boolean{
return (_activities.contains(_arg1));
}
public function addActivity(_arg1:Activity, _arg2:Number=NaN):void{
if (isNaN(_arg2)){
_arg2 = _arg1.getDefaultPriority();
};
_activities.add(_arg1, _arg2);
_arg1.addedToEmitter(this);
}
public function update(_arg1:Number):void{
var _local2:int;
var _local3:Particle;
var _local5:Action;
var _local6:int;
var _local7:int;
if (!_running){
return;
};
if (_arg1 > _maximumFrameTime){
_arg1 = _maximumFrameTime;
};
var _local4:int = _counter.updateEmitter(this, _arg1);
_local2 = 0;
while (_local2 < _local4) {
createParticle();
_local2++;
};
sortParticles();
_local4 = _activities.length;
_local2 = 0;
while (_local2 < _local4) {
_activities[_local2].update(this, _arg1);
_local2++;
};
if (_particles.length > 0){
_local4 = _actions.length;
_local6 = _particles.length;
_local7 = 0;
while (_local7 < _local4) {
_local5 = _actions[_local7];
_local2 = 0;
while (_local2 < _local6) {
_local3 = _particles[_local2];
_local5.update(this, _local3, _arg1);
_local2++;
};
_local7++;
};
_local2 = _local6;
while (_local2--) {
_local3 = _particles[_local2];
if (_local3.isDead){
dispatchEvent(new ParticleEvent(ParticleEvent.PARTICLE_DEAD, _local3));
_particleFactory.disposeParticle(_local3);
_particles.splice(_local2, 1);
};
};
} else {
dispatchEvent(new EmitterEvent(EmitterEvent.EMITTER_EMPTY));
};
dispatchEvent(new EmitterEvent(EmitterEvent.EMITTER_UPDATED));
}
public function addExistingParticles(_arg1:Array, _arg2:Boolean=false):void{
var _local4:int;
var _local5:int;
var _local6:int;
var _local3:int = _arg1.length;
if (_arg2){
_local5 = _initializers.length;
_local6 = 0;
while (_local6 < _local5) {
_local4 = 0;
while (_local4 < _local3) {
_initializers[_local6].initialize(this, _arg1[_local4]);
_local4++;
};
_local6++;
};
};
_local4 = 0;
while (_local4 < _local3) {
_particles.push(_arg1[_local4]);
dispatchEvent(new ParticleEvent(ParticleEvent.PARTICLE_ADDED, _arg1[_local4]));
_local4++;
};
}
public function removeAction(_arg1:Action):void{
if (_actions.remove(_arg1)){
_arg1.removedFromEmitter(this);
};
}
public function hasActivityOfType(_arg1:Class):Boolean{
var _local2:uint = _activities.length;
var _local3:uint;
while (_local3 < _local2) {
if ((_activities[_local3] is _arg1)){
return (true);
};
_local3++;
};
return (false);
}
public function set useInternalTick(_arg1:Boolean):void{
if (_useInternalTick != _arg1){
_useInternalTick = _arg1;
if (_started){
if (_useInternalTick){
FrameUpdater.instance.addEventListener(UpdateEvent.UPDATE, updateEventListener, false, 0, true);
} else {
FrameUpdater.instance.removeEventListener(UpdateEvent.UPDATE, updateEventListener);
};
};
};
}
public function hasInitializer(_arg1:Initializer):Boolean{
return (_initializers.contains(_arg1));
}
public function start():void{
if (_useInternalTick){
FrameUpdater.instance.addEventListener(UpdateEvent.UPDATE, updateEventListener, false, 0, true);
};
_started = true;
_running = true;
var _local1:int = _activities.length;
var _local2:int;
while (_local2 < _local1) {
_activities[_local2].initialize(this);
_local2++;
};
_local1 = _counter.startEmitter(this);
_local2 = 0;
while (_local2 < _local1) {
createParticle();
_local2++;
};
}
public function hasAction(_arg1:Action):Boolean{
return (_actions.contains(_arg1));
}
public function pause():void{
_running = false;
}
public function set counter(_arg1:Counter):void{
_counter = _arg1;
if (running){
_counter.startEmitter(this);
};
}
public function get counter():Counter{
return (_counter);
}
public function runAhead(_arg1:Number, _arg2:Number=10):void{
var _local3:Number = _maximumFrameTime;
var _local4:Number = (1 / _arg2);
_maximumFrameTime = _local4;
while (_arg1 > 0) {
_arg1 = (_arg1 - _local4);
update(_local4);
};
_maximumFrameTime = _local3;
}
}
}//package org.flintparticles.common.emitters
Section 14
//Linear (org.flintparticles.common.energyEasing.Linear)
package org.flintparticles.common.energyEasing {
public class Linear {
public static function easeOut(_arg1:Number, _arg2:Number):Number{
return ((1 - (_arg1 / _arg2)));
}
public static function easeIn(_arg1:Number, _arg2:Number):Number{
return ((1 - (_arg1 / _arg2)));
}
public static function easeInOut(_arg1:Number, _arg2:Number):Number{
return ((1 - (_arg1 / _arg2)));
}
public static function easeNone(_arg1:Number, _arg2:Number):Number{
return ((1 - (_arg1 / _arg2)));
}
}
}//package org.flintparticles.common.energyEasing
Section 15
//Quadratic (org.flintparticles.common.energyEasing.Quadratic)
package org.flintparticles.common.energyEasing {
public class Quadratic {
public static function easeOut(_arg1:Number, _arg2:Number):Number{
_arg1 = (1 - (_arg1 / _arg2));
return ((_arg1 * _arg1));
}
public static function easeIn(_arg1:Number, _arg2:Number):Number{
_arg1 = (_arg1 / _arg2);
return ((1 - (_arg1 * _arg1)));
}
public static function easeInOut(_arg1:Number, _arg2:Number):Number{
_arg1 = (_arg1 / (_arg2 * 0.5));
if (_arg1 < 1){
return ((1 - ((_arg1 * _arg1) * 0.5)));
};
_arg1 = (_arg1 - 2);
return (((_arg1 * _arg1) * 0.5));
}
}
}//package org.flintparticles.common.energyEasing
Section 16
//EmitterEvent (org.flintparticles.common.events.EmitterEvent)
package org.flintparticles.common.events {
import flash.events.*;
public class EmitterEvent extends Event {
public static var EMITTER_UPDATED:String = "emitterUpdated";
public static var EMITTER_EMPTY:String = "emitterEmpty";
public function EmitterEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
}
}
}//package org.flintparticles.common.events
Section 17
//ParticleEvent (org.flintparticles.common.events.ParticleEvent)
package org.flintparticles.common.events {
import org.flintparticles.common.particles.*;
import flash.events.*;
public class ParticleEvent extends Event {
public var particle:Particle;
public var otherObject;
public static var PARTICLES_COLLISION:String = "particlesCollision";
public static var PARTICLE_ADDED:String = "particleAdded";
public static var PARTICLE_DEAD:String = "particleDead";
public static var PARTICLE_CREATED:String = "particleCreated";
public function ParticleEvent(_arg1:String, _arg2:Particle=null, _arg3:Boolean=false, _arg4:Boolean=false){
super(_arg1, _arg3, _arg4);
this.particle = _arg2;
}
}
}//package org.flintparticles.common.events
Section 18
//UpdateEvent (org.flintparticles.common.events.UpdateEvent)
package org.flintparticles.common.events {
import flash.events.*;
public class UpdateEvent extends Event {
public var time:Number;
public static var UPDATE:String = "update";
public function UpdateEvent(_arg1:String, _arg2:Number=NaN, _arg3:Boolean=false, _arg4:Boolean=false){
super(_arg1, _arg3, _arg4);
this.time = _arg2;
}
}
}//package org.flintparticles.common.events
Section 19
//ColorInit (org.flintparticles.common.initializers.ColorInit)
package org.flintparticles.common.initializers {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
import org.flintparticles.common.utils.*;
public class ColorInit extends InitializerBase {
private var _max:uint;
private var _min:uint;
public function ColorInit(_arg1:uint, _arg2:uint){
_min = _arg1;
_max = _arg2;
}
public function set minColor(_arg1:uint):void{
_min = _arg1;
}
public function get color():uint{
return (((_min == _max)) ? _min : interpolateColors(_max, _min, 0.5));
}
public function set color(_arg1:uint):void{
_max = (_min = _arg1);
}
override public function initialize(_arg1:Emitter, _arg2:Particle):void{
if (_max == _min){
_arg2.color = _min;
} else {
_arg2.color = interpolateColors(_min, _max, Math.random());
};
}
public function get minColor():uint{
return (_min);
}
public function set maxColor(_arg1:uint):void{
_max = _arg1;
}
public function get maxColor():uint{
return (_max);
}
}
}//package org.flintparticles.common.initializers
Section 20
//Initializer (org.flintparticles.common.initializers.Initializer)
package org.flintparticles.common.initializers {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
public interface Initializer {
function initialize(_arg1:Emitter, _arg2:Particle):void;
function addedToEmitter(_arg1:Emitter):void;
function removedFromEmitter(_arg1:Emitter):void;
function getDefaultPriority():Number;
}
}//package org.flintparticles.common.initializers
Section 21
//InitializerBase (org.flintparticles.common.initializers.InitializerBase)
package org.flintparticles.common.initializers {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
public class InitializerBase implements Initializer {
public function initialize(_arg1:Emitter, _arg2:Particle):void{
}
public function addedToEmitter(_arg1:Emitter):void{
}
public function removedFromEmitter(_arg1:Emitter):void{
}
public function getDefaultPriority():Number{
return (0);
}
}
}//package org.flintparticles.common.initializers
Section 22
//Lifetime (org.flintparticles.common.initializers.Lifetime)
package org.flintparticles.common.initializers {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
public class Lifetime extends InitializerBase {
private var _max:Number;
private var _min:Number;
public function Lifetime(_arg1:Number, _arg2:Number=NaN){
_max = _arg2;
_min = _arg1;
}
public function get lifetime():Number{
return (((_min == _max)) ? _min : ((_max + _min) * 0.5));
}
public function get maxLifetime():Number{
return (_max);
}
override public function initialize(_arg1:Emitter, _arg2:Particle):void{
if (isNaN(_max)){
_arg2.lifetime = _min;
} else {
_arg2.lifetime = (_min + (Math.random() * (_max - _min)));
};
}
public function set lifetime(_arg1:Number):void{
_max = (_min = _arg1);
}
public function set minLifetime(_arg1:Number):void{
_min = _arg1;
}
public function set maxLifetime(_arg1:Number):void{
_max = _arg1;
}
public function get minLifetime():Number{
return (_min);
}
}
}//package org.flintparticles.common.initializers
Section 23
//SharedImage (org.flintparticles.common.initializers.SharedImage)
package org.flintparticles.common.initializers {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
import flash.display.*;
public class SharedImage extends InitializerBase {
private var _image:DisplayObject;
public function SharedImage(_arg1:DisplayObject){
_image = _arg1;
}
override public function initialize(_arg1:Emitter, _arg2:Particle):void{
_arg2.image = _image;
}
public function set image(_arg1:DisplayObject):void{
_image = _arg1;
}
public function get image():DisplayObject{
return (_image);
}
}
}//package org.flintparticles.common.initializers
Section 24
//Particle (org.flintparticles.common.particles.Particle)
package org.flintparticles.common.particles {
import flash.geom.*;
import flash.utils.*;
public class Particle {
public var energy:Number;// = 1
public var lifetime:Number;// = 0
public var scale:Number;// = 1
public var image;// = null
public var color:uint;// = 4294967295
public var collisionRadius:Number;// = 1
private var _colorTransform:ColorTransform;// = null
private var _previousColor:uint;
public var isDead:Boolean;// = false
public var mass:Number;// = 1
private var _dictionary:Dictionary;// = null
public var age:Number;// = 0
public function get dictionary():Dictionary{
if (_dictionary == null){
_dictionary = new Dictionary(true);
};
return (_dictionary);
}
public function get colorTransform():ColorTransform{
if (((!(_colorTransform)) || (!((_previousColor == color))))){
_colorTransform = new ColorTransform((((color >>> 16) & 0xFF) / 0xFF), (((color >>> 8) & 0xFF) / 0xFF), ((color & 0xFF) / 0xFF), (((color >>> 24) & 0xFF) / 0xFF), 0, 0, 0, 0);
_previousColor = color;
};
return (_colorTransform);
}
protected function cloneInto(_arg1:Particle):Particle{
var _local2:Object;
_arg1.color = color;
_arg1.scale = scale;
_arg1.mass = mass;
_arg1.collisionRadius = collisionRadius;
_arg1.lifetime = lifetime;
_arg1.age = age;
_arg1.energy = energy;
_arg1.isDead = isDead;
_arg1.image = image;
if (_dictionary){
_arg1._dictionary = new Dictionary(true);
for (_local2 in _dictionary) {
_arg1._dictionary[_local2] = _dictionary[_local2];
};
};
return (_arg1);
}
public function get alpha():Number{
return ((((color & 4278190080) >>> 24) / 0xFF));
}
public function initialize():void{
color = 4294967295;
scale = 1;
mass = 1;
collisionRadius = 1;
lifetime = 0;
age = 0;
energy = 1;
isDead = false;
image = null;
_dictionary = null;
_colorTransform = null;
}
public function clone(_arg1:ParticleFactory=null):Particle{
var _local2:Particle;
if (_arg1){
_local2 = _arg1.createParticle();
} else {
_local2 = new Particle();
};
return (cloneInto(_local2));
}
}
}//package org.flintparticles.common.particles
Section 25
//ParticleFactory (org.flintparticles.common.particles.ParticleFactory)
package org.flintparticles.common.particles {
public interface ParticleFactory {
function createParticle():Particle;
function disposeParticle(_arg1:Particle):void;
}
}//package org.flintparticles.common.particles
Section 26
//Renderer (org.flintparticles.common.renderers.Renderer)
package org.flintparticles.common.renderers {
import org.flintparticles.common.emitters.*;
public interface Renderer {
function removeEmitter(_arg1:Emitter):void;
function addEmitter(_arg1:Emitter):void;
}
}//package org.flintparticles.common.renderers
Section 27
//SpriteRendererBase (org.flintparticles.common.renderers.SpriteRendererBase)
package org.flintparticles.common.renderers {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
import org.flintparticles.common.events.*;
import flash.events.*;
import flash.display.*;
public class SpriteRendererBase extends Sprite implements Renderer {
protected var _emitters:Array;
public function SpriteRendererBase(){
_emitters = new Array();
mouseEnabled = false;
mouseChildren = false;
addEventListener(Event.ADDED_TO_STAGE, addedToStage, false, 0, true);
}
private function particleAdded(_arg1:ParticleEvent):void{
addParticle(_arg1.particle);
if (stage){
stage.invalidate();
};
}
private function addedToStage(_arg1:Event):void{
if (stage){
stage.invalidate();
};
}
public function get emitters():Array{
return (_emitters);
}
protected function addParticle(_arg1:Particle):void{
}
private function updateParticles(_arg1:Event):void{
var _local2:Array = new Array();
var _local3:int;
while (_local3 < _emitters.length) {
_local2 = _local2.concat(_emitters[_local3].particles);
_local3++;
};
renderParticles(_local2);
}
private function emitterUpdated(_arg1:EmitterEvent):void{
if (stage){
stage.invalidate();
};
}
public function removeEmitter(_arg1:Emitter):void{
var _local3:Particle;
var _local2:int;
while (_local2 < _emitters.length) {
if (_emitters[_local2] == _arg1){
_emitters.splice(_local2, 1);
_arg1.removeEventListener(EmitterEvent.EMITTER_UPDATED, emitterUpdated);
_arg1.removeEventListener(ParticleEvent.PARTICLE_CREATED, particleAdded);
_arg1.removeEventListener(ParticleEvent.PARTICLE_ADDED, particleAdded);
_arg1.removeEventListener(ParticleEvent.PARTICLE_DEAD, particleRemoved);
for each (_local3 in _arg1.particles) {
removeParticle(_local3);
};
if (_emitters.length == 0){
removeEventListener(Event.RENDER, updateParticles);
renderParticles([]);
} else {
stage.invalidate();
};
return;
};
_local2++;
};
}
protected function renderParticles(_arg1:Array):void{
}
protected function removeParticle(_arg1:Particle):void{
}
private function particleRemoved(_arg1:ParticleEvent):void{
removeParticle(_arg1.particle);
if (stage){
stage.invalidate();
};
}
public function addEmitter(_arg1:Emitter):void{
var _local2:Particle;
_emitters.push(_arg1);
if (stage){
stage.invalidate();
};
_arg1.addEventListener(EmitterEvent.EMITTER_UPDATED, emitterUpdated, false, 0, true);
_arg1.addEventListener(ParticleEvent.PARTICLE_CREATED, particleAdded, false, 0, true);
_arg1.addEventListener(ParticleEvent.PARTICLE_ADDED, particleAdded, false, 0, true);
_arg1.addEventListener(ParticleEvent.PARTICLE_DEAD, particleRemoved, false, 0, true);
for each (_local2 in _arg1.particles) {
addParticle(_local2);
};
if (_emitters.length == 1){
addEventListener(Event.RENDER, updateParticles, false, 0, true);
};
}
}
}//package org.flintparticles.common.renderers
Section 28
//FrameUpdater (org.flintparticles.common.utils.FrameUpdater)
package org.flintparticles.common.utils {
import flash.utils.*;
import org.flintparticles.common.events.*;
import flash.events.*;
import flash.display.*;
public class FrameUpdater extends EventDispatcher {
private var _shape:Shape;
private var _time:Number;
private static var _instance:FrameUpdater;
public function FrameUpdater(){
_shape = new Shape();
_shape.addEventListener(Event.ENTER_FRAME, frameUpdate, false, 0, true);
_time = getTimer();
}
private function frameUpdate(_arg1:Event):void{
var _local2:int = _time;
_time = getTimer();
var _local3:Number = ((_time - _local2) * 0.001);
dispatchEvent(new UpdateEvent(UpdateEvent.UPDATE, _local3));
}
public static function get instance():FrameUpdater{
if (_instance == null){
_instance = new (FrameUpdater);
};
return (_instance);
}
}
}//package org.flintparticles.common.utils
Section 29
//interpolateColors (org.flintparticles.common.utils.interpolateColors)
package org.flintparticles.common.utils {
public function interpolateColors(_arg1:uint, _arg2:uint, _arg3:Number):uint{
var _local4:Number = (1 - _arg3);
var _local5:uint = Math.round(((((_arg1 >>> 16) & 0xFF) * _arg3) + (((_arg2 >>> 16) & 0xFF) * _local4)));
var _local6:uint = Math.round(((((_arg1 >>> 8) & 0xFF) * _arg3) + (((_arg2 >>> 8) & 0xFF) * _local4)));
var _local7:uint = Math.round((((_arg1 & 0xFF) * _arg3) + ((_arg2 & 0xFF) * _local4)));
var _local8:uint = Math.round(((((_arg1 >>> 24) & 0xFF) * _arg3) + (((_arg2 >>> 24) & 0xFF) * _local4)));
return (((((_local8 << 24) | (_local5 << 16)) | (_local6 << 8)) | _local7));
}
}//package org.flintparticles.common.utils
Section 30
//Maths (org.flintparticles.common.utils.Maths)
package org.flintparticles.common.utils {
public class Maths {
private static const DEGTORAD:Number = 0.0174532925199433;
private static const RADTODEG:Number = 57.2957795130823;
public static function asRadians(_arg1:Number):Number{
return ((_arg1 * DEGTORAD));
}
public static function asDegrees(_arg1:Number):Number{
return ((_arg1 * RADTODEG));
}
}
}//package org.flintparticles.common.utils
Section 31
//PriorityArray (org.flintparticles.common.utils.PriorityArray)
package org.flintparticles.common.utils {
import flash.utils.*;
public class PriorityArray extends Proxy {
private var _values:Array;
public function PriorityArray(){
_values = new Array();
}
public function remove(_arg1):Boolean{
var _local2:uint = _values.length;
while (_local2--) {
if (_values[_local2].value == _arg1){
_values.splice(_local2, 1);
return (true);
};
};
return (false);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function nextName(_arg1:int):String{
return ((_arg1 - 1).toString());
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function setProperty(_arg1, _arg2):void{
var _local3:uint = uint(_arg1);
if ((((_local3 == _arg1)) && ((_local3 < _values.length)))){
_values[_local3].value = _arg2;
};
}
public function add(_arg1, _arg2:Number):uint{
var _local3:uint = _values.length;
var _local4:uint;
while (_local4 < _local3) {
if (_values[_local4].priority < _arg2){
break;
};
_local4++;
};
_values.splice(_local4, 0, new Pair(_arg2, _arg1));
return (_values.length);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function getProperty(_arg1){
var _local2:int = int(_arg1);
if ((((((_local2 == _arg1)) && ((_local2 < _values.length)))) && (_values[_local2]))){
return (_values[_local2].value);
};
return (undefined);
}
public function clear():void{
_values.length = 0;
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function nextNameIndex(_arg1:int):int{
if (_arg1 < _values.length){
return ((_arg1 + 1));
};
return (0);
}
public function get length():uint{
return (_values.length);
}
public function removeAt(_arg1:uint){
var _local2:* = _values[_arg1].value;
_values.splice(_arg1, 1);
return (_local2);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function nextValue(_arg1:int){
return (_values[(_arg1 - 1)].value);
}
public function contains(_arg1):Boolean{
var _local2:uint = _values.length;
while (_local2--) {
if (_values[_local2].value == _arg1){
return (true);
};
};
return (false);
}
}
}//package org.flintparticles.common.utils
class Pair {
private var value;
private var priority:Number;
private function Pair(_arg1:Number, _arg2){
this.priority = _arg1;
this.value = _arg2;
}
}
Section 32
//Accelerate (org.flintparticles.twoD.actions.Accelerate)
package org.flintparticles.twoD.actions {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
import org.flintparticles.common.actions.*;
import org.flintparticles.twoD.particles.*;
public class Accelerate extends ActionBase {
private var _x:Number;
private var _y:Number;
public function Accelerate(_arg1:Number, _arg2:Number){
_x = _arg1;
_y = _arg2;
}
public function set x(_arg1:Number):void{
_x = _arg1;
}
public function get y():Number{
return (_y);
}
public function get x():Number{
return (_x);
}
override public function update(_arg1:Emitter, _arg2:Particle, _arg3:Number):void{
var _local4:Particle2D = Particle2D(_arg2);
Particle2D(_arg2).velX = (_local4.velX + (_x * _arg3));
_local4.velY = (_local4.velY + (_y * _arg3));
}
public function set y(_arg1:Number):void{
_y = _arg1;
}
}
}//package org.flintparticles.twoD.actions
Section 33
//LinearDrag (org.flintparticles.twoD.actions.LinearDrag)
package org.flintparticles.twoD.actions {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
import org.flintparticles.common.actions.*;
import org.flintparticles.twoD.particles.*;
public class LinearDrag extends ActionBase {
private var _drag:Number;
public function LinearDrag(_arg1:Number){
_drag = _arg1;
}
public function get drag():Number{
return (_drag);
}
public function set drag(_arg1:Number):void{
_drag = _arg1;
}
override public function update(_arg1:Emitter, _arg2:Particle, _arg3:Number):void{
var _local4:Particle2D;
_local4 = Particle2D(_arg2);
var _local5:Number = (1 - ((_drag * _arg3) / _local4.mass));
if (_local5 < 0){
_local4.velX = 0;
_local4.velY = 0;
} else {
_local4.velX = (_local4.velX * _local5);
_local4.velY = (_local4.velY * _local5);
};
}
}
}//package org.flintparticles.twoD.actions
Section 34
//Move (org.flintparticles.twoD.actions.Move)
package org.flintparticles.twoD.actions {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
import org.flintparticles.common.actions.*;
import org.flintparticles.twoD.particles.*;
public class Move extends ActionBase {
private var p:Particle2D;
override public function getDefaultPriority():Number{
return (-10);
}
override public function update(_arg1:Emitter, _arg2:Particle, _arg3:Number):void{
p = Particle2D(_arg2);
p.x = (p.x + (p.velX * _arg3));
p.y = (p.y + (p.velY * _arg3));
}
}
}//package org.flintparticles.twoD.actions
Section 35
//RotateEmitter (org.flintparticles.twoD.activities.RotateEmitter)
package org.flintparticles.twoD.activities {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.activities.*;
import org.flintparticles.twoD.emitters.*;
public class RotateEmitter extends ActivityBase {
private var _angularVelocity:Number;
public function RotateEmitter(_arg1:Number){
_angularVelocity = _arg1;
}
override public function update(_arg1:Emitter, _arg2:Number):void{
var _local3:Emitter2D = Emitter2D(_arg1);
_local3.rotRadians = (_local3.rotRadians + (_angularVelocity * _arg2));
}
public function set angularVelocity(_arg1:Number):void{
_angularVelocity = _arg1;
}
public function get angularVelocity():Number{
return (_angularVelocity);
}
}
}//package org.flintparticles.twoD.activities
Section 36
//Emitter2D (org.flintparticles.twoD.emitters.Emitter2D)
package org.flintparticles.twoD.emitters {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
import org.flintparticles.common.utils.*;
import org.flintparticles.twoD.particles.*;
public class Emitter2D extends Emitter {
protected var _y:Number;// = 0
public var spaceSort:Boolean;// = false
public var spaceSortedX:Array;
protected var _x:Number;// = 0
protected var _rotation:Number;// = 0
protected static var _creator:ParticleCreator2D = new ParticleCreator2D();
public function Emitter2D(){
_particleFactory = _creator;
}
public function get y():Number{
return (_y);
}
override protected function initParticle(_arg1:Particle):void{
var _local2:Particle2D;
_local2 = Particle2D(_arg1);
_local2.x = _x;
_local2.y = _y;
_local2.rotation = _rotation;
}
override protected function sortParticles():void{
var _local1:int;
var _local2:int;
if (spaceSort){
spaceSortedX = _particles.sortOn("x", (Array.NUMERIC | Array.RETURNINDEXEDARRAY));
_local1 = _particles.length;
_local2 = 0;
while (_local2 < _local1) {
_particles[spaceSortedX[_local2]].sortID = _local2;
_local2++;
};
};
}
public function set x(_arg1:Number):void{
_x = _arg1;
}
public function set rotRadians(_arg1:Number):void{
_rotation = _arg1;
}
public function get x():Number{
return (_x);
}
public function get rotRadians():Number{
return (_rotation);
}
public function set rotation(_arg1:Number):void{
_rotation = Maths.asRadians(_arg1);
}
public function get rotation():Number{
return (Maths.asDegrees(_rotation));
}
public function set y(_arg1:Number):void{
_y = _arg1;
}
public static function get defaultParticleFactory():ParticleFactory{
return (_creator);
}
}
}//package org.flintparticles.twoD.emitters
Section 37
//Velocity (org.flintparticles.twoD.initializers.Velocity)
package org.flintparticles.twoD.initializers {
import org.flintparticles.common.emitters.*;
import flash.geom.*;
import org.flintparticles.common.particles.*;
import org.flintparticles.common.initializers.*;
import org.flintparticles.twoD.zones.*;
import org.flintparticles.twoD.particles.*;
public class Velocity extends InitializerBase {
private var _zone:Zone2D;
public function Velocity(_arg1:Zone2D){
_zone = _arg1;
}
override public function initialize(_arg1:Emitter, _arg2:Particle):void{
var _local3:Particle2D;
var _local5:Number;
var _local6:Number;
_local3 = Particle2D(_arg2);
var _local4:Point = _zone.getLocation();
if (_local3.rotation == 0){
_local3.velX = _local4.x;
_local3.velY = _local4.y;
} else {
_local5 = Math.sin(_local3.rotation);
_local6 = Math.cos(_local3.rotation);
_local3.velX = ((_local6 * _local4.x) - (_local5 * _local4.y));
_local3.velY = ((_local6 * _local4.y) + (_local5 * _local4.x));
};
}
public function set zone(_arg1:Zone2D):void{
_zone = _arg1;
}
public function get zone():Zone2D{
return (_zone);
}
}
}//package org.flintparticles.twoD.initializers
Section 38
//Particle2D (org.flintparticles.twoD.particles.Particle2D)
package org.flintparticles.twoD.particles {
import flash.geom.*;
import org.flintparticles.common.particles.*;
public class Particle2D extends Particle {
public var sortID:int;// = -1
private var _inertia:Number;
public var velY:Number;// = 0
private var _previousRadius:Number;
private var _previousMass:Number;
public var angVelocity:Number;// = 0
public var x:Number;// = 0
public var y:Number;// = 0
public var velX:Number;// = 0
public var rotation:Number;// = 0
override public function clone(_arg1:ParticleFactory=null):Particle{
var _local2:Particle2D;
if (_arg1){
_local2 = (_arg1.createParticle() as Particle2D);
} else {
_local2 = new Particle2D();
};
cloneInto(_local2);
_local2.x = x;
_local2.y = y;
_local2.velX = velX;
_local2.velY = velY;
_local2.rotation = rotation;
_local2.angVelocity = angVelocity;
return (_local2);
}
override public function initialize():void{
super.initialize();
x = 0;
y = 0;
velX = 0;
velY = 0;
rotation = 0;
angVelocity = 0;
sortID = -1;
}
public function get matrixTransform():Matrix{
var _local1:Number = (scale * Math.cos(rotation));
var _local2:Number = (scale * Math.sin(rotation));
return (new Matrix(_local1, _local2, -(_local2), _local1, x, y));
}
public function get inertia():Number{
if (((!((mass == _previousMass))) || (!((collisionRadius == _previousRadius))))){
_inertia = (((mass * collisionRadius) * collisionRadius) * 0.5);
_previousMass = mass;
_previousRadius = collisionRadius;
};
return (_inertia);
}
}
}//package org.flintparticles.twoD.particles
Section 39
//ParticleCreator2D (org.flintparticles.twoD.particles.ParticleCreator2D)
package org.flintparticles.twoD.particles {
import org.flintparticles.common.particles.*;
public class ParticleCreator2D implements ParticleFactory {
private var _particles:Array;
public function ParticleCreator2D(){
_particles = new Array();
}
public function clearAllParticles():void{
_particles = new Array();
}
public function disposeParticle(_arg1:Particle):void{
if ((_arg1 is Particle2D)){
_arg1.initialize();
_particles.push(_arg1);
};
}
public function createParticle():Particle{
if (_particles.length){
return (_particles.pop());
};
return (new Particle2D());
}
}
}//package org.flintparticles.twoD.particles
Section 40
//BitmapRenderer (org.flintparticles.twoD.renderers.BitmapRenderer)
package org.flintparticles.twoD.renderers {
import flash.geom.*;
import flash.display.*;
import flash.filters.*;
import org.flintparticles.twoD.particles.*;
import org.flintparticles.common.renderers.*;
public class BitmapRenderer extends SpriteRendererBase {
protected var _preFilters:Array;
protected var _bitmap:Bitmap;
protected var _bitmapData:BitmapData;
protected var _colorMap:Array;
protected var _smoothing:Boolean;
protected var _canvas:Rectangle;
protected var _postFilters:Array;
protected static var ZERO_POINT:Point = new Point(0, 0);
public function BitmapRenderer(_arg1:Rectangle, _arg2:Boolean=false){
mouseEnabled = false;
mouseChildren = false;
_smoothing = _arg2;
_preFilters = new Array();
_postFilters = new Array();
_canvas = _arg1;
createBitmap();
}
public function addFilter(_arg1:BitmapFilter, _arg2:Boolean=false):void{
if (_arg2){
_postFilters.push(_arg1);
} else {
_preFilters.push(_arg1);
};
}
protected function createBitmap():void{
if (!_canvas){
return;
};
if (((_bitmap) && (_bitmapData))){
_bitmapData.dispose();
_bitmapData = null;
};
if (_bitmap){
removeChild(_bitmap);
};
_bitmap = new Bitmap(null, "auto", _smoothing);
_bitmapData = new BitmapData(_canvas.width, _canvas.height, true, 0);
_bitmap.bitmapData = _bitmapData;
addChild(_bitmap);
_bitmap.x = _canvas.x;
_bitmap.y = _canvas.y;
}
public function clearPaletteMap():void{
_colorMap = null;
}
public function get canvas():Rectangle{
return (_canvas);
}
public function removeFilter(_arg1:BitmapFilter):void{
var _local2:int;
while (_local2 < _preFilters.length) {
if (_preFilters[_local2] == _arg1){
_preFilters.splice(_local2, 1);
return;
};
_local2++;
};
_local2 = 0;
while (_local2 < _postFilters.length) {
if (_postFilters[_local2] == _arg1){
_postFilters.splice(_local2, 1);
return;
};
_local2++;
};
}
public function set canvas(_arg1:Rectangle):void{
_canvas = _arg1;
createBitmap();
}
protected function drawParticle(_arg1:Particle2D):void{
var _local2:Matrix;
_local2 = _arg1.matrixTransform;
_local2.translate(-(_canvas.x), -(_canvas.y));
_bitmapData.draw(_arg1.image, _local2, _arg1.colorTransform, DisplayObject(_arg1.image).blendMode, null, _smoothing);
}
public function setPaletteMap(_arg1:Array=null, _arg2:Array=null, _arg3:Array=null, _arg4:Array=null):void{
_colorMap = new Array(4);
_colorMap[0] = _arg4;
_colorMap[1] = _arg1;
_colorMap[2] = _arg2;
_colorMap[3] = _arg3;
}
public function get bitmapData():BitmapData{
return (_bitmapData);
}
override protected function renderParticles(_arg1:Array):void{
var _local2:int;
var _local3:int;
if (!_bitmap){
return;
};
_bitmapData.lock();
_local3 = _preFilters.length;
_local2 = 0;
while (_local2 < _local3) {
_bitmapData.applyFilter(_bitmapData, _bitmapData.rect, BitmapRenderer.ZERO_POINT, _preFilters[_local2]);
_local2++;
};
if ((((_local3 == 0)) && ((_postFilters.length == 0)))){
_bitmapData.fillRect(_bitmap.bitmapData.rect, 0);
};
_local3 = _arg1.length;
if (_local3){
_local2 = _local3;
while (_local2--) {
drawParticle(_arg1[_local2]);
};
};
_local3 = _postFilters.length;
_local2 = 0;
while (_local2 < _local3) {
_bitmapData.applyFilter(_bitmapData, _bitmapData.rect, BitmapRenderer.ZERO_POINT, _postFilters[_local2]);
_local2++;
};
if (_colorMap){
_bitmapData.paletteMap(_bitmapData, _bitmapData.rect, ZERO_POINT, _colorMap[1], _colorMap[2], _colorMap[3], _colorMap[0]);
};
_bitmapData.unlock();
}
}
}//package org.flintparticles.twoD.renderers
Section 41
//DiscSectorZone (org.flintparticles.twoD.zones.DiscSectorZone)
package org.flintparticles.twoD.zones {
import flash.geom.*;
public class DiscSectorZone implements Zone2D {
private var _minAngle:Number;
private var _innerRadius:Number;
private var _minAllowed:Number;
private var _outerRadius:Number;
private var _center:Point;
private var _maxAngle:Number;
private var _innerSq:Number;
private var _outerSq:Number;
private static var TWOPI:Number = 6.28318530717959;
public function DiscSectorZone(_arg1:Point, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number){
if (_arg2 < _arg3){
throw (new Error((((("The outerRadius (" + _arg2) + ") can't be smaller than the innerRadius (") + _arg3) + ") in your DiscSectorZone. N.B. the outerRadius is the second argument in the constructor and the innerRadius is the third argument.")));
};
_center = _arg1;
_innerRadius = _arg3;
_outerRadius = _arg2;
_innerSq = (_innerRadius * _innerRadius);
_outerSq = (_outerRadius * _outerRadius);
_minAngle = _arg4;
_maxAngle = _arg5;
while (_maxAngle > TWOPI) {
_maxAngle = (_maxAngle - TWOPI);
};
while (_maxAngle < 0) {
_maxAngle = (_maxAngle + TWOPI);
};
_minAllowed = (_maxAngle - TWOPI);
if (_arg4 == _arg5){
_minAngle = _maxAngle;
} else {
_minAngle = clamp(_minAngle);
};
}
public function set minAngle(_arg1:Number):void{
_minAngle = clamp(_arg1);
}
public function get innerRadius():Number{
return (_innerRadius);
}
public function getArea():Number{
return (((Math.PI * _outerSq) - (Math.PI * _innerSq)));
}
public function get maxAngle():Number{
return (_maxAngle);
}
public function set innerRadius(_arg1:Number):void{
_innerRadius = _arg1;
_innerSq = (_innerRadius * _innerRadius);
}
public function set outerRadius(_arg1:Number):void{
_outerRadius = _arg1;
_outerSq = (_outerRadius * _outerRadius);
}
public function set maxAngle(_arg1:Number):void{
_maxAngle = _arg1;
while (_maxAngle > TWOPI) {
_maxAngle = (_maxAngle - TWOPI);
};
while (_maxAngle < 0) {
_maxAngle = (_maxAngle + TWOPI);
};
_minAllowed = (_maxAngle - TWOPI);
}
public function contains(_arg1:Number, _arg2:Number):Boolean{
_arg1 = (_arg1 - _center.x);
_arg2 = (_arg2 - _center.y);
var _local3:Number = ((_arg1 * _arg1) + (_arg2 * _arg2));
if ((((_local3 > _outerSq)) || ((_local3 < _innerSq)))){
return (false);
};
var _local4:Number = Math.atan2(_arg2, _arg1);
_local4 = clamp(_local4);
return ((_local4 >= _minAngle));
}
public function get minAngle():Number{
return (_minAngle);
}
public function get center():Point{
return (_center);
}
public function getLocation():Point{
var _local1:Number = Math.random();
var _local2:Point = Point.polar((_innerRadius + ((1 - (_local1 * _local1)) * (_outerRadius - _innerRadius))), (_minAngle + (Math.random() * (_maxAngle - _minAngle))));
_local2.x = (_local2.x + _center.x);
_local2.y = (_local2.y + _center.y);
return (_local2);
}
public function get outerRadius():Number{
return (_outerRadius);
}
public function set center(_arg1:Point):void{
_center = _arg1;
}
private function clamp(_arg1:Number):Number{
while (_arg1 > _maxAngle) {
_arg1 = (_arg1 - TWOPI);
};
while (_arg1 < _minAllowed) {
_arg1 = (_arg1 + TWOPI);
};
return (_arg1);
}
}
}//package org.flintparticles.twoD.zones
Section 42
//DiscZone (org.flintparticles.twoD.zones.DiscZone)
package org.flintparticles.twoD.zones {
import flash.geom.*;
public class DiscZone implements Zone2D {
private var _innerRadius:Number;
private var _outerRadius:Number;
private var _center:Point;
private var _innerSq:Number;
private var _outerSq:Number;
private static const TWOPI:Number = 6.28318530717959;
public function DiscZone(_arg1:Point, _arg2:Number, _arg3:Number=0){
if (_arg2 < _arg3){
throw (new Error((((("The outerRadius (" + _arg2) + ") can't be smaller than the innerRadius (") + _arg3) + ") in your DiscZone. N.B. the outerRadius is the second argument in the constructor and the innerRadius is the third argument.")));
};
_center = _arg1;
_innerRadius = _arg3;
_outerRadius = _arg2;
_innerSq = (_innerRadius * _innerRadius);
_outerSq = (_outerRadius * _outerRadius);
}
public function set outerRadius(_arg1:Number):void{
_outerRadius = _arg1;
_outerSq = (_outerRadius * _outerRadius);
}
public function get center():Point{
return (_center);
}
public function getArea():Number{
return ((Math.PI * (_outerSq - _innerSq)));
}
public function getLocation():Point{
var _local1:Number = Math.random();
var _local2:Point = Point.polar((_innerRadius + ((1 - (_local1 * _local1)) * (_outerRadius - _innerRadius))), (Math.random() * TWOPI));
_local2.x = (_local2.x + _center.x);
_local2.y = (_local2.y + _center.y);
return (_local2);
}
public function get outerRadius():Number{
return (_outerRadius);
}
public function get innerRadius():Number{
return (_innerRadius);
}
public function set innerRadius(_arg1:Number):void{
_innerRadius = _arg1;
_innerSq = (_innerRadius * _innerRadius);
}
public function set center(_arg1:Point):void{
_center = _arg1;
}
public function contains(_arg1:Number, _arg2:Number):Boolean{
_arg1 = (_arg1 - _center.x);
_arg2 = (_arg2 - _center.y);
var _local3:Number = ((_arg1 * _arg1) + (_arg2 * _arg2));
return ((((_local3 <= _outerSq)) && ((_local3 >= _innerSq))));
}
}
}//package org.flintparticles.twoD.zones
Section 43
//Zone2D (org.flintparticles.twoD.zones.Zone2D)
package org.flintparticles.twoD.zones {
import flash.geom.*;
public interface Zone2D {
function getArea():Number;
function getLocation():Point;
function contains(_arg1:Number, _arg2:Number):Boolean;
}
}//package org.flintparticles.twoD.zones
Section 44
//advBlock1 (advBlock1)
package {
import flash.display.*;
public dynamic class advBlock1 extends MovieClip {
}
}//package
Section 45
//btnBuy (btnBuy)
package {
import flash.events.*;
import flash.display.*;
public class btnBuy extends SimpleButton {
public function btnBuy(){
addEventListener(MouseEvent.CLICK, onClick);
}
public function onClick(_arg1:MouseEvent):void{
Main.Application.soundControl.Play(1, 1, false);
Main.Application.openNextPicture();
this.visible = false;
}
}
}//package
Section 46
//btnMenu (btnMenu)
package {
import flash.events.*;
import flash.display.*;
public class btnMenu extends SimpleButton {
public function btnMenu(){
addEventListener(MouseEvent.CLICK, onClick);
}
public function onClick(_arg1:MouseEvent):void{
Main.Application.soundControl.Play(0, 1, false);
Main.Application.MMenu = new MainMenu();
Preloader.Application.addChild(Main.Application.MMenu);
}
}
}//package
Section 47
//btnMoreGames (btnMoreGames)
package {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public class btnMoreGames extends SimpleButton {
public function btnMoreGames(){
super();
useHandCursor = true;
addEventListener(MouseEvent.CLICK, function (_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://tds.mutanky.com/?gameid=ekeeper_sexy_fortune&version=1&action=more-games"), "_blank");
});
}
}
}//package
Section 48
//btnMoreGirls (btnMoreGirls)
package {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public class btnMoreGirls extends SimpleButton {
public function btnMoreGirls(){
super();
useHandCursor = true;
addEventListener(MouseEvent.CLICK, function (_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://tds.mutanky.com/?gameid=ekeeper_sexy_fortune&version=1&action=more-girls"), "_blank");
});
}
}
}//package
Section 49
//btnMoreGirlsGame (btnMoreGirlsGame)
package {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public class btnMoreGirlsGame extends SimpleButton {
public function btnMoreGirlsGame(){
super();
useHandCursor = true;
addEventListener(MouseEvent.CLICK, function (_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://tds.mutanky.com/?gameid=ekeeper_sexy_fortune&version=1&action=more-girls-2"), "_blank");
});
}
}
}//package
Section 50
//btnPlay1 (btnPlay1)
package {
import flash.events.*;
import flash.display.*;
public class btnPlay1 extends SimpleButton {
public function btnPlay1(){
addEventListener(MouseEvent.CLICK, onClick);
}
public function onClick(_arg1:MouseEvent):void{
Main.Application.current_girl = 1;
Main.Application.soundControl.Play(0, 1, false);
Main.Application.MMenu.visible = false;
if (Main.Application.game_init == false){
Main.Application.Init();
} else {
Main.Application.Restart();
};
}
}
}//package
Section 51
//btnPlay2 (btnPlay2)
package {
import flash.events.*;
import flash.display.*;
public class btnPlay2 extends SimpleButton {
public function btnPlay2(){
addEventListener(MouseEvent.CLICK, onClick);
}
public function onClick(_arg1:MouseEvent):void{
Main.Application.current_girl = 2;
Main.Application.soundControl.Play(0, 1, false);
Main.Application.MMenu.visible = false;
if (Main.Application.game_init == false){
Main.Application.Init();
} else {
Main.Application.Restart();
};
}
}
}//package
Section 52
//btnPlay3 (btnPlay3)
package {
import flash.events.*;
import flash.display.*;
public class btnPlay3 extends SimpleButton {
public function btnPlay3(){
addEventListener(MouseEvent.CLICK, onClick);
}
public function onClick(_arg1:MouseEvent):void{
Main.Application.current_girl = 3;
Main.Application.soundControl.Play(0, 1, false);
Main.Application.MMenu.visible = false;
if (Main.Application.game_init == false){
Main.Application.Init();
} else {
Main.Application.Restart();
};
}
}
}//package
Section 53
//btnSelect (btnSelect)
package {
import flash.events.*;
import flash.display.*;
public class btnSelect extends SimpleButton {
public function btnSelect(){
addEventListener(MouseEvent.CLICK, onClick);
}
public function onClick(_arg1:MouseEvent):void{
Main.Application.soundControl.Play(0, 1, false);
Main.Application.MMenu.visible = true;
}
}
}//package
Section 54
//btnSF (btnSF)
package {
import flash.display.*;
public dynamic class btnSF extends MovieClip {
}
}//package
Section 55
//btnStart (btnStart)
package {
import flash.events.*;
import flash.display.*;
public class btnStart extends SimpleButton {
public function btnStart(){
addEventListener(MouseEvent.CLICK, onClick);
}
public function onClick(_arg1:MouseEvent):void{
Main.Application.soundControl.Play(0, 1, false);
if (Main.Application.started == false){
Main.Application.balance = (Main.Application.balance - Main.Application.bet);
Main.Application.initK();
Preloader.Application.nextPictureCost.text = (Main.Application.pcost.toString() + "$");
Preloader.Application.yourBalance.text = (Main.Application.balance.toString() + "$");
Preloader.Application.currentResult.text = "waiting...";
Main.Application.btnSfake.visible = true;
this.visible = false;
};
}
}
}//package
Section 56
//button_click (button_click)
package {
import flash.media.*;
public dynamic class button_click extends Sound {
}
}//package
Section 57
//buy_click (buy_click)
package {
import flash.media.*;
public dynamic class buy_click extends Sound {
}
}//package
Section 58
//clips1 (clips1)
package {
import flash.display.*;
public dynamic class clips1 extends MovieClip {
}
}//package
Section 59
//clips2 (clips2)
package {
import flash.display.*;
public dynamic class clips2 extends MovieClip {
}
}//package
Section 60
//clips3 (clips3)
package {
import flash.display.*;
public dynamic class clips3 extends MovieClip {
}
}//package
Section 61
//configManager (configManager)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
public class configManager extends MovieClip {
var showonload:String;// = null
var popupurl:String;// = ""
var areas:Dictionary;
public var values:Array;
var gid:String;
var ver:uint;
var areacontent:Dictionary;
var configXML:XML;
public function configManager(_arg1:String, _arg2:uint, _arg3:Stage):void{
var ioErrorHandler:Function;
var loadXML:Function;
var gameid = _arg1;
var version = _arg2;
var st = _arg3;
configXML = <config></config>
;
areas = new Dictionary(true);
areacontent = new Dictionary(true);
values = [];
super();
ioErrorHandler = function (_arg1:Event):void{
trace("config fail");
};
loadXML = function (_arg1:Event):void{
var k:uint;
var tmpfn:Function;
var e = _arg1;
configXML = new XML(e.target.data);
var i:uint;
while (i < configXML.stages.stage.length()) {
k = 0;
while (k < configXML.stages.stage[i].banners.banner.length()) {
if (configXML.stages.stage[i].banners.banner[k].@autoload == "true"){
trace(((("get content " + configXML.stages.stage[i].@name) + " loc:") + configXML.stages.stage[i].banners.banner[k].@location));
getContent(configXML.stages.stage[i].@name, k, configXML.stages.stage[i].banners.banner[k].@location, configXML.stages.stage[i].banners.banner[k].@x, configXML.stages.stage[i].banners.banner[k].@y, configXML.stages.stage[i].banners.banner[k].@href);
};
if (configXML.stages.stage[i].@name == "popup"){
tmpfn = function (_arg1:Event):void{
if (popupurl != ""){
navigateToURL(new URLRequest(popupurl), "_blank");
};
st.removeEventListener(MouseEvent.CLICK, tmpfn);
};
st.addEventListener(MouseEvent.CLICK, tmpfn);
popupurl = configXML.stages.stage[i].banners.banner[k].@href;
};
k = (k + 1);
};
i = (i + 1);
};
i = 0;
while (i < configXML.values.value.length()) {
if (String(configXML.values.value[i].@stagename).length > 0){
values[configXML.values.value[i].@name] = [configXML.values.value[i].@stagename, configXML.values.value[i].@text];
} else {
values[String(configXML.values.value[i].@name)] = String(configXML.values.value[i].@value);
};
i = (i + 1);
};
dispatchEvent(new Event("CONFIGLOADED"));
trace("config loaded\n\n");
};
gid = gameid;
ver = version;
var loader:URLLoader = new URLLoader();
loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, ioErrorHandler);
loader.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
loader.addEventListener(Event.COMPLETE, loadXML);
loader.load(new URLRequest(((((("http://config.mutanky.com/?gameid=" + gameid) + "&version=") + version) + "&player=") + Capabilities.version)));
}
public function addArea(_arg1:String, _arg2:MovieClip):void{
var bannerid:uint;
var i:uint;
var k:uint;
var id = _arg1;
var area = _arg2;
if (areas[id] == undefined){
areas[id] = area;
if (areacontent[id] == undefined){
areacontent[id] = [];
i = 0;
while (i < configXML.stages.stage.length()) {
if (String(configXML.stages.stage[i].@name) == id){
k = 0;
while (k < configXML.stages.stage[i].banners.banner.length()) {
getContent(configXML.stages.stage[i].@name, k, configXML.stages.stage[i].banners.banner[k].@location, configXML.stages.stage[i].banners.banner[k].@x, configXML.stages.stage[i].banners.banner[k].@y, configXML.stages.stage[i].banners.banner[k].@href);
k = (k + 1);
};
};
i = (i + 1);
};
};
};
bannerid = int((Math.random() * areacontent[id].length));
if (((((!((areacontent[id][bannerid] == null))) && (!((areacontent[id][bannerid] == undefined))))) && (!(area.contains(areacontent[id][bannerid]))))){
area.addChild(areacontent[id][bannerid]);
dispatchEvent(new Event(("LOADED_" + id)));
if (areacontent[id][bannerid].href != ""){
areacontent[id][bannerid].addEventListener(MouseEvent.CLICK, function (_arg1:Event):void{
navigateToURL(new URLRequest(areacontent[id][bannerid].href), "_blank");
});
};
} else {
showonload = id;
};
trace((("start " + id) + " area"));
}
function getContent(_arg1:String, _arg2:uint, _arg3:String, _arg4:Number, _arg5:Number, _arg6:String):void{
var loadcontent:Function;
var id = _arg1;
var arrid = _arg2;
var loc = _arg3;
var x = _arg4;
var y = _arg5;
var href = _arg6;
loadcontent = function (_arg1:Event):void{
var bannerid:uint;
var e = _arg1;
if (areacontent[id] == undefined){
areacontent[id] = [];
};
e.target.content.x = x;
e.target.content.y = y;
e.target.content.href = href;
e.target.content.gameid = gid;
e.target.content.version = ver;
areacontent[id][arrid] = e.target.content;
if (showonload == id){
bannerid = int((Math.random() * areacontent[id].length));
areas[id].addChild(areacontent[id][bannerid]);
if (areacontent[id][bannerid].href != ""){
areacontent[id][bannerid].addEventListener(MouseEvent.CLICK, function (_arg1:Event):void{
navigateToURL(new URLRequest(areacontent[id][bannerid].href), "_blank");
});
};
};
trace("content loaded");
trace(("LOADED_" + id));
dispatchEvent(new Event(("LOADED_" + id)));
};
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadcontent);
loader.load(new URLRequest(loc));
}
}
}//package
Section 62
//EmbedClip (EmbedClip)
package {
import flash.display.*;
public class EmbedClip extends MovieClip {
public function EmbedClip(){
stop();
}
}
}//package
Section 63
//fireworkExplode (fireworkExplode)
package {
import flash.media.*;
public dynamic class fireworkExplode extends Sound {
}
}//package
Section 64
//g1 (g1)
package {
import flash.media.*;
public dynamic class g1 extends Sound {
}
}//package
Section 65
//game_over (game_over)
package {
import flash.media.*;
public dynamic class game_over extends Sound {
}
}//package
Section 66
//gameTheme (gameTheme)
package {
import flash.media.*;
public dynamic class gameTheme extends Sound {
}
}//package
Section 67
//kiss (kiss)
package {
import flash.media.*;
public dynamic class kiss extends Sound {
}
}//package
Section 68
//Main (Main)
package {
import flash.geom.*;
import org.flintparticles.common.initializers.*;
import org.flintparticles.common.actions.*;
import org.flintparticles.common.counters.*;
import flash.events.*;
import flash.display.*;
import org.flintparticles.twoD.zones.*;
import flash.filters.*;
import org.flintparticles.common.energyEasing.*;
import org.flintparticles.twoD.actions.*;
import org.flintparticles.twoD.initializers.*;
import org.flintparticles.twoD.activities.*;
import org.flintparticles.twoD.emitters.*;
import org.flintparticles.common.displayObjects.*;
import org.flintparticles.twoD.renderers.*;
import flash.ui.*;
public class Main extends Sprite {
public var started:Boolean;// = false
public var pt:pointer;
public var freep:Number;// = 0
public var resultsMC:Results;
public var ring_angels:Array;
public var bet:Number;// = 25
public var aBlock1:advBlock1;
public var currentp:Number;// = 1
public var current_girl:Number;// = 1
public var it:Number;// = 0.1
public var rg:ring;
public var fireworks_emitter:Emitter2D;
public var game_init:Boolean;// = false
public var soundControl:SoundControl;
public var pic_costs:Array;
public var MMenu:MainMenu;
public var pcost:Number;
public var ring_data:Array;
public var btnSel:btnSelect;
public var balance:Number;
public var cp1:clips1;
public var balance_default:Number;// = 1000
public var cp3:clips3;
public var k:Number;// = -1
public var cp2:clips2;
public var btnB:btnBuy;
public var btnM:btnMenu;
public var touchS:touchSound;
public var emitter:Emitter2D;
public var btnS:btnStart;
public var btnSfake:btnSF;
public var end_of_game:Boolean;// = false
public var btnMGirls:btnMoreGirlsGame;
public static var Application:Main;
public function Main(){
soundControl = new SoundControl();
balance = balance_default;
ring_data = new Array(1, 30, 100, -5, -4, 20, 5, 0, 1000, -3, 0, 2, 200, 40, 0, 60, 3, -2, 500, 0, 10, 50, 0, -1);
ring_angels = new Array();
pic_costs = new Array(1500, 2500, 4000, 7000, 9500, 12000, 15000, 20000, 35000, 50000, 75000, 90000);
pcost = pic_costs[0];
super();
if (Preloader.Main_count > 0){
delete ??getglobalscope
[this];
return;
};
Preloader.Main_count++;
Application = this;
MMenu = new MainMenu();
Preloader.Application.layers[1].addChild(MMenu);
aBlock1 = new advBlock1();
MMenu.addChild(aBlock1);
Preloader.Application.config.addArea("menu", aBlock1);
var _local1:btnMoreGames = new btnMoreGames();
MMenu.addChild(_local1);
_local1.x = 10;
_local1.y = 300;
var _local2:btnMoreGirls = new btnMoreGirls();
MMenu.addChild(_local2);
_local2.x = 340;
_local2.y = 300;
addEventListener(Event.ENTER_FRAME, Update);
soundControl.AddSound(new button_click());
soundControl.AddSound(new buy_click());
soundControl.AddSound(new fireworkExplode());
soundControl.AddSound(new ruletka());
soundControl.AddSound(new tada());
soundControl.AddSound(new gameTheme());
soundControl.AddSound(new game_over());
soundControl.AddSound(new kiss());
soundControl.AddSound(new g1());
soundControl.Play(5, 0, false);
}
function reportKeyUp(_arg1:KeyboardEvent):void{
}
public function Init():void{
if (game_init == true){
return;
};
started = false;
var _local1:Number = (550 / 2);
var _local2:Number = (400 / 2);
emitter = new Emitter2D();
emitter.counter = new Steady(25);
emitter.addActivity(new RotateEmitter(7));
emitter.addInitializer(new SharedImage(new Line(3)));
emitter.addInitializer(new ColorInit(4294967040, 4294927872));
emitter.addInitializer(new Velocity(new DiscSectorZone(new Point(0, 0), 350, 200, 0, 0.2)));
emitter.addInitializer(new Lifetime(2));
emitter.addAction(new Age(Quadratic.easeIn));
emitter.addAction(new Move());
emitter.addAction(new Fade());
emitter.addAction(new Accelerate(0, 50));
emitter.addAction(new LinearDrag(0.5));
var _local3:BitmapRenderer = new BitmapRenderer(new Rectangle(0, 0, 550, 400));
_local3.addFilter(new BlurFilter(2, 2, 1));
_local3.addFilter(new ColorMatrixFilter([1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0.97, 0]));
_local3.addEmitter(emitter);
Preloader.Application.addChild(_local3);
emitter.x = _local1;
emitter.y = _local2;
ring_angels.push(new Array((360 - 7.5), 7.5));
var _local4:Number = 1;
while (_local4 < 24) {
ring_angels.push(new Array((7.5 + ((_local4 - 1) * 15)), (7.5 + (_local4 * 15))));
_local4++;
};
var _local5:ring_mask = new ring_mask();
_local5.x = _local1;
_local5.y = _local2;
cp1 = new clips1();
cp1.mask = _local5;
cp1.gotoAndStop(currentp);
_local5 = new ring_mask();
_local5.x = _local1;
_local5.y = _local2;
cp2 = new clips2();
cp2.mask = _local5;
cp2.gotoAndStop(currentp);
_local5 = new ring_mask();
_local5.x = _local1;
_local5.y = _local2;
cp3 = new clips3();
cp3.mask = _local5;
cp3.gotoAndStop(currentp);
cp1.visible = false;
cp2.visible = false;
cp3.visible = false;
switch (current_girl){
case 1:
cp1.visible = true;
break;
case 2:
cp2.visible = true;
break;
case 3:
cp3.visible = true;
break;
default:
cp1.visible = true;
break;
};
rg = new ring();
pt = new pointer();
Preloader.Application.addChild(cp1);
Preloader.Application.addChild(cp2);
Preloader.Application.addChild(cp3);
Preloader.Application.addChild(_local5);
Preloader.Application.addChild(rg);
Preloader.Application.addChild(pt);
cp1.x = _local1;
cp1.y = _local2;
cp2.x = _local1;
cp2.y = _local2;
cp3.x = _local1;
cp3.y = _local2;
rg.x = _local1;
rg.y = _local2;
pt.x = _local1;
pt.y = 0;
btnS = new btnStart();
Preloader.Application.addChild(btnS);
btnS.x = 440;
btnS.y = 330;
btnSfake = new btnSF();
Preloader.Application.addChild(btnSfake);
btnSfake.x = 440;
btnSfake.y = 330;
btnSfake.visible = false;
btnB = new btnBuy();
Preloader.Application.addChild(btnB);
btnB.x = 5;
btnB.y = 300;
btnB.visible = false;
btnM = new btnMenu();
Preloader.Application.addChild(btnM);
btnM.x = 10;
btnM.y = 350;
btnM.visible = false;
touchS = new touchSound();
Preloader.Application.addChild(touchS);
touchS.x = 5;
touchS.y = 90;
btnSel = new btnSelect();
Preloader.Application.addChild(btnSel);
btnSel.x = 5;
btnSel.y = 110;
btnMGirls = new btnMoreGirlsGame();
Preloader.Application.addChild(btnMGirls);
btnMGirls.x = 5;
btnMGirls.y = 130;
resultsMC = new Results();
Preloader.Application.addChild(resultsMC);
resultsMC.x = _local1;
resultsMC.y = _local2;
resultsMC.gotoAndStop(1);
resultsMC.visible = false;
fireworks_emitter = new Emitter2D();
fireworks_emitter.counter = new Blast(75);
fireworks_emitter.addInitializer(new SharedImage(new Dot(2)));
fireworks_emitter.addInitializer(new ColorInit(4294967040, 4294927872));
fireworks_emitter.addInitializer(new Velocity(new DiscZone(new Point(0, 0), 400, 120)));
fireworks_emitter.addInitializer(new Lifetime(5));
fireworks_emitter.addAction(new Age(Quadratic.easeIn));
fireworks_emitter.addAction(new Move());
fireworks_emitter.addAction(new Fade());
fireworks_emitter.addAction(new Accelerate(0, 0));
fireworks_emitter.addAction(new LinearDrag(0.5));
_local3 = new BitmapRenderer(new Rectangle(0, 0, 550, 400));
_local3.addFilter(new BlurFilter(2, 2, 1));
_local3.addFilter(new ColorMatrixFilter([1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0.95, 0]));
_local3.addEmitter(fireworks_emitter);
Preloader.Application.addChild(_local3);
fireworks_emitter.x = _local1;
fireworks_emitter.y = _local2;
Preloader.Application.defaultBet.text = (bet.toString() + "$");
Preloader.Application.nextPictureCost.text = (pcost.toString() + "$");
Preloader.Application.yourBalance.text = (balance.toString() + "$");
Preloader.Application.currentPic.text = (currentp + "/");
if (cp1.visible == true){
Preloader.Application.currentPic.appendText(cp1.totalFrames.toString());
} else {
if (cp2.visible == true){
Preloader.Application.currentPic.appendText(cp2.totalFrames.toString());
} else {
if (cp3.visible == true){
Preloader.Application.currentPic.appendText(cp3.totalFrames.toString());
};
};
};
Preloader.Application.currentResult.text = "waiting...";
game_init = true;
Preloader.Application.stage.addEventListener(KeyboardEvent.KEY_DOWN, reportKeyDown);
Preloader.Application.stage.addEventListener(KeyboardEvent.KEY_UP, reportKeyUp);
fireworks_emitter.start();
soundControl.Play(2, 1, false);
}
public function initK(_arg1:Boolean=false):void{
if (started == true){
return;
};
it = (0.05 * 2);
k = (it * Math.floor((70 + (Math.random() * 70))));
started = true;
emitter.start();
soundControl.Play(3, 1, false);
if (_arg1 == false){
resultsMC.visible = false;
};
}
public function reportKeyDown(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.SPACE){
if (started == false){
if (balance >= bet){
soundControl.Play(0, 1, false);
balance = (balance - bet);
initK();
Preloader.Application.nextPictureCost.text = (pcost.toString() + "$");
Preloader.Application.yourBalance.text = (balance.toString() + "$");
Preloader.Application.currentResult.text = "waiting...";
btnSfake.visible = true;
btnS.visible = false;
};
};
};
if (_arg1.keyCode == Keyboard.ENTER){
if (btnB.visible == true){
soundControl.Play(1, 1, false);
openNextPicture();
btnB.visible = false;
};
};
}
public function openNextPicture(_arg1:Boolean=false):void{
fireworks_emitter.start();
soundControl.Play(2, 1, false);
if (_arg1 == false){
resultsMC.visible = false;
balance = (balance - pcost);
if ((((((((cp1.visible == true)) && ((currentp < cp1.totalFrames)))) || ((((cp2.visible == true)) && ((currentp < cp2.totalFrames)))))) || ((((cp3.visible == true)) && ((currentp < cp3.totalFrames)))))){
pcost = pic_costs[(currentp - freep)];
};
};
currentp++;
Preloader.Application.currentPic.text = (currentp + "/");
if (cp1.visible == true){
Preloader.Application.currentPic.appendText(cp1.totalFrames.toString());
cp1.gotoAndStop(currentp);
if (currentp < cp1.totalFrames){
Preloader.Application.nextPictureCost.text = (pcost.toString() + "$");
} else {
Preloader.Application.nextPictureCost.text = "";
};
} else {
if (cp2.visible == true){
Preloader.Application.currentPic.appendText(cp2.totalFrames.toString());
cp2.gotoAndStop(currentp);
if (currentp < cp2.totalFrames){
Preloader.Application.nextPictureCost.text = (pcost.toString() + "$");
} else {
Preloader.Application.nextPictureCost.text = "";
};
} else {
if (cp3.visible == true){
Preloader.Application.currentPic.appendText(cp3.totalFrames.toString());
cp3.gotoAndStop(currentp);
if (currentp < cp3.totalFrames){
Preloader.Application.nextPictureCost.text = (pcost.toString() + "$");
} else {
Preloader.Application.nextPictureCost.text = "";
};
};
};
};
Preloader.Application.yourBalance.text = (balance.toString() + "$");
if (balance < bet){
soundControl.Play(6, 1, false);
resultsMC.gotoAndStop(131);
resultsMC.visible = true;
Preloader.Application.currentResult.text = "Game Over!";
btnSfake.visible = true;
btnS.visible = false;
btnM.visible = true;
};
if ((((((((cp1.visible == true)) && ((currentp == cp1.totalFrames)))) || ((((cp2.visible == true)) && ((currentp == cp2.totalFrames)))))) || ((((cp3.visible == true)) && ((currentp == cp3.totalFrames)))))){
soundControl.Play(4, 1, false);
resultsMC.gotoAndPlay(6);
resultsMC.visible = true;
fireworks_emitter.start();
soundControl.Play(2, 1, false);
Preloader.Application.currentResult.text = "End Of Game!";
btnSfake.visible = true;
btnS.visible = false;
btnB.visible = false;
btnM.visible = true;
end_of_game = true;
};
}
private function Update(_arg1:Event):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
if (MMenu.visible == true){
return;
};
if (k > -1){
if (cp1.visible == true){
btnB.visible = ((((balance >= pcost)) && ((currentp < cp1.totalFrames)))) ? true : false;
};
if (cp2.visible == true){
btnB.visible = ((((balance >= pcost)) && ((currentp < cp2.totalFrames)))) ? true : false;
};
if (cp3.visible == true){
btnB.visible = ((((balance >= pcost)) && ((currentp < cp3.totalFrames)))) ? true : false;
};
if (k > 0){
rg.rotation = (rg.rotation + k);
k = (k - it);
};
if ((((((k <= 0)) && ((started == true)))) && ((end_of_game == false)))){
btnS.visible = true;
btnSfake.visible = false;
started = false;
emitter.stop();
_local2 = -10;
_local3 = Math.round(rg.rotation);
if (_local3 < 0){
while (_local3 < 0) {
_local3 = (_local3 + 360);
};
};
if ((((((((_local3 > 0)) && ((_local3 <= ring_angels[0][1])))) || ((((_local3 > ring_angels[0][0])) && ((_local3 <= 360)))))) || ((_local3 == 0)))){
_local2 = ring_data[0];
} else {
_local4 = 1;
while (_local4 < 24) {
if ((((_local3 > ring_angels[_local4][0])) && ((_local3 <= ring_angels[_local4][1])))){
_local2 = ring_data[_local4];
break;
};
_local4++;
};
};
if (_local2 >= 0){
if (_local2 == 0){
soundControl.Play(6, 1, false);
};
if (_local2 >= bet){
fireworks_emitter.start();
soundControl.Play(2, 1, false);
};
balance = (balance + _local2);
Preloader.Application.yourBalance.text = (balance.toString() + "$");
Preloader.Application.currentResult.text = (("+" + _local2.toString()) + "$");
} else {
if (_local2 == -1){
resultsMC.gotoAndStop(Math.abs(_local2));
resultsMC.visible = true;
fireworks_emitter.start();
soundControl.Play(2, 1, false);
initK(true);
Preloader.Application.currentResult.text = "Free Move";
} else {
if (_local2 == -2){
soundControl.Play(8, 1, false);
freep++;
resultsMC.gotoAndStop(Math.abs(_local2));
resultsMC.visible = true;
fireworks_emitter.start();
soundControl.Play(2, 1, false);
openNextPicture(true);
Preloader.Application.currentResult.text = "Free Picture!";
} else {
if (_local2 == -3){
soundControl.Play(7, 1, false);
_local2 = (5000 + (250 * currentp));
balance = (balance + _local2);
Preloader.Application.yourBalance.text = (balance.toString() + "$");
Preloader.Application.currentResult.text = (("+" + _local2) + "$ !!!");
resultsMC.gotoAndStop(3);
resultsMC.visible = true;
fireworks_emitter.start();
soundControl.Play(2, 1, false);
} else {
if (_local2 == -4){
resultsMC.gotoAndStop(Math.abs(_local2));
resultsMC.visible = true;
fireworks_emitter.start();
soundControl.Play(2, 1, false);
balance = (balance * 10);
Preloader.Application.yourBalance.text = (balance.toString() + "$");
Preloader.Application.currentResult.text = "Money Boost!";
} else {
if (_local2 == -5){
soundControl.Play(6, 1, false);
balance = Math.floor((balance / 2));
Preloader.Application.yourBalance.text = (balance.toString() + "$");
if (balance < bet){
resultsMC.gotoAndStop(131);
resultsMC.visible = true;
Preloader.Application.currentResult.text = "Game Over!";
btnSfake.visible = true;
btnS.visible = false;
btnM.visible = true;
} else {
resultsMC.gotoAndStop(132);
Preloader.Application.currentResult.text = "Half Cut...";
};
resultsMC.visible = true;
};
};
};
};
};
};
if ((((((((cp1.visible == true)) && ((currentp < cp1.totalFrames)))) || ((((cp2.visible == true)) && ((currentp < cp2.totalFrames)))))) || ((((cp3.visible == true)) && ((currentp < cp3.totalFrames)))))){
if (balance >= pcost){
btnB.visible = true;
};
};
if ((((((((balance < bet)) && (!((_local2 == -1))))) && (!((_local2 == -2))))) && (!((_local2 == -5))))){
soundControl.Play(6, 1, false);
resultsMC.gotoAndStop(131);
resultsMC.visible = true;
Preloader.Application.currentResult.text = "Game Over!";
btnSfake.visible = true;
btnS.visible = false;
btnM.visible = true;
};
};
};
}
public function Restart():void{
fireworks_emitter.start();
soundControl.Play(2, 1, false);
balance = balance_default;
currentp = 1;
freep = 0;
pcost = pic_costs[0];
cp1.gotoAndStop(currentp);
cp2.gotoAndStop(currentp);
cp3.gotoAndStop(currentp);
cp1.visible = false;
cp2.visible = false;
cp3.visible = false;
switch (current_girl){
case 1:
cp1.visible = true;
break;
case 2:
cp2.visible = true;
break;
case 3:
cp3.visible = true;
break;
default:
cp1.visible = true;
break;
};
btnM.visible = false;
btnSfake.visible = false;
btnS.visible = true;
resultsMC.visible = false;
end_of_game = false;
started = false;
k = 0;
rg.rotation = 0;
Preloader.Application.nextPictureCost.text = (pcost.toString() + "$");
Preloader.Application.yourBalance.text = (balance.toString() + "$");
Preloader.Application.currentPic.text = (currentp + "/");
if (cp1.visible == true){
Preloader.Application.currentPic.appendText(cp1.totalFrames.toString());
} else {
if (cp2.visible == true){
Preloader.Application.currentPic.appendText(cp2.totalFrames.toString());
} else {
if (cp3.visible == true){
Preloader.Application.currentPic.appendText(cp3.totalFrames.toString());
};
};
};
Preloader.Application.currentResult.text = "waiting...";
}
}
}//package
Section 69
//MainMenu (MainMenu)
package {
import flash.display.*;
public dynamic class MainMenu extends MovieClip {
}
}//package
Section 70
//pointer (pointer)
package {
import flash.display.*;
public dynamic class pointer extends MovieClip {
}
}//package
Section 71
//Preloader (Preloader)
package {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.system.*;
public class Preloader extends MovieClip {
public var config:configManager;
public var ProgressBar:MovieClip;
public var layers:Array;
public var gameid:String;// = "ekeeper_sexy_fortune"
public var defaultBet:TextField;
public var currentPic:TextField;
public var version:uint;// = 1
private var progressBar:Sprite;
public var yourBalance:TextField;
public var config_loaded:Boolean;// = false
public var currentResult:TextField;
public var nextPictureCost:TextField;
public static const ENTRY_FRAME:Number = 3;
public static const DOCUMENT_CLASS:String = "Main";
public static var Main_count:Number = 0;
public static var Application:Preloader;
public function Preloader(){
layers = new Array(2);
addFrameScript(2, frame3);
super();
stop();
Application = this;
layers[0] = new Sprite();
stage.addChild(layers[0]);
layers[1] = new Sprite();
stage.addChild(layers[1]);
config = new configManager(gameid, version, stage);
config.addEventListener("CONFIGLOADED", cfgLoaded);
Security.allowDomain("*");
stage.showDefaultContextMenu = false;
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
progressBar = (getChildByName("ProgressBar") as Sprite);
progressBar.scaleX = 0;
loaderInfo.addEventListener(ProgressEvent.PROGRESS, progressHandler);
loaderInfo.addEventListener(Event.COMPLETE, completeHandler);
}
private function enterFrameHandler(_arg1:Event):void{
if ((((currentFrame >= Preloader.ENTRY_FRAME)) && ((config_loaded == true)))){
removeEventListener(Event.ENTER_FRAME, enterFrameHandler);
stop();
main();
};
}
private function progressHandler(_arg1:ProgressEvent):void{
var _local2:uint = _arg1.bytesLoaded;
var _local3:uint = _arg1.bytesTotal;
progressBar.scaleX = (_local2 / _local3);
}
public function cfgLoaded(_arg1:Event):void{
config_loaded = true;
}
function frame3(){
stop();
}
private function main():void{
if (Preloader.Main_count > 0){
return;
};
var _local1:Class = (loaderInfo.applicationDomain.getDefinition(Preloader.DOCUMENT_CLASS) as Class);
var _local2:Sprite = (new (_local1) as Sprite);
_local2.name = "Main";
layers[0].addChild(_local2);
}
private function completeHandler(_arg1:Event):void{
play();
addEventListener(Event.ENTER_FRAME, enterFrameHandler);
}
}
}//package
Section 72
//Results (Results)
package {
import flash.display.*;
public dynamic class Results extends MovieClip {
public function Results(){
addFrameScript(129, frame130);
}
function frame130(){
stop();
}
}
}//package
Section 73
//ring (ring)
package {
import flash.display.*;
public dynamic class ring extends MovieClip {
}
}//package
Section 74
//ring_mask (ring_mask)
package {
import flash.display.*;
public dynamic class ring_mask extends MovieClip {
}
}//package
Section 75
//ruletka (ruletka)
package {
import flash.media.*;
public dynamic class ruletka extends Sound {
}
}//package
Section 76
//SoundControl (SoundControl)
package {
import flash.events.*;
import flash.display.*;
import flash.media.*;
public class SoundControl extends Sprite {
private var sndTransform:Array;
private var sndNum:int;// = 0
private var channel:Array;
private var sound:Array;
private var globalSwitch:Boolean;// = true
private var loopPlay:Array;
private var sndSwitch:Array;
public function SoundControl(){
sound = new Array();
channel = new Array();
sndTransform = new Array();
sndSwitch = new Array();
loopPlay = new Array();
super();
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
public function Stop(_arg1:int):void{
sndSwitch[_arg1] = false;
}
public function Play(_arg1:int, _arg2:int, _arg3:Boolean=false):void{
sndSwitch[_arg1] = true;
if (!loopPlay[_arg1]){
if (_arg2 == 0){
loopPlay[_arg1] = true;
};
if (((!(globalSwitch)) || (_arg3))){
sndTransform[_arg1].volume = 0;
};
channel[_arg1] = sound[_arg1].play(0, ((_arg2)>0) ? _arg2 : 999999, sndTransform[_arg1]);
};
}
public function AddSound(_arg1:Object):void{
sound[sndNum] = _arg1;
channel[sndNum] = new SoundChannel();
sndTransform[sndNum] = new SoundTransform();
sndSwitch[sndNum] = true;
loopPlay[sndNum] = false;
sndNum++;
}
private function onEnterFrame(_arg1:Event):void{
var _local2:int;
while (_local2 < sndNum) {
if (((((!(globalSwitch)) || (!(sndSwitch[_local2])))) && ((sndTransform[_local2].volume > 0)))){
sndTransform[_local2].volume = (sndTransform[_local2].volume - 0.05);
channel[_local2].soundTransform = sndTransform[_local2];
if (sndTransform[_local2].volume <= 0.07){
sndTransform[_local2].volume = 0;
channel[_local2].soundTransform = sndTransform[_local2];
};
} else {
if (((((globalSwitch) && (sndSwitch[_local2]))) && ((sndTransform[_local2].volume < 1)))){
sndTransform[_local2].volume = (sndTransform[_local2].volume + 0.05);
channel[_local2].soundTransform = sndTransform[_local2];
if (sndTransform[_local2].volume >= 0.93){
sndTransform[_local2].volume = 1;
channel[_local2].soundTransform = sndTransform[_local2];
};
};
};
_local2++;
};
}
public function TouchSound():void{
if (sndNum == 0){
return;
};
globalSwitch = !(globalSwitch);
if (globalSwitch){
sndTransform[0].volume = 1;
channel[0].soundTransform = sndTransform[0];
};
}
}
}//package
Section 77
//tada (tada)
package {
import flash.media.*;
public dynamic class tada extends Sound {
}
}//package
Section 78
//thumb1 (thumb1)
package {
import flash.events.*;
import flash.display.*;
public class thumb1 extends MovieClip {
public function thumb1(){
useHandCursor = true;
buttonMode = true;
addEventListener(MouseEvent.CLICK, onClick);
}
public function onClick(_arg1:MouseEvent):void{
Main.Application.current_girl = 1;
Main.Application.soundControl.Play(0, 1, false);
Main.Application.MMenu.visible = false;
if (Main.Application.game_init == false){
Main.Application.Init();
} else {
Main.Application.Restart();
};
}
}
}//package
Section 79
//thumb2 (thumb2)
package {
import flash.events.*;
import flash.display.*;
public class thumb2 extends MovieClip {
public function thumb2(){
useHandCursor = true;
buttonMode = true;
addEventListener(MouseEvent.CLICK, onClick);
}
public function onClick(_arg1:MouseEvent):void{
Main.Application.current_girl = 2;
Main.Application.soundControl.Play(0, 1, false);
Main.Application.MMenu.visible = false;
if (Main.Application.game_init == false){
Main.Application.Init();
} else {
Main.Application.Restart();
};
}
}
}//package
Section 80
//thumb3 (thumb3)
package {
import flash.events.*;
import flash.display.*;
public class thumb3 extends MovieClip {
public function thumb3(){
useHandCursor = true;
buttonMode = true;
addEventListener(MouseEvent.CLICK, onClick);
}
public function onClick(_arg1:MouseEvent):void{
Main.Application.current_girl = 3;
Main.Application.soundControl.Play(0, 1, false);
Main.Application.MMenu.visible = false;
if (Main.Application.game_init == false){
Main.Application.Init();
} else {
Main.Application.Restart();
};
}
}
}//package
Section 81
//touchSound (touchSound)
package {
import flash.events.*;
import flash.display.*;
public class touchSound extends SimpleButton {
public function touchSound(){
addEventListener(MouseEvent.CLICK, onClick);
}
public function onClick(_arg1:MouseEvent):void{
Main.Application.soundControl.TouchSound();
}
}
}//package