Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > Flex > Flex 2, 3 & 4

Reply
 
Thread Tools Rate Thread Display Modes
Old 02-18-2009, 08:25 PM   #1
kingcu
Registered User
 
Join Date: Feb 2009
Posts: 1
Default VDividedBox not restoring the divider position after switching states

I've got two panels in a VDividedBox: a top panel and a bottom panel. Then I create a 'new' state, which will replace the top panel with a third panel. When switching back to the base state, however, the top panel doesn't occupy the original divided space, it is pushed all the way to the top and is minimized. Also, what I noticed is that, if I change the divider position before switching the states, everything works fine. Please see code attached and help me with this hopefully quick issue. Thank you.

Code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="horizontal">

	<mx:VDividedBox id="navigation" width="300" height="100%">
		<mx:Panel id="topPanel" title="Top" width="100%" height="50%">
			<mx:ControlBar>
				<mx:Button label="New" click="{currentState='new'}"/>
			</mx:ControlBar>
		</mx:Panel>
		<mx:Panel id="bottomPanel" title="Bottom" width="100%" height="50%"/>
	</mx:VDividedBox>
	
	<mx:Panel id="contentPanel" title="Content" width="100%" height="100%"/>
	
	<mx:states>
		<mx:State name="new">
			<mx:RemoveChild target="{topPanel}"/>
			
			<mx:AddChild relativeTo="{navigation}" position="firstChild">
				<mx:Panel id="newPanel" title="New">
					<mx:ControlBar>
						<mx:Button label="Back" click="{currentState=''}"/>
					</mx:ControlBar>
				</mx:Panel>
			</mx:AddChild>
			<mx:SetProperty target="{newPanel}" name="width" value="{topPanel.width}"/>
			<mx:SetProperty target="{newPanel}" name="height" value="{topPanel.height}"/>
			
			<mx:SetProperty target="{bottomPanel}" name="enabled" value="false"/>
			<mx:SetProperty target="{contentPanel}" name="enabled" value="false"/>
		</mx:State>
	</mx:states>
</mx:Application>
kingcu 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
Trying to trace a stage in output for a simulation.. AlanH ActionScript 2.0 7 11-22-2008 02:32 AM
Flash Y position converted to Browser Scroll Position CookieDog ActionScript 1.0 (and below) 5 06-18-2007 10:46 PM
When switching between states, the states are not drawn properly... sllik Flex 2, 3 & 4 0 06-03-2007 04:35 PM
Detecting drag and drop funkydesigner ActionScript 1.0 (and below) 4 04-11-2001 05:32 PM


All times are GMT. The time now is 07:21 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.