The forums have permanently moved to forum.kirupa.com. This forum will be kept around in read-only mode for archival purposes. To learn how to continue using your existing account on the new forums, check out this thread.


Results 1 to 2 of 2

Thread: convert AS2 To AS3

  1. #1

    convert AS2 To AS3

    onClipEvent (load) {
    letterkeys = new Array('A','B','C','D','E','F','G','H','I','J','K', 'L','M','N','O','P','Q','R','S','T','U','V','W','X ','Y','Z');
    }
    onClipEvent (keyDown) {
    down1_2_text = Key.getCode();
    if (down1_2_text >= 65 and pressed <= 90) {
    _root.down1_2_text = letterkeys[down1_2_text-65];
    }
    if (_root.down1_2_text == "T") {
    _root.wrong1_2.gotoAndStop("yes");
    } else {
    _root.wrong1_2.gotoAndStop("no");
    }
    _root.gotoAndPlay("base2_2");
    }












    stop();
    greyBG.onRelease = function() {
    gotoAndStop("home");
    };

  2. #2
    Tompa's Avatar
    278
    posts
    Trust me, I'm an engineer
    Code:
    import flash.events.KeyboardEvent;
    import flash.events.MouseEvent;
    var letterkeys = new Array('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z');
    addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
    function keyDownHandler(e:Event):void{
        down1_2_text = e.keyCode;
        if(down1_2_text >= 65 && pressed <= 90){
            down1_2_text = letterkeys[down1_2_text-65];
        }
        if(down1_2_text == "T"){
            wrong1_2.gotoAndStop("yes");
        }else{
        wrong1_2.gotoAndStop("no");
        }
        gotoAndPlay("base2_2");
    }
                    
    stop();
    greyBG.addEventListener(MouseEvent.onRelease, greyBGrelease);
    function greyBGrelease(e:MouseEvent):void{
        gotoAndStop("home");
    }

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012