Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 07-31-2008, 06:45 AM   #1
maasss18
Registered User
 
Join Date: Jul 2008
Posts: 33
Red face Help with ViewStack

I have a titlewindow with 2 buttons. And within the titlewindow there is a viewstack. The viewstack have 2 containers. Button1 click event to switch to container1 and button2 click event to switch to container2. Each container have its own control. Container 1 have textinput and vslider. Container 2 also have textinput and vslider. I could retrieve and set the values of controls in container 1 when button1 is click using viewstack.selectedIndex=0. but am unable to set the values of the control in container 2 when button2 is clicked using viewstack.selectedIndex=1. Got this error for container2.

Error #1009: Cannot access a property or method of a null object reference.

Appreciate if you could kindly advise.

if(DB.variableView == "Cont1")
{
varEditor.toggleBtn1.selectedIndex = 0;
varEditor.viewstack1.selectedIndex = 0;

varEditor.txtInitialValue1.text = DB.varInitialValue;
}
if(DB.variableView == "Cont2")
{

varEditor.toggleBtn1.selectedIndex = 1;
varEditor.viewstack1.selectedIndex = 1;
varEditor.txtInitialValue2.text = DB.varInitialValue;
}
maasss18 is offline   Reply With Quote
Old 07-31-2008, 07:01 AM   #2
manoj_kulkarni
Registered User
 
Join Date: Jan 2008
Posts: 14
Default

try by setting viewstack's creationPolicy property to "all".
manoj_kulkarni is offline   Reply With Quote
Old 07-31-2008, 07:08 AM   #3
maasss18
Registered User
 
Join Date: Jul 2008
Posts: 33
Default

YEA! Thank you very much! It's working now! Thank you!
maasss18 is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need to create a viewstack index on application creation corbo950 Flex 2, 3 & 4 2 06-20-2008 04:36 PM
Cannot hide an Item within a Viewstack rt30000 Flex 2, 3 & 4 1 02-21-2008 06:21 PM
viewStack + load component function ljonny18 Flex 2, 3 & 4 3 10-15-2007 05:16 PM
Image component not initialized on first viewstack view drkstr Flex 2, 3 & 4 2 05-23-2007 10:35 PM
viewStack problem ljonny18 Flex 2, 3 & 4 0 11-08-2006 01:29 PM


All times are GMT. The time now is 03:06 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.