2 Replies - 13306 Views - Last Post: 11 May 2011 - 02:55 AM

#1 mjrdesign  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 3
  • Joined: 10-May 11

AS2 - I want to put this movie clip behind my text but it isnt working

Posted 10 May 2011 - 10:30 AM

I tried playing around with the this.switchdepth but it didn't work. Any other suggestions?

This is the first movie clip code - calling out the other movie clip

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



This is the second code

//var text_array:Array = Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "x", "y", "z", "?", "<", ">", "!", "`", "@", "#", "$", "%", "^", "&", "*", "(", ")", "-", "+", "|", "/", "=", "_", ",", "[", "]", "{", "}", ":", ";");
var text_array:Array = Array("0", "1","3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "x", "y", "z");
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-0)];
this._y = random(Stage.height-this._height);
this.speed = random(8)+4;
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(0x00ccff, rand_scale+10, 5, 5, 0.5);
var filterArray:Array = new Array();
filterArray.push(filter);
//
var filter:BlurFilter = new BlurFilter((100-rand_scale)/10, (100-rand_scale)/10);
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;
	}

};


This post has been edited by lordofduct: 11 May 2011 - 06:28 AM
Reason for edit:: Edited by Forum Leader to include code brackets, please use them in the future.


Is This A Good Question/Topic? 1
  • +

Replies To: AS2 - I want to put this movie clip behind my text but it isnt working

#2 lordofduct  Icon User is offline

  • I'm a cheeseburger
  • member icon


Reputation: 2538
  • View blog
  • Posts: 4,641
  • Joined: 24-September 10

Re: AS2 - I want to put this movie clip behind my text but it isnt working

Posted 10 May 2011 - 06:28 PM

there is no 'the_depth' property to be setting.

In AS2 you should use the 'swapDepths' method.

http://help.adobe.co..._LangRef_1.html

note:

Quote

Parameters

target: Object - This parameter can take one of two forms:

A Number that specifies the depth level where the movie clip is to be placed.
An instance name that specifies the movie clip instance whose depth is swapped with the movie clip for which the method is being applied. Both movie clips must have the same parent movie clip.




Here is the AS2 reference, bookmark it:

http://help.adobe.co..._LangRef_1.html
Was This Post Helpful? 0
  • +
  • -

#3 chinchang  Icon User is offline

  • Indie Game Developer
  • member icon

Reputation: 192
  • View blog
  • Posts: 725
  • Joined: 22-December 08

Re: AS2 - I want to put this movie clip behind my text but it isnt working

Posted 11 May 2011 - 02:55 AM

View Postmjrdesign, on 10 May 2011 - 11:00 PM, said:

I tried playing around with the this.switchdepth but it didn't work. Any other suggestions?

This is the first movie clip code - calling out the other movie clip


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


This is the second code


//var text_array:Array = Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "x", "y", "z", "?", "<", ">", "!", "`", "@", "#", "$", "%", "^", "&", "*", "(", ")", "-", "+", "|", "/", "=", "_", ",", "[", "]", "{", "}", ":", ";");
var text_array:Array = Array("0", "1","3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "x", "y", "z");
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-0)];
this._y = random(Stage.height-this._height);
this.speed = random(8)+4;
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(0x00ccff, rand_scale+10, 5, 5, 0.5);
var filterArray:Array = new Array();
filterArray.push(filter);
//
var filter:BlurFilter = new BlurFilter((100-rand_scale)/10, (100-rand_scale)/10);
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;
}

};


Always enclose your code within code tags.

Posted Imageode tags.

This post has been edited by chinchang: 11 May 2011 - 02:56 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1