Groups | Blog | Home
all groups > flash (macromedia) > june 2004 >

flash (macromedia) : Horizontal Gravity and Automatic Scrolling


seb
6/25/2004 3:18:15 PM
i don't know about the "gravity" thing.
For the scrolling by moving the mouse, here are the basics:

You need to create a movieClip with the content you want to scroll.
Let's call this Movie Clip "photo" (instance name).
Then extend the MovieClip timeline acroos three frames. Create another
layer for your actions, with three keyframes:

keyframe 1:

yphoto = 0;
heightmovie = 471; //put here the height of your main flash movie
heightphoto = 820; //height of the scrolling content
scrollspeed = 15; //the higher the number, the slower the scroll speed

keyframe 2:

if (_xmouse > 0) {
ymouse = _ymouse - (heightmovie / 2);
speed = (ymouse) / scrollspeed;
if (speed < 0) {
speed = -(speed);
}
if (ymouse < 0) {
yphoto = yphoto + speed;
}
if (ymouse > 0) {
yphoto = yphoto - speed;
}

if (yphoto > 0) {
yphoto = 0;
}
if (yphoto < -(heightphoto - heightmovie)) {
yphoto = -(heightphoto - heightmovie);
}
setProperty("photo", _y, yphoto);
}

keyframe 3:

gotoAndPlay(1);




[quoted text, click to view]
seb
6/25/2004 5:16:21 PM


[quoted text, click to view]

in this layer, it should be two more frames, not keyframes.

Then, i added another layer, actions, and put 3 keyframes on
[quoted text, click to view]

I made a mistake:
in keyframe 3, you should have

gotoAndPlay(2);

not gotoAndPlay(1);

[quoted text, click to view]

The mask is not necessary for the code to work, but yes, you should have
a mask in your main timeline, masking the area of your "grey bar" that
you want to be visible.

Then, the targets in my code example *assume* that your movie is
structured this way:

Main timeline:
a Mask Layer with the "grey bar movie" underneath it, in one frame.
grey bar movie instance name: "photo"

In the grey bar movie timeline:

3 keyframes for the code in top layer,
3 *frames* for the grey bar movie.

I also assume that your animations are MovieClips that are IN the grey
bar MovieClip. right?...

Maybe if you can zip your flash file and upload it on a server and give
me the URL, I can take a look at it.


[quoted text, click to view]
soccerbeanie21
6/25/2004 6:39:09 PM
Two things

1. Check out how the drop down menus allow you to scroll by just moving your
mouse.
They're using a mask, but how does it continually cycle. Is there a place
where i can find a tutorial on this?

2. How, on the preloader, do they get the preloader bar to use some kind of
"horizontal gravity"?

Is there a place where i can find a tutorial on this?


Here's the website http://www.panasonic-europe.com/home.aspx

soccerbeanie
soccerbeanie21
6/25/2004 8:59:43 PM
I don't think i'm doing it right.
I have a movie which drops down when you scroll over a grey bar. The movie
contains 3 white boxes with animation inside of them, but i only want 2 of them
to show at a time, unless you move your mouse up or down some. Just like the
website.

Instead of having one frame for my "grey movie bar" i added two more keyframes
like you said. Then, i added another layer, actions, and put 3 keyframes on
top of the 3 keyframes from the movie layer. It didn't really do anything.

Do i have to use a mask to get that effect?
Here's the website again.
http://panasoniceurope.com

Thanks for helping me out!
soccerbeanie
soccerbeanie21
6/26/2004 4:54:28 PM
Sounds good.
My current website is http://www.sbcyouth.org
When the page is done loading, look up into the top right corner. You'll see
something like "click here". Click on it to download the project. It's about
1.4 megs. When you open up the project scroll over upcoming events. I want
the top box to scroll down, just like that website.
Thanks for your help.
soccerbeanie
AddThis Social Bookmark Button