开发者

What is the best way to render a horizontally draggable list of movieclips for a flash to ios project

ActionScript Mobile Project. Flas开发者_运维技巧h to IPad. I am using Flash Builder 4.5.1

  1. I have a row of movieclips that I need to drag horizontally.
  2. there could be up to 300 clips. Each clip is 100 px wide.
  3. Each clip has different content/text and animations.
  4. the viewable area will be the stage.

Any tips or links to info regarding ...

Dragging. Dragging and removing clips when not on stage. ( i am not sure how to remove and put back with correct content in clip ) How to manage the content. Optimization.

Any thoughts would be appreciated! Thanks for your time.


Your best bet is to use Flex components, since they natively support drag and drop functionality.

http://livedocs.adobe.com/flex/3/html/help.html?content=dragdrop_4.html

Simply use a HorizontalList object in your case, because you want horizontal scrolling. Set the size of the CellRenderer based on how many cells you want on screen at any given moment (e.g. 1024px = width of iPad, so 100px per cell would make 10 cells onscreen at once). Each movieclip will resize itself based on the size of the cells, and shrink or grow to fit the space allotted. Animations, images and text all work fine in lists like this as far as I can tell (although I've mainly dealt with TileList objects).

Flex components have built in optimization, meaning they only render the cells on screen and load up new ones as the user scrolls. The number of items in your DataProvider shouldn't affect performance.

Take a look at the links I've mentioned and comment if you have any further questions. If you aren't using mxml at all, e.g. 'pure AS3', then you'll need some external libraries for drag and drop support: http://code.google.com/p/as3-drag-and-drop-tilelist/

Cheers,

Josh

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