A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: about rotating MC's .....

  1. #1
    Member
    Join Date
    Oct 2000
    Posts
    53
    hey ppl !

    This is my problem:
    I have want to make a rotating rectangle..
    when the user goes with the mouse over the rectangle, the rotation speed must slow down and when the user goes with the mouse out the rotation speed must speed up until the normal rotating speed ..
    anyone an idea how I can fix this with actionscript ?

    i hope someone will help me ?
    maybe some example code ?
    grtz
    STALKERT

  2. #2
    Welcome to flavour country
    Join Date
    Sep 2000
    Posts
    662
    Make your rectangle mc. Create a new button with the rectangle shape in the last keyframe only. Place an instance of the button over the rectangle in your mc. Add the following actions to the button:

    On(rollover){
    _root.speed=5
    }
    On(rollout){
    _root.speed=10
    }

    Place an instance of your rectangle mc on the stage and click on it. Give it an instance name and open the actions panel where you will enter the following actions:
    (these do not go in a key frame, they are assigned to the mc itself)

    onClipEvent(load){
    _root.speed=10
    }
    onClipEvent(enterframe){
    root.mcname._rotation++_root.speed;
    }

    I haven't tested this to see if it works, but you should be able to get an idea.

  3. #3
    Member
    Join Date
    Oct 2000
    Posts
    53
    thanx for your reply !
    But I think this is not exactly what I needed because the code you gave doesn't slow down or speed up really..

    When I go with the mouse over it's slows down but I want a linear slow down or speed up...
    speed 5....6....7....8...9....10
    not: 5 .. 10

    almost there
    hope u guys will help me once again ..

  4. #4
    Welcome to flavour country
    Join Date
    Sep 2000
    Posts
    662
    Ok, try this. On the button:

    On(rollover){
    _root.up=true
    }
    On(rollout){
    _root.up=false
    }

    On the mc:

    onClipEvent(load){
    _root.speed=10
    }
    onClipEvent(enterframe){
    if(_root.up==true && _root.speed>5){
    _root.speed--;
    root.mcname._rotation++_root.speed;
    }else if(_root.up==false && _root.speed<10){
    _root.speed++;
    root.mcname._rotation++_root.speed;
    }else{
    _root.mcname._rotation++_root.speed;
    }
    }

    Of course you can adjust the numbers to your liking.



    [Edited by thewiz1972 on 05-03-2001 at 05:51 PM]

  5. #5
    Member
    Join Date
    Oct 2000
    Posts
    53
    thx again dude..
    Look at the fla i made..
    It's has to be a menu.. you can see it's still a little buggie..

    http://members.brabant.chello.nl/~j.saanen/site.fla

    anymore hints ?

  6. #6
    I made a little movie with a cube. It is not the same as your movie but if you change the graphics it will work.
    This is the script:
    On the MC :
    onClipEvent (load) {
    this.RotatieSnelheid = 5;
    }
    onClipEvent (enterFrame) {
    _root.Text = RotatieSnelheid;

    this._rotation += RotatieSnelheid;
    if (MuisStatus <> 1) {
    RotatieSnelheid -= 1;
    }
    if (RotatieSnelheid <= 5) {
    RotatieSnelheid = 5;
    }
    if (RotatieSnelheid >= 25) {
    RotatieSnelheid = 25;
    }

    }

    On the Hotspot Frame 1 (on timeline):
    on (rollOver) {

    _root.VierKant.RotatieSnelheid += 2;
    _root.VierKant.MuisStatus = 1;
    }
    on (rollOut) {
    _root.VierKant.MuisStatus = 0;
    }
    Frame 2 of timeline:

    on (rollOut) {
    _root.VierKant.MuisStatus = 0;
    }


    I hope this will help you out.
    If you don't get it, just reply your e-mail and I will send you the movie.

    Geen Dank


  7. #7
    Junior Member
    Join Date
    Sep 2000
    Posts
    27
    cool !
    can you send me the fla-file please ?
    stalker666@chello.nl

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