dcsimg
A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: level click-thru

  1. #1
    Junior Member
    Join Date
    Apr 2005
    Posts
    4

    level click-thru

    I have buttons on the main movie on level 0. On top of that I have smaller swfs loading and unloading into level 1. Everything works fine but the problem is that it is possible to click on the level 1 swfs and activate a button on the main movie below it by mistake. Because of the placement of things on the movies this is actually happening as the viewer is mistaking some graphics on level 1 for an active button (the hand from the lower movie shows through when it is passed over).
    I tried loading the swfs into an empty movie clip instead but the same click-through effect occurred. Any ideas? Thanks.

    p.s. The fla is in MX, but I can easily transfer it to 2004pro if that helps.

  2. #2
    Registered User nunomira's Avatar
    Join Date
    May 2002
    Location
    portugal
    Posts
    7,003
    Hi
    Welcome to FlashKit

    If you place a movie clip (or button) on top of the button(s) you want to disable with the right code applyed to it, you'll get the effect you want.

    Suppose this movie clip is called my_mc:
    code:

    // don't switch to a hand
    my_mc.useHandCursor = false;
    // make sure it would behave as a button
    my_mc.onRelease = function()
    {
    // do nothing
    };
    // hide the mc
    my_mc._alpha = 0;


    Notice that this is useful when you have many buttons, because, if you have one button only (few) you can use the enabled property:
    code:

    my_btn.enabled = false;


  3. #3
    Junior Member
    Join Date
    Apr 2005
    Posts
    4

    disable permanent

    Thank you for your reply. Here’s what happened when I tried it. I used the button code enable =false for each of the buttons calling swfs. (I changed it to address level 0, the level the buttons were on and put the code on the swf itself, that is the swf on level 1. So the code was: _level0_root.Button_Instance_Name.enabled=false; I repeated this code for each button I needed disabled and put it on all the smaller portfolio .swfs on frame 1 of the swf.) It worked, but it left the buttons permanently disabled after I unloaded the swf. So then I tried the other code. I put it on the button for the swf that resides on the main move. First I created an empty movie clip, then attached the code you gave me about making the movie clip a button, then loaded the swf into the empty movie clip. The code on the button was this:

    this.createEmptyMovieClip("empty_mc",1);
    empty_mc.useHandCursor = false;
    empty_mc.onRelease = function()
    {
    };
    empty_mc.loadMovie("portfolioA.swf");
    }

    The buttons did become disabled, but again, permanently also. Then I thought that perhaps that was because the movie clip was still on level 1 even after the swf unloaded from it and if I put a removeMovieClip() on the button that unloads the swf I would get rid of the code disabling the buttons also. But it got dodgy somehow and at that point the code no longer hid the buttons. Could it be because on the swf that was playing was the code to remove the movie clip and it was removed prematurely even though the code was supposedly on a button that didn’t appear until the last frame?
    Part of the problem I think is that I didn’t explain the situation clearly because I think it might be an issue of addressing levels. The smaller swfs that load are portfolio swfs and
    if it helps to see what I’m talking about, the URL is www.zazoudesigns.com.


    In a nutshell, what I need is:

    main movie 900px x 800px (level 0) playing the whole time and buttons on main movie enabled.

    when viewer loads smaller (portfolio) swfs into level 1:
    the main movie continues to play but five of its buttons (the ones underneath the new swf) become disabled to prevent the viewer clicking them.

    when viewer unloads the smaller (portfolio) swf on level 1
    and returns to viewing the main movie the disabled
    buttons are enabled again and the viewer can repeat
    the process again with a different swf.

    Thank you for your help.

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