blog

2010 ArchiveJozef Chúťka's blog — blog.yoz.sk/2010/page/8/

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

52 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 »

April 12, 2010

4 Comments

Child communication content Loader Parent URLRequest

How to communicate between loader and child

A diagram of event dispatch between Parent.swf and Child.swf through loader.content.

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

Read the rest of this entry »

April 6, 2010

No comments

DefaultProperty metadata tag

Quick tip: DefaultProperty Metadata Tag

XML markup with a CDATA section containing hallo world.

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:

Read the rest of this entry »

April 2, 2010

6 Comments

Camera3D hover orbit Papervision 3D Scene3D smooth Viewport3D

Smooth Orbiting Camera in Papervision 3D

Overlapping red, cyan and yellow three-dimensional blocks.

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:

Read the rest of this entry »

March 29, 2010

No comments

3d Facebook Papervision 3D sOliver

s.Oliver Rubik’s Cube

Three tilted fashion thumbnails, with the centre image enlarged.

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

No comments

quine TextField trace wonderfl

Quine in ActionScript 3

Syntax-highlighted ActionScript code in an editor.

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.

Read the rest of this entry »

March 19, 2010

No comments

fork game of life Graphics pixel bender shorten Sprite with wonderfl

Game of life (update)

A black-and-white grid with clusters of live cells from Conway’s Game of Life.

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.

Read the rest of this entry »

March 17, 2010

5 Comments

assignments functions instations operators optimization statements

Common Tricks in ActionScript Code Shortening

Feet on a bathroom scale whose display reads 'HELP!'.

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.

Read the rest of this entry »

« Older Entries

Newer Entries »