Jump to content
Search Community

Blitmask and Dynamic Text

Icecage
Moderator Tag

Recommended Posts

Posted

Hi, how would I change a dynamic text after I use blitmask

 

blitMask = new BlitMask(this, x, y, width, blockHeight * 5, false, true, 0xFFFFFF, true);

 

I tried to:

 

blitMask.disableBitmapMode();
dynamicText.text = "BLABLA";
blitMask.enableBitmapMode();

 

 

blitMask.dispose();
dynamicText.text = "BLABLA";
blitMask = new BlitMask(this, x, y, width, blockHeight * 5, false, true, 0xFFFFFF, true);

 

but nothing works.

 

Any advice on how I can achieve this?

Posted

Hi,

 

If you change the contents of the target of the BlitMas, you need BlitMask to take a new capture of the target. It sounds like you need to use the update() method and set the forceRecaptureBitmap

 

parameter to true like so:

 

blitmask.update(false, true);

 

let us know if that works for you.

Posted

I followed your advice, set autoUpdate to false

 

blitMask = new BlitMask(this, x, y, width, blockHeight * 5, false, [b]false[/b], 0xFFFFFF, true);

 

And I put this in EnterFrame event:

 

blitmask.update(null, true);

the dynamic text still doesn't get updated

 

If this is relevant at all, I'm working on a scrolling calendar which followed this tutorial

I added a startDrag on the blitmask on mousedown event.

Posted

Hi,

 

Please make sure you are embedding your fonts.

 

Below is a very simple example to illustrate dynamic text being updated :

 

 

import com.greensock.*;

var blitMask:BlitMask = new BlitMask(mc,0,0,250,200,true,true,0x000000,true);

TweenMax.to(mc, 2, {x:-750, repeat:-1, yoyo:true});


function updateText(){
mc.word_txt.text = "hello";
blitMask.update(null, true);
}


//update text after 2 seconds
TweenLite.delayedCall(2, updateText);

 

Flash CS5 fla and swf attached

blitmaskUpdateText.zip

Posted (edited)

sorry I missed something on my code in my first reply

It actually worked after I added this line to enter frame event

blitMask.update(null, true);

 

Thanks a lot for your help, sorry for the troubles

Edited by Icecage
Posted

You're very welcome. It was no trouble. Glad to hear you figured it out!

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