Flex :: Repeater Item As An Array Index (binding)?

Oct 12, 2010

I have a label inside a repeater (rptInfos), and I have an arraycollection (Texts) that has the translations. The "Texts" content is changing when I change the language, and normally I use {Texts.getItemAt(219}} for example when I need a translated text. But in the repeater I have a translateable column, so I want to use it like this:

<s:Label text="{Texts.getItemAt(rptInfos.currentItem.DictID as int)}" />

but it says "Syntax error: expected a definition keyword (such as function) after attribute , not target".I wanted to translate it in the labels creationComplete event, but than I can forget about binding, so only when reloaded can I have the content to update.

View 2 Replies


Similar Posts:


Flex :: Checkbox Visibility Binding In Repeater?

Nov 20, 2009

I am trying to dynamically bind the visibility of a checkbox control to a data field of a repeater as follows.

[Code]...

View 1 Replies

Flex :: Ensure An Item Gets Deleted Inside Repeater?

Aug 4, 2010

I have a code like this:

<mx:Repeater id="allItemRepeator"
dataProvider="{_model.allItems}"
>
<components:ComponentSelector id="componentSelector"

[Code]....

When code changes for allItems the item disapears from screen as expected but still sits in memory! I know this by a function inside a compoenent that has "trace" so the trace output still displays even after the component disappears from screen. How do I ensure that the element is deleted when it's reference is deleted? Will using List-based component to display items instead of "Repeator" solve the problem (it requires significant refactoring of my code so I'm asking before trying it out)

View 1 Replies

ActionScript 3.0 :: Flex: Send Event Or Something To Repeater Item

Feb 13, 2010

I have a Tile with a repeater. I need to select a repeater item or the tile and change its values, or fire an event, or something.

View 1 Replies

Flex :: Access TileList Item Index In A Custom Item Renderer?

Mar 4, 2011

<mx:itemRenderer>
<mx:Component>
<mx:Canvas>

[code]......

View 2 Replies

ActionScript 3.0 :: Getting An Array Item By Index #?

Jun 15, 2011

I have a tricky problem in that I have an array that has been populated with strings ("item1", "item2", etc). However, at a certain point I need to pull one randomly out of the group, via a random number function. The issue is I cannot reference the items in the array by a number, I get an error. So when I try to get myArray(5) it doesn't work.
 
How can I work around this so I can grab a random item in my string array?

View 6 Replies

Actionscript 3 :: Know The Index Of An Item In The Array?

Mar 30, 2010

var arr1:Array = new Array();
arr1.push(item1);
arr1.push(item2);
arr1.push(item3);

then arr1 and its elements get passed to other functions is there a way to know the index of an item in the array?

GetParentArrayIndex(item2) would give me 1;

View 2 Replies

ActionScript 3.0 :: Insert Item Into Array At Certain Index?

Mar 10, 2012

i see that theres the array.push and array.unshift, but thats just the beginning and the end of the array. how would i go about inserting an item(s) into an array at the desired index?

View 4 Replies

ActionScript 2.0 :: Checking Index Number Of An Item In An Array?

Aug 2, 2007

I have this Array

Code:
var shoprubriken:Array = new Array();
shoprubriken[0] = "43";
shoprubriken[1] = "44";

[Code]....

Now I wanted to check on which Index Position maybe the 47 is

How can I archive this on a Button or Function?

View 5 Replies

Flex :: ViewStack With A Repeater - Repeater Gets Placed At The Bottom?

Sep 2, 2010

I have a problem when creating a ViewStack, with a repeater along with other components (i.e. vBox) inside the ViewStack. The repeaters get placed at the bottom of the view. Despite the repeater is listed before other components, it is placed at the bottom.Is there a workaround where I can get the repeater drawn before the other components?Here is an example:

<mx:ViewStack id="viewStack" width="100%" height="100%" backgroundColor="#FFFFFF"
backgroundAlpha="1" paddingLeft="5" paddingRight="5" paddingBottom="5">
<mx:Repeater id="editorsRP" dataProvider="{dynamicFields}" [code].....

View 2 Replies

Actionscript 3 :: After Shuffling Array - Variable = Array[index] Gives 0, Trace(array[index]) Gives Correct Number

Aug 16, 2011

I think it would be simplest to explain it like this:

[Code]...

View 1 Replies

Flex :: Get Item From AdvancedDataGrid Given Index

Jul 7, 2009

I've got a subclass of AdvancedDataGrid showing a tree-like data structure. How can I, given the index returned by calculateDropIndex, get the item at that index? After reading through reams of code, it seems like the least terrible way is:

