A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: Progam animating

  1. #1
    Member
    Join Date
    Nov 2000
    Posts
    52
    Could someone please show me some love and help me out. Ok here is my question, I know how to animate without using tweens such as this: "_root.ball._x += 10;", now my question is how would I make my movie clip "ball" to stop at a certain place?

  2. #2
    Senior Member
    Join Date
    Nov 2000
    Posts
    168
    you need to put that code in an empty movie clip and then select linkage and give it an identifier. then you can use attachMovie and removeMovieClip to start and stop the movement.

    -dan

  3. #3
    deva_station
    Guest
    _root.ball._x += 10;
    if (_root.ball._x>=400){
    _root.ball._x=400;
    }

  4. #4
    Member
    Join Date
    Nov 2000
    Posts
    52

    It worked

    Hey it worked, thanks. Okay I have one more question, after the ball has moved to a specific area how do I make it go down right after it has moved to the right?

  5. #5
    Senior Member
    Join Date
    Nov 2000
    Posts
    168
    I'll assume you're using deva_station's code to do this. In this case you could put _root.ball._y -= 10; after the if statment, instead of stopping it at 400 just start moving it down when it gets to 400.

    -dan

  6. #6
    Member
    Join Date
    Nov 2000
    Posts
    52

    Response

    Okay I tried that but the problem is it slants, I don't want it to slant. This is what I put:

    _root.ball._x += 20;

    if(_root.ball._x >= 550){
    _root.ball._x = 550;
    }


    _root.ball._y += 10;

    And when I view it, the ball slants, how do I make it go down right after it goes to the right, Thanks.

  7. #7
    Senior Member
    Join Date
    Nov 2000
    Posts
    168
    _root.ball._x += 20;

    if(_root.ball._x >= 550){
    _root.ball._y += 20;
    }


  8. #8
    deva_station
    Guest
    i will assume you are using a timelime loop, to achieve your goal, its probably best to use a 4 frame timeline loop as described below:

    1. the timeline loop will consist of 4 frames.
    2. frames 2 and 4 will have gotoAndPlay (prevFrame);

    3. frame 1 will have the following code:
    _____________________________________

    _root.ball._x += 10;
    if (_root.ball._x>=400){
    _root.ball._x=400;
    gotoAndPlay (3);
    }
    _____________________________________


    4. frame 3 will hold the following code:

    _root.ball._x -= 10;
    if (_root.ball._x<=10){
    _root.ball._x=10;
    gotoAndPlay (1);
    }


    these figures are obviously for illustration purposes, use this code as it suits your project, try that and let me know if it works.

  9. #9
    Member
    Join Date
    Nov 2000
    Posts
    52

    Thanks

    Thankyou very much that was a big help:

  10. #10
    deva_station
    Guest
    anthos what exactly are you trying to acheive?

    do you want the ball to move from left to right and back again? or left to right and then down?

    either way that code i posed in my previous reply should get you going in the right direction, just modify the _x with _y to make it go vertically... you know what i mean

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