blog
2010 ArchiveJozef Chúťka's blog — blog.yoz.sk/2010/page/8/
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.
April 12, 2010
Child communication content Loader Parent URLRequest
How to communicate between loader and child

This post is about communication between loader (Parent.as) flash object (.swf) and loaded (Child.as) flash object. While flash is event based, I find it correct to use events to communicate, although different methods exist (direct function call etc.)
April 6, 2010
Quick tip: DefaultProperty Metadata Tag

I hope to clarify function of DefaultProperty metadata tag with this article, while documentation may seems to be a little unclear. What it says is: The [DefaultProperty] metadata tag defines the name of the default property of the component when you use the component in an MXML file. It is correct and easy to imagine and understand once you see a little example. So here it is:
April 2, 2010
Camera3D hover orbit Papervision 3D Scene3D smooth Viewport3D
Smooth Orbiting Camera in Papervision 3D

While working with papervision, I realized papervision is missing something like hovering camera (read section Orbiting your scene using the Mouse). I decided to simulate it by using Camera3D.orbit() method. And here is the result:
March 29, 2010
3d Facebook Papervision 3D sOliver
s.Oliver Rubik’s Cube

The Rubik’s Cube is a 3-D mechanical puzzle invented in 1974 by Hungarian sculptor and professor of architecture Ernő Rubik. My latest project was to create a 3D engine (I have used papervision) based on this logic + integrate with facebook. Finally, the game is ready and you can play s.Oliver ‘s Cube on Facebook.
March 29, 2010
quine TextField trace wonderfl
Quine in ActionScript 3

In computing, a quine is a computer program which produces a copy of its own source code as its only output. For amusement, programmers sometimes attempt to develop the shortest possible quine in any given programming language.
While playing with wonderfl I have found a nice ActionScript quine solution from yonatan, which I decided to shorten. It would be shorter code using trace() but than you won’t be able to log/see output on wonderfl, thats why TextField is used.
March 19, 2010
fork game of life Graphics pixel bender shorten Sprite with wonderfl
Game of life (update)

The Game of Life, also known simply as Life, is a cellular automaton devised by the British mathematician John Horton Conway in 1970. It is the best-known example of a cellular automaton. The “game” is a zero-player game, meaning that its evolution is determined by its initial state, requiring no further input from humans. One interacts with the Game of Life by creating an initial configuration and observing how it evolves.
March 17, 2010
assignments functions instations operators optimization statements
Common Tricks in ActionScript Code Shortening

Code shortening can make your code more readable as well as more unreadable :-). While it is recommend to use coding conventions and standards, in some cases you can spare a lot of lines using some shortening. In fact there must not be a conflict between using convetion vs. using shortening, and soon after you get used to some “shortcuts”, your code may be reduced in reasonable amount of lines. Some reading about code optimization can be found here, this article extends optimizations.