Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

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

Reply
 
Thread Tools Rate Thread Display Modes
Old 03-30-2006, 08:11 AM   #1
webninja
Registered User
 
Join Date: Mar 2006
Location: Rhode Island
Posts: 51
Default HDividedBox and VDividedBox issue

Hi All...

I'm new to Flash development and to Flex, but I have many years experience in development with other languages. I was working on a Java applet when it occured to me that Flash might be a better technology. I downloaded the Flex 2 Alpha but could not make much of it since docs were missing, but I grabbed the Beta 2 the other day and I am quite impressed! AS3 looks really great.

Anyhow, enough rambling. I am trying to code an interface using 3 VDividedBox controls inside an HDividedBox. This seems to work well enough, but when I add components to the VDividedBox controls I see that I can not anchor them. For example, if I add a components into the VDividedBox, like a Tree and a TextArea, and run the app, I can resize the VDividedBox but the components don't adjust their size to match.

I tried various properties and also tried adding a canvas first (The Canvas in the VDividedBox and then the Tree in the Canvas). No joy.

So what's the trick? I would appreciate any help. I have been through the docs and didn't find it, but there is alot there and I could have missed it. If someone could tell me the trick or point me at the docs, I would really appreciate it!

Thanks!

Jim
webninja is offline   Reply With Quote
Old 03-30-2006, 03:18 PM   #2
hangalot
lala
 
hangalot's Avatar
 
Join Date: Feb 2002
Location: on the road
Posts: 2,859
Default

give me an example in code so i can take a look.
__________________
oi poloi
http://www.memorphic.com/news/
hangalot is offline   Reply With Quote
Old 03-30-2006, 05:44 PM   #3
webninja
Registered User
 
Join Date: Mar 2006
Location: Rhode Island
Posts: 51
Default Here is some source...

Thank you very much!

I have it to the pont where the components resize vertically but not horozontally. With vetical resizing, the components get as tall as the application, which is great. With horozontal resizing, the only get so wide and then stop, getting no wider.

I am trying to achieve something similar to this:

http://www.everythingflex.com/blog/1...dedPrefBox.cfm


Code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" layout="absolute">
	<mx:HDividedBox left="0" top="0" liveDragging="true" height="700" width="800">
		<mx:VDividedBox height="695">
			<mx:Tree></mx:Tree>
			<mx:TextArea/>
		</mx:VDividedBox>
		<mx:VDividedBox>
			<mx:Tree bottom="0" right="0" left="0" top="0"></mx:Tree>
		<mx:BarChart id="barchart1">
			<mx:series>
				<mx:BarSeries displayName="Series 1" xField=""/>
			</mx:series>
		</mx:BarChart>

		<mx:DataGrid>
			<mx:columns>
				<mx:DataGridColumn dataField="col1"/>
				<mx:DataGridColumn dataField="col2"/>
				<mx:DataGridColumn dataField="col3"/>
			</mx:columns>
		</mx:DataGrid>
		</mx:VDividedBox>
		<mx:Tile  height="695" direction="vertical">
		</mx:Tile>
		
	</mx:HDividedBox>
	
</mx:Application>
webninja is offline   Reply With Quote
Old 03-31-2006, 02:02 AM   #4
hangalot
lala
 
hangalot's Avatar
 
Join Date: Feb 2002
Location: on the road
Posts: 2,859
Default

ok. so that has more to do with the controls inside that resizer thingy.
take this code
Code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" layout="absolute">
	<mx:HDividedBox left="0" top="0" liveDragging="true" height="700" width="800" >
		<mx:VDividedBox height="695">
			<mx:Tree></mx:Tree>
			<mx:TextArea/>
		</mx:VDividedBox>
		<mx:VDividedBox>
			<mx:Tree bottom="0" right="0" left="0" top="0"></mx:Tree>
		<mx:BarChart id="barchart1" width="100%">
			<mx:series>
				<mx:BarSeries displayName="Series 1" xField=""/>
			</mx:series>
		</mx:BarChart>

		<mx:DataGrid>
			<mx:columns>
				<mx:DataGridColumn dataField="col1"/>
				<mx:DataGridColumn dataField="col2"/>
				<mx:DataGridColumn dataField="col3"/>
			</mx:columns>
		</mx:DataGrid>
		</mx:VDividedBox>
		<mx:Tile  height="695" direction="vertical">
		</mx:Tile>
		
	</mx:HDividedBox>
	
</mx:Application>
and resize around the barchart and see what happens. all i did was set charts width to 100%
__________________
oi poloi
http://www.memorphic.com/news/
hangalot is offline   Reply With Quote
Old 03-31-2006, 04:17 AM   #5
webninja
Registered User
 
Join Date: Mar 2006
Location: Rhode Island
Posts: 51
Default Thank you!

Setting the width to 100% on all the components fixed the problem, thanks very much! I have two (hopefully) quick questions if you don't mind...

First, why didn't I have to set the height to 100%?

Second, do the UI components in Flex2 work like the ones in an earlier Flex, so if I go out and get a book about how to use the UI components, it will be useful?

Thanks again!

Jim
webninja is offline   Reply With Quote
Old 04-01-2006, 02:25 PM   #6
hangalot
lala
 
hangalot's Avatar
 
Join Date: Feb 2002
Location: on the road
Posts: 2,859
Default

first question, i will have to look at the flex source how it does it resizes, but my feeling is it should be consistant both ways.

ui components are pretty simmiliar to flex 1.5 (i never used 1 properly), but everything has been rewritten in AS3, so the quirks will not be the same. the flex book however should help you a fair bit in understanding how the firstpass compiler works and what is posible in the framework
__________________
oi poloi
http://www.memorphic.com/news/
hangalot is offline   Reply With Quote
Old 04-01-2006, 06:18 PM   #7
webninja
Registered User
 
Join Date: Mar 2006
Location: Rhode Island
Posts: 51
Default

Thanks again! Actually I'm starting to figure this out pretty well. I really like the components. Today, I'm going to try to write my own, as I need something unique for this app. There are some descent docs on how to start with that, either in MXML or AS3. AS3 is quite a lot like java in many ways, so I thinking working in AS3 directly will be easier for me.

Fingers crossed!
webninja is offline   Reply With Quote
Old 04-01-2006, 06:25 PM   #8
hangalot
lala
 
hangalot's Avatar
 
Join Date: Feb 2002
Location: on the road
Posts: 2,859
Default

your own component is just a mxml page. simple as.
i will put a link of some stuff up now. give me a couple of minutes
#
__________________
oi poloi
http://www.memorphic.com/news/
hangalot is offline   Reply With Quote
Old 04-01-2006, 06:39 PM   #9
hangalot
lala
 
hangalot's Avatar
 
Join Date: Feb 2002
Location: on the road
Posts: 2,859
Default

my server is not liking something currently. i will get back to this in a day
__________________
oi poloi
http://www.memorphic.com/news/
hangalot is offline   Reply With Quote
Old 04-02-2006, 10:33 AM   #10
webninja
Registered User
 
Join Date: Mar 2006
Location: Rhode Island
Posts: 51
Default

I can't thank you enough. You're a huge help!
webninja 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


All times are GMT. The time now is 06:18 PM.


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