A Flash Developer Resource Site

Page 1 of 2 12 LastLast
Results 1 to 20 of 34

Thread: Animation on menu button down

  1. #1
    Member
    Join Date
    Apr 2006
    Posts
    94

    Animation on menu button down

    Hi,

    I need some help on this one....

    I'm creating a web page, and I want to add an effect every time a menu-button is pressed...

    Every time another button is pressed, I want to have the rectangle(with content in it) be "compressed" and the new rectangle fading in...

    I can create this: Site1 (press menu buttons to watch), but I want it to be more advanced...(Content fading out first,or being folded together or something)

    Site2 => This is the test website I'm working with...

    (Wow I hope someone understands what I mean )

  2. #2
    Senior Member
    Join Date
    Dec 2006
    Posts
    274
    I'm such a newbie so I'm not very familar with all 3fda tricks.. one way could be that you make all "fade in" and "fade out" animations to separate movies (scene1fadein, scene1fadeout, scene2fadein... etc) or if it is possible "fade in, pause/viewing, fade out" in single movie (scene1show-view-hide, scene2show-view-hide)
    or use scripting functionality to do whatever you like

    Using events (like show, move, hide etc.) to create complex webpage construction animation is easy but how to do same with actions as you might wish is beyond me this time..

  3. #3
    Senior Member zoranvedek's Avatar
    Join Date
    Aug 2001
    Location
    Wagoner OK
    Posts
    893
    Use child movies and scenes. I haven't looked at your examples yet, but that's my gut instinct. Are you in advanced mode?

    If I get time later I'll take a look and see what I can do. Right now I'm up to my eyeballs in a cover design, for a local music publication. then I have band practice till 10 this evening, and a date at the bar afterwards, so maybe tommorrow at the earliest. Sorry I can't be of more help right now.

    Try setting up your background on a seperate child than your content, then on your button call the scene in the child movie(with the content) to hide the content, after the content is hidden, use a scene in the child movie(with the content) to call the background to re-appear, you might be able to set a variable in your button to call the child with the new content from the movie with the background in it(if x=1 load movie_12, if x=2 load movie_13, etc....).......

    Hope this helps you some. If you're not using adavanced options, all of this might be greek to you....

    -J

  4. #4
    Member
    Join Date
    Apr 2006
    Posts
    94
    Quote Originally Posted by zoranvedek
    Use child movies and scenes. I haven't looked at your examples yet, but that's my gut instinct. Are you in advanced mode?

    If I get time later I'll take a look and see what I can do. Right now I'm up to my eyeballs in a cover design, for a local music publication. then I have band practice till 10 this evening, and a date at the bar afterwards, so maybe tommorrow at the earliest. Sorry I can't be of more help right now.

    Try setting up your background on a seperate child than your content, then on your button call the scene in the child movie(with the content) to hide the content, after the content is hidden, use a scene in the child movie(with the content) to call the background to re-appear, you might be able to set a variable in your button to call the child with the new content from the movie with the background in it(if x=1 load movie_12, if x=2 load movie_13, etc....).......

    Hope this helps you some. If you're not using adavanced options, all of this might be greek to you....

    -J
    I think what you're explaining is what I already have on "Site1", I'm looking for something that looks more professional like on this site
    Anyway, Good luck with your date, and I hope someone can help me out tomorrow

  5. #5
    Senior Member zoranvedek's Avatar
    Join Date
    Aug 2001
    Location
    Wagoner OK
    Posts
    893
    Simple enough, the button shows the "doors' Closing and after they close simply switches out the content, they open with new content. In a case like this I'd set up all my content on a slide show, give each button a variable to pass to the movie holding the "doors", and then add a scene after the doors are closed, and before they are opened to use that variable to call the slide with the needed content. I can think of at least one other way to do it(using layers or child movies), but I think that might be the simplest. Child movies would allow you to animate the content though, either way it's basically the same.......

    -Jason

  6. #6
    Member
    Join Date
    Apr 2006
    Posts
    94
    I perfectly understand what you mean, I only don't know how to do it...

    What I tried so far is this:

    I have a slideshow with all the slides.
    Also I have a menu which refers to the slides on button down.
    Now I created a paint element (the doors)and selected "element has properties" then, I put them inside a layer, and added a layer mask (to prevent the doors from being visible outside my rectangle).
    The problem I have now is that I can't add events (to move the doors) to the "button down" from the menu. I can only add an action (f.i. play element)

  7. #7
    Senior Member zoranvedek's Avatar
    Join Date
    Aug 2001
    Location
    Wagoner OK
    Posts
    893
    Create your own buttons, don't call the slides from the button, simply let each button assign a variable, and play the doors animation(put the doors in a child movie, and set it up with scenes:scene 1=stop, scene 2=animate doors close<--called from button, scene 3=call slide<---variable here, scene 4 open doors, scene 5 goto scene 1), use that variable in the movie with the doors to call the slide with the content.

    Yup it'm confusing myself here, but it'll work. Anyway I'm out for the night, might do an an example for you in the morning, if you haven't worked it out by then....

    -J

  8. #8
    Member
    Join Date
    Apr 2006
    Posts
    94
    I tried all over and over and over and can't get it to work...
    Now, even the mask isn't working anymore

    I deleted all the actions and only left the paintings in my example file...
    Also, I don't think I ever worked with scenes before..?
    *Very confused now*
    Attached Files Attached Files

  9. #9
    Senior Member
    Join Date
    Dec 2006
    Posts
    274
    Something like this? It is just a door effect to hide something and then show something. (use preview to check it out, I have not tested it in Flash player -> the button bug)

    (I'm loading your example after this reply....)
    Attached Files Attached Files

  10. #10
    Member
    Join Date
    Apr 2006
    Posts
    94
    Jep, it's something like that
    Now I only need a mask to prevent it being visible on the whole movie.

    I Have this and I want the doors in the middle rectangle when pressing a button.
    But like you made it, I could perfectly make it with my normal "menu",instead of using buttons..?
    I'll figure out the "go to frame" later, never used that before

    Thanks

  11. #11
    Senior Member
    Join Date
    Dec 2006
    Posts
    274
    After testing and thinking this more, my method is too limited as door animation movie does the "slide" change, and I think you could not give parameters to movie (at least without scripting?!)

    And actions to play "door closing", change slide and "opening the door" is bit limited as actions "act" all at once.

    "go to frame" is easy it just starts a movie to play from wanted scene. In my example just "play element" would have done.. at some point I had 2 scenes in my "door" movie

    edit: Actually zoranvedek wrote it like it should go I'll try if I can make an example..

  12. #12
    Member
    Join Date
    Apr 2006
    Posts
    94
    Quote Originally Posted by Finjogi
    After testing and thinking this more, my method is too limited as door animation movie does the "slide" change, and I think you could not give parameters to movie (at least without scripting?!)

    And actions to play "door closing", change slide and "opening the door" is bit limited as actions "act" all at once.

    "go to frame" is easy it just starts a movie to play from wanted scene. In my example just "play element" would have done.. at some point I had 2 scenes in my "door" movie

    edit: Actually zoranvedek wrote it like it should go I'll try if I can make an example..
    Ok thnx

  13. #13
    Senior Member
    Join Date
    Dec 2006
    Posts
    274
    Ok, now it should work, but sorry, menu is more broken in latest 3dfa release than button so I use buttons

    It was quite easy after all.
    - button sets a "slide" variable and plays door movie
    - Door movie calls function to change slide in middle of movie.
    (instruction could work also -> element ("Slide show 3").showSlide (slide); )
    Attached Files Attached Files

  14. #14
    Member
    Join Date
    Apr 2006
    Posts
    94
    Wow, it works
    It's not very easy to do but it works

    Well, I'm learning every day...Never worked with actions (call, let,..) but I have some basic Java and PHP knowledge so I understand the "way it is working".

    Only one thing I do not understand...
    I think the " Let slide = "Slide 1" " passes the slide to the action in the door movie event (call door_effect => showslide) but I can't see "slide" be defined as variable and I can't see "door_effect" to be defined as a variable...
    door_effect is the movie name, so that could make sense...But the slide?? shouldn't that have to be "Slideshow 3" ?
    (Wow it's not simple for me to explain something like this in english )

  15. #15
    Member
    Join Date
    Apr 2006
    Posts
    94
    Maybe I figured it out...

    => Let slide = "slide 1"
    => This makes content of "slide 1" shown in slide

    => Let slide = "slide 2"
    => This makes content of "slide 2" shwn in slide

    So in java this would be like

    string slide

    when pushing button 1:
    => slide = "slide 1"

    when pushing button 2:
    => slide = "slide 2"

    and so on??
    Last edited by my_6th_sense; 01-06-2007 at 09:29 AM.

  16. #16
    Senior Member
    Join Date
    Dec 2006
    Posts
    274
    Yep, just open "Starting script" ( button located above elements part), there is slide variable and showSlide() function defined

    edit:
    "door_effect" is main movie name so function defined under main movie are called like "movie_name.function_name(param_name)" and so on...
    Last edited by Finjogi; 01-06-2007 at 09:42 AM.

  17. #17
    Member
    Join Date
    Apr 2006
    Posts
    94
    Ok thnx

    I wish I had a good memory
    I'll probably have to check your example file again for about 200 times before I can create one all by myself

    One question, what did you mean by: "menu is more broken in latest 3dfa release than button "?
    I'm not having any problems with menus...?

    Greetings

  18. #18
    Senior Member
    Join Date
    Dec 2006
    Posts
    274
    there is some bug in buttons and menu, you only can set variable values by calling you own function. Bit hard to describe but..

    for example: action "Let slide = "Slide 1" do not work, "slide" variable do not change/update.

    but if I make function:
    function letSlide(s){
    slide = s;
    }

    and use action "Call function" -> mymovie.letSlide("Slide 1")
    then variable "slide" updates.

    See thread http://board.flashkit.com/board/showthread.php?t=715882

  19. #19
    Member
    Join Date
    Apr 2006
    Posts
    94
    Hmm, I tried applying it to my file but it didn't work...
    I must be missing something..Can you take a look?

    I created a "door movie" child movie with actions in it.
    I created a textbutton with actions...
    I inserted the same starting script as you, but changed the "Slide show 3" to "Slide show 1" since I'm using slide show 1...

    Greetings
    Attached Files Attached Files

  20. #20
    Member
    Join Date
    Apr 2006
    Posts
    94
    Ok it's working now....
    After 2 hours of searching I found out that I couldn't copy/paste the actions but I had to insert them myself for some reason :s
    It's working fine now

    Thanx a lot for the help!

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