Click to See Complete Forum and Search --> : createTextfield + mask + problem


amccool
03-23-2007, 02:47 PM
Hello!

I'm having som problem with a dynamic created textfield.

The text wont show up, just like its transparent. I've tried to
add the property .embedFont and cacheasbitmap but nothing works!

Here is my code:

var filearr = Array();

function loadfiles(i) {
var my_fmt:TextFormat = new TextFormat();
my_fmt.color = 0xFFFFFF;
my_fmt.font = 'Arial';
my_fmt.size = 12;
container[i] = files.createEmptyMovieClip("c" + i, files.getNextHighestDepth());
mcLoader.loadClip('interface/flash/themes/miami/icons/ms_word.png', container[i]);

filearr[i] = container[i].createTextField("f" + i, container[i].getNextHighestDepth(), 0, 0, 100, 60);
filearr[i]._visible = true;
filearr[i].embedFonts = true;
filearr[i].cacheAsBitmap = true;
filearr[i].autoSize = true;
filearr[i].text = 'TTTT';
filearr[i].setTextFormat(my_fmt);

files._width = 180;
files._visible = true;
if (i == filelist.length-1) {
setTimeout(function () {progressing._visible=''; progressing._visible = false;}, 300);
}
}

loadfiles(0);

Hope someone can help me out, this is killing me....

/Adrian

amccool
03-23-2007, 04:20 PM
Finally I got the text to appear.

Well I cannot exactly explain how I got this text working. But I remove
a few properties now it looks like this:

function loadfiles(i) {

container[i] = files.createEmptyMovieClip("c" + i, files.getNextHighestDepth());

filearr[i] = container[i].createTextField("f" + i, 30, 20, 20, 100, 60);
// filearr[i]._visible = true;
// filearr[i].embedFonts = true;
// filearr[i].multiline = true;
// filearr[i].wordWrap = true;
filearr[i].autoSize = true;
filearr[i].text = filelist[i];

var my_fmt:TextFormat = new TextFormat();
my_fmt.color = 0xFFFFFF;
my_fmt.font = 'Arial';
my_fmt.size = 12;

filearr[i].setTextFormat(my_fmt);

mcLoader.loadClip('interface/flash/themes/miami/icons/ms_word.png', container[i]);

// test.text = filearr[i].getDepth() + '- - ' + container[i]._width + '- - ' + container[i]._height;

files._visible = true;
if (i == filelist.length-1) {
setTimeout(function () {progressing._visible=''; progressing._visible = false;}, 300);
}
}



I believe this might be the problem: filearr[i].embedFonts = true;
But i'm not sure. Anyway, if i enable embedFonts the flash gets messed up.
So I have to remove the property and save and compact...hmm
I don't know if this is right....can someone explain this?

Now the next problem.....
I cannot use the loadClip method.
It's like its replacing the textfield within the created movieclip.


Hmmm...

/A