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 

DragSource  - AS3 Flex

Pakietmx.core
Klasapublic class DragSource
DziedziczenieDragSource Inheritance Object

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

The DragSource class contains the data being dragged. The data can be in multiple formats, depending on the type of control that initiated the drag.

Each format of data is identified with a string. The hasFormat() method is used to determine if the object has data in that format. The dataForFormat() method is used to retrieve the data in the specified format.

Data can be added directly using the addData() method, or indirectly using the addHandler() method. The addHandler() method registers a callback that will be called if the data is requested. This is useful for adding data in a non-native format that may require large computations or conversions. For example, if you have raw sound data you can add an MP3 format handler. The MP3 conversion will only be done if the MP3 data is requested.



Właściwości publiczne
 WłaściwośćZdefiniowane przez
 Inheritedconstructor : Object
Odwołanie do obiektu klasy lub funkcji konstruktora, dotyczące danej instancji obiektu.
Object
  formats : Array
[tylko do odczytu] Contains the formats of the drag data, as an Array of Strings.
DragSource
Metody publiczne
 MetodaZdefiniowane przez
  
Constructor.
DragSource
  
addData(data:Object, format:String):void
Adds data and a corresponding format String to the drag source.
DragSource
  
addHandler(handler:Function, format:String):void
Adds a handler that is called when data for the specified format is requested.
DragSource
  
Retrieves the data for the specified format.
DragSource
  
Returns true if the data source contains the requested format; otherwise, it returns false.
DragSource
 Inherited
Wskazuje, czy dla obiektu zdefiniowano określoną właściwość.
Object
 Inherited
Wskazuje, czy instancja klasy Object należy do łańcucha prototypów obiektu określonego jako parametr.
Object
 Inherited
Wskazuje, czy określona właściwość istnieje i jest przeliczalna.
Object
 Inherited
Ustawia dostępność właściwości dynamicznej używanej w pętlach.
Object
 Inherited
Zwraca ciąg reprezentujący obiekt — sformatowany zgodnie z konwencjami właściwymi dla ustawień regionalnych.
Object
 Inherited
Zwraca ciąg reprezentujący określony obiekt.
Object
 Inherited
Zwraca pierwotną wartość dla określonego obiektu.
Object
Szczegół właściwości

formats

właściwość
formats:Array  [tylko do odczytu]

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

Contains the formats of the drag data, as an Array of Strings. Set this property using the addData() or addHandler() methods. The default value depends on data added to the DragSource object.



Implementacja
    public function get formats():Array
Konstruktor Szczegół

DragSource

()Konstruktor
public function DragSource()

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

Constructor.

Szczegół metody

addData

()metoda
public function addData(data:Object, format:String):void

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

Adds data and a corresponding format String to the drag source. This method does not return a value.

Parametry

data:Object — Object that specifies the drag data. This can be any object, such as a String, a DataProvider, and so on.
 
format:String — String that specifies a label that describes the format for this data.

addHandler

()metoda 
public function addHandler(handler:Function, format:String):void

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

Adds a handler that is called when data for the specified format is requested. This is useful when dragging large amounts of data. The handler is only called if the data is requested. This method does not return a value.

Parametry

handler:Function — Function that specifies the handler called to request the data. This function must return the data in the specified format.
 
format:String — String that specifies the format for this data.

dataForFormat

()metoda 
public function dataForFormat(format:String):Object

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

Retrieves the data for the specified format. If the data was added with the addData() method, it is returned directly. If the data was added with the addHandler() method, the handler function is called to return the data.

Parametry

format:String — String that specifies a label that describes the format for the data to return. This string can be a custom value if you are creating a custom drop target with the addData() method.

List-based controls have predefined values for the format parameter. If the control that initiated the drag operation is a Tree, then the format is "treeItems" and the items implement the ITreeDataProvider interface. For all other List-based controls that have built-in drag and drop support, the format is "items" and the items implement the IDataProvider interface.

Zwraca
Object — An Object containing the data in the requested format. If you drag multiple items, the returned value is an Array. For a List-based control, the returned value is always an Array, even if it contains a single item.

hasFormat

()metoda 
public function hasFormat(format:String):Boolean

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

Returns true if the data source contains the requested format; otherwise, it returns false.

Parametry

format:String — String that specifies a label that describes the format for the data.

Zwraca
Booleantrue if the data source contains the requested format.




[ 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.