blog

Flash / Flex ArchiveJozef Chúťka's blog — blog.yoz.sk/category/flash-flex/page/7/

May 6, 2010

No comments

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.

Read the rest of this entry »

May 5, 2010

393 Comments

Access Token Facebook facebook api FacebookOAuthGraph Graph API OAuth

Facebook Graph API & OAuth 2.0 & Flash (update)

Facebook permission dialog requesting access to public information, email, photos and videos.

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.

Read the rest of this entry »

May 4, 2010

No comments

alpha BlendMode Layer TextField transparency

Quick tip: Alpha On TextFields

Five lines of sample text with increasing opacity.

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.

Read the rest of this entry »

May 4, 2010

No comments

8bit alchemy Audio mod SoundObject Synthesizer

8bit Players & Synthesizers In Flash

A FlashModPlug player interface showing track information and volume controls.

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.

Read the rest of this entry »

May 4, 2010

1 Comment

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())];

Read the rest of this entry »

April 26, 2010

2 Comments

DisplayObject drag rotate scale SubjectTransformator

SubjectTransformator To Transform Any DisplayObject

Two images with transformation handles: an illustrated portrait and a landscape.

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…

Read the rest of this entry »

April 22, 2010

3 Comments

debug debug player MicroProfiler PreloadSwf profile profiler

The Ultimate Debugging And Profiling

A browser displaying the onBoard canvas with a MonsterDebugger inspection window.

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).

Read the rest of this entry »

April 19, 2010

No comments

Twitter Twitter API

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

2 Comments

columns delimiter htmlText LinkedTextFields split text TextFields

LinkedTextFields Class To Split Text Into Multiple TextFields (update)

Example text with coloured hyperlinks flowing across several boxes.

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:

Read the rest of this entry »

April 13, 2010

34 Comments

OAuth Twitter Twitter API TwitterLogger TwitterLoggerEvent TwitterOAuth TwitterProxyLoader

TwitterLogger Class To Full Twitter API Access From ActionScript 3

Twitter and Adobe Flash logos connected by circular arrows.

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.

Read the rest of this entry »

« Older Entries

Newer Entries »