[Flash8]Problems with return()

Hi! I’m new and not very good on english, sorry for that… :crying:

I’m using Flash8 with AS2.0

i’ve problem using a datagrid/dataset with the function:

my_ds.filterFunc = function(item:Object) {…

I’ve 5 information to control (price, town…)

for example, a person could want a house from 10000 to 20000 (price), in NY…

so I’ve have to ask my dataset the informations:

item.Price>pricemin && item.Price<pricemax;

item.Town == townset; etc…

one by one they works ando also if i write the function:

return(item.Price>10000 && item.Price<20000 && item.Town == “NY”…);

but when I’m trying to work dinamic with

var Pricing = “item.Price>pricemin && item.Price<pricemax”;
var Towning = " && item.Town == townset";

and then:

return (pricing+towning+…)

it doesn’t work!! :m:

probably is something wrong with the String() against the item:Object but I’m not so good to solve it…

there are too many combinations to write different functions with IF, ELSE IF…

so I’d like to have a system to mix the user’s choices with a single function

please HEEEELP ! :sen:

I’m not sure but I think the problem is you have to pass an object instead of a string.

for example:
my_object = {max_price:100,min_price:50,city:“NY”};

my_function(my_object);

Read the documentation to see what kind of object is that function expecting.