Razorberry’s Adobe Flash Blog

August 17th, 2008

AIR in Action - Now in stores!

Posted by Ash in General
General

AIR in Action cover

I’m super-pleased to say that Adobe AIR in Action is now available in all good bookstores (those that don’t have it aren’t good bookstores.. I’m looking at you, Boston Prudential Center’s Barnes & Noble).

I had a fantastic time contributing my chapters for this book, and even though I may be biased, I think it is a great guide for learning all the features of AIR, and how to apply them in real applications.

I have to say big thanks to everyone who provided their input, including the reviewers. Also high-fives to the other authors, Joey, Sam and Kathryn. I really hope to get the chance to work with them again.

Anyway, click this link (UK) for the amazon page. Or you can buy the newfangled ebook from Manning.

Click here for the table of contents.

June 6th, 2008

Tiny audio streamer

Posted by Ash in General
General

I found this javascript-controlled audio streamer I made a while ago. It weighs in at a massive 1.2k and is very basic. Maybe you could make it a personal challenge to make it smaller!

Download the swf here. (right click & save).

Source (AS2):
Main.as
MiniStreamer.as

How to use:
Basically you need to embed the swf at whatever size you would like the progress bar to be.
Then play or stop an mp3 using javascript calls playAudio(url); and stopAudio();.

HTML:


<script language=“javascript”>
function thisMovie(movieName) {
    if (navigator.appName.indexOf("Microsoft") != -1) {
        return window[movieName];
    } else {
        return document[movieName];
    }
}
function playAudio() {
  // ‘AudioStreamer’ is the id of the embedded swf
  thisMovie(’AudioStreamer’).playAudio(’test.mp3′);
}
function stopAudio() {
  thisMovie(’AudioStreamer’).stopAudio();
}
</script>
June 5th, 2008

Messing around with papervision again

Posted by Ash in Actionscript
Actionscript

Nothing too spectacular, but I threw together a new pointless animation for my front page.

See it here.

One day I will have enough varied content to warrant a menu or something.

Here is the source, for learning purposes. It won’t compile without a couple of files, but you can get the idea :)

April 22nd, 2008

Razor Component Trac now up and running

Posted by Ash in Hot
Hot

After a week of inserting asdoc comments, I uploaded the source to the Razor Component Framework to my public svn. The components also have a new project page, at:

http://www.razorberry.com/components/

The ticket system is open to submission as long as it doesn’t get spammed, and I will also be adding more documentation and examples on the wiki over the coming weeks.

I’m always open to constructive criticism, so please feel free to email me (razor (at) razorberry.com) with your thoughts, just as long as your thoughts amount to more than “These suck!”. But please also keep in mind that this is beta software, and I’m providing no warranties or guarantees of any kind :).

As I mentioned in my last post. I still need to backport some features before releasing the as2 source, but the as3 source is all there.

Have fun!

April 8th, 2008

Announcing the Razor Component Framework

Posted by Ash in General
General

Razor component framework

I’ve posted about the components I’ve been working on as a side project for a long while now. Finally, I’m just about ready to release them to the public in a beta state.

The Razor Component Framework is intended to be a lightweight, yet feature-rich alternative to the mx framework for Flash, Flex and AIR. It comes in both ActionScript 2 and 3 flavours while maintaining as consistent an API as possible.
(more…)

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.

December 1st, 2007

Not a good advertisement for Flash

Posted by Ash in Discussion
Discussion

Flash crashes in Times Square.

November 2nd, 2007

Converting html entities in AS3

Posted by Ash in Actionscript
Actionscript

I’m posting this here mainly because I always have to look it up. But maybe this post will help someone down the road.

Converting a string with html entities (such as &amp;) to their respective symbols:

AS:


public function htmlUnescape(str:String):String
{
    return new XMLDocument(str).firstChild.nodeValue;
}

Converting a string so that it has html entities:

AS:


public function htmlEscape(str:String):String
{
    return XML( new XMLNode( XMLNodeType.TEXT_NODE, str ) ).toXMLString();
}
AS:


trace(htmlEscape(“ham & eggs”))// ham &amp; eggs
trace(htmlUnescape(“ham &amp; eggs”))// ham & eggs
Next Page »
Macromedia XML News Aggregator