I am trying to make a Slider Puzzle (game whereby an image is cut up into
tiles and one tile is removed then the tiles are rearranged and the aim is
to rearrange the pieces of the picture)

Anyway I was trying to do this using purely code and nothing in the library.

So what I have done is create several empty movie clips
i.e the tile, the mask and a movie clip to load the image in

I then wanted to duplicate this tile but it does not seem to work.

Here is what I have tried

Tile_Size = 55;
How_Many_Tiles_Across = 4;
How_Many_Tiles_Down = 4;

createEmptyMovieClip("tile_mc", 10);

tile_mc.moveTo(0,0);

tile_mc.beginFill(0xFF0000);
tile_mc.lineTo(Tile_Size,0);
tile_mc.lineTo(Tile_Size,Tile_Size);
tile_mc.lineTo(0,Tile_Size);
tile_mc.lineTo(0,0);
tile_mc.endFill();

tile_mc.createEmptyMovieClip("loader_mc", 2);

createEmptyMovieClip("mask_mc", 3);

mask_mc.moveTo(0,0);

mask_mc.beginFill(0x000000);
mask_mc.lineTo(Tile_Size,0);
mask_mc.lineTo(Tile_Size,Tile_Size);
mask_mc.lineTo(0,Tile_Size);
mask_mc.lineTo(0,0);
mask_mc.endFill();

tile_mc.setMask("mask_mc");

loadMovie("sugababes_1.jpg", tile_mc.loader_mc);

tile_mc.duplicateMovieClip("tile1_mc",11);

tile1_mc._x = Tile_Size;
tile1_mc._y = 0;


The second tile appears but it does not appear to show the image.

Any help would be much appreciated.

I will obviously run through a loop to do all 16 tiles once I have worked
this mask malarkey out.

Thanks in advance

Paul

btw this needs to be published flash 7 as2 max so can't use Flash 8
features.


_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to