MACROMEDIA FLEX 2-MIGRATING APPLICATIONS TO FLEX 2 Manual do Utilizador Página 181

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 184
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 180
Using the drag-and-drop feature 181
Controlling the feedback indicator
To control the feedback indicator that accompanies a drag proxy, you now use the new
showFeedback() and getFeedback() methods of the DragManager class. The indicator
shows what happens if you try to drop the item; for example, a red circle with a white x
represents an aborted drop, or a green circle with a white plus (+) indicates a valid drop.
In Flex 1.x, you could change the feedback indicator with the
action property of the event.
In Flex 2, use the
showFeedback() method to control the value of this property for all
DragManager-related events. To get this value on any DragEvent object, you now use the
getFeedback() method.
Setting actions
You no longer set the action property of the event object. Instead, you must call the
DragManager.setFeedback() method, as the following example shows.
Flex 1.5:
private function doDragOver(event:Event):Void {
// If the Control key is down, show the COPY drag feedback appearance.
if (event.ctrlKey) {
event.action = DragManager.COPY;
} else {
event.action = DragManager.MOVE;
}
}
Flex 2:
private function doDragOver(event:DragEvent):void {
// If the Control key is down, show the COPY drag feedback appearance.
if (event.ctrlKey) {
DragManager.showFeedback(DragManager.COPY);
} else {
DragManager.showFeedback(DragManager.MOVE);
}
}
Vista de página 180
1 2 ... 176 177 178 179 180 181 182 183 184

Comentários a estes Manuais

Sem comentários