Hello!
I m trying to split an image on nine equal restangels but i m having some problems due my lack of serious theorethical ground in actionscript
here 's the code:
function createRectangels():Void
{
var widthOfRectangle:Number=218;
var heightOfRectangle:Number=165;
var i:Number;
var j:Number;
//I m attaching the image from the library
_root.attachMovie("nature","nature2",this.getNextHighestDepth());
var myBitmapData:BitmapData = new BitmapData(640,480)
myBitmapData.draw(nature2)
nature2._visible=false;
//Dinamicly creating the image rectangels
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
var Pic:BitmapData = new BitmapData(218,165,true,0xFFCCCCFF);
Pic.draw(myBitmapData, new Matrix(), null, null, new Rectangle(218*j,165*i, 218, 165));
this.createEmptyMovieClip("clip"+i+j, this.getNextHighestDepth());
this["clip"+i+j].attachBitmap(Pic,this["klipot"+i+j].getNextHighestDepth());
this["clip"+i+j]._x=j*widthOfRectangle;
this["clip"+i+j]._y=i*heightOfRectangle;
}
}
}
createRectangels();
I m getting visible only the upper left corner of the image.
I hope someone will reply.