Category Archives: Quick Hints

AS3: Multiline textfields and Line Metrics

Last week I had to do something that I never thought of, let me present you the case: First of all we have a multiline, word-wrapped textfield in AS3, the text is picked up from an external XML file and gets styled with a CSS stylesheet, the textfield CAN have one line or multiple lines [...]

AS3: Quickhint: Shared Objects

Last week while working on the interface for my new upcoming library I needed a way to save some data on the users computer, altough I’m working with AIR I could easily save an xml or a txt file to the users local computer, but as soon as I would start writing a pure as3 [...]

AS3: QuickHint: Convert BitmapData to ByteArray

While writing my next post, about Facebook and Flash development, I noticed that there is something in my post drafts that I haven’t published yet, so I changed it a bit and here you go. On one of my last posts taking a screenshot with AS3 I’ve explained how to create a snapshot by using [...]

AS3: Drawing dynamic anchor lines

Based on this post on the Adobe’s AS3 forum, I thought  I would create a simple class that takes care of the requested task. The whole idea is basically to draw a line dynamically between 2 displayobjects, on top of it when one object is being dragged the line is redrawn along based on the [...]

AS3: Take a screenshot of any Displayobject

Ok you want to take a snapshot of a movieclip, sprite, displayobject, shape or just simply the whole stage? That is a simple task to accomplish in AS3. Below a reusable function I wrote while working for one of our clients: private function getBitmapData( target:DisplayObject ) : BitmapData { if ( bd ) { bd [...]