Actionscript Custom Event


/ Published in: ActionScript 3
Save to your folder(s)



Copy this code and paste it in your HTML
  1. package {
  2. /*
  3. ** @name : BottoneEvent.as
  4. ** @description : Classe derivata da Event per gestire un proprio evento personalizzato
  5. ** @author : =undo=
  6. ** @web : http://www.undolog.com
  7. ** @email : g.fazioli@undolog.com
  8. */
  9. import flash.events.*;
  10. public class BottoneEvent extends Event {
  11. public static const MIOEVENTO:String = 'pluto'; // codice qualsiasi, anche 'mioevento' in minuscolo
  12. public var Valore:Number = NaN;
  13. /*
  14. ** @name : BottoneEvent
  15. ** @description : constructor
  16. */
  17. public function BottoneEvent ( type:String, v:Number, bubbles:Boolean=false, cancelable:Boolean=false ):void {
  18. super(type, bubbles, cancelable);
  19. this.Value = v;
  20. }
  21. /*
  22. ** @override
  23. */
  24. override public function clone():Event {
  25. return new KnobEvent(this.type, this.Value, this.bubbles, this.cancelable);
  26. }
  27. }
  28. }

URL: http://www.undolog.com/2008/05/18/creare-eventi-personalizzati-in-actionscript-30/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.