Skip to content
This repository has been archived by the owner on Sep 18, 2018. It is now read-only.

Commit

Permalink
added MetaController
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewfitz committed Jun 28, 2009
1 parent 4bffb67 commit 45dcc83
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 5 deletions.
9 changes: 8 additions & 1 deletion changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@ Desuade Library Changelog
Beta 2:

Motion:
-added hexProperty to BasicColorTween/ColorTween to allow for non-DisplayObject color tweening
-rewrote controllers
-major syntax change
-ValueController now MotionController
-PointsContainer now KeyframeContainer
-Points are now Keyframes
-PhysicsValueController now MetaController
-uses Keyframes instead of points (same concept, just more intuitive)
-added property to BasicColorTween/ColorTween to allow for non-DisplayObject color tweening
-added debug codes for BasicPhysics

Partigen: none
Expand Down
4 changes: 2 additions & 2 deletions com/desuade/motion/Motion.as
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ package com.desuade.motion {
/**
* The numeric version of the package. Used for version comparisions.
*/
public static const VERSION:Number = 1.002;
public static const VERSION:Number = 1.003;

/**
* The "official" release version.
*/
public static const VERSIONLABEL:String = '1.0 Beta';
public static const VERSIONLABEL:String = '1.0 Beta 2';

/**
* Company that owns the source code
Expand Down
82 changes: 82 additions & 0 deletions com/desuade/motion/controllers/MetaController.as
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
package com.desuade.motion.controllers {

public dynamic class MetaController extends Object {

protected var _target:Object;
protected var _properties:Array;
protected var _duration:Object;

public function MetaController($target:Object, $properties:Array, $duration:Number, $containerclass:Class = null) {
super();
_target = $target;
_properties = $properties;
_duration = $duration;
for (var i:int = 0; i < $properties.length; i++) {
this[$properties[i]] = new MotionController($target, $properties[i], $duration, $containerclass);
}
}

public function get target():Object{
return _target;
}
public function set target($value:Object):void {
_target = $value;
}

public function get properties():Array{
return _properties;
}

public function get duration():Number{
return _duration;
}
public function set duration($value:Number):void {
_duration = $value;
}

public function get active():Boolean{
for (var p:String in this) {
if(this[p].active) return true
}
return false;
}

public function addController($property:String, $containerclass:Class = null):void {
_properties.push($property);
this[$property] = new MotionController(_target, $property, _duration, $containerclass);
}

public function addKeyframes($position:Number, $keyframes:Object):void {
for (var i:int = 0; i < _properties.length; i++) {
var found:Boolean = false;
for (var p:String in $keyframes) {
var kp:Object = $keyframes[p];
if(p == _properties[i]){
this[p].keyframes.add(new Keyframe($position, kp.value, kp.ease, kp.spread, kp.extras));
delete $keyframes[p];
found = true;
continue;
}
}
if(!found){
_properties[i].keyframes.add(new Keyframe($position, null));
}
}
}

public function start():void {
for (var p:String in this){
this[p].start();
}
}

public function stop():void {
for (var p:String in this){
this[p].stop();
}
}

}

}

4 changes: 2 additions & 2 deletions com/desuade/partigen/Partigen.as
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ package com.desuade.partigen {
/**
* The numeric version of the package. Used for version comparisions.
*/
public static const VERSION:Number = 2.001;
public static const VERSION:Number = 2.002;

/**
* The "official" release version.
*/
public static const VERSIONLABEL:String = '2.0 Beta';
public static const VERSIONLABEL:String = '2.0 Beta 2';

/**
* Company that owns the source code
Expand Down

0 comments on commit 45dcc83

Please sign in to comment.