Wow, I feel your pain brother ;-) No one could answer my virtual reality movement question either...
I was working on a parallax code and finally dropped it in favor of a simple on layer "look around" that would include X and Y movement.
here is the source for the single layer if it might help:
code:
//declare once
//more time = slow , minimum is 1
var time = 10;
//locked true/false , toggle movement
var locked = false;
var destX;
var destY;
var frame_w = frame_mc._width;
var frame_h = frame_mc._height;
var image_w = image_mc._width;
var image_h = image_mc._height;
//set event recalculate every mouse move
image_mc.onMouseMove = function() {
//if mouse is inside frame area
if (frame_mc.hitTest(_xmouse, _ymouse, false) && !locked) {
destX = -((image_w-frame_w)*_xmouse/frame_w);
destY = -((image_h-frame_h)*_ymouse/frame_h);
}
updateAfterEvent();
};
//set event keep moving
image_mc.onEnterFrame = function() {
this._x += (destX-this._x)/time;
this._y += (destY-this._y)/time;
};
//example use of toggle
//set event for button , you can take it out if you don't need
lock_btn.onRelease = function() {
locked = true;
};
unlock_btn.onRelease = function() {
locked = false;
};
Here are websites that I found with a bit of parallax help:
------------------------------------------------------
The issue with EVERY parallax movie that is posted on FLASHKIT that does not loop (ie a panorama that just goes round and round) is that if you mouse out and click out of the stage the movie looses its bearings and shows the edges of the parallax with all the ugly layers. Some are better than others, but all will fall apart if you open another browser window...
I know the code is possible as http://narnia.com just stops at the edges of the non looping parallax movies (see Aslan's camp for a good example)
Maybe someone from Disney will post the secret to keeping fly aways in check ;-)
I posted my own thread "Scrolling Navigation Flies Away" to try and deal with this, but it just has the above code.
If you find anything else, Please post it here! I will check back with anything else I find.
Good LUCK!!!!!!
:-D
-Jes
Last edited by jessicacrandall; 11-25-2007 at 06:25 PM.
I'll have a look at that code you posted but, i'm pretty determined to get this parallax thing working! I found this good tutorial on Kirupa --> http://www.kirupa.com/developer/flas..._image_pan.htm and currently trying to manipulate it to work as a parallax scroll. Getting closer...
Familiar with allot of the sites you posted... (last two links broken however). That tutorial on parallax featured in the UK mag "Web Designer" is ideal if it wasn't for the fact it's impossible to get.. back issues out of print. I wrote the mag... no response. Even wrote the author but he couldn't help seeing they owned the rights... this is frustrating!
Anyway...
i know someone out there has the answer!
Please... Share the wealth!
p.s. Jess... only have MX04. Can you save down your FLA for me so i can see?
thanks darlin, your the best!
> j
Last edited by Jason Inch; 02-07-2007 at 12:49 PM.
well you all have hooked another flasher on parallax......I don't have much to contribute to this conversation right now but I'll be keeping my eye on it....hope to collaberate soon
parallax is an effect that fakes depths, in the sense that the objects further seem to move slower that the object in front. when i say slower, i'm talking about half the speed of anything in 'front' of it.
for example, if you take the kirupa example posted by Jason. You can look at this modified code:
where the background is set to move at a speed of 4, houses in front at a speed of 8 (doubled), and people in front of houses at a speed of 16 (doubled again).
Looks like we started ourself a little parallax community here!
gparis!
Thanks for that!
I've been playing around with manipulating this code as well. Added some stop action triggered by buttons. Close, but as you can see... few bugs yet to work out (ie. funky shaking, inconsistent movement?). Not sure what's going on but, doing a search on Kirupa for "image panning" has yielded some pretty good info.
Let me know how you guys are making out with this.
Jess,
Thank you too, good script you have there!
I'm sure this could also be manipulated a bit to get a similar effect.
Well done.
a little closer...
> j
Last edited by Jason Inch; 02-07-2007 at 02:46 PM.
Very clever Mr Bill, but not quite what I was looking for with the X and Y, cuz I want to have the effect of moving your field of vision.
That is an awesome use of imbedding a mc though :-)
Here is my X and Y with out parallax thus far. The room is so small that I might just leave it without... I think that parallax works best with far distance and this set is just a room. (btw this is a cooking Kids TV show, I am the production and set designer so I am getting to show off all my work
yeah, that billy site is something else, music aint bad either!
has some depth of field but not much - note the lil background image...
designed by these guys - http://www.sofake.com/ - creative bastads!
One day i hope to be half as good.
I ended up emailing the www.pspartgallery.com site i admire so to find out there secrects. Holding my breath till i hear back.
i'm feeling a bit dizzy??/.. aiiol a
Last edited by Jason Inch; 02-07-2007 at 06:38 PM.
I ended up with a much wider original mc (850px wide instead of the original 400px.) I adapted your code to work with my original image_mc to control the now overly speedy ratio that would have otherwise occurred.