MACROMEDIA COLDFUSION MX 7.0.2-USING COLDFUSION MX WITH FLEX 2 Guide de l'utilisateur Page 223

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 256
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 222
Build a distributed application with the ActionScript object adapter 223
Create variables
In this section, in the script block you declare variables for objects that you will use.
Directly below the import statements in the script block, add the following variable
declarations:
public var noteObj:Object = new Object();
public var getToken:AsyncToken;
private var ds:DataService;
[Bindable]
public var noteProxy:ObjectProxy;
Initialize the application
In this section, you write an event listener method that creates a DataService component and
calls the DataService component’s
getItem() method, which retrieves the current note text.
1. Add the following method declaration directly under the variable declarations to create an
event listener:
public function initApp():void {
}
2.
Add the boldface text to the initApp() method to create a DataService component when
the
initApp() method is called. The ds DataService component connects to the server-
side
notes Data Management Service destination, which is specified in its one argument.
public function initApp():void {
ds = new DataService("notes");
}
3.
Add the boldface text to the initApp() method. This code adds a Result event listener to
the DataService component and sets initial values for the noteObj object’s
noteId and
noteText properties. It also sets the value of the getToken object to the AsyncToken object
that the DataService component’s
getItem() method returns.
The ActionScript object adapter uses the
noteId property as a unique identifier for each
noteObj object, and the
noteText property contains the note text.
public function initApp():void {
ds = new DataService("notes");
ds.addEventListener(ResultEvent.RESULT, resultHandler);
ds.autoCommit = false;
noteObj.noteId = 1;
noteObj.noteText = "Type your notes here and share them with other
clients!";
getToken = ds.getItem(noteObj, noteObj);
}
Vue de la page 222
1 2 ... 218 219 220 221 222 223 224 225 226 227 228 ... 255 256

Commentaires sur ces manuels

Pas de commentaire

Medion Telewizory i monitory podręczniki użytkownika

Zaczynanie od F

Kliknij na poniższy alfabet, aby przejść do pełnej listy modeli zaczynających się od tej litery

Modele Rodzaj dokumentu
FLAT PANEL LCD TFT MONITOR
Instrukcja Użytkownika   CHAPTER 2. Hardware Spec of DSN-5750, 15 strony
Instrukcja Obsługi   Medion FLAT PANEL LCD TFT MONITOR Service manual, 25 strony