# Play movie based on IF condition

**URL:** <https://forum.kirupa.com/t/play-movie-based-on-if-condition/316741>\
**Category:** flash\
**Created:** [December 1, 2010, 11:03am UTC](https://forum.kirupa.com/t/play-movie-based-on-if-condition/316741 "2010-12-01T11:03:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![MAKDXB](https://avatars.discourse-cdn.com/v4/letter/m/ebca7d/32.png) [@MAKDXB](https://forum.kirupa.com/u/MAKDXB)\
**Post date:** [December 1, 2010, 11:03am UTC](https://forum.kirupa.com/t/play-movie-based-on-if-condition/316741/1 "2010-12-01T11:03:52Z")

</div>

Hi,

I trying to play different movies based on the day detected by script.  
Script works fine and plays right movie. But as soon as i insert any graphics / animation from library; script stops working.

Is there any known bug with might be causing this or am i missing something ?

thanks  
M

```auto
var todaydate = new Date ();
var dayname = todaydate.getDay();
if (dayname == 4){
 gotoAndPlay ("Thursday");
}
if (dayname == 5){
 gotoAndPlay ("Friday");
}
if (dayname == 6){
 gotoAndPlay ("Saturday");
}
if (dayname == 1){
 gotoAndPlay ("Monday");
}
if (dayname == 2){
 gotoAndPlay ("Tuesday");
}
if (dayname == 3){
 gotoAndPlay ("Wednesday");
}

```
