6 Replies Latest reply on Jun 12, 2007 1:56 PM by Newsgroup_User

    applying actions

    kimsue02
      Hi,
      I know you can apply an action to a specific object, but is there a way to apply an action to the whole flash movie?
      thanks!
        • 1. Re: applying actions
          Rothrock Level 5
          Yes. Maybe. What do you mean?
          • 2. Re: applying actions
            kimsue02 Level 1
            I'm doing a banner which has to include a link. All I know how to do right now is to apply an action, with the url link, to one particular object within the flash move. What I need to do is have the whole flash banner be one big link, so where you can click anywhere in that banner, not just on a particular object. I'm not sure how to do that.
            Hope I explained that OK...
            Thanks.
            • 3. Re: applying actions
              Rothrock Level 5
              Ah, I see. I think you might want to look at onMouseUp

              onMouseUp=function(){
              trace("the mouse was released");
              }

              The mouse events often trip up people because they expect that it refers to a specific clip. But Mouse actions are only related to the Mouse. If you attach this to different clips:

              clip1.onMouseUp=function(){
              trace("click received by "+this);
              }

              clip2.onMouseUp=function(){
              trace("click received by "+this);
              }

              You will get two message because everybody receives the click.
              • 4. Re: applying actions
                kimsue02 Level 1
                I'm lost :) I really don't know that much about actions. All I know is I select an object and down int he actions window I put in the action script code.

                If I tried what you are suggesting, where exactly do I put the code if I'm not selecting a specific object?

                I'm not sure if this is the most efficient way to do something like this, but what if I created a shape the same dimensions as my canvas, converted that to a symbol and made it alpha=0% and applied the action to that?
                • 5. Re: applying actions
                  SymTsb Level 2
                  actually, that's what you should do. If nothing in the banner requires any kind of movement or response from the user, that is the easiest approach. Cover your stage with one giant button and code the getURL or whatever to that button.
                  • 6. Re: applying actions
                    Level 7
                    >> I'm not sure if this is the most efficient way to do something like this,
                    >> but
                    what if I created a shape the same dimensions as my canvas, converted that
                    to a
                    symbol and made it alpha=0% and applied the action to that?

                    That will work, but Rothrock's method is better - as he said mouse events
                    aren't specific to a clip - so all you need to do is create a listener and
                    add a mouseUp to it. In your main timeline, select a frame, (should be your
                    script layer) and add this code:

                    var mouseListener = new Object();
                    mouseListener.onMouseUp = function(){
                    getURL("myURL","_blank");
                    }
                    Mouse.addListener(mouseListener);


                    Now, anytime you click in your movie the getURL will execute.

                    --
                    Dave -
                    Head Developer
                    http://www.blurredistinction.com
                    Adobe Community Expert
                    http://www.adobe.com/communities/experts/