ActionScript® 3.0 — dokumentacja dla platformy Adobe® Flash®
Strona główna  |  Ukryj listę pakietów i klas |  Pakiety  |  Klasy  |  Nowości  |  Indeks  |  Dodatki  |  Dlaczego język angielski?
Filtry: Pobieranie danych z serwera...
Pobieranie danych z serwera...
mx.core 

IDeferredInstance  - AS3 Flex

Pakietmx.core
Interfejspublic interface IDeferredInstance

Wersja języka: ActionScript 3.0
Wersja produktu: Flex 3
Wersje środowiska wykonawczego: Flash Player 9, AIR 1.1

The IDeferredInstance interface defines the Flex deferred instance factory interface. An implementation of IDeferredInstance creates a particular instance value when the getInstance() method is first called, and returns a reference to that value when the getInstance() method is called subsequently.

The Flex compiler performs the following automatic coercions when it encounters MXML that assigns a value to a property with the IDeferredInstance type:

  1. If you assign a property of type IDeferredInstance a value that is an MXML child tag representing a class, such as a component tag, the compiler creates an IDeferredInstance implementation whose getInstance() method returns an instance of the class, configured as specified in the MXML code. The following example shows this format; in this example, MyComp is a custom component that has a variable called myDeferredInstanceProperty of type IDeferredInstance. The compiler generates an IDeferredInstance1 implementation whose getInstance() method returns an instance of the Label class, with its text property set to "This is a deferred label":
              <MyComp>
                  <myDeferredInstanceProperty>
                      <Label text="This is a deferred label"/>
                  </myDeferredInstanceProperty>
              </MyComp>
  2. If you assign a text string to a property of type IDeferredInstance, the compiler interprets the string as a fully qualified class name, and creates an IDeferredInstance implementation whose getInstance() method returns a new instance of the specified class. The specified class must have a constructor with no arguments. The following example shows this format; in this example, the compiler generates an IDeferredInstance1 implementation whose getInstance() method returns an instance of the MyClass class:
              <MyComp myDeferredInstanceProperty="myPackage.MyClass/>

Use the IDeferredInstance interface when an ActionScript class defers the instantiation of a property value. You cannot use IDeferredInstance if an ActionScript class requires multiple instances of the same value. In those situations, use the IFactory interface.

The states.AddChild class includes a childFactory property that is of type IDeferredInstance.

Powiązane elementy interfejsu API



Metody publiczne
 MetodaZdefiniowane przez
  
Creates an instance Object from a class or function, if the instance does not yet exist.
IDeferredInstance
Szczegół metody

getInstance

()metoda
public function getInstance():Object

Wersja języka: ActionScript 3.0
Wersja produktu: Flex 3
Wersje środowiska wykonawczego: Flash Player 9, AIR 1.1

Creates an instance Object from a class or function, if the instance does not yet exist.

Zwraca
Object — The instance Object.




[ X ]Dlaczego język angielski?
Treść dokumentacji języka ActionScript 3.0 wyświetlana w języku angielskim

Niektóre części dokumentacji języka ActionScript 3.0 nie są przetłumaczone na poszczególne języki. Gdy element nie jest przetłumaczony na dany język, jest wyświetlany tekst angielski. Na przykład opis klasy ga.controls.HelpBox nie jest przetłumaczony na żaden dodatkowy język. Z tego powodu polska wersja dokumentacji zawiera opis klasy ga.controls.HelpBox w języku angielskim.