A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: whats wrong with this?

  1. #1
    Senior Member
    Join Date
    Oct 2000
    Location
    York, Pennsylvania
    Posts
    380
    onClipEvent (enterFrame) {
    if (Key.isDown(Key.RIGHT)) {
    this._x = this._x+10;
    }
    }


    I cannot get this to work in KM. I am trying to move an object when the arrow keys are pressed.

  2. #2
    Senior Member
    Join Date
    Jul 2000
    Posts
    5,087
    I would use this indtead;

    onClipEvent(keyDown) {
    if (Key.getCode() == Key.RIGHT) {
    this._x+=5;
    }
    }


    but that's me...


    Your script is working in the Flash 5 Player standalone for me. It should work.

    I modified it slightly though per my own tastes... this is what I used:

    onClipEvent (enterFrame) {
    if (Key.isDown(Key.RIGHT)) {
    this._x += 10;
    }
    }

  3. #3
    Junior Member
    Join Date
    May 2002
    Posts
    26
    had the same problem till i clicked on the flash file in the browser. then everything seemed to start to work.

    seems the focus doesnt come automatically to the flash on the web page. IS there any way I can get the focus and not have to first click the flash, for key strokes.

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