Flex :: List All Elements In A Container?
Jul 11, 2011
I want to list all controls (buttons, datagrids, etc) in a container
This works but gives me a warning 1008: variable 'comp' has no type declaration.
for (var i:int = 0;i<this.numElements;i++)
{
var comp = this.getElementAt(i);
[Code]....
when I get a compiler warning it's because I'm not doing something the way it is supposed to be.
Are there any alternatives to reference the id property? A method I'm missing even a whole different way iterate through all the controls?
View 3 Replies
Similar Posts:
Jul 2, 2011
In a Flex Mobile project I have a simple itemRenderer where I'm trying to create an "bubble" texting effect, similar to ichat or iphone (just so you get what im going for). But if the text is longer than the screen it runs off, rather than just going down a line.
If I set Group thats holding the rectangle(to create the bubble effect) and the label to 100% it works and keeps it from exceeding the list containers bounds, BUT the group is always at 100% and looks bad, I'm trying to keep the "bubble" JUST AROUND the text.
Anyway so, at the top of my itemRenderer I tried specifying:
<s:ItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark" width="100%" height="100%">
And here's my layout I figured since msg_container has a width of 100% I was hoping bubble_lable_group would just not exceed that but...it doesnt...it just runs off. I tried setting a max width but that does not allow you to input percents. And just to say it 1 more time. I know if i set bubble_lable_group width to 100% it works, and keeps it from going off the edge, but then the rectangle "bubble" stretches all the way across and just looks bad.
<s:VGroup id="main_container" horizontalAlign="left" paddingBottom="10" paddingTop="10"
verticalAlign="top" width="100%">
[Code]....
View 1 Replies
Aug 17, 2011
Flex's new States re-parents visual items that are marked with includeIn/excludeFrom. If I have a Group (MainGroup) with 5 children/elements that are state controlled, is there still a way to get a reference to MainGroup's children? mainGroup.numChildren and mainGroup.numElements don't work since the children are re-parented. At best, they show 1.
<s:states>
<s:State name="view1State" />
<s:State name="view2State" />
<s:State name="view3State" />
[code]....
View 4 Replies
Mar 9, 2012
Is it possible to define a property to limit the number of elements which will appear in a mx:List ? I've read about setting the property rowCount, but I don't see any effect.Can a filter be applied to accomplish this? My intention was to avoid removing the items from the list/array collection, but simply "hide" them. Can this be done?
View 2 Replies
May 12, 2010
I'm using a list element with variableRowHeight and word-wrap set to true like in the example below:
[URL]
When I scroll through the list with a mouse scrollwheel the text in the listItems also scroll. I know that this is to do with the height of the textField...
View 1 Replies
Mar 1, 2012
I'm coding this minigame implementation where a sprite traverses tiles on a screen, and when he's done traversing a tile, the tile "disappears" (its alpha decreases and it becomes a "wall" the player can not move onto). Now, simple enough. Make use of a traversing and traversed boolean arrays to store if a tile is currently being traversed, or if it isn't, but it has been traversed. So, if traversing == 0 and traversed == 1, make the tile "disappear". However, and here's the weird part, if I just set the alpha to, say, 0.5 in this if statement, it sets the alpha on just the tile I traversed, whereas if I try to make it part of the wall as well (in the same if), every tile except the one I've traversed to becomes a wall.
Here's part of the code (it happens in the enterFrame game loop):
Code:
const NUM_TILES = 15;
//Add MC for all the tiles
var tiles = new MovieClip();
addChildAt(tiles,5);
[code]....
View 1 Replies
Mar 21, 2010
I have 2 arrays, one of images, the other of links I would like to create an XML list using the values in these arrays. My code is similar to:
public function savecards():void var coverflow:XML = new XML(<coverflow/>); var cover:XML = new XML(<cover/>);
for (var j:Number = 0; j < 2;
[code].....
View 2 Replies
Jul 6, 2011
I have a for loop which is grabbing data from a xml file and showing it to the user.. my problem is that I want to show 5 for let's say.. 30 seconds.. and then making a transition and show another 5 elements.
I can make the condition like:
Code:
if(info.length() >= 5){
for (var i:int = 0; i < 5; i++)
{
and I show the first 5. But what now? How do I hide those and show the next five?
View 7 Replies
Jun 27, 2003
I have a list of countries that are in an xml document. I was wondering if here was a way to randomly load ten of these and place them on the stage in random places. I want to get the effect of this intro: [URL]. (not the one with the black background)
View 8 Replies
Apr 25, 2004
I'm trying to make an array and list it's elements in a text box.
Code:
tabs = new Array();
tabs[0] = "jerseys";
tabs[1] = "tshirts";
[code]....
View 4 Replies
Sep 21, 2011
I have a loop that goes through data from a book and displays it. The book is not consistent in it's layout so I am trying to display it in two different ways. First way(works fine) is to load the text from that section in to a panel and display it. The second way is to create a new panel (panel creates fine) and then add collapsable panels(nested) to that panel. Here is the code from the else loop.
else if (newPanel == false){
// simpleData is just for the title bar of the new panel
// otherwise the panel has no content
[Code]....
The error I get is: ReferenceError: Error #1069: Property panel4.4 not found on components.readTest and there is no default value.
I have tried setting the "name" property instead of the "id" property.
View 1 Replies
Sep 21, 2009
For some reason below is not working. It is probably very obvious but I am not seeing it. As soon as I comment out the container mc variable and just add Child to root timeline I see everything which means me container is not being added to the stage correctly.
stop();
import flash.display.MovieClip;
var i:int = 0;
var a:Number = 10;
var ageString:String;
var ageText:Array = new Array();
[Code] .....
View 7 Replies
Dec 23, 2010
I have a viewstack container w/ 3 views: red, black, and blue. How can I completely hide the black & not include it?
[Code]...
View 2 Replies
Jan 13, 2012
I am creating an flex Air project,so mxml file will run. I have circles in one Big circle at one side and will be same on other side.
Now how to drag any circle from any Big circle to other side. Or it could be like any two container having circles, then how to drag and drop circle?
For one circle i am able to do drag and drop.But I want one Big circle on left hand side and one big circle on right hand side .And small circles with class names will be in these big circles.Now i want to drag and drop those small circles in big circles.Big cicles should not move. Even i have tried this code in actionscript
package
{
import flash.display.Sprite;
import flash.events.MouseEvent;
[Code].....
But in this i want big circles should not move and small circles should only be dragged.
View 1 Replies
Jan 27, 2010
I'm currently working on a custom component which extends Canvas (let's call it SuperCanvas) ; it's basically a container that let you zoom & pan its contents. It would be too long to explain why, but I can't use scrollRect, so I was forced to declare a Canvas object (called innerCanvas)... inside my SuperCanvas (I know, not very nice =/) I would like to know if there's a proper way to "redirect" the creation of my component's children in this canvas.
[Code]...
View 1 Replies
Aug 11, 2010
I'm using flex 4.1 to write an application. i read in the documents that has the rowCount property to set how many items to display. the does not have that property. how can I limit the list to display 3 items ?
View 3 Replies
May 26, 2011
Flex 3 List control had a itemRollOver event. Flex 4 List doesn't have it. Is there an equivalent or a workaround for this issue?
View 2 Replies
Dec 31, 2009
Here is a snip from within my code:
[Code]...
The 'recommendations' dataProvider is an ArrayCollection of String, which are generally sentences about as long as this one. By setting the variableRowHeight and wordWrap properties as shown, if a sentence is too long to fit on a single line, everything works fine- the row expands and the messages show on two lines, or occasionally three.
The space allocated for this panel within the entire canvas means if the total text size of 'recommendations' exceeds six lines, I need for the entire list scroll. This is also working just fine. The trouble is when using the mouse wheel to do the scrolling- Flex scrolls both the entire list and the single item where the mouse is hovering. Often this results in only the second half of a sentence being visible. Non-programmer friends I have asked to look at this noticed this, and tell me it as a problem. If a user does not notice the dual scrolling, and sees only a fragment of a sentence, it will be perceived as an error in the application.
[Code]....
View 1 Replies
Jul 6, 2011
When a user selects a category from the first drop down box then i want the 2nd drop down to be updated based on the selection of the first drop down. I have created multiple ArrayCollections whose names are set to the "data" values of the first drop down, for instance:
[Bindable]
public var countries:ArrayCollection = new ArrayCollection([
{label:"USA",data:"USA"},
[code].....
View 2 Replies
Aug 31, 2011
I am currently working on a project in Flex and I am having a hard time having a list's contents ALL be selected by default. Wondering how to do this.
<mx:List id="list" dataProvider="{dp}" allowMultipleSelection="true"/>
I'm just trying to have the list all selected.
View 2 Replies
Jun 28, 2010
I'm trying to animate a list as I delete the top row. All the examples I can find use itemsChangeEffect to bind to the effect, but this property exists only in MX lists, not spark lists.
Any idea how I can get the same effect done in Spark Lists?
I'm trying to remove the top most item in the list with a slight fade out effect before the rest of the items move up to replace the gap.
View 2 Replies
Nov 23, 2009
while i using drag & drop from listbox1 to listbox2 ,how can i get all the items of listbox2 in flex
View 1 Replies
May 13, 2011
The traditional way to assign an icon would be to use the icon field of the item renderer,which reads the value of "icon" property in your data, for example:
listData.addItem({label: "Logout", icon: "com.classpth.DefualtThemeLogoutIconClass"});
But i want the DefualtThemeLogoutIconClass to changed to another class: ightThemeLogoutIconClass when the theme is changed.The only way to do this would be to use a style declaration containing a classReference to the icon, and change its the value in each of the CSS files of the various themes.The question is, is there any way to assign this style to an icon in a List, something as easy as intuitive as list[0].getIcon().setStyle("styleName");
View 1 Replies
Jan 17, 2010
I am having difficulty getting a reference to elements added after compile-time using the 'id' property. I have seen a few forum topics suggesting that this isn't possible, and that getting a reference to elements added this way is trickier, but never just exactly what that trick is. This code throws a fun little: Error: uncaught exception: Error calling method on NPObject! [plugin exception: "ReferenceError: Error #1069: Property canvas_tentpoles_0 not found on SGraph and there is no default value."].
[Code]...
View 2 Replies
Jan 26, 2010
Is it generally to position elements relative to other elements or in absolute values?
View 2 Replies
Apr 3, 2012
Ive been trying to get flex popups to open under some of my visual elements.
View 1 Replies
Oct 1, 2009
does anyone know how to shift all the array elements by one or more without deleting the array itself?
Something like rotating the array:
1,2,3,4,5,6,7,8,9,10
10,1,2,3,4,5,6,7,8,9
9,10,1,2,3,4,5,6,7,8
8,9,10,1,2,3,4,5,6,7
7,8,9,10,1,2,3,4,5,6
View 4 Replies
Jul 21, 2009
I want to extend the RadioButton component in Flex 3, adding a text input line to it in place of the label. Is it possible to do this?Alternately, is it possible to have a container -- such as an HBox -- delegate all properties to an internal component -- such as a RadioButton -- so that I could create a composite component that 'acts like' a radio button?
View 1 Replies
Jul 28, 2010
I create an HBox, fill it with a grid of buttons, and set the scroll policy. When I resize the window, the stage changes size, and so does the HBox ... to a point. Once it reaches the height of the Grid it contains, it stops shrinking, like it has a "min-height". This ruins the scrollbar that I'm trying to establish in this case.
I've set the height to 100%, shouldn't it always take the height of the stage, it's parent?[code]....
View 2 Replies
Jun 9, 2010
When i create a menu, the dropdowns go behind the flash element. But in some sites, like Digg, it is shown above. z-index is of no use
View 2 Replies