Help! I have a what should be a simple problem. I am relatively new to AS3. I am using the following code to return a value when a button is clicked. The buttons are located in a movie clip that has been put on the stage.
CODE:
//stops the movie clip from playing
movieClip2.stop()
//this will return the value of each button that is clicked
movieClip2.d0.index = 0
movieClip2.d1.index = 1
movieClip2.d2.index = 2
movieClip2.d3.index = 3
//this sets the answerClick function for each butoon
movieClip2.d0.addEventListener(MouseEvent.CLICK, answerClick)
movieClip2.d1.addEventListener(MouseEvent.CLICK, answerClick)
movieClip2.d2.addEventListener(MouseEvent.CLICK, answerClick)
movieClip2.d3.addEventListener(MouseEvent.CLICK, answerClick)
//this function will change once I can get the buttons to work once clicked
function answerClick( evt ) {
trace(“hilly billy”)
//myPushBox.x = myPushBox.x + 10
}
Currently when I test this code it gives me this error:
ReferenceError: Error #1056: Cannot create property index on flash.display.SimpleButton
Any help is greatly appreciated.
Thanks!