setBackground(0,0,0); $w = 800; $h = 800; $movie->setDimension($w, $h); include("../functions/mytrace.php"); $c_size=1; $s2 = drawCircle($c_size, 0, 0, 1, 255,255,255); $s = drawCircle($c_size, 0, 0, 1, 145,133,180); $a = new SWFSprite(); $a -> add($s); $a -> nextframe(); $movie->addExport($a, 'sq'); $a2 = new SWFSprite(); $a2 -> add($s2); $a2 -> nextframe(); $movie->addExport($a2, 'sq_alt'); $movie->add(new SWFAction(" // 'special' funcs for extra madness MovieClip.prototype.inc_x=function(){ this.x++; }; MovieClip.prototype.dec_x=function(){ this.x--; }; MovieClip.prototype.inc_y=function(){ this.y++; }; MovieClip.prototype.dec_y=function(){ this.y--; }; // function that handles the motion of the sq[i] objects. // this is set as the onenterframe for all of them in the initClip. MovieClip.prototype.movement = function(){ _root.thecount=Math.floor(this.depth/num); // if we havent reached the goal num of circles... if(_root.thecount < _root.count){ // move the circle this._x = this.x + Math.sin(this.angle) * (this.length*5); this._y = this.y + Math.cos(this.angle) * (this.length*5); // call its special function, set in initclip this.funcr(); // set the newname for the addmore function var newname = this._name+'_'+this.depth; this.addmore(newname); // increment the depth, length and angle and check if we're done. this.depth+=num; this.length+=this.length_inc; this.angle+=this.angle_inc; _root.log = _root.thecount; } else { _root.restart = true; _root.log = 'finito'; } }; // this function adds another instance of the sq clip to the movie // and sets its parent MovieClip.prototype.addmore = function(no){ //w stands for whichone - allows for different colored circles if(this.w == 0) _root.attachMovie('sq', no, this.depth); else _root.attachMovie('sq_alt', no, this.depth); _root[no]._x = this._x; _root[no]._y = this._y; }; // initialization function MovieClip.prototype.initClip = function(x,y,l,a,ai,li,oef,w,f){ this.x = x; this.y = y; this.length = l; this.angle = a; this.angleinit = a; this.onenterframe = oef; this.depth = _root.start; this.initdepth = _root.start; _root.start++; this.angle_inc = ai; this.length_inc = li; this.w = w; this.funcr = f; }; movers = 12; num = movers; count = 200; a = 4; l = 0.2; for(i=1;i<=movers; i++){ _root.attachMovie('sq', 'sq'+i, i); } _root.start = i+1; // (x,y,l,a,d,ai,li,oef,w) sq1.initClip(Stage.width/2,Stage.height/2, 0, 0, -a, -l, movement,0); sq2.initClip(Stage.width/2,Stage.height/2, 0, 0, -a, l, movement,0); sq3.initClip(Stage.width/2,Stage.height/2, 0, 0, a, -l, movement,0); sq4.initClip(Stage.width/2,Stage.height/2, 0, 0, a, l, movement,0); sq5.initClip(Stage.width/2,Stage.height/2, 0, 0, -a*2, -l, movement,0); sq6.initClip(Stage.width/2,Stage.height/2, 0, 0, -a*2, l, movement,0); sq7.initClip(Stage.width/2,Stage.height/2, 0, 0, a*2, -l, movement,0); sq8.initClip(Stage.width/2,Stage.height/2, 0, 0, a*2, l, movement,0); sq9.initClip(Stage.width/2,Stage.height/2, 0, 0, -a/2, -l, movement,0); sq10.initClip(Stage.width/2,Stage.height/2, 0, 0, -a/2, l, movement,0); sq11.initClip(Stage.width/2,Stage.height/2, 0, 0, a/2, -l, movement,0); sq12.initClip(Stage.width/2,Stage.height/2, 0, 0, a/2, l, movement,0); ")); $output = 0; if($output == 0){ header("Content: application/x-shockwave-flash"); $movie->output(9); } else { $name = "pattern_9"; $movie->save($name.".swf", 9); echo "
ahhhhhhhhh"; } ?>