Visual Rectangles Intersection AS3 Example

ActionScript3.0 Rectangle class is part of the flash.geom package besides Point, Matrix, Transform and ColorTransform. Any visual representation of rectangles has to be implemented by programmer. One way of doing it is to create new class and here I wanted to include rectangle color as initial parameter, so this new class vRectangle (from visual rectangle, off course) looks something like this:vRectangle.aspackage{ import flash.geom.Rectangle; import flash.display.Shape; import flash.display.Sprite; public class vRectangle { public var rect:Rectangle; public var shape:Shape; public function vRectangle(a:Number, b:Number, c:Number, d:Number, e:uint):void { this.rect = new Rectangle(a, b, c, d); this.shape = new Shape(); this.shape.graphics.beginFill(e); this.shape.graphics.lineStyle(2, 0×000000); this.shape.graphics.drawRect(rect.x,

You Might Also Like...

  • Quick Tip: How to Export Flash to PNG with HYPE

    1469 readersWith Flash you can create some awesome code generated graphics. Often you’d like to save these graphics as an image, so you can edit them afterwards with image editing software or just showcase them. We’ll use the HYPE framework from Joshua Davis and Branden Hall to save our code-generated graphics as a PNG. View Screencast Don’t like

  • Energy Bar Flash Game AS3 Tutorial

    834 readersIn some Flash games author often has a need to display energy bar for hero character or enemy character or both. In this tutorial you will learn how to create reusable energy bar which you can ..., well reuse, in all your future projects. Code is pure ActionScript 3.0. I'm trying to develop this habit

  • Using BitmapSplit function with Tweener

    584 readersFew posts ago I introduced Dynamic Bitmap Split Function. This function allows you to split any Bitmap into any (reasonable) number of column and rows and use those parts separately.Here is one quick example of using this function together with Tweener class. Click on image to see live example.and here is code:import flash.display.Bitmap;import flash.display.BitmapData;import flash.utils.ByteArray;import

  • Create a Dynamic Bar Graph Generator Using XML + AS3

    1276 readers

  • Ononmin Flash prototype – step 3

    256 readersIn this 3rd part we’ll manage stage edges and balls collisions. You’re invited to read steps 1 and 2 if you didn’t already. The main function does not change. 1 2 3 4 5 6 7 8 9 10 11 package { import flash.display.Sprite; public class onon extends Sprite { // field_mc has a parameter

  • Send Season’s Greetings With a Flash Piano Christmas Card

    899 readers

  • View Demo

    Colorful Animated Menu with AS3

    1125 readers

  • Create a Password Masking Class in ActionScript 3.0

    1745 readers

  • Create a Mac Dock Style Menu with AS3

    2031 readersIn this tutorial I’ll show you how to create a menu like Apple’s Dock using AS3 classes. We will create a single .as file that will perform all the magic, extending it to add new features. Final Result Preview First, let’s take a look at what we’ll be creating. Roll your mouse over the icons to see

  • Pyramids using AS3 drawing API

    933 readersLet's continue from where we finished last post. We have Triangle AS3.0 class up and running and we want to use it and draw some pyramids.If you look carefully you will notice that every pyramid consist of two triangles. This is actually simplified version where only two sides are visible and front side triangle has

'>How to create a top quality logo for your company
  • Remove a Section of Your Photo
  • Subscribe to RSS headline updates from: GurusUnleashed
    Powered by FeedBurner

  • Design & Career Resources

    Open design job and RFQ/RFP listings for Thursday, 29 July Courtesy of Design Jobs Live!
    The latest resources and free stuff (like textures, fonts, Photoshop brushes, scripts, plug-ins, and much more!) from workflowFreelance.com. Read more!
    The latest headlines from workflowFreelance.com. Read more!
  • Popular Search Terms

    Curious what others are searching for? Below are the most popular search terms over the last 30 days.