A Flash Developer Resource Site

Results 1 to 20 of 20

Thread: JAVASCRIPT running flash button

Hybrid View

  1. #1
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    getURL("javascript:command('listen',2)","_self");
    Nope. getURL won't work.


    ExternalInterface.call("listen(2)");

    as long as you have a JS function called listen which takes a number, like 2, as parameter.

    gparis

  2. #2
    Senior Member
    Join Date
    Aug 2009
    Posts
    113
    so I changed it to:

    Code:
    import flash.external.ExternalInterface;
    ExternalInterface.call("listen(2)");
    
    myListener = new Object();
    myListener.onKeyDown = function() {
    
    if (Key.getCode() == 113) {
    getURL("javascript:command('listen',2)","_self");
    }
    };
    Key.addListener(myListener);

    and then javascript will just have to call ExternalInterface.call("listen(2)");
    to run the same script with the flash button?
    Is my understanding correct?

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