Question About "outer Space" Concept!

Hey Flashers,

I have a question about a concept I’m trying to develop and I was wondering if there was anyone out the who could point me in the right direction. Any help would be greatly appreciated.

What I am trying to do is to create a Flash intro sort of like the opening to a Star Wars movie, except no scrolling text. I want it to appear as though the viewer is floating through space with stars passing by.

Is there a way to create this type of effect in Flash? If so, please write me and let me know how this might be done. Thanks in advance. I’m looking forward to hearing from you.

Thanks,

Kelly:P

umm a starfield backdrop moving from left to right?

for some reason I think what you want isnt as simple as that… can you exaplain it a little better? All a basic SW-like starfield backdrop would be is a space image moving sideways (or vertically) in the background.

I think s/he means it moves inwards, like the windows screensaver…?

or not… just me guessing :slight_smile:

Hey Guys,

The last post is correct - I want the stars to be coming at the viewer just like the windos screen saver. Is there a way to create such an effect in Flash?

Thanks,

Kelly

P.S. I’m a guy…LOL:P

here’s an approach using prototypes.

simple but cute:


reference = 150;
speed = 20;
MovieClip.prototype.asNewStar = function(){
	this.x = random(Stage.width)-Stage.width/2;
	this.y = random(Stage.height)-Stage.height/2;
	this.z = 1000;
	
	this.onEnterFrame = function(){
		if ((this.z -= speed) < -100) this.removeMovieClip();
		else this.drawStar();
	}
}

MovieClip.prototype.drawStar = function(){
	this.clear();
	this.lineStyle(5-this.z/200, 0xffffff, 100);
	perspectiveRatio = reference/(reference + this.z);
	this.moveTo(this.x*perspectiveRatio, this.y*perspectiveRatio);
	perspectiveRatio = reference/(reference + this.z + 20);
	this.lineTo(this.x*perspectiveRatio, this.y*perspectiveRatio);
}

this.createEmptyMovieClip("galaxy",1);
galaxy._x = Stage.width/2
galaxy._y = Stage.height/2;
galaxy.onEnterFrame = function(){
	this.createEmptyMovieClip("star"+ depth, depth++).asNewStar();
}

copy and paste (and make sure the background is set to black :))

[edit]sbeener beat me to the punch ;)[/edit]

nothing says zooming through space like 3d perspective.

i like yours better. : )

Hey Guys,

I just wanted to thank you all for the help. However, I have a problem and can’t seem to get the darn thing to work. When I try to check the code it tells me theres an error on line 26 and I can’t seem to fix it. If anyone can hlep me with this I’d appreciate it.

Thanks,

Kelly