PDA

View Full Version : Order of onclick event


bruce
10-23-2007, 10:26 AM
I found a problem with how onclick is processed (or processed in the wrong spot).

I have a view that contains a number of graphics, one is a close button which sits on top of the rest. If you click and drag the top, the window drags. If you click the close button, it closes. (obvious eh? :) )

However, if I add onmouseover="this.setSource(blah)" and onmouseout....
I don't receive the onclick message. However, if I move the mouse around and click alot I do receive the click most of the time.

So I moved the view out of the top bar but positioned on the top bar with no change in behavior. If I remove the setSource commands and simply setSource oninit, the click behavior works like a champ.

<view>
<other views>

<view name="closeButton" x="${parent.width-25}" y="5" clickable="true"
onmouseover="this.setSource(curTheme + 'mmowinCloseMoused.jpg')"
onmouseout="this.setSource(curTheme + 'mmowinClose.jpg')"
oninit="this.setSource(curTheme + 'mmowinClose.jpg')" >
<method event="onclick">
Debug.write("closeButton clicked");
classroot.setVisible(false);
</method>
</view>

NOTE: The graphic doesn't appear properly on the mouseover. During the clicking, it appears when the click works. I thought it might be that the graphic fell behind, but I tried bringToFront() without luck. Of course, it has to load the graphic so maybe it reorders the graphics again when it is received.

I'm using version 4.0.5. I'll log this as a bug unless there is something I am missing.

Cheers,
Bruce

bruce
10-23-2007, 10:35 AM
Didn't realize there was a 4.0 forum, lol. Well, next time :)