A Flash Developer Resource Site

Results 1 to 14 of 14

Thread: Stuck!

  1. #1
    Member
    Join Date
    May 2004
    Posts
    71

    Stuck!

    Ok heres what I am Doing:

    I currentyl have three types of swfs....one, the master, to load all the swfs into, two the top navigation which stays the same throughout, and 3, the content swf which comprises the rest of the site.

    Inside the 3rd Swfs, there is a secondary nav underneath the large background image. When the sec nav links are clicked, the content area appears in the background image...ill try to draw.

    -------------------
    ------------------- <- top nav
    | | <- big "background image"
    | | <---content popup (appears on sec nav click)
    | |
    -------------------
    ------------------- <- secondary nav

    heres the concept that i am stuck on....

    how do i make it so when you click on the secondary nav button, the box appears with the content in it....but when you click on the next sec nav button, the previous dissapears, and the new one appears?

    Does anyone understand what i am talking about???

    PLEASE HELP!!!
    Last edited by Vtee05; 06-09-2006 at 02:41 AM.

  2. #2
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    If your using loadMovie into an empty movie clip, the new one replaces whatever is already there. You don't have to unload it.

  3. #3
    Member
    Join Date
    May 2004
    Posts
    71
    right but how do you make the old one fade out????

  4. #4
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    That's more complicated. Say in your main movie, your loading your content movies into an empty clip with the instance name of mtClip. Now, in each of your external content movies, you need a fade in animation and a stop, where it's faded in. This means, you need to make each movie portable, by building all the movie inside one movie clip, then adding that to the main root timeline, so you can fade the whole movie with one tween on one layer. You have to do that for each content movie.

    On the root timeline, there is no stop in frame 1. Say the fade in tween goes to frame 15 and it's now faded in and you have a stop() there. Then another 15 frames and a fade out to frame 30. also on frame 30, you have to have some if statements that read a variable from the buttons in the main movie, so it knows which movie to load next, determined by which button was pressed. In frame 30, of each and every external content movie, add something like this;

    if(_root.whatMovie == 1){
    _root.mtClip.loadMovie("content1.swf");
    } else {
    if(_root.whatMovie == 2){
    _root.mtClip.loadMovie("content2.swf");
    } else {
    if(_root.whatMovie == 3){
    _root.mtClip.loadMovie("content3.swf");
    } else {
    if(_root.whatMovie == 4){
    _root.mtClip.loadMovie("content4.swf");
    }
    }
    }
    }
    }

    Then, on the buttons;

    on(release){
    _root.whatMovie = 1;
    _root.mtClip.play();
    }

    And so on.

  5. #5
    Member
    Join Date
    May 2004
    Posts
    71
    thanks, that explaions a little but, but i was mostly set up like taht....i know that about the fade in stuff, that i figured out. BUt waht i dont know is, how does it know when you click on the link, to go to the tween the causes the content box to fade out? It would be easy if you knew which one they were going to click (obviously you dont) <- you could just add a behavior to go to and play the fade out frames. But you dont know which one they are going to click so what is the if statement that i need to tell it to : example

    on click of link (Company)
    { if (previous content was Staff)
    { go to Staff and play the fade tween}

    if (previous content was Press)
    {go to Press and play the fade tween

    if (previous content was Inquire)
    {go to Inquire and play the fade tween}

    load company.swf

    }


    ^^^^what is the actionscript to do that????

  6. #6
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    Like I said, you set the variable on the button click;

    _root.whatMovie = 1;

    And tell the loaded movie in mtClip, to play;

    _root.mtClip.play();

    On the last frame of each of those fade animations, is code to read the variable set by the button click and load the next appropriate movie.

  7. #7
    Member
    Join Date
    May 2004
    Posts
    71
    ok...so this is how i am trying to do it. Inside the company.fla (which is the fla for all the company content)....I have the layers to fade in the bottom nav and the large background. Above those layers, i have a layer with a single keyframe that has a blank movie clip. when you go into that movie clip, the actionscript i add is

    var myMCL:MovieClipLoader = new MovieClipLoader();
    var myListener:Object = new Object();

    myMCL.addListener(myListener);

    myMCL.loadClip("overview.swf", 5);

    to load the overview content first
    overview swf is a 30 frame swf that holds the fade in and out (with the stop at fram 15) like you described above. EVerything works fine as of here....everything fades in right, and ive got the overview displayed. I get how i have to add the a.s. to the navigation buttons, but the next is where i get confused. Where do I add the rest of the actionscript to make it work with the rest of the content boxes (overview.swf, press.swf, team.swf, locations.swf, partners.swf)

    Sorry if Im being slow but ive tried to work it thru and i cant figure it out...thanks for your help

  8. #8
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    That list of if statements above in post 4 would go on frame 30 of each of the content movies. Your buttons set the variable and tell the overview swf to play. It looks like you loaded it to level 5, so you have to target that to make it play past frame 15. When it gets to frame 30, it reads that code, starts to load the next movie into itself, and disappears. When it's loaded itself, it plays out to frame 15 and stops.

  9. #9
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    Here's another way to do it, where the transition, instead of being built into each movie, is built into a movie clip in the main movie. The concept is similar, and this may be easier. Right now, the transition is a sliding door, but it could be a fade in over the area, or any other animation you want to use.

    Here's an example main movie and two of the four fla's this loads. Look through all of them, cause there is code everywhere.
    Attached Files Attached Files

  10. #10
    Member
    Join Date
    May 2004
    Posts
    71
    ok i tried to setup my fla's after the above, but something is wrong and its not working, can you take a look??? the main fla/swf is company and overview is supposed to load into it::dl it here: http://www.roccagroup.com/help.zip

    thanks for your extended help

  11. #11
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    Your trans movie has no animation, and the code to make it work isn't attached to it.

    And your overview movie is missing the frame 1 code.

  12. #12
    Member
    Join Date
    May 2004
    Posts
    71
    i feel like a tard, but i still got questions...i did everything (i think) with the exception of adding a transition effect (i gott figure out how to make it be a fade out), but anyways....i think there is a problem with my buttons, because even tho the other contents swfs dont exist yet, shouldnt the overview.swf dissapear? (even tho theres no transition effect)....

    and if you could, how can i make the transition effect be a fade out?

    the updated flas/swf are at http://www.roccagroup.com/help2.zip

  13. #13
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    The path ont he buttons isn't right. You need to give the menu movie clip an instance name. Call it menuMc and the buttons mc name it buttons. So instead of;

    And so on. Thats why your trans wasn't doing anything. Even if you had a fade out in it. And you had the button code in two places.

    http://www.flashbax.com/fla/company.zip

  14. #14
    Member
    Join Date
    May 2004
    Posts
    71
    thankyouthankyouthankyou...finnally it works right...thanks alot, i figured out the fade effect that i wanted......

    you basically just taught me flash..lol..
    thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center