开发者

Flex: Adding selectable image on canvas

I am new to flex, and do not know how to add an image (or other ui component) to canvas, so user can select it (and see that it's selected), also I want to add a possibility for example to click backspace and remove selected image from scene. How to do that?

Maybe you can p开发者_运维百科oint me to a doc to read?


I am not sure what you exactly need.

Do you need to add one image to the canvas, or possibly multiple? And how do you need to lay out these images? Horizontal? Vertical? Tiled?

One way of doing it could be to add a TileList to your canvas, and as dataprovider an ArrayCollection that holds the sources of the images you need.

Create an itemrenderer for the List or TileList and you will be able to display the images.

The images will then be selectable. When you add an eventListener to the keyDown event you can catch the backscpace button being clicked and remove the selected item from the tilelist.

<mx:TileList id="myTileList" dataProvider="{myImages}" itemRenderer="your.domain.MyItemRenderer" keyDown="{keyDownHandler(event)}" />

Adobe LiveDocs and a few of the words I used in this answer might help you further.

Hope this helps.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