Jump to content
Search Community

AS3: Simple tween causing glitching/rendering issue

mhigley test
Moderator Tag

Recommended Posts

Hey fellow GreenSockers!!

 

This problem I'm sure stems from me not fully understanding how flash renders images and the such, but I wanted to bring it up anyways just in case someone else has experienced the same problem and has found a solution.

 

I've got a few movie clips masked and nested into a single movie clip and when the user hovers over the image, it expands displaying more hidden information about the photo. The problem happens when the image expands, there's a break in the rendering causing a visual glitch that, under the simplistic circumstances, doesn't seem like it should be bogging down the software. Anyone have any suggestions? Is there some kind of memory hog in my actionscript that I don't understand? Any and all assistance is greatly appreciated.

 

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

panel.addEventListener(MouseEvent.ROLL_OUT, panelClose);
panel.addEventListener(MouseEvent.ROLL_OVER, panelOpen);

function panelClose(e:MouseEvent):void {
var timeline:TimelineLite = new TimelineLite();
timeline.insertMultiple([
						 new TweenLite(panel, 1, {x:443, ease:Quint.easeOut}),
						 new TweenLite(panel.panelMask, 1, {width:178, ease:Quint.easeOut}),
						 new TweenMax(panel.panelImg, 1, {x:-100, colorTransform:{tint:0x000000, tintAmount:0.5}, ease:Quint.easeOut}),
						 new TweenLite(panel.panelBg, 1, {width:178, ease:Quint.easeOut}),
						 new TweenLite(panel.panelHdr, 1, {alpha:1, x:17, ease:Quint.easeOut}),
						 new TweenLite(panel.panelOverlay, 1, {alpha:0, x:179, ease:Quint.easeOut})
						 ], 0, TweenAlign.START, 0);
}
function panelOpen(e:MouseEvent):void {
var timeline:TimelineLite = new TimelineLite();
timeline.insertMultiple([
						 new TweenLite(panel, 1, {x:178, ease:Quint.easeOut}),
						 new TweenLite(panel.panelMask, 1, {width:443, ease:Quint.easeOut}),
						 new TweenMax(panel.panelImg, 1, {x:1, colorTransform:{tint:0x000000, tintAmount:0}, ease:Quint.easeOut}),
						 new TweenLite(panel.panelBg, 1, {width:443, ease:Quint.easeOut}),
						 new TweenLite(panel.panelHdr, 1, {alpha:0, x:-153, ease:Quint.easeOut}),
						 new TweenLite(panel.panelOverlay, 1, {alpha:1, x:1, ease:Quint.easeOut})
						 ], 0, TweenAlign.START, 0);

}

 

I've attached a zipped .fla and .swf for those who want to download it. I've also posted it to my site if you want to see it in action there, or download the files from there.

 

 

Thanks.

// JR

Link to comment
Share on other sites

Could you explain what you mean by "glitching"? I didn't notice any performance problems (although I am on a really fast computer). If you're talking about your image looking a bit jagged/crunchy, you just need to turn smoothing on for that image. You can do that by right-clicking on the bitmap in the library and select "properties" and then check the smoothing checkbox.

smoothing.jpg

 

Does that help?

Link to comment
Share on other sites

I appreciate you taking a look.

 

Here's a quick screen cap of what I'm seeing on the two computers I've tested it on.

split.jpg

 

The split running through the headlights seems to happen every time the box expands. What I've noticed is that the split is inline with the top edge of the "Img Splits Here" text box. Am I looking at a hardware problem (not fast enough), or is there something else I'm missing?

 

 

// JR

Link to comment
Share on other sites

Yeah, that has nothing to do with TweenLite/Max - it's the Flash Player itself. Sorry - I wish I had better news for you. :( You could experiment with drawing your stuff to a BitmapData and substituting your raw content with the BitmapData, but it may degrade performance slightly overall. Just a thought.

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...