Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Making _rotate rotate smoothly

New Here ,
May 22, 2008 May 22, 2008
I have this script:

on (release) {
mc1._rotation -=90;
}

it rotates the movieclip 1, but I want it to rotate smoothly (accelerate and then brake).

How can it be changed?

Rgds
TOPICS
ActionScript
399
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , May 22, 2008 May 22, 2008
Use a tweening class. You could even use an interval, but a class like
Tweener would work better. I use Tweener ( http://code.google.com/p/tweener/)
so using it you'd just do:

import caurina.transitions.Tweener;

on(release){
Tweener.addTween(mc1, {_rotation:-90, time:2});
}

--
Dave -
www.offroadfire.com
Head Developer
http://www.blurredistinction.com
Adobe Community Expert
http://www.adobe.com/communities/experts/


Translate
LEGEND ,
May 22, 2008 May 22, 2008
Use a tweening class. You could even use an interval, but a class like
Tweener would work better. I use Tweener ( http://code.google.com/p/tweener/)
so using it you'd just do:

import caurina.transitions.Tweener;

on(release){
Tweener.addTween(mc1, {_rotation:-90, time:2});
}

--
Dave -
www.offroadfire.com
Head Developer
http://www.blurredistinction.com
Adobe Community Expert
http://www.adobe.com/communities/experts/


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 22, 2008 May 22, 2008
Thanks. I'll give it a try.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 22, 2008 May 22, 2008
I tried:

import caurina.transitions.Tweener;

on(release){
Tweener.addTween(mc1, {_rotation:-90, time:2});
}

It did import the package but the button is not working.

on (release) {
mc1._rotation -=90;
}

was OK.

What is the difference?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 22, 2008 May 22, 2008
LATEST
I think I see what you want. Try this:

on(release){
Tweener.addTween(mc1, {_rotation:mc1._rotation - 90, time:2});
}

That will tween mc1 -90º from it's current rotation, on each release.

--
Dave -
www.offroadfire.com
Head Developer
http://www.blurredistinction.com
Adobe Community Expert
http://www.adobe.com/communities/experts/


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines