PDA

View Full Version : displacementMap freezing



jhvh1134
September 11th, 2009, 11:59 AM
Hi guys, Im supposed to make a marquee that has curved dynamic text scrolling through it. I used the displacement map filter for this and it almost works. the only problem is that when the dynamic text field gets to a certain x position, the filter stalls, but the text continues to scroll. Im really at a loss.

heres what I got so far:
http://www.jhvh1134.com/misc/marquee.swf




var dPoint:Point = new Point(0, 0);
var dMap:BitmapData = new BitmapData(colorMap.width, colorMap.height , true, 0x808080);

dMap.draw(colorMap);
removeChild(colorMap);

var dFilter:DisplacementMapFilter = new DisplacementMapFilter ();
dFilter.scaleX = 50;
dFilter.scaleY = 52;
dFilter.componentX = 2;
dFilter.componentY = 1;
dFilter.mode = "color";
dFilter.color = 0x000000;
dFilter.alpha = 0;
dFilter.mapPoint = dPoint;
dFilter.mapBitmap = dMap;
textContainer.filters = [dFilter];
textContainer.texty.htmlText = "Around the Marquee";

addEventListener(Event.ENTER_FRAME,myFunction);

function myFunction(event:Event) {
textContainer.texty.x = textContainer.texty.x - 2;

if(textContainer.texty.x < -30){
textContainer.texty.x = 550;
}
}


Any help would be great

StridBR
September 11th, 2009, 10:28 PM
not sure, try increasing you displacement map area?

looks like it happens when you textContainer registration point (which i believe is top-left aligned) is out of bounds

jhvh1134
September 13th, 2009, 08:13 PM
StridBR (http://www.kirupa.com/forum/member.php?u=75462): thanks for the reply. I tried that, but for some reason it doesnt work. I thought by putting the scrolling text into a movie clip that doesnt move would make it work, but for some odd reason doesnt.