Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    May 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation Need help in creating a flash menu which show/hide on button click.

    Hi,

    I wish to create a flash menu which should scroll up from botton of movie on clicking a single "View menu" button.
    The text on the button should show "Hide menu" when menu is displayed.
    Up on clicking the same button whose text is "Hide menu" now, the menu should scroll down and hide from stage.
    The text on the button again revert to "Show Menu"

    Please help me creating this.Any valuable help is appreciated.

    Thank you.

  • #2
    Senior Coder gnomeontherun's Avatar
    Join Date
    Sep 2007
    Location
    Houston
    Posts
    2,846
    Thanks
    10
    Thanked 238 Times in 229 Posts
    Do you have Flash? Do you have anything created now?

    I'm not a code machine...you can use Google if you want to find free scripts. If you have a question about coding and are willing to try to make it first, then we can help.

    Not trying to sound rude, but we aren't here to just code things for people, we are here to help others code on their own.

  • #3
    New to the CF scene
    Join Date
    May 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Here is what I did

    Hi Jeremy,

    I am sorry if you felt in that way. I am not a lazy freak who wants some one else to do the job which i should do. Only thing was that my message was incomplete.

    Here is the action script i wrote which is running in the root, frame1


    Movieclip.prototype.scrollme = function(yPos)
    {

    this._y -= (this._y-yPos)/5;
    };

    out = false;


    menu.onEnterFrame = function() {


    if (out) {

    this.scrollme(75);
    } else {
    this.scrollme(100);
    }
    };


    //To give an elastic property on mouse over

    Movieclip.prototype.elasticScale = function(targetS, accel, convert) {
    this.step = this.step * accel + (targetS - this._xscale) * convert
    this._xscale = this._yscale += this.step
    }


    // Button actions

    for(i=1;i<6;i++){
    theButton=_root.menu["but"+i];
    theButton.thisNum=i;

    theButton.onEnterFrame=function() {

    if (_root.menu["but"+this.thisNum].overMe) {

    this.elasticScale(150, 0.7, 0.3)
    } else {
    this.elasticScale(100, 0.7, 0.3)
    }
    }

    }
    theButton.onRollOver=function(){

    _root.menu["but"+this.thisNum].overMe=true;

    _root.menu["but"+this.thisNum].swapDepths(4000)
    }

    theButton.onRollOut=function(){

    _root.menu["but"+this.thisNum].overMe=false;
    }

    // show hide button

    showhide.onRelease = function() {

    if (out) {

    out = false;

    } else {

    out = true;

    }};

    My issue is that the show hide button is not doing what it should do.The menu is not popping up when the button is clicked.

    I know that you were trying not to be rude.but that was good enough to discourage a new coder registered in this forum.

    I was only looking for a suggestion .Not your code.Thanks for your advice about the possibilities of google.


    Thanks for your time.

  • #4
    Senior Coder gnomeontherun's Avatar
    Join Date
    Sep 2007
    Location
    Houston
    Posts
    2,846
    Thanks
    10
    Thanked 238 Times in 229 Posts
    No problem, I'm just trying to get enough information about your problem so that we can actually help. Sometimes people try to get us to just do their work, so thanks for the code now we can actually do some help. We try to be helpful when we can, but its very hard sometimes with out any information to go on, and sometimes we get people who just want us to provide them our code. I even see every few days someone who doesn't even have Flash trying to make a flash program, and that shows a serious lack of attempt on their part. That is what I want to prevent, so my apologies if you were put off.

    I'm not sure what your level of AS knowledge is? Your menu is contained in a movieClip right? You are writing or combining a lot of code which can be simplified greatly. Basically you can create this effect with Tweens, which are documented here, and with only about 8 lines of code or so. Basically on a button click you will call the Tween class to slide it up.

    Here is a basic demonstration, which you can further develop from.

    Code:
    buttonname.onRelease {
    var myTween:Tween = new Tween (menu_mc,"_y",Strong.easeOut,500,100,2,true);
    }

  • #5
    New to the CF scene
    Join Date
    May 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile

    Hi Jeremy,

    Thank you very much. You were very helpful.
    I went through the documentation link you gave me.
    I restructured the code using tweening .
    It is working fine now.

    Thank you.


  •  

    Posting Permissions

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