Hi Maria Jose,

yes a bead could be convenient for some uses.

you can change:

var badge:Label = new Label();
badge.typeNames = "jewel badge";

with just:

super.createdBadge();

also this will not be needed:

public override function set strand(value:IStrand):void
                {
                        super.strand = value;
                }

thanks

El lun, 1 feb 2021 a las 22:18, Maria Jose Esteve (<mjest...@iest.com>)
escribió:

> Hello again, I have rectified the bead, maybe now it is more correct?
> (I share it in case someone is interested.)
>
>         import org.apache.royale.core.IStrand;
>         import org.apache.royale.jewel.Label;
>         import org.apache.royale.events.MouseEvent;
>         import org.apache.royale.jewel.beads.controls.Badge;
>
>         [Event(name="click", type="org.apache.royale.events.MouseEvent")]
>
>         /**
>          *  The Badge class provides a small status descriptors for UI
> elements.
>          *
>          *  A Badge is an onscreen notification element consists of a
> small circle,
>      *  typically containing a number or other characters, that appears in
>      *  proximity to another object
>          *
>          *  The BadgeOnClick class is a Badge extension that dispatches
> the MouseClick Event.
>          */
>         public class BadgeOnClick extends Badge
>         {
>                 public function BadgeOnClick()
>                 {
>                         super();
>                 }
>                 /**
>                  * used to create the badge ui element
>                  * that will be a Label
>                  */
>                 override protected function createBadge():Label
>                 {
>                         var badge:Label = new Label();
>                         badge.typeNames = "jewel badge";
>
>                         badge.addEventListener("click", function():void{
>                                 dispatchEvent(new MouseEvent("click"));
>                         });
>                         return badge;
>                 }
>                 public override function set strand(value:IStrand):void
>                 {
>                         super.strand = value;
>                 }
>         }
>
> Thx.
> Hiedra.
>
>

-- 
Carlos Rovira
Apache Member & Apache Royale PMC
*Apache Software Foundation*
http://about.me/carlosrovira

Reply via email to