blog

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

April 12, 2010

2 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

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

March 12, 2010

No comments

Button ButtonBar rating RatingButtonBar

RattingButtonBar class

A row of black, red and yellow stars.

RatingButtonBar class extends ButtonBar and is meant to be used for ratings. Just like common star ratings all over the internet. Based on ButtonBar it makes it easy skinable for developers. Use bindable selectedIndex to get index of selected rating (zero based).

Read the rest of this entry »

March 10, 2010

1 Comment

css font-face fontFamily fontStyle fontWeight Helvetica

What fontName to use with embedding?

A font style menu with Arial Black selected.

This article extends “Embedding fonts bold vs. black” post. Sometimes it may be tricky to guess correct fontName with your font. Compilator works with different fontNames than what Flash IDE shows you. Lets say you want to embed fonts from .swf (library) file into .css file. In Flash IDE, properties panel for TextInput, character Family and Style stand for something totaly different that what you gonna need with correct fontName value later in .css file. In fact solution is very easy.

Read the rest of this entry »

March 4, 2010

3 Comments

BasicRenderEngine Cube DisplayObject3D Papervision 3D QuadrantRenderEngine sortMode ViewportLayer ViewportLayerSortMode z-sort

Fixing Z-sorting in Papervision 3D (update)

A cube made of smaller cubes, with four white squares visible from above and a black side.

It may be very tricky thing to get papervision 3d scene rendered correctly event for the simpliest objects. In my case, I have created simple 3d scene with few primitive objects (8 cubes). Cubes are positioned close to each other to create shape of bigger cube + some small space between. Cubes are added into wrapping DisplayObject3D, later wrapper is added to scene in order to make it easy to rotate cubes as a group. Camera targets the center of the scene. In the demo, there are 3 sliders to rotate wrapping object in each x, y, z axis + two buttons that rotates wrapper in the problematic possition (based on z-sorting fix approach). Finally I managet it to work, you can follow my approaches below. Notice the changes are not cummulative, each approach comes from original Application.mxml. All of the ideas collected online from blogs, forums etc.

Read the rest of this entry »

« Older Entries

Newer Entries »