Jump to content
Search Community

Issues with Rotation, and Scaling [SOLVED]

RZephyr07 test
Moderator Tag

Recommended Posts

I have a snowflake masking out a photo that I want to scale and rotate at the same time for our schools upcoming e-holiday card. I'm using AS2 as I'm familiar with it... you can see the work in progress here.

 

The problem I have is that attempting to enlarge and rotate the 6-spoked snowflake at the same time causes it to kind of bounce in and out... it looks funny. I just want it to enlarge as if it were getting closer.

 

Here's the CS3 source if you need to look at the code, which is on the 3rd frame.

 

import com.greensock.*;
import com.greensock.easing.*;

/////////////////////////////////////Subtitles Handeling/////////////////////////////////////
TweenMax.to(sub1, 0, {_alpha:0});

if (_global.subtitles =="on") {
	TweenMax.to(sub1, 1, {autoAlpha:100});
	trace ("Subtitles will be shown.");
} else {
	TweenMax.to(sub1, 0, {autoAlpha:0});
	trace ("Subtitles will not be shown.");
}

photo1.registrationX = 227.1;
photo1.registrationY = 340.75;
TweenMax.from(photo1, 2, {autoAlpha:-100});
TweenMax.to(photo1, 7, {_width:618.2, _height:927.5, ease:Default (Regular.easeOut)})
TweenMax.to(snowflake1, 5, {repeat:-1, _rotation:360, ease:Linear.easeNone});
TweenMax.to(snowflake1, 6, {bezier:[{_x:453, _y:046}, {_x:480, _y:280}, {_x:700, _y:400}], orientToBezier:false});

var timeline:TimelineMax = new TimelineMax();
timeline.append(TweenMax.to(snowflake1, 7, {_width:1448.4, _height:1448.4}) );
//TweenMax.to(snowflake1, 7, {_width:1010, _height:1010, ease:Default (Regular.easeOut)})
stop();

The code right now is messy with some seemingly odd choices (I plan on migrating this to timelinemax once I get it figured out).

Link to comment
Share on other sites

The problem is that you're tweening the _width and _height properties instead of _xscale and _yscale. Flash measures the _width and _height based on the BOUNDING BOX, so if you're rotating at the same time, watch how the bounding box shifts because your snowflake is a different width/height when it's at a 45 degree angle than it is at 0 or 90 degrees, etc. If you just tween the _xscale/_yscale, it should solve the problem. Again, this isn't a problem with the tweening engine - it's just how Flash measures width/height.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...