I have two JPG images on convas, and want to draw a border around the
image when I click it. I extended mx:Image to handle the mouseUp
event. However, when I clicked on image1, image2 also had the border
drawn around it. Why did both images received the mouseUp event?
Attached please find the simplifed example.

Another question is, I keep getting lots of warnings in my log file,
mostly complaining on some __get_xxxxx() functions. I also have the
error messages attached.

Please help, and your advice is highly appreciated!

Tim




Attach Code

>>>>>>>> Question 1: why mis-fire of mouseUp event? <<<<<<<<<<<<<
>>>>>>>> Sample code: testApp.mxml <<<<<<<<<<<<<<<<<<<<

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml";
xmlns="*">
<mx:Canvas width="550" height="550" backgroundColor="#0099FF">
  <ImgEx id="img1" source="kitty12a.jpg" 
         x="20" y="20" width="50%" height="50%"/>
  <ImgEx id="img2" source="kitty16a.jpg" 
         x="320" y="320" width="30%" height="30%"/>
</mx:Canvas>
</mx:Application>

>>>>>>>> ImgEx.mxml: my component handling mouseUp event:  <<<<<<<<<

<?xml version="1.0" encoding="utf-8"?>
<mx:Image xmlns:mx="http://www.macromedia.com/2003/mxml";
                     mouseUp="onMouseUp(event, this)" 
                     borderStyle="none" borderColor="#FF3300"
borderThickness="5" >
<mx:Script>
<![CDATA[
        function onMouseUp(e, obj):Void {
                this.setStyle("borderStyle", "solid");
                //
                // if the previous line is replaced with the 
                // following commented line, things work well. 
                // But WHY ???

                // obj.setStyle("borderStyle", "solid");
        }
]]>
</mx:Script>

</mx:Image>


>>>>>>>>>>Question 2: Why so many warnings in the log file ? <<<<<<<<
Warning: onSetFocus is not a function
        at ()
Warning: onKillFocus is not a function
        at ()
Warning: __get__preferredWidth is not a function
        at __get__contentHolderWidth()
Warning: __get__preferredHeight is not a function
        at __get__contentHolderHeight()
Warning: __get__preferredWidth is not a function
        at __get__contentHolderWidth()
Warning: __get__preferredHeight is not a function
        at __get__contentHolderHeight()
Warning: __get__preferredWidth is not a function
        at __get__contentHolderWidth()
Warning: __get__preferredHeight is not a function
        at __get__contentHolderHeight()
......
...... (and the same warnings, on and on and on)





------------------------ Yahoo! Groups Sponsor --------------------~--> 
<font face=arial size=-1><a 
href="http://us.ard.yahoo.com/SIG=12hcfcles/M=362329.6886308.7839368.1510227/D=groups/S=1705007207:TM/Y=YAHOO/EXP=1123187421/A=2894321/R=0/SIG=11dvsfulr/*http://youthnoise.com/page.php?page_id=1992
">Fair play? Video games influencing politics. Click and talk back!</a>.</font>
--------------------------------------------------------------------~-> 

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to