# Control movie clip duration with an external config file?

**URL:** <https://forum.kirupa.com/t/control-movie-clip-duration-with-an-external-config-file/257362>\
**Category:** flash\
**Created:** [April 13, 2008, 9:15am UTC](https://forum.kirupa.com/t/control-movie-clip-duration-with-an-external-config-file/257362 "2008-04-13T09:15:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Calydon](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/calydon/32/682_2.png) [@Calydon](https://forum.kirupa.com/u/Calydon)\
**Post date:** [April 13, 2008, 9:15am UTC](https://forum.kirupa.com/t/control-movie-clip-duration-with-an-external-config-file/257362/1 "2008-04-13T09:15:58Z")

</div>

I have a stage with a few different movie clips placed one on top of the other, in different layers, one frame per clip. One is a day time scene, one a night-time scene, one is raining, one is just cloudy. I want to be able to change the duration they run before switching to the next clip, or maybe even prevent it from appearing (maybe if duration is set to ‘0’?).

I want to be able to make any adjustements to the clip lengths by simply editing a text or XML file.

Here is how I’m controlling the clip length now, although I’m open to better ways.

```auto
function sunnydayFrame() {                
    nextFrame(); 
    clearInterval(myTimer); 
}
myTimer = setInterval(sunnydayFrame, 8000); // calls the function to advance frame after 8 seconds

```

The next frame is the same except it is function rainydayFrame () and it is myTimer2 and so forth.

Thanks for any help you can provide,
