Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Some help please guys.... 2

Status
Not open for further replies.

coldfused

Technical User
Jan 27, 2001
2,442
US
Guys I have a effect I'm trying to work with in this file:


The picture in the file is 39 k, with the effect, which is just a bunch of tweening squares, it goes up to 141 k.

I was wondering if one of you math guru's could help me out with a script that will take that single square and duplicate it across the board, then tween it out with the effect that I have. Hopefully taking that file size down way below that 141.

The fla is:


If someone has time, and could help, I would appreciate it. Any way I could be of help to that person in return, I would more than gladly return the favor.

Thanks in advance.


csatterwhite@orlandomediasolutions.com
 
Hey Carl, how you doing?

I've mailed a 40k version of the effect to you.
 
Hi Wangbar!

How is it possible to do this effect within 1K?


@ Virt: would you mind showing me the fla, please?

regards

tektips.gif
 
Quick'n'dirty but here's the code in the fla:

Code:
function placeSquares(horizontal, vertical, fadeout) {
	//set up grid
	for (var i = 0; i<horizontal; i++) {
		for (var j = 0; j<vertical; j++) {
			count++;
			this.attachMovie('square', 'square'+count, count);
			clip = this['square'+count];
			//position clips
			clip._x = i*clip._width;
			clip._y = j*clip._height;
			//set time to start  each clip fading out
			clip.delay = getTimer()+count*fadeout;
		}
	}
	return count;
}
//
function fadeSquares(total, fadespeed) {
	for (var i = 0; i<=total; i++) {
		clip = this['square'+i];
		if (clip.delay<getTimer()) {
			clip._alpha -= fadespeed;
		}
		if (i == total && clip._alpha<=0) {
			//finished, so clear the fade function
			this.onEnterFrame = null;
		}
	}
}
//create grid
horizontal = 19;
vertical = 5;
fadeout = 30;
fadespeed = 10;
total = placeSquares(horizontal, vertical, fadeout);
//do fading
this.onEnterFrame = function() {
	fadeSquares(total, fadespeed);
};
 
Ewan I sent you mail to say thanks, but once again thank you, your the best.

Firegambler just place that code on the first frame of your movie. make a mc and call it &quot;square&quot;.

The script pulls the &quot;square&quot; mc from the library, attaches it, duplicates and tweens it out. Works in Mx.

All in 1 k. Movie went from 141 to 40.

Beautiful,

Thanks again Ewan!


csatterwhite@orlandomediasolutions.com
 
Carl would you mind putting those links back at work pls? ;-)

Regards,
Dragos.


 
Unfortunately bubu I have already re-worked that fla with ewan's fix. You can however see the effect that it produces, the site is not finished, and I am still working on the flash for the header graphic, but you can see the unfinished version here:



csatterwhite@orlandomediasolutions.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top