Build a Fluid Website Layout with Flash

Build a Fluid Website Layout with Flash

Tutorial Details
  • Program: Flash
  • Estimated Completion Time: 40 mins

Twice a month, we revisit some of our readers’ favorite posts from throughout the history of Activetuts+. This tutorial was first published in July, 2009.

A fluid web layout uses 100% width (and height) of the browser, floating all the contained elements into certain positions. This is opposed to fix-width layout where contents remain fixed no matter what the browser size is.

This technique is popular in HTML/CSS websites, but this tut will show you how to create a similar fluid layout effect in Flash. Every element will reposition itself with ease animation when the browser resizes.


Introduction

During the following steps we’ll create ActionScript 3 classes which make our flash website fluid. All our display symbols will retain their alignment when the Flash is resized.

The ActionScript classes created in this tutorial can be easily reused in different projects.


Step 1: Background Information

As shown in the image below, all the elements which float according to the browser size will be referred to as "fluid objects".


Step 2: Fluid Object Coordinates

Each fluid object will contain alignment parameters. The parameters store the x, y, x offset, y offset value of the object to indicate how it aligns.

Assigning x and y to 0 will make the fluid object align to the top left corner. Assigning x and y to 1 will make the fluid object align to the bottom right corner. Therefore, assigning x and y value between 0 and 1 will float the object at a percentage of the width and height of the browser.

The offset X and Y offset the position of the fluid objects while they align. Offsetting useful when positioning an object whose alignment point is not at the center. The offset is also useful for making margins on the alignment.


Step 3: Create a Directory

Create a directory called "FluidLayout" in the working directory. This directory will store all classes which relate to the fluid layout classes.

It’s a good habit to put the ActionScript class files in directories by category. For example, fluid layout classes will be placed in the "FluidLayout" folder in this case.

Please note that all the directory names, file names and codes are case sensitive.


Step 4: New ActionScript File

Open a new ActionScript file named "FluidObject.as". Save this ActionScript file into the "FluidLayout" directory.

The class FluidObject will store the alignment parameters of the symbols and reposition the symbols when the browser resizes.


Step 5: The Class Skeleton

Let’s start coding the FluidObject.as now.

	package FluidLayout {

		/* Add import classes here */

		public class FluidObject {

			/* Declare instance variables here */

			/* Constructor of the class */
			public function FluidObject(target:DisplayObject,paramObj:Object)
			{
			}

			/* Function that repositions the monitored object */
			protected function reposition():void
			{
			}

			/* Function that is called when the RESIZE event is fired */
			protected function onStageResize(e):void
			{
			}
		}
	}

Step 6: Importing Required Classes

Add the following code where you see: /* Add import classes here */

	/* class needed on resize Event */
	import flash.events.Event;

	/* classes needed for MovieClip and DisplayObject */
	import flash.display.*;

Step 7: Declaring Instance Variables

There are three instance variables for this class:

  1. “_param” will store the alignment parameters.
  2. “_target” will point to the monitored symbol.
  3. “_stage” is a copy instance of the flash stage.

There is also a setter for “_param” to enable changing of the alignment parameters. Add the following code where you see: /* Declare instance variables here */

	/* alignment parameters */
	protected var _param:Object;

	/* target object to be monitored */
	protected var _target:DisplayObject;

	/* stage instance of the flash document */
	protected var _stage:Stage;

	/* Setter for the alignment param */
	public function set param(value:Object):void {
		_param = value;
		this.reposition();
	}

Step 8: Implementing the Constructor

The constructor will initialize the target monitored symbol and store the given alignment parameters.

	/* Constructor of the class */
	public function FluidObject(target:DisplayObject,paramObj:Object)
	{
		/* Assign the instance variables */
		_target = target;
		_param = paramObj;
		_stage = target.stage;

		/* add event handler for stage resize */
		_stage.addEventListener(Event.RESIZE, onStageResize);

		/* reposition the object with the alignment setting applied*/
		this.reposition();

	}

Step 9: Implementing reposition()

