COLUMNERO
Escrito el 28/08/2005 por Xavi Beumala
Fruto de los talleres SubFlash, Elecash y Dani implementaron una clase para maquetar en formato columnas un texto dado. La verdad es que me cayó muy simpático el componente y me dio por adaptarlo al formato de componentes de flash. Después de un intercambio de mails con Elecash hemos ampliado sus funcionalidades para que también pueda renderizar html y hemos hecho una refactorización del código. El último paso ha sido cear un paquete mxp para facilitar su distribución.
El código lo podéis descargar, modificar a vuestro antojo y utilizarlo donde os haga falta (proyectos comerciales incluidos). Si no queréis el codigo y simplemente lo queréis utilizar, podéis descargar la extensión instalable. Los links para las descargas están al final del post.
El uso es muy intuitivo, si lo queréis usar desde la linea de tiempo simplemente lo tenéis que arrastrar y rellenar las propiedades.
Por otro lado si lo queréis incrustar desde código lo podéis hacer como con cualquier otro componente. La interfaz pública que ofrece es la siguiente:
Propiedadades
- nCols: Número de columnas
- mediania: Separación en píxels entre columnas
- texto: Texto a renderizar
- css: URL de las css que se aplicarán
- notDrawedText: Si el texto que se tiene que renderizar no cabe en el espacio destinado al componente, el texto que no quepa quedará almacenado en esta variable.
Métodos
- invalidate(): Fuerza el repintado del componente
- getTextAtColumn(i:Number): Devuelve el texto de la columna i-ésima.
Problemas conocidos
- Por la naturaleza del parseador para detectar los tags html, en el texto no pueden aparecer los carácteres < ni >. En su defecto se tienen que usar > y <
- Si se quieren incluir imágenes medinate el tag img, éste tiene que incluir los atributos height y width. De no ser así los cálculos para saber en qué posición se debe cambiar de columna serán erróneos. Esto es debido a que la carga de las imágenes no es immediata y por lo tanto en el momento de calcular la altura del campo no se contempla la presencia de la imagen (aún no cargada)
- En la última versión se han corregido dos bugs. El primero consistía en que sí se abría un tag html renderizado en la primera columna y no se cerraba hasta la tercera, el componente lo cerraba automáticamente en la segunda. El otro bug consistía en que no se habían tenido en cuenta los tags simples como los img, que se cierran y abren con un sola etiqueta. Por como estaba hecho se duplicaba la imagen. Ambos han quedado resueltos.
Por último comentar que si descargáis el código encontraréis un archivo de ejemplo de utilización. Si ejecutais el swf desde un standalone player y redimensionais la ventana veréis como se van redibujando las columnas adaptándose al nuevo tamaño de la ventana.
Si detectais cualquier otro fallo no dudéis en notificarlo en los comentarios del post del blog de elecash.
Descargar código fuente.
Descargar extensión instalable.
increíble! esto está buenísimo : ) muchas gracias por compartir
Hi. Nice topic! Thanks
It's not so clear to be so sured that it's true
Why you all thinking in a such way, people?
I don't want to think, that a lot of people thinking in a such way.
Not so complicated to try to understand it, don't you think so?
Stop. Whether you think it's true or not, it's just an opinion
Beware of first sight conclusions, often they are wrong.
Where can I read in english about it?
Hammm… Nice article… Interesting.
Hi. Nice topic! Thank you..
Thank you for write..
Thank you for write
Very good article. Thanks for sharing.
Thanks for very interesting article. I really enjoyed reading all of your posts. It?s interesting to read ideas, and observations from someone else?s point of view? makes you think more. So please keep up the great work. All the best
Looks very interesting. Thanks for sharing.
Thank for the input, appreciated.
Thank you for write...
Thanks for the input, appreciated!
Looks very interesting.Thanks for article.
Thanks!
thank you
nice article. but i personally don't agree that all people are thinking in such way
Thanks
nice article Thank you
buena
Thank you for write
Thanks
Thank you..
nice article
Thank you write for article.
it s useful article so thanks
helpful coments thank you
interesting article...thnks
very kind article thank you
thank you for writing
perfect... thank you
i love this topic
thank you so much very helpful
very interesting. thank you.
thank you. regards..
I liked it. Thanks.
thank you. interesting.
Nice article. Thanks
thank you.
evden eve nakliyat,evden eve nakliye,istanbul evden eve nakliyat,ankara evden eve nakliyat ,izmir evden eve nakliyat,evden eve nakliyat taþýmacýlýk
evden eve nakliyat taþýmacýlýk,istanbul,ankara,izmir
ankara nakliyat ankara evden eve nakliyat
ankara evden eve nakliyat ankara nakliyat ankara nakliye
evden eve nakliyat,evden eve nakliye,istanbul evden eve nakliyat,ankara evden eve nakliyat ,izmir evden eve nakliyat,evden eve nakliyat ta?ymacylyk
gracias..
kýz oyunlarý en güzel oyunlar güzel oyunlar güzel oyun oyunlar oyun komik oyunlar 2 kiþilik oyunlar oda oyunlarý oda oyunlarý tatil tatil köyleri tatil yerleri tatil köyü tatil sepeti ucuz tatil ets tur çizgi film çizgi film izle çocuk oyunlarý çocuk oyun çocuk oyunu cocuk oyunlari oyun kiz oyunlari oyunlar bedava oyunlar bedava oyun kýz oyunlarý beybix saç kesme oyunlarý saç oyunlarý doktor oyunlarý ameliyat oyunlarý var mýsýn yok musun beybix selena oyunlarý oteller ucuz otel tatil köyleri bez bebek kelimatör flash games onilne games mountain bike games extreme pamplona
gracias.
Nice post. Well done. Thanks.
thank you for the post.
nice
Well done. Thanks
very kind article thank you
Hello I liked it. Thank you
Beware of first sight conclusions, often they are wrong.
Thank you.
I had trouble finding this information on the Internet! Thank you for taking the time to post!
Thanks
thanks everybody.
good works.
good
thanks.
forum
good
thnx
wooww thanks.. man
Hola
gracias..
I have translated this to English. Great post!
Thanks
Thanksss