3 Replies Latest reply on Aug 8, 2007 10:02 AM by Newsgroup_User

    Video with a Button on top (k)

    Level 7
      I have a moving scrollbar with stills from various FLV videos. When the
      user rolls over a still it stops the scrollbar and plays the
      video(videos are about 5 seconds long). I want a button to pop up after
      about 2 seconds that says "Play Entire Video". I accomplished this by
      putting a cuePoint into the FLV at around 2 secs.

      Problem I am having is with the rollOut of the video. Prior to the
      addition of this button, I had rollOut that stopped the play of the
      video. What's happening is that when I roll onto the button that pops up
      after 2sec, flash is seeing that as me rolling out of the video and
      stops the video from playing.

      So what I want to accomplish is this:

      Imagine the Japanese flag, a rectangle with a red dot in the middle.

      The white part of the flag is the video, the red dot, the button.

      After two seconds of video play, the red dot appears. When you rollover
      the red dot, the video continues to play uninterrupted. When you roll
      out of the white part of the flag, the video stops.

      -Kirk
        • 1. Re: Video with a Button on top (k)
          Rothrock Level 5
          Totally unrelated, but what is the "(k)" in your topic? I see this all the time and I have no idea what it means.

          I'm taking it this is AS2, since this is a difficulty that was addressed in AS3.

          You have several different choices depending upon how you want to structure things. But the main thing is you will need to change it so that you aren't using the built in onRollOut event or maybe change the onRollOver of the button.

          With AS2, only one item at a time can receive the clip events, so if you roll over one, you must be rolling out of another (assuming it has a defined event handler).

          If you put the button inside the movieclip, then the parent will just intercept all the events.

          I see two solutions (or variations on solutions) either change it so that the button has an invisible hit area the size and shape of the video, cancel the video's onRollOut, and set it up so that a rollout from the new invisible button area is what will trigger stopping the movie. But that will change the cursor for the whole thing and if they click anywhere in the area they will get the button action. Not such a good choice, probably.

          Or you can use hitTest to determine where the mouse is. So when the button appears also do some code like this:

          myButton.onMouseUp=function(){
          if(this.hitTest(_xmouse,_ymouse,true)){
          trace("clicked the button");
          }
          }

          I might have the scope or the coordinates not quite right, but that should do it. Of course it gets a bit more complex if you need a roll over for the button, but you can just use the same idea in an onEnterFrame to see if the mouse is over the button and react accordingly.

          Are you using an actual button? I don't think most folks here actually use those. Instead use a MovieClip with the different states in frames 1-3.

          • 2. Re: Video with a Button on top (k)
            Level 7
            The (k) is just a method for me to find my posts easily in Thunderbird.
            (k) for Kirk

            I am using AS2 and since my post am trying using a movieClip instead of
            buttons. Getting very close and had it working briefly. Of course I
            changed things and now can't get it back to working.

            -kirk


            Rothrock wrote:
            > Totally unrelated, but what is the "(k)" in your topic? I see this all the time
            > and I have no idea what it means.
            >
            > I'm taking it this is AS2, since this is a difficulty that was addressed in
            > AS3.
            >
            > You have several different choices depending upon how you want to structure
            > things. But the main thing is you will need to change it so that you aren't
            > using the built in onRollOut event or maybe change the onRollOver of the button.
            >
            > With AS2, only one item at a time can receive the clip events, so if you roll
            > over one, you must be rolling out of another (assuming it has a defined event
            > handler).
            >
            > If you put the button inside the movieclip, then the parent will just
            > intercept all the events.
            >
            > I see two solutions (or variations on solutions) either change it so that the
            > button has an invisible hit area the size and shape of the video, cancel the
            > video's onRollOut, and set it up so that a rollout from the new invisible
            > button area is what will trigger stopping the movie. But that will change the
            > cursor for the whole thing and if they click anywhere in the area they will get
            > the button action. Not such a good choice, probably.
            >
            > Or you can use hitTest to determine where the mouse is. So when the button
            > appears also do some code like this:
            >
            > myButton.onMouseUp=function(){
            > if(this.hitTest(_xmouse,_ymouse,true)){
            > trace("clicked the button");
            > }
            > }
            >
            > I might have the scope or the coordinates not quite right, but that should do
            > it. Of course it gets a bit more complex if you need a roll over for the
            > button, but you can just use the same idea in an onEnterFrame to see if the
            > mouse is over the button and react accordingly.
            >
            > Are you using an actual button? I don't think most folks here actually use
            > those. Instead use a MovieClip with the different states in frames 1-3.
            >
            >
            >
            • 3. Re: Video with a Button on top (k)
              Level 7
              Actually, I think I can accomplish this using the _ymouse/_xmouse thing.

              Only thing I need to do is write up the code.

              Thanks,
              -kirk




              W. Kirk Lutz wrote:
              > The (k) is just a method for me to find my posts easily in Thunderbird.
              > (k) for Kirk
              >
              > I am using AS2 and since my post am trying using a movieClip instead of
              > buttons. Getting very close and had it working briefly. Of course I
              > changed things and now can't get it back to working.
              >
              > -kirk
              >
              >
              > Rothrock wrote:
              >> Totally unrelated, but what is the "(k)" in your topic? I see this all
              >> the time and I have no idea what it means.
              >>
              >> I'm taking it this is AS2, since this is a difficulty that was
              >> addressed in AS3.
              >>
              >> You have several different choices depending upon how you want to
              >> structure things. But the main thing is you will need to change it so
              >> that you aren't using the built in onRollOut event or maybe change the
              >> onRollOver of the button.
              >>
              >> With AS2, only one item at a time can receive the clip events, so if
              >> you roll over one, you must be rolling out of another (assuming it has
              >> a defined event handler).
              >>
              >> If you put the button inside the movieclip, then the parent will just
              >> intercept all the events.
              >>
              >> I see two solutions (or variations on solutions) either change it so
              >> that the button has an invisible hit area the size and shape of the
              >> video, cancel the video's onRollOut, and set it up so that a rollout
              >> from the new invisible button area is what will trigger stopping the
              >> movie. But that will change the cursor for the whole thing and if they
              >> click anywhere in the area they will get the button action. Not such a
              >> good choice, probably.
              >>
              >> Or you can use hitTest to determine where the mouse is. So when the
              >> button appears also do some code like this:
              >>
              >> myButton.onMouseUp=function(){
              >> if(this.hitTest(_xmouse,_ymouse,true)){
              >> trace("clicked the button");
              >> }
              >> }
              >>
              >> I might have the scope or the coordinates not quite right, but that
              >> should do it. Of course it gets a bit more complex if you need a roll
              >> over for the button, but you can just use the same idea in an
              >> onEnterFrame to see if the mouse is over the button and react
              >> accordingly.
              >>
              >> Are you using an actual button? I don't think most folks here
              >> actually use those. Instead use a MovieClip with the different states
              >> in frames 1-3.
              >>
              >>
              >>