Remove .jpg from an array

Hi there, I am using the code below to display the amount of images in an array, and the current image.

// show total number of images in the array

_root.curImage.text = (_root.image_array[this.i]);
_root.imageTotal.text = “/0”+_root.image_array.length;

It appears in a form like this: 024.jpg/060

Is there a quick and easy way to remove the .jpg so it just reads 024/60, have tried looking around but it is a kind of abstract thing to search for and I am still fairly new to arrays

Thanks in advance,

SH

Look up for the “slice” method (shift+F1 to pop the reference help).

But I’m guessing it’d be easier to take the .jpg out directly out of your array…
Why don’t you just use numbers for your photos and use something like (cause I guess it’s a loadmovie you’re using…) :

holder.loadmovie(_root.image_array[this.i]+".jpg")

Good luck.

Cheers Pomme, by flipping over the logic it makes so much more sense.

I used the second method. I had an inkling that you could use slice too from some of the searches - will look it up as I get deeper into arrays.

So took the steps you suggested and it works like a dream and suddenly things make much more sense! Now I don’t need to put .jpg after every image in the text array, and I’m sure this will help me get the back and next buttons working.

Thanks for helping me take the next step, top forum.

SH