How to truncate ".jpg" of end of variable string

I create a loadJPG function that auto matically creates an mc.

I want the mc to have the same name as the jpeg without the extension, how can I truncate the “.jpg” off?

jpg = test.jpg

I want mc to = test

Ron

This should work:

normal = "h88.jpg";
modified = normal.substring(0, normal.lastIndexOf("."));
DynamicTextField.text = modified;

hope it helps! u just debug this code to suits u!

yours,
–h88

It seems that u didnt c my post, ill post that post to notify u 3dRON