# Getting variable from movie?

**URL:** <https://forum.kirupa.com/t/getting-variable-from-movie/185639>\
**Category:** Uncategorized\
**Created:** [April 14, 2006, 8:57pm UTC](https://forum.kirupa.com/t/getting-variable-from-movie/185639 "2006-04-14T20:57:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![stevek1977](https://avatars.discourse-cdn.com/v4/letter/s/7bcc69/32.png) [@stevek1977](https://forum.kirupa.com/u/stevek1977)\
**Post date:** [April 14, 2006, 8:57pm UTC](https://forum.kirupa.com/t/getting-variable-from-movie/185639/1 "2006-04-14T20:57:31Z")

</div>

frogive me, as i am still learning, and this might sound totally off the wall.

i need to get the filename of the movie that is being played and have it availble to me within a class.

i have a function that gets the name, but it doesnt work inside the class.

how would i get the filename of the movie that is playing from within the class and be able to use it as a variable?

* * *

this is the function i have been using to get the filename.

```auto
function movieName () 
{
    var url = new String (this._url);
    var p1 = url.lastIndexOf ("/") + 1;
    var p2 = url.length;
    return url.slice (p1, p2);
}

name = movieName();

```
