Glowing Orb
Description: Draw an orb that glows using actionscript
Author: John Bezanis
Added: January 20th 2007
Version: Flash 8

Select the Oval tool and hold shift to draw a perfect circle on the stage.

Select the gradient Transform Tool. In the color panel, set the Type to Linear. Set the colors to #1129FF and #A3ACFE. Spin the gradient by grabbing the circle and spinning it.

Right-click the circle, select Convert to Symbol, change the name to glowingorb, and click ok. Double click the circle, which will open up the new glowingorb symbol. In the timeline, click the create new layer button. Select the circle in the lower layer and right-click copy it. Select the higher layer, and Edit->Paste in Place.

Select the Gradient Transform Tool again. Set the type to Radial. Move the left color box to around 75% and set the color to #01108F and alpha to 0%. Change the right box color to #01108F and alpha to 70%. Copy this shape, create a new layer and paste it into this new layer.

Use the Free Transform Tool to shrink this new shape a bit. In the Color panel, set the type to Radial, the left color to #FFFFFF with 100% Alpha, and the right color to #FFFFFF with 0% Alpha. Click the paint bucket tool and click the top center of the shape. Select the Gradient Transform Tool, grab the circle with the arrow, and shrink the gradient.
Return to the main scene, select the Selection Tool, and single click the Orb. In the actions box, insert the following code:
- //This code executes when the orb is first loaded
- onClipEvent (load) {
- //Import the GlowFilter class
- import flash.filters.GlowFilter;
- //This is glow color
- var color:Number = 0xEB1D99;
- //No Transparency
- var alpha:Number = 1;
- //blurX and blurY are the height and width of the glow
- var blurX:Number = 5;
- var blurY:Number = 5;
- var strength:Number = 2;
- var quality:Number = 10;
- //Glow is outer
- var inner:Boolean = false;
- //Do not cut out the object
- var knockout:Boolean = false;
- //Create an instance of the GlowFilter class named filter
- var filter:GlowFilter = new GlowFilter(color, alpha, blurX, blurY, strength, quality, inner, knockout);
- //apply the filter
- this.filters = [filter];
- //The blur size starts at 5 and is set to grow
- var blurSize:Number=5;
- var blurGrowing:Boolean=true;
- }
- //This code executed on each frame
- onClipEvent (enterFrame) {
- //If the blur is set to grow, increase its size, otherwise shrink it.
- if(blurGrowing){ blurSize+=2; }
- else { blurSize-=2; }
- if(blurSize>40){
- blurSize=40;
- //Blur is getting too big. Set it to shrinking.
- blurGrowing=(!blurGrowing);
- }else if(blurSize<5){
- blurSize=5;
- //Blur is getting too small. Set it to growing.
- blurGrowing=(!blurGrowing);
- }
- //Alter the filter to the new blur size
- filter.blurY = blurSize;
- filter.blurX = blurSize;
- //Apply the change to the blurX and blurY
- this.filters = [filter];
- }
Download Source File
Comments
I like this effect. Thanks for sharing
March 23rd 2007 03:03PM - Valle
I'm so glad I found this! Thanks for a great tutorial. I used a different set of colors and still got a great, professional result.
October 24th 2007 02:10PM - Amanda
I seem to have done something wrong, I don't get the glow effect...I might have missed something in the code, any words of advice?
June 28th 2009 05:06PM - Paul
Nice, and a good walkthrough to go with it! Cheers dude!
November 23rd 2009 10:11AM - White Label SEO
That is an awesome cube, thanks for sharing.
December 13th 2009 07:12AM - dental
Great article, thanks for the interesting reads you always seem to have.
December 28th 2009 01:12AM - Hid Conversion
The glow of the orb is very cool. Thanks for the code.
December 29th 2009 11:12PM - online sniper games
I wonder if it replaces with a glowing diamond, hope to see your similar post.
December 31st 2009 03:12AM - cheap cricket phones
Great looking orb. Lots of good stuff in this blog.
January 4th 2010 12:01AM - essay sample
Lots of good stuff in this blog.
January 4th 2010 02:01AM - Designer Wedding Dresses
The glowing orb has a hypnotic effect on me :)
January 7th 2010 08:01AM - sex chat
really cool tutorial!
January 19th 2010 07:01PM - bondage esx
you have good skills to elaborate your knowledge to others. Good work.
January 23rd 2010 02:01AM - Cotton yarn
That is some inspirational stuff. Never knew that opinions
January 24th 2010 06:01AM - evening dresses
Really a great tutorial
January 24th 2010 09:01AM - Acai Berry 1
Thanks for a great tutorial.
January 26th 2010 03:01AM - book
This tutorial is fantastic.
January 26th 2010 03:01AM - film
Special thank for good post.
February 5th 2010 09:02PM - โหลดเพลงà
Thank for the information
February 6th 2010 07:02AM - โหลดเพลงm
Special thank for good post.
February 10th 2010 04:02AM - โหลดเพลงà
Special thank for good post.
February 10th 2010 08:02AM - โหลดเพลงà
Add a Comment





