I'm making a survey with questions and Radiobuttons. I'm testing with 2 questions so far. And I was thinking about putting each question on seperate frames, and use navigation buttons like "gotoAndStop(2)" etc.
I don't know if this is the best way to structure a survey, though.
So far, I have MovieClip1 (question 1) on Frame 1 and MovieClip2 (question 2) on Frame 2. And a MovieClip-button "Next" on Frame 1 and a MovieClip-button "Check result" on Frame 2.
I'm using a Document Class for the actionscript code (Main.as).
In the constructor, I have added eventlisteners for the next-button and result-button, like this:
next.addEventListener(MouseEvent.CLICK, nextClick); result.addEventListener(MouseEvent.CLICK, resultClick);
And the functions for the click events look like this for now:
function nextClick(e:MouseEvent):void
{
gotoAndStop(2);
}
function resultClick(e:MouseEvent):void
{
}
But obviously I get an error because the result-button is placed on Frame 2, and the constructor can't find it(?).
I get this error message:
TypeError: Error #1009: Cannot access a property or method of a null object reference. at Main$iinit()
Is there a way to specify that the "result"-instance is at Frame 2 or something?
Feel free to come up with suggestions for how to better structure a survey.

New Topic/Question
Reply



MultiQuote




|