Skip to content

Instantly share code, notes, and snippets.

Created August 13, 2010 15:24
Show Gist options
  • Save anonymous/523042 to your computer and use it in GitHub Desktop.
Save anonymous/523042 to your computer and use it in GitHub Desktop.
package
{
import flash.display.Shape;
import flash.display.Sprite;
import flash.events.Event;
import flash.events.TimerEvent;
import flash.text.TextField;
import flash.utils.Timer;
import idv.etrex.MVO.Sequences.Decorator.Bound;
import idv.etrex.MVO.Sequences.Decorator.Offset;
import idv.etrex.MVO.Sequences.Decorator.Repeat;
import idv.etrex.MVO.Sequences.Mapping;
import idv.etrex.MVO.Sequences.Noise;
import idv.etrex.MVO.Sequences.Polynomial;
import idv.etrex.MVO.Sequences.Sequence;
import idv.etrex.MVO.SuperArray;
/**
* ...
* @author etrex
*/
public class Main extends Sprite
{
public function Main():void
{
var n:int = 30;
var m:int = 5;
var noise:Sequence = new Noise(5);
var o1:Sequence = new Offset(1);
var xs:Sequence = o1.bound(m);
var ys:Sequence = o1.repeat(m);
var spa:SuperArray = new SuperArray();
spa.length = n;
spa.setSequence(o1);
spa.select(getText);
spa.attr("x").setSequence(xs.multiplyN(120).add(noise));
spa.attr("y").setSequence(ys.multiplyN(50).add(noise));
trace(xs.toArray(n));
// 1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5
trace(ys.toArray(n));
// 1,1,1,1,1,2,2,2,2,2,3,3,3,3,3,4,4,4,4,4,5,5,5,5,5,6,6,6,6,6
trace(xs.multiplyN(120).toArray(n));
// 120,240,360,480,600,120,240,360,480,600,120,240,360,480,600,120,240,360,480,600,120,240,360,480,600,120,240,360,480,600
trace(ys.multiplyN(50).toArray(n));
// 50,50,50,50,50,100,100,100,100,100,150,150,150,150,150,200,200,200,200,200,250,250,250,250,250,300,300,300,300,300
}
public function getCircle(i:Number):Shape {
var s:Shape = new Shape();
s.graphics.beginFill(0x000000);
s.graphics.drawCircle(0, 0, 5);
s.graphics.endFill();
this.addChild(s);
return s;
}
public function getText(i:Number):TextField {
var t:TextField = new TextField();
t.text = i.toString();
this.addChild(t);
return t;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment