Solved this with:

mx.core.Application.application.nextScreenName = eval
(event.target.data);

--- In flexcoders@yahoogroups.com, "face7hill" <[EMAIL PROTECTED]> 
wrote:
>
> Hi Everyone,
> 
> I have a ViewStack with a bunch of screens in my Main.mxml app.  
On 
> the first viewstack (mainViewStack.selectedChild=screen0) I'm 
> calling a component (Screen0.mxml).  Inside that component, I have 
a 
> bunch of radio buttons.  When a user clicks a radio button, the 
> buttonClicked() function is called, which then assigns a value to 
my 
> variable nextScreenName in my main app.  The main app has a button 
> (nextButton) which when clicked activates goToScreenName
> (nextScreenName).
> 
> For some reason, the function goToScreenName(x) will not take the 
> argument from the radio buttons even though it is being sent (I 
> checked).  I have a feeling that this is a variable typing 
problem.  
> If I rewrite the function to use selectedIndex instead, and have 
the 
> radio buttons broadcast numbers, it works fine.  But it doesn't 
work 
> with sending strings for selectedChild.  Anybody have any ideas 
why?
> 
> Thanks folks!
> 
> 
> <!-- Main.mxml -->
> <mx:Script>
> <![CDATA[
>       var nextScreenName;
>       
>       function goToScreenName(x){
>               mainViewStack.selectedChild = x;
>       }
> ]]> 
> </mx:Script> 
> <mx:ViewStack id="mainViewStack">
>       <Screen0 id="screen0" />
>       <Screen1 id="screen1" />
>       <Screen2 id="screen2" />
>       <Screen3 id="screen3" />
>       <Screen4 id="screen4" />
> </mx:ViewStack>
> <mx:Button id="nextButton" label="Next" click="goToScreenName
> (nextScreenName);"/> 
> 
> 
> 
> <!-- Screen0.mxml -->
> <mx:Script>
> <![CDATA[
> function buttonClicked( event : Object ) : Void {
>       //This does not work
>       //mx.core.Application.application.nextScreenName = String
> (event.target.data);
>       
>       //This does not work either
>       //mx.core.Application.application.nextScreenName = 
> event.target.data;
> }     
> ]]> 
> </mx:Script>
> <mx:RadioButton label="Screen 1" data="screen1" 
click="buttonClicked
> ( event );"/>
> <mx:RadioButton label="Screen 2" data="screen2" 
click="buttonClicked
> ( event );"/>
> <mx:RadioButton label="Screen 3" data="screen3" 
click="buttonClicked
> ( event );"/>
> <mx:RadioButton label="Screen 4" data="screen4" 
click="buttonClicked
> (event);"/>
>






------------------------ Yahoo! Groups Sponsor --------------------~--> 
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/nhFolB/TM
--------------------------------------------------------------------~-> 

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 




Reply via email to