Jump to content
Search Community

Blitmask lags every 4 seconds

Pipsisewah test
Moderator Tag

Recommended Posts

Hello,

 

I am experimenting with the blitmask object and I am running into a little odd problem.  When I run a very simple demo of simply scrolling a textfield using blitmask, the movement lags about every 4 seconds.  The lag looks like a jitter and for maybe 1/2 a second I cannot read anything (almost like the object and the screen refresh get out of sync).

 

When I watch and play with the demo on the website, I see a very very small amount of this lag, but its still much better than what I am seeing.

 

I set my application to 60 fps and I am using embedded fonts.  I am running an i7 with an nVidia 650M 2G graphics card on Windows 7 (all gaming is no problem for me, so this should not be a factor).

 

Below is the code I am using.  Any tips or an explanation would be great.

The purpose of this code would be to display an RSS/Atom or other scrolling text feed.

// Create Textfield
var tf:TextField = new TextField();

// Setup Properties and Values
tf.embedFonts = true;
tf.autoSize = TextFieldAutoSize.LEFT;
tf.text = "(Reuters) - Hurricane Odile ground its way up Mexico's Baja California peninsula on Monday, gradually losing strength after injuring dozens of people, forcing the evacuation of thousands and smashing shops open to looters in the popular tourist area.  Fierce winds felled trees, buffeting homes and businesses, as one of the worst storms ever to hit the luxury retreats of Los Cabos battered Mexicos northwestern coast with heavy rains.";// The text is 3x as long but I had to cut it due to website thinking it was spam
				
// Format the TextField
var format:TextFormat = new TextFormat();
format.font = "arial";
format.size = 40;		
tf.setTextFormat(format);
				
//Add it to the screen
var uic:UIComponent = new UIComponent();
uic.addChild(tf);
grpMain.addElement(uic);
			

//Call the scrolling function
blitmaskDemo(tf);



//Scrolling Function
private function blitmaskDemo(tf:TextField):void{
  var bm:BlitMask = new BlitMask(tf, tf.x, tf.y, 1920, tf.height, true);
  bm.cacheAsBitmap = true;
  bm.bitmapMode = true;
  TweenMax.to(tf, 150, {x:-(tf.width) + tf.x, onUpdate:bm.update, ease:Linear.easeNone});
}

Thank you!!

Link to comment
Share on other sites

Hi and welcome to the GreenSock forums.

 

I believe what you are describing can be attributed to garbage collection routines running that halt ActionScript execution and cause lag. Unfortunately controlling Flash player's GC routines is completely out of our control. Have you tried testing your swf in a browser like Chrome? Typically the Flash browser plugins run much better than the player Flash uses when you export your swf.

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