Tutorials on how to achive the following effects?

You have to give it a different name too. And each letter should have it’s own time reference. Check this out:

cellSize=5;
radius=20;
damp=.9;
numLetter=0;
letterSpacing=30;

letterI=new Array(
				  [0,1,0,0],
				  [0,1,0,0],
				  [0,1,0,0],
				  [0,1,0,0]);
letterL=new Array(
				  [1,0,0,0],
				  [1,0,0,0],
				  [1,0,0,0],
				  [1,1,1,1]);
letterY=new Array(
				  [1,0,0,1],
				  [1,1,1,1],
				  [0,0,0,1],
				  [0,0,0,1]);
letterA=new Array(
				  [1,1,1,1],
				  [1,0,0,1],
				  [1,1,1,1],
				  [1,0,0,1]);
letterS=new Array(
				  [1,1,1,1],
				  [0,1,0,0],
				  [0,0,1,0],
				  [1,1,1,1]);

function containerRollOVer(){
	delete this.onRollOver;
	for (var clip in this) this[clip].explode();
}

function displayCell(letter){
	var num,i,j,mc;
	clip=this.createEmptyMovieClip("container"+numLetter,numLetter++);
	clip._x=numLetter*letterSpacing;
	for (j=0;j < letter.length;j++){
		for (i=0;i < letter[0].length;i++){
			if (letter[j]*==1){
				mc=clip.attachMovie("cell","cell"+num,num);
				mc.i=i;
				mc.j=j;
				mc._x=i*cellSize;
				mc._y=j*cellSize;
//				mc.onRollOver=explode;
				num++;
			}
		}
	}
	this.clip.onRollOver=containerRollOver;
}

MovieClip.prototype.explode=function(){
	this.start=getTimer();
	this.vx=(Math.random()-.5)*radius;
	this.vy=(Math.random()-.5)*radius;
	this.onEnterFrame=function(){
		this._x+=this.vx;
		this._y+=this.vy;
		this.vx*=damp;
		this.vy*=damp;
		if (getTimer()-this.start > 2000 ) this.onEnterFrame=spinningAround;
//		if (this.vx < .1 && this.vy < .1) delete this.onEnterFrame;
	}
}

function spinningAround(){
	var diffx=this._x-this.i*cellSize;
	var diffy=this._y-this.j*cellSize;
	this._x-=diffx/7;
	this._y-=diffy/7;
	if (Math.abs(diffx)+Math.abs(diffy) < .1){
		this._x=this.i*cellSize;
		this._y=this.j*cellSize;
		this._parent.onRollOver=containerRollOver;
	}
}

displayCell(letterI);
displayCell(letterL);
displayCell(letterY);
displayCell(letterA);
displayCell(letterS);

A bit long…

pom :cowboy:

Ah fudge, so simple, why couldn’t I figure that out?

::sigh:: :frowning:

Hey Ilyas, you are incredible. You mentioned taking exams, what do you go to school for? Are you learning this in school? If not, how the hell did you get so friggin good? :slight_smile:

fix it lost … fix it !
http://www.kirupaforum.com/showthread.php?s=&threadid=8347

I wished there were Flash exams :stuck_out_tongue: I’d probably do better than what I did today :-\ Pretty much screwed up everything… :frowning: Well, never mind, that was the most difficult of my subjects (multimedia networking).

And I’ll tell you my secret: I read a lot of codes, and I structure my code. Object-oriented programming is a pain in the butt, but at least you learn good coding practices.

I mean, what I did is not THAT complicated, as you said. The thing is that you have to keep track of what you want to do, and build the corresponding functions.

function displayCell(letter){
  // That one will build the letter
  // When the letter is created, define onRollOver
}

function containerRollOver(){
  // my letter explodes
  // After some time, they come back -> function spinningAround
}

function spinningAround(){
  // goes back home
  // resets rollOver (easy because it's just a function call)
}

And that’s it. that’s how I start my program. Then I build each function, little by little.

Of course, you have to decide that you are going to use arrays to describe the letter shape first… but tadaaa!! here’s the idea behind the code.

pom :slight_smile:

Hey Ilyas, I understood your code clearly from the beginning.

What I am wondering is how you can pull code do that out of the air like that. It took me like a week to get my very own random motion thing working (and then I found sbeeners tutorial… pff), but you did this incredible effect in like 10 minutes…lol. As if it were nothing at all.

What I really need to do is get some friggin money and buy myself some books to learn from. I am planning on getting the Moock book and some FOE books later on.

Well, this surely didn’t come from books, Lost… I tell you, read flas of people you know can code, and you’ll be just fine. I don’t want to polish his shoes or anything, but Bit codes VERY well. Very clearly. Read his files and you’ll learn all this in no time.

pom :cowboy:

That is how I learn now.

How long have you been doing this Ilyas? I think you told me before, but I don’t remember.

If you have been doing it for a while, that definitely explains a lot.

I scoped out some of bits files, never did that before…

You are right, his code is clean, organized, and easy to understand. Thanks for the tip-off :slight_smile:

Here are two examples I came up with the current text effect at hand (please note the second one is a hack, I cheated a bit on that one, but at least it works)…

Effect 1 (standard)
Effect 2 (rotate)

Nice :slight_smile:

Ya ilyas. How long have u been codeing. I meen I can read and understand everything you have written there but I can’t just write anything from scratch. I’ve taken a year of OOP and I still can’t code like that. You really have some skills.

Hey beta great job on the FLA. I wanted to do it while u guys where but work eats up so much time. I plan on building one of my own this weekend. I guess I’l see what I can come up with. Does bit have open code on his site? All I saw when I was there where the SWF’s.

Hey HCLPfan. I hope that was sarcaism when u called this guy a loser. We lower level guys could only hope to one day have skills like he does. When I said it looks like he does this for a hobby that was a complement. When someone can build something like this in there spare time it is amazing to think what they do for a living. We should show these guys some respect because they are the people who are going to help u become better.

Well, if you really want to know, I’ve started with algorithmic stuff and C language 2 years and a half ago. Then last year I had C++ and Java classes and I started Flash. This year, I had some more C++ and Java classes. :-\ Nothing amazing.

pom :slight_smile:

Hmmm… That would do a cool footer for the contest, don’t you think? :beam: :beam:

Ya it would. I’m going to try a simple version of that code then try something a little differnt. When is the footer contest anyway. I want to make sure I have some ready for it.

I under stand the code I think but how do you use it. DO you pput it in the first fram or on a MC or what?:-\

You put it in the first frame of the main timeline.

Hey Ilyas, that is a lot of programming language knowledge, no wonder this comes so simple to you. I know a bit of Javascript and DHTML, and that is why I understand a lot of this… DHTML is a pain to learn though, it looks almost exactly like AS, but it is much harder to incorporate considering it is done on an HTML page and not in an animation.

I have a js exam tomorrow… Better start learning about it :-\

But it’s not only js, fortunately (or unfortunately, we’ll see).

I wish you much luck on that?

I don’t know <B>too</B> much js, but if you ever need help, I can try and help you out.

I appreciate the offer but it’s 1:40 am and my exam is tomorrow morning :stuck_out_tongue:

Well then any other time :stuck_out_tongue:

And you better get some sleep dude, if your test is actually this morning (according to your time).

It is 12:45 PM here.

I can’t wait to try this code out this weekend. I really hope to get a chance to.