的Flex / AS3拖放 - 定制降反馈 [英] Flex/AS3 Drag Drop - Custom Drop Feedback

查看:174
本文介绍了的Flex / AS3拖放 - 定制降反馈的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是 Horizo​​ntalList将部件来显示图像的列表,你可以从另一个组件拖动图像加入到列表中,这一切工作正常。

I am using a HorizontalList component to display a list of images, you can drag images from another component to join the list, this all works fine.

如果我这样做 list.showDropFeedback(事件)我得到一个难看的黑条中的 Horizo​​ntalList将 - 我真正想要的是一条线的图像,在新一将实际坐的左/右

If I do list.showDropFeedback(event) I get an unsightly black bar at the top of images in the HorizontalList - what I really want is a line to the left/right of the image, where the new one will actually sit.

我想我需要定义一个自定义DropFeedback来覆盖默认。有谁知道,如果有有一种方法来实现这一目标?

I guess I need to define a custom DropFeedback to override the default. Does anyone know if there there is a way to achieve this?

谢谢!

推荐答案

宥可以通过重写showDropFeedback()方法SOVE它。我的$ C $低于C:

Yuo can sove it by overriding showDropFeedback() method. My code below:

    import mx.controls.HorizontalList;
import mx.controls.listClasses.IListItemRenderer;
import mx.core.mx_internal;
import mx.events.DragEvent;

use namespace mx_internal;

public class HList extends HorizontalList
{
	public function HList()
	{
		super();						
	}	


        override public function showDropFeedback(event:DragEvent):void
        {

           super.showDropFeedback(event);

            dropIndicator.setActualSize(rowHeight - 4, 4);
            DisplayObject(dropIndicator).rotation = 90;

        }



}

这篇关于的Flex / AS3拖放 - 定制降反馈的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