# \[FMX04\] Pass Dataset Variable

**URL:** https://forum.kirupa.com/t/fmx04-pass-dataset-variable/278838
**Category:** flash
**Created:** [January 6, 2009, 4:05pm UTC](https://forum.kirupa.com/t/fmx04-pass-dataset-variable/278838 "2009-01-06T16:05:13Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![asterix2x](https://avatars.discourse-cdn.com/v4/letter/a/f9ae1b/32.png) [@asterix2x](https://forum.kirupa.com/u/asterix2x)
#### Post date: [January 6, 2009, 4:05pm UTC](https://forum.kirupa.com/t/fmx04-pass-dataset-variable/278838/1 "2009-01-06T16:05:13Z")

</div>

I am trying to pass a dataset variable to display a specific category. Inside the filterFunc I have the following code which does not seem to work:

// Search by category  
\_global.\_filter = “username”;  
var \_category:String = String(item.\_global.\_filter);  
var \_categoryID:Number = \_category.indexOf(“true”);  
if (\_categoryID != -1) {  
return true;  
} return false;

This does not work, but if I use the following code, it will work fine:  
var \_category:String = String(item.username);  
var \_categoryID:Number = \_category.indexOf(“true”);  
if (\_categoryID != -1) {  
return true;  
} return false;

I am assuming I have to transform the string to an object, similar to how you access a button, but cannot get the syntax right. For example, to access a button (id) from a variable you use:

```
var my_btn = Eval(_name + "_btn");
// Based on the onPress Event, fire the search term 
my_btn.onPress = function(evt:Object) {
        // Add functionality here
}

```

Any help would be appreciated, thanks in advance
