web design template web design template web design template

Page : 1 2

1. Select frame 1 on Actions layer and choose Window > Actions

2. In the Actions panel add the following actions for 'but1'


window._alpha=100;
window.widthNew = 390;
window.heightNew = 200;
window.xposNew = 14;
window.yposNew = 120;



// window._alpha=100;
This action assigns the new Alpha value to window movie clip

// window.widthNew = 390;
This action assigns new value to Width of the window

// window.heightNew = 200;
This action assigns new value to Height of the window

// window.xposNew = 14;
This action assigns new value to X position of the window

// window.yposNew = 120;
This action assigns new value to Y position of the window


3. Assign similar actions for remaining buttons. You need to change only the values as per your requirement

Here we have assigned the values as shown below

// For but2 :

window._alpha = 100;
window.widthNew = 250;
window.heightNew = 250;
window.xposNew = 85;
window.yposNew = 90;


// For but3 :

window._alpha = 100;
window.widthNew = 340;
window.heightNew = 150;
window.xposNew = 38;
window.yposNew = 140;


// For but4 :

window._alpha = 100;
window.widthNew = 150;
window.heightNew = 220;
window.xposNew = 135;
window.yposNew = 110;


// For but5 :

window._alpha = 100;
window.widthNew = 180;
window.heightNew = 180;
window.xposNew = 120;
window.yposNew = 125;


4. Insert a new layer above Actions layer and name it as 'Outline'

5. At frame 1 of Outline layer create an outline for the stage

6. Choose Control > Test Movie

Click the menu buttons and you can see the window changing its shape according the values we have assigned for all the buttons.

Change the values as you like and see how the window animation reacts.


1. Double click the window movie clip to go inside it.

2. Insert a new layer below the existing layer

3. With the help of 'Rectangle' tool create a small rectangle

4. Select the rectangle and convert it into a Movie Clip with top left registration point selected and name it as 'screen'


5. In the Properties panel type Instance Name as 'screen'

We need this screen to load other swfs into it

6. Choose Control > Test Movie

You will find that the screen is not changing its shape according to the window. To make it happen we need to add some actionscript to the existing script.

7. Come back into Scene 1

8. Select frame 1 on Functions layer and choose Window > Actions

9. In the Actions panel add the following actions

function setScreen(){
  window.screen._x = window.winTop._x;
  window.screen._width = window.winTop._width;
  window.screen._y = window.winLeft._y;
  window.screen._height = window.winLeft._height;
}  


// function setScreen()
This function is created to set the X,Y position and Width,Height of the screen according to outlines of the window

// window.screen._x = window.winTop._x;
The X position of the screen is set according to X position of top outline (winTop) of the window

// window.screen._width = window.winTop._width;
The Width of the screen is set according to Width of top outline (winTop) of the window

// window.screen._y = window.winLeft._y;
The Y position of the screen is set according to Y position of left outline (winLeft) of the window

// window.screen._height = window.winLeft._height;
The Height of the screen is set according to Height of left outline (winLeft) of the window

10. Select the window movie clip and choose Window > Actions

11. In the Actions panel add the following line of code

_root.setScreen();


// _root.setScreen();
The setScreen function is called

12. Choose Control > Test Movie

Now you will find that screen is changing its shape according to the window


Now we want to load different sections into this screen. Suppose we want to load aboutus.swf into this screen on click of About Us button

For that we need to create the aboutus.swf.



1. Create a new movie with Dimensions of 390px. X 200px. and fps = 24 with white color as Background Color

(Note: The dimensions of the movie you wish to load should be of the same size which you have mentioned on click of the Buttons. Here for but1 we have assigned the values as window.widthNew = 390,window.heightNew = 200. So here we are creating the about us file of the same dimensions )

2. Put the about us content as you want. Here we have put dummy text like 'About Us text will come here....'

3. Save the file as 'aboutus.fla' at the same location where you have saved your resizable_window.fla file

4. Choose Control > Test Movie and create a swf file i.e. aboutus.swf

Now we want aboutus.swf file to load into the screen on click of About Us Button

1. Open resizable_window.fla

2. Select frame 1 on Actions layer

3. Choose Window > Actions

4. In the Actions panel type the following action for 'but1' i.e. for About Us button

loadMovie("aboutus.swf", "window.screen");


// loadMovie("aboutus.swf", "window.screen");
This action loads aboutus.swf file into the screen

5. Choose Control > Test Movie

6. Click the About Us button. You will find the aboutus.swf is displayed in the window


For remaining sections create different swfs as per the dimensions mentioned in the button actions.

For Products create a swf (products.swf) of Width 250px. X Height 250px.

For Services create a swf (services.swf) of Width 340px. X Height 150px.

For Clients create a swf (clients.swf) of Width 150px. X Height 220px.

For Contact Us create a swf (contactus.swf) of Width 180px. X Height 180px.

(Note: If you create a swf with different dimensions then you need to put the same values in the button actions.)

7. Select frame 1 on Actions layer

8. Choose Window > Actions

9. In the Actions panel type the following action for 'but2' i.e. for Products button

loadMovie("products.swf", "window.screen");

10. Similarly assign the following actions for respective buttons i.e. but3,but4,but5

loadMovie("services.swf", "window.screen"); // for but3 i.e. Services button

loadMovie("clients.swf", "window.screen"); // for but4 i.e. Clients button

loadMovie("contactus.swf", "window.screen"); // for but5 i.e. Contact Us button


11. Choose Control > Test Movie

Click the buttons and check how the window animates and the sections get displayed in the window.

Regards,

Manoj Kotak.
The author is Director of Image Online Pvt. Ltd.
Developer of Layout Galaxy web site design templates for photoshop and Flash.

All accompanying logos, brands and product names are trademarks of their respective companies.

Blood for humans comes only from humans : Donate Blood
http://www.donate-blood.org   E-mail - om@donate-blood.org





© Image Online  2001-2003