Flex :: 4 - Unset The Explicit Height Value Of A Component?
Mar 22, 2011
When a container component is declared without setting an specific height value, the contaniner's height will be automatically set to a value which makes possible to display all of its content/children without scrolling (when possible). After the component is initialized with the proper height, I explicitly change the height value of the container.
My question is, after I change the component's height, is it possible to switch back to the original height that was automatically set based on the containers contents? I'm looking for some way to unset the explicit value of the component's height.
View 3 Replies
Similar Posts:
Nov 10, 2009
I want to constrain the height of a flex component to the height of the browser viewport.
The component's children are populated from a database table using a repeater, and are basic checkboxes. There are enough of them that the flex app ends up being about twice the height of the screen, which means some of the rest of the layout goes crappy on me. How can I force the component that contains these to limit itself to the size of the viewport?
View 4 Replies
Jul 25, 2010
I'm playing around with code like this:
<s:Button id="test" label="test" transformX="{Math.floor(test.width/2)}" rotationY="20" x="20" y="20" />
The button is rotated on the Y axis and the rotate pivot is in the middle of the button.
This will create a button that looks something like this[code]...
I put together a sample to show off the various approaches for calculating this that people are suggesting. The source code is also available. Nothing is quite working like I'd expect. For example, turn the rotationSlider to 85. The button is effectively invisible, yet all approaches are still giving it height and width.
View 3 Replies
May 2, 2011
I have a panel with a custom skin whose height is smaller than its hostcomponent's height. When I layout this out in a vgroup, the component's size doesn't reflect the skin's smaller size.
Is there a way to completely delegate the size of a container to the skin class?
View 1 Replies
Jul 8, 2011
I've created a custom component with several inline item renderers that I use as a tooltip. The height of the component is unknown, as the data contents of the component are not known until runtime.
However, when displaying the tooltip, occasionally it extends beyond the boundaries of the flash application, thus, I'd like to be able to detect this occurrence and reposition the tip.
The problem is that the height and width of the component are, apparently, not available until after being rendered by the popup manager. (i.e. they are always 0)But, I do not know any way of finding out when the popup is actually rendered and, therefore, the height/width values available.
[Code]...
View 4 Replies
Jun 26, 2009
Im trying to create a layout in flex using mxml, the layout contains a Canvas component and a Box. The layout should always be such that the Box sits at the bottom edge of the application and has a fixed height, whereas the Canvas fills the remaining stage area and does not overlap with the Box. My MXML is as follows;
[Code]...
View 3 Replies
Oct 12, 2009
Once I've set either the width or percentWidth property on a flex label, is there a way to reset the width to its default (i.e., the width of the text plus padding)? I'm using the label as a renderer. In some cases, I'd like it to automatically size to the text, and in other cases, I'd like it to be a percentage width of its container. Obviously, I could use two separate labels, one for each of the above cases, but I'm curious if it's possible to reset the label to its default behavior.
View 2 Replies
Apr 1, 2010
How to set a Spark List height to the height of its content?Tried this:
var lastRow:IVisualElement =
myList.dataGroup.getElementAt(myList.dataGroup.numElements - 1);
myList.height = lastRow.y + lastRow.height;
It works in case of a single item, but lastRow is null in case of more items.
View 5 Replies
Apr 5, 2010
By default the height of an Flex Accordion container is the height of the initially selected child. I'd like to be able to set the height to the tallest child so that no resizing or scrolling is necessary when other children are selected. I do not want to use the resizeToContent property. I want the size of the container to stay constant no matter what child is selected.
My current thought is to extend the accordion class setting the creation policy to "all" and then override the measure function to loop through all the children and find the tallest one and use that for the height. This seems a little kludgy though, so I'd like to know if there is a better approach. Ultimately my question is: is there a way to set the size of an accordion container such that the container never resizes and scoll bars are never necessary to display any of the children?
View 1 Replies
Mar 5, 2010
In Flash CS3 I was able to duplicate any MovieClip from an external SWF by loading the SWF, and then executing the following code:
var targetClass:Class = MovieClipToDuplicate.constructor;
var duplicate:MovieClip = new targetClass();
Note that the MovieClips I was duplicating did NOT have any linkage explicitly defined. Flash would automatically assign a unique class to each MovieClip. Now, in Flash CS4, when I try to do the same thing the .constructor property returns only the "MovieClip" class, such that the "duplicate" variable above is but a blank MovieClip. If I compile the external SWF using CS3, my old code still works. But I want to do it in CS4.
View 4 Replies
Sep 24, 2010
Is there any way for me to define implicit or explicit type conversions in ActionScript?For instance, I want to define a conversion such that Array can cast into MyClass implicitly. If not, an explicit cast would be useful. I know I can always pass it into my constructor, but I am dealing with semantics here, and I am most interested in a conversion solution if it exists.
View 1 Replies
Mar 24, 2006
I am a novice and am educating myself about AS.Reading through Datatypes and conversion, I came across different methods to converting data into "string".
1) by using the toString() method
2) by using the String() function
3) converting to a string using empty string concatenation :- x + "";
My questions are :
a) which of the three is the preferable method?
b)Why?
c) Are there any specific instances when one is preferred over the other?
View 10 Replies
May 26, 2009
I am going to embed a Flex app on an html page. The html page is already going to have a scroll bar to scroll up and down. The contents of the flex app are very dynamic, and I don't want to have an extra scroll bar when there is already one. So is there a way to make the height of the swf match the height of the contents of the swf?
View 2 Replies
Jun 23, 2011
I have a component "child" which has a cancel button. Now this component is placed in a state called "newChildComp" I also have another component called "parent". In the parent component, i have a button that dispatches an event. Here is the event code:
[Code].....
so, basically,i am checking to see if the cancel button component in the Child component, while i am still in the parent Compoent, was clicked, if it was clicked, call the cancelButtonHandler. The problem is by the time the addNewChild handles the event, that cancel button was still null. My question is how do i solve this without using the itemCreationPolicy on the cancel button?
View 1 Replies
May 6, 2010
Is there anyway to change the height of the slider in AS3? (CS3), I've tried changing the actual graphic (of the bar) in the library and no matter how big I make it it's always locked to 13 pixels high.
View 3 Replies
Mar 16, 2010
Maybe I'm googling for the wrong thing but I can't find anything on this.
How can I change the line height of a Label element in Flex?
I have two labels in a VBox and there is quite a lot of white space between them which I would like to reduce. There's no line height property and setting the height property causes overlap.
View 1 Replies
Sep 6, 2010
When I add a ComboBox component into a Sprite, the height of the container is larger than it should.Here's what I mean:
import fl.controls.ComboBox;
//add combo box inside a container sprite
var combo:ComboBox = new ComboBox();[code]..........
the height changes from 101 to 104.
UPDATE:I've overwritten the configUI method in a ComboBox subclass, but the measurements are correct all the time. Why does the container height change to 100 ?
View 5 Replies
Jun 4, 2010
Why can't I adjust the height of the slider component? I created a new component and placed it on the stage, and changed the height of all of the images that comprised this slider (which were movieclips) to a larger size, but it still remains a skinny line when I run the program. I even did this in the Actions section:
mySlider.height = 20; but it seems like the program is ignoring anything that has to do with adjusting the height of the slider. If I try adjusting the width, however, then that works. It makes the line longer when I set the width a larger number. But why is the height of the slider line not being adjusted? No matter what I do, nothing is working. I have searched all over the internet for answers, but I can't find anything.
View 0 Replies
Feb 28, 2011
i have a class, that extends Sprite and i want to build a Flash CS5 component out of it (using the component panel in Flash CS5, so some designers can benefit from it).
The specialty is, i am overriding the setters/getters of width/height and also scaleX/scaleY of my component, because i want to do some special stuff there, but of course i still call super.width, ... and so on.
So, i set up everything, drag an instance on the stage at author time, resize it to my needs. But at runtime now, i had to find, that neither my overridden width or height setters, nor my overridden scaleX / scaleY setters are ever called.
Still, my component got resized. So i ask myself, what is Flash CS5 doing to change the size of my component, if it is not using width/height or scaleX/scaleY? Everything else works as expected, i have some parameters, which i set to inspectable and i can set them in the panel in the flash IDE, it just works fine. Only my overridden setters are not called.
View 1 Replies
Feb 7, 2012
Does anyone know if there is a way to find the height of the text within the TextLayout class?
I am making my TextLayout objects like so:
this._textFlow = new TextFlow();
this._paragraphElement = new ParagraphElement();
this._textFlow.addChild(this._paragraphElement);
[Code].....
All the public properties I'd expect to find the height are undefined such as this._textFlow.lineHeight.
View 1 Replies
May 29, 2009
Already I have one video player and it's width and height are set as 450 and 370 respectively. It's set by statically on its property field. Now I want to change the width and height of video component according to the specified value. Also the control box should be scale accordingly. But when i tried to change the video component's width and height while loading, it's not getting changed.
View 4 Replies
Oct 12, 2010
i am trying to load array of pictures dynamically in to a loader component,the picture after loading in to loader component i am resizing it to required size.
115 is the width and height of loader component.
.complete = function (eventObject)
{
loader.redraw();
x_txt1= loader.width;
y_txt1= loader.height;
[Code]....
but if i select next picture while fullscreen then loader.width and .height shows as 0 and picture is not displaying.
View 1 Replies
Jun 7, 2011
I have a VBox with fixed width and height, and I add image objects with fixed width and height. I find that if my objects' height exceed the VBox's height, it doesn't show the object. I tried validateNow(), but it doesn't work. The object is added, but VBox just doesn't display it, so it leaves a blank with a same height as my other object.
[Code]...
View 1 Replies
Nov 11, 2010
I'm building a top view 2D map, that it's objects are stored on the server.The kind of objects are 10 and might be a photo, label, button, lists, mix of them or labels with tooltips.The component must request the "areas" that are missing on screen.An area is 1000x1000 px and is cached in flex.To move in the map, will be like in google maps (drag-and-drop).I should be able to have another list and move objects from one to another using drag-an-drop on objects. Ex.: I grab an objects from a list and I move it on this map, I release the mouse button and the item is placed there.Now the problem is: I build a custom component for this trying to emulate the item renderer for performance and recyclage, implement drag-and-drop on objects and request the areas that are missing?
or
I extend the List component from spark and I add some features as multiple kind of itemrenderers and use recycle on them. Of course it must be able to request the missing areas on the screen and cache it's data.Maybe create a custom layout is needed too.What I need is something that must be really fluid, so the lighter this component is, the better.
UPDATE: *There will be not any object over another.
*I will not use hitTest on bitmaps because all bitmaps are wrapped in another component,as they,for now are itemrenderers.
Anyway I already begin to do this using a class that extends the SkinnableDataContainer and a custom layout. As the layout is not like a grid, is sparse, random items at diferent points(x, y).How to get the localX and localY, relative to item renderer and not to the Spark List, from a DragEvent in Flex 4?
View 1 Replies
Sep 3, 2009
I have two components. One is called "InsideComp" and one is called "OutsideComp". OutsideComp has InsideComp as one piece of its component, and in my main MXML file, I have embedded an instance of OutsideComp. How do I access a public variable of InsideComp within my main MXML file?In Actionscript, I could just do something like:OutsideComp.InsideComp.valToChange = 5; But I dont know how to do it in MXML. I know this is probably an easy question.
View 4 Replies
Sep 21, 2011
I would like to bind two components with out binding and which resides in different MXML.for eg: A.mxml has textinput and B.mxml has a combobox when choose one item in B.mxml selected item should be display in A.mxml textinput.
View 2 Replies
Jul 29, 2011
I have a component with a public variable declared
[Bindable]
public var mnuSource:String;
When I extend this component, I can reference mnuSource (it compiles) but Runtime complains about the property not being accessible (error 1056).
How do you modify / declare component properties so they are actually available to other components?
View 2 Replies
Sep 29, 2010
I'd like to use a button within a component to remove it. So, you click it and the component is gone. But, I haven't figured out how you reference the component from within the component. What should I put in click=""?
My component: popCanvas
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Panel width="200" height="200" title="hello"
click="remove=">
[Code].....
View 1 Replies
Aug 12, 2009
A Flex components values are initlized by init methord. In an application flow, How to refresh a mxml component data value ; as init is callled at the start up it self only.
eg. of mxml componet may be as simple as button label or text as complex as repeater whose data provider is a web service ( means a fresh quesy should be made to pull the data and refresh the dataprovider of repeater )
View 3 Replies
Apr 18, 2011
In my Flex 4 app I would like all my alert boxes to be a specific width and height, how do I specify that in the CSS? I want to avoid having to specify the width and height every time I want to show an alert, that's why I'd like to set it in the CSS, but does not look like there's a way to.. Something like this does not work:
mx|Alert
{
height: 100;
width: 300;
}
View 3 Replies