Ask a Question related to Macromedia Flash Actionscript, Design and Development.
-
hoz #1
populating an array with a conditional
Hey guys,
I'm trying to populate an array based on an if condition. Each time the
function is initialized, I want to clear the array before looping the if
equation. Below is my code. Suggestions:
var downloads:Array = new Array();
function downloadSongs(){
downloads.splice(0);
for(var i=0; i<list_lb.length; ++i){
if(list_lb.getItemAt(i).label.indexOf("Downloads") {
downloads.push(list_lb.getItemAt(i).label)
}
}
downloads_lb.dataProvider = downloads;
}
The list_lb is a component shopping cart with song titles and many other
things. Those titles with only Download (My Song Download), should be added to
the new array. Maybe I can't do a indexOf with the component, so perhaps
convert to text first?
Thanks for your help,
Hoz
hoz Guest
-
populating a datagrid from an array
Here is the situation: I have a datagrid that is being populated from a database, with anywhere from 1 to 3 columns showing depending on how many... -
Populating an array with a list of values
I have performed a cfhttp request, the results of which are in a variable called FoundString. Found String consists of a list of website links, I... -
Conditional Table Row
I have a query that has records that have a group value: Group A, Group B, Group C, etc. I want to have a repeating region conditionally show the... -
Conditional sum?
FMP6, MacOSX.2 I've created a calc field using the aggregate Sum(score) to give me a "total points scored" for all related records in a... -
Conditional Value Lists
While browsing the Techinfo database on the web for the contents of the FileMaker Developer CD, I encoutered a folder describing an example of... -
hoz #2
populating an array with a conditional
Hey guys,
I'm trying to populate an array based on an if condition. Each time the
function is initialized, I want to clear the array before looping the if
equation. Below is my code. Suggestions:
var downloads:Array = new Array();
function downloadSongs(){
downloads.splice(0);
for(var i=0; i<list_lb.length; ++i){
if(list_lb.getItemAt(i).label.indexOf("Downloads") {
downloads.push(list_lb.getItemAt(i).label)
}
}
downloads_lb.dataProvider = downloads;
}
The list_lb is a component shopping cart with song titles and many other
things. Those titles with only Download (My Song Download), should be added to
the new array. Maybe I can't do a indexOf with the component, so perhaps
convert to text first?
Thanks for your help,
Hoz
hoz Guest



Reply With Quote

