views:

93

answers:

2

Hi,

first of all I am completely new to AS3. I want to create a simple website, with 3 buttons. Once you click on the button, content should appear next to it. But i have trouble programming even one button.

Here is the script:

stop(); photography_btn.addEventListener(MouseEvent.CLICK, photoclick); function photoclick(event:MouseEvent) { gotoAndPlay("photography"); }

But Flash says: 1120: Access of undenfined property photography_btn. I have looked everywhere on the internet for the past two days, but since I am so new at this, other people's solutions don't really help me.

Also, I integrated a stop action, but the script won't stop! I have put the actions on the first frame.

Please, I need some help, getting really desperate otherwise...

Thank you!! Jennifer

A: 

ok, I solved it. forgot to give it an instance name ... grrr ;)

however, i have read on some websites that the stop(); only works on the first frame of the timeline. what do i do with the other frames?

Jennifer Heidelberg
You can use stop() on any frame.
David
A: 

Where is your code being placed?

It might just be that you need to add "this" to your calls:

this.stop(); 
this.photography_btn.addEventListener(MouseEvent.CLICK, photoclick);
function photoclick(event:MouseEvent) { this.gotoAndPlay("photography"); }
M.A. Hanin