Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

buh

[Resolvido] tamanho de um campo texto dinamico=tamanho de texto

Recommended Posts

bom galera explicando o que quero..

tenhu um xml e dentro do flash um dinamic text... qual o problema se eu criar um dinamic text de tamanho x dentro do flash e a quantidade de texto a entrar for maior naum ira aparecer tudo certo..

 

o que eu comecei a fazer foi o seguinte..

 

so pra teste..

 

criei uma variavel onde hospedo o texto..

texto_read="GREAT   and it seems twill solve some alignment problems?Thankyou Doug!GREAT WORK!i’m developing a similar chat in Flex but i have some problems with gif files alignment in htmlText.For example, replacing three strings typed in a line with proper gif emoticons, the images are displayed out of line… in the bottom of text, one under the other.What textfield class or component are you using?I’m using TextArea and it seems there are several bugs in it…Using swf files instead of gif will solve some alignment problems?Thankyou Doug!GREAT WORK!i’m developing a similar chat in Flex but i have some problems with gif files";

um texto qualquer acima..

dai eu pensei.. primeiro tenhu que descobrir o tamanho do meu texto

conta=texto_read.length;

criei uma largura que eu queria que o dinamic text ficasse

 

largura = 300;

a altura seria do tamanho do texto pra que me mostre o texto inteiro

altura=conta/3-30;

eu fiz a altura pegando o tamanho do texto dividindo por 3 menos 30

naum me perguntem como cheguei a esses valores de 3 e 30 kkkk foi chutado

 

depois apliquei os valores de altura e largura ao meu dinamic text..

bloco.texto._width=largura;
bloco.texto._height=altura;
bloco.texto.htmlText=texto_read;
bloco.fundo._width=largura;
bloco.fundo._height=altura;

 

bommmmmmmm o exemplo acima completo

 

texto_read="GREAT   and it seems twill solve some alignment problems?Thankyou Doug!GREAT WORK!i’m developing a similar chat in Flex but i have some problems with gif files alignment in htmlText.For example, replacing three strings typed in a line with proper gif emoticons, the images are displayed out of line… in the bottom of text, one under the other.What textfield class or component are you using?I’m using TextArea and it seems there are several bugs in it…Using swf files instead of gif will solve some alignment problems?Thankyou Doug!GREAT WORK!i’m developing a similar chat in Flex but i have some problems with gif files";
conta=texto_read.length;
largura = 300;
altura=conta/3-30;
bloco.texto._width=largura;
bloco.texto._height=altura;
bloco.texto.htmlText=texto_read;
bloco.fundo._width=largura;
bloco.fundo._height=altura;

 

no exemplo acima o campo criado e exatamente o tamanho do texto no codigo ali o bloco.fundo .. fundo é igual a um movieclip de uma determinada cor de fundo para o texto que é criado do mesmo tamanho para que pegue o texto todo dentro dele

 

intãoo qual é a duvida??? kkkk

 

bomm dependendo do tamanho do texto se ele for maior que isso o espaço abaixo do texto criado vai ficando maiorr

 

naum teria um jeito de fazer com que ele ache o tamanho exato a ser acriado?? intenpendente do tamanho do texto?

 

 

alguem deve ter uma forma mais facil e eficaz .. se tiverem ideia postem por favor obrigadoo

Compartilhar este post


Link para o post
Compartilhar em outros sites

Um exemplo com campo de texto criado dinamicamente, definido apenas a largura com altura variável. O MC de fundo obedece as dimensões da cx. texto.

 

var texto_read:String = "GREAT and it seems twill solve some alignment problems?Thankyou Doug!GREAT WORK!i’m developing a similar chat in Flex but i have some problems with gif files alignment in htmlText.For example, replacing three strings typed in a line with proper gif emoticons, the images are displayed out of line… in the bottom of text, one under the other.What textfield class or component are you using?I’m using TextArea and it seems there are several bugs in it…Using swf files instead of gif will solve some alignment problems?Thankyou Doug!GREAT WORK!i’m developing a similar chat in Flex but i have some problems with gif files";
bloco.createTextField("texto", 999, 0, 0, 300, 0);
bloco.texto.autoSize = true;
bloco.texto.wordWrap = true;
bloco.texto.html = true;
bloco.texto.htmlText = texto_read;

bloco.fundo._x = 0;
bloco.fundo._y = 0;
bloco.fundo._width = bloco.texto._width;
bloco.fundo._height = bloco.texto._height;

Att.

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.