A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: beginner action script

  1. #1
    Member
    Join Date
    Dec 2001
    Posts
    65

    beginner action script

    hi there i just need something clearing up

    i have mad a simple circle move left and right on a key press.

    what i want to do now is have a dynamic text display go up in 100's as the left key is pressed

    my code to move the ball is below, what would i have to do to make a dynamic text display show 100++ everytime the left key is pressed . .if this is still unlcear

    what i want to do is make a dynamic text box incrememnt by 100 every time the left key is pressed...... so on 8 presses the dynamic box will show 800..

    thanks for any help at all . . . cheers

    my code on my ball movie clip is

    onClipEvent (keyDown)
    {
    if (Key.isDown( key.LEFT))
    {
    _x-=10;
    }

    //im assuming some kind of code will go here

    }

    onClipEvent (keyDown)
    {
    if (Key.isDown( key.RIGHT))
    {
    _x+=10;
    }
    }
    Last edited by rholding2000; 08-12-2005 at 04:57 AM.

  2. #2
    Senior Member corky§urprise's Avatar
    Join Date
    Jun 2005
    Posts
    346
    onClipEvent(load) {
    speed=10
    _root.score=0
    }
    onClipEvent (enterFrame) {
    if (Key.isDown(key.LEFT)) {
    this_x-=speed
    }
    }
    on (keyPress "<Left>") {
    _root.score+=100
    }

    onClipEvent (enterFrame) {
    if (Key.isDown(key.RIGHT)) {
    this_x+=speed
    }
    }

    Something like that? (Give the dynamic text a variable of score)

  3. #3
    Member
    Join Date
    Dec 2001
    Posts
    65
    excellent mate, thanks a lot

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