FlashDevelop y AsWing

May 8, 2006 on 2:08 pm | En OsFlash - Flash Open Source | 8 Comentarios

Para integrar y poder usar AsWing desde FlashDevelop es tan sencillo como añadir al classpath el directorio donde se encuentra nuestro framework AsWing.

FlashDevelop tiene un classpath global que utilizarán todos los proyectos que creemos.
Para añadir directorios a nuestro classpath global es tan sencillo como ir al menú 'Tools - Global Classpaths..' o bien pulsando Ctrl + F9.

Donde nos aparecerá una ventana para añadir el directorio donde tengamos AsWing o el framework que le queramos indicar..

También Flash Develop incorpora un classpath único para cada proyecto. Para modificar este classpath es tan sencillo como ir al menú 'Proyect - Properties'.

Y modificar los datos de la pestaña classpath:

Yo he optado por añadir las clases de AsWing en el directorio predeterminado donde se encuentran el resto de las clases que ya incorpora AsWing, en mi caso en: 'C:\Archivos de programa\FlashDevelop\library', asi como en 'C:\Archivos de programa\FlashDevelop\tools\mtasc\std' para evitar que me de errores mtasc.

Una vez añadido AsWing, he creado un nuevo proyecto con una única clase llamada Prueba.as.
Donde la clase Prueba.as es la misma que la del tutorial 'MTASC + Aswing: Primeros pasos en Osflash'.

Actionscript:
  1. // importamos las clases necesarias
  2. import org.aswing.BorderLayout;
  3. import org.aswing.Event;
  4. import org.aswing.JButton;
  5. import org.aswing.JTextArea;
  6. import org.aswing.JFrame;
  7. import org.aswing.utils.*;
  8. // creamos la clase a compilar que heredará de JFrame
  9. class Prueba extends JFrame{
  10. // Creamos dos variables de tipo JButton y JTextArea
  11. private var miBoton:JButton;
  12. private var miTexto:JTextArea;
  13. // El constructor de la clase
  14. public function Prueba() {
  15. super(_root, true);
  16. // Creamos los botones
  17. miBoton = new JButton("JButton1");
  18. miTexto = new JTextArea("Pulsa el botón");
  19. // Los colocamos
  20. getContentPane().append(miBoton, BorderLayout.SOUTH)
  21. getContentPane().append(miTexto,BorderLayout.CENTER)
  22. // Controlamos el click del botón
  23. miBoton.addEventListener(JButton.ON_PRESS, Delegate.create(this, marcarPulsacion));
  24. }
  25. // Función que se ejecutará al hacer click en el botón
  26. private function marcarPulsacion(eventObj:Event):Void {
  27. miTexto.setText("Botón Pulsado");
  28. }
  29. // Main de la clase
  30. public static function main(Void):Void {
  31. var myWindow:Prueba = new Prueba();
  32. myWindow.setLocation(50, 50);
  33. myWindow.setTitle("Aswing Prueba..");
  34. myWindow.setSize(100, 100);
  35. myWindow.show();
  36. }
  37. }

Un saludo!;)

8 Comments »

RSS feed for comments on this post. TrackBack URI

  1. Grandioso como siempre!

    Sergio, tendremos que abrir un subforo en Neoflashers sobre OSFlash

    un abrazo

    salut

    Comment by Bruno — May 8, 2006 #

  2. Cuando quieras! ;)

    Comment by ...sErGiO... — May 8, 2006 #

  3. ¿Cómo sabes que es lo que debes importar?
    Tengo el demo basico y quiero agregar un CheckBox usando attachMovie pero nada pasa, me imagino que me falta el citado import

    Comment by Jose Eleno — May 12, 2006 #

  4. Hola José!

    Que quieres agregar un CheckBox (componente de macromedia) o un JCheckBox (componente AsWing)..

    Un saludo, y gracias por visitar el blog!;)

    Comment by ...sErGiO... — May 13, 2006 #

  5. … eh una cosilla — debería ser:

    import org.aswing.util.*;

    en lugar de ‘utils’…

    saludos,
    J

    Comment by Julian — June 27, 2006 #

  6. Muchas gracias julian, cuando tenga un rato reedito.

    Un saludo!;)

    Comment by ...sErGiO... — July 2, 2006 #

  7. Buenas.Quiero hacer una barra de progreso con JProgressBar y no me hace la recarga de forma continua, sin que me muestra la barra completa. Si me motraras algun ejemplo me seria de gran ayuda.Gracias

    Comment by David — March 14, 2007 #

  8. No movement,louis vuitton outletnumerous foreigners say with a rather great, and this is the United states the world’s fitness louis vuitton bagsmiddle is highly advised ladies who need to shed unwanted weight recipe urgently.
    Tactics: A complete of LV handbags12 days.
    The very first 3 days: veggies and fruits daily as foods each morning to consume fruits, vegetables and fruits can eat at noon, during the night to consume vegetables (not the oil and salt Oh), the pounds limitation.
    4-6 days: consume milk and yogurt (will not invest in there preservatives, not simply won’t help pounds reduction will grow Xiao Dudu), you can actually try to eat, the body weight limitation.
    The very lastlouis vuitton handbags 6 days: mixed veggies, fruit and milk and yogurt to consume, the pounds limitation.

    Also, you possibly can try what weight reduction merchandise. Decision of pounds reduction LV outletgoods, most customers should always opt for items are very well received Oh, and month to month sales in 1000 or even more, and make sure to pick the green and healthy, no side effects of body weight reduction products and solutions, I introduce you to a place: 1234jf @ com (@ for into..) lv walletYou possibly can look and feel inside, it happens to be a weight reduction solution listing, sorting out the fat loss products ranked Taobao, Taobao collection in the most effective weight-loss services, top quality and evaluation with the most effective phrase of mouth, this top-selling weight-loss medication well-being items. Wish valuable to you, I desire you an effective excess fat loss.

    Comment by paroCitssap — April 12, 2011 #

Leave a comment



XHTML permitido: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>


Powered by WordPress.
Entries and comments feeds. Valid XHTML and CSS. ^Top^