Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7013615
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:24:51+00:00 2026-05-27T22:24:51+00:00

I am newer in FLEX and currently i am using FLEX 3.0 I want

  • 0

I am newer in FLEX and currently i am using FLEX 3.0
I want to develop a Tic Tac Toe game in FLEX. At first i think this one is the easiest for me but now its going to be very tough for me. I have searched on Internet but not a single link helps me that much so please give me proper Idea with proper code. Here i am giving you the sample code. its a bit of complex so sorry for that.

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" backgroundColor="#000000" 
horizontalAlign="center" verticalAlign="middle" height="100%" width="100%" verticalGap="0" horizontalGap="0">

<mx:Script>
    <![CDATA[
        import mx.controls.Alert;
        import mx.controls.Image;

        private var blnFirst:Boolean = true;
        private var arr0:Array = new Array();
        private var arr1:Array = new Array();
        private var arr2:Array = new Array();
        private var count:int = 0;
        private var arr:Array = new Array();
        private var pl1Won:Boolean = false;
        private var pl2Won:Boolean = false;

        public function img_click(event:Event):void
        {
            if(event.currentTarget.enabled)
            {
                count++;
                if(blnFirst)
                {
                    blnFirst = false;
                    var itemp:Image = new Image();
                    itemp.percentHeight = 100;
                    itemp.percentWidth = 100;
                    itemp.source = "Images/Circle.png";
                    event.currentTarget.addChild(itemp);
                    event.currentTarget.enabled = false;
                    arrayInsert(event.currentTarget.id,true);
                }
                else
                {
                    blnFirst = true;
                    var itemp:Image = new Image();
                    itemp.percentHeight = 100;
                    itemp.percentWidth = 100;
                    itemp.source = "Images/Cross.png";
                    event.currentTarget.addChild(itemp);
                    event.currentTarget.enabled = false;
                    arrayInsert(event.currentTarget.id,false);
                }
            }

            if(count == 9)
            {
                arr = [arr0, arr1, arr2];
            }
        }

        private function arrayInsert(id:String,value:Boolean):void
        {
            if(id == "box00")
                arr0[0] = value;    
            if(id == "box01")
                arr0[1] = value;
            if(id == "box02")
                arr0[2] = value;
            if(id == "box10")
                arr1[0] = value;
            if(id == "box11")
                arr1[1] = value;    
            if(id == "box12")
                arr1[2] = value;
            if(id == "box20")
                arr2[0] = value;    
            if(id == "box21")
                arr2[1] = value;    
            if(id == "box22")
                arr2[2] = value;
        }

        private function btn_click():void
        {
                        for(var i:int=0;i<3;i++)
            {
                for(var j:int=0;j<3;j++)
                {
                    //very confused in this part
                }
            }
                            }

    ]]>
</mx:Script>
<mx:VBox height="500" width="500" borderStyle="solid" borderThickness="3" borderColor="#000000"
    backgroundColor="#ffffff" verticalGap="0" horizontalGap="0">

    <mx:HBox width="100%" height="33.3%" horizontalGap="0" verticalGap="0">

        <mx:Box height="100%" width="33.3%" borderStyle="solid" borderThickness="3" borderColor="#000000" backgroundColor="#ffffff"
            click="{img_click(event);}" id="box00" >
        </mx:Box>
        <mx:Box height="100%" width="33.3%" borderStyle="solid" borderThickness="3" borderColor="#000000" backgroundColor="#ffffff"
            click="{img_click(event);}" id="box01">
        </mx:Box>
        <mx:Box height="100%" width="33.4%" borderStyle="solid" borderThickness="3" borderColor="#000000" backgroundColor="#ffffff"
            click="{img_click(event);}" id="box02">
        </mx:Box>

    </mx:HBox>
    <mx:HBox width="100%" height="33.3%" horizontalGap="0" verticalGap="0">

        <mx:Box height="100%" width="33.3%" borderStyle="solid" borderThickness="3" borderColor="#000000" backgroundColor="#ffffff"
            click="{img_click(event);}" id="box10">
        </mx:Box>
        <mx:Box height="100%" width="33.3%" borderStyle="solid" borderThickness="3" borderColor="#000000" backgroundColor="#ffffff"
            click="{img_click(event);}" id="box11">
        </mx:Box>
        <mx:Box height="100%" width="33.4%" borderStyle="solid" borderThickness="3" borderColor="#000000" backgroundColor="#ffffff"
            click="{img_click(event);}" id="box12">
        </mx:Box>

    </mx:HBox>
    <mx:HBox width="100%" height="33.4%" horizontalGap="0" verticalGap="0">

        <mx:Box height="100%" width="33.3%" borderStyle="solid" borderThickness="3" borderColor="#000000" backgroundColor="#ffffff"
            click="{img_click(event);}" id="box20">
        </mx:Box>
        <mx:Box height="100%" width="33.3%" borderStyle="solid" borderThickness="3" borderColor="#000000" backgroundColor="#ffffff"
            click="{img_click(event);}" id="box21">
        </mx:Box>
        <mx:Box height="100%" width="33.4%" borderStyle="solid" borderThickness="3" borderColor="#000000" backgroundColor="#ffffff"
            click="{img_click(event);}" id="box22">
        </mx:Box>

    </mx:HBox>

</mx:VBox>

<mx:Button click="{btn_click();}" />

</mx:Application>

I have check the winning condition on btn_click() function but you can give me the idea to change it when the one row is completed.

I want to know how to handle the array of TicTacToe Game.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T22:24:52+00:00Added an answer on May 27, 2026 at 10:24 pm

    This game can develop using different Logic.
    Refer 1 and 2 Which source enabled.
    and try to accomplish your game.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I think that some newer languages like JS can do this natively, but I
I am newer with flex technology.I am creating a chart using ant file &
I'm developing a video chat application using flex. After some bandwidth check I want
I want to read an Atom in Flex. I can see in the debugger
I'm developing a small python like language using flex, byacc (for lexical and parsing)
I want to connect Java and FLEX. I have never used Java and also
I am developing a simple compiler in the cygwin environment using flex and bison
I am developing a Flex-based game, and struggling with SmartFox Server. Anyway, it's a
I am creating a mobile app with Flex 4.6 and I'm using the SplitViewNavigator
I am writing a flex application and I have two Spark TextAreas. I want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.