A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: Cant get drop down menu to work

  1. #1
    Junior Member
    Join Date
    Nov 2010
    Posts
    12

    Exclamation Cant get drop down menu to work

    I'm a newbie, so sorry in advance! I got a lot of help coding this dress up game, and now I would love to be able to have the "banners" in the menu drop down and have for example hair and hair2 and so on. So it SHOULD not be so hard, but I just can't get it to work..
    I tried this tutorial but I got Syntax error when I tried it. And then I tried some other tutorial and then the links didn't work.
    I would really really appreciate if someone could take a look in my code and see if there is a simple solution maybe!
    Thanks! (I will attach an fla-file without the images)

    My version is CS5 but I use AS2 (unfortunaly I know)
    style2.fla

  2. #2
    Member Alloy Bacon's Avatar
    Join Date
    Apr 2011
    Posts
    1,085
    post the code
    the bottle neck helps

  3. #3
    Junior Member
    Join Date
    Nov 2010
    Posts
    12
    But there is sooo much code, isn't it easier to look at the fla-file?

  4. #4
    Junior Member
    Join Date
    Nov 2010
    Posts
    12
    I can't paste all of the code here, it says it's too long :/

  5. #5
    Junior Member
    Join Date
    Nov 2010
    Posts
    12
    Ok now I tried again with the first tutorial, and now I didn't get syntax error for some reason. But the menu button is showing all the time and won't disappear.
    I've made an invisible "catcher button" on a layer below the whole menu as it says in the tutorial, and this is the code
    Code:
    function invisible (){
    	btn_tops2.visible = false;
    }
    	btn_tops.onRollOver = function(){
    		btn_tops2.visible = true;
    	};
    invisible ();
    
    btn_catcher.OnRollOver = function(){
    	invisible();
    }

  6. #6
    Prid - Outing Nig 13's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    1,864
    Hi,

    Love your game, the art is really unique and I love all the different options

    Could you post your updated FLA file where you've tried implementing the drop down effect? I just can't seem to quite understand WHAT you're actually trying to achieve :O
    I am back, guys ... and finally 18 :P

    BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS

  7. #7
    Junior Member
    Join Date
    Nov 2010
    Posts
    12
    Thank you so much! Yes perhaps I'm being a bit unclear. I'm feeling a bit confused myself
    Here is the file with the drop down menu code
    style3.fla

  8. #8
    Prid - Outing Nig 13's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    1,864
    You almost had it, just a few naming errors -- most likely because you're probably used to AS3 or just made a simple mistake

    Code:
    btn_catcher.OnRollOver = function(){
    	invisible();
    }
    you wrote OnRollOver with a capital O -- that's wrong, it's: onRollOver

    also, for the visible property you've been using the AS3 name:

    Code:
    btn_tops2.visible = false;
    the correct AS2 notation is: _visible

    So with all the mistakes cleared up, here's the fixed code you should be using for the buttons:

    PHP Code:
    function invisible(){
        
    btn_tops2._visible false;
    }
    btn_tops.onRollOver = function(){
        
    btn_tops2._visible true;
    };
    invisible();

    btn_catcher.onRollOver = function(){
        
    invisible();

    I hope this works and that it helps you
    I am back, guys ... and finally 18 :P

    BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS

  9. #9
    Member Alloy Bacon's Avatar
    Join Date
    Apr 2011
    Posts
    1,085
    nig
    the bottle neck helps

  10. #10
    Junior Member
    Join Date
    Nov 2010
    Posts
    12
    THANK YOU!! I'm so happy there are nice people like you, helping us n00bs in need. It works perfectly now!

Tags for this Thread

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