MACROMEDIA FLEX-CREATING ADVANCED COMPONENTS Instrukcja Użytkownika Strona 45

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 52
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 44
{
var event:Event = PropertyChangeEvent
.createUpdateEvent(this, "value", null,
value);
dispatch(event);
}
1.
Bind a single value property.
For example:
proxy.bind(propertyName, null, bindingId, BindingDirection.INPUT, InputBindings.SINGLETON, "");
2.
Bind an array as a 2D array.
For example:
proxy.bind(propertyName, null, bindingId, BindingDirection.INPUT, InputBindings.ARRAY2D, "");
3.
Bind an array as a 1D array.
For example:
proxy.bind(propertyName, null, bindingId, BindingDirection.INPUT, InputBindings.ARRAY, "");
12.2.4 Sub-element and Sub-property Binding
Most connections allow binding property sub-elements or sub-properties that are of Array type to the
Excel spreadsheet. For example of a sub-element binding, the RSS Connector has a property called
rssItems that contains all of the feed items returned from the loading process. Each feed item has a
title, a description, a link, and a published date. You can then bind an individual feed item or each
element of a single feed, such as title, to the Excel spreadsheet. Refer to the sample "RSS Connector
With Trigger" and its source code for an example.
To use sub-element or sub-property binding, first create a chain accessor, which provides a mechanism
to access and assign a specific element or property within an Array, and pass it as the second parameter
to the bind method of the property sheet proxy as follows:
Sub-element binding:
// create a chain to bind to rssItems[0]
var chain:Array = [0]; //access first feed item: an array of 4 elements
// binding to rssItems
proxy.bind("rssItems", chain, bindingID, BindingDirection.INPUT, InputBindings.ARRAY, "");
or
// create a chain to bind to rssItems[0][2]
var chain:Array = [0, 2]; //access the third element of the first feed item
// binding to rssItems
proxy.bind("rssItems", chain, bindingID, BindingDirection.INPUT, InputBindings.SINGLETON, "");
Sub-property binding:
// create a chain to bind to sub-property data[0].xValue
var chain:Array = [0, "xValue"]; //access xValue property of the first object
// binding to property "data"
proxy.bind("data", chain, bindingID, BindingDirection.INPUT, InputBindings.SINGLETON, "");
2013-05-0645
Appendix B: Custom Property Sheet API Reference
Przeglądanie stron 44
1 2 ... 40 41 42 43 44 45 46 47 48 49 50 51 52

Komentarze do niniejszej Instrukcji

Brak uwag