0 Replies Latest reply on Dec 13, 2010 10:32 AM by thenewmexican62

    Rounded Image,mouseUp/Down effects, and event problem


      I'm using the RoundedImage AS3 code found on-line pretty much everywhere.
      When applying mouseUpEffect/mouseDownEffect(s) with a RoundedImage instance,
      the event dispatching for RoundedImage instances in question becomes erroneous.
      The first RoundedImage instance declared, functions as expected, dispatching both mouseUp, and mouseDown events.
      However, the second RoundedImage instance declared, only responds to the mouseDown event. The mouseUp event gets lost.


      Any help is greatly appreciate it.


      Here is the code for the RoundedImage.as


      public class RoundedImage extends Image {
              public function RoundedImage(){
              public function get cornerRadius():int {
                  return cornerRad;
              public function set cornerRadius(radius:int):void {
                  cornerRad = radius;
              override protected function createChildren():void {
                  this.roundedMask = new UIComponent();
              override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void {
                  super.updateDisplayList(unscaledWidth, unscaledHeight);
                  roundedMask.graphics.drawRoundRectComplex(0, 0, unscaledWidth, unscaledHeight,cornerRad, cornerRad,cornerRad, cornerRad);
                  this.mask = roundedMask;
              protected var roundedMask:UIComponent;
              protected var cornerRad:int;


        private function testMouseClick(event:Event):void {
                      trace("inside testMouseClick");


      <RoundedImage x="0" y="10" id="roundedImage1" click="testMouseClick(event)" mouseUpEffect="{unglowRoundedImage1}" cornerRadius="25" mouseDownEffect="{glowRoundedImage1}" source="{icon1}"  width="75" height="75"/>
      <RoundedImage x="100" y="10" click="testMouseClick(event)" id="roundedImage2" mouseUpEffect="{unglowRoundedImage2}" cornerRadius="25" mouseDownEffect="{glowRoundedImage2}" source="{icon2}" width="75" height="75" />