It would be a little more elegant , and a little faster, to do

 

    if (disp is Button)

 

instead of

 

    if (disp.toString().indexOf("Button") > -1

 

- Gordon

 


From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Mike Crowe
Sent: Friday, October 13, 2006 6:52 PM
To: [email protected]
Subject: [flexcoders] Hiding backMonthButton and fwdMonthButton on DateChooser

 

Hi folks,

Took me a while, but I accomplished hidding the back and forward
buttons. Not to elegant, but works.

Create this as a MXML Component and include such
<components:DateChooserNoYear .... />

Cheers!
Mike

<?xml version="1.0" encoding="utf-8"?>
<mx:DateChooser xmlns:mx="http://www.adobe.com/2006/mxml" width="160"
height="140"
creationComplete="initNoYear();">

<mx:Script>
<![CDATA[
import mx.controls.*;
public function initNoYear():void
{
this.yearNavigationEnabled=false;
var disp:DisplayObject;
for ( var i:int = 0; i < this.numChildren; i++ )
{
disp = this.getChildAt(i);
if ( disp.toString().indexOf("Button") > -1 )
disp.visible = false;
}
}
]]>
</mx:Script>

</mx:DateChooser>

__._,_.___

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





SPONSORED LINKS
Software development tool Software development Software development services
Home design software Software development company

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___

Reply via email to