Take the 2-minute tour ×

I have made this short example to demonstrate some problems I'm having.

        x="100" y="100" opaqueBackground="#000000" width="80%" height="300"
        <mx:Button x="5" y="5"/>
        <mx:Button x="5" y="50"/>


        private function init(event:Event):void{
            buttonCanvas.addEventListener(MouseEvent.ROLL_OUT, function(event:Event):void{
                buttonCanvas.opaqueBackground=(buttonCanvas.opaqueBackground==0)? 0x666666:0;

I don't understand the following:

  1. Why don't the percentage or absolute dimensions affect the canvas size?
  2. Why does the roll_out event fire when the mouse leaves a button (even when it is still inside the canvas).

I'm going nuts trying to figure this out. Any help would be greatly appreciated!

share|improve this question
add comment

3 Answers

Maybe you wanted to use backgroundColor style and not opaqueBackground property?

share|improve this answer
add comment

Just glancing at this, I can tell you that the default value for opaqueBackground is null, not 0.

share|improve this answer
I have set it to 0 explicitly. It does seem to be 0 when run (the background is black). –  cammil May 24 '10 at 13:25
add comment

Check this post!It says the difference between MouseOut and Roll Out clearly. Hope this helps.

share|improve this answer
add comment

Your Answer


