Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Zustände verwalten > Komponenten hinzufügen und entfernen

Komponenten hinzufügen und entfernen

Eine der häufigsten Anwendungen für Zustände ist das Hinzufügen und Entfernen von Komponenten. Sie können das <mx:AddChild>-Tag verwenden, um eine oder mehrere Komponente(n) einzufügen. Nachfolgend definieren wir einen Zustand namens newTextInput, der eine Button-Komponenteninstanz einfügt:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
    <mx:states>
        <mx:State name="newTextInput">
            <mx:AddChild>
                <mx:TextInput id="textinput" />
            </mx:AddChild>
        </mx:State>
    </mx:states>
    <mx:Button id="button" label="Klick" click="currentState='newTextInput'" />
</mx:Application>

					  


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint