Using Adobe Animate Movieclips outside a Tile

I am working through the Matching Game in Adobe Animate using ZIM.

I would like to replace the Object List and Target List with Movieclips on the stage and not use Tiles.

I have replaced the Objects List like this:
From this................

// these are what we drag
var objectsList = [
	new Label("Square"),
	new Label("Circle"),
	new Label("Triangle")
];
to this.....................
var objectsList = [
	zimify(this.kuadradu),
	zimify(this.sirkulu),
	zimify(this.triangulu)
];

and the target list is now this....
var targetsList = [
	zimify(this.square), // the movieClips on the stage
	zimify(this.circle),
	zimify(this.triangle)
	// new Rectangle(), // or use a zimify(movieClip) here
	// new Circle(),
	// new Triangle(110,110,110)
];

// What I can't work out is how to remove the tiles so that the effects (animations etc) still work with the movieclips.
// So I can't convert the code below to work without tiles...

// tile the targets and objects
var targets = new Tile(targetsList, 3, 1, 100, 0, true) // true to keep list in order	
	.pos(0,200,CENTER)
	.alp(0)
	.animate({
		wait:.5,
		props:{alpha:1}
	});

var objects = new Tile(objectsList, 3, 1, 50, 0, true)
	.drag()
	.pos(0,150,CENTER,BOTTOM);
// ________________
// these are what we drag
var objectsList = [
	//new Label("Square"),
	zimify(this.kuadradu), -----------------this does not work
	new Label("Circle"), -------------------but these two do.
	new Label("Triangle") ---------------- 
];

I just can't work out why?


Can anyone help me with this?

Thank you

Rod
matching_1.zip (82.6 KB)

Hi Rod - will try and take a look this afternoon once I get back from teaching. MovieClips are a little tricky - have a read over the ZIM SHIM example code again - and make sure that you did everything needed. I can't remember, you may need to add a drag({all:true}) so you actually drag the whole clip rather than the content in the container of the clip. Or something like that. And there was something about stopping the timeline too...

Rod - yes. Set the mouseChildren of the movieclip to false and then the whole clip drags not just the shape inside.

var kuadraduZim = zimify(this.kuadradu);
kuadraduZim.mouseChildren = false;

Thank you, thank you, thank you. I have been trying to work this out for days!!!!
I really appreciate your support.
Warm regards
Rod

1 Like