Fluid layouts in Flash

fevereiro 14, 2007 from

I have done some projects in the past using a lot of Flash, most of the newcomers usually want their sites done using this Adobe technology.

Nowadays, though, Flash seems to have lost a bit of its shine. With AJAX, Webstandards, CSS and stuff like that being hyped as the new trend for this new web called web 2.0.

However, as an unknown designer doing my job, I have started a flash project. Basically it’s a site in flash. So one of the things that I was willing to do was to create a fluid site in flash, that resizes when I resize my browser’s window.

After some searches everything was pretty clear, it was far simpler than I expected, because that I show bellow an example with a very simple design of my logo.

Step 1

Create a new flash project, any size, it doesn’t matter, it will take 100% of the screen.

The logo and all elements will always be aligned in the center of the page

Step 2

Place the design and create movieclips. In this example I set the registration point in the center of all movieclips, making everything much easier to align.

Step 3

The Stage Class

The Stage class is a top-level class whose methods, properties, and handlers you can access without using a constructor. Use the methods and properties of this class to access and manipulate information about the boundaries of a SWF file.

var stageListener:Object = new Object();
stageListener.onResize = function() {
};
Stage.scaleMode = "noScale";
Stage.align = "TL";
Stage.addListener(stageListener);

Step 4

Using the Tween Class to spice it up a little bit. I used this class to create tweens, so, when the user will resize the windows and when he finishes the resizing and release the button, the elements will move straight to the center of the screen again.

The Tween class lets you use ActionScript to move, resize, and fade movie clips easily on the Stage by specifying a property of the target movie clip to be tween animated over a number of frames or seconds. The Tween class also lets you specify a variety of easing methods.

Step 5

The HTML and CSS. The background used there comes from the CSS, and the flash uses the WMODE = Transparent parameter.

Final Result

Click in the image to open a new window with the flash example.

The elements will move smoothly until they reached the center of the page

Bellow a list of some sites explaining more this subject:

http://abduzeedo.com.br/files/imagecache/img690x320/originals/fluid-center.jpg

Sobre o autor

Abduzeedo is a blog about design. There are all sorts of articles for those who want to look for inspiration. Also you will find very useful tutorials for the most used applications out there, with a special selection of Photoshop Tutorials and Illustrator Tutorials. You can get in follow us via Twitter at @abduzeedo

Sponsored Links:

More articles about:

Comments and Reactions

Featured Tutorial

Dicas Rápidas Photoshop: Técnicas Avançadas de UI Design
Dicas Rápidas Photoshop: Técnicas Avançadas de UI Design
Como em várias outras ferramentas, existem várias maneiras de se alcançar um resultado no Photoshop. A diferença entre essas opções está no tempo em que podem ser feitas e modificadas. Depois de falar com vários designers descobri que uso algumas técnicas que eles nem conheciam, eles faziam as coisas da maneira mais difícil. Então resolvi fazer esse video para compartilhar essas técnicas com a comunidade. Video

Try this Wallpaper

Papel de Parede da Semana #48 - Hocus Pocus de Craig Shields
Papel de Parede da Semana #48 - Hocus Pocus de Craig Shields
O papel de parede dessa semana é uma incrível arte digital de um artista do depthCORE e faz parte da nova exibição do coletivo o capítulo HER. Hocus Pocus foi criada por Craig Shields, um jovem e talentoso ilustrador do Reino Unido.

Book Suggestion

Sugestão de Livro: The Lean Startup
Sugestão de Livro: The Lean Startup
A série semanal de sugestão de livros já é um sucesso no Abduzeedo.com e hoje estamos começando a postar a série aqui no Abduzeedo Brasil também, esperamos que gostem. O livro sugerido nessa semana é um livro de leitura obrigatória na minha opinião, é o livro The Lean Startup: How Today's Entrepreneurs Use Continuous Innovation to Create Radically Successful Businesses de Eric Ries.