# Actionscript doesn't stop when going to next scene?

**URL:** <https://forum.kirupa.com/t/actionscript-doesnt-stop-when-going-to-next-scene/302029>\
**Category:** flash\
**Created:** [December 20, 2009, 11:28am UTC](https://forum.kirupa.com/t/actionscript-doesnt-stop-when-going-to-next-scene/302029 "2009-12-20T11:28:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![yarafashion](https://avatars.discourse-cdn.com/v4/letter/y/b5a626/32.png) [@yarafashion](https://forum.kirupa.com/u/yarafashion)\
**Post date:** [December 20, 2009, 11:28am UTC](https://forum.kirupa.com/t/actionscript-doesnt-stop-when-going-to-next-scene/302029/1 "2009-12-20T11:28:03Z")

</div>

Hello,

I’m working on a school project and now I need a little help.  
I put an actionscript to make a “matrix effect” on the timeline, but it won’t stop playing. It’s just repeating over and over again. Even when I’m going to a next frame. Is there a way to stop the script from playing?

This is the code from the “matrix effect”:

for (i=0; i\<=463; i++) {  
\_root.attachMovie(“digit”,“digit”+i,i);  
this[“digit”+i].the\_depth = i;  
}

and the digit movieclip has this code:  
// --------------------------------------  
// created by Adrian C. [www.adrianTNT.com](http://www.adrianTNT.com)  
// --------------------------------------  
//  
var text\_array:Array = Array(“0”, “1”, “2”, “3”, “4”, “5”, “6”, “7”, “8”, “l”, “m”, “n”, “o”, “p”, “\<”, “\>”, “!”, “`”, “@”, “#”, “$”, “%”, “^”, “&”, "_", “(”, “)”, “-”, “+”, “|”, “/”, “=”, “\_”, “,”, “[”, “]”, “{”, “}”, “:”, “;”);  
//var text\_array:Array = Array(“0”, “1”);  
text\_box.text = text\_array[random(text\_array.length)];  
//  
var matrix\_position:Array = Array();  
//  
counter = 0;  
counter\_limit = random(5)+3;  
//  
for (r=0; r\<=Stage.width/this.\_width; r++) {  
matrix\_position.push(r_this.\_width);  
}  
this.\_x = matrix\_position[random(matrix\_position.length-1)];  
this.\_y = random(Stage.height-this.\_height);  
this.speed = random(8)+8;  
rand\_scale = int(random(100));  
this.\_alpha = rand\_scale;  
this.\_xscale = rand\_scale;  
this.\_yscale = rand\_scale;  
//  
this.swapDepths(rand\_scale);  
//  
import flash.filters.BlurFilter;  
import flash.filters.GlowFilter;  
//  
var filter:GlowFilter = new GlowFilter(0x009999, rand\_scale+1, 10, 10, 3);  
var filterArray:Array = new Array();  
filterArray.push(filter);  
//  
var filter:BlurFilter = new BlurFilter((80-rand\_scale)/15, (80-rand\_scale)/15);  
filterArray.push(filter);  
this.filters = filterArray;  
//  
//  
this.onEnterFrame = function() {  
/\*  
// letters change during animation  
counter++;  
if (counter\>counter\_limit) {  
text\_box.text = text\_array[random(text\_array.length)];  
counter = 0;  
}  
\*/  
this.\_y += speed;  
if (this.\_y\>=Stage.height+this.\_height) {  
this.\_y = 0-this.\_height;  
}  
};
