Flash Advisor logo
:: Desktop Shortcut
:: Flash Help
Advice from Experts

Closed Thread
Results 1 to 6 of 6

Thread: Embedded buttons don't work-- Help me please

  1. #1

    Default Embedded buttons don't work-- Help me please

    Help! I'm a newbie to actionscript and am working on a pop-up menu in Flash 8.

    You can see the menu at: http://integreview.wildwoodclient.com/

    Here is the problem. I want the pop-ups to close when the user rolls off the menu. However, when I use code:

    on (rollOut){
    _parent.gotoAndPlay(1);
    }

    and place it on the popup menu object, the buttons embedded within the object do not function-- No link-- no rollover to yellow. The first menu items has the above code attached. The ones below do not.

    I can see that the problem is that when I use the event on the parent object (the menu itself) the child objects (the buttons) do not function. How do I make the child objects function as well as the on(rollOut) action on the parent object?

    Any help you can give me is appreciated-- and be gentle.. I'm still new at this

    Thanks,

    Mark

  2. #2
    Join Date
    May 2004
    Location
    U.S.A.
    Posts
    2,890

    Default

    Hi,

    What your doing is negating the child object with the parent objects code. A button inside a movieclip has a rollOver property. However, if the movieclip holding the button also has a rollOver event, it will fire first and the button inside wont. This is called competeing events. The same thing occurs if you put a movieclip inside of a movieclip with the same situation. The solution would require you to seperate the objects. Using movieclips as buttons allows you a bit more control than button code. Say you have two movieclips on seperate layers, you could then do something like....

    Code:
    myMC.onRollOver=function(){
    myMC2.gotoAndPlay("open");
    }
    myMC2.onRollOver=function(){
    //do something;
    }
    A mind once stretched by a new idea never regains its original dimensions.
    - Oliver Wendell Holmes

  3. #3

    Default Next steps

    I put the following in my actionscript layer in frame 1:

    Code:
    _root.about_pop.onRollOut=function(){
    	trace("In the about_pop rollOut Function");
    	_root.gotoAndPlay(1);
    }
    stop();
    The trace doesn't appear in the output window so I know the function isn't firing. The instance of the of the window I want the rollOut to apply too is called about_pop.

    What am I missinghere?

    I really appreciate your assistance!

    Mark

  4. #4
    Join Date
    May 2004
    Location
    U.S.A.
    Posts
    2,890

    Default

    Hi,

    There is nothing wrong with that code. Make sure the movieclip has an instance name and your not using the object library name. Check the targetting option to see if the movieclip is listed.(the crosshair symbol) If the movieclip is nested inside another movieclip. The parent clip needs to be referenced in the path....

    myMC1.myMC2.onRollOver=function(){

    }

    although, this looks a bit suspicious......

    _root.gotoAndPlay(1);

    is your movieclip that is using that code not on frame 1 already? If not, the code layer needs to be extended to the length of the timeline conaining the object it is trying to assign the code to.
    A mind once stretched by a new idea never regains its original dimensions.
    - Oliver Wendell Holmes

  5. #5

    Default Half way there

    YOur help is most appreciated.

    Well it worked... When I rollOut of that movie clip the clip disappears, but the embedded buttons on the clip are still not functional.

    Do I have to address the object... and every object within it directly through the code?

    Mark

  6. #6
    Join Date
    May 2004
    Location
    U.S.A.
    Posts
    2,890

    Default

    Hi,

    Having a rollOver event on a movieclip will disable the rollOver code for the button, effectivly disableing the button. I'm not exactly clear on what your trying to achieve. I suggest using movieclips instead of buttons and seperating content that needs specialized code.
    A mind once stretched by a new idea never regains its original dimensions.
    - Oliver Wendell Holmes

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Replies: 1
    Last Post: 08-29-2006, 11:13 PM
  2. Replies: 3
    Last Post: 07-28-2006, 10:01 PM
  3. Lines Around Embedded SWF
    By ziola111 in forum Newbies
    Replies: 1
    Last Post: 05-16-2006, 02:26 PM
  4. Looping and buttons(without loop button doesn't work)
    By KingKong in forum Flash Scripting
    Replies: 3
    Last Post: 12-25-2004, 02:55 PM
  5. Question about embedded audio
    By jjjones in forum Sound and Music
    Replies: 3
    Last Post: 09-03-2003, 11:56 AM

Bookmarks

Posting Permissions

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