The repositioning function is in charge of calculating the new x/y position of the monitored fluid object.

	/* Function that reposition the monitored object */
	protected function reposition():void
	{
		/* get the current width and height of the flash document */
		var stageW = _stage.stageWidth;
		var stageH = _stage.stageHeight;

		/* update the x and y value of the monitored object */
		_target.x = (stageW * _param.x) + _param.offsetX;
		_target.y = (stageH * _param.y) + _param.offsetY;

	}

Step 10: Implementing onStageResize()

The onStageResize function is an event handler which is called when the browser resizes.

	/* Function that is called when the RESIZE event is fired */
	protected function onStageResize(e):void
	{
		/* reposition the target */
		this.reposition();
	}

Step 11: The Completed Class

The finished class FluidObject is finished in this step.

package FluidLayout {

	/* class needed on resize Event */
	import flash.events.Event;

	/* classes needed for MovieClip and DisplayObject */
	import flash.display.*;

	public class FluidObject {

		/* alignment parameters */
		protected var _param:Object;

		/* target object to be monitored */
		protected var _target:DisplayObject;

		/* stage instance of the flash document */
		protected var _stage:Stage;

		/* Setter for the alignment param */
		public function set param(value:Object):void {
			_param=value;
			this.reposition();
		}

		/* Constructor of the class */
		public function FluidObject(target:DisplayObject,paramObj:Object)
		{
			/* Assign the instance variables */
			_target = target;
			_param = paramObj;
			_stage = target.stage;

			/* add event handler for stage resize */
			_stage.addEventListener(Event.RESIZE, onStageResize);

			/* reposition the object with the alignment setting applied*/
			this.reposition();

		}

		/* Function that repositions the monitored object */
		protected function reposition():void
		{
			/* get the current width and height of the flash document */
			var stageW = _stage.stageWidth;
			var stageH = _stage.stageHeight;

			/* update the x and y value of the monitored object */
			_target.x = (stageW * _param.x) + _param.offsetX;
			_target.y = (stageH * _param.y) + _param.offsetY;

		}

		/* Function that is called when the RESIZE event is fired */
		protected function onStageResize(e):void
		{
			/* reposition the target */
			this.reposition();
		}

	}

}

Step 12: Time to Create a Flash File

Begin a new Flash Document with ActionScript 3.0 supported and call it "website.fla". Then set the Document class as "Website".

If a dialog box pops up with the message: "A definition for the document class could not be found in the classpath,…" just click "OK" to bypass it. We’re going to create that class after drawing the graphic symbols.

The background image will be dark in this tutorial (I’ve put together my own space-like image using Photoshop). Therefore the background color of the flash document needs to set to black. Click Modify > Document to open the Document Properties dialog and change the background color.


Step 13: Draw the Title Symbol

There will be 5 flash symbols on the stage:

  • background
  • title
  • menu
  • middle content
  • footer

Let’s make the title first. The aim of this tutorial is to create floating symbols in the fluid layout rather then creating fancy website components. The symbols will only contain a text field indicating the purpose only.

For the title symbol, there’s a semi-transparent background. In order to fit different widths of the browser, the width of the background need to be large enough.

After having finished drawing the symbol, click Modify > Convert to Symbol (F8). Click the "Advanced" button to show detailed settings for the symbol.

Click "Export for ActionScript" to enable the ActionScript to access this symbol. Then find the "Class" field in the dialog and set the value to "Title" for the title symbol. This means that we’ve assigned a new Class called "Title" to this symbol. We can use this symbol later in the ActionScript.

Remember to name your symbol for easy recognition before you click OK. If a dialog box pops up with the message "A definition for this class could not be found in the classpath,…" again, just click "OK" to bypass it. Since we’ll not add any behavior to the symbol, we’ll let Flash create an empty class for us.


Step 14: Draw the Other Symbols

Delete the "title" symbol instance on stage because it will be created by ActionScript later.

We’ll use the same method to draw "background", "menu", "middle content" and "footer". The class name of these symbols will be Background, Menu, Middle and Footer accordingly.

The background image can be downloaded from the source files. Other symbols are text-field only.


Step 15: Code the Document Class

Create an ActionScript file and named as "Website.as"; this class file should be saved in the same directory as the website.fla file.

This class must also share the same name as that set in the Document Class (refer to Step 12). For example, the Document Class "Website" refers to "Website.as" in the same directory. This ActionScript class will be loaded right after the flash is loaded.

