Thanks for the reply Hans

You say that duplicateMovie will not duplicate stuff drawn through the API

However the following code appears to do just that.

Tile_Size = 55;
Number_Of_Rows = 4;
Number_Of_Columns = 4;

// ------------------------------------------
// Create Tile and fill it in with solid fill
// ------------------------------------------

createEmptyMovieClip("tile_mc", 1);

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_ID = 1;

// ------------------------
// Create the grid of tiles
// ------------------------

for (var vRow_Index = 1; vRow_Index < Number_Of_Rows+1; vRow_Index++) {

        for (var vColumn_Index = 1; vColumn_Index < Number_Of_Columns+1;
vColumn_Index++) {

                var vClip_Ref = tile_mc.duplicateMovieClip("tile" + Tile_ID +
"_mc",100+Tile_ID);

                Tile_ID++;
        }
}


There does however seem to be a problem using the same mask on duplicated
movie clips.

Or perhaps I am misunderstanding ?

Thanks

Paul

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Hans
Wichman
Sent: 24 November 2005 16:29
To: Flashcoders mailing list; Flashcoders mailing list
Subject: Re: [Flashcoders] Cutting an image up into tiles using masks


duplicateMovie will not duplicate any loaded images or stuffd drawn throuh
the api.
basically you'd have to load the image lots of times as well.

At 04:58 PM 11/24/2005, Paul Steven wrote:
>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

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

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

Reply via email to