<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Programmatically resizing a Flex HDividedBox container</title>
	<atom:link href="http://blog.flexexamples.com/2007/10/09/programmatically-resizing-a-flex-hdividedbox-container/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.flexexamples.com/2007/10/09/programmatically-resizing-a-flex-hdividedbox-container/</link>
	<description>Just a bunch of Adobe Flex Examples</description>
	<lastBuildDate>Sun, 12 Feb 2012 14:19:03 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Alex</title>
		<link>http://blog.flexexamples.com/2007/10/09/programmatically-resizing-a-flex-hdividedbox-container/comment-page-1/#comment-10239</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Mon, 12 Dec 2011 18:35:17 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/10/09/programmatically-resizing-a-flex-hdividedbox-container/#comment-10239</guid>
		<description>I&#039;m now saving and restoring the UI like a boss. Thank you!</description>
		<content:encoded><![CDATA[<p>I&#8217;m now saving and restoring the UI like a boss. Thank you!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: S Nichols</title>
		<link>http://blog.flexexamples.com/2007/10/09/programmatically-resizing-a-flex-hdividedbox-container/comment-page-1/#comment-1519</link>
		<dc:creator>S Nichols</dc:creator>
		<pubDate>Thu, 23 Apr 2009 00:24:03 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/10/09/programmatically-resizing-a-flex-hdividedbox-container/#comment-1519</guid>
		<description>Peter,

You code example got me started in solving my problem.   Below is a code snippet solution to remember the previous Flex session&#039;s HDividedBox location. I believe must users would want the location of the screen splitters remembered.

&lt;pre class=&quot;code&quot;&gt;
public var _preferences:SharedObject;
private var _currentSplitterLocation:int;

// Get the location of the splitter when the Flex app first starts.
private function creationHandler(event:Event):void {
    _userPreferences = SharedObject.getLocal(”preferences”);

   // Get the current location of the HDividedBox at startup
    _currentSplitterLocation = myDivider.getDividerAt(0).x;

}

// Called when a divider is moved. Add onRelease event to HDividedBox control
public function dividerDragComplete(event:DividerEvent):void {
   // Update the current location of the splitter.
   _currentSplitterLocation += event.delta;
   // Save it to to the shared object.
   _userPreferences.data.divider = _currentSplitterLocation;
}

// Called to load the last sessions divider location from shared object
public function loadDividers():void {
   if(_userPreferences.data.divider !=null) {
      myDivder.getDividerAt(0).x = _userPreferences.data.divider;
   }
}
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Peter,</p>
<p>You code example got me started in solving my problem.   Below is a code snippet solution to remember the previous Flex session&#8217;s HDividedBox location. I believe must users would want the location of the screen splitters remembered.</p>
<pre class="code">
public var _preferences:SharedObject;
private var _currentSplitterLocation:int;

// Get the location of the splitter when the Flex app first starts.
private function creationHandler(event:Event):void {
    _userPreferences = SharedObject.getLocal(”preferences”);

   // Get the current location of the HDividedBox at startup
    _currentSplitterLocation = myDivider.getDividerAt(0).x;

}

// Called when a divider is moved. Add onRelease event to HDividedBox control
public function dividerDragComplete(event:DividerEvent):void {
   // Update the current location of the splitter.
   _currentSplitterLocation += event.delta;
   // Save it to to the shared object.
   _userPreferences.data.divider = _currentSplitterLocation;
}

// Called to load the last sessions divider location from shared object
public function loadDividers():void {
   if(_userPreferences.data.divider !=null) {
      myDivder.getDividerAt(0).x = _userPreferences.data.divider;
   }
}
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: beshan</title>
		<link>http://blog.flexexamples.com/2007/10/09/programmatically-resizing-a-flex-hdividedbox-container/comment-page-1/#comment-1523</link>
		<dc:creator>beshan</dc:creator>
		<pubDate>Mon, 09 Mar 2009 17:21:28 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/10/09/programmatically-resizing-a-flex-hdividedbox-container/#comment-1523</guid>
		<description>@sascha/hdrs
I was wondering is there a way to change the width/height of the DividedBox’s Divider?

horizontalGap=&quot;6&quot;</description>
		<content:encoded><![CDATA[<p>@sascha/hdrs<br />
I was wondering is there a way to change the width/height of the DividedBox’s Divider?</p>
<p>horizontalGap=&#8221;6&#8243;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: codecraig</title>
		<link>http://blog.flexexamples.com/2007/10/09/programmatically-resizing-a-flex-hdividedbox-container/comment-page-1/#comment-1522</link>
		<dc:creator>codecraig</dc:creator>
		<pubDate>Fri, 05 Sep 2008 13:30:08 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/10/09/programmatically-resizing-a-flex-hdividedbox-container/#comment-1522</guid>
		<description>Actually, &quot;dividerThickness&quot;.</description>
		<content:encoded><![CDATA[<p>Actually, &#8220;dividerThickness&#8221;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: codecraig</title>
		<link>http://blog.flexexamples.com/2007/10/09/programmatically-resizing-a-flex-hdividedbox-container/comment-page-1/#comment-1521</link>
		<dc:creator>codecraig</dc:creator>
		<pubDate>Fri, 05 Sep 2008 13:29:36 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/10/09/programmatically-resizing-a-flex-hdividedbox-container/#comment-1521</guid>
		<description>@sascha/hdrs

Take a look at the &quot;dividerAffordance&quot; style of the DividedBox class (http://livedocs.adobe.com/flex/3/langref/mx/containers/DividedBox.html).</description>
		<content:encoded><![CDATA[<p>@sascha/hdrs</p>
<p>Take a look at the &#8220;dividerAffordance&#8221; style of the DividedBox class (<a href="http://livedocs.adobe.com/flex/3/langref/mx/containers/DividedBox.html" rel="nofollow">http://livedocs.adobe.com/flex/3/langref/mx/containers/DividedBox.html</a>).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sascha/hdrs</title>
		<link>http://blog.flexexamples.com/2007/10/09/programmatically-resizing-a-flex-hdividedbox-container/comment-page-1/#comment-1520</link>
		<dc:creator>sascha/hdrs</dc:creator>
		<pubDate>Fri, 25 Jul 2008 07:01:33 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/10/09/programmatically-resizing-a-flex-hdividedbox-container/#comment-1520</guid>
		<description>Hi,
I was wondering is there a way to change the width/height of the DividedBox&#039;s Divider? The Divider is approx. 10 pixels thick and I&#039;d like to make it thinner but it seems there is no style for that, except dividerThickness which only applies to the line when the user drags the Divider. Changing the skin doesn&#039;t change anything either.</description>
		<content:encoded><![CDATA[<p>Hi,<br />
I was wondering is there a way to change the width/height of the DividedBox&#8217;s Divider? The Divider is approx. 10 pixels thick and I&#8217;d like to make it thinner but it seems there is no style for that, except dividerThickness which only applies to the line when the user drags the Divider. Changing the skin doesn&#8217;t change anything either.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kelly Davis</title>
		<link>http://blog.flexexamples.com/2007/10/09/programmatically-resizing-a-flex-hdividedbox-container/comment-page-1/#comment-1512</link>
		<dc:creator>Kelly Davis</dc:creator>
		<pubDate>Mon, 23 Jun 2008 11:36:52 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/10/09/programmatically-resizing-a-flex-hdividedbox-container/#comment-1512</guid>
		<description>I think I resolved this issue (sort of). I was overlooking the simple fact that if you want to set the initial state of the dividers, all you have to do is set the widths or heights of the child containers to what you need them to be, instead of calling the moveDivider() method.</description>
		<content:encoded><![CDATA[<p>I think I resolved this issue (sort of). I was overlooking the simple fact that if you want to set the initial state of the dividers, all you have to do is set the widths or heights of the child containers to what you need them to be, instead of calling the moveDivider() method.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kelly Davis</title>
		<link>http://blog.flexexamples.com/2007/10/09/programmatically-resizing-a-flex-hdividedbox-container/comment-page-1/#comment-1518</link>
		<dc:creator>Kelly Davis</dc:creator>
		<pubDate>Fri, 20 Jun 2008 15:07:23 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/10/09/programmatically-resizing-a-flex-hdividedbox-container/#comment-1518</guid>
		<description>Interestingly, I added the resizer call to a button click. The first time I click the button and trigger resizer() I get the same behavior. If I click it again, then it works. So it looks like after adding the new child to the HDividedBox puts the container into a state that causes getDividerAt().x = ? to not work correctly.</description>
		<content:encoded><![CDATA[<p>Interestingly, I added the resizer call to a button click. The first time I click the button and trigger resizer() I get the same behavior. If I click it again, then it works. So it looks like after adding the new child to the HDividedBox puts the container into a state that causes getDividerAt().x = ? to not work correctly.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kelly Davis</title>
		<link>http://blog.flexexamples.com/2007/10/09/programmatically-resizing-a-flex-hdividedbox-container/comment-page-1/#comment-1517</link>
		<dc:creator>Kelly Davis</dc:creator>
		<pubDate>Fri, 20 Jun 2008 14:57:39 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/10/09/programmatically-resizing-a-flex-hdividedbox-container/#comment-1517</guid>
		<description>Thanks for your reply. Using callLater doesn&#039;t seem to do it either. The middle container gets squished by the right and left containers.</description>
		<content:encoded><![CDATA[<p>Thanks for your reply. Using callLater doesn&#8217;t seem to do it either. The middle container gets squished by the right and left containers.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peterd</title>
		<link>http://blog.flexexamples.com/2007/10/09/programmatically-resizing-a-flex-hdividedbox-container/comment-page-1/#comment-1516</link>
		<dc:creator>peterd</dc:creator>
		<pubDate>Fri, 20 Jun 2008 00:02:32 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/10/09/programmatically-resizing-a-flex-hdividedbox-container/#comment-1516</guid>
		<description>Kelly Davis,

Try changing your code to something like this:

&lt;pre class=&quot;code&quot;&gt;
private function init():void {
    var newChild:VBox = new VBox();
    newChild.percentHeight = 100;
    newChild.percentWidth = 100;
    newChild.setStyle(&quot;backgroundColor&quot;, &quot;red&quot;);

    var label:Label = new Label();
    label.text = &quot;HELLO&quot;;
    newChild.addChild( label );
    hdivbox.addChild( newChild );

    &lt;strong style=&quot;color:red;&quot;&gt;callLater(resizer);&lt;/strong&gt;
}

&lt;strong style=&quot;color:red;&quot;&gt;private function resizer():void {
    hdivbox.getDividerAt(0).x = 50;
    hdivbox.getDividerAt(1).x = 400;
}&lt;/strong&gt;
&lt;/pre&gt;

Peter</description>
		<content:encoded><![CDATA[<p>Kelly Davis,</p>
<p>Try changing your code to something like this:</p>
<pre class="code">
private function init():void {
    var newChild:VBox = new VBox();
    newChild.percentHeight = 100;
    newChild.percentWidth = 100;
    newChild.setStyle(&quot;backgroundColor&quot;, &quot;red&quot;);

    var label:Label = new Label();
    label.text = &quot;HELLO&quot;;
    newChild.addChild( label );
    hdivbox.addChild( newChild );

    <strong style="color:red;">callLater(resizer);</strong>
}

<strong style="color:red;">private function resizer():void {
    hdivbox.getDividerAt(0).x = 50;
    hdivbox.getDividerAt(1).x = 400;
}</strong>
</pre>
<p>Peter</p>
]]></content:encoded>
	</item>
</channel>
</rss>

