setBackground(255,155,0); $w = 800; $h = 800; $movie->setDimension($w, $h); $mytrace_height=20; include("../functions/mytrace.php"); $c_size=$_GET['circle_size']; $s2 = drawCircle($c_size, 0, 0, 1, 0,0,0); $s = drawFilledCircleAlpha($c_size, 0, 0, 1, 0,0,0,155); $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+=1; }; MovieClip.prototype.dec_x=function(){ this.x-=1; }; MovieClip.prototype.inc_y=function(){ this.y+=1; }; MovieClip.prototype.dec_y=function(){ this.y-=1; }; // 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); this._y = this.y + Math.cos(this.angle) * (this.length); // 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; var mult = (_root.thecount%4)+1; this.length+=this.length_inc; this.angle+=this.angle_inc; //this.angle_inc = Math.sin(this.angle) / (this.length*mult); //this.angle_inc = this.y*Math.tan(this.angle); //this.angle_inc = this.y; _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 = 16; num = movers; count = ".$_GET['count']."; a = ".$_GET['angle_inc']."; l = ".$_GET['length_inc']."; for(i=1;i<=movers; i++){ _root.attachMovie('sq', 'sq'+i, i); } _root.start = i+1; type=".$_GET['type']."; if(type==1){ x1 = Stage.width/4; x2 = 3*x1; y1 = Stage.height/4; y2 = 3*y1; } else { x1 = x2 = Stage.width/2; y1 = y2 = Stage.height/2; } // (x,y,l,a,ai,li,oef,w,f){ /* sq1.initClip(x1, y1, 0, 0, -a, -l, movement,0); sq2.initClip(x1,y1, 0, 0, -a, l, movement,0); sq3.initClip(x1,y1, 0, 0, a, -l, movement,0); sq4.initClip(x1,y1, 0, 0, a, l, movement,0); sq5.initClip(x2,y1, 0, 0, -a*2, -l, movement,0); sq6.initClip(x2,y1, 0, 0, -a*2, l, movement,0); sq7.initClip(x2,y1, 0, 0, a*2, -l, movement,0); sq8.initClip(x2,y1, 0, 0, a*2, l, movement,0); sq9.initClip(x1,y2, 0, 0, -a*4, -l, movement,0); sq10.initClip(x1,y2, 0, 0, -a*4, l, movement,0); sq11.initClip(x1,y2, 0, 0, a*4, -l, movement,0); sq12.initClip(x1,y2, 0, 0, a*4, l, movement,0); sq13.initClip(x2,y2, 0, 0, -a*8, -l, movement,0); sq14.initClip(x2,y2, 0, 0, -a*8, l, movement,0); sq15.initClip(x2,y2, 0, 0, a*8, -l, movement,0); sq16.initClip(x2,y2, 0, 0, a*8, l, movement,0); */ sq1.initClip(x1,y1, 0, 0, -a, -l, movement,1,inc_y); sq2.initClip(x1,y1, 0, 0, -a, l, movement,1,inc_y); sq3.initClip(x1,y1,0, 0, a, -l, movement,1,inc_x); sq4.initClip(x1,y1,0, 0, a, l, movement,1,inc_x); sq5.initClip(x2,y1,0, 0, a, l, movement,1,inc_y); sq6.initClip(x2,y1,0, 0, a, -l, movement,1,inc_y); sq7.initClip(x2,y1,0, 0, -a, l, movement,1,inc_x); sq8.initClip(x2,y1,0, 0, -a, -l, movement,1,inc_x); sq9.initClip(x1,y2,0, 0, -a, -l, movement,1,dec_x); sq10.initClip(x1,y2,0, 0, -a, l, movement,1,dec_x); sq11.initClip(x1,y2,0, 0, a, -l, movement,1,dec_y); sq12.initClip(x1,y2,0, 0, a, l, movement,1,dec_y); sq13.initClip(x2,y2,0, 0, -a, -l, movement,1,dec_y); sq14.initClip(x2,y2,0, 0, -a, l, movement,1,dec_y); sq15.initClip(x2,y2,0, 0, a, -l, movement,1,dec_x); sq16.initClip(x2,y2,0, 0, a, l, movement,1,dec_x); ")); $output = 0; if($output == 0){ header("Content: application/x-shockwave-flash"); $movie->output(9); } else { $name = "pattern_20"; $movie->save($name.".swf", 9); echo "
ahhhhhhhhh"; } ?>