Changing the front of card - Matching Game

Hi there,
I have been able to change this:

to this....

by changing the following code:

       var front = stage.frame.makeIcon().sca(1.1);//THIS LINE
       back = new Page(front.width,front.height,blue,green);
       var answer = answers[index++];
       asset(answer).clone().scaleTo(back,95,95).center(back).ble("multiply");
       var card = new Flipper(front, back, null, null, null, null, null, false, false).centerReg({add:false});
       card.answer = answer; // store on card for ease of collection
       return card;
   }

to this...
var front = new Rectangle(150, 100, "#76ccbc").centerReg();

What I would like to do is to change the front card to an wooden image.
image

I am stuck on how to do this. Just wondering if you might have some thoughts on this.

Thank you

Rod

The front and back parameters are any DisplayObject. So you have made it a new Rectangle(), it could be a new Pic() of the wood image. Or it could be a new Container() that holds any number of things - or a MovieClip.

Are you in Animate? You could try making a MovieClip with the wood in it. Or you can use F.loadAssets() and provide a file and path to an image. Then use new Pic() to show the picture.

I've just tried the new Pic option and it works perfectly....... just what I needed.....

Thank you SO much!!!!!

1 Like