Here is the skeleton of the Document Class:

package {

	import flash.display.*;
	import FluidLayout.*;

	public class Website extends MovieClip{

		public function Website()
		{
		}
	}
}

Step 16: Implementing the Constructor

package {

	import flash.display.*;
	import FluidLayout.*;

	public class Website extends MovieClip{

		public function Website()
		{
			/* Set the Scale Mode of the Stage */
			stage.scaleMode = StageScaleMode.NO_SCALE;
			stage.align = StageAlign.TOP_LEFT;

			/* Add the symbols to stage */
			var bg = new Background();
			addChild(bg);

			var title = new Title();
			addChild(title);

			var menu = new Menu();
			addChild(menu);

			var middle = new Middle();
			addChild(middle);

			var footer = new Footer();
			addChild(footer);

			/* Apply the alignment to the background */
			var bgParam = {
				x:0,
				y:0,
				offsetX: 0,
				offsetY: 0
			}
			new FluidObject(bg,bgParam);

			/* Apply the alignment to the title */
			var titleParam = {
				x:0,
				y:0,
				offsetX:0,
				offsetY:0
			}
			new FluidObject(title,titleParam);

			/* Apply the alignment to the menu */
			var menuParam = {
				x:1,
				y:0,
				offsetX: -menu.width - 20,
				offsetY: 20
			}
			new FluidObject(menu,menuParam);

			/* Apply the alignment to the content */
			var middleParam = {
				x:0.5,
				y:0.5,
				offsetX: -middle.width/2,
				offsetY: -middle.height/2
			}
			new FluidObject(middle,middleParam);

			/* Apply the alignment to the footer */
			var footerParam = {
				x:1,
				y:1,
				offsetX: -footer.width - 10,
				offsetY: -footer.height -10
			}
			new FluidObject(footer,footerParam);
		}
	}
}

Step 17: Ensure All Assets are Ready

Open website.fla in Flash and check again before texting the movie.

There’s no need to place the symbols on the stage because the Website.as will create symbol instances from library by using their class names. The linkage class names of the symbols needs to be correct in order for the script to use them. The linkage class name can be checked in the library panel.


Step 18: Ready to View the Result

Click Control > Text Movie or Ctrl(Cmd) + Enter to test the flash website.

Try resizing the window and check if all objects are repositioning to the correct alignment.


Step 19: Further Work

Each FluidObject now needs to have specific x,y,offsetX and offsetY property values. A new Class will be created in the coming steps to simplify the future code when adding new fluid objects.


Step 20: SimpleFluidObject Class

Open a new ActionScript file named "SimpleFluidObject.as". Save this file inside the "FluidLayout" directory because this is part of the FluidLayout package.

This file extends FluidObject class so that it will provides simple alignment by using names like TOP, MIDDLE, BOTTOM_RIGHT instead of specifying the x,y properties.

Here is the skeleton of the class:

package FluidLayout {

	import flash.events.Event;
	import flash.display.*;

	public class SimpleFluidObject extends FluidObject{

		public function SimpleFluidObject(target:DisplayObject,paramObj:Object)
		{
		}
	}
}

Step 21: Implementing the Constructor

