Hi Jim - Thanks for your answer and sample. My problem was in changing the borderStyle to none - that's what was messing up the panel layout.
But then I ran into a different problem - demonstrated in your example as well - which is that changing the thickness of the border shrinks the contents of the panel and causes everything to move inward. What I wanted was a simple selection indicator that leaves everything inside the panel as is. What I ended up doing was surrounding the panel with a vbox that has all paddings set to zero and the same corner radius as the panel, and it's this border color that I'm changing. This leaves everything alone inside the panel. It does bring up yet another problem, though, which I'll address in a separate posting. - Tom Jim Robson wrote: > > Hey Tom, > > I can't reproduce your issue. Using the code below, the > border toggles off and on, and the panel retains its > rounded corners. Perhaps I misunderstood the nature of > your question? > > <?xml version="1.0" encoding="utf-8"?> > <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml > <http://www.adobe.com/2006/mxml>" > layout="absolute" borderStyle="solid"> > > <mx:Script> > <![CDATA[ > private var foo:Boolean = true > private function swapBorder():void { > if(foo){ > //Remove border > pnlUgly.setStyle("borderThickness",0); > }else{ > //Replace border > pnlUgly.setStyle("borderThickness",2); > pnlUgly.setStyle("borderColor",0xff8040); > } > foo = !foo; > } > ]]> > </mx:Script> > > <mx:Panel id="pnlUgly" x="177" y="107" width="310" > height="200" layout="absolute" cornerRadius="10" > borderStyle="solid" borderThickness="2" > borderColor="#ff8040" backgroundColor="#00ff00" > title="Ugly Panel"> > <mx:Form x="10" y="10"> > <mx:FormItem label="Label"> > <mx:TextInput/> > </mx:FormItem> > <mx:FormItem label="Label"> > <mx:ComboBox></mx:ComboBox> > </mx:FormItem> > <mx:FormItem label="Label"> > <mx:Button label="Button" click="swapBorder();"/> > </mx:FormItem> > </mx:Form> > </mx:Panel> > > </mx:Application> > > On Mon, 12 Jun 2006 16:51:59 -0400 > Tom Fitzpatrick <[EMAIL PROTECTED] > <mailto:tom%40streamlinestudios.com>> wrote: > > Yes - I tried that. The problem is that the border, even > >when set to the > > panel's background color, interrupts it visually - > >overlaying the panel > > header, for example. > > > > It seems that what I need is to redraw or refresh the > >panel after the > > border is removed to restore the original look. I just > >don't know how to > > do that. > > > > - Tom > > > > Jim Robson wrote: > >> > >> Tom, > >> > >> Instead of removing the border, which seems to confuse > >>the > >> player, could you just toggle the border's color? When > >>you > >> want the border to disappear, change its color to the > >>same > >> color as the panel's background. Then change the color > >> back when you want the border to be visible. > >> > >> Will that work? > >> > >> Jim > >> > >> On Mon, 12 Jun 2006 14:48:15 -0400 > >> Tom Fitzpatrick <[EMAIL PROTECTED] > <mailto:tom%40streamlinestudios.com> > >> <mailto:tom%40streamlinestudios.com>> wrote: > >> > I have a panel with corner radius set to 10. > >> > > >> > I'm trying to turn its border on and off > >> >programatically, toggling the > >> > border styles between solid and none, thickness > >>between > >> >2 and 0. > >> > > >> > The toggling is working fine, but when I hide the > >>border > >> >after showing > >> > it once, I lose the panel's curved corner radius and > >>its > >> >dropshadow. > >> > > >> > Is there some way to just turn the border on and off > >> >while still > >> > retaining the dropshadow and the look of the panel's > >> >corner radius? > >> > > >> > - Tom > >> > > >> > > >> > >> > > > > > > > > ------------------------ Yahoo! Groups Sponsor --------------------~--> Home is just a click away. Make Yahoo! your home page now. http://us.click.yahoo.com/DHchtC/3FxNAA/yQLSAA/nhFolB/TM --------------------------------------------------------------------~-> -- 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/

