# Actionscript problem

**URL:** <https://forum.kirupa.com/t/actionscript-problem/207529>\
**Category:** Uncategorized\
**Created:** [November 18, 2006, 4:39pm UTC](https://forum.kirupa.com/t/actionscript-problem/207529 "2006-11-18T16:39:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kmolleson](https://avatars.discourse-cdn.com/v4/letter/k/e99b99/32.png) [@kmolleson](https://forum.kirupa.com/u/kmolleson)\
**Post date:** [November 18, 2006, 4:39pm UTC](https://forum.kirupa.com/t/actionscript-problem/207529/1 "2006-11-18T16:39:04Z")

</div>

I have 2 different pieces of AS for my full flash homepage but i can’t get them to work at the same time properly. This first piece is to load random images onto an array on my homepage.

```auto
var myImages = ["IMG_1318.jpg", "IMG_1316.jpg", "IMG_1317.jpg"];
var rand = random(myImages.length);
loadMovie(this.myImages[rand], container);
//trace("image loaded is "+this.myImages[rand]);

stop();

```

that part is currently working as intended thanks to Cello for the stop bit. The problem is since the stop bit was added at the end my random image array works as intended but at the same time it also stops my clock. Here is the AS for my clock.

```auto
mytime = new Date();

s = mytime.getUTCSeconds();
m = mytime.getUTCMinutes();
h = mytime.getUTCHours();
month = mytime.getUTCMonth();

if (s < 10)
{
    seconds = "0" + s;
}
else
{
    seconds = s;
} 
if (m < 10)
{
    minutes = "0" + m;
}
else
{
    minutes = m;
} 

month2 = month + 1;

with (BaghdadTime) {
    
    if (month2 >= 4 && month2 <= 9)
    {
        bh = h + 4;
    }
    else
    {
        bh = h + 3;
    } 
    if (bh > 23)
    {
        bh = bh - 24;
    } 
    if (bh < 10)
    {
        hours = "0" + bh;
    }
    else
    {
        hours = bh;
        
    } 
    BTime = hours + ":" + minutes + ":" + seconds;
    _root.BaghdadTime.time = BTime;
}

with (WestCoastTime) {
    
    if (month2 >= 4 && month2 <= 10)
    {
        wh = h - 7;
    }
    else
    {
        wh = h - 8;
    }
    
    if (wh < 0)
    {
            wh = 24 + wh;
    } 
    if (wh < 10)
    {
        hours = "0" + wh;
    }
    else
    {
        hours = wh;
    } 
    WTime = hours + ":" + minutes + ":" + seconds;
    _root.WestCoastTime.time = WTime;
}

with (MountainTime) {
    
    mh = h - 6;
    
    if (mh < 0)
    {
        mh = 24 + mh;
    } 
    if (mh < 10)
    {
        hours = "0" + mh;
    }
    else
    {
        hours = mh;
    } 
    MTime = hours + ":" + minutes + ":" + seconds;
    _root.MountainTime.time = MTime;
}

delete mytime;
mytime = new Date();

```

is there something else simple i’m missing that will keep my clock working but not mess up my picture array?
