dcsimg
A Flash Developer Resource Site

Results 1 to 11 of 11

Thread: animation on button click

  1. #1
    Senior Member
    Join Date
    Jun 2002
    Posts
    127

    animation on button click

    Hello,

    I am in the process of making a flash site. I have a six buttons which trigger an animation like the one found on http://www.417north.com/ my site is found on http://www.geocities.com/vancouverband

    I had no problem with the transition, but when you press home, I want the box which holds the content to fold up, and when you click on any of the other buttons, it opens back up and stays open till you press home again.


    Thanks,

    Greg

  2. #2
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    This has been covered in a lot of threads. Search for transition mc or transition effect.

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

  3. #3
    Senior Member
    Join Date
    Jun 2002
    Posts
    127
    I cant seem to find any examples. Maybee I was a little unclear. this is the kind of thing I am looking for.

    on the home button= if the box is expanded, trigger the clip to
    close it, but if it is already closed, keep it
    that way.

    on the rest of the buttons= if the box is closed, trigger the clip
    that expands it, but if it is allready
    open, keep it that way.


    thanks alot


    greg

  4. #4
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    I dont quite follow. I cant see any box that is closed. I just see a scrolling movieclip beside the buttons on your site.

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

  5. #5
    Senior Member
    Join Date
    Jun 2002
    Posts
    127
    Right, I can't get the box to close, the box which I am refering to is the one which surrounds the scrolling movie clip

  6. #6
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    What is the box? A movieclip? Do you have a animation a of the box closing? I guess you want the scrolling content to close with the box as well.

    You could make a movieclip of the box with a close and opening animation inside it ( with framelabels at the starting point of each (open, close). And a stop action on the first frame so it does not play at first and a stop action in the middle , before the close animation.

    Then setting the scrolling mc to invisible at all times the box is not open.

    // On first frame of main timeline
    scrollMC._visible=0;

    All buttons but Home will have this included

    // Code to add to buttons exept home
    if(once!=1){
    boxMC.gotoAndPlay("open");
    once=1;
    }

    That will make the box open just once the first button is clicked.Then it will stay put at the stop action before the close framelabel. Thats until you click home.

    // Code to add to home button
    scrollMC._visible=0;
    boxMC.gotoAndPlay("close");

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

  7. #7
    Senior Member
    Join Date
    Jun 2002
    Posts
    127
    That did not seem to work, I attached the fla, perhaps that would help.

    Thanks
    Attached Files Attached Files

  8. #8
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    As I dont have the fonts I couldnt make the mask work, but here is the general idea. Check NEWS and HOME buttons. I also named the box mc to box.

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

  9. #9
    Senior Member
    Join Date
    Jun 2002
    Posts
    127
    well, that works at first, but check it again. The animation only will come up one time. If you hit news then home and then news again, you will still be left with an empty screen

  10. #10
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    I forgot, you can add this to the home button.

    _root.once=0;

    This is not an ideal solution. I just tried to think of a simple way to do it. It will probably be better to apply a fade to the general movieclip or making the box into a hole in the page or a monitor of some sort or having the mask grow or......

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

  11. #11
    Senior Member
    Join Date
    Jun 2002
    Posts
    127
    that did the trick, thanks alot

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