4 Replies Latest reply on May 17, 2006 7:49 AM by riichieg

    AS Button / hit state HELP!

      I have a clip with a hit state that I want to target frame 1 of another clip on mouseover. (thumbnail effect) There is a stop command on frame one of that secondary clip. On click , I want the secondary clip to play from frame 2, till the end.

      My problem is that Im not experienced with actionscript button behaviors and determining which script commands to use is confusing.

      Can anyone link me or outline what needs to be done here? Thanks
        • 1. Re: AS Button / hit state HELP!
          shyaway Level 1
          are you using btn or mc?
          btn will revert back on mouseout state, however, using mc, you can control where you want it to stop.
          mc can act exactly as a btn would and more.

          script for button, you would have
          //do something

          script for mc
          my_mc.onRelease = function(){
          //do something

          to get the rollover effect that you have for btn, you can use
          my_mc.onRollOver = function(){

          ... and so on.
          • 2. AS Button / hit state HELP!
            riichieg Level 1
            I was using mc. Before I continue, I want to mention that this is a photo gallery. within an entire movie.. Within the main gallery clip are the thumbs( layered individually) . Im only working with one thumb at his time to eliminate further confusion. The first thumb is a MC_g1 This clip simply brightens and fades, on mouse over and out. (the click state can be added later to bring up the actual photo mc) the first frame on layer 2 has a stop action and the last frame has a stop action. Frame 2 is where the thumb tween begins to brighten and fade, The hit symbol is an MC symbol which I believe will be common for all thumbs. I placed this at the lowest layer .in frame 1 of MC_g1. I am thinking otherwise that the hit symbol should be placed over each thumb in the gallery but something tells me that is not correct. The hit symbol is within the clip for the thumb.

            The error message during preview is Statement must appear within on/onClipEvent handler
            my_mc.onRelease = function(){ and the same for each additional command. OUCH!

            There is no doubt that your code is correct. Im questioning my end of it.

            I'm trying very hard to develop this skill but in that detailed description of what I set up above, there is a major, or minor error which I can't see. Thanks for responding shyaway. I need all the help that I can get!
            • 3. Re: AS Button / hit state HELP!
              blemmo Level 1
              Guess you placed the code directly on the MC. If you want that, use on(release){ ... } instead of my_mc.onRelease = ... (these are different handlers!).
              I'd recommend to use my_mc.onRelease, and place the code in the timeline that holds my_mc (the instance 'my_mc' has to be present in that frame, otherwise it won't work). This way you can have all your code in the timeline, and not attached to individual MCs, which is quite easier to manage and overlook.

              • 4. Re: AS Button / hit state HELP!
                riichieg Level 1
                I prefer to work with mc's on this. The following are the error codes that were generated.

                **Error** Symbol=gallery shots, layer=g1 hit, frame=1:Line 1: Statement must appear within on/onClipEvent handler
                g1.onRelease = function(){

                **Error** Symbol=gallery shots, layer=g1 hit, frame=1:Line 5: Statement must appear within on/onClipEvent handler
                g1.onRollOver = function(){

                Total ActionScript Errors: 2 Reported Errors: 2

                in this example I placed the btn graphic over the gallery thumb on a separate layer.

                Perhaps this requires a different approach because I'm not seeing something here. (the following is not on the main timeline)

                If I create a movie clip named gallery_mc from scratch and place a thumb on layer 1, convert the thumb to an mc, open the thumb mc and set the timline as follows: layer1 frame 1 (stop action), layer 1 frame 10 (stop action), layer 2 frame 1 (static image), layer 2 frame 2 (image begins tween), layer 2, frame 10 (image ends tween). being this is the thumb effect mc, the symbol that i created with alpha 0% (is this refered to as the handler?) should be placed on the thumb on the gallery clip stage. I believe thats where is should be (on a different layer than the thumb pic itself). the action should be placed on this symbol.
                So there are two mc's in the example , the gallery mc containing the thumb pic, and the thumb mc.

                If this is false, then what would the layout be?
                note : the main timeline already has a button link to the gallery mc and works. I dont want to revert to button symbols to do this. I prefer this new challenge with btn_mc's.