---
title: "隐藏Flex控件"
author: "gdntx"
date: "2009-09-28T10:21:52Z"
tags: ["Adobe", "Flex", "XML"]
slug: "flex"
draft: false
lastmod: "2009-09-28T10:21:52Z"
id: 479086
url: "https://gdntx.iteye.com/blog/479086"
---

```
<xml version=”1.0″ encoding=”utf-8″?>
<mx:Application
xmlns:mx=”http://www.adobe.com/2006/mxml”
layout=”vertical”>
<mx:Button label=”hide text”
click=”myText.visible=false;
myText.includeInLayout=false;” />
<mx:Text id=”myText” text=”hello,
this text will be hidden or shown,
depending on the buttons” />
<mx:Button label=”show text”
click=”myText.visible=true;
myText.includeInLayout=true;” />
</mx:Application>


```