blog
Jozef Chúťka's blog — blog.yoz.sk/page/3/
April 8, 2011
debug mm.cfg Module PreloadSwf profile proxy
Quick Tip: Debugging Module Inside Non-debug Application

Did you know that it is not possible to debug loaded content within release (non-debug) build app? Every attempt to insert a breakpoint during the runtime will cause null pointer exception thrown by flash builder, however you can still trace() output. To be more specific, imagine you have main application deployed somewhere on the web and you want to debug a module you are just developing wrapped inside the main application. Sure you can use proxy mapping trick + custom run configuration, that would help you run your debugging version of module.swf, however while the main application is non-debug version, the flash builder debugger will just not work correctly. Luckily you have two options to make it work. First, you may also map the main application .swf file for your debug version (+ some flex rsl files) or second option, make the flash player wrap whole content into some .swf compiled in debug mode using PreloadSWF in mm.cfg.
March 25, 2011
125000 Triangles & Still Smooth

A few months ago I played with an idea of creating 3D illusion from an image and its depth map. First versions were based on displacement maps (custom implementation in pixel bender) and later I used common 3D engines to transform image into a 3D model. With software rendering I hit fps limit somewhere around 10000 triangles, what is like 70×70 segments per plane. Now if your source image is something like 700×700 pixles, the fragmentation is 10px per segment, that is not enough details for me :-) .
Luckily, Adobe introduced Molehill a GPU-accelerated 3D API and I was curious about where the limits of this are. While Away3D already released its molehill version, I have transformed existing 3ddm Away3D version what literally was just like 10 lines of code.
March 18, 2011
Class Error getDefinitionByName namespace
Quick Tip: Constructor Of Property With Namespace
Some of you may not like the solution (including me) but sometimes you need a little hack to make things work for you. In my case I required a constructor of property declared under custom namespace but not defined (null). Normally, you would go for describeType(), but guess what, yeah it just does not describes properties with namespace other than public. While there was nothing better in my mind than passing some unexpected value and expect what happend I decided to go for it. Luckily an exception was thrown with correct constructor name.
February 27, 2011
Command Context Module ModuleLoader ModuleMediator Robotlegs
Simple Modular Robotlegs

You know it, when you learn new things looking for documentation or tutorials all over the internet and even if you find potential good source it is some times difficult to focus on the key information while it contains a lot of stuff you do not need at all? Well, there really are some interesting sources for building robotlegs with modules (Modular Robotlegs, DynModules, Modular Tutorial ) but it took me some time to grab only the key functionality. So, I have decided to create the simpliest working project using robotlegs and modules.
February 14, 2011
Bindable BindableDynamics DynamicResourceManager ResourceBundle ResourceManager
The Ultimate Resource Manager

How would you like your resousrce manager to be able to access bundle content as easy as RM.bundleName.resourceName no functions used, no parameters, even better with a binding enabled? You like it? Me too. Lets have a look at the implementation.
First we need dynamic variables to be bindable. There are more existing and working solutions for this based on Proxy class. We have to handle getProperty() method and implement IEventDispatcherin order to dispatch events. The final class may looks something like BindableDynamics.
Next, lets do some ResourceManager magic to obtain localized values for our dynamic properties. We do not expect the properties will dispatch changes within one locale, but when locale changes (e.g. switch from en_US to fr_FR) all properties should get updated. A single artificial “propertyChange” event will do a good job for us. Lets call this DynamicResourceManager.
Final step can be custom. For example I like implementation with static (no initialization required) constants (constant works with mxml binding without throwing a warning) that looks something like…
February 11, 2011
Group horizontal Scroller vertical VGroup
Quick Tip: Horizontal And Vertical Scrollbars For A Spark Application
If I remember correctly it used to be native for Flex 3 application to show scrollbars when application content exceeded application width or height. In spark a little hack is needed:
<s:Application ...>
<s:Scroller width="100%" height="100%">
<s:Group>
<s:VGroup width="100%">
<views:Header id="header" width="100%" />
<s:BorderContainer width="100%" height="300" borderWeight="5"/>
</s:VGroup>
</s:Group>
</s:Scroller>
</s:Application>Notice s:VGroup nested inside s:Group component. This is in fact the hack to make both vertical and horizontal scrollbars appear correctly.
January 21, 2011
AIR Desktop NativeProcess Remotair remote
Remote Desktop With Remotair

A day ago I published a youtube video about remote Windows control from an Android device. I will try to clarify the process about how it is done. What you need to make this work for you is (1.) an Android device with Remotair application v 0.1.9 (or higher) installed, (2.) Windows with Remotair desktop .exe air application v 0.1.3 (or higher) and (3.) some capture-desktop softwer, VH Screen Capture works good.
January 13, 2011
api maps onBoard OpenStreetMap
onBoard on Maps

I am pleased to announce, I managed to create an onBoard port for OpenStreetMap API. A few months ago I tought about how could this been done, and finaly, past week I had some time to work on that. With map version you can explore map as well as draw on any place – when zoomed to max. The tool that was created I consider as a very smooth map explorer, I am not affraid to say much smoother than official explorer from OpenStreetMap or Google Maps even considering short time spent on developing it, and I am not mentioning possibility to rotate the map or possibility to have an Android app in few hours.
January 10, 2011
Faster floor, round, ceil for ActionScript
It is always nice to add some speed boost to your performance critical algorithms. Making some native Math function’s alternatives perform up to 8 times faster is possible. Lets have a look at the basic ones Math.floor(), Math.round(), Math.ceil():
faster alternative for Math.floor()
var ni:int = n;
return (n < 0 && n != ni) ? ni - 1 : ni;faster alternative for Math.round()
return n < 0 ? n + .5 == (n | 0) ? n : n - .5 : n + .5;faster alternative for Math.ceil()
var ni:int = n;
return (n >= 0 && n != ni) ? ni + 1 : ni;January 7, 2011
ByteArray compress gzip gzuncompress lzma zip
Quick Tip: Compression in Flash
While working on one of my projects where I needed compression for transfered data, I hit some very interesting compression libraries. Also the ByteArray class contains compress method, using zlib algorithm in flash player or multiple algorithms in AIR. At the end I decided to use ByteArray.compress() method for encoding vs. PHP gzuncompress for decoding, what works correctly, fast and smooth.
Here is a list of 3rd party compression libraries and other good stuff:
AS3 Zip: ActionScript 3 based library for reading and writing zip files
FZip: FZip is an Actionscript 3 class library to load, modify and create standard ZIP archives.
ASZip: ActionScript 3 library to generate ZIP files
LZMA Encoder: AS3 class to compress data using LZMA algorithm.
LZMA Decoder: A part of the apparat framework.
GZIP: ActionScript GZIP compression library
Gzip for HTTPService/URLLoader: Adding Gzip support for Flex/AIR HTTPService/URLLoader
airxzip: Zip library for ActionScript3 on AIR
If you know some more, please let me know.