【问题标题】:Getting Flex TileList image source获取 Flex TileList 图片源
【发布时间】:2009-08-15 04:06:53
【问题描述】:

我有一个从 Flickr 加载数据的 TileList。 tilelist 使用 imageRenderer 来制作一堆缩略图。

我正在尝试创建自定义拖放功能,但我想获取 tilelist mouseEvent 目标的图像源。下面是拖动处理程序的代码:

public function onPicMouseDown(e:MouseEvent):void {
            var tileList:TileList = TileList(e.currentTarget);

            var item:Object = Object(tileList.selectedItem);

            var source:DragSource = new DragSource();

            var dragView : Image = new Image();
            dragView.source = tileList.selectedItem.source;

            DragManager.doDrag(
                rowRenderer,
                source,
                e,
                dragView
              );
}

但是 tileList.selectedItem 没有源属性。源是 itemrenderer 生成的图像的属性。我希望能够做一些相当于

的事情
tileList.selectedItem.itemRenderer.source

但这也不行。

必须有一种简单的方法来做到这一点,而我只是想念它。任何帮助将不胜感激。

【问题讨论】:

    标签: apache-flex drag-and-drop tilelist


    【解决方案1】:

    在您的 onMousePicDown 处理程序中,您的来源应该是:

    dragView.source = event.target.parent.source;
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-02-10
      • 1970-01-01
      • 1970-01-01
      • 2012-02-15
      • 2011-01-15
      • 1970-01-01
      相关资源
      最近更新 更多