# Move Player @ Dice Game on Board

**URL:** <https://forum.kirupa.com/t/move-player-dice-game-on-board/352028>\
**Category:** flash\
**Created:** [November 13, 2014, 7:48am UTC](https://forum.kirupa.com/t/move-player-dice-game-on-board/352028 "2014-11-13T07:48:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jimfakoya](https://avatars.discourse-cdn.com/v4/letter/j/73ab20/32.png) [@jimfakoya](https://forum.kirupa.com/u/jimfakoya)\
**Post date:** [November 13, 2014, 7:48am UTC](https://forum.kirupa.com/t/move-player-dice-game-on-board/352028/1 "2014-11-13T07:48:54Z")

</div>

Using Actionscript 3, How does a player move based on dice result?  
I’m developing a game that is based on the popular snake and ladder game as my undergraduate project. It has 36 tiles. Thus far, I’m able to roll the dice but needs the player to move with dice result. I appreciate help. Here is code:

```
package{

    

    import flash.display.*;

    import flash.events.*;

    import flash.text.*;

    

    public class peaconty extends MovieClip{

        

        //variables

        public var rollBtn;

        public var dieMov;

        public var boardMov;

        public var textResult;

        

        public function peaconty() :void{

            rollBtn.addEventListener(MouseEvent.CLICK, rollRandomNumber);

            dieMov.gotoAndStop(Math.ceil(Math.random() * 6));

            boardMov.gotoAndStop(Math.ceil(Math.random() * 6));

        }

        

        function rollRandomNumber(Event:MouseEvent) :void{

            //trace(randNumb);

            var randNumb:uint = Math.ceil(Math.random() * 6);

            textResult.text = "You rolled "+randNumb;

            

            dieMov.gotoAndStop(randNumb);

            boardMov.gotoAndStop((currentFrame) +(randNumb));

    }

}

}

```

Working files are here: [https://drive.google.com/file/d/0B6-sCCgH269LZGFUamVyVllVOWM/view?usp=sharing](https://drive.google.com/file/d/0B6-sCCgH269LZGFUamVyVllVOWM/view?usp=sharing)  
Thanks.
