blog
Flash / Flex ArchiveJozef Chúťka's blog — blog.yoz.sk/category/flash-flex/page/7/
May 6, 2010
embed Flash Flex MovieClip Sprite TypeError
Quick tip: Embedded MovieClip not MovieClip?
When embedding MovieClips (with only one frame) from Flash .swf file into your Flex projects, you can fall into runtime issues:
[Embed(source="assets/preloader.swf", symbol="preloader")]
public static const PRELOADER_CLASS:Class;
MovieClip(new Assets.PRELOADER_CLASS());TypeError: Error #1034: Type Coercion failed: cannot convert *** to flash.display.MovieClip.May 5, 2010
Access Token Facebook facebook api FacebookOAuthGraph Graph API OAuth
Facebook Graph API & OAuth 2.0 & Flash (update)

As previously mentioned, facebook released a new Graph API. It is based on OAuth 2.0 protocol (old authorization token also works). While it is fresh thing, there is no much ActionScript stuff around, so I came with FacebookOAuthGraph class. This class is meant to be used as an abstract class, while it contains just the basic authentication algorithm and call method to request data. It stores access token in SharedObject, so next time you came into app, you get connected on background without noticing (no popup etc.). Your token should expire in 24 hours.
May 4, 2010
alpha BlendMode Layer TextField transparency
Quick tip: Alpha On TextFields

When targeting your movie into flash player 9 (or lower), you can fall into issues with text transparency. If TextField contains not embedded font, by default it will not render transparency (alpha) correctly. Luckily, there is a solution for that, as simple as setting blendMode to “layer” parameter to your TextField. This solution was mentioned on Glenn Gervais blog plus there are some other techniques mentioned in comments, for example applying BlurFilter(0, 0) or cacheAsBitmap=true. Thankfully, once you start targeting Flash Player 10, you won’t need any sort of hacks.
May 4, 2010
8bit alchemy Audio mod SoundObject Synthesizer
8bit Players & Synthesizers In Flash

FlashModPlug is a flash module player created by Ralph Hauwert (UnitZeroOne). It is intended to be a future reference implementation for FlashModPlugLib, intended to be released in the near future. It is an Adobe Alchemy port of the well know LibModPlug, originally created by Olivier Lapicqu and currently maintained by Konstanty Bialkowski. Player includes well known formats such as MOD, XM, IT, S3M, and lesser know formats like Okt and 669.
May 4, 2010
AdjustColor brightness color ColorMatrixFilter contrast hue saturation
Quick tip: Contrast & Brightness In ActionScript 3
There are multiple libraries that lets you adjust contrast, brightness, hue, saturation. Lets have look at some:
fl.motion.AdjustColor class is a part of Flash CS4:
import flash.filters.ColorMatrixFilter;
import fl.motion.AdjustColor;
// AdjustColor class location:
// Adobe Flash CS4/Common/Configuration/ActionScript 3.0/projects/Flash/src/fl/motion/AdjustColor.as
var color:AdjustColor = new AdjustColor();
color.brightness = brightness;
color.contrast = contrast;
color.hue = 0;
color. saturation = 0;
image.filters = [new ColorMatrixFilter(color.CalculateFinalFlatArray())];April 26, 2010
DisplayObject drag rotate scale SubjectTransformator
SubjectTransformator To Transform Any DisplayObject

SubjectTransformator class is a simple utility class that lets you transform (rotate, scale, drag) any DisplayObject on stage. As for now, this class may be the subject of change, so please download latest version before use. You can see the demo below in the article…
April 22, 2010
debug debug player MicroProfiler PreloadSwf profile profiler
The Ultimate Debugging And Profiling

Yesterday I came across interesting articles from jpauclair. The first one is about Almighty PreloadSWF (mm.cfg attribute to define preloader for any as3 .swf file) and the second about his new Flash Visual Profiler. Long story short, you can debug and profile any ActionScript 3 compiled .swf file on the web (or local) you decide to, for example in De MonsterDebugger (open source debugger for Adobe Flash, Flex and AIR).
April 19, 2010
Quick tip: TwitterUtils.makeDate() correction
There is a bug in current version (2.0) of TwitterScript API. In com.twitter.api.utils.TwitterUtils.makeDate() function, there is a wrong month assignment on line 22. While you match date from a String, make sure to subtract 1 from month number, while ActionScript 3 Date.month is zero-based. Issue already submitted on TwitterScript code home page.
April 14, 2010
columns delimiter htmlText LinkedTextFields split text TextFields
LinkedTextFields Class To Split Text Into Multiple TextFields (update)

While watching Adobe Creative Suite 5 demonstration, I got inspired to create LinkedTextFields Class. In Flash CS5 IDE there is a new function that lets you link text fields in order to split one text into all fields based on how much fits in each (for example article columns). I tought it must be possible to do this with ActionScript 3. And it is. I created this lightweight LinkedTextFields Class that does exact the same thing as the new tool in CS5. LinkedTextFields Class lets you render plain text as well as HTML text. By default, text is splited based on white space characters, but you can define your own delimiters. Long story short, here is the proof of concept:
April 13, 2010
OAuth Twitter Twitter API TwitterLogger TwitterLoggerEvent TwitterOAuth TwitterProxyLoader
TwitterLogger Class To Full Twitter API Access From ActionScript 3

For the last couple of days I have been working with Twitter API, trying to make the api usable for flash in browser the same way as FacebookLogger (Facebook API extension) is. Guess what, I did it! I created TwitterLogger. TwitterLogger class extends official TwitterScript (ActionScript API) and implements OAuth (and TwitterOAuth – PHP Library to support OAuth for Twitter’s REST API) authorization protocol to gain full access into Twitter API from flash in browser.