Razorberry’s Adobe Flash Blog

January 28th, 2008

AS3 Dynamic Speech Bubble Snippet

Posted by Ash in Actionscript
Actionscript

The static method drawSpeechBubble in the file below uses the drawing API to draw a rounded rectangle based speech bubble with a dynamic point. The side the point is on moves depending on the relative position to the bubble. It looks best if you set the point to be fairly close to the actual rectangle.

Usage:

AS:


SpeechBubble.drawSpeechBubble(target:Sprite, rect:Rectangle, cornerRadius:Number, point:Point)

// Example:
var g:Graphics = graphics;

var m:Matrix = new Matrix();
m.createGradientBox(200,100,90*Math.PI/180,80,80);
g.clear();
g.lineStyle(2,0×888888,1,true);
g.beginGradientFill(GradientType.LINEAR, [0xe0e0e0, 0xffffff], [1,1], [1,0xff],m);
SpeechBubble.drawSpeechBubble(this, new Rectangle(80,80,200,100), 20, new Point(120,300));
g.endFill();

Sample (move mouse to change point position):

Download:
SpeechBubble.as

Apologies for any code messiness! I’m aware that you can create a dent in the corner.. it’s probably up to you to position the point sensibly so it doesn’t screw up :)

January 26th, 2008

I am not Singularity..

Posted by Ash in Discussion
Discussion

..until I find out what it is.

But kudos to Aral for his viral marketing strategy ;)

January 24th, 2008

Announcing Adobe AIR in Action

Posted by Ash in General
General

AIR in Action cover

For a while now I’ve been spending my spare time writing about AIR for an upcoming book titled “Adobe AIR in Action” published by Manning.

I’ve had the pleasure of working with three very talented co-authors, Joey Lott, Sam Ahn, and Kathryn Rotondo. I’m psyched about the release since I think we’ve put together a very solid guide to Adobe AIR from a Flash and Flex perspective, and we’ve come up with some great examples that utilize each individual aspect of the new API.

My chapters are centered around utilizing databases in your AIR application, including some primers on SQL, and integrating HTML and JS content into your app.

The book will be released in a few months, but if you can’t wait that long, you can actually read chapters in their ‘uncut’ format in Manning’s Early Access Program. You can also pre-order the book on Amazon, here.

Click here for more information.

Macromedia XML News Aggregator