How to explode in Flash mx?

Hi all,

I am stuck with the following.


textData = new LoadVars ();
textData.load ("textFiles/"+ dir +".txt?noCache="+new Date().getTime());

And the dir value is used like


<PARAM NAME=FlashVars value="dir=product_a">

I use the var dir in a couple of .swf’s. But now i need to “exploder” the dir value so i get just the first word. In this case “product”. I know how to do it in php, but not in flash mx.

Thnks in advanced

I am looking at substring(), substr(), splice() and split() right now

hmmm,

Why does this not work


testFile = dir.split("_");

textData = new LoadVars ();
textData.load ("textFiles/"+ testFile[0] +".txt?noCache="+new Date().getTime());

Oops
it did work