# Action script problem

**URL:** <https://forum.kirupa.com/t/action-script-problem/317016>\
**Category:** Uncategorized\
**Created:** [December 8, 2010, 3:49am UTC](https://forum.kirupa.com/t/action-script-problem/317016 "2010-12-08T03:49:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kalkidan\_Ferede](https://avatars.discourse-cdn.com/v4/letter/k/3da27b/32.png) [@Kalkidan\_Ferede](https://forum.kirupa.com/u/Kalkidan_Ferede)\
**Post date:** [December 8, 2010, 3:49am UTC](https://forum.kirupa.com/t/action-script-problem/317016/1 "2010-12-08T03:49:34Z")

</div>

Dear friends,

I have problem with flash action script,

I have four buttons, “home”, “services”, “demo”, “contact”, . the thing run good but, the animation focus(color change of a button) for both “home” and “services”, the focus stays on services either the user clicks the “home” or “service”.

I here put the code, the first one is for the "“home”, second for “service”, third “demo”, “fourth” contact.

on (rollOver)  
{  
if (\_root.link != 5)  
{  
this.gotoAndPlay(“s2”);  
} // end if  
}  
on (releaseOutside, rollOut)  
{  
if (\_root.link != 5)  
{  
this.gotoAndPlay(“s1”);  
} // end if  
}  
on (release)  
{  
if (\_root.link != 5)  
{  
if (\_root.g != 1)  
{  
\_root[“item” + \_root.link].gotoAndPlay(“s2”);  
\_root.link = 5;  
\_root.sp.gotoAndPlay(“s1”);  
\_root.b1.play();  
} // end if  
} // end if  
}  
on (release)  
{  
getURL(“index.html”, “”);  
}

on (rollOver)  
{  
if (\_root.link != 2)  
{  
this.gotoAndPlay(“s1”);  
} // end if  
}  
on (releaseOutside, rollOut)  
{  
if (\_root.link != 2)  
{  
this.gotoAndPlay(“s2”);  
} // end if  
}  
on (release)  
{  
if (\_root.link != 2)  
{  
if (\_root.g != 1)  
{  
\_root[“item” + \_root.link].gotoAndPlay(“s2”);  
\_root.link = 2;  
\_root.sp.gotoAndPlay(“s1”);  
\_root.b1.play();  
} // end if  
} // end if  
}  
on (release)  
{  
getURL(“index-2.html”, “”);  
}

on (rollOver)  
{  
if (\_root.link != 4)  
{  
this.gotoAndPlay(“s1”);  
} // end if  
}  
on (releaseOutside, rollOut)  
{  
if (\_root.link != 4)  
{  
this.gotoAndPlay(“s2”);  
} // end if  
}  
on (release)  
{  
if (\_root.link != 4)  
{  
if (\_root.g != 1)  
{  
\_root[“item” + \_root.link].gotoAndPlay(“s2”);  
\_root.link = 4;  
\_root.sp.gotoAndPlay(“s1”);  
\_root.b1.play();  
} // end if  
} // end if  
}  
on (release)  
{  
getURL(“demo.html”, “”);  
}

on (rollOver)  
{  
if (\_root.link != 6)  
{  
this.gotoAndPlay(“s1”);  
} // end if  
}  
on (releaseOutside, rollOut)  
{  
if (\_root.link != 6)  
{  
this.gotoAndPlay(“s2”);  
} // end if  
}  
on (release)  
{  
if (\_root.link != 6)  
{  
if (\_root.g != 1)  
{  
\_root[“item” + \_root.link].gotoAndPlay(“s2”);  
\_root.link = 6;  
\_root.sp.gotoAndPlay(“s1”);  
\_root.b1.play();  
} // end if  
} // end if  
}  
on (release)  
{  
getURL(“index-5.html”, “”);  
}

heeelp,

I appriciate all comments,

Urs,  
Kal
