Slicing Images

Any ideas on how to take an externally loaded JPG, and using Pure actionscript, slicing it into a variable number of peices (all seperate movieclips in an array of course). Im thinking the Bitmapdata class might help… Any thoughts?

Chris