Flex Get Height Of Children When To Call Function?

Jun 8, 2009

I have a function I wrote that gets the height of the application without scrolling. Meaning the height it would need to be to not have to scroll.

[Code]...

This function works well but the problem is knowing when to call it. I planned on calling it after I add/remove any children from it. However thats still too soon because I don't get the correct height yet if I run it then. The fix I currently have is using a Timer to call the function about 300 milliseconds after a child is added/removed which seems to work well but I think this is a very risky fix. So I was wondering a better solution. I am thinking there has to be some sort of event I can listen for that will tell me when its ready for me to run this function, I just don't know what event that would be?

View 1 Replies


Similar Posts:


Flex :: How To Find Height Of Children In TabNavigator

Nov 13, 2009

I'm having sizing issues with a TabNavigator. The direct children of the TabNavigator are Canvases, and within these I am adding Images. I'm trying to resize the images to fit within the Canvas without scrollbars. The Canvas height is set to 100% of the parent, which is the TabNav. Then I'm setting the image.height = parent.height *.9. The result is that Flex is generating scrollbars because the images are too high. It appears that the root cause is that the height property of the TabNavigator is the height of the entire component, including the height of the tabs. I'm assuming therefore it also contains that little strip of space between the tabs and the children of the TabNavigator. This makes sense, but is there a property that returns only the height of the children? I'm aware of the scrollbar policy properties and I've experimented with those. I know I can also try a different multiplier for the image size to get it to fit. It just seems like there should be a property to get the size of the space for the children.

View 1 Replies

Get Total Height Of A Container's Children In Flex?

Aug 9, 2010

If I have a container, and I set clipContent to true, how do I get the total height of the children inside it? Is there a method for doing this without itinerating through every child and summing the heights?

View 1 Replies

Flex :: VGroup - (Parent) Container Does Not Change Height With Children?

May 13, 2011

I have code like the following:
<s:VGroup gap="10" id="group" height="100%">
<s:Label text="This is page 2" />
<s:Button content="Resize Canvas" click="resize(event);"/>
<mx:Canvas id="photoCanvas" color="#567898" backgroundColor="#125567">
</mx:Canvas>
</s:VGroup>

I don't understand why the following does not work:
Pushing the Button resizes the photoCanvas's height (gets taller or smaller). Since the photoCanvas control is a child element of the VGroup shouldn't the container update itself to the new height? The Vgroup has ALWAYS the same height, no matter what the (total) height of the children is! I would like the VGroup to adjust itself and get a height value equal to the sum of its children heights. Is this not possible??

View 1 Replies

Flex :: Width And Height Specified In Percentage Not Working For Children Of A Viewstack

Sep 30, 2011

I have a ViewStack which is dataProvider for a TabBar. There are two VBoxs as children for this ViewStack. It works fine with absolute values for width and height for these VBoxs, but when specified in percentages, the VBox uses all the available space (100%) for any percentage value. find the code and screen shots below.

how can children of a ViewStack be aligned to center? There is no horizontalAlign property for ViewStack and it is not working with horizontalCenter= "0".

Code:

<mx:ViewStack id="viewStack" width="100%" height="100%" selectedIndex="0" horizontalCenter="0" textAlign="center">
<mx:VBox label="Tab 1" width="25%" height="10%" borderThickness="2" borderColor="red"

[Code]....

View 2 Replies

Flex :: Setting A Group Container Height To 0 Does Not Hide His Children?

Feb 21, 2012

I need to resize a Group using myGroup.height = 0. And it works, but myGroup's children are still visible, I do not know why...

View 1 Replies

Flex :: Changing ScaleX/scaleY On Parent Scales The Children But Doesn't Update Height/width Property?

Nov 23, 2010

I have created a custom component - MyImage - that has two children including a Bitmap as well as a Sprite.My display object hierarchy is as follows -

mx:Canvas
view:MyImage
mx:Bitmap

[code].....

View 1 Replies

Flex :: Call Function After Remote Call?

Jan 31, 2011

I have a function in Flex which has three function in it.

