Jump to content


Vectors jumping when scaling very large

Recommended Posts



I'm working on a project where I need to scale vector lines (drawn in Flash or imported from Illustrator) extremely large, up to 150x their original scale. I've been trying to use Tweenlite to do this and am getting some odd results. The lines seem to "jump" when you get zoomed in very far. You can see an example here: http://manvsrobot.com/zoom-test.swf


You should see the red line jumping over the blue one and then going back a few times as it zooms in.


Do you have any idea why this is or how I could solve it? Here's the code I'm using:


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

var myTimeline:TimelineMax = new TimelineMax();
myTimeline.append(new TweenLite(line, 10, {scaleX:150, scaleY:150}));

Link to comment
Share on other sites

It's very difficult to know what's going on without seeing your FLA and code. Just be careful about scaling things very large because it can create big performance problems for the Flash rendering engine (which has nothing to do with TweenLite/Max).

Link to comment
Share on other sites

I have attached the FLA. You'll see that the code I pasted in before is the entirety of the code.

Link to comment
Share on other sites

That has nothing to do with TweenLite/Max - it's just the Flash Player having problems rendering your object which ends up being 144,750 pixels wide (and over 68 million pixels)!!! Are you sure you want to do that?


If you convert the lines to fills, that seems to fix the Flash rendering bug. I actually heard directly from a Flash Player engineer 2 days ago that rendering strokes is a VERY complex (and CPU-intensive) process. So stick with fills if possible.

Link to comment
Share on other sites

Thanks a lot. I had a feeling I was asking a bit much of Flash with that. I have converted all lines to fills and it did indeed fix the issue.


I'm assuming what I'm doing is still going to be a bit processor intensive and probably not the best idea, though. Do you happen to know if eats up a lot of resources to do something like this, even though 99.99% of the shape is outside the stage? Maybe masking the shape would help? I realize this is all well outside having anything to do with TweenLite, and I appreciate any knowledge you can spare.


Thanks again.

Link to comment
Share on other sites

Definitely do NOT mask it - that makes it much, much worse. Masks kill performance. And unfortunately, Flash does render objects even if they're technically beyond the bounds of the stage although you could try using a scrollRect which performs better than a mask by far.


Hope that helps.

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.