Turn Memory Card In Memory Game
Are there still no way of rotating a bitmap in flash with descent result? A property that I dont know of..?!=)
ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0
Posted on: 03-30-2007, 09:34 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
[F8] Memory Style Card Game Card Flipping Issue
Hey guys,
I need a little help with a project I'm doing for school. I'm designing a memory style card game where you flip cards over and if they match they go away and stuff. You know what I mean. Anyway, I can't figure out how to tell both cards to revert to their original state if you guess wrong.
I have the last card you pressed flipping back over no problem. It's just the first one that won't do anything and I can't figure out how to reference it.
If anyone can help that'd be great.
Memory Card Game
Hello all,
I am web designer; I am learner in action scripts
I wanted to create a flash game (memory card game) and score should be saved in to database. Please suggest me how use python/perl
Can u help me in this.. http://www.cleverpig.com/examples/memory.htm this is the sample url
I wanted to make same as this but result (score) will be saved in BD.
Warm Regards
Rajeev
Memory Card Game (almost Done)
Hiya,
I'm trying to make a memory cards game but I am stuck...
I dont know why the game ismt working.
here is the fla-
http://members.lycos.co.uk/xtks/poke_m.fla
can u tell me pkease what do I need to add to make it work?
thanks
[F8] Memory Card Game
Hello there,
I´m creating a card game and I'm having problems with the animation part. Here are the details:
I have:
1 movie clip call Carta that contains the animation for showing the card, this is the layer that I'm going to drag into the main stage. This mc is made of
-- 1 mc called cartaFrente instanciated as "cartaCara" that contains all the front images I would like to show to the user
-- 1 image containing the back part of the cards.
In the main stage I create an instance for Carta, in this case the instance name is "LaCarta"
in the firts frame I duplicate the instance LaCarta, then bring into the scene changin _x and _y also in this frame I'm trying to show the 2nd card in my Deck, here is the code:
duplicateMovieClip(_root.LaCarta,"mcCarta",1);
with(this["mcCarta"]){
_x = 100;
_y = 100;
_root.laCarta.cartaCara.gotoAndStop(2);
}
In the onRelease event for LaCarta I play the main mc:
on (release) {
_root.LaCarta.play();
}
when running this stuff I click on the mc but nothing happens! What I think it is suppose to run is that when I click then I would be able to see the 2nd card.
Please help me, I cannot find what I'm doing wrong, I'm using flash 8 and ActionScript 2.0
Thank you friends!
Memory Card Game _ Need Some Help With Creating It
Hello Guys & Gals,
I had a tutorial I was using quite a while back to create a 'memoy card' game- You know- clcik a card it turns over-- you try to match that image with the same image on another card which then eliminates the pair- etc... until you have them all matched!
I know...simple game! Well... I am new to designing any game in Flash--so I am making a simple memory game for a kids site.
Is Anyone out there able to assess what is wrong with my code to this point?
It seems to add too many cards--and it doesn't match up an equal amount of paired graphics- it always seems like when you get to near the end- there is like 4 cards left- each with a different image on it that doesnt match any others!
If anyone can help- or direct me to some help that would be AWESOME!!
Thanks...I will include the code with this post...
Thanks in advance!
Problem With Memory Card Game Code - Please Help?
Hi all, I hope someone can help me with this.
I am creating a simple memory card game in Flash 8 with 10 cards. For anyone who's unfamiliar with the concept, the user gets a quick look at the faces on the cards before the cards are flipped face down, and the user then has to try to find pairs of faces (10 cards = 5 pairs). In theory, each time the user plays the game, the face images are populated randomly so it's a new game each time. The problem I am having is that with the code I've written, some of the cards are coming up blank, which means not all 5 faces are represented on the cards. Below is the function I wrote to populate the card faces:
Code:
_global.loadCards = function () {
trace ("you are accessing the loadCards function")
var randomUsed = false;
var listOfRandoms = new Array ();
for (i=1; i<=10; i++){
var newRandom = int(Math.random()*11);
if (newRandom == 0){
newRandom = 1;
/*for (j=1; j <= listOfRandoms.length; j++){
if (newRandom == listOfRandoms[j]){
randomUsed = true;
break;
} else {
randomUsed = false;
}
}*/
}
trace ("newRandom is " + newRandom);
listOfRandoms[i] = newRandom;
trace("List of randoms is "+listOfRandoms.length+" long");
trace(listOfRandoms);
/*for (j=1; j <= listOfRandoms.length; j++){
if (newRandom == listOfRandoms[j]){
randomUsed = true;
break;
} else {
randomUsed = false;
}
}*/
if (rabbitCounter < 2 && randomUsed == false){
_root["card"+newRandom].animalContainer.attachMovie("rabbitNodding", "animal", 1);
_root["card"+newRandom].clickValue = "rabbit";
rabbitCounter++;
trace ("rabbitCounter is " + rabbitCounter);
} else if (sheepCounter < 2 && randomUsed == false){
_root["card"+newRandom].animalContainer.attachMovie("sheepWalking", "animal", 1);
_root["card"+newRandom].clickValue = "sheep";
sheepCounter++;
trace ("sheepCounter is " + sheepCounter);
} else if (raccoonCounter < 2 && randomUsed == false){
_root["card"+newRandom].animalContainer.attachMovie("raccoonHopping", "animal", 1);
_root["card"+newRandom].clickValue = "raccoon";
raccoonCounter++;
trace ("raccoonCounter is " + raccoonCounter);
} else if (foxCounter < 2 && randomUsed == false){
_root["card"+newRandom].animalContainer.attachMovie("foxJumping", "animal", 1);
_root["card"+newRandom].clickValue = "fox";
foxCounter++;
trace ("foxCounter is " + foxCounter);
} else if (beaverCounter < 2 && randomUsed == false){
_root["card"+newRandom].animalContainer.attachMovie("beaverHovering", "animal", 1);
_root["card"+newRandom].clickValue = "beaver";
beaverCounter++;
trace ("beaverCounter is " + beaverCounter);
}
if (randomUsed == true){
i--;
}
}
}
You'll note that there is a second for loop nested within the first. Actually, it is in there twice, and I have it commented out in both places at the moment because I don't know where it is supposed to go, AND it tends to cause flash to crash entirely when I try to test the movie if I uncomment it in either spot. But a friend who's more familiar with AS than I am helped me with this code and he put it in there. I believe it (or something similar) needs to be there somewhere, as it is meant to check that the random number that is generated during an iteration of the first for loop hasn't been used before (which is what determines which card will be populated with which face), but I don't know how to fix it at all.
Any help with this would be much appreciated, as I have a deadline approaching
Thanks so much in advance...
[F8] - Card Memory Game (simple Script) HELPO
Hey there! I hope you guys can help me because im a bit desperate and haven't been able to find anything that could work. So im working on this memory type game where I have 9 buttons at the bottom and 66 cards on top.
What I want do is make the game work in the following way. You first select one of the buttons from the bottom. Then you start opening cards from the top. Only 6 will match the one at the bottom. Now, what could be the easiest way of making this work. I tried working my way through a memory game fla but it just doesnt' work.
Any ideas???
Autorun From An IPAQ Memory Card
Hey all.
I have recently created a flash projector for an HP iPAQ® 4150 using FlashPack (great product). I need to load this projector onto a flash memory card and enable it to autorun when the iPAQ is turned on.
The memory card will be inserted into the iPAQ prior to delivery.
Anybody familiar with this emerging technology?
Thanks
<"((JM))><
Memory Leaks In Flash? Cus My Program Is Using Over 235,000kbs Of Memory
ANY HELP APPRECIATED as i've spent 2 days on this (started 2 days 3 hours ago)... please help me
I have only 16 images in my program, its a slideshow, all my images have a small image selection which on(rollOver) shows that image in a bigger screen, however when my program launches, I do ctrl + alt + del, and my memory usage for that swf file I made is at 235,000kb of memory, and my laptop can't handle it, (its 70mb) and the original .fla file is (70mb)
Is there anyway to fix this, I belive my scripts are leaking, I know for a fact, im not cleaning my locals... or globals...
if I declare a variable should I set it to null?
Question 1: Should I remove local variables? if so how do I do it?
Question 2: Should I remove global variables? if so how do I do it?
Question 3: Any other things I need to know?
this is my code for start up, which hides all images not in the first 4 places (which is suppost to be visible) the others are turned invisible...
Code:
_global.b = Array();
_global.end = 16;
_global.b[0] = btn_1;
_global.b[1] = btn_2;
_global.b[2] = btn_3;
_global.b[3] = btn_4;
_global.b[4] = btn_5;
_global.b[5] = btn_6;
_global.b[6] = btn_7;
_global.b[7] = btn_8;
_global.b[8] = btn_9;
_global.b[9] = btn_10;
_global.b[10] = btn_11;
_global.b[11] = btn_12;
_global.b[12] = btn_13;
_global.b[13] = btn_14;
_global.b[14] = btn_15;
_global.b[15] = btn_16;
_global.X = 40;
_global.Y = 30;
var t:Number = Array();
for (var i:Number = 0; i<4; i++)
{
t[i] = (i*100)+80;
}
for (var i:Number = 0; i<_global.end; i++)
{
var b = _global.b[i]._x;
_global.b[i]._x = (i*100)+t[0];
if (b != t[0] and b != t[1] and b != t[2] and b != t[3])
{
_global.b[i]._visible = false;
}
else
{
_global.b[i]._visible = true;
}
}
code for scrolling through my list of images (as it only shows 4 on the screen at one time)
basically, each image is 90 * 68 (width/height) the X position of the first image is 80, and it increments by 100 each time, until the 5th image, in which its 30, the start up code above, spaces them out by 100 (as I normally dont have enough room to fit 16+ images spaced out by 100) it also does other things
Basically, t gets the X position of last image... then
And basically hides and unhides images pending if they're X position is 80, 180, 280, 380...
Code:
on(release)
{
var t:Number = 0;
for (var i:Number = 0; i<_global.end; i++)
{
t = (i*100)+80;
}
for (var i:Number = 0; i<_global.end; i++)
{
if (_global.b[i]._x > 79)
{
if (_global.b[i]._x == 80)
{
_global.b[i]._visible = false;
_global.b[i]._x = t+100;
}
if (_global.b[i]._x > 579)
{
_global.b[i]._visible = false;
}
if (_global.b[i]._x == 480)
{
_global.b[i]._visible = true;
}
_global.b[i]._x -= 100;
}
}
}
The next code is for "enhancing" my images a little bit, it increases its Width & Height by 30 and 40... and decreases by that on rollOut / dragOut
(as you can dragOut and rollOut doesn't happen therefore I need it so you can't "increase" the image height & width without decreasing when your mouse moves off it)
Code:
on(rollOver)
{
gotoAndStop(2);
var b = btn_1
b._width = b._width + _global.X;
b._height = b._height + _global.Y;
b._x = b._x - X/2;
b._y = b._y - Y/2;
}
on(dragOut)
{
var b = btn_1;
b._width = b._width - _global.X;
b._height = b._height - _global.Y;
b._x = b._x + X/2;
b._y = b._y + Y/2;
}
on(rollOut)
{
var b = btn_1;
b._width = b._width - _global.X;
b._height = b._height - _global.Y;
b._x = b._x + X/2;
b._y = b._y + Y/2;
}
Thats it, they're basically 1 of each different thing I have... it basically stays the same, I have 32 images (large_1-16, and small_1-16)
They're exactly the same size, but I wasn't sure if I could use 1 image twice, for different things (they're size is 2500 * 1900 give or take a 100 or so)
Card Game (turn-based) - Lobby Room And Game Room, Maintain State
Hi all, I´m new in this forum, since now i appreciate for any help.
I´m developing a turn-based card game in Flash 8 (multiplayer), using the concepts of lobby and room. In this case when the user login de game, he always see the lobby, where he can choice the games, then the user selects a game in a dataGrid and enter the game.
Inside the game (that resides in another frame in my .fla), there is a button that when clicked brings de users to the main lobby ( gotoAndStop(“lobby”) ) so that the user can visualize the lobby with the game running in background with the others users.
The problem is when the user return to the game ( gotoAndStop(“game”) ), the images, cards, players name and chat history text disappear, all the game object disappear, remaining only the original graphics (movie clips) to the game room.
In fact, I need a solution to maintain the state of the game when the user decide to visualize the lobby (with the game running) and after return to the game.
Thanks for any help.
Regards,
Luiz Filipe (CURURU)
Os: Sorry for my bad english -
Memory Game - Could You Help Me Out?
Hi,
I've downloaded subways F4 memory game:
http://www.flashkit.com/movies/Games...86/index.shtml
I'm having some difficulties with the code though.
I want to make a birthday card for my little brother and i want to add all the pictures of the family. We are with 10 members. would really want to add two more pairs to the game so there would be 20 cards (4*5 or 5*4). I would be very glad if someone could help me out and assist me in how I should alter the file so an extra column (or row) will appear.
Would someone help me? You would make me and my family very glad!
Thank you very much in advance,
Andries van der Leij
Help With Memory Game
i am trying to model my game after the one seen at:
http://www.flashhog.com/3guys
if you do not want to take a trip there, although its a funny game, its just three guys with beers sitting on a couch. a cat on the floor says "watch" and then the guys will randomly move. one guy burps, one farts, one spits, and the dog on the floor coughs. you will see a random pattern of these events. then the cat will say "your turn" and its up to the player to click the guys in the right order. every round another event is added.
i want to make a game like that. can anyone teach me how?
Memory Game Help
Im trying to create a memory game in flash mx. I have 15 white boxes total(3rows 5collums) that I converted to buttons. On the down state I want a picture to appear and stay. Then when you click on another box it is a match it disappears if not then they turn back to white boxes. What code will i need to make this work?
Anyone Try The BEF Memory Game Tut?
I was trying to make a simple memory game and wanted to use the BEF tut for this, but when I was working through it, I could not get the cards to turn over. Has anyone tryed to follow this tutorial and get it to work? I think I narrowed the problem to the following code snippet:
on (release)
{
if (((_root.cardsInPlay<2) && (this.theCard._currentframe<=1)))
{
if (_root.cardsInPlay == 1)
{
_root.card2Match = this.theCard.cardFace._currectframe;
}
this.theCard.play();
_root.attemptCount++;
_root.gameAttempts = "Attempts: "+Math.roun(_root.attemptCount/2);
}
}
Memory Game
I have to make memory game.
Can somebody send me .fla file which works for eny memory game.
Thank you...bye!
Memory Game
Hello,
I am trying to do a simple Memory Game in Flash 8. The examples I have found are much more complicated than what this game needs to be so I was trying to create my own from scratch. There is no random needed just 8 cards on the screen so 4 matches total. When they get a match the pair visibility turns off and when they are all matched it goes to a finished screen. I have all of that working great but I am having 2 problems.
Problem 1:
When the user selects the wrong card that isn’t a match I need it to flip back over and set the variables back to 0. I can’t figure out how to do this without writing a conditional statement for each possible order the user could select them in.
Problem 2:
When they select the second card and it is a match the match disappears which is good but it goes so quickly that the user doesn’t even have time to see that they got the match. I would like it to delay so it doesn’t disappear so fast.
I would really appreciate any help here. I have attached the FLA file so you can look at the functionality.
Thanks so much!!!
Movie Clips On Stage
card1a
card1b
card2a
card2b
card3a
card3b
card4a
card4b
card1a matches with card1b
card2a matches with card2b
card3a matches with card3b
card4a matches with card4b
Actions on Root Level
On Frame 1:
_global.match1=0
_global.match2=0
_global.match3=0
_global.match4=0
On Frame 5:
card1a.onRelease = function() {
_root.card1a.play();
};
card1b.onRelease = function() {
_root.card1b.play();
};
card2a.onRelease = function() {
_root.card2a.play();
};
card2b.onRelease = function() {
_root.card2b.play();
};
card3a.onRelease = function() {
_root.card3a.play();
};
card3b.onRelease = function() {
_root.card3b.play();
};
card4a.onRelease = function() {
_root.card4a.play();
};
card4b.onRelease = function() {
_root.card4b.play();
};
On Frame 6:
if ((_global.match1 == 2) && (_global.match2 == 2) && (_global.match3 == 2) && (_global.match4 == 2)) {
_root.gotoAndPlay(10);
} else {
_root.gotoAndPlay(_currentframe-1);
}
if (_global.match1 == 2) {
card1a._visible = false;
card1b._visible = false;
}
if (_global.match2 == 2) {
card2a._visible = false;
card2b._visible = false;
}
if (_global.match3 == 2) {
card3a._visible = false;
card3b._visible = false;
}
if (_global.match4 == 2) {
card4a._visible = false;
card4b._visible = false;
}
Actions within Movie Clips
card1a
Frame 1:
stop();
Frame 5:
_global.match1 = (_global.match1) + 1
trace(_global.match1);
stop();
Frame 10:
_global.match1 = (_global.match1) - 1
trace(_global.match1);
card1b
Frame 1:
stop();
Frame 5:
_global.match1 = (_global.match1) + 1
trace(_global.match1);
stop();
Frame 10:
_global.match1 = (_global.match1) - 1
trace(_global.match1);
card2a
Frame 1:
stop();
Frame 5:
_global.match2 = (_global.match2) + 1
trace(_global.match2);
stop();
Frame 10:
_global.match2 = (_global.match2) - 1
trace(_global.match2);
card2b
Frame 1:
stop();
Frame 5:
_global.match2 = (_global.match2) + 1
trace(_global.match2);
stop();
Frame 10:
_global.match1 = (_global.match2) - 1
trace(_global.match2);
card3a
Frame 1:
stop();
Frame 5:
_global.match3 = (_global.match3) + 1
trace(_global.match3);
stop();
Frame 10:
_global.match3 = (_global.match3) - 1
trace(_global.match3);
card3b
Frame 1:
stop();
Frame 5:
_global.match3 = (_global.match3) + 1
trace(_global.match3);
stop();
Frame 10:
_global.match3 = (_global.match3) - 1
trace(_global.match3);
card4a
Frame 1:
stop();
Frame 5:
_global.match4 = (_global.match4) + 1
trace(_global.match4);
stop();
Frame 10:
_global.match4 = (_global.match4) - 1
trace(_global.match4);
card4a
Frame 1:
stop();
Frame 5:
_global.match4 = (_global.match4) + 1
trace(_global.match4);
stop();
Frame 10:
_global.match4 = (_global.match4) - 1
trace(_global.match4);
Help Memory Game
Hi eryone,
I am making a game where you watch the buttons on a trumpet go down then copy the pattern, but I can't get it to work. Here is the fla www.redtrumpet.info/games/tpt.fla
Memory Game Help How To Do The Pop Up?
hi all..
actually the memory card i already created without problem.
What i facing is the pop up.
Its like when user have choose the correct pair. i wanna have a pop-up windows stating the user has won a prize.
http://www.sendspace.com/file/znr1z1
the link above is the flash memory card game.
i wanna do something like that.
When choosen the correct pair. there is a pop-up stating you have won something!
i hope you guys can help! Thanks in advance!
Memory Game Help
Hello
I wonder if someone could help me out with this memory game problem.
I have a working memory that loads 15 images random each time the game starts. That is 30 card with 15 images. They duplicate. When I find two equal images they stay open.
Now on to the problem.
What to do if I´d like to replace a set of images for example:
image 1 x duplicate with image 1 x image2.
Instead of a duplicat I´d like to get two images to belong to each other.
It must be inside the code and im not a master in actionscripting.
Someone....
best regards
micron
Memory Game Help
hi am making a simple memory game where the user has to remember a set pattern of movements e.g. four different colours user has to remember what order they are pressed
basically i need to know if it is possible to make this process random and how i would go about setting it up so the user can guess the process
all examples and pointers welcome
cheers
Memory Game
Hey!
I’m creating a “memory game” in flash 8. For now, I’m trying to do it with only 3 objects.
In these 3 objects, objA corresponds with objB. When objA and objB are selected, “nice” will appear in the main timeline.
I’m having trouble corresponding objA and objB. This is the code I have for each object, can anyone tell me what I’m doing wrong?
object1:
onClipEvent(load)
{
objA=1;
}
on (press)
{
objA=A;
gotoAndPlay("active");
}
on (release)
{
if (objA==A && objB==B)
{
_root.gotoAndPlay("nice");
} else{
this.gotoAndPlay("inactive");
}
}
object2:
onClipEvent(load)
{
objB=1;
}
on (press)
{
objB=B;
gotoAndPlay("active");
}
on (release)
{
if (objA==A && objB==B)
{
_root.gotoAndPlay("nice");
} else{
this.gotoAndPlay("inactive");
}
}
object3:
onClipEvent(load)
{
objC=1;
}
on (press)
{
objC=C;
gotoAndPlay("active");
}
on (release)
{
if (objC==C && objD==D)
{
_root.gotoAndPlay("nice");
} else{
this.gotoAndPlay("inactive");
}
}
Memory Game
I'd like to find a tutorial which teaches you how to create a memory game in Flash 5.
Thank you.
Memory Game
Hi
i am looking for some good memory tutorials made in newer flash version (e.g. flash mx 2004)
I have only found some stupid old game made in flash 4...
I prefer a game that uses xml to get the cards and involves a highscore.
Thanks for your links
Another Memory Game
can anyone help me with the codes?
i was able to code to make my cards shuffle. but how will i make the computer know if the cards match?
i have 20 cards.
Memory Game
Hello,
I am trying to do a simple Memory Game in Flash 8. The examples I have found are much more complicated than what this game needs to be so I was trying to create my own from scratch. There is no random needed just 8 cards on the screen so 4 matches total. When they get a match the pair visibility turns off and when they are all matched it goes to a finished screen. I have all of that working great but I am having 2 problems.
Problem 1:
When the user selects the wrong card that isn’t a match I need it to flip back over and set the variables back to 0. I can’t figure out how to do this without writing a conditional statement for each possible order the user could select them in.
Problem 2:
When they select the second card and it is a match the match disappears which is good but it goes so quickly that the user doesn’t even have time to see that they got the match. I would like it to delay so it doesn’t disappear so fast.
I would really appreciate any help here. I have attached the FLA file so you can look at the functionality.
Thanks so much!!!!!
Movie Clips On Stage
card1a
card1b
card2a
card2b
card3a
card3b
card4a
card4b
card1a matches with card1b
card2a matches with card2b
card3a matches with card3b
card4a matches with card4b
Actions on Root Level
On Frame 1:
_global.match1=0
_global.match2=0
_global.match3=0
_global.match4=0
On Frame 5:
card1a.onRelease = function() {
_root.card1a.play();
};
card1b.onRelease = function() {
_root.card1b.play();
};
card2a.onRelease = function() {
_root.card2a.play();
};
card2b.onRelease = function() {
_root.card2b.play();
};
card3a.onRelease = function() {
_root.card3a.play();
};
card3b.onRelease = function() {
_root.card3b.play();
};
card4a.onRelease = function() {
_root.card4a.play();
};
card4b.onRelease = function() {
_root.card4b.play();
};
On Frame 6:
if ((_global.match1 == 2) && (_global.match2 == 2) && (_global.match3 == 2) && (_global.match4 == 2)) {
_root.gotoAndPlay(10);
} else {
_root.gotoAndPlay(_currentframe-1);
}
if (_global.match1 == 2) {
card1a._visible = false;
card1b._visible = false;
}
if (_global.match2 == 2) {
card2a._visible = false;
card2b._visible = false;
}
if (_global.match3 == 2) {
card3a._visible = false;
card3b._visible = false;
}
if (_global.match4 == 2) {
card4a._visible = false;
card4b._visible = false;
}
Actions within Movie Clips
card1a
Frame 1:
stop();
Frame 5:
_global.match1 = (_global.match1) + 1
trace(_global.match1);
stop();
Frame 10:
_global.match1 = (_global.match1) - 1
trace(_global.match1);
card1b
Frame 1:
stop();
Frame 5:
_global.match1 = (_global.match1) + 1
trace(_global.match1);
stop();
Frame 10:
_global.match1 = (_global.match1) - 1
trace(_global.match1);
card2a
Frame 1:
stop();
Frame 5:
_global.match2 = (_global.match2) + 1
trace(_global.match2);
stop();
Frame 10:
_global.match2 = (_global.match2) - 1
trace(_global.match2);
card2b
Frame 1:
stop();
Frame 5:
_global.match2 = (_global.match2) + 1
trace(_global.match2);
stop();
Frame 10:
_global.match1 = (_global.match2) - 1
trace(_global.match2);
card3a
Frame 1:
stop();
Frame 5:
_global.match3 = (_global.match3) + 1
trace(_global.match3);
stop();
Frame 10:
_global.match3 = (_global.match3) - 1
trace(_global.match3);
card3b
Frame 1:
stop();
Frame 5:
_global.match3 = (_global.match3) + 1
trace(_global.match3);
stop();
Frame 10:
_global.match3 = (_global.match3) - 1
trace(_global.match3);
card4a
Frame 1:
stop();
Frame 5:
_global.match4 = (_global.match4) + 1
trace(_global.match4);
stop();
Frame 10:
_global.match4 = (_global.match4) - 1
trace(_global.match4);
card4a
Frame 1:
stop();
Frame 5:
_global.match4 = (_global.match4) + 1
trace(_global.match4);
stop();
Frame 10:
_global.match4 = (_global.match4) - 1
trace(_global.match4);
Memory Game
Is there a (semi) simple way to produce a memory game like this one?:
http://www.zefrank.com/memory/
I can draw all possible frames but there's bound to be a better way...
Memory Game
I'd like to find a tutorial which teaches you how to create a memory game in Flash 5.
Thank you.
Memory Game
hello,
i would like some help on building a memory game, you know the one with the cards faced down, and you have to pick two that have the same content.
i'm using a 6x6 board (36 cards), but i'm having problems writing the part of the code that attrib's the content to the cards, i can only give the same value to 2 diferent cards taken random from the deck, .... you know the game.
thanks anyway
Memory Game
hiya...
I wondered if anyone had a good simple example of a matching/memory game in Flash. I want the user to be able to click on a box and it will flip to show an image, and then click on another box to try and match. if they don't match then both cards flip back over, if they do match then they disappear. When the user matches all the cards, they get feedback.
If anyone has any work examples or some good suggestions to get me started it would be much appreciated.
thank-you
Memory Game Conflicts - Can You Pls. HELP
I am in dyer need of some scripting help if you can. I have a Memory game for kids. I am using 3 animals, and their corresponding (3) names. The game works fine [but only when the selcetions are made from top row to btm. row]. I have the animals across the top and their names that match below them. If the user starts of by clicking on a btm row card, the script gets confused and does not work. Just like me, confused... Below are 2 of the main frames of coding. There are 2 more frames with coding but I feel the trouble is somewhere below. If you can help me sort this out I sure would be grateful. Many thanks in advance for using your time to look this over for me.
//variables declaration
var sorted = new Array();
var words = new Array('dog','cat','bird');
var arrayPics = new Array();
var arrayNames = new Array();
var elements = 3;
var checkIndex;
var count;
var counter;
var obj1;
var obj2;
var element1;
var element2;
var imgs;
//Step to store picture names in the arrayPics
arraySort();
for(i=0;i<=sorted.length-1;i++){
arrayPics.push(words[sorted[i]]);
}
delete sorted;
//Step to store picture names in the arrayNames
var sorted = new Array();
arraySort();
for(i=0;i<=sorted.length-1;i++){
arrayNames.push(words[sorted[i]]);
}
//This function randomize the numbers that will be used to change the
//Pictures postion
function arraySort(){
var i = 0;
var n = elements;
var ni = elements;
while ( i<=n ) {
number=random(ni);
if (i==0) {
sorted.push(number);
i = i + 1;
}
for ( j=0; j<=(i - 1); j++ ) {
c=0;
for ( k=0; k<=(i-1); k++ ) {
if ( sorted[k]==number ) {
c=1;
}
}
if (c==1) {
break;
}
sorted.push(number);
i = i + 1;
}
if ( i == ni ) {
i = i + 1;
}
}
}
// Function to duplicate and place the movie Clips as well as assing
// some values to them
function start(){
xpos = 250;
ypos = 250;
for(i=0;i<=5;i++){
duplicateMovieClip(mc,'mc'+i,i);
newMc = eval('mc'+i);
with(newMc){
_x = xpos;
_y = ypos;
xpos = _x + _width + 10;
}
if(i==2){
xpos = 250;
ypos = newMc._y + newMc._height + 10;
}
if(i<=2){
newMc.value = arrayNames[i];
}
if(i>2){
newMc.value = arraypics[i-3];
newMc.word = arraypics[i-3];
}
newMc.index = i;
}
}
// This function will be called by click events that will be raised by the
// buttonswhere the images or the names will be placed
function checkIt(obj,name,index){
counter+=1;
checkIndex = index;
if(counter==2){
timeCounter.flag = true;
counter = 0;
checkIndex = ""
}
if(index<=2){
count+=1;
obj1 = obj;
element1 = name;
duplicateMovieClip(img,"img"+count,count+10);
block = eval("img"+count);
imgs = block;
with(block){
attachMovie(name,name,count+20);
_x = obj._x;
_y = obj._y;
_width = 78;
_height = 78;
}
obj._visible = 0;
}
if(index>2){
obj.gotoAndStop(2);
obj2 = obj;
element2 = name;
}
}
// This function will check the matching and will be called by the timerCount
// movie clip. This movie clip will delay one second for each click.
function analyse(){
if(element1<>element2){
imgs.removeMovieClip();
obj1._visible = 1;
obj2.gotoAndStop(1);
} else {
elements-=1;
}
if(elements==0){
count = 0;
gotoAndPlay("labEnd");
}
}
Flash Memory Game Help
how could i make a memory game like this one
http://pbskids.org/caillou/games/memory/index.html
I just want it so when you choose a correct match then it will say at the bottom of the screen *whoo hoo* or whatever
Flash Memory Game
how could i make a memory game like this one
http://pbskids.org/caillou/games/memory/index.html
I just want it so when you choose a correct match then it will say at the bottom of the screen *whoo hoo* or whatever
Memory Game MX 2004
Trying to chance a matching game from making a pair of two eqal to making a pair of two different, but matching cards (ex.: mouse and cheese).
Have made a movieclip with 13 frames:
first frame = back of card.
frame 2 and 3 matches, 4 and 5 etc.
Tried to make the following code match the job:
Of couse it wont work, because I havent managed to tell the code to match frame 2 and 3 etc. The code is still looking for a match of two identical frames...
Is this getting too complicates?
initGame();
stop();
function initGame() {
cardsListOrdered = [];
for(i=1;i<=12;i++) {
cardsListOrdered.push()
}
cardsListSorted = [];
while (cardsListOrdered.length > 0) {
r = int(Math.random()*cardsListOrdered.lenght);
cardsListSorted.push(cardsListOrdered[r]);
cardsListOrdered.splice(r,1);
}
x = 0;
y = 0;
for(i=0;i<12;i++) {
attachMovie("Card","Card"+i,i);
_root["Card"+i].picture = cardsListSorted[i];
_root["Card"+i]._x = x*79+140;
_root["Card"+i]._y = y*72+130;
x++;
if (x > 3) {
x = 0;
y++;
}
}
firstclip = 0;
}
function clickCard(clip) {
if (secondclip != 0) {
firstclip.gotoAndStop(back);
secondclip.gotoAndStop(back);
firstClip = 0;
secondClip = 0;
}
if (firstclip == clip) {
firstclip.gotoAndStop(back),
firstClip = 0;
} else if (firstclip == 0) {
clip.gotoAndStop(clip.pair+1);
firstclip = clip;
} else {
clip.gotoAndStop(clip.pair+1+b);
secondClip = clip;
if (firstclip.pair1 == secondClip.pair1b) {
firstClip.removeMovieClip();
secondClip.removeMovieClip();
firstClip = 0;
secondClip = 0;
}
}
}
stop();
[F8] Help On Simple Memory Game...
Hi, im trying to create a simple memory game w/o the use of ARRAYs.
I haven't learned how to use Arrays yet.. anyways
im using a simple algorithm to try and make things work.
Code:
var a_counter:Number = 0;
var b_counter:Number = 0;
var click_counter:Number = 0;
//card 1 cover onRelease
c1_cover.onRelease = function(){
this._alpha = 0; //change alpha to 0
a_counter += 1; //add 1 to a_counter
click_counter += 1;
}
//card 1a cover onRelease
c1_acover.onRelease = function(){
this._alpha = 0; //change alpha to 0
a_counter += 1; //add 1 to a_counter
click_counter += 1;
}
//card 2 cover onRelease
c2_cover.onRelease = function(){
this._alpha = 0; //change alpha to 0
b_counter += 1; //add 1 to b_counter
click_counter += 1;
}
//card 2a cover onRelease
c2_acover.onRelease = function(){
this._alpha = 0; //change alpha to 0
b_counter += 1; //add 1 to b_counter
click_counter += 1;
}
//onEnterFrame
onEnterFrame = function(){
//hide cards aa_card and aa_1card when a_counter is equal to 2
if(a_counter == 2){
aa_card._alpha -= 10;
aa_1card._alpha -= 10;
}
//hide cards bb_card and bb_1card when a_counter is equal to 2
if(b_counter == 2){
bb_card._alpha -= 10;
bb_1card._alpha -= 10;
}
//hide cards aa_card and aa_1card when a_counter is equal to 2
if((click_counter==2)&&(a_counter==1)){
c1_cover._alpha += 10;
c1_acover._alpha += 10;
}
if((click_counter==2)&&(b_counter==1)){
c2_cover._alpha += 10;
c2_acover._alpha += 10;
}
}
here's the code im using...
now if you click on the top cards to match them, then the bottom ones you win. But if you dont match them , it will go to an error.
the problem is... if click_counter == 2, im suppose to reset it back to 0. but i cant simply write
if (click_counter == 2){
click_counter = 0;
}
because it wont reset the cards..
attached is the fla file im using..
very much appreciate it if someone can take a look at it..
thanks
Memory Game Script
New here.
I'm putting together a memory game for my boss with Flash 8 dynamically, and the AS I have does not have code to collect the back of the card jpg from the folder. My expertise is not as high as I would like it to be so an explanation, as well as a solution, would be fantastic.
My question is, "Does anyone know how I would go about attaching a simple .jpg to the back of all the cards instead of a blue box?"
this is the code that I'm using:
PHP Code:
card_w = 70;
card_h = 90;
card_wdistance = 10;
card_hdistance = 10;
card_dw = card_w + card_wdistance;
card_dh = card_h + card_hdistance;
row_card = Math.floor((Stage.width - card_wdistance) / card_dw);
col_card = Math.floor((Stage.height - card_hdistance) / card_dh);
n_card = col_card * row_card % 2 == 0 ? col_card * row_card : (col_card - 1) * row_card;
imgs_n = n_card / 2;
centerImage = function(target){
target.front._visible = false
target.front.container._x -= target.front.container._width / 2
target.front.container._y -= target.front.container._height / 2
}
empty = new Array();
function createCard(n, w, h) {
empty.push(n);
this.createEmptyMovieClip('card' + n, n);
with (this['card' + n]) {
lineStyle(0, 0x000000, 100);
beginFill(0x000099, 60);
moveTo(w / 2, 0);
lineTo(w / 2, h / 2);
lineTo(-w / 2, h / 2);
lineTo(-w / 2, -h / 2);
lineTo(w / 2, -h / 2);
lineTo(w / 2, 0);
endFill();
createEmptyMovieClip('front', 1);
front.createEmptyMovieClip('container', 2);
front.createEmptyMovieClip('backgr', 1);
with (front.backgr) {
moveTo(-w / 2, -h / 2);
lineStyle(0, 0x000000, 0);
beginFill(0x333333, 100);
lineTo(w / 2, -h / 2);
lineTo(w / 2, h / 2);
lineTo(-w / 2, h / 2);
lineTo(-w / 2, -h / 2);
endFill();
}
front.onEnterFrame = function() {
tot = this.container.getBytesTotal();
car = this.container.getBytesLoaded();
if (tot == car && tot > 200) {
this._parent._parent.centerImage(this._parent);
delete this.onEnterFrame;
}
};
}
}
selcards = [];
function placeImages() {
act_img = 0;
for (img = 0; img < imgs_n; img++) {
for (k = 0; k < 2; k++) {
act = Math.round(Math.random() * (empty.length - 1));
this['card' + empty[act]].img_id = act_img;
this['card' + empty[act]].front.container.loadMovie("imgs/img" + act_img + ".jpg");
this['card' + empty[act]].onRelease = function() {
this.rotateCard(0, 0);
this.enabled = false;
MovieClip.prototype.enabled = false;
};
empty.splice(act, 1);
}
act_img++;
}
}
MovieClip.prototype.rotateCard = function(v, i) {
this.operazione = v == 0 ? +0.1 : -0.1;
this.incremento = i == 0 ? 100 : 10;
selcards.push(this._name);
this.onEnterFrame = function() {
this.incremento += this.operazione;
this._xscale = (100 * Math.sin(this.incremento));
if (this._xscale > 0) {
this.front._visible = v == 1 ? false : true;
}
if (this._xscale >= 99) {
delete this.onEnterFrame;
selcards.length < 2 ? MovieClip.prototype.enabled = true : null;
v == 0 && selcards.length > 1 ? checkCards() : null;
}
};
};
function generateGameField(cards, distance, hdistance) {
Ypos = card_h / 2 + hdistance;
Xpos = card_w / 2 + distance;
for (c = 0; c < cards; c++) {
createCard(c, card_w, card_h);
if (c % row_card == 0 && c > 0) {
Ypos += this['card' + c]._height + hdistance;
Xpos = card_w / 2 + distance;
}
this['card' + c]._x = Xpos;
this['card' + c]._y = Ypos;
Xpos += this['card' + c]._width + distance;
}
placeImages();
}
generateGameField(n_card, card_wdistance, card_hdistance);
score = 0;
this.createTextField('punti', -1, 500, 380, 0, 0);
punti.autoSize = true;
punti.text = 0;
function checkCards() {
if (this[selcards[0]].img_id == this[selcards[1]].img_id) {
score++;
punti.text = score;
eval(selcards[0])._visible = eval(selcards[1])._visible = false;
} else {
eval(selcards[0]).rotateCard(1, 1);
eval(selcards[1]).rotateCard(1, 1);
eval(selcards[0]).enabled = eval(selcards[1]).enabled = true;
}
selcards = [];
MovieClip.prototype.enabled = true;
}
I would appreciate any help.
The Ol' Memory Game Question
Hello!
First time poster here, I've been having an issue with Actionscript 3.0 and figured this would be the best place to ask!
I am learning the program through Lynda.com's tutorials by Todd Perkins. After going over functions, custom classes, arrays, loops, and all that good stuff, he is working on coding an old fashioned memory game, you know, the kind where you flip two cards and hope they match!
So, I am following along and doing the same thing in my own files. Where the problem arises is getting the image to appear on the card.
To be more specific, the card is a movie clip. In the movie clip, the bottom layer is a shape tween to make the card look like it's turning. Above that is a movie clip, with alpha to 0, motion tweened to also "turn". This movie clip's instance is called "loader_mc", and, ideally, this movie clip is supposed to hold the graphic. However, though my code is identical to his, no graphic shows up.
So my question is, how can I get this movie clip to accept the graphic? Here is my code:
Card code
ActionScript Code:
package
{
import flash.display.MovieClip;
import flash.events.MouseEvent;
public class Card extends MovieClip
{
private var _type:*;
public function Card()
{
this.buttonMode = true;
this.addEventListener(MouseEvent.CLICK, onClick);
}
private function onClick(event:MouseEvent):void
{
this.play();
}
public function setType(type:*):void
{
_type = type;
loader_mc.addChild(_type);
}
}
}
Custom Class code
ActionScript Code:
package
{
import flash.display.MovieClip;
import Card;
import Kid;
import Baby1;
public class MemoryGame extends MovieClip;
{
private var _card:Card;
private var _kid:Kid;
private var _baby:Baby1;
public function MemoryGame()
{
createCards();
}
public function createCards():void
{
_card = new Card();
addChild(_card);
_kid = new Kid();
_card.setType(_kid);
}
}
}
I don't get error messages, but I don't get the proper result. I think the problem is not so much the code, but rather, how the movie clipc (loader_mc) is set up. In the tutorial, he just refers to it as a movie clip with the alpha on 0. But there's gotta be something more to that?
I thank you all so much in advance for helping me with this convoluted problem. I'm sorry it's such a long, drawn out, and specific one!
Thanks again!!
Help With Memory Matching Game
Hi to all.
I'm programming a matching game, and I downloaded a sample from this site: memory.fla. The sample is nice, but I want to match two different images (a word and the matching image). The game is made only for matching two identical images.
What changes I have to do to the ActionScript code to do this?
Please help...
Thanks in advance...
Tha
Advice On Memory Game
Okay, I'm working on creating a memory game for work, but I'm having a little trouble.
Specifically, I'm trying to work out the following sequence:
1. Select first tile. It has an animated flip to reveal the picture.
2. Select second tile. It also has the animated flip.
3. Wait about half a second.
a. If the tiles match, they disappear and a sidebar slides in from the side.
b. If the tiles do not match, they flip back over (again with the animation).
I'm really close, but I keep running into hitches if you click tiles too quickly, or other minor hiccoughs. I'm starting to think that my entire approach to the problem is flawed.
So my question is this: how would youwork this sequence out? I don't need any code, just the theory you'd use to keep everything running smoothly. I'd like to keep it object-oriented, and in AS 2.0, but I'm willing to try just about anything within those constraints. So how 'bout it?
Rys
How Do I Make A Game Like Memory ?
Hi , I am trying to prgrame a very simple game kinda like memory, where you match to movie clips, and than they are a pair and cannot be parted. but I have gotton stuck on the part after a movie clip is dragable.
I can make the movieclip cickable and dragable, I can even make it stop draging as soon as it has met the movieclip that it matches, but I only want it to stop draging after it has been released on top of the Movie clip it matches; it matches otherwise I want it to return to its starting poisition.
so how do i do this?
thaks for yor help.
Flash-Memory Game
I wondered if anyone knows how to do a memory game using Flash. I want the user to be able to click on a box and it will flip to show an image, and then click on another box to try and match. if they don't match then both cards flip back over, if they do match then they disappear. When the user matches all the cards, they get feedback.
I would appreciate very much if anybody could me help get started in any way.
Thank you so much for your help !!
Carol
Memory Game AS Show 2 Cards
Been working on a project, a Memory Game, I can only get it to show one card at a time and I would like it to show 2 cards a time.
Many Thanks,
__________________________________________________ _________
picArray = new Array("pic1","pic1","pic2","pic2","pic3","pic3","p ic4","pic4","pic5","pic5","pic6","pic6","pic7","pi c7","pic8","pic8");
trial = 0;
_root.p0._visible = 0;
countPic = 0
newArray = new Array();
function checkPicture(pic,bt,mc){
newArray.push(pic);
countPic++
if ( countPic ==1 ) {
pic1 = pic
bt1 = bt
mc_1 = mc
}
if (countPic ==2) {
trial += 1
pic2 = pic
bt2 = bt
mc_2 = mc
if ( pic2 == pic1 ) {
snd = new Sound();
snd.attachSound("ok");
snd.start(0,2);
countPic = 0
count = count + 2
CheckEnd(count);
} else {
countPic = 0
snd = new Sound();
snd.attachSound("bad");
snd.start(0,2);
var1 = eval(bt1);
removeMovieClip(var1);
var2 = eval(bt2);
removeMovieClip(var2);
var3 = eval(mc_1)
var3._visible = 1;
var4 = eval(mc_2)
var4._visible = 1;
for ( i=0; i<=newArray.length-1; i++ ) {
if ( newArray[i] == pic1 || newArray[i] == pic2 ) {
newArray.splice(i-1,1);
}
}
}
}
delete snd
}
stop();
Memory Game - Match 2 Different Cards
I am trying to change the actionsScript for a memory game matching a copy with the original card - to a memory game matching two different cards. I have place all the cards in a movieClip - first frame=back of card, second frame=first half of a pair, third frame=second half of a pair - contiuing with 6 pairs.
I have problems making the match :
The old code was easy:
if(firstclip.picture==secondclip.picture) {
firstClip.removeMovieClip();
secondClip.removeMovieClip();
firstClip=0;
secondclip=0;
}
How can I change it???
----
The whole script looks like this: (the movieClip with the cards is named: kort!
----
initGame();
stop();
function initGame() {
// make sorted list of cards
cardsListOrdered = [];
for(i=1;i<=12;i++) {
cardsListOrdered.push(i);
}
// shuffle list
cardsListSorted = [];
while (cardsListOrdered.length > 0) {
r = int(Math.random()*cardsListOrdered.length);
cardsListSorted.push(cardsListOrdered[r]);
cardsListOrdered.splice(r,1);
}
// create card clips and assign their location and picture
x = 0;
y = 0;
for(i=0;i<12;i++) {
attachMovie("kort","kort"+i,i);
_root["kort"+i].pair = cardsListSorted[i];
_root["kort"+i]._x = x*83+145;
_root["kort"+i]._y = y*76+117;
// move to next card spot
x++;
if (x > 3) {
x=0;
y++;
}
}
firstclip = 0;
}
function clickKort(clip) {
// see whether two cards are showing
if (secondclip !=0) {
// turn those two cards back over
firstclip.gotoAndStop(1);
secondclip.gotoAndStop(1);
firstClip = 0;
secondClip = 0;
}
// see whether same card was clicked
if (firstclip == clip) {
// turn card back over
firstclip.gotoAndStop(1);
firstClip=0;
// see whether no cards are showing
} else if (firstclip==0) {
// turn first card over
clip.gotoAndStop(clip.pair+1);
firstclip=clip;
// must be one card showing
} else {
// turn second card over
clip.gotoAndStop(clip.pair+1);
secondClip = clip;
// see whether two cards match
if(firstClip.pair == secondClip.pair){
// remove both cards
firstClip.removeMovieClip();
secondClip.removeMovieClip();
firstClip = 0;
secondClip = 0;
}
}
}
Building A Flash MX Memory Game
Hello All,
I used a tutorial off this site by Gant to build a Memory Card game in Flash MX. You know the type that displays so many cards...and you flip one over at a time and try and match it to another until all the cards are matched. I think we all have seen or played that game.
Anyways...it took me a long time to get it all put together-but in the end is not working because I do not know where to put the 'function coding'. Anyways....does anyone have a good tutorial on making this game?
Also...I am looking for a tutorial on making a 'sliding puzzle' game in Flash MX as well. You know....you have a simple picture--cut it into squares and scramble it up. Then the tiles have to be slid into place to make the picture appear.
If anyone has any good tutorials for these games or can direct me to them I would really appreciate it---I suck bad when it comes to games!
LOL
Thanks in advance...
Photographical Memory Help Modify This Game
hi all could you help meplease modify my game so that it can be
interactive it is a spelling games for kides
i want an array " not too good whith arrays " of 100 words to randomly choose 10 out of them
display them on after the other and between every word there sould be a word " photographical memory"
when the kides see this word they start writing the word be for it
hope that i made myself clear
[F5] Pairs Memory Game Issues
Can anyone help with a script to get me out of a hole?
I am revisiting a pairs memory game that I worked on a few years ago. Long story short is that I am a designer who originally took over the design of this game, not the scripting. I have a basic level of Flash but not much AS. The client now wishes to use this 'xmas' game again this year (see attached) but with a few additions:
I need to create additional pairs from the current 12 to 18, so 36 cards in total.
I also need a text message (with small accompanying image) popping up when a pair is matched. A different message needs to be shown when each specific pair is matched.
The game was created in Flash 5 so I assume that the additional or modified scripts needs to match or the game won't work when published. Please advise?
Note that I’m probably going to need a step by step guide on how to set this up in flash. I hope it isn't too difficult.
Paul
|