MACROMEDIA FLASH 8-EXTENDING FLASH Uživatelský manuál Strana 12

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 17
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 11
2003 Macromedia, Inc. 12
Declare a function named getCategories_result() with a parameter
named result.
function getCategories_result(result) {}
In the body of the function, use another function included with the
Flash Remoting Components call “DataGlue”. This function
provides a simple mechanism to easily map a recordset to your
Flash widget. The third and forth parameters describe your
column headings. Use DataGlue to bind your data as follows:
DataGlue.bindFormatStrings (category_cb, result,
"#name#", "#categoryId#");
9. Here is the completed method if you prefer to use it:
//event handler to capture returned category list
function getCategories_result(result) {
DataGlue.bindFormatStrings (category_cb, result, "#name#",
"#categoryId#");
}
10. Test the movie. You should see the categories display in the combo
box. When the box is clicked, the first category is selected.
Conclusion
You have now populated a Combo Box UI component that you can use in
your application. As you can see, Flash Remoting allows you to access
and display complex data structures from your server in rich, Flash UI
components and gives you the power to easily manipulate the data.
Zobrazit stránku 11
1 2 ... 7 8 9 10 11 12 13 14 15 16 17

Komentáře k této Příručce

Žádné komentáře