Current location: Hot Scripts Forums » General Web Coding » Flash & ActionScript » How do I stop an actionscript from playing?


How do I stop an actionscript from playing?

Reply
  #1 (permalink)  
Old 01-26-10, 04:40 AM
Yarafashion Yarafashion is offline
New Member
 
Join Date: Jan 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
How do I stop an actionscript from playing?

Hello everyone,

I need your help. I've already searched for a couple of weeks now and I just can't make it work.
I've copy-pasted a code that generates an "matrix" effect in my flash movie.
I've also made two scenes.
The first scene contains the matrix script, the second one just a plane black background.
So.. I play the script in the first scene and want it to stop when I go to the second scene.
When I put a stop(); command in the timeline it still keeps playing in the first AND second scene.

The question is: How can I stop the actionscript in Scene 1 before I go to Scene 2?

This is the script I'm talking about (found here):

In the timeline this code is used:

for (i=0; i<=463; i++) {
_root.attachMovie("digit","digit"+i,i);
this["digit"+i].the_depth = i;
}

In the "digit" object they wrote this code:

// --------------------------------------
// created by Adrian C. adrianTNT.com - Flash design
// --------------------------------------
//
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;
}
};
Reply With Quote
  #2 (permalink)  
Old 03-04-10, 03:18 AM
CodeRobber's Avatar
CodeRobber CodeRobber is offline
Newbie Coder
 
Join Date: Feb 2010
Location: Leicestershire UK
Posts: 19
Thanks: 0
Thanked 2 Times in 2 Posts
have you tried stopping the actual object?

If it has an instance name try digit.stop();
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I get a movieclip on the main stage to stop playing? etabetapi Flash & ActionScript 1 07-01-08 05:14 PM
How to get user input from actionscript to PHP? aizen86 Flash & ActionScript 2 08-29-07 10:49 AM
Flash audio clip playing TOO fast. t49518 Flash & ActionScript 0 05-12-07 09:08 PM
Need Your HelP! Loading Multiple External Text into Multiple Dynamic Text Fields Flash_Boi Flash & ActionScript 2 03-30-06 03:27 PM


All times are GMT -5. The time now is 06:48 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.