tags:

views:

252

answers:

2

Hi,

We need to create a flash application, where there would be a "menu page".
When you click a link here, it will take you to another page with a completely different layout and functions.

Now I am new to Flash and wondering how this is normally done.

If it is HTML, you would create 2 HTML pages that link to each other.
Do you create two separate Flash application? Or is there a better way?

I'm probably going to use FlexBuilder to do the coding, creating .as file - if that has anything to do with this.

Thank you.

+1  A: 

Normally you split all your pages in different swf files and load/unload them as needed. If your going to use ActionScript 3, see the documentation of the Loader class.

Usually what I do is create one main document with a content container like a Sprite, and all the loading methods, the main content menu, the progress bar, etc. All the loaded pages are added inside this content container, and all the "content links" call the main document load methods.

facildelembrar
Thank you.I am not sure how to manage different swf files from one main swf file.Can you click a link, like from the menu page to go to the first page, and then click a Back button on the first page to go back to the menu page?
Flash doesn't have a back/forward native solution, so your back button needs to have the full address of the previous page. Your back button can have its own loading methods, but if it calls the load method of the menu page (by using ".parent" for instance), you won't need to code everything again.
facildelembrar
Thank you facildelembrar! I managed to use the Loader class, now I posted another question you may have the answer tohttp://stackoverflow.com/questions/559897/multi-pages-flash-applicationThanks!
A: 

There are many ways to go about making pages such as that. The easiest way would be to make all the pages you want in MovieClips in the Flash IDE and animate them in when a user clicks on a button.

It would look something like this:

myButton.addEventListener(MouseEvent.CLICK, onClickHandler);

function onClickHandler(e:MouseEvent):void { //animate stuff }

Flex should take care of your imports.

Also, you may consider using Tweener for your animations, and if you really get into it take a look at swfAddress.

Jonathan Dumaine