Pakket | mx.core |
Klasse | public class DragSource |
Overerving | DragSource Object |
Taalversie: | ActionScript 3.0 |
Productversie: | Flex 3 |
Runtimeversies: | Flash Player 9, AIR 1.1 |
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.
Eigenschap | Gedefinieerd door | ||
---|---|---|---|
constructor : Object
Verwijzing naar het klasseobject of de constructorfunctie van een bepaalde objectinstantie. | Object | ||
formats : Array [alleen-lezen]
Contains the formats of the drag data, as an Array of Strings. | DragSource |
Methode | Gedefinieerd door | ||
---|---|---|---|
Constructor. | DragSource | ||
Adds data and a corresponding format String to the drag source. | DragSource | ||
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 | ||
Geeft aan of voor een object een opgegeven eigenschap is gedefinieerd. | Object | ||
Geeft aan of een instantie van de klasse Object zich in de prototypeketen van het object bevindt dat als parameter is opgegeven. | Object | ||
Geeft aan of de opgegeven eigenschap bestaat en kan worden opgesomd. | Object | ||
Stelt de beschikbaarheid van een dynamische eigenschap voor lusbewerkingen in. | Object | ||
Geeft de tekenreeksweergave van dit object weer, geformatteerd volgens de locatiespecifieke conventies. | Object | ||
Retourneert een tekenreeksrepresentatie van het opgegeven object. | Object | ||
Retourneert de primitieve waarde van het opgegeven object. | Object |
formats | eigenschap |
formats:Array
[alleen-lezen] Taalversie: | ActionScript 3.0 |
Productversie: | Flex 3 |
Runtimeversies: | 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.
Implementatie
public function get formats():Array
DragSource | () | Constructor |
public function DragSource()
Taalversie: | ActionScript 3.0 |
Productversie: | Flex 3 |
Runtimeversies: | Flash Player 9, AIR 1.1 |
Constructor.
addData | () | methode |
public function addData(data:Object, format:String):void
Taalversie: | ActionScript 3.0 |
Productversie: | Flex 3 |
Runtimeversies: | Flash Player 9, AIR 1.1 |
Adds data and a corresponding format String to the drag source. This method does not return a value.
Parameters
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 | () | methode |
public function addHandler(handler:Function, format:String):void
Taalversie: | ActionScript 3.0 |
Productversie: | Flex 3 |
Runtimeversies: | 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.
Parameters
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 | () | methode |
public function dataForFormat(format:String):Object
Taalversie: | ActionScript 3.0 |
Productversie: | Flex 3 |
Runtimeversies: | 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.
Parameters
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 |
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 | () | methode |
public function hasFormat(format:String):Boolean
Taalversie: | ActionScript 3.0 |
Productversie: | Flex 3 |
Runtimeversies: | Flash Player 9, AIR 1.1 |
Returns true
if the data source contains
the requested format; otherwise, it returns false
.
Parameters
format:String — String that specifies a label that describes the format
for the data.
|
Boolean — true if the data source contains
the requested format.
|
Wed Jun 13 2018, 11:42 AM Z