Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Actionscript Problem

  • 26-03-2005 5:28pm
    #1
    Registered Users, Registered Users 2 Posts: 191 ✭✭


    Just started learning flash, having problems getting some buttons to work.

    I have a Menu button which when clicked opens up a Submenu which contains two buttons. I want specific text to be displayed when either of these two buttons are pressed. I'm using labels and the following actionscript to jump around the timeline:
    gotoAndStop("startMenu");
    mainMenu_bn.onRelease = function() {
    	gotoAndStop("subMenu");
    };
    text1_bn.onRelease = function() {
    	gotoAndStop("text1");
    };
    text2_bn.onRelease = function() {
    	gotoAndStop("text2");
    };
    

    Clicking the menu works fine, the timeline jumps to the frame labeled "subMenu" and the two buttons appear. But clicking either of these buttons has no effect, the text won't appear. Yet when I start the program on the "subMenu" label (gotoAndStop("subMenu");) the buttons do display the text. :confused:

    Sorry if that was all very confusing, hopefully somebody understands and can tell me what I'm doing wrong. Thanks.


Comments

  • Registered Users, Registered Users 2 Posts: 2,647 ✭✭✭impr0v


    Where is the actionscript that you have posted from? is it on the main timeline and executed when the movie loads?

    I don't understand the purpose of the 'function' you are calling. Surely it would be simpler to leave the
    gotoAndStop("startMenu");
    
    in the main timeline and then have the actions on the buttons themselves.

    I.e. you would have
    on(Release){
             gotoAndStop("subMenu");
    }
    
    on the main button, and then
    on(Release){
            gotoAndStop("text1");
    }
    

    on the first submenu button and replace "text1" with "text2" for the second button.


  • Registered Users, Registered Users 2 Posts: 453 ✭✭dead air


    Have you given instance names to the new buttons on the submenu? Make sure that they have the instance names "text1_bn" and "text2_bn".

    Or, are the two submenu buttons contained in a movie clip? That might also be a reason why they aren't functioning properly.


Advertisement