package FluidLayout {

	import flash.events.Event;
	import flash.display.*;

	public class SimpleFluidObject extends FluidObject{

		public function SimpleFluidObject(target:DisplayObject,paramObj:Object)
		{
			/* Tell parent class to init the constructor */
			super(target,paramObj);

			/* assign alignment and margin value by the constructor parameters */
			var alignment = paramObj.alignment;
			var margin = paramObj.margin;

			/* Preset the alignment and margin value if need */
			if (alignment == undefined) alignment = "MIDDLE";
			if (margin == undefined) margin = 0;

			/* convert the alignment (eg. "TOP", "BOTTOM_RIGHT") to x, y, offsetX and offsetY */
			var params = new Object();
			switch (alignment){
				case "TOP_LEFT":
				params = {
					x:0,
					y:0,
					offsetX: margin,
					offsetY: margin
					};
				break;
				case "TOP":
				params = {
					x:.5,
					y:0,
					offsetX: -target.width/2,
					offsetY: margin
					};
				break;
				case "TOP_RIGHT":
				params = {
					x:1,
					y:0,
					offsetX: -target.width - margin,
					offsetY: margin
					};
				break;
				case "LEFT":
				params = {
					x:0,
					y:.5,
					offsetX: margin,
					offsetY: -target.height/2
					};
				break;
				case "MIDDLE":
				params = {
					x:.5,
					y:.5,
					offsetX: -target.width/2 - margin/2,
					offsetY: -target.height/2 - margin/2
					};
				break;
				case "RIGHT":
				params = {
					x:1,
					y:.5,
					offsetX: -target.width - margin,
					offsetY: -target.height/2
					};
				break;
				case "BOTTOM_LEFT":
				params = {
					x:0,
					y:1,
					offsetX: margin,
					offsetY: -target.height - margin
					};
				break;
				case "BOTTOM":
				params = {
					x:.5,
					y:1,
					offsetX: -target.width/2,
					offsetY: -target.height - margin
					};
				break;
				case "BOTTOM_RIGHT":
				params = {
					x:1,
					y:1,
					offsetX: -target.width - margin,
					offsetY: -target.height - margin
					};
				break;
			}
			_param = params;			

			/* reposition the fluid object to the right position */
			this.reposition();
		}
	}
}

Step 22: New Usage of the Fluid Objects

Refer to the Website.as file and try using the new alignment method to align the fluid objects.

The Old Method to apply alignment to Title:

/* Apply the alignment to the title */
var titleParam = {
	x:0,
	y:0,
	offsetX:0,
	offsetY:0
}
new FluidObject(title,titleParam);

The New Method to apply alignment to Title:

var titleParam = {
	alignment: "TOP_LEFT",
	margin: 0
}
new SimpleFluidObject(title,titleParam);

Available alignments:

  • TOP_LEFT, TOP, TOP_RIGHT
  • LEFT, MIDDLE, RIGHT
  • BOTTOM_LEFT, BOTTOM, BOTTOM_RIGHT

Step 23: The Published HTML

Now the fluid alignment works on the "Test Movie" in Flash IDE, but there is one key point to make this work on browser.

Open website.fla. Go to File > Publish Settings and ensure HTML is enabled. Click the HTML tab and change the dimension to "Percent". Ensure the percent is set to 100 on both width and height.

Click "Publish" to publish the website as "website.swf" and "website.html" files.

Now open the "website.html" file with your favorite text editor and add the following code in the header. Adding the code right after the </title> tag would be a good choice.

These CSS styles eliminate the gap between the top left side of the HTML and the SWF file.

	<style>
	body{
		margin:0;
		padding:0;
	}
	</style>

Step 24: Advanced Technique Adding Easing

An easing effect can be applied when the browser resizes so that the objects will move to the correct position with an ease out effect.

Open "FluidObject.as". Add the following lines after "import flash.display.*;". These lines will import the tweening animation class to give the code ability to ease the objects.

	/* classes needed for Easing Animation */
	import fl.transitions.Tween;
	import fl.transitions.easing.*;

Then find the following lines in the "FluidObject.as" file. They are within the "reposition" function.

	_target.x=stageW*_param.x+_param.offsetX;
	_target.y=stageH*_param.y+_param.offsetY;

Replace them with the following code:

	/* set the duration of the easing animation (seconds) */
	var duration = 0.5;

	/* declare the new X/Y value */
	var newX = _target.x;
	var newY = _target.y;

	/* calculate the new X value based on the stage Width */
	if (_param.x != undefined){
		newX = (stageW * _param.x) + _param.offsetX;
	}

	/* calculate the new Y value based on the stage Height */
	if (_param.y != undefined){
		newY = (stageH * _param.y) + _param.offsetY;
	}

	/* Tell flash to tween the target object to the new X/Y position */
	new Tween(_target, "x",Strong.easeOut,_target.x,newX,duration,true);
	new Tween(_target, "y",Strong.easeOut,_target.y,newY,duration,true);

Test the movie, the objects will be easing when the browser resizes


Conclusion

We’ve just created two classes which are in charge of the floating fluid objects. We also created an example to align different objects on stage by using the classes. This example is only a sample case; you can use your imagination to play with the alignments. For example, a symbol may be interactive and its alignment may change from top to bottom when the user clicks on it.

