# Checkbox and button as3

**URL:** <https://forum.kirupa.com/t/checkbox-and-button-as3/323885>\
**Category:** Uncategorized\
**Created:** [July 22, 2011, 11:54am UTC](https://forum.kirupa.com/t/checkbox-and-button-as3/323885 "2011-07-22T11:54:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kcabe](https://avatars.discourse-cdn.com/v4/letter/k/3da27b/32.png) [@kcabe](https://forum.kirupa.com/u/kcabe)\
**Post date:** [July 22, 2011, 11:54am UTC](https://forum.kirupa.com/t/checkbox-and-button-as3/323885/1 "2011-07-22T11:54:27Z")

</div>

Hello

I have found a checkbox code that assign value once the check box is ticked see code bellow but i want to add a button to move to next frame but it will not work, i am not too sure why see code below

any help must be simple

**the checkbox code**  
import fl.controls.CheckBox;  
cart\_txt.text = “Your Shopping Cart Contains:”;

var checkbox1 = new CheckBox();  
var checkbox2 = new CheckBox();

checkbox1.addEventListener(MouseEvent.CLICK, updateList);  
checkbox2.addEventListener(MouseEvent.CLICK, updateList);

checkbox1.label = “Milk”;  
checkbox2.label = “Bread”;  
checkbox1.x = 80;  
checkbox1.y = 60;  
checkbox2.x = 80;  
checkbox2.y = 80;  
addChild(checkbox1);  
addChild(checkbox2);

function updateList (event:MouseEvent):void {

```
cart_txt.text = "Your Shopping Cart Contains:

```

";  
if (checkbox1.selected == true) cart\_txt.appendText(checkbox1.label + "  
");  
if (checkbox2.selected == true) cart\_txt.appendText(checkbox2.label + "  
");  
}

\*\*my button code: \*\*

function myStart1(event:MouseEvent):void {  
gotoAndStop(“sentences1”);  
}  
next1\_btn.addEventListener(MouseEvent.CLICK, myStart1);

thanks

xav
