Loading ...
Sorry, an error occurred while loading the content.

simulate click on flash banner

Expand Messages
  • Sasha
    hello i want to be able to simulate (on event) a mouse click on a flash banner (on various areas). i tried with http://developer.yahoo.com/yui/yuitest/ and i
    Message 1 of 4 , May 23 10:34 AM
    • 0 Attachment
      hello

      i want to be able to simulate (on event) a mouse click on a flash
      banner (on various areas). i tried with
      http://developer.yahoo.com/yui/yuitest/ and i was able to simulate a
      click on a link for example, but i couldn't make it work for a flash
      banner (object). does anyone have any idea why or how can i make this
      happen?

      thanks a lot!
    • Sasha
      this is the flash object:
      Message 2 of 4 , May 24 6:25 AM
      • 0 Attachment
        this is the flash object:

        <object allowScriptAccess="always" id="flash_object"
        onclick="alert('click');"
        classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
        codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0"
        width="250" height="250">
        <param name="movie" value="/movie.swf" />
        <param name="quality" value="high" />
        <PARAM NAME="allowScriptAccess" VALUE="always">
        <embed src="/movie.swf" quality="low"
        pluginspage="http://www.macromedia.com/go/getflashplayer"
        type="application/x-shockwave-flash" width="250" height="250"></embed>
        </object>

        i've tried this piece of code on a flash object:

        <script type="text/javascript">
        var element = document.getElementById("flash_object");

        //simulate a click Alt key down
        YAHOO.util.UserAction.click(element, { altKey: true});

        </script>


        it actually prints 'click' but it does not execute the on (release)
        event inside the flash banner (it doesn't simulate the click itself).

        can someone please tell me what i am doing wrong?
      • Nicholas Zakas
        I don t believe you re doing anything I wrong. I think (but am not sure) that Flash movies don t actually receive DOM events from the browser. Although the
        Message 3 of 4 , May 29 10:10 AM
        • 0 Attachment

          I don’t believe you’re doing anything I wrong. I think (but am not sure) that Flash movies don’t actually receive DOM events from the browser. Although the <object> element will respond when you put an onclick event handler on it, Flash handles click events on movies by itself. In the normal flow of a web page, a click maps as both a DOM click event and a Flash click event, but in this case it seems that the Flash click event just isn’t generated with the simulated click. I wish I could lend more insight, but I’m just not that familiar with the internal working of Flash.

           

          Regards,

          Nicholas

           


          From: ydn-javascript@yahoogroups.com [mailto: ydn-javascript@yahoogroups.com ] On Behalf Of Sasha
          Sent: Saturday, May 24, 2008 6:26 AM
          To: ydn-javascript@yahoogroups.com
          Subject: [ydn-javascript] Re: simulate click on flash banner

           

          this is the flash object:

          <object allowScriptAccess= "always" id="flash_object"
          onclick="alert( 'click'); "
          classid="clsid: D27CDB6E- AE6D-11cf- 96B8-44455354000 0"
          codebase="http://download. macromedia. com/pub/shockwav e/cabs/flash/ swflash.cab# version=7, 0,19,0"
          width="250" height="250" >
          <param name="movie" value="/movie. swf" />
          <param name="quality" value="high" />
          <PARAM NAME="allowScriptAc cess" VALUE="always" >
          <embed src="/movie. swf" quality="low"
          pluginspage= "http://www.macromed ia.com/go/ getflashplayer"
          type="application/ x-shockwave- flash" width="250" height="250" ></embed>
          </object>

          i've tried this piece of code on a flash object:

          <script type="text/javascri pt">
          var element = document.getElement ById("flash_ object");

          //simulate a click Alt key down
          YAHOO.util.UserActi on.click( element, { altKey: true});

          </script>

          it actually prints 'click' but it does not execute the on (release)
          event inside the flash banner (it doesn't simulate the click itself).

          can someone please tell me what i am doing wrong?

        • Sasha
          hello Nicholas, thanks for the reply. i found on adobe site some documentation: http://www.adobe.com/support/flash/publishexport/scriptingwithflash/sc
          Message 4 of 4 , Jun 1, 2008
          • 0 Attachment
            hello Nicholas, thanks for the reply.

            i found on adobe site some documentation:
            http://www.adobe.com/support/flash/publishexport/scriptingwithflash/sc
            riptingwithflash_03.html , but i think the click on the object (on
            certain areas to trigger on press event) is out of the question.
            maybe i should ask for the movie to be modified to accept events
            other than external clicks.

            thanks


            --- In ydn-javascript@yahoogroups.com, "Nicholas Zakas" <nzakas@...>
            wrote:
            >
            > I don't believe you're doing anything I wrong. I think (but am not
            sure)
            > that Flash movies don't actually receive DOM events from the
            browser.
            > Although the <object> element will respond when you put an onclick
            event
            > handler on it, Flash handles click events on movies by itself. In
            the
            > normal flow of a web page, a click maps as both a DOM click event
            and a
            > Flash click event, but in this case it seems that the Flash click
            event
            > just isn't generated with the simulated click. I wish I could lend
            more
            > insight, but I'm just not that familiar with the internal working of
            > Flash.
            >
            >
            >
            > Regards,
            >
            > Nicholas
            >
            >
            >
            > ________________________________
            >
            > From: ydn-javascript@yahoogroups.com
            > [mailto:ydn-javascript@yahoogroups.com] On Behalf Of Sasha
            > Sent: Saturday, May 24, 2008 6:26 AM
            > To: ydn-javascript@yahoogroups.com
            > Subject: [ydn-javascript] Re: simulate click on flash banner
            >
            >
            >
            > this is the flash object:
            >
            > <object allowScriptAccess="always" id="flash_object"
            > onclick="alert('click');"
            > classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
            >
            codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swfl
            as
            > h.cab#version=7,0,19,0
            >
            <http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#v
            er
            > sion=7,0,19,0> "
            > width="250" height="250">
            > <param name="movie" value="/movie.swf" />
            > <param name="quality" value="high" />
            > <PARAM NAME="allowScriptAccess" VALUE="always">
            > <embed src="/movie.swf" quality="low"
            > pluginspage="http://www.macromedia.com/go/getflashplayer
            > <http://www.macromedia.com/go/getflashplayer> "
            > type="application/x-shockwave-flash" width="250"
            height="250"></embed>
            > </object>
            >
            > i've tried this piece of code on a flash object:
            >
            > <script type="text/javascript">
            > var element = document.getElementById("flash_object");
            >
            > //simulate a click Alt key down
            > YAHOO.util.UserAction.click(element, { altKey: true});
            >
            > </script>
            >
            > it actually prints 'click' but it does not execute the on (release)
            > event inside the flash banner (it doesn't simulate the click
            itself).
            >
            > can someone please tell me what i am doing wrong?
            >
          Your message has been successfully submitted and would be delivered to recipients shortly.