Yes I do, to tell the pixels where to go to form the letters.
I don’t know how to do it, but I can see how they would be used.
Yes I do, to tell the pixels where to go to form the letters.
I don’t know how to do it, but I can see how they would be used.
OK, I’m getting somewhere. This will draw an “I” if you have a 5*5 square in your library with the linkage name “cell”:
cellSize=5;
letterI=new Array(
[0,1,1,0],
[0,1,1,0],
[0,1,1,0],
[0,1,1,0]);
function displayCell(letter){
var num,i,j,mc;
this.createEmptyMovieClip("container",-1);
for (j=0;j < letter.length;j++){
for (i=0;i < letter[0].length;i++){
if (letter[j]*==1){
mc=container.attachMovie("cell","cell"+num,num);
mc._x=i*cellSize;
mc._y=j*cellSize;
num++;
}
}
}
}
displayCell(letterI);
Then “all” you need to do is define the spinning function.
pom :cowboy:
I hope u guys can figure something out because I’m stumped:-\
Wow, that is pretty awesome. I now know how to make letters with arrays :beam:
I understand your code, I am just going to study it for a while to make sure I fully get it into my head for later use.
Last update:
cellSize=5;
radius=20;
damp=.9;
letterI=new Array(
[0,1,1,0],
[0,1,1,0],
[0,1,1,0],
[0,1,1,0]);
/*****************************************************************
Functions:
- containerRollOver defines the container rollOver
- displayCell takes an array in parameter and draws the letter
- explode makes the dots explode
- spinningAround makes the final spin and return to normal
******************************************************************/
function containerRollOVer(){
delete this.onRollOver;
for (var clip in this) this[clip].explode();
}
function displayCell(letter){
var num,i,j,mc;
this.createEmptyMovieClip("container",-1);
for (j=0;j < letter.length;j++){
for (i=0;i < letter[0].length;i++){
if (letter[j]*==1){
mc=container.attachMovie("cell","cell"+num,num);
mc.i=i;
mc.j=j;
mc._x=i*cellSize;
mc._y=j*cellSize;
// mc.onRollOver=explode;
num++;
}
}
}
this.container.onRollOver=containerRollOver;
}
MovieClip.prototype.explode=function(){
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()-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);
But I don’t know how exactly he made his dots spin But you get the idea.
pom :cowboy:
OH WOW, that is friggin amazing ilyas.
How do you get it to work with more than 1 letter?
Or to work with a string that you define through AS?
Sorry if that is too much…lol, I am learning so much right now, this is great.
I guess you’d have to define all the letters like I did with the I by hand. (see the array? 1 is black, 0 is white).
pom :cowboy:
I figured that, but when I try and draw the other letter, it doesn’t draw. I can only draw one letter at a time :-\
Do I have to define a new displaycell function for all the letters?
PS: I was close to the rotation thing, but it was one of those close but no cigar deals. I could get it to rotate, but with the code I came up with I realized there was no way to get it back to the original spot. At least that I could figure out.
That’s because I create the container clip at the same depth all the time. Change it into an incrementing variable and I think it should work.
Nope :-\ doesn’t seem to work.
omgosh … so over my head
i wish there was a **** school somewhere that could teach you stuff like this.
i guess after i finish this degree i should get another one in comp sci so i can learn to code. maybe then this stuff would make more sense.
its easy for me as a designer to discount the validity of a lot of nifty tricks out there b/c they serve no purpose and honestly aren’t designed that well. but this guy that did the orisinal site and a few other choice designers are the ones that inspire me. they find effective uses and apply good design to nifty code.
sigh i want to learn but i think i’m too thick headed to do it on my own.
pft.
i will figure it out!
ok i’m done shrug back to work
Hrmm, I am suppose I am to duplicate the movie clip “container” and move the new duplicate to a new (x,y)… now to work on that… :-\
I’m starting to understand but it is hard to learn when I don’t have flash at work. This weekend i’m going to try this out though. I think I should do some array tuts first though. I haven’t used one in about 2 years and I need to brush up on them a little.
*Originally posted by lostinbeta *
**Hrmm, I am suppose I am to duplicate the movie clip “container” and move the new duplicate to a new (x,y)… now to work on that… :-\**
Hmmm??
So u guys had never seen that site before? It was easy to find. It is top of the list on google when u search for “flash games”. I would like to know who he is and what he does for a living. That site seems to be a hobby. He doesn’t have any portfolio work there. I would like to see some more web design work form him:-\
Nope, I have never seen it before, and I never looked for flash games in google.
I don’t play too many games online so if I were to I would just go to newgrounds, shockwave, or whatever.
Hrmmm, I can’t seem to get this thing to work for more than 1 letter, so I can make like a word.
*Originally posted by lostinbeta *
**And look at this one…
http://www.ferryhalim.com/orisinal/text/pixels1.htm
It is actually done with tiny images!!! **
what a loser… i mean sure its cool… but how much time does he have on his hands???
Um, some people do this for a living… this might be him.
Also, when you get good enough at it, you can create things like that in like 5-10 minutes.
Who knows if he has been using Flash since like Version 1 and knows everything about it.
I don’t think being able to create such cool things is being a loser, it is having talent.
[edit]if you check out http://www.ferryhalim.com you can see his portfolio, and he does Flash Games for major sites [/edit]
His site says you need the Flash 4 plugin.
:q: i hope you guys figure it out :-\ you would be sooo cool!!
*Originally posted by HCLPfan *
**what a loser… i mean sure its cool… but how much time does he have on his hands??? **
:: Copyright KIRUPA 2024 //--