Import Flash.display.Sprite; Import Org.papervision3d.core.effects.AbstractEffect; var i:int = 0; Create 60 rings using circular statements var classnamestr:string = Getqualifiedclassname (cc); while (i<60) {///Create bubble instance var _circle:sprite = new Sprite ();//Random color var colornum:uint = new UINT (MATH.POW () * 255,3)); _circle.graphics.linestyle (1,colornum); _circle.graphics.drawcircle (0,0,15); Set some properties of the bubble; Bubble size _circle.scaley = _circle.scalex = Math.random (); The position of the bubble in the scene _circle.x = Math.Round (Math.random () * (Stage.stagewidth-_circle.width)); _circle.y = Math.Round (Math.random () * (Stage.stageheight-_circle.height)); Add Scene AddChild (_circle); This field copies the movie clip//var classname:class = Getdefinitionbyname (classnamestr) as Class; var c:sprite = new ClassName () as Sprite; c.x = Math.Round (Math.random () * (Stage.stagewidth-_circle.width)); C.y = Math.Round (Math.random () * (Stage.stageheight-_circle.height)); AddChild (c); i++; }
Create the as3.0 file, press ALT and double-click the first frame to join this code!