# Newbie - How to create chess game?

**URL:** <https://forum.kirupa.com/t/newbie-how-to-create-chess-game/10446>\
**Category:** flash\
**Created:** [January 1, 2003, 9:36am UTC](https://forum.kirupa.com/t/newbie-how-to-create-chess-game/10446 "2003-01-01T09:36:11Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![RayDream](https://avatars.discourse-cdn.com/v4/letter/r/dbc845/32.png) [@RayDream](https://forum.kirupa.com/u/RayDream)\
**Post date:** [January 1, 2003, 9:36am UTC](https://forum.kirupa.com/t/newbie-how-to-create-chess-game/10446/1 "2003-01-01T09:36:11Z")

</div>

Hi there,

I am a newbie who don’t know a thing about scripting… However I want to create a simple board game with no AI. It will be as simple as the player will click on the empty area to make a black seed appear, on the next click it will turns white, then on the next click it will turn empty.

Original board:  
+++++  
+++++  
+++++  
+++++

Click once:  
+++++  
+++++  
++B++  
+++++

Click again:  
+++++  
+++++  
++W++  
+++++

Click again:  
+++++  
+++++  
+++++  
+++++

Click click click click…  
+++++  
++BB+  
+BBB+  
++B++

Click click …  
+++++  
++BW+  
+BWB+  
++B++

Click …  
+++++  
++BW+  
+B+B+  
++B++

i hope you can understand from the draft above… Thats mean the game does not need to process all the rules in the game, but the player will play the game with the rules he knows.

Please help!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 1, 2003, 1:57pm UTC](https://forum.kirupa.com/t/newbie-how-to-create-chess-game/10446/2 "2003-01-01T13:57:59Z")

</div>

all of your +'s would be movieclips. in these movieclips you have 3 frames. +, B and W. The images or whatever is used for +, B and W will all go in their own frame on a single layer (+ on frame 1, B on frame 2 and W on frame 3). Under that layer make a new layer for a button. This button will control the progression of the space through the +, B and W when clicked. This single layer will cover the entire 3 frames and have just that single button. This button should be a square the size of a single playing space. I see you having two options for this button. 1) make it a normal button so that it actually is the the background of the board or 2) make it an invisible button so it doesnt interfere with any of the imagery of the board. To do that, simply edit your button and move the square shape that makes up the button to be only included in the HIT frame.

Now going back to the 3 frame movieclip, put a stop() command on every frame. You can do this in the +,B,W layer since the frames are already broken up there. Then on your button (which takes up the 3 frames) add  
on(press){  
play()  
}  
then whenever you hit the button, you’ll play to the next frame and stop. You could have used nextframe() but then at the last frame you would have had to set up something to go back to frame 1. play automatically does this so i figured it was easier this way.

Thats pretty much it. Now you can arrang your board the way you want to using these peices, test it, and see how it works.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 1, 2003, 10:26pm UTC](https://forum.kirupa.com/t/newbie-how-to-create-chess-game/10446/3 "2003-01-01T22:26:40Z")

</div>

try this one: [basic chess thingy](http://www.avalon-rev.dk/basic_chess.html)

And here’s the fla, in case u wanna see it…: [fla-file]([http://www.avalon-rev.dk/basic](http://www.avalon-rev.dk/basic) chess.fla)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 2, 2003, 6:06am UTC](https://forum.kirupa.com/t/newbie-how-to-create-chess-game/10446/4 "2003-01-02T06:06:50Z")

</div>

Has he even read it? :-\

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 2, 2003, 10:33am UTC](https://forum.kirupa.com/t/newbie-how-to-create-chess-game/10446/5 "2003-01-02T10:33:45Z")

</div>

Yes! Thank you very much!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 2, 2003, 10:55am UTC](https://forum.kirupa.com/t/newbie-how-to-create-chess-game/10446/6 "2003-01-02T10:55:36Z")

</div>

Ah, there he was 🙂

hehe…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 2, 2003, 6:03pm UTC](https://forum.kirupa.com/t/newbie-how-to-create-chess-game/10446/7 "2003-01-02T18:03:01Z")

</div>

[www.geocities.com/raydream\_ework/weiqi.swf](http://www.geocities.com/raydream_ework/weiqi.swf)  
🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 2, 2003, 6:07pm UTC](https://forum.kirupa.com/t/newbie-how-to-create-chess-game/10446/8 "2003-01-02T18:07:24Z")

</div>

when linking a geocities swf, include the html and link the html. gc doesnt like off-account file linking.

and for anyone who runs across these gc direct swf links, the easiest way to get around them is to click the link once to pop up the window then click and drag the link into the new window. It will load fine then.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 2, 2003, 6:07pm UTC](https://forum.kirupa.com/t/newbie-how-to-create-chess-game/10446/9 "2003-01-02T18:07:33Z")

</div>

Sweet. Nice work! Very aesthetically pleasing.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 2, 2003, 6:22pm UTC](https://forum.kirupa.com/t/newbie-how-to-create-chess-game/10446/10 "2003-01-02T18:22:42Z")

</div>

Ah… ![](http://www.avalon-rev.dk/blush.gif)… hehe…

Is anything clickable yet?? (-:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 2, 2003, 6:24pm UTC](https://forum.kirupa.com/t/newbie-how-to-create-chess-game/10446/11 "2003-01-02T18:24:26Z")

</div>

oh no…help!

Actually I am creating this for my pocket pc. However the flash player in pocket pc only support version 5, yet if i export the program to version 5, the click can not work!

What’s wrong?

[www.geocities.com/raydream\_ework/weiqifla.zip](http://www.geocities.com/raydream_ework/weiqifla.zip)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 2, 2003, 6:26pm UTC](https://forum.kirupa.com/t/newbie-how-to-create-chess-game/10446/12 "2003-01-02T18:26:06Z")

</div>

hold on… I can fix this 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 2, 2003, 6:32pm UTC](https://forum.kirupa.com/t/newbie-how-to-create-chess-game/10446/13 "2003-01-02T18:32:23Z")

</div>

my method is flash 5 compatible

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 2, 2003, 6:32pm UTC](https://forum.kirupa.com/t/newbie-how-to-create-chess-game/10446/14 "2003-01-02T18:32:38Z")

</div>

AHHH!!!

did u really make all the little blocks manually?? Or… rather… duplicated them??

Hmmmm… I’ll show you how to do it in my other fla, the one I gave u before…

Hang on a few minutes…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 2, 2003, 6:36pm UTC](https://forum.kirupa.com/t/newbie-how-to-create-chess-game/10446/15 "2003-01-02T18:36:44Z")

</div>

Haha…thanks a lot for the last file… but I can’t figure out a way to create layers above the one duplicated by arrays… so I end up copy them one by one…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 2, 2003, 6:41pm UTC](https://forum.kirupa.com/t/newbie-how-to-create-chess-game/10446/16 "2003-01-02T18:41:21Z")

</div>

Hehe, it’s oki, as long as you can figure it out 😛

Well, this version should work in flash 5 🙂

[download fla]([http://www.avalon-rev.dk/basic](http://www.avalon-rev.dk/basic) chess.fla)  
see it: [here!]([http://www.avalon-rev.dk/basic](http://www.avalon-rev.dk/basic) chess.html)

I just added an invisible button on a seperate layer inside the block MC, and moved the code the that one instead.

Flash 5 doesn’t allow button code on MC’s, flash 6 does… so… 🙂

hehe…

Btw u know anything about a flash player for smartphones?? I know the pocketPC player is out tho…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 2, 2003, 6:58pm UTC](https://forum.kirupa.com/t/newbie-how-to-create-chess-game/10446/17 "2003-01-02T18:58:08Z")

</div>

Sorry I don’t know anything about smartphone…

And erm… add a ‘button’ layer below? Does that mean I can just add one in my symbol so that I do not have to duplicate all of them once again?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 2, 2003, 7:18pm UTC](https://forum.kirupa.com/t/newbie-how-to-create-chess-game/10446/18 "2003-01-02T19:18:06Z")

</div>

Hang on…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 2, 2003, 7:23pm UTC](https://forum.kirupa.com/t/newbie-how-to-create-chess-game/10446/19 "2003-01-02T19:23:21Z")

</div>

Here it is! 🙂

Dunno why I didn’t just do it on yours right from the start 😛

www.avalon-rev.dk/weiqi.fla

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 2, 2003, 7:24pm UTC](https://forum.kirupa.com/t/newbie-how-to-create-chess-game/10446/20 "2003-01-02T19:24:46Z")

</div>

Oh… I follow exactly the same as how you add the button… but there is still some kind of errors show up when I publich:

[www.geocities.com/raydream\_ework/weiqibutton.zip](http://www.geocities.com/raydream_ework/weiqibutton.zip)

[Next page](https://forum.kirupa.com/t/newbie-how-to-create-chess-game/10446.md?page=2)
