blog

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

June 7, 2010

1 Comment

characters czech embed slovak

Quick tip: Characters To Include For Czech & Slovak

In a lot of projects we need to embed czech and slovak characters. Here is a list of those I mostly embed:

ÁáÄäČčĎďÉéĚěÍíĺĹľĽŇňÔôÓóŘřŠšŤťÚúŮůÝýŽž !”#$%&’()*+,-./0123456789:;?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}<=>'

June 7, 2010

No comments

addEventListener anonymous listener Timer

Quick tip: Timer Listeners Doesn’t Require Remove

Based on profiler (or net.hires.debug.Stats) your Timer listeners doesn’t need to be removed in order to empty garbage collector – the release reference, however it is always a good practice to remove all of them, event those with anonymous functions. Quick proof of concept:

Read the rest of this entry »

June 3, 2010

77 Comments

Access Token Facebook facebook api FacebookOAuthGraph Graph API OAuth session

Authorizing Iframe Facebook Applications For Graph API

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

This article continues my exploration of best facebook graph api integration into your flash app. Before continue reading, make sure you understand the previous article. Due to huge interest, I am adding codes that makes your flash app working with graph api within facebook iframe. Try this app live on http://apps.facebook.com/blogoauthgraph/, notice once you get there, you are redirected to grant permissions (if not authorized or granted already) and then redirected back to the app, where you are connected and ready to use graph api.

Read the rest of this entry »

June 2, 2010

2 Comments

buffer delay Loader priority timeout URLLoader URLRequest URLRequestBuffer

URLRequestBuffer – Buffer Your URLRequests

A belt of cartridges feeding into a machine gun.

Let’s suppose your app makes a lot of http requests at once, and you need a good administration for that. Based on used browser your app is running on, you are only allowed to limited request count – mostly its 2 requests per domain, the remaining ones are sitting in browser buffer waiting to finish those actual. URLRequestBuffer is handy class that lets you manage URLRequest-s. E.g. you are creating image gallery and request hundreds of images in gallery at a time, now when user navigates throug the images you need to make some request more prioritized before others, some to be canceled, some may timeout etc. Here comes URLRequestBuffer in scene.

Read the rest of this entry »

June 2, 2010

6 Comments

black and white BlendMode color ColorCircle ColorPicker donut palette RGB

Color Picker Not Boring Anymore

Overlapping colour wheels.

For my next project, I needed some lightweight color picker that would be usable but not boring. Nice challenge. So I have created ColorCircle class that may work as a color picker while it dispatches all the necessary ColorCircleEvent-s. I made this class a little dynamic, so you can create custom color pickers on runtime using RGB palette, Black to White fade, solid color or current color with any defined radius (inner + outer) you want.

To create donut shapes I have used shape with lineStyle+drawCircle+cacheAsBitmap drawed over original graphics using BlendMode.ALPHA. To browse RGB pelette there is a paletteColor() method that crawls all color spectrum based on position (0 to 1).

Read the rest of this entry »

May 24, 2010

6 Comments

cache etag headers PHP request

Image Caching With PHP

HTTP response headers showing 304 Not Modified.

While working on my next project, I am looking for the best possible techniques to make it fastest possible (both client and server). My app requests a lot of images here and there, it may count up to hundreds or thousands requests in a while. I can not hold all of those wthin flash player cache because some of them may change, and I also want shortest possible respond times and client-server traffic reduction as well as server side computing reduction. Thats where browser caching comes into the scene. I have experimented a bit with all possible http headers to understand each browser specifics and I came with a solution.

Read the rest of this entry »

May 19, 2010

No comments

benchmark dispatchEvent enumerations event iterations loop

A different view on loops – listener-looping

Two circular arrows crossed by a red X.

What is the usual practice when searching / setting / operating over some list of item? I think you usually think of iterating over some list (array) or linked list etc. Well, ActionScript has to offer one more technique you maybe never tought of, lets call it listener-looping. ActionScript is event based language, that means that every EventDispatcher based classes are able to listen and dispatch events. And this fits our needs for loop alternative. Lets suggest, you do not have any list to be iterated over but you still have a chance to accomplish it by making each item listening for custom event.

Read the rest of this entry »

May 13, 2010

1 Comment

Array benchmark linked list loop optimization Vector

Myth Buster – Benchmarking Loops

A bar chart comparing benchmark results.

Lets have a look at some of the most common and fastest loops used in ActionScript 3. Is int really faster than uint and Number? Is while loop faster than for? Is pre-increment faster than post-increment? To test all of these I have created benchmark test application on wonderfl. App compares loops with 10.000.000 iterations and logs testing times. To compare different variable types, loop methods, increment / decrement modes, there are buttons grouping each test. Please be patient with your first click, the model Array is being generated (Link button also generates linked list). The first test compares Arrays, second one Vectors.

Read the rest of this entry »

May 10, 2010

22 Comments

3d Bitmap displacement pixel bender

Pixel Bender Displacement Map Fakes 3D Effect (update)

A white flower against a blue sky and green field.

Few days before I saw an amazing 3d effects on VidazPhoto. That made me want to master this effect. So, starting today morning I played around with flex and pixel bender and here are the results. I have created simple pixel bender kernel that uses monochromatic bitmapData to calculate amount of displacement for each pixel. All you have to do, in order to make your 2D images become 3D, is to create monochromatic map (black & white image) with the same dimensions as the original image (use lighter colors for closer objects, darker colors for distant ones). Than, based on rotation, push correct amounts of full displacement (dx, dy displacements for full white color) into shader. The displacement is linear starting on 0, 0 for black color, up to dx, dy for white color. All sources available to download.

Read the rest of this entry »

May 7, 2010

1 Comment

abstract drawing Guide Point

Abstract Drawing

An abstract drawing of intersecting red and green lines.

While some free time today, I have been playing on guiding script, than suddenly I got an idea, I can create some eye-catching thing with it and voilà, here is little thingy, can be used for screensaver etc… Have a nice Friday :-)

Read the rest of this entry »

« Older Entries

Newer Entries »