1 person found this helpful
use the trace() function to debug your code. for example, you can easily determine if a function is being called by adding a trace("something") to that function.
I am not sure if I did what you told me to do. For every event listener I added a trace() function, which reported, if the event listener got called or not, but still I am not able to find the error, because if the Button doesn't work, the event listener doesn't get called. I think it could have something to do with the Buttons, but I copied some working Buttons from one keyframe to another one, but that still did't solve the problem. They do have the same instance, so I don't understand, why some Buttons work and others don't ; (
Any further ideas???
if your listener function isn't called, you have an incorrect reference to the event dispatcher (your button). there are many ways that can happen with as3.
the only certain way to fix the problem is to go to the first keyframe that contains your problematic button and assign the same instance name as that used in your code. remove all keyframes after that first keyframe. test your listener code.
thank you very much for your help!!!
It seems that I have a hard time understanding your hints even though they might be the solution to my problem.
I only have one Event Listener per Button.
There is only one Instance for each Button, but these Buttons are pasted in different frames in the timeline.
I used the swap... Button to make sure every copy of the instance has the same name.
All Buttons work at the beginning, but as soon one or the other button has been clicked, some event Listeners don't seem to react anymore.
Would be great, if you have a step by step description, because I am a real newbie to Flash.
Thanks in advance.
Problem solved. Thank you for your help anyways kglad!
The script was fine. Something was wrong with the Buttons. I created a new Layer, removed all the old Buttons except the ones from Frame 1. Copied and pasted them into the other frames and everything worked.
Workaround of half an hour is sometimes better than looking eight hours for the error beeing frustrated.