Ver Mensaje Individual
  #1 (permalink)  
Antiguo 27/07/2012, 12:47
Avatar de ceaped
ceaped
 
Fecha de Ingreso: febrero-2004
Mensajes: 2.185
Antigüedad: 20 años, 3 meses
Puntos: 9
Pregunta Componente UIScrollBar con campo de .txt dinámico

Buenas tardes

Como puedo utilizar este scroll con un campo de texto dinámico:

Código actionscript:
Ver original
  1. import fl.controls.UIScrollBar;
  2.  
  3. var url:String = "http://www.helpexamples.com/flash/text/lorem.txt";
  4.  
  5. var tf:TextField = new TextField();
  6. tf.x = 10;
  7. tf.y = 10;
  8. tf.width = 500;
  9. tf.height = 380;
  10. tf.wordWrap = true;
  11. addChild(tf);
  12.  
  13. var myScrollBar:UIScrollBar = new UIScrollBar();
  14. myScrollBar.move(tf.x + tf.width, tf.y);
  15. myScrollBar.height = tf.height;
  16. myScrollBar.scrollTarget = tf;
  17. addChild(myScrollBar);
  18.  
  19. var uLdr:URLLoader = new URLLoader();
  20. uLdr.addEventListener(Event.COMPLETE, completeHandler);
  21. uLdr.load(new URLRequest(url));
  22.  
  23. function completeHandler(event:Event):void {
  24.     tf.text = URLLoader(event.target).data;
  25.     myScrollBar.update();
  26. }

Gracias por su ayuda
__________________
Diseñador Gráfico publicitario