I think I am finding that the problem is in the nextQuestionPlease() method. 
The reference to questionsVS is null and I can't figure out why.

Here is the function:

public function nextQuestionPlease():void {

                questionsVS.selectedIndex=currentQuestion;

            }

Here is the viewStack:

    <mx:ViewStack id="questionsVS" width="98%" height="100%" paddingLeft="10">

        <questions:question1 />
        <questions:question2 />
        <questions:question3 />
        <questions:question4 />
    </mx:ViewStack>

In my init I set it to 0 and it appears how it should. How can I instantiate it?

----------------------------------------
From: "Wally Kolcz" <wko...@isavepets.com>
Sent: Monday, March 09, 2009 6:43 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Find the value of a radiobutton in a radio group 

I am trying to make a AIR app that is a test. I have radiobuttons with a value 
of either 0 or 1 depending on if its correct or not. I want to pass the value 
to a function that keeps score. I am running into a problem on determining the 
value of the passed question to see if the app should add a 1 to the score or 
not. I keep getting 'Error #1069: Property value not found on Number and there 
is no default value.' when I click the button.

Here is my radiobuttongroup:

<mx:Label fontWeight="bold" text="1. Which layer(s) of the OSI Reference Model 
provide(s) for internetwork connectivity?" />
    <mx:RadioButtonGroup id="group1" />
    <mx:RadioButton paddingLeft="10" groupName="group1" label="Data Link" 
value="0" selected="true" />
    <mx:RadioButton paddingLeft="10" groupName="group1" label="Physical" 
value="0" />    
    <mx:RadioButton paddingLeft="10" groupName="group1" label="Session" 
value="0" />    
    <mx:RadioButton paddingLeft="10" groupName="group1" label="Network" 
value="1" />    
    <mx:RadioButton paddingLeft="10" groupName="group1" label="Presentation" 
value="0" />    

    <mx:Button label="Next" click="testMod.checkSingle(group1.selectedValue)" />

Here is my function:

public function checkSingle(answer:Object):void {
                if (answer.value !=0) {
                Application.application.score += 1;
                }
                nextQuestionPlease();
            }

How can I get it to find the value and determine if it should add 1 or not.

Thanks.


Reply via email to