Craps game help

Hi
I’m very new to action script and i’m trying to make a craps game in flash.

The program starts with a login screen which takes you to a menu, then you get the choice of 3 games. I’m on my second game so far which i’m having trouble with.

So far i’ve managed to get 2 spinners with numbers 1-6 on each, which will spin, give you the values in 2 separate text boxes then add the value together in another text box.

The trouble i am having is the winning and lossing condions, where i have no idea where to start.

Rulse are if your value equals 7 or 11 you win
if your value equals 2,3 or 12, yoo lose and
if your value is anothing else then user gets another go and has to get the same value again or get a 7 and lose.

Heres code so far:

import fl.transitions.Tween;
import fl.transitions.TweenEvent;
import fl.transitions.easing.*;

var randomnumber:Number;
var randomvalue:Number;
var winorlose:Number;

var tw:Tween = new Tween(arrow_mc,“rotation”,Strong.easeOut, 0, 360, 3, true);
tw.stop();

tw.addEventListener(TweenEvent.MOTION_FINISH, spinStopped);

function spinStopped(twevt:TweenEvent):void {
count_txt.text = String(randomnumber);
arrow_mc.addEventListener(MouseEvent.CLICK, spin);
var sum = Number(randomnumber)+Number(randomvalue);
sum_txt.text = String(sum);
}

var mv:Tween = new Tween(pointer_mc,“rotation”,Strong.easeOut, 0, 360, 3, true);
mv.stop();

mv.addEventListener(TweenEvent.MOTION_FINISH, spinFinish);

function spinFinish(twevt:TweenEvent):void {
value_txt.text = String(randomvalue);
pointer_mc.addEventListener(MouseEvent.CLICK, spinner);
var sum = Number(randomnumber)+Number(randomvalue);
sum_txt.text = String(sum);
}

arrow_mc.addEventListener(MouseEvent.CLICK, spin);

function spin(mevt:MouseEvent):void {
var numturns:int = Math.ceil(2Math.random());
randomnumber = Math.ceil(6
Math.random());

arrow_mc.removeEventListener(MouseEvent.CLICK, spin);



tw.begin = arrow_mc.rotation;
tw.finish = numturns*360 + randomnumber*60;
tw.start();

}

pointer_mc.addEventListener(MouseEvent.CLICK, spinner);

function spinner(mevt:MouseEvent):void {
var numgo:int = Math.ceil(2Math.random());
randomvalue = Math.ceil(6
Math.random());

pointer_mc.removeEventListener(MouseEvent.CLICK, spinner);



mv.begin = pointer_mc.rotation;
mv.finish = numgo*360 + randomvalue*60;
mv.start();

}

menu_btn.addEventListener(MouseEvent.CLICK, goFrame2);
function goFrame2(e:MouseEvent):void{
gotoAndPlay(2);
}

LogOutBtn.addEventListener(MouseEvent.CLICK, goFrame1);

function goFrame1(e:MouseEvent):void{
gotoAndStop(1);
}

Sorry if it looks a little untidy.
I basically have no idea if i need to create another function or create if statements within existing functions.

I tried creating another function afte the bottom function but got a lot of time constant errors and unexpected else statements whihc i didn’t understand.

Can anybody help me with the code, maybe a little example would be greatly appreciated.

I’ve provided a screenshot to make things clearer.