Pixel random move question

Hello guys, i am trying to make a so called pixel effect in witch I want to make a shape only from pixels that are positioned in some random place on the stage. And all these pixels move to a certain point and create that shape.

I now this is a long shot for a newbe like me but i’m willing to learn.

So could somebody give me some clue on how to begin this. I’ve been looking into BitmapData Class but i don’t now if that is the best way to do it.

:ear:

There is more than one way to do this of course. Here’s one way. It’s inspired by (although not identical to) Hack #2 in Sham Bhangal’s Flash Hacks, which you might want to check out if you can get a hold of it.

[AS]function move() {
this._x += (-this._x+this.x)/this.speed;
this._y += (-this._y+this.y)/this.speed;
if (Math.abs(this._x - this.x)<.5 && Math.abs(this._y - this.y)<.5) {
delete (this.onEnterFrame);
}
}
pixelnum=0;
for (i=shape._x; i<shape._x+shape._width; i++) {
for (j=shape._y; j<shape._y+shape._height; j++) {
if (shape.hitTest(i, j, true)) {
clip = _root.attachMovie(“pixel”, “pixel”+pixelnum, pixelnum);
clip.x = i;
clip.y = j;
clip.speed = (Math.random()*2)+2;
clip._x = Math.random()*Stage.width;
clip._y = Math.random()*Stage.height;
pixelnum++
}
}
}
launcher = 0;
queue = setInterval(launch, 5);
function launch(){
_root[“pixel”+launcher].onEnterFrame = move;
launcher++;
if (launcher == pixelnum){
clearInterval(queue);
}
}[/AS]

thanks man! this will give me a head start !:smiley: