X-men site

*Originally posted by lostinbeta *
**I just noticed that… and hey!!!

I am not as good at this stuff as people think I am :frowning: I know bits and pieces of code, but putting it all together can sometimes be a problem for me. **

… I just thought I might have seen something youve done before (all which impresses) that was similar. Maybe not. Perhaps in the future?

Now this is a neat effect :slight_smile:

Wonder if I can find some place to use it, hehe… Would make a neat distraction some where on a web site.

*Originally posted by senocular *
**… I just thought I might have seen something youve done before (all which impresses) that was similar. Maybe not. Perhaps in the future? **

Perhaps in the future… now that I know how to do it, I think I can set something up, I am already getting ideas :slight_smile:

lostinbeta:

what do you mean???

Senocular said that he thought he remembered me doing something like this before. Then he realized I didn’t and asked if perhaps I would create something like it in the future. And I said I might and I was getting ideas on what to do with it.

Senocular, that’s a pretty cool effect! If you don’t mind, how would you add easing to the zooming? (I’ve been playing around with your code but I can’t figure it out.)

here ya go :wink:


MovieClip.prototype.makeBox = function(r){ // draw a box
	var clip;
	with(clip = this.createEmptyMovieClip("box"+this.depth, this.depth++)){ // create new clip
		lineStyle(1, 0, 100); // draw the new clip
		moveTo(-r,-r);
		lineTo(r,-r);
		lineTo(r,r);
		lineTo(-r,r);
		lineTo(-r,-r);
	}
	return clip;
}
	
ref = 300; // perspective reference
origin = {x:200, y:200}; // origin of 3d view

for (i=0; i< 10; i++){
	var box = this.makeBox(50); // make box with radius of 50 (100x100)
	box.x = box.y = 0; // all positioned in center of x & y
	box.z = i*100; // space out along z depth
	box.onEnterFrame = function(){ // control its movement, position, scaling etc
		**var dir = Key.isDown(90) - Key.isDown(65); // movement direction in/out movement (a & z keys)
		this.zspeed = Math.min(Math.max(-10, this.zspeed+dir), 10); // prevent speed from going beyond -10 or 10
		this.z += this.zspeed *= .95; // decelerate 95% every frame, add to z position**
		this.x += (origin.x-this._parent._xmouse - this.x)/10; // control left/right movement w/ ease
		this.y += (origin.y-this._parent._ymouse - this.y)/10;
		var prop = ref/(ref+this.z); // proportion based on reference and z positioning
		if (this._visible = (prop < 4)){ // only show if proportion less than 4
			this._x = origin.x + this.x*prop; // position on screen
			this._y = origin.y + this.y*prop;
			this._xscale = this._yscale = this._alpha = 100*prop; // scale and adject alpha for depth
		}
	}
}

Cool! Thanx! :beam:

fluid one or anyon else in this thread, if your willing to part with the fla for that file I would love to grab it. If not I understand and will proceed to spend the next three months translating what you guys wrote hehe.
Andrew

zephn: What do you need a .fla file for? Its purely copy and paste. It uses the drawing API to create the shapes. A .fla file will not help you out any more than the code on the page. And it is advanced, so its hard to understand.

a while back on actionscript.org there was almost the exact same navigation in a downloadable .fla. i just spent about ten minutes looking for it but i cant find it now. perhaps its still there under the “movies” section.

Hi,
That effect is part of the experiments on gravity of Levitated and all of you can find the source code for it in www.levitated.net

SHO

Nice one, Sen :slight_smile:

true I did the copy and past and it worked with the boxes but I don’t know how to alter it to get the line effect that fluidone got with the buttons. I’d rather try and translate one that is further along the road of what i want as an effect.

WOW!!! How did you all who really knows what you are doing with actionscript mastered one? I’m going to programing school next year…