Flash as3.0 Colorful Bubbles!

Source: Internet
Author: User

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!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.