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 2009
    Posts
    113
    anyone who could help me? Bec. I dont really have an idea how to start. Is it possible?


    and can someone tell me what is the meaning of this.addEventListener(KeyboardEvent.KEY_UP,keyPres sed); in this code:

    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="init();">
    <mx:Script>
    <![CDATA[
    private function init():void {
    i.setFocus();
    this.addEventListener(KeyboardEvent.KEY_UP,keyPres sed);
    }

    private function keyPressed(event:KeyboardEvent):void {
    if(event.keyCode.toString()=="84" && event.ctrlKey==true)
    ExternalInterface.call('newtab');
    }

    ]]>
    </mx:Script>
    <mx:TextInput x="23" y="268" width="256" id="i" text="Text Box"/>
    </mx:Application>

    <script type="text/javascript">
    function newtab(e){
    document.body.focus();
    window.open('about:blank');
    }
    </script>


    Or is it possible to setfocus on both flash file and html?

    I mean, F1, F2, F3 when clicked will set focus on flash and run Key.getCode() == 113 from flash
    but letters and arrow keys will function in textbox (html)..
    Last edited by ayusuits; 11-02-2009 at 04:43 AM.

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