blog

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

January 22, 2010

8 Comments

Authorization DesktopSession Facebook facebook api FacebookLogger FacebookPopup FlexIFrame IFrame

Elegant Facebook Login For Desktop Application

An application window displaying a Facebook login dialog.

Default facebook login page is usualy opened in new browser window or popup window, so user lose focus from your page. This application opens facebook login page within your flash application, so user will not lose your page. In fact little iframe trick is used.

This post connects my 3 previous posts: Flex IFrame – Web browser in flash, FacebookLogger and Facebook Extended Permissions With Authorization by Overriding Class in swc in order to create elegant solution for facebook connect with your desktop application (means outside facebook iframe or fbml). I recomend to read all previous mentioned posts before trying to run this app.

Read the rest of this entry »

January 21, 2010

9 Comments

Authorization DesktopSession Facebook facebook api swc URLRequest

Facebook Extended Permissions With Authorization by Overriding Class in swc

Facebook dialog previewing application posts with Allow Publishing and Don't Allow buttons.

It may be not popular, but it is possible to substitute / override whole class from .swc file. Lets say you are using some public api, in our case Facebook actionscript api. I admire work of developer team, but I would like to have some things different. My facebook application requires publish_stream extended permission right after user login (authorize) my application. Even if official facebook api documentation says it is possible to ask for extended permission with login.php call (req_perms parameter), our facebook actionscript api does not offer setting this parameter.

Read the rest of this entry »

January 19, 2010

4 Comments

pixel bender Shader ShaderExplorer ShaderFilter ShaderInput ShaderLoader ShaderParameter

Pixel Bender Explorer

Pixel Bender Explorer showing a kaleidoscope image and adjustment sliders.

Pixel Bender Explorer is simple application that lets you dynamicly load .pbj files, apply it on image and edit shader values. Application uses two classes. ShaderLoader class loads external .pbj file and casts loaded binary data into Shader object. ShaderExplorer class inspects created Shader object and generates editable form based on Shader parameters. You can load your own external .pbj files (crossdomain.xml required near .pbj file) or feel free to download and use whole .swf application localy.

Application inspired by Enumerating Pixel Bender filter parameters and metadata dynamically in Flash and Introduction to Pixel Bender: Part 2 articles.

Read the rest of this entry »

January 12, 2010

No comments

antialias Arial Bitmap text css embed fontAntialiasType fontFamily fontSize TextField

Embed Bitmap text into Flex

pixelFont

This article helps you embed pixel sharp fonts (without antialias) into your flex apps. As far as I know you wouldn’t be able to do this just by direct embedding local font file into your flex application, but you gonna need Flash CS4 authoring tool. There are two ways you can make Bitmap text work in flex. You can use pure css method or actionscript method. The downside of both methods is, you have to define and export from flash exact font size you are going to use.

Read the rest of this entry »

January 11, 2010

No comments

geometry GeometryMath Point

GeometryMath 3 points in line test

inLine

GeometryMath.isLine() static function tests 3 Points and returns true if these points are in line. Optional 4th parameter defines if you require point2 to be in the middle between 1 and 3. Function is not based on vector algorithm, but on triangle equation. This simple function was developed in order to optimize number of points necessary to draw some paths. To draw a line, you do not need all the points, you can omit all the middle points that are on the same line and the result looks the same – optimizes performance or storage.

Read the rest of this entry »

January 8, 2010

7 Comments

benchmark BitmapData ImageResizer Matrix pixel bender Point resize ResizeMath

How to resize an image with ActionScript (update)

imageResizeLanczos

If you need to resize an image on client side, I mean real bitmapData resize (not just showing scaled), feel free to use ImageResizer class. This class takes bitmapData of source image, new width and height and resize method (defined by ResizeMath class), and returns new bitmapData of resized image.

Update: It seems that bitmapData.draw() method uses bilinear algorithm when scaling via Matrix. Bilinear algorithm gives you fine results when downscaling no more than 2 times (400px -> 200px). So, I added bilinearIterative() method into ImageResizer class that creates resized bitmapData by multiple steps achieving much smoother results!

Read the rest of this entry »

January 5, 2010

1 Comment

compiler flag link report xml xsl xslt

Flex Size Report

linkreport

This post is for everyone who is looking for clear and readeable size report from flex.

1. Define “-link-report” flag for compiler 2. Export / publish your project 3. Create static .xsl file 4. Link .xsl file into generated .xml size report

Read the rest of this entry »

December 16, 2009

No comments

DisplayObject Graphics hitTestPoint RayMath

RayMath class

raymath

While working on newest project I created a simple util class that simulates rays of spot light. It uses DisplayObject hitTestPoint() method to test for ray stream collisions so it does not go beyond the obstacles (corners etc.). Feel free to use RayMath class as you wish

Read the rest of this entry »

December 8, 2009

5 Comments

Facebook facebook api FacebookEvent FacebookLogger FacebookLoggerEvent FacebookSessionUtil LoaderInfo

FacebookLogger

facebook-small-logo

In a last couple of weeks I have been working on a lot of facebook applications. It did not took long to realize that there is always the same logic behind logging/connecting to facebook. So I came to FacebookLogger abstraction class that handles these basic steps. It only contains login/connection logic, so its pretty much the core that is usable only after extending.

Read the rest of this entry »

December 4, 2009

2 Comments

Charts Flex interpolateValues LineChart LineSeries Stroke

Flex Charts – interpolating values in Series

interpolateValues

Recently, I felt into problem with chart when using interpolateValues parameter set to true. You expect it to work as described in Language Reference. And guess what, it works :) , but make sure you provide correct numeric values (not strings – those were problematic in my case). Parameter interpolateValues is able to draw a continuous line by interpolating the missing value. Missing values means null (v1 in example) or when key is omited (v2).

If you want to use Charts in Flex, download data visualization components for your flex builder and copy content into sdk directory.

Read the rest of this entry »

« Older Entries

Newer Entries »