Adobe Dreamweaver Forums



Last 10 THreads :         Javahelp/Oracle Help (Last Post : cindys@ddms.com - Replies : 9 - Views : 10 )           »          FlashVars help (Last Post : Cgull - Replies : 2 - Views : 3 )           »          Quiz results and slide views (Last Post : dlspielman@gmail.com - Replies : 0 - Views : 1 )           »          Repeater and XML problem (Last Post : ntsiii - Replies : 1 - Views : 4 )           »          accessing data in ArrayCollection (Last Post : ntsiii - Replies : 1 - Views : 8 )           »          Re: Avoiding infinite loop with cfinclude? (Last Post : Ian Skinner - Replies : 3 - Views : 4 )           »          Spry issue with fade (Last Post : Dooza - Replies : 8 - Views : 9 )           »          Navigation from Contact Form (Last Post : mtrueblood - Replies : 2 - Views : 4 )           »          dreamweaver v. movable type? (Last Post : Dooza - Replies : 1 - Views : 2 )           »          Disabling menu bars in a browser window (Last Post : Dooza - Replies : 1 - Views : 2 )           »         


Home Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
User Info Statistics
Go Back   Adobe Dreamweaver Forums > Other Macromedia/Adobe Products > Flex
 
Tags: , , , , ,



Reply
  #1 (permalink)  
Old 08-26-2008, 08:07 PM
NathanThibert
 
Posts: n/a
Diggs:
Default Getting Container Height With Dynamic Content Added

Hello,

I'm having issues getting a containers height after adding content to that
container. The code below shows you what I'm trying to do. I have tried to
validate the container and still get a 0 in height. Is there a reason why this
is happening because from my point of view, after I add an object to the
container the height of the container should change. Please help.

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
creationComplete="init()" applicationComplete="check()">

<mx:Script>
<![CDATA[
import mx.containers.VBox;
import flash.utils.setInterval;
import mx.controls.Text;

private var txt:Text = new Text();
private var vBox:VBox = new VBox();

private function init():void {
txt.text = "Hello World";
vBox.addChild(txt);
this.addChild(vBox);
}

private function check():void {
setInterval(trace, 100, vBox.height);
}

]]>
</mx:Script>

</mx:Application>



Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 08-26-2008, 08:45 PM
Greg Lafrance
 
Posts: n/a
Diggs:
Default Re: Getting Container Height With Dynamic Content Added

Probably has to do with the fact you are calling check() in
applicationComplete, as this code works:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
creationComplete="init()">
<mx:Script>
<![CDATA[
import mx.containers.VBox;
import flash.utils.setInterval;
import mx.controls.Text;

private var txt:Text = new Text();
private var vBox:VBox = new VBox();

private function init():void {
txt.text = "Hello World";
vBox.addChild(txt);
this.addChild(vBox);
}

private function check():void {
setInterval(trace, 100, vBox.height);
}
]]>
</mx:Script>
<mx:Button label="Check Size" click="check()"/>
</mx:Application>

Reply With Quote
Reply


Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



© Camley Interactive (camley.info) 2008 - all logos and images are copywrite their respective owners.
Proud member of the Camley Interactive Network
All times are GMT. The time now is 05:46 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
Cheap Car Insurance - Compare Motor Insurance
Endsleigh Car Insurance Natwest Car Insurance
More Than Car Insurance Norwich Union Car Insurance
Prudential Car Insurance Zurich Car Insurance
Inactive Reminders By Mished.co.uk