do it this way:
define your material here:

material mat_test
{
//can set flags and assign material skins if you need to
// flags = tangent;
// skin1=whatever...
}

then in a starter function:

starter
{
effect_load(mat_test,"mat_test.fx");
}

then in the action for your entity:
my.material=mat_test;