Search Results

Search found 2 results on 1 pages for 'user339681'.

Page 1/1 | 1 

  • Why does the roll_out event fire in this code?

    - by user339681
    I have made this simple example to demonstrate some problems I'm having. <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"> <mx:Canvas id="buttonCanvas" x="100" y="100" opaqueBackground="#000000" width="80%" height="300" creationComplete="init(event)"> <mx:Button x="5" y="5"/> <mx:Button x="5" y="50"/> </mx:Canvas> <mx:Script> <![CDATA[ private function init(event:Event):void{ buttonCanvas.addEventListener(MouseEvent.ROLL_OUT, function(event:Event):void{ buttonCanvas.opaqueBackground=(buttonCanvas.opaqueBackground==0)? 0x666666:0; }); } ]]> </mx:Script> </mx:Application> I don't understand the following: Why doesn't the percentage nor absolute dimensions affect the canvas? 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!

    Read the article

  • How do I set the dimensions of a custom component defined in an ActionScript class?

    - by user339681
    I'm trying to set the height of a vertical bar (activityBar) but it does not appear to do anything. i have tried something similar with the whole component, but setting the dimensions does nothing (even in the mxml used to instantiate the class). Indeed, I've added transparent graphics just to give the component some dimensions I'm not sure what I'm doing wrong. It's something bad though; my approach seems dire. FYI: I'm trying to create a mic activity bar that will respond to the mic by simply setting the height of the activityBar child (which seems to me to be more efficient than redrawing the graphics each time). Thanks for your help! package components { import mx.core.UIComponent; public class MicActivityBar extends UIComponent { public var activityBar:UIComponent; // Constructor public function MicActivityBar() { super(); this.opaqueBackground = 0xcc4444; graphics.beginFill(0xcccccc, 0); graphics.drawRect(0,-15,5,30); graphics.endFill();// background for bar activityBar = new UIComponent(); activityBar.graphics.beginFill(0xcccccc, 0.8); activityBar.graphics.drawRect(0,-15,5,20); activityBar.graphics.endFill(); activityBar.height=10; addChild(activityBar); } } }

    Read the article

1