Set control to visible
<?xml version="1.0"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" backgroundColor="white"> <mx:HBox creationComplete="checkEmail()"> <mx:Script> import flash.net.*; private function checkEmail():void { if(data.email.length > 0) { emailButton.visible = true; } } public function sendMail():void { var u:URLRequest = new URLRequest("mailto:" + data.email); navigateToURL(u,"_self"); } </mx:Script> <mx:Button id="emailButton" visible="false" label="Send Email" click="sendMail()" /> </mx:HBox> </mx:Application>