|
||||||||||||||||
. . . . . |
Flash MX and MX2004 ScrollPane Tutorial #2
Make sure that you do the First ScrollPane tutorial Part 1 first: -
This Flash ScrollPane tutorial will deal specifically with the problem of addressing buttons within a
Flash MX Pro
ScrollPane.
This project will deal with the farcical premise of Steve's Tutes Inc website. We need to build a flash website
that gives information about the Board , the members and staff of Steve's Tutes Inc. lol.. We have 12 board members
and 32 staff, and we cant fit them on the page vertically so we need a scrollpane in the center section.
First open up
Flash MX Pro
Flash Tutorials in Video Format -
Watch them now at LearnFlash.com
Create another layer and call it "buttons". Make your title and put it up the top of the left navigation bar. Creating Loaded Movies
Now we are going to create 3 new fla files so that we can load in our scrollpanes for the center section.
Go file - New and Name the new fla "members.fla". Make it 600x400. Open up the library and click on the most bottom left icon to create a new symbol. Select "Movie Clip" and name it "member_mc". click on the Advanced button and tick the "Export for Actionscript" and in the Linkage - Identifier box leave the name as "member_mc". Click "OK". Create buttons to go into ScrollPane
Start creating your buttons. I have put the list of member names vertically and made a button from each name.
on(press){
_level0.attachMovie("barney_mc", "barney_mc",0);
_level0.barney_mc._x = _level0.container._x;
_level0.barney_mc._y = _level0.container._y;
}
do the same for the rest of the buttons on the members.fla file. Here is one for fred
on(press){
_level0.attachMovie("fred_mc", "fred_mc",0);
_level0.barney_mc._x = _level0.container._x;
_level0.barney_mc._y = _level0.container._y;
}
Make a list of all the movieclips names' that you will be attaching.
Write them down. e.g barney_mc, fred_mc, brett_mc, danny_mc... etc etc. We will need to create these MovieClips later in our main .fla file. Make sure you compile the .swf file for members. Hit Control + Enter Keys.
Create 2 more new files and name them "board.fla" and "staff.fla". Making a dummy Movie Clip for the right hand Content box
We need to create some sort of dummy cover mc to override the last members content in the right hand box.
The easiest way to do this is create a dummy mc. Loading ScrollPanes into Flash Main Movie
Now we need to load our separate .swf movies into the center section of our main movie.
Go to our main movie, and create a new layer. Call it "code". Click on frame 1 of this layer and open the
Actions window. Remember that we have called our left buttons, members_btn, board_btn, and staff_btn.
board_btn.onRelease = function(){
unloadMovieNum(1);
attachMovie("dummyRight_mc","dummyRight_mc",0);
dummyRight_mc._x = container._x;
dummyRight_mc._y = container._y;
loadMovie("board.swf",1);
}
members_btn.onRelease = function(){
unloadMovieNum(1);
attachMovie("dummyRight_mc","dummyRight_mc",0);
dummyRight_mc._x = container._x;
dummyRight_mc._y = container._y;
loadMovie("members.swf",1);
}
staff_btn.onRelease = function(){
unloadMovieNum(1);
attachMovie("dummyRight_mc","dummyRight_mc",0);
dummyRight_mc._x = container._x;
dummyRight_mc._y = container._y;
loadMovie("staff.swf",1);
}
If we want a movie preloaded into the middle section and/or the right, put some code like this:
this.onLoad = function(){
attachMovie("dummyRight_mc","dummyRight_mc",0);
dummyRight_mc._x = container._x;
dummyRight_mc._y = container._y;
loadMovie("members.swf",1);
}
Creating Right Hand Content MovieClips
Now we need to make all the movieclips that we wrote down before, eg. barney_mc, fred_mc etc..
Repeat the process above for fred_mc. And so on for brett_mc, danny_mc... etc etc..
Buy Flash MX Pro
|
|
||||||||||||||
|
| Home | Flash MX | Actionscript 2.0 | Flash 3D | Flash 8 | Flash Database | Flash Mobile | Flash CS3 | Java For Kids | Video Course | General Video | Photoshop | Web Design | Digital Photography | Forum | Games | free backgrounds | Resume | Flash Animations | Streaming Video | Students Work | Links | Contact me | sitemap | reviews | store | advertisers | . . |
||||||||||||||||