# MX|unspecified number of characters

**URL:** <https://forum.kirupa.com/t/mx-unspecified-number-of-characters/23108>\
**Category:** Uncategorized\
**Created:** [June 12, 2003, 9:49pm UTC](https://forum.kirupa.com/t/mx-unspecified-number-of-characters/23108 "2003-06-12T21:49:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hihabyte](https://avatars.discourse-cdn.com/v4/letter/h/4491bb/32.png) [@hihabyte](https://forum.kirupa.com/u/hihabyte)\
**Post date:** [June 12, 2003, 9:49pm UTC](https://forum.kirupa.com/t/mx-unspecified-number-of-characters/23108/1 "2003-06-12T21:49:46Z")

</div>

I don’t really know how to translate my problem in understandable text, but I’ll try.  
I want to be able to check if a filename ends with a specific word or string and if it does, something must happen.

EG: 2 movies: muse\_guitar.swf and audioslave\_guitar.swf  
If I load one of these movies into a movieclip in another swf, a script in that swf should check if the movie that has loaded, ends with the string \_guitar.swf and if it does, the guitar-menu must load, for example.

So I’m looking for something like:

```
    If loadedmovie = *&"_guitar.swf" then ...

```

but I don’t know the correct symbols or code that I should use.

Thanks for the help!🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 12, 2003, 10:53pm UTC](https://forum.kirupa.com/t/mx-unspecified-number-of-characters/23108/2 "2003-06-12T22:53:27Z")

</div>

why don’t you just define a variable in muse\_guitar.swf and audioslave\_guitar.swf?  
then you can check that variable and do whatever you need to do…

example:

```auto
// muse_guitar.swf and audioslave_guitar.swf first frame actions
var myVar = "guitar";
// in the other swf
myMovieClip.loadMovie("audioslave_guitar.swf");
if (myMovieClip.myVar == "guitar") {
// load guitar menu
}

```

however, you could try this:

```auto
myMovieClip.loadMovie("audioslave_guitar.swf");
var url = myMovieClip._url;
if (url.substr(url.lastIndexOf("_"), url.length) == "_guitar.swf") {
// load guitar menu
}

```

hope it helps… =)