public function update():void
{
A(); \Dispatches a event with Remote Call

[code].......

View 1 Replies

ActionScript :: Flex - An Object Returned From A Function Call Changed The Next Time The Same Function Is Called?

Jan 10, 2012

I have an AS3 program that calls a function multiple times. The function must return multiple variables, so I created a class for the function to declare an object containing all of these variables. For example, here's my class:

package
{
public class PER
{
[Code].....

Let's say the calling program calls the function, which returns the variables into data_set1 (where data_set1 depends on input variables arg1, arg2, arg3) using:

var data_set1:PER = function_name(arg1, arg2, arg3);

The calling program does some stuff, then calls the function again, but returns the variables into a new variable name, data_set2:

var data_set2:PER = function_name(arg4, arg5, arg6);

My intention is that data_set1 and data_set2 are different (e.g. not linked together).

My question is, given that arrays are passed by reference, will data_set1 be modified to agree with data_set2 upon the 2nd function call? Why or why not?

View 1 Replies

Actionscript 3 :: Flex 3: Run A Function After A Repeater Is Completed Done Loading The Children?

Jun 10, 2011

I have a repeater which creates a child named "wholeProject" each time the repeater loops.

<mx:Repeater id="projectRP" dataProvider="{projectsHttp.lastResult.project}">
<Block:project
id="wholeProject"

[Code]....

As you can see from the last line of the piece, i have a the creationComplete option run two functions. What I would LIKE to happen is once the repeater is done loading all of the block:project pieces for each function to run once and only once. Instead, the two functions are running after each is created. I tried putting the creation complete in the tag, but that didn't work.

Is there a way to tell the creationComplete piece to run only when the last piece of the repeater has been created?

View 1 Replies

Actionscript 3 :: MovieClip Resizes But Its Children's Height And Width Are Not Changed?

Feb 27, 2011

Changing the width and height of the parent MovieClip does not bring change in the width and height of the inner MovieClip. The parent MovieClip is placed at Stage and is resized manually. When I assign the dimension of the parent MovieClip to the inner MovieClip through code, the parent MovieClip dimension is changed. I want both MovieClip to be of same width and height at runtime. However, parent MovieClip dimension is changed at design time by me.

Example:There are two MovieClip, one inside another. Now parent MovieClip is placed at Stage at design time and its dimension is (50,50) and the child MovieClip which is inside the parent MovieClip has also same dimensions (50,50). Now, I manually change the parent MovieClip dimension by pressing Q and stretching it with mouse, the dimension of the parent MovieClip is now (100,150) or whatever I like. Now double-click on parent MovieClip and check that inner MovieClip dimension remains same i.e. (50,50)Now in AS3 code, I change the width and height of inner MovieClip like this:

saveheight = parentmc.height;
savewidth = parentmc.width;

now I change the child MovieClip according to the dimensions of the parent MovieClip like this:

parentmc.inner_mc.width = parentmc.width;
parentmc.inner_mc.height = parentmc.height;

but this brings change in parentmc also so I reassign value to parentmc like this:

parentmc.height = saveheight;
parentmc.width = savewidth;

In above case, parentmc and inne_rmc dimension should be same i.e (100 ,150). With swapping the values as above, I get parentmc and inner_mc to be of same dimension, but object size is never (100, 150), I have checked it with pixel-perfect air app.

View 3 Replies

ActionScript 3.0 :: Change The Height & Width Of The Container Without The Children Scaling?

Feb 15, 2009

I have a container object that i add children to. I want to change the height & width of the container without the children scaling. In this case I draw a rectangle in flash which I'll use as the container object then export for AS.

[Code]...

View 5 Replies

Flex :: Flex - Function Call Inside Of Component?

Sep 1, 2010

I want to call an App function inside a (I know about the Component scope already).What I mean is this:

<mx:Script>
<![CDATA[
public someFunction():void {

[code]......

View 1 Replies

Flash - Children Movieclips Doesn't Show Its Width And Height According To Parent Movieclip

Jul 19, 2011

I have placed 3 movieclips named mcParent, mcChild1, mcChild2 and 1 textbox in flash. child are childrens of parent movie clip. child1 and child2 both are of sizes 300 whereas parent movieclip is 600px, textbox is placed inside child2 movie clip .

I have made the flash to auto resize according to the screen area. Everything works well, but after resize it resizes parent and all childrens and textbox which is correct. The problem is with the correct placement of textbox on mcChild2. I have seen that after resize, mcParent width and scalex both changes but the child clips doesn't changed its sizes even they are stretched but there sizes are not updated due to which I am unable to get the exact location of where to place the textbox.

View 1 Replies

Flex :: Call() Of Function With Arguments?

Sep 4, 2009

I have a component that I hand over a function

public var func : Function;

Now the function is a function that has parameters in its signature

public function myFunction(s : String) : void {
doSomething(s);
}

from my component I can call the function with

func.call();

how to invoke the function with its parameters?

View 1 Replies

Flex :: Call Function When Dataprovider Changes?

Feb 6, 2011

How can I set a function to be called when the length of a DataProvider changes?

View 2 Replies

Flex :: Dynamically Call A Function?

Jun 2, 2011

How can we dynamically call a fuction. I have tried below code:

public function checkFunc() : void
{
Alert.show("inside function");

[code]......

View 4 Replies

Flex - Access Children Of Children Recursively?

Mar 10, 2010

I have a Canvas which has many components inside it and those again, have many components inside them.

getChildren() returns only the top level children. What is the best way to retrieve all the children (children of children of children and so on).

Well, I sorta know how to do this by iterating through the children, but the code is really messy. I'd prefer to use a nice recursive function. Has anyone written this before? Or is there a Util class to do this?

View 3 Replies

Actionscript :: Add Children To Accordion Children In Flex 4?

Oct 28, 2011

I have an ArrayCollection that is read to generate containers in an accordion programmatically:

<s:ArrayCollection id="_ac_ps">
<fx:Object label="Block and lot" data="_blocklot" searchType="districtblocklot"
info="" />

[code].......

View 1 Replies

ActionScript 3.0 :: [flex As3]function Non Recursive Call. How?

Feb 3, 2009

So, I create standard AS3 flex project. In constructor goes only start();


rest of functions are basically this:

private start():void { f1();}

private function f1():void { f2();}

private function f2():void { f1();}


And it's standard recursion. SWF either breaks or loops as many times as I tell it. One f calls the other, which calls first... I do not want that.

I want f1 to do some stuff, calls f1 and closes itself. Than f2 works, calls f1 and closes. And so on.

Like having 2 sets of code that loops through.
What's the cleanest way to do that?

View 16 Replies

ActionScript 3.0 :: [flex As3] Function Non Recursive Call?

Sep 2, 2009

I create standard AS3 flex project. In constructor goes only start();

rest of functions are basically this:
private start():void { f1();}
private function f1():void { f2();}
private function f2():void { f1();}

And it's standard recursion. SWF either breaks or loops as many times as I tell it. One f calls the other, which calls first... I do not want that. I want f1 to do some stuff, calls f1 and closes itself. Than f2 works, calls f1 and closes. And so on. Like having 2 sets of code that loops through.

View 1 Replies

Actionscript 3 :: Flex: How To Call Function Of Embedded Swf

Jan 5, 2010

I have a Flex 3.4 app that embeds a swf with mx:SwfLoader...

That swf has a public function named "playIt". I've tried dispatching events to gettingHere.content, casting gettingHere.content as a MovieClip and other stuff...

var swfApp:MovieClip = MovieClip(gettingHere.content);
if (swfApp.hasOwnProperty("playIt")) {
var helloWorld:Function = (swfApp["playIt"] as Function);
helloWorld();
}

View 2 Replies

Flex :: Call Parent Function From ItemRenderer

Feb 6, 2010

I want to call the parent function called "edit_groups()" from the itemRenderer. The code for my itemRenderer is:

<mx:VBox id="vbx_container" paddingBottom="4" paddingLeft="4" paddingRight="4" paddingTop="4" borderStyle="solid"
dropShadowEnabled="true" width="100%" height="100%" horizontalScrollPolicy="off" verticalScrollPolicy="off" >
<mx:Canvas width="100%" height="100%" horizontalScrollPolicy="off" verticalScrollPolicy="off" >
<mx:Image id="image" width="100" height="100" source="{data.thumb}" scaleContent="true" maintainAspectRatio="true"
complete="{image_smoothing_handler(event);}" trustContent="true" doubleClick="{Call The Parent Function"edit_groups()"}"/>
</mx:Canvas></mx:VBox>

And I call my itemRenderer from an application like:
list_groups_modify.itemRenderer=new ClassFactory(groups.list_groups_modify_item_renderer);
<mx:Label text="{data.label}" textAlign="center" maxWidth="60" toolTip="{data.label}"/>

View 3 Replies

Flex :: Possible To Call Function By Using Datagrid Column?

May 17, 2010

Is it possible to call the function by using the datagrid column item?I want to call the function while the user click the particular column item in the datagrid?

View 1 Replies

Flex :: Call A Function When Building An Array?

Aug 16, 2010

Can I call a function when building an array in Flex 3?

public function gridBuilder(myArray:Array):void {
var i:uint;
for (i=0; i<myArray.length; i++){

[Code]....

MyArray is the result of a remote call to the database. I then prepare the array to be used in a dataGrid. I also want to call a function that provides a grade. Unfortunately, my function appears to be called only once. Is it possible to call a function when you're building an array? see the "Grade:" bit.

View 1 Replies

Asp.net :: Access / Invoke / Call Flex Swf Function?

Feb 20, 2011

I create a swf with flex. Than I embeded that swf into aspx page.But how can I access/invoke/call swf function from asp.net???

View 1 Replies

Flex :: Call Child Function From Within Parent?

Jun 1, 2011

Is it possible to call a child function from within the parent? I know to go child > parent, you can do parentApplication.functionName(parameters);, but what about going the other way... that is parent > child?

View 2 Replies

Flex :: Call A Function In It From Php Side Of AMFPHP?

Aug 26, 2011

Is it possible to call a function in flex from the php side of AMFPHP?

For instance, and error is thrown in php, can i "listen" for it in the flex app?

View 1 Replies

ActionScript 3.0 :: Call A Function Before The Flex App Is Closed?

Oct 10, 2010

I was wondering if flex has some events that can call before I close the whole application or close browser. Since I would like to send a httpservice to a php before the swf is closed. I tried this before:

<mx:Application xmlns:mx="" creationComplete="init()" remove="clearHistroy()">

But it didn't work.

View 1 Replies

ActionScript :: Flex - Call A Varargs Function With An Array?

Aug 11, 2009

I need to call a varargs function:

function doSomething(... args): Object {
// do something with each arg
}

However, I'm building the arguments for this dynamically:

var someArgs: Array = ['a', 'b', 'c'];
doSomething(someArgs);

The problem is, when I call the function in this way args ends up being a 1-element array with someArgs as the first element, not a three-element array.How can I call doSomething with someArgs as the argument array?(For the search engines, this is argument unpacking)

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved