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


Similar Posts:


Flex :: AS3 - Removing Objects By Array Item Reference

Jan 2, 2010

I am trying to add some Sprite objects as the contents of an array, and I would like to be able to "clear" them from the stage. I would assume that if there are loaders involved, I need to do
_imgArray[i].close();
_imgArray[i].unload();

And if I am using a sprite, I can do:
removeChild(_imgArray[i]);
None of the above work.

Currently I try:
for(i = 0; i < _localXML.length(); i++) {
var tmp:BMLink = new BMLink(_localXML[i], _bw, _bh, i);
_imgArray[i] = tmp;
_imgArray[i].x = (_bw + _mainpad) * i;
_base.addChild(_imgArray[i]);
But this doesn't work.

The class instances that are populating the array are all extending sprite, but they have their own individual loaders inside w/ progress events etc.

View 2 Replies

ActionScript 3.0 :: Removing A Specific Item From Array?

May 6, 2009

I am having an array of movieclips and when my circle(controlled with the keyboard) hitTests true with one of the movieclips inside that array i want to remove that movieclip from the array so when i hitTest it again it returns false (I hitTest using a "for in" with that array).How do i remove a specific item from within an array?

View 9 Replies

ActionScript 3.0 :: Removing Specific Item From An Array Without Splice?

Jan 23, 2010

I have an unordered ever-changing array that looks something like this:

12,23,1,4,11

I just want to basically tell the code to remove a specific item, let's say "23". But since the array is constantly changing length, I can't use splice.I also can't have any gaps, such as "12,,1,4,11". It must return "12,1,4,11".And on a related note, can I then check if this array has the same content of numbers as another array (and do I have to put them both in numeric order before it can perform the check, or doesn't it matter that they're not in the same order, as long as they have the same contents)?

View 8 Replies

Flex :: Removing All Iterates Through Each Item In List

Mar 12, 2011

When would you want to use removeAll() vs just new ArrayCollection when you want to clear an array collection. Remove all iterates though each item in the list. I can't see a case when I would want to use it.

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 :: How To Validate (Phone Number) Each Array Item

Nov 17, 2009

var str:String=cntslst.text;
var results:Array = str.split(",");
for(i=0;i<result.length;i++)
{<mx:NumberValidator source="{result[i]}" property="text" id="cell" />}
Is it possible ?

View 1 Replies

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

ActionScript 3.0 :: Flex Removing Duplicates From An Array Doesn't Work?

Sep 11, 2010

I've been trying to remove duplicates from an array for a while, or even preventing them, and I'm having nothing but trouble.There's a lot of code to go through.I'm creating an array with objects inside it like so...

Code:
private function getJsonResult(event:Event):void {
//ta.text+=http.lastResult;

[code].....

View 2 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

ActionScript 3.0 :: Objects - Removing The Item From The 3D Space

Dec 10, 2008

I've created a navigation system using Flash 3D functionality. It consists of a MovieClip with a rounded rectangle + a text with no-antialias bitmap font. I'm using Tweener to modify the z co-ordinates of the mc to make it "slide onto" the stage. However when the mc is completed animating it is notably blurry (the text at least). I was wondering if it might just be because it's in 3D-space the perspective (which hasn't been modified) is throwing the rendering off. So onComplete of the animation I try assigning null to the z-value in hopes of removing the item from the 3D space. I've attached the package code I'm using to create and animate the navigation feature.

View 1 Replies

ActionScript 3.0 :: Get Array Position Of Clicked Item To Fetch String From Another Array?

Mar 23, 2010

I put my mc's in an array.I have another array with strings.when the mc is clicked I want to get its position in the mc array and return the string from the same position in the string array.How do I do that?

PHP Code:
var numBtnArray:Array = new Array;
function addNumButtonsToStage():void{

[code].....

View 4 Replies

Flex :: Select Item In Details Form Dropdown When Datagrid Item Is Selected

Feb 15, 2011

I have this datagrid:

<mx:DataGrid id="dgCompetenteN" includeIn="Test" left="10" right="472" top="69" bottom="149"
dataProvider="{colCompetente}" editable="false">
<mx:columns>

[Code]....

What I want to do is, when I select an item in the datagrid, the selected item of the dropdown should be the correct one (the one which has the field idCompSuperioara equal to the third element in the selected datagrid row).

View 1 Replies

Flex :: Get List Item Selection Working When Using A Png Mask In An Item Renderer In A 4.5 Mobile App?

Jun 10, 2011

I'm creating a mobile app in which I need to show a calendar with months at the top. The months are part of a component that extends from SkinnableDataContainer (and has some custom scrolling/behaviour - which is why I did'nt use a spark list). I need the months to be shown as a 'trapezium' shaped tab and so I'm using a png image as a mask in the item renderer for the component.

When the mask is not applied, it all works well - the months render, the list/data container selection works when I click on a month and so on.When the mask is applied, it renders well, scrolling and everything else seems to work well - but when I click on a month, nothing happens visually. And from the trace statements in my code, it appears list item selection is not changing. Looks like mouse clicks are not working.

Code:

public class TopCalendarMonthRenderer extends LabelItemRenderer {
[Embed(source="/assets/trapezium_alpha.png")]
private static var TrapeziumMask:Class;
private static var trapeziumMaskInstance:BitmapAsset;

[code]...

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

Flex :: Toggling States - When Other Item Is Selected The First Item Does Not Change Its State?

Apr 26, 2011

I have used states in my application.The thing is I have made the first item in my list to be selected. so I gave like this,

if(itemIndex == 0)
this.currentState="selected";

this works fine.The problem is when other item is selected the first item does not change its state,it remains in the selected state until its clicked.My code looks like this,

<s:BorderContainer id="outerCont" width="275" height="100" borderVisible="false"
backgroundColor.normal="#3D3C3C" backgroundAlpha.selected="0.1"
backgroundColor.selected="{data.color}">

My states are like this,

<s:states>
<s:State name="normal" />
<s:State name="hovered" />[code]........

View 1 Replies

Flash :: Prevent An Item From Being Added To An Array If It Already Exists In The Array

Jun 22, 2011

I know how to remove duplicates from an array, but what I'm trying to do is prevent an item from ever being added to an array in the first place if it already exists. I'm pulling in data from an xml feed in a loop, and I thought that searching for that values index would work, but no matter what, the index is always -1. Here's my code:

[Code]...

Maybe I'm misunderstanding the indexOf function, but I thought it was supposed to return -1 if a value did not exist in an array. What am I doing wrong?

View 4 Replies

Actionscript 3 :: Trigger Flex Piechart Item Click Event When A Datagrid Item Is Clicked?

Nov 4, 2011

Is it possible to trigger Flex Piechart Item click event when a Datagrid Item is clicked.If so can anyone give some example.

View 3 Replies

ActionScript 3.0 :: Access Array In Arraycollection And Add Item To The End Of Array?

Aug 24, 2010

I have this code to try to acess the values of the array in the arraycollection but it does not work it actually creates a value to the end of the arraycollection. can anyone tell me what im doing wrong i basically whant to modifys the individual arrays in the arraycollection and add Login_user.

Code:
for(var i:int = 0; i< dispArray.length; ++i){
dispArray.addItemAt({"login_user":"XXX"},i);
}

View 1 Replies

ActionScript 3.0 :: Removing A Value From An Array?

Apr 10, 2010

It's a simple self-checkout grocery thing and I want to list the items the user is "buying" after typing in the appropriate code, but I can't get it to stay at nine lines only in the dynamic text field. I was told to use array.shift() to get rid of the first value in the two arrays so that I have an easy way by keeping the arrays at nine values, but it doesn't seem to work right.. It'll get rid of the first value, but only once and it'll add a blank value and then continue happily adding to the length of the array. Google has failed me so far so I suspect it's something else in my code.[code]

View 1 Replies

ActionScript 2.0 :: Removing Value From Array?

Mar 28, 2005

The as dictionary tells me I can use array.splice to remove an element from an array like so

Code:

var myPets_array:Array = new Array("cat", "dog", "bird", "fish");
trace( myPets_array.splice(1) ); // dog,bird,fish
trace( myPets_array ); // cat

Which is all fine an dandy, but what if I want to use a value instead of the index number?

like:

Code:
var myPets_array:Array = new Array("cat", "dog", "bird", "fish");
trace( myPets_array.splice("cat") ); // dog,bird,fish

[code]...

View 1 Replies

IDE :: Removing Duplicate Value In An Array?

Oct 26, 2009

I have an array containing single alphabet in every index and some of them in the array are duplicates. I'm trying to pick an alphabet and if there is an alphabet in that array, I want it remove from the array.

so lets say if i have 3 "a" in the array, I want all 3 to be remove. But my function only remove one alphabet. How do i make it remove all 3?

Also another question is, if i reach the end of the array how to i remove it? if i use splice it doesnt seem that it will remove the last item in the array.

my code is very simple

for (var i:int = 0; i<alphabetArrayLength; i++) {
if (singleAlphabet_arr[i] == alphabetPicked) {
answer = singleAlphabet_arr.splice(i,1);
}
}

View 1 Replies

ActionScript 3.0 :: Removing With An Array?

Jan 2, 2011

the button is added in Land():

Code:
function land():void
{
if(ship.xVel==0 && ship.yVel==0 && rocks.x>50 && rocks.x<350 && rocks.y>311 && rocks.y<319)
{

[Code]...

View 7 Replies

ActionScript 2.0 :: Removing Value From Array

Mar 28, 2005

The as dictionary tells me I can use array.splice to remove an element from an array like so

[Code]...

View 1 Replies

Actionscript :: Get A Menu Item's Width Before Displaying The Menu Item In Flex?

Mar 11, 2011

I'm trying to get the menu width of a menu item in flex 4. I can get it but I have to show the menu first, then hide the menu, do a calculation, and show it again. Is there an easier way to get the item menu width without this hassle?

View 1 Replies

ActionScript 3.0 :: How To Add Item To Array

Aug 27, 2009

I want to know if there is a method or some code to add new items to an array, but it want the items have the name of the buttons's instance name, or the label's name, so when i push the button, it adds its name to an array. Here is my code:

ActionScript Code:
tauri.addEventListener(MouseEvent.CLICK, addAddress);
abydos.addEventListener(MouseEvent.CLICK, addAddress);
tollana.addEventListener(MouseEvent.CLICK, addAddress);
dialNow.addEventListener(MouseEvent.CLICK, dialTo);
var tauriAddress:Array = ["tauri","abydos"];
var newAddress:Array = new Array();
function addAddress(event:MouseEvent):void {
newAddress.push();

I don't know if I should use the push method here, tell me what to put here for adding the instance name of the button to the array
trace(newAddress);
}

View 3 Replies

ActionScript 2.0 :: Sum Up Item In Array?

Jul 25, 2004

below is my script,to sum up the number in my array....but the output is all the numbers in array and not the sum up numbers....

CorrectMark =correctArray[0]+correctArray[1]+correctArray[2]+ correctArray[3]+ correctArray[4];
display.text=CorrectMark;

View 2 Replies

ActionScript 3.0 :: Add An Item To An Array?

Mar 19, 2010

I'm trying to add an item to an array, but when I do, it keeps the results (prizeField) from before and adds the new ones to it. i.e. at the beginning if I push a string to the array I have 4 items. If I push another, I then have 9. Then 15 and so forth. Here is my code:

Code:
var myFlexParent:Object;
var prizeArray:Array = ["apples", "bananas", "cranberries"];
var textFormat:TextFormat = new TextFormat("Cairo", 48);[code].....

I know that I need some sort of removeChild() in there, but I cannot get it to actually work.

View 1 Replies

ActionScript 3.0 :: Removing Clips Using Array?

Dec 5, 2011

If I use array to reference clips, what's the best way to remove the clips using that arrayHere's the basic example code with a way that seems to work. I want to know the best/proper way to remove from memory

Code:
var arrayListItems:Array = new Array();
function loadList(){

[code].....

View 4 Replies







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