The file structure should be the same as below after you finish this tutorial. Specifically, the FluidObject.as and SimpleFluidObject.as should be in the "FluidLayout" directory in order to work.

Enjoy the Fluid Layout!

Add Comment

Discussion 162 Comments

Comment Page 2 of 3 1 2 3
  1. Kristinn says:

    Hi guys, First of all, thank you so much for the tutorial! It is mindblowing!

    Second, I am new to flash, and I am going through tutorials to learn all this different stuff and trying to implement to a website I am making. One small question, I think, how can I:

    Use this fluid layout, but have a background video, that fits to screen size.

    I have both working but in two different files.

    I achieve the “background video fit screen”:

    Import video to stage, embed in timeline and use freeform to fill the stage with the video.

    then:

    Set html publish settings to 100% width and height.

    And by doing this tutorial I got the fluid layout working, but in a different file.

    What I am basically asking you guys for is: how can I implement both features into one webpage??

    I have tried this, but the video does not resize in browser, Chrome.

    Thanks alot!

    p.s.

    reference(not fluid though):

    http://www.hellomonday.net these guys use the fullscreen feature in their works.

  2. pcasa says:

    Great Tutorial.

    Preloader help would be great.

    Tried AS3 preloader from gotoandlearn but don’t know how to reference Website.as.

  3. Mihails says:

    Amazing tutorial!
    However I’ve stucked. I’ll be pleased if somebody will be able to help me.
    So I have same menu and, for example, 3 keyframes in the “middle”. How can I control these keyframes by click on the different button in the menu?
    I tried to use Devin’s code, but it still did not work. Maybe I put it in the wrong place (where exactly did you paste this code, Devin?). I have same problems as VIlle had. Could somebody help me with that?

  4. Paul says:

    Hi,

    so, everything is working so far, but I have one question. I have a FLV playing in the background and I wanted to know how I can get the video to scale to the browser’s size and keep the other elements “fluid” ?

    Thanks!

    • Colman says:

      Pass an extra parameter when creating an instance of the FluidObject class – a boolean parameter (scaleable true/false or whatever)

      in your reposition function (or create a seperate function to handle scaling) – check if scaleable is set to true. If it is then:

      obj.width = stage.stageWidth;
      obj.height = stage.stageHeight;
      obj.scaleX > obj.scaleY ? obj.scaleY = obj.scaleX : obj.scaleX = obj.scaleY;

      somthing like that … havent tested the code

  5. Bebop says:

    You are the best, very good and useful tutorial

  6. Moses Adeniyi says:

    Excellent tutorial

  7. Alexandre says:

    Can someone pass through all the questions and answer them?
    Thanks

  8. Chris says:

    I have no doubts that this is a very outstanding and excellent tutorial.
    But in my opinon this is a technique which can easily be done in CSS (provided the use of a moden browser. By modern I do not mean IE.)

  9. Dave says:

    Has anyone gotten this to work with Gaia

    Currently I have this error:

    Gaia Framework (AS3) v3.1.9
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at com.gaiaframework.FluidLayout::FluidObject()
    at pages::MemberPage()

    I believe the error is coming from the FluidObject.as file and has to do with referencing the stage.

    When I comment out all the referneces to the stage it runs but the fluid layout does not work. I have heard I need to use the ADDED_TO_STAGE but I have no idea how that works.

    Any suggestions?

    • Hussein says:

      i duno whats Gaia is.
      But concerning added to stage. you need to do the following.

      public function Website()
      {

      this.addEventListener(Event.ADDED_TO_STAGE, init);
      }
      private function init(e)
      {
      anything to do with stage scaling goes in here.
      ……

      }

      hope that helped, the Fluidlayout works fine on IE, but on Mozilla, u need to refresh the page or resize it.

  10. Tonymo says:

    It has a problem like refreshing the webpage.

  11. John says:

    Hi, this is a great tutorial, thank you very much but how do put a button on the menu in as3, I am a beginner, the tutorial I did well, excuse my English and my silly question hehe, thanks

    please help me!!

    • Bryan hall says:

      Ok so you’ve created the menu right, or at least have the source file downloaded and your project open.
      Now what you want to do is under the library, double click on the menu. Highlight the text and break it into parts having each page(button) its own text field) then click on each individual and convert to a btn.

  12. Fercho says:

    Hi, i’m new in as3, i follow the tutorial and it’s amazing congratulations and thanks for the share. Im building a fluid website and i just have a question: How can i resize the mc’s?

    If anyone can help me i will appreciate it so much.

    Thanks

    • Fercho says:

      Of course, resize the mc’s depending on the stage resize. I mean convert some mc’s into rezisable (not bg) and some mc’s not rezisables (middle or footer or menu…)

  13. Matt says:

    nice tut, but how does this work when working on more than just the index page?

    Its nice to have the main page resize but what about linking to other pages and making that content resize too

    How would i go about doing that?

  14. Eric Salvi says:

    Had a question about width and height, can you add those to something like this?

    var menuParam = {
    x:1,
    y:0,
    width: 0,
    height: 1,
    offsetX: -menu.width – 20,
    offsetY: 20
    }
    new FluidObject(menu,menuParam);

    So for instance the background we want scaled 100% both width and height?

  15. John says:

    how would you do the navigation button for this. Like making the buttons work?

  16. I have a problem, when I load an external swf, when entering the site the times he does not resize it, and then it only when I resize the window restoration, what do I do? ( i’m from brazillian )

  17. Devin Walker says:

    What’s up everyone?

    I’ve had different people asking about how I added buttons and preloaders (also included MP3 player, background effects and contact form) for this Fluid Website tutorial. I decided to offer up my code @
    http://www.dlocc.com/articles/flash-fluid-website-template-tutorial-and-download/

    You can find an explanation of the code and download my the .FLA in a zip with all the classes and everything. Here’s a demo of the website I created from this tut http://www.dlocc.com/downloads/fluid/index.html

    Hope this helps!

    • Parasar says:

      Thanks a million Devin!
      your init code helped me solve my problem on a fluid layout site i was trying to create by loading external SWFs ( was banging my head on for a few days now…)

      TypeError: Error #1009: Cannot access a property or method of a null object reference.
      at About$iinit()

      ps-m new to actionscript : )

  18. Muzaffar says:

    This is very nice tut. I would appreciate if you will also define, on how to set url for the title and how to load the target movie clip on the stage. Thanks

  19. jorge says:

    Great tutorial, been looking for this for a while

  20. haku says:

    your awsome

  21. John Martin says:

    Hello.

    What about google indexation? This fuid layout will be indexed by google or others?

    Thanks.

  22. kalidas says:

    how can use action script

  23. David says:

    I can’t quite understand why here it uses protected var and protected function? I think we can just use private var and private function. this should be fine.

  24. Steven says:

    i know there are more folks who’ve had this problem, i read all the posts. but no replies to any of em. how do you place a pre-loader into fluid site layout? i can’t figure it out.

  25. andre says:

    Thank you for a great tut Devin.

    One problem I still have is the background. It doesnt rescale at all. a good example of the effect I want to get is this (http://www.f-o-a.net/) website. you can see that the background image (although it’s animated-which I dont need to do right now) scales based on the size of the window without losing its proportion.
    can you please help to achieve that effect… Thanks

  26. Thanks for this. is really useful. I have a problem. I need to add a preloader at this source file that i modified to my good. but is really difficult to modify the actionscript file. i’m following this tut to preload http://active.tutsplus.com/tutorials/web-design/create-an-apple-inspired-flash-preloader/

    somebode can helpme please? Thanks!!!

  27. Moh says:

    It is excellent!

  28. Devin Miller says:

    So I saw this tutorial and its great but I want to use it in a different way, but Im coming across some issues. First I should probably tell you what I am trying to accomplish. I want the background to be fluid so it fills the entire area because its a picture but, I want my content (all of it) in the center and its big(1200px x 1400px) so I want it to be able to scroll down.

    Issue 1: It is not going to the middle of my stage.
    Issue 2: There is no scrolling it cuts off my content

    Is there anyway to fix this?

  29. Telefunken says:

    Hello Thanks for this !!! is really cool!!

    I’m trying to add a externall preloader to this but i have this error.

    TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at Website()

    What i need to modify in the website.as file?

    Thanks!!

  30. James says:

    Hello good afternoon, is the following I was trying to make an application to cd-rom, using the liquid layout, but I have a container that is centered in the middle they are hubs and when we click on one of these cubes, and will make an animation for a specific movie clip in that category. I was to put your code but the following when they resize the window movie clip shake it all, there Aluma reason this happens is that I wanted these cool and always stay visible, as for example the title of the demo … Thank you so

  31. Matt Vogt says:

    Yo! Wonderful Tut! Very Active!

    Makzan I have a question about a situation:

    What happens if you animate a object, therefore offsetting it from it’s spawning offsetx and offsety values, when you resize, of course they’ll relocate to the origin, ie non animated position. Therefore is there a way or at least a direction you could point me in to get the relocation values updated on my animated object’s new position???

    Thanks brother!
    Matt Vogt

  32. Sergio Amaro says:

    This looks and works great on firefox and safari, but not on IE8.
    The ActiveX control prompts every time, blooking the opening.
    I’ve tried to modify my security settings, didnt work.

    What can I do to change this? I can’t use this code on any website if it keeps blooking.

    Help me!!!!!!!

  33. Aaron says:

    Hey great tutorial.

    Im having trouble adding a new symbol. Im exporting the new symbol for action script. Im then adding the symbol to the stage in the website.as file Im also applying the aligment in the website.as file but Im getting the error message that the variable is not defined. Any ideas?

  34. parasar says:

    Thanks a lot!
    has been of great help

    one question though…how can i give an instance name to the dynamically created title, menu, etc. so that i add event-listeners to them??

  35. Adi says:

    Great tutorial, thnx!

  36. wagster says:

    Interesting. I have just finished building something like this and I have a couple of questions.

    First – is this the command pattern? It looks a bit like it, but I’m only getting my head around patterns just now.

    Second – I also built a class called FluidObject, but I was using it as a superclass of my objects – it did much the same thing. What are the advantages of using composition over inheritance?

  37. clairde says:

    great tut! love it !

  38. scot says:

    Great tutorial,
    I would really love see you do a second part to this, working with menu, pages etc.

    greetings

    scot

  39. carter says:

    My symbols don’t say exported next to them in the library for some reason. I followed the steps and exported to actionscript, any idea where I went wrong?

  40. MaRmAR says:

    When creating those fluid elements you should properly position them before calling addChild() method otherwise they will initally float from x,y=0,0 to newX,newY instead of showing already in position.

  41. Vivek Parmar says:

    though i hate flash but must admit that its a great tutorial.
    thanks for this

  42. moe says:

    Thanks for sharing this tutorial, this actually has more to it than just how to create a fluid layout.
    The OOP steps are actually useful.

    Keep em coming :-)

  43. harilalkm says:

    it’s an awsome tutorial. But i have doubt . Is it better to use a static class instead of creating so many objects?

  44. thiago says:

    Hello team! Very good tutorial, congratulations to all!
    My question is when to add the codes to do the loading another swf within the documents of this tutorial. Can you help me on this issue? I wonder if I have to create classes for the appropriate links, or if I add – as I’m doing – in the 1st frame?
    I hope to answer you, and if they can help me I appreciate it!
    Thanks

  45. Matheus says:

    Amazing….. Thank you very much, for this nice explanation about fluid Layout’s.

    Seeya

  46. beginner says:

    Very impressive tutorial i must say.
    but i am having difficulties
    when i hit play the movie it shows blank…
    anything wrong possible?

  47. tütünex says:

    it’s an awsome tutorial. But i have doubt . Is it better to use a static class instead of creating so many objects?

  48. chris says:

    how do you make more of the site, like continuing into the menu and stuff

  49. Adam says:

    Great tut, just what i needed. Keep it comming!

  50. Tharik says:

    Better example!

Comment Page 2 of 3 1 2 3

Add a Comment

To add a code snippet to your comment, please wrap your code like so: <pre name="code" class="html">YOUR CODE</pre>. You can replace the class name with "js," "css," "sql," or "php." If there are any "<" or ">" within your code, please search and replace them with: &lt; and &gt; respectively.