Ask a Question related to Macromedia Flex General Discussion, Design and Development.
-
pope on acid #1
loop through array to build a new array
If I combine the following 2 functions (accesses by clicking a checkbox), as
result the new array does not contains all items that matches the checkboxes I
selected.
private function clickHandler(event:Event):void
{
//Empty filtered array
selectedOffers.removeAll();
var selCheckbox:CheckBox = CheckBox(event.target);
selCheckboxName = selCheckbox.id;
selCheckboxName = selCheckboxName.substring(1);
// If a checkbox has been selected, we add the corresponding
categoryId to the selectedCategories array.
selCatId = selCheckbox.id.substring(1);
if (selCheckbox.selected){selectedCategories.addItem( selCatId);}
else {
// If a checkbox has been unselected, we remove it from the
selectedCategories array.
var l:int = selectedCategories.length;
for (var i:int; i < l; i++)
{
if (selectedCategories.getItemAt(i) == selCatId)
{
selectedCategories.removeItemAt(i);
break;
}
}
}
if(selectedCategories.length > 0)
{
//Call Category filter
getOffersByCategories(selectedCategories);
}
else
{
selectAll();
}
}
private function getOffersByCategories(selCats:ArrayCollection):voi d
{
var iC:int;
var iSO:int;
while (iC <= selCats.length)
{
while (iSO < Offers.length)
{
if(Offers[iSO].categories.search(selCats[iC]) != -1)
{
selectedOffers.addItem(Offers[iSO]);
}
iSO++;
}
iC++;
}
grdOffers.dataProvider = selectedOffers;
}
pope on acid Guest
-
How to build array from ASP result with HTTPService
Hello, It's driving me crazy because it's probably something little I'm doing wrong. What I want to do is put the result of get.asp into an... -
cannot loop the array
I have 2 questions regarding arrays: 1) we need to define the size of the array, there is no dynamic array concept? i.e. the following define the... -
Array Loop
Please help me to debug: <cfquery name="qSelectPwd" datasource="#Application.AppDSN#"> select password from tablename </cfquery> <!---... -
Build multidimensional array from arrays
Hello everyone, I have: @one = qw(A B C D); @two = qw(E F G H); I want to build a multidimensional array from the above arrays. I want to... -
array data matches but array created in loop doesn't work
I have the exact same data in two arrays, but only the array created like so will work: $spaw_imglibs = array( array( 'value' =>...



Reply With Quote

