# Help: ordered data set

**URL:** https://forum.kirupa.com/t/help-ordered-data-set/57941
**Category:** Uncategorized
**Created:** [July 18, 2004, 1:25am UTC](https://forum.kirupa.com/t/help-ordered-data-set/57941 "2004-07-18T01:25:02Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Veryfine007](https://avatars.discourse-cdn.com/v4/letter/v/b9e5f3/32.png) [@Veryfine007](https://forum.kirupa.com/u/Veryfine007)
#### Post date: [July 18, 2004, 1:25am UTC](https://forum.kirupa.com/t/help-ordered-data-set/57941/1 "2004-07-18T01:25:02Z")

</div>

I’m creating a timeline to stop a movieclip at specific times.

Using setInterval I’d like to use an if statement to pause my movieclip at each of the times indicated by variableTimes:

variableTimes = [15, 20, 25];  
if(myTimer=variableTimes){  
myMovie.stop();

However, I can’t seem to figure out how to give variableTimes three independent variables. Help?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 18, 2004, 2:39am UTC](https://forum.kirupa.com/t/help-ordered-data-set/57941/2 "2004-07-18T02:39:21Z")

</div>

variableTimes = [15, 20, 25];  
for(i=0,i\<=variableTimes.\_length-1,i++){  
if(myTimer==variableTimes\*){  
myMovie.stop();  
}  
}

please note the “==” this compares variables  
"=" is used to set variables

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 18, 2004, 4:28am UTC](https://forum.kirupa.com/t/help-ordered-data-set/57941/3 "2004-07-18T04:28:11Z")

</div>

thanks. the function makes sense and it should work but i’m getting an error regarding my brackets and I don’t know why. this is what i have placed in the frame. Do you have any idea why it’s not working?

myTimer = setInterval(countDown, 1000);  
displayTime = 46;  
mouthTimes1=[6,15,29,35];  
mouthTimes2=[8,17,31,37];  
countDown = function(message){  
displayTime–;  
}  
for(i=0,i\<=mouthTimes1.\_length-1,i++){  
if(myTimer==mouthTimes1\*){  
\_parent.stop();  
}}  
for(i=0,i\<=mouthTimes2.\_length-1,i++){  
if(myTimer==mouthTimes2\*){  
\_parent.gotoAndPlay(\_currentframe+1);  
}}

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 19, 2004, 7:32am UTC](https://forum.kirupa.com/t/help-ordered-data-set/57941/4 "2004-07-19T07:32:09Z")

</div>

if thats a direct copy and paste of the code I dont see any reason it gives an error, what I would do here is try putting the “}}” on seperate lines…or maybe use the autoformat thing in the actionscript window, it usually makes errors pretty apparent.

If you can locate the error upload the fla, or pm it to me if youre worried about it being stolen.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 21, 2004, 12:16am UTC](https://forum.kirupa.com/t/help-ordered-data-set/57941/5 "2004-07-21T00:16:04Z")

</div>

Hey, no problem, I wasn’t paying attention to semi-colons.

for(init; condition; next){}

instead of

for(init, condition, next){}
