# \[AS3\] Shuffler class

**URL:** <https://forum.kirupa.com/t/as3-shuffler-class/262103>\
**Category:** open source\
**Created:** [June 3, 2008, 11:01am UTC](https://forum.kirupa.com/t/as3-shuffler-class/262103 "2008-06-03T11:01:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnlouis](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/johnlouis/32/568_2.png) [@johnlouis](https://forum.kirupa.com/u/johnlouis)\
**Post date:** [June 3, 2008, 11:01am UTC](https://forum.kirupa.com/t/as3-shuffler-class/262103/1 "2008-06-03T11:01:48Z")

</div>

this is the first time i’ve shared classes, so don’t be too harsh. 🍺 it’s nothing fancy, but i am quite happy with it. I will be using it on my site, but i decided to share it anyway.

here is a quote from my [blog](http://blog.mindfock.com/)

> Basically, it “throws” in items into the stage, and you could shuffle them around or you could stack them up. I’ve made it very easy to use, and it’s still under development, but I think it’s ready to be used by others… You can use any DisplayObject as the ‘items’ of the Shuffler.  
> There are explanations in the code, but here are some important points  
> shuffle() - shuffles the items  
> stack() - stacks the items  
> setFocusOn(item: DisplayObject) - sets the item param as the focused item  
> addItem(item: DisplayObject) - adds item param to the shuffler  
> deleteItem(index:int) - deletes the item at index  
> has max property for maximum number of boxes allowed. 0 for infinite.

[sample](http://www.mindfock.com/experiments/TestShuffler.swf)  
[Shuffler class](http://www.mindfock.com/classes/Shuffler.as)

you need [TweenLite](http://blog.greensock.com/tweenliteas3/)

---

<div class="post-metadata">

**Author:** ![devonair](https://avatars.discourse-cdn.com/v4/letter/d/3be4f8/32.png) [@devonair](https://forum.kirupa.com/u/devonair)\
**Post date:** [June 3, 2008, 9:22pm UTC](https://forum.kirupa.com/t/as3-shuffler-class/262103/2 "2008-06-03T21:22:30Z")

</div>

That is really slick!