var oldSelectedIndex:int = this.selectedIndex;
var mouseOverIndex:int = this.calculateDropIndex(event);
this.selectedItem = mouseOverIndex;
var item:* = this.selectedItem;
this.selectedIndex = oldSelectedIndex;

The other option seems to be tinkering around with the iterator property... But, judging by the way I've seen it used, that will get pretty harry pretty quickly too. So, how can I get the item at a particular index in an advanced datagrid without going insane?

View 3 Replies

Flex :: Get Item By Index In A Tree Control?

Jan 20, 2010

I'm doing a drag and drop operation on a tree using some help from Adobe's quick Starts:[URL]

The code suggested is roughly this:

var dropTarget:Tree = Tree(evt.currentTarget);
var i:int = dropTarget.calculateDropIndex(evt);
myTree.selectedIndex = i;

[Code].....

EDIT: I forgot to post that my current workaround is setting the selectedIndex = -1 after I get my node:XML. I'm afraid that if something bogs on the processor the user may see it select then deselect.

View 2 Replies

Flex :: Repeater Not Working Fine When Passed A Dataprovider (array) Having A Single Element?

Feb 24, 2011

I am using a Repeater in an Accordian which does not appear to see a single element in userArray. If I add another entry to userArray then the Repeater works fine.

private function currUsersServiceHandler(event:ResultEvent):void{
if (event.result.currentUsers != null)
{
if (event.result.currentUsers.user is ArrayCollection) // if more than one elements are present
{

[code]....

Edit:There is another thing I have just noticed i.e. that the accordian does show a single tab (when Array has a single element) but it's not labeled with the first name which I am setting. If I enter another user, two tabs appear and both are labeled with names I am setting. The first tab appears labeled too then.

View 1 Replies

Actionscript 3 :: Find The Index Of A Dropped Item In Flex?

Jul 14, 2011

How can I find the index of a item dropped into a list in flex using a spark list?

View 2 Replies

Flex :: Dispatching Custom Event From Repeater Component And Listen Event In Other Repeater Components

May 4, 2011

I have a repeater component with custom event. My repeater components fires custom event holding data. My need is to dispatch event so other repeater components can access data from dispatching component.

Edit: Added whole stuff here.

<!-- AttributeMapping.mxml -->
<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:fx="http://ns.adobe.com/mxml/2009"

[Code].....

View 1 Replies

Arraycollection - Flex 3 Removing Items From An Array Collection When The User Clicks A Button And Reflecting That In A Repeater

May 18, 2011

I have an arrayCollection with the following structure:

[Code]...

the AC is defined as follows:[Bindable] private var projectErrorsAC:ArrayCollection = new ArrayCollection;

I'm using this AC in a repeater to display each error. After each error is shown, I've placed an "Accept" and "Deny" button. Once the user clicks either one of these buttons, I'd like to call a function that removes the particular error from the AC. Here's what I have so far:

[Code]...

View 2 Replies

Flex :: Delete Item From Collection Bound To Datagrid And Update The Grid Selected Index

Feb 20, 2011

I have a datagrid with an xmlListCollection bound to it:

<mx:DataGrid id="dgCompetente" includeIn="Competente" x="10" y="66" width="547" height="468"
change="dgCompetente_changeHandler(event)" dataProvider="{colCompetente}"
editable="false">

[Code]......

I want the selectedIndex to remain the same. So, if I delete item 2, the next in the list should be selected. The problem is that if I delete item 2, item 3 will be selected and I have no idea why.

View 1 Replies

Flex :: Binding To An Specific Property Of Objects In An Array?

Jul 22, 2009

I am using Flex to create a small form. All I have at the moment is a List component, that I want to populate with a list of font names.I am getting the fonts using Font.enumerateFonts(true);. This returns an array of flash.text.Font objects.

The Font objects have a fontName property that is a String of that fonts name.My problem is that I can't figure out how to bind the List's dataProvider to the fontName property of each of the Font objects in the Array.Is there a way to do this just with binding? and not creating a new array of Strings by looping through the Font objects?

View 1 Replies

Show Item Index In My Item Renderer?

Mar 10, 2011

How to show the item index in my item renderer.Owner of the item renderer is TileList. [url],..

View 2 Replies

Flex :: Binding - Error In Getting Values From XML File To Array Collection?

Nov 15, 2010

I am trying display values in a datagrid in my application. I have all the values as an xml file. I had only one set of record n the XML file, to fill only one row of the data grid. While trying to store the values from the XML file to an Array Collection in the application File using the code, i.e.,

<mx:Model id="reviewList" source="assets/reviewList.xml"/>
<mx:ArrayCollection id="reviewlist" source="{reviewList.Item}"/>

I get an error, saying Error No# 1034: Type coercion failed cannot convert mx.utils::ObjectProxy to Array.But If I have two record sets in the XML file, it works fine. If there is only one set, I gHere is my xml file:

<ReviewList>
<Item>
<ReviewId>1123</ReviewId>

[code]....

View 6 Replies

Flash :: Get The Specific Array Index Based On Value Inside The Index's Object?

Jun 22, 2011

So, for sending to individual streams we have to reference the connected netStream we want to send to in some way like this:

sendStream.peerStreams[0].send("MyFunction",param1,param2);

and I have to determine which peer I'm sending to by their ID such as "peerID1234"

I know that you can check the peerID of the stream by doing:

sendStream.peerStreams[0]["farID"]

how can I make my send stream function know to use the array index where the peerID is?

so basically it could be like:

sendStream.peerStreams[where peerStreams[]["farID"] == peerID].send("MyFunction",param1,param2);

View 1 Replies

Flex :: Arraycollection - Assign An Index Of My Choice To Array Collection?

Dec 14, 2010

I want to give an array index to array collection let say 205 when it is started is it possible to do so in flex or any alternate of this.actually I need to index the objects with a specific no, in 2D array collection

say

205 a c d g f d
268 s g h g f f
805 d g h h f f d

where integers are indexes and alphabets are object referenced by these integers

View 2 Replies

Flex :: Binding To An MXML-esque "binding String"?

Oct 13, 2009

Is it possible to specify MXML-esque "binding strings" in ActionScript?For example, I want to be able to do something like:

MXMLBinding(this, "first_item",
this, "{myArrayCollection.getItemAt(0)");
MXMLBinding(this, ["nameLbl", "text"],

[code].....

View 6 Replies

Flex :: Binding Two Array Collection To Flex One Array Collection?

Oct 10, 2011

In my flex application im using two datagridfirst datgrid is for items collectionssecond is for bank details.if i click one row in first datagrid (which has the items collections)...a unique code is taken from the grid(which is primary key).then, i have to select two or more banks using itemrenderer checkboxes in second datagrid(which has the bank details)ow, have to bind the bank details(one or more banks) with that one primary key in first datagrid. to an single array collection... and have to show it in another new datagrid(thirdone)

View 1 Replies

Flex :: Removing Item From Array

Dec 14, 2010

I have 2 arrays & 2 checkbox repeaters: the second gets populated w/ items selected from the first. I can add the items no problem. How do I then delete the item if it gets deselected from the first checkbox repeater?

[Code]....

View 1 Replies

Flex :: 3: Using Array Item Value As An Objects Name

Aug 19, 2011

If I have a list of items in an array that represent the names of modules:

[Code]...

View 1 Replies

Flex :: Adding Item To An Array?

Dec 12, 2010

How do I add an item to a multidimensional array? I want to add the price to item2 but I get "push is not a function"

<fx:Script>
<![CDATA[
[Bindable]

[Code]....

View 1 Replies

Flex :: Detecting The Index Of Datagrid Row Affected By Change In Dataprovider (array Collection)

Feb 16, 2011

I have an array collection as the dataprovider to a datagrid. When I change a value in the arraycollection, a particular row gets updated in the datagrid. I want to get the index of that particular row. How do I get it?

View 1 Replies

Convert Lee 3D Carousel Tut To AS3 - How To Re-index Each Item Properly?

May 11, 2009

I've been trying yo convert Lee 3D carousel tut to AS3 and it pretty much there apart from one thing. I took Lee's as2 carousel 2 and applied what I know to convert it to AS3. I couldn't work out how to re-index each item properly. When the last item in the XML should appear under an item to it's left or right it does not due to numbers being rounded from the scaleX value being too close and causing the same number to be generated from more than one item therefore last item to be processed ending up on top. I've tried a few alternatives, but nothing has worked so far. Hopefully that makes to sense to someone.

If you download the files from Lee's tutorial http:[url].... open the fla, change the publish settings to Flash Player 9+ and AS3, remove all existing AS code, check the library item linkage as I've capitalized everything and add the following to the root timeline.The code causing the problem is this in the function mover:

Code: Select allvar index:int = Math.floor(mc.scaleX*10);
Code: Select allvar loader:URLLoader = new URLLoader();
loader.addEventListener(Event.COMPLETE, onLoaded);[code].............

View 3 Replies







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