# Changing color of movieclip depending on the current url \_root.\_url.indexOf

**URL:** <https://forum.kirupa.com/t/changing-color-of-movieclip-depending-on-the-current-url--root--url-indexof/264024>\
**Category:** Uncategorized\
**Created:** [June 22, 2008, 9:09am UTC](https://forum.kirupa.com/t/changing-color-of-movieclip-depending-on-the-current-url--root--url-indexof/264024 "2008-06-22T09:09:20Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![crystalmedia](https://avatars.discourse-cdn.com/v4/letter/c/f08c70/32.png) [@crystalmedia](https://forum.kirupa.com/u/crystalmedia)\
**Post date:** [June 22, 2008, 9:09am UTC](https://forum.kirupa.com/t/changing-color-of-movieclip-depending-on-the-current-url--root--url-indexof/264024/1 "2008-06-22T09:09:20Z")

</div>

Hi,

I`m trying to set-up a script that changes the color of a movie clip, depending on the current url of the page… My code is:

```auto
var link = "http://localhost/v-v/indexSRP.php?kategorija=";
var link2 = "http://localhost/v-v/index.php?kategorija=";

if (_root._url.indexOf(link + "3") == 0) {
    var slogani = new Color("_root.slogan.pozadina.boja");
    slogani.setRGB(0xEC7702);
}
if (_root._url.indexOf(link + "4") == 0) {
    var slogani = new Color("_root.slogan.pozadina.boja");
    slogani.setRGB(0xF2DA04);
}
if (_root._url.indexOf(link + "5") == 0) {
    var slogani = new Color("_root.slogan.pozadina.boja");
    slogani.setRGB(0x97BD00);
}
if (_root._url.indexOf(link + "6") == 0) {
    var slogani = new Color("_root.slogan.pozadina.boja");
    slogani.setRGB(0x069B9A);
}
if (_root._url.indexOf(link + "7") == 0) {
    var slogani = new Color("_root.slogan.pozadina.boja");
    slogani.setRGB(0x9E774B);
}

if (_root._url.indexOf(link2 + "10") == 0) {
    var slogani = new Color("_root.slogan.pozadina.boja");
    slogani.setRGB(0xEC7702);
}

if (_root._url.indexOf(link2 + "11") == 0) {
    var slogani = new Color("_root.slogan.pozadina.boja");
    slogan.setRGB(0xF2DA04);
}
if (_root._url.indexOf(link2 + "12") == 0) {
    var slogani = new Color("_root.slogan.pozadina.boja");
    slogani.setRGB(0x97BD00);
}
if (_root._url.indexOf(link2 + "13") == 0) {
    var slogani = new Color("_root.slogan.pozadina.boja");
    slogani.setRGB(0x069B9A);
}
if (_root._url.indexOf(link2 + "14") == 0) {
    var slogani = new Color("_root.slogan.pozadina.boja");
    slogani.setRGB(0x9E774B);
}

```

Any kind of help is much appreciated,  
Thanks

---

<div class="post-metadata">

**Author:** ![crystalmedia](https://avatars.discourse-cdn.com/v4/letter/c/f08c70/32.png) [@crystalmedia](https://forum.kirupa.com/u/crystalmedia)\
**Post date:** [June 23, 2008, 9:04am UTC](https://forum.kirupa.com/t/changing-color-of-movieclip-depending-on-the-current-url--root--url-indexof/264024/2 "2008-06-23T09:04:36Z")

</div>

anyone?

---

<div class="post-metadata">

**Author:** ![randomagain](https://avatars.discourse-cdn.com/v4/letter/r/35a633/32.png) [@randomagain](https://forum.kirupa.com/u/randomagain)\
**Post date:** [June 23, 2008, 9:18am UTC](https://forum.kirupa.com/t/changing-color-of-movieclip-depending-on-the-current-url--root--url-indexof/264024/3 "2008-06-23T09:18:24Z")

</div>

it make more sense if you set up a variable dependant on the page it was on then tested that

ie, goto page 2

variable = 2

though what you are trying to do should in thoery be possible

---

<div class="post-metadata">

**Author:** ![crystalmedia](https://avatars.discourse-cdn.com/v4/letter/c/f08c70/32.png) [@crystalmedia](https://forum.kirupa.com/u/crystalmedia)\
**Post date:** [June 23, 2008, 1:19pm UTC](https://forum.kirupa.com/t/changing-color-of-movieclip-depending-on-the-current-url--root--url-indexof/264024/4 "2008-06-23T13:19:20Z")

</div>

Im didnt quite understand what you tried to say… Can you please explain this one is killing me…[quote=randomagain;2347498]it make more sense if you set up a variable dependant on the page it was on then tested that

ie, goto page 2

variable = 2

though what you are trying to do should in thoery be possible[/quote]

---

<div class="post-metadata">

**Author:** ![randomagain](https://avatars.discourse-cdn.com/v4/letter/r/35a633/32.png) [@randomagain](https://forum.kirupa.com/u/randomagain)\
**Post date:** [June 23, 2008, 1:59pm UTC](https://forum.kirupa.com/t/changing-color-of-movieclip-depending-on-the-current-url--root--url-indexof/264024/5 "2008-06-23T13:59:41Z")

</div>

_bites down on pill then foams at mouth_

---

<div class="post-metadata">

**Author:** ![lkky00245](https://avatars.discourse-cdn.com/v4/letter/l/d78d45/32.png) [@lkky00245](https://forum.kirupa.com/u/lkky00245)\
**Post date:** [June 23, 2008, 3:49pm UTC](https://forum.kirupa.com/t/changing-color-of-movieclip-depending-on-the-current-url--root--url-indexof/264024/6 "2008-06-23T15:49:29Z")

</div>

If games like usfine sell [buy wow goldQuake and Doom defined action gaming in the gaming world, Need for Speed was the definition of racing games. Need For Speed, [url=http://www.usfine.com/Maple-Story-PowerLeveling-c-98.html]maple story power levelingor NFS for short has been around since almost the beginning of when computer gaming gained importance. [url=http://www.usfine.com/runescape-powerleveling-c-90.html]runescape power levelingNeed For Speed is [url=http://www.usfine.com/runescape-powerleveling-c-90.html]runescape powerleveling a racing game in which the player chooses cars and then races on various tracks. It was and is highly playable due to the simplicity of controls and existence of a thin progressive knack in the game. [url=http://www.usfine.com/runescape-powerleveling-c-90.html]runescape](http://www.usfine.com/world-of-warcraft-usa-c-51.html)

---

<div class="post-metadata">

**Author:** ![crystalmedia](https://avatars.discourse-cdn.com/v4/letter/c/f08c70/32.png) [@crystalmedia](https://forum.kirupa.com/u/crystalmedia)\
**Post date:** [June 23, 2008, 4:44pm UTC](https://forum.kirupa.com/t/changing-color-of-movieclip-depending-on-the-current-url--root--url-indexof/264024/7 "2008-06-23T16:44:27Z")

</div>

😑
