Home Tutorials Forums Articles Blogs Movies Library Employment Press

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

Thread Tools Rating: Thread Rating: 1 votes, 5.00 average. Display Modes
Old 08-13-2007, 04:18 PM   #1
Registered User
Join Date: Aug 2007
Posts: 39
Default setting width to 100% for a dynamically created element


I'm new to Flex. Here's my problem:

I dynamically create a VBox and I want to give it "100%" for its width.

I tried:

PHP Code:
var oneVBox:VBox = new VBox();
oneVBox.width "100%"
But this gives me the error: "Implicit coercion of a value of type String to an unrelated type Number".

I tried
PHP Code:
var oneVBox:VBox = new VBox();
But it doesn't seem to work.

How can I do it?

Thank you!

tata668 is offline   Reply With Quote
Old 08-13-2007, 05:03 PM   #2
Registered User
Join Date: Aug 2007
Location: Utrecht, The Netherlands
Posts: 14

oneVBox.percentWidth = 100;

(see the VBox documentation: percentWidth : Number
Number that specifies the width of a component as a percentage of its parent's size.)
Deniz is offline   Reply With Quote
Old 08-13-2007, 05:14 PM   #3
Registered User
Join Date: Aug 2007
Posts: 39

tata668 is offline   Reply With Quote

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
Dynamically created TextField questions maxx ActionScript 2.0 4 11-06-2005 11:02 AM
Dynamically created movie clip problems aphexburn ActionScript 2.0 2 09-29-2005 06:05 AM
Dynamically created MCs are always there? At every frame? pixlix ActionScript 2.0 4 09-03-2005 01:09 PM
using dynamically created content in a Scrolling Pane jmcwatters Components 4 06-11-2003 05:17 PM
Setting width and height of a movie clip mactaggart ActionScript 1.0 (and below) 5 05-16-2002 12:39 PM

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